pgpool-II-4.1.4/0000775000175000017500000000000013730351012010315 500000000000000pgpool-II-4.1.4/m4/0000775000175000017500000000000013730350746010652 500000000000000pgpool-II-4.1.4/m4/docbook.m40000664000175000017500000000556713730350075012464 00000000000000# config/docbook.m4 # PGAC_PROG_JADE # -------------- AC_DEFUN([PGAC_PROG_JADE], [AC_CHECK_PROGS([JADE], [openjade jade])]) # PGAC_PROG_NSGMLS # ---------------- AC_DEFUN([PGAC_PROG_NSGMLS], [AC_CHECK_PROGS([NSGMLS], [onsgmls nsgmls])]) # PGAC_CHECK_DOCBOOK(VERSION) # --------------------------- AC_DEFUN([PGAC_CHECK_DOCBOOK], [AC_REQUIRE([PGAC_PROG_NSGMLS]) AC_CACHE_CHECK([for DocBook V$1], [pgac_cv_check_docbook], [cat >conftest.sgml < test random testsect text EOF pgac_cv_check_docbook=no if test -n "$NSGMLS"; then $NSGMLS -s conftest.sgml 1>&AS_MESSAGE_LOG_FD 2>&1 if test $? -eq 0; then pgac_cv_check_docbook=yes fi fi rm -f conftest.sgml]) have_docbook=$pgac_cv_check_docbook AM_CONDITIONAL(can_build_docs, test "$pgac_cv_check_docbook" = "yes") AC_SUBST([have_docbook]) ])# PGAC_CHECK_DOCBOOK # PGAC_PATH_DOCBOOK_STYLESHEETS # ----------------------------- AC_DEFUN([PGAC_PATH_DOCBOOK_STYLESHEETS], [AC_ARG_VAR(DOCBOOKSTYLE, [location of DocBook stylesheets])dnl AC_MSG_CHECKING([for DocBook stylesheets]) AC_CACHE_VAL([pgac_cv_path_stylesheets], [if test -n "$DOCBOOKSTYLE"; then pgac_cv_path_stylesheets=$DOCBOOKSTYLE else for pgac_prefix in /usr /usr/local /opt /sw; do for pgac_infix in share lib; do for pgac_postfix in \ sgml/stylesheets/nwalsh-modular \ sgml/stylesheets/docbook \ sgml/stylesheets/dsssl/docbook \ sgml/docbook-dsssl \ sgml/docbook/dsssl/modular \ sgml/docbook/stylesheet/dsssl/modular \ sgml/docbook/dsssl-stylesheets \ sgml/dsssl/docbook-dsssl-nwalsh do pgac_candidate=$pgac_prefix/$pgac_infix/$pgac_postfix if test -r "$pgac_candidate/html/docbook.dsl" \ && test -r "$pgac_candidate/print/docbook.dsl" then pgac_cv_path_stylesheets=$pgac_candidate break 3 fi done done done fi]) DOCBOOKSTYLE=$pgac_cv_path_stylesheets AC_SUBST([DOCBOOKSTYLE]) if test -n "$DOCBOOKSTYLE"; then AC_MSG_RESULT([$DOCBOOKSTYLE]) CATALOG="-c ${DOCBOOKSTYLE}/catalog" else AC_MSG_RESULT(no) CATALOG= fi AC_SUBST([CATALOG]) ])# PGAC_PATH_DOCBOOK_STYLESHEETS # PGAC_PATH_COLLATEINDEX # ---------------------- # Some DocBook installations provide collateindex.pl in $DOCBOOKSTYLE/bin, # but it's not necessarily marked executable, so we can't use AC_PATH_PROG # to check for it there. Other installations just put it in the PATH. AC_DEFUN([PGAC_PATH_COLLATEINDEX], [AC_REQUIRE([PGAC_PATH_DOCBOOK_STYLESHEETS])dnl if test -n "$DOCBOOKSTYLE" -a -r "$DOCBOOKSTYLE/bin/collateindex.pl"; then COLLATEINDEX="$DOCBOOKSTYLE/bin/collateindex.pl" AC_SUBST([COLLATEINDEX]) else AC_PATH_PROG(COLLATEINDEX, collateindex.pl) fi])# PGAC_PATH_COLLATEINDEX pgpool-II-4.1.4/m4/libtool.m40000664000175000017500000106043413730350075012503 00000000000000# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- # # 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 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. m4_define([_LT_COPYING], [dnl # 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. ]) # serial 57 LT_INIT # LT_PREREQ(VERSION) # ------------------ # Complain and exit if this libtool version is less that VERSION. m4_defun([LT_PREREQ], [m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1, [m4_default([$3], [m4_fatal([Libtool version $1 or higher is required], 63)])], [$2])]) # _LT_CHECK_BUILDDIR # ------------------ # Complain if the absolute build directory name contains unusual characters m4_defun([_LT_CHECK_BUILDDIR], [case `pwd` in *\ * | *\ *) AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;; esac ]) # LT_INIT([OPTIONS]) # ------------------ AC_DEFUN([LT_INIT], [AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl AC_BEFORE([$0], [LT_LANG])dnl AC_BEFORE([$0], [LT_OUTPUT])dnl AC_BEFORE([$0], [LTDL_INIT])dnl m4_require([_LT_CHECK_BUILDDIR])dnl dnl Autoconf doesn't catch unexpanded LT_ macros by default: m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4 dnl unless we require an AC_DEFUNed macro: AC_REQUIRE([LTOPTIONS_VERSION])dnl AC_REQUIRE([LTSUGAR_VERSION])dnl AC_REQUIRE([LTVERSION_VERSION])dnl AC_REQUIRE([LTOBSOLETE_VERSION])dnl m4_require([_LT_PROG_LTMAIN])dnl _LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}]) dnl Parse OPTIONS _LT_SET_OPTIONS([$0], [$1]) # This can be used to rebuild libtool when needed LIBTOOL_DEPS="$ltmain" # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' AC_SUBST(LIBTOOL)dnl _LT_SETUP # Only expand once: m4_define([LT_INIT]) ])# LT_INIT # Old names: AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT]) AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_PROG_LIBTOOL], []) dnl AC_DEFUN([AM_PROG_LIBTOOL], []) # _LT_CC_BASENAME(CC) # ------------------- # Calculate cc_basename. Skip known compiler wrappers and cross-prefix. m4_defun([_LT_CC_BASENAME], [for cc_temp in $1""; 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-%%"` ]) # _LT_FILEUTILS_DEFAULTS # ---------------------- # It is okay to use these file commands and assume they have been set # sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'. m4_defun([_LT_FILEUTILS_DEFAULTS], [: ${CP="cp -f"} : ${MV="mv -f"} : ${RM="rm -f"} ])# _LT_FILEUTILS_DEFAULTS # _LT_SETUP # --------- m4_defun([_LT_SETUP], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl AC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl _LT_DECL([], [PATH_SEPARATOR], [1], [The PATH separator for the build system])dnl dnl _LT_DECL([], [host_alias], [0], [The host system])dnl _LT_DECL([], [host], [0])dnl _LT_DECL([], [host_os], [0])dnl dnl _LT_DECL([], [build_alias], [0], [The build system])dnl _LT_DECL([], [build], [0])dnl _LT_DECL([], [build_os], [0])dnl dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([LT_PATH_LD])dnl AC_REQUIRE([LT_PATH_NM])dnl dnl AC_REQUIRE([AC_PROG_LN_S])dnl test -z "$LN_S" && LN_S="ln -s" _LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl dnl AC_REQUIRE([LT_CMD_MAX_LEN])dnl _LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl _LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_CHECK_SHELL_FEATURES])dnl m4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl m4_require([_LT_CMD_RELOAD])dnl m4_require([_LT_CHECK_MAGIC_METHOD])dnl m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl m4_require([_LT_CMD_OLD_ARCHIVE])dnl m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl m4_require([_LT_WITH_SYSROOT])dnl _LT_CONFIG_LIBTOOL_INIT([ # 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 ]) if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi _LT_CHECK_OBJDIR m4_require([_LT_TAG_COMPILER])dnl 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 _LT_CC_BASENAME([$compiler]) # 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 _LT_PATH_MAGIC fi ;; esac # Use C for the default configuration in the libtool script LT_SUPPORTED_TAG([CC]) _LT_LANG_C_CONFIG _LT_LANG_DEFAULT_CONFIG _LT_CONFIG_COMMANDS ])# _LT_SETUP # _LT_PREPARE_SED_QUOTE_VARS # -------------------------- # Define a few sed substitution that help us do robust quoting. m4_defun([_LT_PREPARE_SED_QUOTE_VARS], [# 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' ]) # _LT_PROG_LTMAIN # --------------- # Note that this code is called both from `configure', and `config.status' # now that we use AC_CONFIG_COMMANDS to generate libtool. Notably, # `config.status' has no value for ac_aux_dir unless we are using Automake, # so we pass a copy along to make sure it has a sensible value anyway. m4_defun([_LT_PROG_LTMAIN], [m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl _LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir']) ltmain="$ac_aux_dir/ltmain.sh" ])# _LT_PROG_LTMAIN ## ------------------------------------- ## ## Accumulate code for creating libtool. ## ## ------------------------------------- ## # So that we can recreate a full libtool script including additional # tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS # in macros and then make a single call at the end using the `libtool' # label. # _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS]) # ---------------------------------------- # Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later. m4_define([_LT_CONFIG_LIBTOOL_INIT], [m4_ifval([$1], [m4_append([_LT_OUTPUT_LIBTOOL_INIT], [$1 ])])]) # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_INIT]) # _LT_CONFIG_LIBTOOL([COMMANDS]) # ------------------------------ # Register COMMANDS to be passed to AC_CONFIG_COMMANDS later. m4_define([_LT_CONFIG_LIBTOOL], [m4_ifval([$1], [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS], [$1 ])])]) # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS]) # _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS]) # ----------------------------------------------------- m4_defun([_LT_CONFIG_SAVE_COMMANDS], [_LT_CONFIG_LIBTOOL([$1]) _LT_CONFIG_LIBTOOL_INIT([$2]) ]) # _LT_FORMAT_COMMENT([COMMENT]) # ----------------------------- # Add leading comment marks to the start of each line, and a trailing # full-stop to the whole comment if one is not present already. m4_define([_LT_FORMAT_COMMENT], [m4_ifval([$1], [ m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])], [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.]) )]) ## ------------------------ ## ## FIXME: Eliminate VARNAME ## ## ------------------------ ## # _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?]) # ------------------------------------------------------------------- # CONFIGNAME is the name given to the value in the libtool script. # VARNAME is the (base) name used in the configure script. # VALUE may be 0, 1 or 2 for a computed quote escaped value based on # VARNAME. Any other value will be used directly. m4_define([_LT_DECL], [lt_if_append_uniq([lt_decl_varnames], [$2], [, ], [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name], [m4_ifval([$1], [$1], [$2])]) lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3]) m4_ifval([$4], [lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])]) lt_dict_add_subkey([lt_decl_dict], [$2], [tagged?], [m4_ifval([$5], [yes], [no])])]) ]) # _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION]) # -------------------------------------------------------- m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])]) # lt_decl_tag_varnames([SEPARATOR], [VARNAME1...]) # ------------------------------------------------ m4_define([lt_decl_tag_varnames], [_lt_decl_filter([tagged?], [yes], $@)]) # _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..]) # --------------------------------------------------------- m4_define([_lt_decl_filter], [m4_case([$#], [0], [m4_fatal([$0: too few arguments: $#])], [1], [m4_fatal([$0: too few arguments: $#: $1])], [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)], [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)], [lt_dict_filter([lt_decl_dict], $@)])[]dnl ]) # lt_decl_quote_varnames([SEPARATOR], [VARNAME1...]) # -------------------------------------------------- m4_define([lt_decl_quote_varnames], [_lt_decl_filter([value], [1], $@)]) # lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...]) # --------------------------------------------------- m4_define([lt_decl_dquote_varnames], [_lt_decl_filter([value], [2], $@)]) # lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...]) # --------------------------------------------------- m4_define([lt_decl_varnames_tagged], [m4_assert([$# <= 2])dnl _$0(m4_quote(m4_default([$1], [[, ]])), m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]), m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))]) m4_define([_lt_decl_varnames_tagged], [m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])]) # lt_decl_all_varnames([SEPARATOR], [VARNAME1...]) # ------------------------------------------------ m4_define([lt_decl_all_varnames], [_$0(m4_quote(m4_default([$1], [[, ]])), m4_if([$2], [], m4_quote(lt_decl_varnames), m4_quote(m4_shift($@))))[]dnl ]) m4_define([_lt_decl_all_varnames], [lt_join($@, lt_decl_varnames_tagged([$1], lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl ]) # _LT_CONFIG_STATUS_DECLARE([VARNAME]) # ------------------------------------ # Quote a variable value, and forward it to `config.status' so that its # declaration there will have the same value as in `configure'. VARNAME # must have a single quote delimited value for this to work. m4_define([_LT_CONFIG_STATUS_DECLARE], [$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`']) # _LT_CONFIG_STATUS_DECLARATIONS # ------------------------------ # We delimit libtool config variables with single quotes, so when # we write them to config.status, we have to be sure to quote all # embedded single quotes properly. In configure, this macro expands # each variable declared with _LT_DECL (and _LT_TAGDECL) into: # # ='`$ECHO "$" | $SED "$delay_single_quote_subst"`' m4_defun([_LT_CONFIG_STATUS_DECLARATIONS], [m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames), [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])]) # _LT_LIBTOOL_TAGS # ---------------- # Output comment and list of tags supported by the script m4_defun([_LT_LIBTOOL_TAGS], [_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl available_tags="_LT_TAGS"dnl ]) # _LT_LIBTOOL_DECLARE(VARNAME, [TAG]) # ----------------------------------- # Extract the dictionary values for VARNAME (optionally with TAG) and # expand to a commented shell variable setting: # # # Some comment about what VAR is for. # visible_name=$lt_internal_name m4_define([_LT_LIBTOOL_DECLARE], [_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [description])))[]dnl m4_pushdef([_libtool_name], m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])), [0], [_libtool_name=[$]$1], [1], [_libtool_name=$lt_[]$1], [2], [_libtool_name=$lt_[]$1], [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl ]) # _LT_LIBTOOL_CONFIG_VARS # ----------------------- # Produce commented declarations of non-tagged libtool config variables # suitable for insertion in the LIBTOOL CONFIG section of the `libtool' # script. Tagged libtool config variables (even for the LIBTOOL CONFIG # section) are produced by _LT_LIBTOOL_TAG_VARS. m4_defun([_LT_LIBTOOL_CONFIG_VARS], [m4_foreach([_lt_var], m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)), [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])]) # _LT_LIBTOOL_TAG_VARS(TAG) # ------------------------- m4_define([_LT_LIBTOOL_TAG_VARS], [m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames), [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])]) # _LT_TAGVAR(VARNAME, [TAGNAME]) # ------------------------------ m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])]) # _LT_CONFIG_COMMANDS # ------------------- # Send accumulated output to $CONFIG_STATUS. Thanks to the lists of # variables for single and double quote escaping we saved from calls # to _LT_DECL, we can put quote escaped variables declarations # into `config.status', and then the shell code to quote escape them in # for loops in `config.status'. Finally, any additional code accumulated # from calls to _LT_CONFIG_LIBTOOL_INIT is expanded. m4_defun([_LT_CONFIG_COMMANDS], [AC_PROVIDE_IFELSE([LT_OUTPUT], dnl If the libtool generation code has been placed in $CONFIG_LT, dnl instead of duplicating it all over again into config.status, dnl then we will have config.status run $CONFIG_LT later, so it dnl needs to know what name is stored there: [AC_CONFIG_COMMANDS([libtool], [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])], dnl If the libtool generation code is destined for config.status, dnl expand the accumulated commands and init code now: [AC_CONFIG_COMMANDS([libtool], [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])]) ])#_LT_CONFIG_COMMANDS # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT], [ # 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' _LT_CONFIG_STATUS_DECLARATIONS 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 lt_decl_all_varnames([[ \ ]], lt_decl_quote_varnames); 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 lt_decl_all_varnames([[ \ ]], lt_decl_dquote_varnames); 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 _LT_OUTPUT_LIBTOOL_INIT ]) # _LT_GENERATED_FILE_INIT(FILE, [COMMENT]) # ------------------------------------ # Generate a child script FILE with all initialization necessary to # reuse the environment learned by the parent script, and make the # file executable. If COMMENT is supplied, it is inserted after the # `#!' sequence but before initialization text begins. After this # macro, additional text can be appended to FILE to form the body of # the child script. The macro ends with non-zero status if the # file could not be fully written (such as if the disk is full). m4_ifdef([AS_INIT_GENERATED], [m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])], [m4_defun([_LT_GENERATED_FILE_INIT], [m4_require([AS_PREPARE])]dnl [m4_pushdef([AS_MESSAGE_LOG_FD])]dnl [lt_write_fail=0 cat >$1 <<_ASEOF || lt_write_fail=1 #! $SHELL # Generated by $as_me. $2 SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$1 <<\_ASEOF || lt_write_fail=1 AS_SHELL_SANITIZE _AS_PREPARE exec AS_MESSAGE_FD>&1 _ASEOF test $lt_write_fail = 0 && chmod +x $1[]dnl m4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT # LT_OUTPUT # --------- # This macro allows early generation of the libtool script (before # AC_OUTPUT is called), incase it is used in configure for compilation # tests. AC_DEFUN([LT_OUTPUT], [: ${CONFIG_LT=./config.lt} AC_MSG_NOTICE([creating $CONFIG_LT]) _LT_GENERATED_FILE_INIT(["$CONFIG_LT"], [# Run this file to recreate a libtool stub with the current configuration.]) cat >>"$CONFIG_LT" <<\_LTEOF lt_cl_silent=false exec AS_MESSAGE_LOG_FD>>config.log { echo AS_BOX([Running $as_me.]) } >&AS_MESSAGE_LOG_FD lt_cl_help="\ \`$as_me' creates a local libtool stub from the current configuration, for use in further configure time tests before the real libtool is generated. Usage: $[0] [[OPTIONS]] -h, --help print this help, then exit -V, --version print version number, then exit -q, --quiet do not print progress messages -d, --debug don't remove temporary files Report bugs to ." lt_cl_version="\ m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION]) configured by $[0], generated by m4_PACKAGE_STRING. Copyright (C) 2011 Free Software Foundation, Inc. This config.lt script is free software; the Free Software Foundation gives unlimited permision to copy, distribute and modify it." while test $[#] != 0 do case $[1] in --version | --v* | -V ) echo "$lt_cl_version"; exit 0 ;; --help | --h* | -h ) echo "$lt_cl_help"; exit 0 ;; --debug | --d* | -d ) debug=: ;; --quiet | --q* | --silent | --s* | -q ) lt_cl_silent=: ;; -*) AC_MSG_ERROR([unrecognized option: $[1] Try \`$[0] --help' for more information.]) ;; *) AC_MSG_ERROR([unrecognized argument: $[1] Try \`$[0] --help' for more information.]) ;; esac shift done if $lt_cl_silent; then exec AS_MESSAGE_FD>/dev/null fi _LTEOF cat >>"$CONFIG_LT" <<_LTEOF _LT_OUTPUT_LIBTOOL_COMMANDS_INIT _LTEOF cat >>"$CONFIG_LT" <<\_LTEOF AC_MSG_NOTICE([creating $ofile]) _LT_OUTPUT_LIBTOOL_COMMANDS AS_EXIT(0) _LTEOF chmod +x "$CONFIG_LT" # configure is writing to config.log, but config.lt does its own redirection, # appending to config.log, which fails on DOS, as config.log is still kept # open by configure. Here we exec the FD to /dev/null, effectively closing # config.log, so it can be properly (re)opened and appended to by config.lt. lt_cl_success=: test "$silent" = yes && lt_config_lt_args="$lt_config_lt_args --quiet" exec AS_MESSAGE_LOG_FD>/dev/null $SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false exec AS_MESSAGE_LOG_FD>>config.log $lt_cl_success || AS_EXIT(1) ])# LT_OUTPUT # _LT_CONFIG(TAG) # --------------- # If TAG is the built-in tag, create an initial libtool script with a # default configuration from the untagged config vars. Otherwise add code # to config.status for appending the configuration named by TAG from the # matching tagged config vars. m4_defun([_LT_CONFIG], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl _LT_CONFIG_SAVE_COMMANDS([ m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl m4_if(_LT_TAG, [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. # _LT_COPYING _LT_LIBTOOL_TAGS # ### BEGIN LIBTOOL CONFIG _LT_LIBTOOL_CONFIG_VARS _LT_LIBTOOL_TAG_VARS # ### 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 _LT_PROG_LTMAIN # 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) _LT_PROG_REPLACE_SHELLFNS mv -f "$cfgfile" "$ofile" || (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" ], [cat <<_LT_EOF >> "$ofile" dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded dnl in a comment (ie after a #). # ### BEGIN LIBTOOL TAG CONFIG: $1 _LT_LIBTOOL_TAG_VARS(_LT_TAG) # ### END LIBTOOL TAG CONFIG: $1 _LT_EOF ])dnl /m4_if ], [m4_if([$1], [], [ PACKAGE='$PACKAGE' VERSION='$VERSION' TIMESTAMP='$TIMESTAMP' RM='$RM' ofile='$ofile'], []) ])dnl /_LT_CONFIG_SAVE_COMMANDS ])# _LT_CONFIG # LT_SUPPORTED_TAG(TAG) # --------------------- # Trace this macro to discover what tags are supported by the libtool # --tag option, using: # autoconf --trace 'LT_SUPPORTED_TAG:$1' AC_DEFUN([LT_SUPPORTED_TAG], []) # C support is built-in for now m4_define([_LT_LANG_C_enabled], []) m4_define([_LT_TAGS], []) # LT_LANG(LANG) # ------------- # Enable libtool support for the given language if not already enabled. AC_DEFUN([LT_LANG], [AC_BEFORE([$0], [LT_OUTPUT])dnl m4_case([$1], [C], [_LT_LANG(C)], [C++], [_LT_LANG(CXX)], [Go], [_LT_LANG(GO)], [Java], [_LT_LANG(GCJ)], [Fortran 77], [_LT_LANG(F77)], [Fortran], [_LT_LANG(FC)], [Windows Resource], [_LT_LANG(RC)], [m4_ifdef([_LT_LANG_]$1[_CONFIG], [_LT_LANG($1)], [m4_fatal([$0: unsupported language: "$1"])])])dnl ])# LT_LANG # _LT_LANG(LANGNAME) # ------------------ m4_defun([_LT_LANG], [m4_ifdef([_LT_LANG_]$1[_enabled], [], [LT_SUPPORTED_TAG([$1])dnl m4_append([_LT_TAGS], [$1 ])dnl m4_define([_LT_LANG_]$1[_enabled], [])dnl _LT_LANG_$1_CONFIG($1)])dnl ])# _LT_LANG m4_ifndef([AC_PROG_GO], [ ############################################################ # NOTE: This macro has been submitted for inclusion into # # GNU Autoconf as AC_PROG_GO. When it is available in # # a released version of Autoconf we should remove this # # macro and use it instead. # ############################################################ m4_defun([AC_PROG_GO], [AC_LANG_PUSH(Go)dnl AC_ARG_VAR([GOC], [Go compiler command])dnl AC_ARG_VAR([GOFLAGS], [Go compiler flags])dnl _AC_ARG_VAR_LDFLAGS()dnl AC_CHECK_TOOL(GOC, gccgo) if test -z "$GOC"; then if test -n "$ac_tool_prefix"; then AC_CHECK_PROG(GOC, [${ac_tool_prefix}gccgo], [${ac_tool_prefix}gccgo]) fi fi if test -z "$GOC"; then AC_CHECK_PROG(GOC, gccgo, gccgo, false) fi ])#m4_defun ])#m4_ifndef # _LT_LANG_DEFAULT_CONFIG # ----------------------- m4_defun([_LT_LANG_DEFAULT_CONFIG], [AC_PROVIDE_IFELSE([AC_PROG_CXX], [LT_LANG(CXX)], [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])]) AC_PROVIDE_IFELSE([AC_PROG_F77], [LT_LANG(F77)], [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])]) AC_PROVIDE_IFELSE([AC_PROG_FC], [LT_LANG(FC)], [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])]) dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal dnl pulling things in needlessly. AC_PROVIDE_IFELSE([AC_PROG_GCJ], [LT_LANG(GCJ)], [AC_PROVIDE_IFELSE([A][M_PROG_GCJ], [LT_LANG(GCJ)], [AC_PROVIDE_IFELSE([LT_PROG_GCJ], [LT_LANG(GCJ)], [m4_ifdef([AC_PROG_GCJ], [m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])]) m4_ifdef([A][M_PROG_GCJ], [m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])]) m4_ifdef([LT_PROG_GCJ], [m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])]) AC_PROVIDE_IFELSE([AC_PROG_GO], [LT_LANG(GO)], [m4_define([AC_PROG_GO], defn([AC_PROG_GO])[LT_LANG(GO)])]) AC_PROVIDE_IFELSE([LT_PROG_RC], [LT_LANG(RC)], [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])]) ])# _LT_LANG_DEFAULT_CONFIG # Obsolete macros: AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)]) AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)]) AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)]) AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)]) AU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_CXX], []) dnl AC_DEFUN([AC_LIBTOOL_F77], []) dnl AC_DEFUN([AC_LIBTOOL_FC], []) dnl AC_DEFUN([AC_LIBTOOL_GCJ], []) dnl AC_DEFUN([AC_LIBTOOL_RC], []) # _LT_TAG_COMPILER # ---------------- m4_defun([_LT_TAG_COMPILER], [AC_REQUIRE([AC_PROG_CC])dnl _LT_DECL([LTCC], [CC], [1], [A C compiler])dnl _LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl _LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl _LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl # 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 ])# _LT_TAG_COMPILER # _LT_COMPILER_BOILERPLATE # ------------------------ # Check for compiler boilerplate output or warnings with # the simple compiler test code. m4_defun([_LT_COMPILER_BOILERPLATE], [m4_require([_LT_DECL_SED])dnl 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* ])# _LT_COMPILER_BOILERPLATE # _LT_LINKER_BOILERPLATE # ---------------------- # Check for linker boilerplate output or warnings with # the simple link test code. m4_defun([_LT_LINKER_BOILERPLATE], [m4_require([_LT_DECL_SED])dnl 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* ])# _LT_LINKER_BOILERPLATE # _LT_REQUIRED_DARWIN_CHECKS # ------------------------- m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[ case $host_os in rhapsody* | darwin*) AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:]) AC_CHECK_TOOL([NMEDIT], [nmedit], [:]) AC_CHECK_TOOL([LIPO], [lipo], [:]) AC_CHECK_TOOL([OTOOL], [otool], [:]) AC_CHECK_TOOL([OTOOL64], [otool64], [:]) _LT_DECL([], [DSYMUTIL], [1], [Tool to manipulate archived DWARF debug symbol files on Mac OS X]) _LT_DECL([], [NMEDIT], [1], [Tool to change global to local symbols on Mac OS X]) _LT_DECL([], [LIPO], [1], [Tool to manipulate fat objects and archives on Mac OS X]) _LT_DECL([], [OTOOL], [1], [ldd/readelf like tool for Mach-O binaries on Mac OS X]) _LT_DECL([], [OTOOL64], [1], [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4]) AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod], [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" >&AS_MESSAGE_LOG_FD $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 >&AS_MESSAGE_LOG_FD # 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 >&AS_MESSAGE_LOG_FD fi rm -rf libconftest.dylib* rm -f conftest.* fi]) AC_CACHE_CHECK([for -exported_symbols_list linker flag], [lt_cv_ld_exported_symbols_list], [lt_cv_ld_exported_symbols_list=no save_LDFLAGS=$LDFLAGS echo "_main" > conftest.sym LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], [lt_cv_ld_exported_symbols_list=yes], [lt_cv_ld_exported_symbols_list=no]) LDFLAGS="$save_LDFLAGS" ]) AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load], [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" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD cat > conftest.c << _LT_EOF int main() { return 0;} _LT_EOF echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD $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 >&AS_MESSAGE_LOG_FD 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 >&AS_MESSAGE_LOG_FD fi rm -f conftest.err libconftest.a conftest conftest.c rm -rf conftest.dSYM ]) 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 ]) # _LT_DARWIN_LINKER_FEATURES([TAG]) # --------------------------------- # Checks for linker and compiler features on darwin m4_defun([_LT_DARWIN_LINKER_FEATURES], [ m4_require([_LT_REQUIRED_DARWIN_CHECKS]) _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported if test "$lt_cv_ld_force_load" = "yes"; then _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes], [FC], [_LT_TAGVAR(compiler_needs_object, $1)=yes]) else _LT_TAGVAR(whole_archive_flag_spec, $1)='' fi _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)="$_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 _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" _LT_TAGVAR(archive_expsym_cmds, $1)="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}" _LT_TAGVAR(module_expsym_cmds, $1)="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}" m4_if([$1], [CXX], [ if test "$lt_cv_apple_cc_single_mod" != "yes"; then _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}" _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}" fi ],[]) else _LT_TAGVAR(ld_shlibs, $1)=no fi ]) # _LT_SYS_MODULE_PATH_AIX([TAGNAME]) # ---------------------------------- # Links a minimal program and checks the executable # for the system default hardcoded library path. In most cases, # this is /usr/lib:/lib, but when the MPI compilers are used # the location of the communication and MPI libs are included too. # If we don't find anything, use the default library path according # to the aix ld manual. # Store the results from the different compilers for each TAGNAME. # Allow to override them for all tags through lt_cv_aix_libpath. m4_defun([_LT_SYS_MODULE_PATH_AIX], [m4_require([_LT_DECL_SED])dnl if test "${lt_cv_aix_libpath+set}" = set; then aix_libpath=$lt_cv_aix_libpath else AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])], [AC_LINK_IFELSE([AC_LANG_PROGRAM],[ lt_aix_libpath_sed='[ /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }]' _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`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_TAGVAR([lt_cv_aix_libpath_], [$1])"; then _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi],[]) if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then _LT_TAGVAR([lt_cv_aix_libpath_], [$1])="/usr/lib:/lib" fi ]) aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1]) fi ])# _LT_SYS_MODULE_PATH_AIX # _LT_SHELL_INIT(ARG) # ------------------- m4_define([_LT_SHELL_INIT], [m4_divert_text([M4SH-INIT], [$1 ])])# _LT_SHELL_INIT # _LT_PROG_ECHO_BACKSLASH # ----------------------- # Find how we can fake an echo command that does not interpret backslash. # In particular, with Autoconf 2.60 or later we add some code to the start # of the generated configure script which will find a shell with a builtin # printf (which we can use as an echo command). m4_defun([_LT_PROG_ECHO_BACKSLASH], [ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO AC_MSG_CHECKING([how to print strings]) # 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*) AC_MSG_RESULT([printf]) ;; print*) AC_MSG_RESULT([print -r]) ;; *) AC_MSG_RESULT([cat]) ;; esac m4_ifdef([_AS_DETECT_SUGGESTED], [_AS_DETECT_SUGGESTED([ 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" )])]) _LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts]) _LT_DECL([], [ECHO], [1], [An echo program that protects backslashes]) ])# _LT_PROG_ECHO_BACKSLASH # _LT_WITH_SYSROOT # ---------------- AC_DEFUN([_LT_WITH_SYSROOT], [AC_MSG_CHECKING([for sysroot]) AC_ARG_WITH([sysroot], [ --with-sysroot[=DIR] Search for dependent libraries within DIR (or the compiler's sysroot if not specified).], [], [with_sysroot=no]) dnl lt_sysroot will always be passed unquoted. We quote it here dnl in case the user passed a directory name. 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|'') ;; #( *) AC_MSG_RESULT([${with_sysroot}]) AC_MSG_ERROR([The sysroot must be an absolute path.]) ;; esac AC_MSG_RESULT([${lt_sysroot:-no}]) _LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl [dependent libraries, and in which our libraries should be installed.])]) # _LT_ENABLE_LOCK # --------------- m4_defun([_LT_ENABLE_LOCK], [AC_ARG_ENABLE([libtool-lock], [AS_HELP_STRING([--disable-libtool-lock], [avoid locking (might break parallel builds)])]) 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 AC_TRY_EVAL(ac_compile); 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 AC_TRY_EVAL(ac_compile); 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 AC_TRY_EVAL(ac_compile); 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" AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, [AC_LANG_PUSH(C) AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) AC_LANG_POP]) 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 AC_TRY_EVAL(ac_compile); 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" ])# _LT_ENABLE_LOCK # _LT_PROG_AR # ----------- m4_defun([_LT_PROG_AR], [AC_CHECK_TOOLS(AR, [ar], false) : ${AR=ar} : ${AR_FLAGS=cru} _LT_DECL([], [AR], [1], [The archiver]) _LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive]) AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file], [lt_cv_ar_at_file=no AC_COMPILE_IFELSE([AC_LANG_PROGRAM], [echo conftest.$ac_objext > conftest.lst lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD' AC_TRY_EVAL([lt_ar_try]) if test "$ac_status" -eq 0; then # Ensure the archiver fails upon bogus file names. rm -f conftest.$ac_objext libconftest.a AC_TRY_EVAL([lt_ar_try]) if test "$ac_status" -ne 0; then lt_cv_ar_at_file=@ fi fi rm -f conftest.* libconftest.a ]) ]) if test "x$lt_cv_ar_at_file" = xno; then archiver_list_spec= else archiver_list_spec=$lt_cv_ar_at_file fi _LT_DECL([], [archiver_list_spec], [1], [How to feed a file listing to the archiver]) ])# _LT_PROG_AR # _LT_CMD_OLD_ARCHIVE # ------------------- m4_defun([_LT_CMD_OLD_ARCHIVE], [_LT_PROG_AR AC_CHECK_TOOL(STRIP, strip, :) test -z "$STRIP" && STRIP=: _LT_DECL([], [STRIP], [1], [A symbol stripping program]) AC_CHECK_TOOL(RANLIB, ranlib, :) test -z "$RANLIB" && RANLIB=: _LT_DECL([], [RANLIB], [1], [Commands used to install an old-style archive]) # 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 _LT_DECL([], [old_postinstall_cmds], [2]) _LT_DECL([], [old_postuninstall_cmds], [2]) _LT_TAGDECL([], [old_archive_cmds], [2], [Commands used to build an old-style archive]) _LT_DECL([], [lock_old_archive_extraction], [0], [Whether to use a lock for old archive extraction]) ])# _LT_CMD_OLD_ARCHIVE # _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, # [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE]) # ---------------------------------------------------------------- # Check whether the given compiler option works AC_DEFUN([_LT_COMPILER_OPTION], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_SED])dnl AC_CACHE_CHECK([$1], [$2], [$2=no m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$3" # 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\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD 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 $2=yes fi fi $RM conftest* ]) if test x"[$]$2" = xyes; then m4_if([$5], , :, [$5]) else m4_if([$6], , :, [$6]) fi ])# _LT_COMPILER_OPTION # Old name: AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], []) # _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, # [ACTION-SUCCESS], [ACTION-FAILURE]) # ---------------------------------------------------- # Check whether the given linker option works AC_DEFUN([_LT_LINKER_OPTION], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_SED])dnl AC_CACHE_CHECK([$1], [$2], [$2=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $3" 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>&AS_MESSAGE_LOG_FD $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then $2=yes fi else $2=yes fi fi $RM -r conftest* LDFLAGS="$save_LDFLAGS" ]) if test x"[$]$2" = xyes; then m4_if([$4], , :, [$4]) else m4_if([$5], , :, [$5]) fi ])# _LT_LINKER_OPTION # Old name: AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], []) # LT_CMD_MAX_LEN #--------------- AC_DEFUN([LT_CMD_MAX_LEN], [AC_REQUIRE([AC_CANONICAL_HOST])dnl # find the maximum length of command line arguments AC_MSG_CHECKING([the maximum length of command line arguments]) AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl 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 ]) if test -n $lt_cv_sys_max_cmd_len ; then AC_MSG_RESULT($lt_cv_sys_max_cmd_len) else AC_MSG_RESULT(none) fi max_cmd_len=$lt_cv_sys_max_cmd_len _LT_DECL([], [max_cmd_len], [0], [What is the maximum length of a command?]) ])# LT_CMD_MAX_LEN # Old name: AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], []) # _LT_HEADER_DLFCN # ---------------- m4_defun([_LT_HEADER_DLFCN], [AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl ])# _LT_HEADER_DLFCN # _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, # ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) # ---------------------------------------------------------------- m4_defun([_LT_TRY_DLOPEN_SELF], [m4_require([_LT_HEADER_DLFCN])dnl if test "$cross_compiling" = yes; then : [$4] 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 AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) $1 ;; x$lt_dlneed_uscore) $2 ;; x$lt_dlunknown|x*) $3 ;; esac else : # compilation failed $3 fi fi rm -fr conftest* ])# _LT_TRY_DLOPEN_SELF # LT_SYS_DLOPEN_SELF # ------------------ AC_DEFUN([LT_SYS_DLOPEN_SELF], [m4_require([_LT_HEADER_DLFCN])dnl 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 AC_CHECK_LIB([dl], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[ lt_cv_dlopen="dyld" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ]) ;; *) AC_CHECK_FUNC([shl_load], [lt_cv_dlopen="shl_load"], [AC_CHECK_LIB([dld], [shl_load], [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"], [AC_CHECK_FUNC([dlopen], [lt_cv_dlopen="dlopen"], [AC_CHECK_LIB([dl], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"], [AC_CHECK_LIB([svld], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"], [AC_CHECK_LIB([dld], [dld_link], [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"]) ]) ]) ]) ]) ]) ;; 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" AC_CACHE_CHECK([whether a program can dlopen itself], lt_cv_dlopen_self, [dnl _LT_TRY_DLOPEN_SELF( lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes, lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross) ]) if test "x$lt_cv_dlopen_self" = xyes; then wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" AC_CACHE_CHECK([whether a statically linked program can dlopen itself], lt_cv_dlopen_self_static, [dnl _LT_TRY_DLOPEN_SELF( lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross) ]) 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 _LT_DECL([dlopen_support], [enable_dlopen], [0], [Whether dlopen is supported]) _LT_DECL([dlopen_self], [enable_dlopen_self], [0], [Whether dlopen of programs is supported]) _LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0], [Whether dlopen of statically linked programs is supported]) ])# LT_SYS_DLOPEN_SELF # Old name: AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], []) # _LT_COMPILER_C_O([TAGNAME]) # --------------------------- # Check to see if options -c and -o are simultaneously supported by compiler. # This macro does not hard code the compiler like AC_PROG_CC_C_O. m4_defun([_LT_COMPILER_C_O], [m4_require([_LT_DECL_SED])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_TAG_COMPILER])dnl AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)], [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=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\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD 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_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes fi fi chmod u+w . 2>&AS_MESSAGE_LOG_FD $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* ]) _LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1], [Does compiler simultaneously support -c and -o options?]) ])# _LT_COMPILER_C_O # _LT_COMPILER_FILE_LOCKS([TAGNAME]) # ---------------------------------- # Check to see if we can do hard links to lock some files if needed m4_defun([_LT_COMPILER_FILE_LOCKS], [m4_require([_LT_ENABLE_LOCK])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl _LT_COMPILER_C_O([$1]) hard_links="nottested" if test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user AC_MSG_CHECKING([if we can lock with hard links]) 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 AC_MSG_RESULT([$hard_links]) if test "$hard_links" = no; then AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe]) need_locks=warn fi else need_locks=no fi _LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?]) ])# _LT_COMPILER_FILE_LOCKS # _LT_CHECK_OBJDIR # ---------------- m4_defun([_LT_CHECK_OBJDIR], [AC_CACHE_CHECK([for objdir], [lt_cv_objdir], [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]) objdir=$lt_cv_objdir _LT_DECL([], [objdir], [0], [The name of the directory that contains temporary libtool files])dnl m4_pattern_allow([LT_OBJDIR])dnl AC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/", [Define to the sub-directory in which libtool stores uninstalled libraries.]) ])# _LT_CHECK_OBJDIR # _LT_LINKER_HARDCODE_LIBPATH([TAGNAME]) # -------------------------------------- # Check hardcoding attributes. m4_defun([_LT_LINKER_HARDCODE_LIBPATH], [AC_MSG_CHECKING([how to hardcode library paths into programs]) _LT_TAGVAR(hardcode_action, $1)= if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" || test -n "$_LT_TAGVAR(runpath_var, $1)" || test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then # We can hardcode non-existent directories. if test "$_LT_TAGVAR(hardcode_direct, $1)" != 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, $1)" != no && test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then # Linking always hardcodes the temporary library directory. _LT_TAGVAR(hardcode_action, $1)=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. _LT_TAGVAR(hardcode_action, $1)=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. _LT_TAGVAR(hardcode_action, $1)=unsupported fi AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)]) if test "$_LT_TAGVAR(hardcode_action, $1)" = relink || test "$_LT_TAGVAR(inherit_rpath, $1)" = 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 _LT_TAGDECL([], [hardcode_action], [0], [How to hardcode a shared library path into an executable]) ])# _LT_LINKER_HARDCODE_LIBPATH # _LT_CMD_STRIPLIB # ---------------- m4_defun([_LT_CMD_STRIPLIB], [m4_require([_LT_DECL_EGREP]) striplib= old_striplib= AC_MSG_CHECKING([whether stripping libraries is possible]) 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" AC_MSG_RESULT([yes]) 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" AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) fi ;; *) AC_MSG_RESULT([no]) ;; esac fi _LT_DECL([], [old_striplib], [1], [Commands to strip libraries]) _LT_DECL([], [striplib], [1]) ])# _LT_CMD_STRIPLIB # _LT_SYS_DYNAMIC_LINKER([TAG]) # ----------------------------- # PORTME Fill in your ld.so characteristics m4_defun([_LT_SYS_DYNAMIC_LINKER], [AC_REQUIRE([AC_CANONICAL_HOST])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_OBJDUMP])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_CHECK_SHELL_FEATURES])dnl AC_MSG_CHECKING([dynamic linker characteristics]) m4_if([$1], [], [ 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}' m4_if([$1], [],[ 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`' m4_if([$1], [],[ 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 AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath], [lt_cv_shlibpath_overrides_runpath=no save_LDFLAGS=$LDFLAGS save_libdir=$libdir eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \ LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\"" AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null], [lt_cv_shlibpath_overrides_runpath=yes])]) LDFLAGS=$save_LDFLAGS libdir=$save_libdir ]) 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 AC_MSG_RESULT([$dynamic_linker]) 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 _LT_DECL([], [variables_saved_for_relink], [1], [Variables whose values should be saved in libtool wrapper scripts and restored at link time]) _LT_DECL([], [need_lib_prefix], [0], [Do we need the "lib" prefix for modules?]) _LT_DECL([], [need_version], [0], [Do we need a version for libraries?]) _LT_DECL([], [version_type], [0], [Library versioning type]) _LT_DECL([], [runpath_var], [0], [Shared library runtime path variable]) _LT_DECL([], [shlibpath_var], [0],[Shared library path variable]) _LT_DECL([], [shlibpath_overrides_runpath], [0], [Is shlibpath searched before the hard-coded library search path?]) _LT_DECL([], [libname_spec], [1], [Format of library name prefix]) _LT_DECL([], [library_names_spec], [1], [[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]]) _LT_DECL([], [soname_spec], [1], [[The coded name of the library, if different from the real name]]) _LT_DECL([], [install_override_mode], [1], [Permission mode override for installation of shared libraries]) _LT_DECL([], [postinstall_cmds], [2], [Command to use after installation of a shared archive]) _LT_DECL([], [postuninstall_cmds], [2], [Command to use after uninstallation of a shared archive]) _LT_DECL([], [finish_cmds], [2], [Commands used to finish a libtool library installation in a directory]) _LT_DECL([], [finish_eval], [1], [[As "finish_cmds", except a single script fragment to be evaled but not shown]]) _LT_DECL([], [hardcode_into_libs], [0], [Whether we should hardcode library paths into libraries]) _LT_DECL([], [sys_lib_search_path_spec], [2], [Compile-time system search path for libraries]) _LT_DECL([], [sys_lib_dlsearch_path_spec], [2], [Run-time system search path for libraries]) ])# _LT_SYS_DYNAMIC_LINKER # _LT_PATH_TOOL_PREFIX(TOOL) # -------------------------- # find a file program which can recognize shared library AC_DEFUN([_LT_PATH_TOOL_PREFIX], [m4_require([_LT_DECL_EGREP])dnl AC_MSG_CHECKING([for $1]) AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, [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 dnl $ac_dummy forces splitting on constant user-supplied paths. dnl POSIX.2 word splitting is done only on the output of word expansions, dnl not every word. This closes a longstanding sh security hole. ac_dummy="m4_if([$2], , $PATH, [$2])" for ac_dir in $ac_dummy; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$1; then lt_cv_path_MAGIC_CMD="$ac_dir/$1" 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]) MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then AC_MSG_RESULT($MAGIC_CMD) else AC_MSG_RESULT(no) fi _LT_DECL([], [MAGIC_CMD], [0], [Used to examine libraries when file_magic_cmd begins with "file"])dnl ])# _LT_PATH_TOOL_PREFIX # Old name: AU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], []) # _LT_PATH_MAGIC # -------------- # find a file program which can recognize a shared library m4_defun([_LT_PATH_MAGIC], [_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH) if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH) else MAGIC_CMD=: fi fi ])# _LT_PATH_MAGIC # LT_PATH_LD # ---------- # find the pathname to the GNU or non-GNU linker AC_DEFUN([LT_PATH_LD], [AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_PROG_ECHO_BACKSLASH])dnl AC_ARG_WITH([gnu-ld], [AS_HELP_STRING([--with-gnu-ld], [assume the C compiler uses GNU ld @<:@default=no@:>@])], [test "$withval" = no || with_gnu_ld=yes], [with_gnu_ld=no])dnl ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. AC_MSG_CHECKING([for ld used by $CC]) 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 AC_MSG_CHECKING([for GNU ld]) else AC_MSG_CHECKING([for non-GNU ld]) fi AC_CACHE_VAL(lt_cv_path_LD, [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 &1 /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 ]) 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 _LT_DECL([], [deplibs_check_method], [1], [Method to check whether dependent libraries are shared objects]) _LT_DECL([], [file_magic_cmd], [1], [Command to use when deplibs_check_method = "file_magic"]) _LT_DECL([], [file_magic_glob], [1], [How to find potential files when deplibs_check_method = "file_magic"]) _LT_DECL([], [want_nocaseglob], [1], [Find potential files using nocaseglob when deplibs_check_method = "file_magic"]) ])# _LT_CHECK_MAGIC_METHOD # LT_PATH_NM # ---------- # find the pathname to a BSD- or MS-compatible name lister AC_DEFUN([LT_PATH_NM], [AC_REQUIRE([AC_PROG_CC])dnl AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM, [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]) 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 AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :) case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in *COFF*) DUMPBIN="$DUMPBIN -symbols" ;; *) DUMPBIN=: ;; esac fi AC_SUBST([DUMPBIN]) if test "$DUMPBIN" != ":"; then NM="$DUMPBIN" fi fi test -z "$NM" && NM=nm AC_SUBST([NM]) _LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface], [lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&AS_MESSAGE_LOG_FD (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&AS_MESSAGE_LOG_FD (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD) cat conftest.out >&AS_MESSAGE_LOG_FD if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" fi rm -f conftest*]) ])# LT_PATH_NM # Old names: AU_ALIAS([AM_PROG_NM], [LT_PATH_NM]) AU_ALIAS([AC_PROG_NM], [LT_PATH_NM]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_PROG_NM], []) dnl AC_DEFUN([AC_PROG_NM], []) # _LT_CHECK_SHAREDLIB_FROM_LINKLIB # -------------------------------- # how to determine the name of the shared library # associated with a specific link library. # -- PORTME fill in with the dynamic library characteristics m4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB], [m4_require([_LT_DECL_EGREP]) m4_require([_LT_DECL_OBJDUMP]) m4_require([_LT_DECL_DLLTOOL]) AC_CACHE_CHECK([how to associate runtime and link libraries], lt_cv_sharedlib_from_linklib_cmd, [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 ]) sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO _LT_DECL([], [sharedlib_from_linklib_cmd], [1], [Command to associate shared and link libraries]) ])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB # _LT_PATH_MANIFEST_TOOL # ---------------------- # locate the manifest tool m4_defun([_LT_PATH_MANIFEST_TOOL], [AC_CHECK_TOOL(MANIFEST_TOOL, mt, :) test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt AC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool], [lt_cv_path_mainfest_tool=no echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out cat conftest.err >&AS_MESSAGE_LOG_FD if $GREP 'Manifest Tool' conftest.out > /dev/null; then lt_cv_path_mainfest_tool=yes fi rm -f conftest*]) if test "x$lt_cv_path_mainfest_tool" != xyes; then MANIFEST_TOOL=: fi _LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl ])# _LT_PATH_MANIFEST_TOOL # LT_LIB_M # -------- # check for math library AC_DEFUN([LT_LIB_M], [AC_REQUIRE([AC_CANONICAL_HOST])dnl LIBM= case $host in *-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*) # These system don't have libm, or don't need it ;; *-ncr-sysv4.3*) AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw") AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm") ;; *) AC_CHECK_LIB(m, cos, LIBM="-lm") ;; esac AC_SUBST([LIBM]) ])# LT_LIB_M # Old name: AU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_CHECK_LIBM], []) # _LT_COMPILER_NO_RTTI([TAGNAME]) # ------------------------------- m4_defun([_LT_COMPILER_NO_RTTI], [m4_require([_LT_TAG_COMPILER])dnl _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= if test "$GCC" = yes; then case $cc_basename in nvcc*) _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;; *) _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;; esac _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], lt_cv_prog_compiler_rtti_exceptions, [-fno-rtti -fno-exceptions], [], [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"]) fi _LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1], [Compiler flag to turn off builtin functions]) ])# _LT_COMPILER_NO_RTTI # _LT_CMD_GLOBAL_SYMBOLS # ---------------------- m4_defun([_LT_CMD_GLOBAL_SYMBOLS], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([LT_PATH_NM])dnl AC_REQUIRE([LT_PATH_LD])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_TAG_COMPILER])dnl # Check for command to grab the raw symbol name followed by C symbol from nm. AC_MSG_CHECKING([command to parse $NM output from $compiler object]) AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], [ # 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 AC_TRY_EVAL(ac_compile); then # Now try to grab the symbols. nlist=conftest.nm if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && 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@&t@_DLSYM_CONST #elif defined(__osf__) /* This system does not cope well with relocations in const data. */ # define LT@&t@_DLSYM_CONST #else # define LT@&t@_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@&t@_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_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)" if AC_TRY_EVAL(ac_link) && 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" >&AS_MESSAGE_LOG_FD fi else echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD fi else echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD 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 ]) 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 AC_MSG_RESULT(failed) else AC_MSG_RESULT(ok) 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 _LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1], [Take the output of nm and produce a listing of raw symbols and C names]) _LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1], [Transform the output of nm in a proper C declaration]) _LT_DECL([global_symbol_to_c_name_address], [lt_cv_sys_global_symbol_to_c_name_address], [1], [Transform the output of nm in a C name address pair]) _LT_DECL([global_symbol_to_c_name_address_lib_prefix], [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1], [Transform the output of nm in a C name address pair when lib prefix is needed]) _LT_DECL([], [nm_file_list_spec], [1], [Specify filename containing input files for $NM]) ]) # _LT_CMD_GLOBAL_SYMBOLS # _LT_COMPILER_PIC([TAGNAME]) # --------------------------- m4_defun([_LT_COMPILER_PIC], [m4_require([_LT_TAG_COMPILER])dnl _LT_TAGVAR(lt_prog_compiler_wl, $1)= _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)= m4_if([$1], [CXX], [ # C++ specific cases for pic, static, wl, etc. if test "$GXX" = yes; then _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(lt_prog_compiler_pic, $1)='-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_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | os2* | pw32* | 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 m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; *djgpp*) # DJGPP does not support shared libraries at all _LT_TAGVAR(lt_prog_compiler_pic, $1)= ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. _LT_TAGVAR(lt_prog_compiler_static, $1)= ;; interix[[3-9]]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; 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*) ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac else case $host_os in aix[[4-9]]*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' fi ;; chorus*) case $cc_basename in cxch68*) # Green Hills C++ Compiler # _LT_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" ;; esac ;; mingw* | cygwin* | os2* | pw32* | 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). m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; dgux*) case $cc_basename in ec++*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ;; ghcx*) # Green Hills C++ Compiler _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; *) ;; esac ;; freebsd* | dragonfly*) # FreeBSD uses GNU C++ ;; hpux9* | hpux10* | hpux11*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' if test "$host_cpu" != ia64; then _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' fi ;; aCC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' ;; esac ;; *) ;; esac ;; interix*) # This is c89, which is MS Visual C++ (no shared libs) # Anyone wants to do a port? ;; irix5* | irix6* | nonstopux*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' # CC pic flag -KPIC is the default. ;; *) ;; esac ;; linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in KCC*) # KAI C++ Compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; ecpc* ) # old Intel C++ for x86_64 which still supported -KPIC. _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; icpc* ) # Intel C++, used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; pgCC* | pgcpp*) # Portland Group C++ compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; cxx*) # Compaq C++ # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL 8.0, 9.0 on PPC and BlueGene _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; esac ;; esac ;; lynxos*) ;; m88k*) ;; mvs*) case $cc_basename in cxx*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall' ;; *) ;; esac ;; netbsd* | netbsdelf*-gnu) ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' ;; RCC*) # Rational C++ 2.4.1 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; cxx*) # Digital/Compaq C++ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; *) ;; esac ;; psos*) ;; solaris*) case $cc_basename in CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; gcx*) # Green Hills C++ Compiler _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' ;; *) ;; esac ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; lcc*) # Lucid _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; *) ;; esac ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ;; *) ;; esac ;; vxworks*) ;; *) _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; esac fi ], [ if test "$GCC" = yes; then _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(lt_prog_compiler_pic, $1)='-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_TAGVAR(lt_prog_compiler_pic, $1)='-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 m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. _LT_TAGVAR(lt_prog_compiler_static, $1)= ;; 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_TAGVAR(lt_prog_compiler_pic, $1)='-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_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no enable_shared=no ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac case $cc_basename in nvcc*) # Cuda Compiler Driver 2.2 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker ' if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then _LT_TAGVAR(lt_prog_compiler_pic, $1)="-Xcompiler $_LT_TAGVAR(lt_prog_compiler_pic, $1)" fi ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_TAGVAR(lt_prog_compiler_static, $1)='-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). m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; hpux9* | hpux10* | hpux11*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-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_TAGVAR(lt_prog_compiler_pic, $1)='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # PIC (with -KPIC) is the default. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in # old Intel for x86_64 which still supported -KPIC. ecc*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; # icc used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. icc* | ifort*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; # Lahey Fortran 8.1. lf95*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared' _LT_TAGVAR(lt_prog_compiler_static, $1)='--static' ;; nagfor*) # NAG Fortran compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; ccc*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # All Alpha code is PIC. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; xl* | bgxl* | bgf* | mpixl*) # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-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_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='' ;; *Sun\ F* | *Sun*Fortran*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; *Sun\ C*) # Sun C 5.9 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' ;; *Intel*\ [[CF]]*Compiler*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; *Portland\ Group*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; esac ;; esac ;; newsos6) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; osf3* | osf4* | osf5*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # All OSF/1 code is PIC. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; rdos*) _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; solaris*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' case $cc_basename in f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';; *) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';; esac ;; sunos4*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; unicos*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; uts4*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; *) _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; esac fi ]) case $host_os in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) _LT_TAGVAR(lt_prog_compiler_pic, $1)= ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])" ;; esac AC_CACHE_CHECK([for $compiler option to produce PIC], [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)], [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)]) _LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1) # # Check to make sure the PIC flag actually works. # if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works], [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)], [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [], [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in "" | " "*) ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;; esac], [_LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no]) fi _LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1], [Additional compiler flags for building library objects]) _LT_TAGDECL([wl], [lt_prog_compiler_wl], [1], [How to pass a linker flag through the compiler]) # # Check to make sure the static flag actually works. # wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\" _LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works], _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1), $lt_tmp_static_flag, [], [_LT_TAGVAR(lt_prog_compiler_static, $1)=]) _LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1], [Compiler flag to prevent dynamic linking]) ])# _LT_COMPILER_PIC # _LT_LINKER_SHLIBS([TAGNAME]) # ---------------------------- # See if the linker supports building shared libraries. m4_defun([_LT_LINKER_SHLIBS], [AC_REQUIRE([LT_PATH_LD])dnl AC_REQUIRE([LT_PATH_NM])dnl m4_require([_LT_PATH_MANIFEST_TOOL])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl m4_require([_LT_TAG_COMPILER])dnl AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) m4_if([$1], [CXX], [ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] case $host_os in aix[[4-9]]*) # 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 _LT_TAGVAR(export_symbols_cmds, $1)='$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 _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi ;; pw32*) _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds" ;; cygwin* | mingw* | cegcc*) case $cc_basename in cl*) _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' ;; *) _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] ;; esac ;; linux* | k*bsd*-gnu | gnu*) _LT_TAGVAR(link_all_deplibs, $1)=no ;; *) _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' ;; esac ], [ runpath_var= _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_cmds, $1)= _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(compiler_needs_object, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(old_archive_from_new_cmds, $1)= _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)= _LT_TAGVAR(thread_safe_flag_spec, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list _LT_TAGVAR(include_expsyms, $1)= # 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'. _LT_TAGVAR(exclude_expsyms, $1)=['_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. dnl Note also adjust exclude_expsyms for C++ above. 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*) _LT_TAGVAR(link_all_deplibs, $1)=no ;; esac _LT_TAGVAR(ld_shlibs, $1)=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 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${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 _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else _LT_TAGVAR(whole_archive_flag_spec, $1)= 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 _LT_TAGVAR(ld_shlibs, $1)=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 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='' ;; m68k) _LT_TAGVAR(archive_cmds, $1)='$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)' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; cygwin* | mingw* | pw32* | cegcc*) # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(exclude_expsyms, $1)=['[_]+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 _LT_TAGVAR(archive_cmds, $1)='$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... _LT_TAGVAR(archive_expsym_cmds, $1)='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 _LT_TAGVAR(ld_shlibs, $1)=no fi ;; haiku*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(link_all_deplibs, $1)=yes ;; interix[[3-9]]*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${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. _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='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 _LT_TAGVAR(whole_archive_flag_spec, $1)='${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 _LT_TAGVAR(whole_archive_flag_spec, $1)='${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 _LT_TAGVAR(whole_archive_flag_spec, $1)= 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 _LT_TAGVAR(whole_archive_flag_spec, $1)='${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' _LT_TAGVAR(compiler_needs_object, $1)=yes ;; esac case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 _LT_TAGVAR(whole_archive_flag_spec, $1)='${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' _LT_TAGVAR(compiler_needs_object, $1)=yes tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 tmp_sharedflag='-G' ;; esac _LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test "x$supports_anon_versioning" = xyes; then _LT_TAGVAR(archive_expsym_cmds, $1)='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 _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' if test "x$supports_anon_versioning" = xyes; then _LT_TAGVAR(archive_expsym_cmds, $1)='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 _LT_TAGVAR(ld_shlibs, $1)=no fi ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$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 _LT_TAGVAR(ld_shlibs, $1)=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 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*) _LT_TAGVAR(ld_shlibs, $1)=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 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; sunos4*) _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac if test "$_LT_TAGVAR(ld_shlibs, $1)" = no; then runpath_var= _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(archive_expsym_cmds, $1)='$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. _LT_TAGVAR(hardcode_minus_L, $1)=yes if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. _LT_TAGVAR(hardcode_direct, $1)=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 _LT_TAGVAR(export_symbols_cmds, $1)='$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 _LT_TAGVAR(export_symbols_cmds, $1)='$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. _LT_TAGVAR(archive_cmds, $1)='' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(file_list_spec, $1)='${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 _LT_TAGVAR(hardcode_direct, $1)=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 _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)= fi ;; esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi _LT_TAGVAR(link_all_deplibs, $1)=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 _LT_TAGVAR(export_dynamic_flag_spec, $1)='${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. _LT_TAGVAR(always_export_symbols, $1)=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. _LT_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" _LT_TAGVAR(archive_expsym_cmds, $1)='$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 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" _LT_TAGVAR(archive_expsym_cmds, $1)="\$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. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${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. _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' if test "$with_gnu_ld" = yes; then # We only use this code for GNU lds that support --whole-archive. _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' fi _LT_TAGVAR(archive_cmds_need_lc, $1)=yes # This is similar to how AIX traditionally builds its shared libraries. _LT_TAGVAR(archive_expsym_cmds, $1)="\$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 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='' ;; m68k) _LT_TAGVAR(archive_cmds, $1)='$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)' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac ;; bsdi[[45]]*) _LT_TAGVAR(export_dynamic_flag_spec, $1)=-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 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(file_list_spec, $1)='@' # 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. _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' _LT_TAGVAR(archive_expsym_cmds, $1)='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, $1)='true' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1,DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols' # Don't use ranlib _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' _LT_TAGVAR(postlink_cmds, $1)='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 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=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. _LT_TAGVAR(archive_cmds, $1)='$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. _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' # FIXME: Should let the user specify the lib program. _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes ;; esac ;; darwin* | rhapsody*) _LT_DARWIN_LINKER_FEATURES($1) ;; dgux*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=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*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2.*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; hpux9*) if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$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 _LT_TAGVAR(archive_cmds, $1)='$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 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_direct, $1)=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' ;; hpux10*) if test "$GCC" = yes && test "$with_gnu_ld" = no; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test "$with_gnu_ld" = no; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes fi ;; hpux11*) if test "$GCC" = yes && test "$with_gnu_ld" = no; then case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$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*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) m4_if($1, [], [ # 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) _LT_LINKER_OPTION([if $CC understands -b], _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b], [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'], [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])], [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags']) ;; esac fi if test "$with_gnu_ld" = no; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: case $host_cpu in hppa*64*|ia64*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$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. AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol], [lt_cv_irix_exported_symbol], [save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" AC_LINK_IFELSE( [AC_LANG_SOURCE( [AC_LANG_CASE([C], [[int foo (void) { return 0; }]], [C++], [[int foo (void) { return 0; }]], [Fortran 77], [[ subroutine foo end]], [Fortran], [[ subroutine foo end]])])], [lt_cv_irix_exported_symbol=yes], [lt_cv_irix_exported_symbol=no]) LDFLAGS="$save_LDFLAGS"]) if test "$lt_cv_irix_exported_symbol" = yes; then _LT_TAGVAR(archive_expsym_cmds, $1)='$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 _LT_TAGVAR(archive_cmds, $1)='$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' _LT_TAGVAR(archive_expsym_cmds, $1)='$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 _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(inherit_rpath, $1)=yes _LT_TAGVAR(link_all_deplibs, $1)=yes ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else _LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; newsos6) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *nto* | *qnx*) ;; openbsd*) if test -f /usr/libexec/ld.so; then _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=yes if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' else case $host_os in openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' ;; esac fi else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; os2*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(archive_cmds, $1)='$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' _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_TAGVAR(archive_cmds, $1)='$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 _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$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 _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_TAGVAR(archive_cmds, $1)='$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' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' else _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$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' _LT_TAGVAR(archive_expsym_cmds, $1)='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 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_separator, $1)=: ;; solaris*) _LT_TAGVAR(no_undefined_flag, $1)=' -z defs' if test "$GCC" = yes; then wlarc='${wl}' _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='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='' _LT_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='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}' _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='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 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=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 _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' else _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' fi ;; esac _LT_TAGVAR(link_all_deplibs, $1)=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. _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4) case $host_vendor in sni) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs' _LT_TAGVAR(hardcode_direct, $1)=no ;; motorola) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4.3*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes _LT_TAGVAR(ld_shlibs, $1)=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$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. _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(ld_shlibs, $1)=no ;; esac if test x$host_vendor = xsni; then case $host in sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym' ;; esac fi fi ]) AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no _LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld _LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl _LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl _LT_DECL([], [extract_expsyms_cmds], [2], [The commands to extract the exported symbol list from a shared archive]) # # Do we need to explicitly link libc? # case "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in x|xyes) # Assume -lc should be added _LT_TAGVAR(archive_cmds_need_lc, $1)=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $_LT_TAGVAR(archive_cmds, $1) 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. AC_CACHE_CHECK([whether -lc should be explicitly linked in], [lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1), [$RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if AC_TRY_EVAL(ac_compile) 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1) compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1) _LT_TAGVAR(allow_undefined_flag, $1)= if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) then lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no else lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes fi _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $RM conftest* ]) _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1) ;; esac fi ;; esac _LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0], [Whether or not to add -lc for building shared libraries]) _LT_TAGDECL([allow_libtool_libs_with_static_runtimes], [enable_shared_with_static_runtimes], [0], [Whether or not to disallow shared libs when runtime libs are static]) _LT_TAGDECL([], [export_dynamic_flag_spec], [1], [Compiler flag to allow reflexive dlopens]) _LT_TAGDECL([], [whole_archive_flag_spec], [1], [Compiler flag to generate shared objects directly from archives]) _LT_TAGDECL([], [compiler_needs_object], [1], [Whether the compiler copes with passing no objects directly]) _LT_TAGDECL([], [old_archive_from_new_cmds], [2], [Create an old-style archive from a shared archive]) _LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2], [Create a temporary old-style archive to link instead of a shared archive]) _LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive]) _LT_TAGDECL([], [archive_expsym_cmds], [2]) _LT_TAGDECL([], [module_cmds], [2], [Commands used to build a loadable module if different from building a shared archive.]) _LT_TAGDECL([], [module_expsym_cmds], [2]) _LT_TAGDECL([], [with_gnu_ld], [1], [Whether we are building with GNU ld or not]) _LT_TAGDECL([], [allow_undefined_flag], [1], [Flag that allows shared libraries with undefined symbols to be built]) _LT_TAGDECL([], [no_undefined_flag], [1], [Flag that enforces no undefined symbols]) _LT_TAGDECL([], [hardcode_libdir_flag_spec], [1], [Flag to hardcode $libdir into a binary during linking. This must work even if $libdir does not exist]) _LT_TAGDECL([], [hardcode_libdir_separator], [1], [Whether we need a single "-rpath" flag with a separated argument]) _LT_TAGDECL([], [hardcode_direct], [0], [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_direct_absolute], [0], [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]) _LT_TAGDECL([], [hardcode_minus_L], [0], [Set to "yes" if using the -LDIR flag during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_shlibpath_var], [0], [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_automatic], [0], [Set to "yes" if building a shared library automatically hardcodes DIR into the library and all subsequent libraries and executables linked against it]) _LT_TAGDECL([], [inherit_rpath], [0], [Set to yes if linker adds runtime paths of dependent libraries to runtime path list]) _LT_TAGDECL([], [link_all_deplibs], [0], [Whether libtool must link a program against all its dependency libraries]) _LT_TAGDECL([], [always_export_symbols], [0], [Set to "yes" if exported symbols are required]) _LT_TAGDECL([], [export_symbols_cmds], [2], [The commands to list exported symbols]) _LT_TAGDECL([], [exclude_expsyms], [1], [Symbols that should not be listed in the preloaded symbols]) _LT_TAGDECL([], [include_expsyms], [1], [Symbols that must always be exported]) _LT_TAGDECL([], [prelink_cmds], [2], [Commands necessary for linking programs (against libraries) with templates]) _LT_TAGDECL([], [postlink_cmds], [2], [Commands necessary for finishing linking programs]) _LT_TAGDECL([], [file_list_spec], [1], [Specify filename containing input files]) dnl FIXME: Not yet implemented dnl _LT_TAGDECL([], [thread_safe_flag_spec], [1], dnl [Compiler flag to generate thread safe objects]) ])# _LT_LINKER_SHLIBS # _LT_LANG_C_CONFIG([TAG]) # ------------------------ # Ensure that the configuration variables for a C compiler are suitably # defined. These variables are subsequently used by _LT_CONFIG to write # the compiler configuration to `libtool'. m4_defun([_LT_LANG_C_CONFIG], [m4_require([_LT_DECL_EGREP])dnl lt_save_CC="$CC" AC_LANG_PUSH(C) # Source file extension for C test sources. ac_ext=c # Object file extension for compiled C test sources. objext=o _LT_TAGVAR(objext, $1)=$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);}' _LT_TAG_COMPILER # 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 _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE ## 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_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) LT_SYS_DLOPEN_SELF _LT_CMD_STRIPLIB # Report which library types will actually be built AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) 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 AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_CONFIG($1) fi AC_LANG_POP CC="$lt_save_CC" ])# _LT_LANG_C_CONFIG # _LT_LANG_CXX_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for a C++ compiler are suitably # defined. These variables are subsequently used by _LT_CONFIG to write # the compiler configuration to `libtool'. m4_defun([_LT_LANG_CXX_CONFIG], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_PATH_MANIFEST_TOOL])dnl if test -n "$CXX" && ( test "X$CXX" != "Xno" && ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || (test "X$CXX" != "Xg++"))) ; then AC_PROG_CXXCPP else _lt_caught_CXX_error=yes fi AC_LANG_PUSH(C++) _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(compiler_needs_object, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for C++ test sources. ac_ext=cpp # Object file extension for compiled C++ test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the CXX compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test "$_lt_caught_CXX_error" != yes; then # 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(int, char *[[]]) { return(0); }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_LD=$LD lt_save_GCC=$GCC GCC=$GXX lt_save_with_gnu_ld=$with_gnu_ld lt_save_path_LD=$lt_cv_path_LD if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx else $as_unset lt_cv_prog_gnu_ld fi if test -n "${lt_cv_path_LDCXX+set}"; then lt_cv_path_LD=$lt_cv_path_LDCXX else $as_unset lt_cv_path_LD fi test -z "${LDCXX+set}" || LD=$LDCXX CC=${CXX-"c++"} CFLAGS=$CXXFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) if test -n "$compiler"; then # We don't want -fno-exception when compiling C++ code, so set the # no_builtin_flag separately if test "$GXX" = yes; then _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' else _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= fi if test "$GXX" = yes; then # Set up default GNU C++ configuration LT_PATH_LD # Check if GNU C++ uses GNU ld as the underlying linker, since the # archiving commands below assume that GNU ld is being used. if test "$with_gnu_ld" = yes; then _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # If archive_cmds runs LD, not CC, wlarc should be empty # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to # investigate it a little bit more. (MM) wlarc='${wl}' # ancient GNU ld didn't support --whole-archive et. al. if eval "`$CC -print-prog-name=ld` --help 2>&1" | $GREP 'no-whole-archive' > /dev/null; then _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else _LT_TAGVAR(whole_archive_flag_spec, $1)= fi else with_gnu_ld=no wlarc= # A generic and very simple default shared library creation # command for GNU C++ for the case where it uses the native # linker, instead of GNU ld. If possible, this setting should # overridden to take advantage of the native linker features on # the platform it is being used on. _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' fi # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else GXX=no with_gnu_ld=no wlarc= fi # PORTME: fill in a description of your system's C++ link characteristics AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) _LT_TAGVAR(ld_shlibs, $1)=yes case $host_os in aix3*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; 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 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 case $ld_flag in *-brtl*) aix_use_runtimelinking=yes break ;; esac 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. _LT_TAGVAR(archive_cmds, $1)='' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(file_list_spec, $1)='${wl}-f,' if test "$GXX" = 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 _LT_TAGVAR(hardcode_direct, $1)=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 _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)= fi esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi 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 _LT_TAGVAR(export_dynamic_flag_spec, $1)='${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. _LT_TAGVAR(always_export_symbols, $1)=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. _LT_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an empty # executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" _LT_TAGVAR(archive_expsym_cmds, $1)='$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 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" _LT_TAGVAR(archive_expsym_cmds, $1)="\$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. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${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. _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' if test "$with_gnu_ld" = yes; then # We only use this code for GNU lds that support --whole-archive. _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' fi _LT_TAGVAR(archive_cmds_need_lc, $1)=yes # This is similar to how AIX traditionally builds its shared # libraries. _LT_TAGVAR(archive_expsym_cmds, $1)="\$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 ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; chorus*) case $cc_basename in *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; cygwin* | mingw* | pw32* | cegcc*) case $GXX,$cc_basename in ,cl* | no,cl*) # Native MSVC # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(file_list_spec, $1)='@' # 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. _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' _LT_TAGVAR(archive_expsym_cmds, $1)='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, $1)='true' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes # Don't use ranlib _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' _LT_TAGVAR(postlink_cmds, $1)='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~ func_to_tool_file "$lt_outputfile"~ 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' ;; *) # g++ # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $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... _LT_TAGVAR(archive_expsym_cmds, $1)='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 -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; darwin* | rhapsody*) _LT_DARWIN_LINKER_FEATURES($1) ;; dgux*) case $cc_basename in ec++*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; ghcx*) # Green Hills C++ Compiler # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; freebsd2.*) # C++ shared libraries reported to be fairly broken before # switch to ELF _LT_TAGVAR(ld_shlibs, $1)=no ;; freebsd-elf*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; freebsd* | dragonfly*) # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF # conventions _LT_TAGVAR(ld_shlibs, $1)=yes ;; gnu*) ;; haiku*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(link_all_deplibs, $1)=yes ;; hpux9*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, # but as the default # location of the library. case $cc_basename in CC*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aCC*) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test "$GXX" = yes; then _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; hpux10*|hpux11*) if test $with_gnu_ld = no; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: case $host_cpu in hppa*64*|ia64*) ;; *) _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' ;; esac fi case $host_cpu in hppa*64*|ia64*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, # but as the default # location of the library. ;; esac case $cc_basename in CC*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aCC*) case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test "$GXX" = yes; then if test $with_gnu_ld = no; then case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac fi else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; interix[[3-9]]*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${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. _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='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' ;; irix5* | irix6*) case $cc_basename in CC*) # SGI C++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' # Archives containing C++ object files must be created using # "CC -ar", where "CC" is the IRIX C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs' ;; *) if test "$GXX" = yes; then if test "$with_gnu_ld" = no; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $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 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib' fi fi _LT_TAGVAR(link_all_deplibs, $1)=yes ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(inherit_rpath, $1)=yes ;; linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; icpc* | ecpc* ) # Intel C++ with_gnu_ld=yes # version 8.0 and above of icpc choke on multiply defined symbols # if we add $predep_objects and $postdep_objects, however 7.1 and # earlier do not add the objects themselves. case `$CC -V 2>&1` in *"Version 7."*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ;; *) # Version 8.0 or newer tmp_idyn= case $host_cpu in ia64*) tmp_idyn=' -i_dynamic';; esac _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ;; esac _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' ;; pgCC* | pgcpp*) # Portland Group C++ compiler case `$CC -V` in *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*) _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"' _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~ $RANLIB $oldlib' _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' ;; *) # Version 6 and above use weak symbols _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' _LT_TAGVAR(whole_archive_flag_spec, $1)='${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' ;; cxx*) # Compaq C++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' runpath_var=LD_RUN_PATH _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed' ;; xl* | mpixl* | bgxl*) # IBM XL 8.0 on PPC, with GNU ld _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test "x$supports_anon_versioning" = xyes; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(whole_archive_flag_spec, $1)='${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' _LT_TAGVAR(compiler_needs_object, $1)=yes # Not sure whether something based on # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 # would be better. output_verbose_link_cmd='func_echo_all' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' ;; esac ;; esac ;; lynxos*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; m88k*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; mvs*) case $cc_basename in cxx*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' wlarc= _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no fi # Workaround some broken pre-1.5 toolchains output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' ;; *nto* | *qnx*) _LT_TAGVAR(ld_shlibs, $1)=yes ;; openbsd2*) # C++ shared libraries are fairly broken _LT_TAGVAR(ld_shlibs, $1)=no ;; openbsd*) if test -f /usr/libexec/ld.so; then _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' fi output_verbose_link_cmd=func_echo_all else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Archives containing C++ object files must be created using # the KAI C++ compiler. case $host in osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;; esac ;; RCC*) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; cxx*) case $host in osf3*) _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && func_echo_all "${wl}-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' ;; *) _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ echo "-hidden">> $lib.exp~ $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~ $RM $lib.exp' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' ;; esac _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test "$GXX" = yes && test "$with_gnu_ld" = no; then _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' case $host in osf3*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $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' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $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' ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; psos*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; lcc*) # Lucid # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; solaris*) case $cc_basename in CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_TAGVAR(archive_cmds_need_lc,$1)=yes _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=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'. # Supported since Solaris 2.6 (maybe 2.5.1?) _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;; esac _LT_TAGVAR(link_all_deplibs, $1)=yes output_verbose_link_cmd='func_echo_all' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' ;; gcx*) # Green Hills C++ Compiler _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' # The C++ compiler must be used to create the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs' ;; *) # GNU C++ compiler with Solaris linker if test "$GXX" = yes && test "$with_gnu_ld" = no; then _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs' if $CC --version | $GREP -v '^2\.7' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else # g++ 2.7 appears to require `-G' NOT `-shared' on this # platform. _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir' case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' ;; esac fi ;; esac ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' case $cc_basename in CC*) _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; 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. _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' runpath_var='LD_RUN_PATH' case $cc_basename in CC*) _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~ '"$_LT_TAGVAR(old_archive_cmds, $1)" _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~ '"$_LT_TAGVAR(reload_cmds, $1)" ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; vxworks*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no _LT_TAGVAR(GCC, $1)="$GXX" _LT_TAGVAR(LD, $1)="$LD" ## 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... _LT_SYS_HIDDEN_LIBDEPS($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS LDCXX=$LD LD=$lt_save_LD GCC=$lt_save_GCC with_gnu_ld=$lt_save_with_gnu_ld lt_cv_path_LDCXX=$lt_cv_path_LD lt_cv_path_LD=$lt_save_path_LD lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld fi # test "$_lt_caught_CXX_error" != yes AC_LANG_POP ])# _LT_LANG_CXX_CONFIG # _LT_FUNC_STRIPNAME_CNF # ---------------------- # func_stripname_cnf prefix suffix name # strip PREFIX and SUFFIX off of NAME. # PREFIX and SUFFIX must not contain globbing or regex special # characters, hashes, percent signs, but SUFFIX may contain a leading # dot (in which case that matches only a dot). # # This function is identical to the (non-XSI) version of func_stripname, # except this one can be used by m4 code that may be executed by configure, # rather than the libtool script. m4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl AC_REQUIRE([_LT_DECL_SED]) AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH]) func_stripname_cnf () { case ${2} in .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; esac } # func_stripname_cnf ])# _LT_FUNC_STRIPNAME_CNF # _LT_SYS_HIDDEN_LIBDEPS([TAGNAME]) # --------------------------------- # Figure out "hidden" library dependencies from verbose # compiler output when linking a shared library. # Parse the compiler output and extract the necessary # objects, libraries and library flags. m4_defun([_LT_SYS_HIDDEN_LIBDEPS], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl AC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl # Dependencies to place before and after the object being linked: _LT_TAGVAR(predep_objects, $1)= _LT_TAGVAR(postdep_objects, $1)= _LT_TAGVAR(predeps, $1)= _LT_TAGVAR(postdeps, $1)= _LT_TAGVAR(compiler_lib_search_path, $1)= dnl we can't use the lt_simple_compile_test_code here, dnl because it contains code intended for an executable, dnl not a library. It's possible we should let each dnl tag define a new lt_????_link_test_code variable, dnl but it's only used here... m4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF int a; void foo (void) { a = 0; } _LT_EOF ], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF class Foo { public: Foo (void) { a = 0; } private: int a; }; _LT_EOF ], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF subroutine foo implicit none integer*4 a a=0 return end _LT_EOF ], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF subroutine foo implicit none integer a a=0 return end _LT_EOF ], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF public class foo { private int a; public void bar (void) { a = 0; } }; _LT_EOF ], [$1], [GO], [cat > conftest.$ac_ext <<_LT_EOF package foo func foo() { } _LT_EOF ]) _lt_libdeps_save_CFLAGS=$CFLAGS case "$CC $CFLAGS " in #( *\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;; *\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;; *\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;; esac dnl Parse the compiler output and extract the necessary dnl objects, libraries and library flags. if AC_TRY_EVAL(ac_compile); then # Parse the compiler output and extract the necessary # objects, libraries and library flags. # Sentinel used to keep track of whether or not we are before # the conftest object file. pre_test_object_deps_done=no for p in `eval "$output_verbose_link_cmd"`; do case ${prev}${p} in -L* | -R* | -l*) # Some compilers place space between "-{L,R}" and the path. # Remove the space. if test $p = "-L" || test $p = "-R"; then prev=$p continue fi # Expand the sysroot to ease extracting the directories later. if test -z "$prev"; then case $p in -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;; -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;; -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;; esac fi case $p in =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;; esac if test "$pre_test_object_deps_done" = no; then case ${prev} in -L | -R) # Internal compiler library paths should come after those # provided the user. The postdeps already come after the # user supplied libs so there is no need to process them. if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then _LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}" else _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}" fi ;; # The "-l" case would never come before the object being # linked, so don't bother handling this case. esac else if test -z "$_LT_TAGVAR(postdeps, $1)"; then _LT_TAGVAR(postdeps, $1)="${prev}${p}" else _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}" fi fi prev= ;; *.lto.$objext) ;; # Ignore GCC LTO objects *.$objext) # This assumes that the test object file only shows up # once in the compiler output. if test "$p" = "conftest.$objext"; then pre_test_object_deps_done=yes continue fi if test "$pre_test_object_deps_done" = no; then if test -z "$_LT_TAGVAR(predep_objects, $1)"; then _LT_TAGVAR(predep_objects, $1)="$p" else _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p" fi else if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then _LT_TAGVAR(postdep_objects, $1)="$p" else _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p" fi fi ;; *) ;; # Ignore the rest. esac done # Clean up. rm -f a.out a.exe else echo "libtool.m4: error: problem compiling $1 test program" fi $RM -f confest.$objext CFLAGS=$_lt_libdeps_save_CFLAGS # PORTME: override above test on systems where it is broken m4_if([$1], [CXX], [case $host_os in interix[[3-9]]*) # Interix 3.5 installs completely hosed .la files for C++, so rather than # hack all around it, let's just trust "g++" to DTRT. _LT_TAGVAR(predep_objects,$1)= _LT_TAGVAR(postdep_objects,$1)= _LT_TAGVAR(postdeps,$1)= ;; linux*) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 # The more standards-conforming stlport4 library is # incompatible with the Cstd library. Avoid specifying # it if it's in CXXFLAGS. Ignore libCrun as # -library=stlport4 depends on it. case " $CXX $CXXFLAGS " in *" -library=stlport4 "*) solaris_use_stlport4=yes ;; esac if test "$solaris_use_stlport4" != yes; then _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' fi ;; esac ;; solaris*) case $cc_basename in CC* | sunCC*) # The more standards-conforming stlport4 library is # incompatible with the Cstd library. Avoid specifying # it if it's in CXXFLAGS. Ignore libCrun as # -library=stlport4 depends on it. case " $CXX $CXXFLAGS " in *" -library=stlport4 "*) solaris_use_stlport4=yes ;; esac # Adding this requires a known-good setup of shared libraries for # Sun compiler versions before 5.6, else PIC objects from an old # archive will be linked into the output, leading to subtle bugs. if test "$solaris_use_stlport4" != yes; then _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' fi ;; esac ;; esac ]) case " $_LT_TAGVAR(postdeps, $1) " in *" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; esac _LT_TAGVAR(compiler_lib_search_dirs, $1)= if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'` fi _LT_TAGDECL([], [compiler_lib_search_dirs], [1], [The directories searched by this compiler when creating a shared library]) _LT_TAGDECL([], [predep_objects], [1], [Dependencies to place before and after the objects being linked to create a shared library]) _LT_TAGDECL([], [postdep_objects], [1]) _LT_TAGDECL([], [predeps], [1]) _LT_TAGDECL([], [postdeps], [1]) _LT_TAGDECL([], [compiler_lib_search_path], [1], [The library search path used internally by the compiler when linking a shared library]) ])# _LT_SYS_HIDDEN_LIBDEPS # _LT_LANG_F77_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for a Fortran 77 compiler are # suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_F77_CONFIG], [AC_LANG_PUSH(Fortran 77) if test -z "$F77" || test "X$F77" = "Xno"; then _lt_disable_F77=yes fi _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for f77 test sources. ac_ext=f # Object file extension for compiled f77 test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the F77 compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test "$_lt_disable_F77" != yes; then # Code to be used in simple compile tests lt_simple_compile_test_code="\ subroutine t return end " # Code to be used in simple link tests lt_simple_link_test_code="\ program t end " # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC="$CC" lt_save_GCC=$GCC lt_save_CFLAGS=$CFLAGS CC=${F77-"f77"} CFLAGS=$FFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) GCC=$G77 if test -n "$compiler"; then AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) 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 AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_TAGVAR(GCC, $1)="$G77" _LT_TAGVAR(LD, $1)="$LD" ## 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... _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" GCC=$lt_save_GCC CC="$lt_save_CC" CFLAGS="$lt_save_CFLAGS" fi # test "$_lt_disable_F77" != yes AC_LANG_POP ])# _LT_LANG_F77_CONFIG # _LT_LANG_FC_CONFIG([TAG]) # ------------------------- # Ensure that the configuration variables for a Fortran compiler are # suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_FC_CONFIG], [AC_LANG_PUSH(Fortran) if test -z "$FC" || test "X$FC" = "Xno"; then _lt_disable_FC=yes fi _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for fc test sources. ac_ext=${ac_fc_srcext-f} # Object file extension for compiled fc test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the FC compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test "$_lt_disable_FC" != yes; then # Code to be used in simple compile tests lt_simple_compile_test_code="\ subroutine t return end " # Code to be used in simple link tests lt_simple_link_test_code="\ program t end " # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC="$CC" lt_save_GCC=$GCC lt_save_CFLAGS=$CFLAGS CC=${FC-"f95"} CFLAGS=$FCFLAGS compiler=$CC GCC=$ac_cv_fc_compiler_gnu _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) if test -n "$compiler"; then AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) 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 AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu" _LT_TAGVAR(LD, $1)="$LD" ## 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... _LT_SYS_HIDDEN_LIBDEPS($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS fi # test "$_lt_disable_FC" != yes AC_LANG_POP ])# _LT_LANG_FC_CONFIG # _LT_LANG_GCJ_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for the GNU Java Compiler compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_GCJ_CONFIG], [AC_REQUIRE([LT_PROG_GCJ])dnl AC_LANG_SAVE # Source file extension for Java test sources. ac_ext=java # Object file extension for compiled Java test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="class foo {}" # Code to be used in simple link tests lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC=yes CC=${GCJ-"gcj"} CFLAGS=$GCJFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_TAGVAR(LD, $1)="$LD" _LT_CC_BASENAME([$compiler]) # GCJ did not exist at the time GCC didn't implicitly link libc in. _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds ## 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_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi AC_LANG_RESTORE GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_GCJ_CONFIG # _LT_LANG_GO_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for the GNU Go compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_GO_CONFIG], [AC_REQUIRE([LT_PROG_GO])dnl AC_LANG_SAVE # Source file extension for Go test sources. ac_ext=go # Object file extension for compiled Go test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="package main; func main() { }" # Code to be used in simple link tests lt_simple_link_test_code='package main; func main() { }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC=yes CC=${GOC-"gccgo"} CFLAGS=$GOFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_TAGVAR(LD, $1)="$LD" _LT_CC_BASENAME([$compiler]) # Go did not exist at the time GCC didn't implicitly link libc in. _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds ## 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_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi AC_LANG_RESTORE GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_GO_CONFIG # _LT_LANG_RC_CONFIG([TAG]) # ------------------------- # Ensure that the configuration variables for the Windows resource compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_RC_CONFIG], [AC_REQUIRE([LT_PROG_RC])dnl AC_LANG_SAVE # Source file extension for RC test sources. ac_ext=rc # Object file extension for compiled RC test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }' # Code to be used in simple link tests lt_simple_link_test_code="$lt_simple_compile_test_code" # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC="$CC" lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC= CC=${RC-"windres"} CFLAGS= compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes if test -n "$compiler"; then : _LT_CONFIG($1) fi GCC=$lt_save_GCC AC_LANG_RESTORE CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_RC_CONFIG # LT_PROG_GCJ # ----------- AC_DEFUN([LT_PROG_GCJ], [m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ], [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ], [AC_CHECK_TOOL(GCJ, gcj,) test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2" AC_SUBST(GCJFLAGS)])])[]dnl ]) # Old name: AU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_GCJ], []) # LT_PROG_GO # ---------- AC_DEFUN([LT_PROG_GO], [AC_CHECK_TOOL(GOC, gccgo,) ]) # LT_PROG_RC # ---------- AC_DEFUN([LT_PROG_RC], [AC_CHECK_TOOL(RC, windres,) ]) # Old name: AU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_RC], []) # _LT_DECL_EGREP # -------------- # If we don't have a new enough Autoconf to choose the best grep # available, choose the one first in the user's PATH. m4_defun([_LT_DECL_EGREP], [AC_REQUIRE([AC_PROG_EGREP])dnl AC_REQUIRE([AC_PROG_FGREP])dnl test -z "$GREP" && GREP=grep _LT_DECL([], [GREP], [1], [A grep program that handles long lines]) _LT_DECL([], [EGREP], [1], [An ERE matcher]) _LT_DECL([], [FGREP], [1], [A literal string matcher]) dnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too AC_SUBST([GREP]) ]) # _LT_DECL_OBJDUMP # -------------- # If we don't have a new enough Autoconf to choose the best objdump # available, choose the one first in the user's PATH. m4_defun([_LT_DECL_OBJDUMP], [AC_CHECK_TOOL(OBJDUMP, objdump, false) test -z "$OBJDUMP" && OBJDUMP=objdump _LT_DECL([], [OBJDUMP], [1], [An object symbol dumper]) AC_SUBST([OBJDUMP]) ]) # _LT_DECL_DLLTOOL # ---------------- # Ensure DLLTOOL variable is set. m4_defun([_LT_DECL_DLLTOOL], [AC_CHECK_TOOL(DLLTOOL, dlltool, false) test -z "$DLLTOOL" && DLLTOOL=dlltool _LT_DECL([], [DLLTOOL], [1], [DLL creation program]) AC_SUBST([DLLTOOL]) ]) # _LT_DECL_SED # ------------ # Check for a fully-functional sed program, that truncates # as few characters as possible. Prefer GNU sed if found. m4_defun([_LT_DECL_SED], [AC_PROG_SED test -z "$SED" && SED=sed Xsed="$SED -e 1s/^X//" _LT_DECL([], [SED], [1], [A sed program that does not truncate output]) _LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"], [Sed that helps us avoid accidentally triggering echo(1) options like -n]) ])# _LT_DECL_SED m4_ifndef([AC_PROG_SED], [ ############################################################ # NOTE: This macro has been submitted for inclusion into # # GNU Autoconf as AC_PROG_SED. When it is available in # # a released version of Autoconf we should remove this # # macro and use it instead. # ############################################################ m4_defun([AC_PROG_SED], [AC_MSG_CHECKING([for a sed that does not truncate output]) AC_CACHE_VAL(lt_cv_path_SED, [# Loop through the user's path and test for sed and gsed. # Then use that list of sed's as ones to test for truncation. as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for lt_ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" fi done done done IFS=$as_save_IFS lt_ac_max=0 lt_ac_count=0 # Add /usr/xpg4/bin/sed as it is typically found on Solaris # along with /bin/sed that truncates output. for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do test ! -f $lt_ac_sed && continue cat /dev/null > conftest.in lt_ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >conftest.in # Check for GNU sed and select it if it is found. if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then lt_cv_path_SED=$lt_ac_sed break fi while true; do cat conftest.in conftest.in >conftest.tmp mv conftest.tmp conftest.in cp conftest.in conftest.nl echo >>conftest.nl $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break cmp -s conftest.out conftest.nl || break # 10000 chars as input seems more than enough test $lt_ac_count -gt 10 && break lt_ac_count=`expr $lt_ac_count + 1` if test $lt_ac_count -gt $lt_ac_max; then lt_ac_max=$lt_ac_count lt_cv_path_SED=$lt_ac_sed fi done done ]) SED=$lt_cv_path_SED AC_SUBST([SED]) AC_MSG_RESULT([$SED]) ])#AC_PROG_SED ])#m4_ifndef # Old name: AU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_SED], []) # _LT_CHECK_SHELL_FEATURES # ------------------------ # Find out whether the shell is Bourne or XSI compatible, # or has some other useful features. m4_defun([_LT_CHECK_SHELL_FEATURES], [AC_MSG_CHECKING([whether the shell understands some XSI constructs]) # 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 AC_MSG_RESULT([$xsi_shell]) _LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell']) AC_MSG_CHECKING([whether the shell understands "+="]) lt_shell_append=no ( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \ >/dev/null 2>&1 \ && lt_shell_append=yes AC_MSG_RESULT([$lt_shell_append]) _LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append']) if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then lt_unset=unset else lt_unset=false fi _LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl # 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 _LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl _LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl ])# _LT_CHECK_SHELL_FEATURES # _LT_PROG_FUNCTION_REPLACE (FUNCNAME, REPLACEMENT-BODY) # ------------------------------------------------------ # In `$cfgfile', look for function FUNCNAME delimited by `^FUNCNAME ()$' and # '^} FUNCNAME ', and replace its body with REPLACEMENT-BODY. m4_defun([_LT_PROG_FUNCTION_REPLACE], [dnl { sed -e '/^$1 ()$/,/^} # $1 /c\ $1 ()\ {\ m4_bpatsubsts([$2], [$], [\\], [^\([ ]\)], [\\\1]) } # Extended-shell $1 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=: ]) # _LT_PROG_REPLACE_SHELLFNS # ------------------------- # Replace existing portable implementations of several shell functions with # equivalent extended shell implementations where those features are available.. m4_defun([_LT_PROG_REPLACE_SHELLFNS], [if test x"$xsi_shell" = xyes; then _LT_PROG_FUNCTION_REPLACE([func_dirname], [dnl case ${1} in */*) func_dirname_result="${1%/*}${2}" ;; * ) func_dirname_result="${3}" ;; esac]) _LT_PROG_FUNCTION_REPLACE([func_basename], [dnl func_basename_result="${1##*/}"]) _LT_PROG_FUNCTION_REPLACE([func_dirname_and_basename], [dnl case ${1} in */*) func_dirname_result="${1%/*}${2}" ;; * ) func_dirname_result="${3}" ;; esac func_basename_result="${1##*/}"]) _LT_PROG_FUNCTION_REPLACE([func_stripname], [dnl # 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}"}]) _LT_PROG_FUNCTION_REPLACE([func_split_long_opt], [dnl func_split_long_opt_name=${1%%=*} func_split_long_opt_arg=${1#*=}]) _LT_PROG_FUNCTION_REPLACE([func_split_short_opt], [dnl func_split_short_opt_arg=${1#??} func_split_short_opt_name=${1%"$func_split_short_opt_arg"}]) _LT_PROG_FUNCTION_REPLACE([func_lo2o], [dnl case ${1} in *.lo) func_lo2o_result=${1%.lo}.${objext} ;; *) func_lo2o_result=${1} ;; esac]) _LT_PROG_FUNCTION_REPLACE([func_xform], [ func_xform_result=${1%.*}.lo]) _LT_PROG_FUNCTION_REPLACE([func_arith], [ func_arith_result=$(( $[*] ))]) _LT_PROG_FUNCTION_REPLACE([func_len], [ func_len_result=${#1}]) fi if test x"$lt_shell_append" = xyes; then _LT_PROG_FUNCTION_REPLACE([func_append], [ eval "${1}+=\\${2}"]) _LT_PROG_FUNCTION_REPLACE([func_append_quoted], [dnl func_quote_for_eval "${2}" dnl m4 expansion turns \\\\ into \\, and then the shell eval turns that into \ eval "${1}+=\\\\ \\$func_quote_for_eval_result"]) # 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 AC_MSG_WARN([Unable to substitute extended shell functions in $ofile]) fi ]) # _LT_PATH_CONVERSION_FUNCTIONS # ----------------------------- # Determine which file name conversion functions should be used by # func_to_host_file (and, implicitly, by func_to_host_path). These are needed # for certain cross-compile configurations and native mingw. m4_defun([_LT_PATH_CONVERSION_FUNCTIONS], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl AC_MSG_CHECKING([how to convert $build file names to $host format]) AC_CACHE_VAL(lt_cv_to_host_file_cmd, [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 ]) to_host_file_cmd=$lt_cv_to_host_file_cmd AC_MSG_RESULT([$lt_cv_to_host_file_cmd]) _LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd], [0], [convert $build file names to $host format])dnl AC_MSG_CHECKING([how to convert $build file names to toolchain format]) AC_CACHE_VAL(lt_cv_to_tool_file_cmd, [#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 ]) to_tool_file_cmd=$lt_cv_to_tool_file_cmd AC_MSG_RESULT([$lt_cv_to_tool_file_cmd]) _LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd], [0], [convert $build files to toolchain format])dnl ])# _LT_PATH_CONVERSION_FUNCTIONS pgpool-II-4.1.4/m4/ltoptions.m40000664000175000017500000003007313730350075013065 00000000000000# Helper functions for option handling. -*- Autoconf -*- # # Copyright (C) 2004, 2005, 2007, 2008, 2009 Free Software Foundation, # Inc. # Written by Gary V. Vaughan, 2004 # # This file 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. # serial 7 ltoptions.m4 # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])]) # _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME) # ------------------------------------------ m4_define([_LT_MANGLE_OPTION], [[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])]) # _LT_SET_OPTION(MACRO-NAME, OPTION-NAME) # --------------------------------------- # Set option OPTION-NAME for macro MACRO-NAME, and if there is a # matching handler defined, dispatch to it. Other OPTION-NAMEs are # saved as a flag. m4_define([_LT_SET_OPTION], [m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]), _LT_MANGLE_DEFUN([$1], [$2]), [m4_warning([Unknown $1 option `$2'])])[]dnl ]) # _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET]) # ------------------------------------------------------------ # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. m4_define([_LT_IF_OPTION], [m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])]) # _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET) # ------------------------------------------------------- # Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME # are set. m4_define([_LT_UNLESS_OPTIONS], [m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option), [m4_define([$0_found])])])[]dnl m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3 ])[]dnl ]) # _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST) # ---------------------------------------- # OPTION-LIST is a space-separated list of Libtool options associated # with MACRO-NAME. If any OPTION has a matching handler declared with # LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about # the unknown option and exit. m4_defun([_LT_SET_OPTIONS], [# Set options m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), [_LT_SET_OPTION([$1], _LT_Option)]) m4_if([$1],[LT_INIT],[ dnl dnl Simply set some default values (i.e off) if boolean options were not dnl specified: _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no ]) _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no ]) dnl dnl If no reference was made to various pairs of opposing options, then dnl we run the default mode handler for the pair. For example, if neither dnl `shared' nor `disable-shared' was passed, we enable building of shared dnl archives by default: _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED]) _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC]) _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC]) _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install], [_LT_ENABLE_FAST_INSTALL]) ]) ])# _LT_SET_OPTIONS ## --------------------------------- ## ## Macros to handle LT_INIT options. ## ## --------------------------------- ## # _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME) # ----------------------------------------- m4_define([_LT_MANGLE_DEFUN], [[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])]) # LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE) # ----------------------------------------------- m4_define([LT_OPTION_DEFINE], [m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl ])# LT_OPTION_DEFINE # dlopen # ------ LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes ]) AU_DEFUN([AC_LIBTOOL_DLOPEN], [_LT_SET_OPTION([LT_INIT], [dlopen]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `dlopen' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], []) # win32-dll # --------- # Declare package support for building win32 dll's. LT_OPTION_DEFINE([LT_INIT], [win32-dll], [enable_win32_dll=yes case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*) AC_CHECK_TOOL(AS, as, false) AC_CHECK_TOOL(DLLTOOL, dlltool, false) AC_CHECK_TOOL(OBJDUMP, objdump, false) ;; esac test -z "$AS" && AS=as _LT_DECL([], [AS], [1], [Assembler program])dnl test -z "$DLLTOOL" && DLLTOOL=dlltool _LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl test -z "$OBJDUMP" && OBJDUMP=objdump _LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl ])# win32-dll AU_DEFUN([AC_LIBTOOL_WIN32_DLL], [AC_REQUIRE([AC_CANONICAL_HOST])dnl _LT_SET_OPTION([LT_INIT], [win32-dll]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `win32-dll' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], []) # _LT_ENABLE_SHARED([DEFAULT]) # ---------------------------- # implement the --enable-shared flag, and supports the `shared' and # `disable-shared' LT_INIT options. # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. m4_define([_LT_ENABLE_SHARED], [m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([shared], [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@], [build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])], [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], [enable_shared=]_LT_ENABLE_SHARED_DEFAULT) _LT_DECL([build_libtool_libs], [enable_shared], [0], [Whether or not to build shared libraries]) ])# _LT_ENABLE_SHARED LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])]) # Old names: AC_DEFUN([AC_ENABLE_SHARED], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared]) ]) AC_DEFUN([AC_DISABLE_SHARED], [_LT_SET_OPTION([LT_INIT], [disable-shared]) ]) AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_ENABLE_SHARED], []) dnl AC_DEFUN([AM_DISABLE_SHARED], []) # _LT_ENABLE_STATIC([DEFAULT]) # ---------------------------- # implement the --enable-static flag, and support the `static' and # `disable-static' LT_INIT options. # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. m4_define([_LT_ENABLE_STATIC], [m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([static], [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@], [build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])], [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], [enable_static=]_LT_ENABLE_STATIC_DEFAULT) _LT_DECL([build_old_libs], [enable_static], [0], [Whether or not to build static libraries]) ])# _LT_ENABLE_STATIC LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])]) # Old names: AC_DEFUN([AC_ENABLE_STATIC], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static]) ]) AC_DEFUN([AC_DISABLE_STATIC], [_LT_SET_OPTION([LT_INIT], [disable-static]) ]) AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_ENABLE_STATIC], []) dnl AC_DEFUN([AM_DISABLE_STATIC], []) # _LT_ENABLE_FAST_INSTALL([DEFAULT]) # ---------------------------------- # implement the --enable-fast-install flag, and support the `fast-install' # and `disable-fast-install' LT_INIT options. # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. m4_define([_LT_ENABLE_FAST_INSTALL], [m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([fast-install], [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@], [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])], [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], [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT) _LT_DECL([fast_install], [enable_fast_install], [0], [Whether or not to optimize for fast installation])dnl ])# _LT_ENABLE_FAST_INSTALL LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])]) # Old names: AU_DEFUN([AC_ENABLE_FAST_INSTALL], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `fast-install' option into LT_INIT's first parameter.]) ]) AU_DEFUN([AC_DISABLE_FAST_INSTALL], [_LT_SET_OPTION([LT_INIT], [disable-fast-install]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `disable-fast-install' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], []) dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], []) # _LT_WITH_PIC([MODE]) # -------------------- # implement the --with-pic flag, and support the `pic-only' and `no-pic' # LT_INIT options. # MODE is either `yes' or `no'. If omitted, it defaults to `both'. m4_define([_LT_WITH_PIC], [AC_ARG_WITH([pic], [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@], [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], [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], [pic_mode=default]) test -z "$pic_mode" && pic_mode=m4_default([$1], [default]) _LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl ])# _LT_WITH_PIC LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])]) LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])]) # Old name: AU_DEFUN([AC_LIBTOOL_PICMODE], [_LT_SET_OPTION([LT_INIT], [pic-only]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `pic-only' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_PICMODE], []) ## ----------------- ## ## LTDL_INIT Options ## ## ----------------- ## m4_define([_LTDL_MODE], []) LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive], [m4_define([_LTDL_MODE], [nonrecursive])]) LT_OPTION_DEFINE([LTDL_INIT], [recursive], [m4_define([_LTDL_MODE], [recursive])]) LT_OPTION_DEFINE([LTDL_INIT], [subproject], [m4_define([_LTDL_MODE], [subproject])]) m4_define([_LTDL_TYPE], []) LT_OPTION_DEFINE([LTDL_INIT], [installable], [m4_define([_LTDL_TYPE], [installable])]) LT_OPTION_DEFINE([LTDL_INIT], [convenience], [m4_define([_LTDL_TYPE], [convenience])]) pgpool-II-4.1.4/m4/ltsugar.m40000664000175000017500000001042413730350075012511 00000000000000# ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*- # # Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc. # Written by Gary V. Vaughan, 2004 # # This file 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. # serial 6 ltsugar.m4 # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])]) # lt_join(SEP, ARG1, [ARG2...]) # ----------------------------- # Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their # associated separator. # Needed until we can rely on m4_join from Autoconf 2.62, since all earlier # versions in m4sugar had bugs. m4_define([lt_join], [m4_if([$#], [1], [], [$#], [2], [[$2]], [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])]) m4_define([_lt_join], [m4_if([$#$2], [2], [], [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])]) # lt_car(LIST) # lt_cdr(LIST) # ------------ # Manipulate m4 lists. # These macros are necessary as long as will still need to support # Autoconf-2.59 which quotes differently. m4_define([lt_car], [[$1]]) m4_define([lt_cdr], [m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])], [$#], 1, [], [m4_dquote(m4_shift($@))])]) m4_define([lt_unquote], $1) # lt_append(MACRO-NAME, STRING, [SEPARATOR]) # ------------------------------------------ # Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'. # Note that neither SEPARATOR nor STRING are expanded; they are appended # to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked). # No SEPARATOR is output if MACRO-NAME was previously undefined (different # than defined and empty). # # This macro is needed until we can rely on Autoconf 2.62, since earlier # versions of m4sugar mistakenly expanded SEPARATOR but not STRING. m4_define([lt_append], [m4_define([$1], m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])]) # lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...]) # ---------------------------------------------------------- # Produce a SEP delimited list of all paired combinations of elements of # PREFIX-LIST with SUFFIX1 through SUFFIXn. Each element of the list # has the form PREFIXmINFIXSUFFIXn. # Needed until we can rely on m4_combine added in Autoconf 2.62. m4_define([lt_combine], [m4_if(m4_eval([$# > 3]), [1], [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl [[m4_foreach([_Lt_prefix], [$2], [m4_foreach([_Lt_suffix], ]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[, [_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])]) # lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ]) # ----------------------------------------------------------------------- # Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited # by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ. m4_define([lt_if_append_uniq], [m4_ifdef([$1], [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1], [lt_append([$1], [$2], [$3])$4], [$5])], [lt_append([$1], [$2], [$3])$4])]) # lt_dict_add(DICT, KEY, VALUE) # ----------------------------- m4_define([lt_dict_add], [m4_define([$1($2)], [$3])]) # lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE) # -------------------------------------------- m4_define([lt_dict_add_subkey], [m4_define([$1($2:$3)], [$4])]) # lt_dict_fetch(DICT, KEY, [SUBKEY]) # ---------------------------------- m4_define([lt_dict_fetch], [m4_ifval([$3], m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]), m4_ifdef([$1($2)], [m4_defn([$1($2)])]))]) # lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE]) # ----------------------------------------------------------------- m4_define([lt_if_dict_fetch], [m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4], [$5], [$6])]) # lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...]) # -------------------------------------------------------------- m4_define([lt_dict_filter], [m4_if([$5], [], [], [lt_join(m4_quote(m4_default([$4], [[, ]])), lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]), [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl ]) pgpool-II-4.1.4/m4/ltversion.m40000664000175000017500000000126213730350075013055 00000000000000# ltversion.m4 -- version numbers -*- Autoconf -*- # # Copyright (C) 2004 Free Software Foundation, Inc. # Written by Scott James Remnant, 2004 # # This file 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. # @configure_input@ # serial 3337 ltversion.m4 # This file is part of GNU Libtool m4_define([LT_PACKAGE_VERSION], [2.4.2]) m4_define([LT_PACKAGE_REVISION], [1.3337]) AC_DEFUN([LTVERSION_VERSION], [macro_version='2.4.2' macro_revision='1.3337' _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) _LT_DECL(, macro_revision, 0) ]) pgpool-II-4.1.4/m4/lt~obsolete.m40000664000175000017500000001375613730350075013415 00000000000000# lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*- # # Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc. # Written by Scott James Remnant, 2004. # # This file 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. # serial 5 lt~obsolete.m4 # These exist entirely to fool aclocal when bootstrapping libtool. # # In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN) # which have later been changed to m4_define as they aren't part of the # exported API, or moved to Autoconf or Automake where they belong. # # The trouble is, aclocal is a bit thick. It'll see the old AC_DEFUN # in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us # using a macro with the same name in our local m4/libtool.m4 it'll # pull the old libtool.m4 in (it doesn't see our shiny new m4_define # and doesn't know about Autoconf macros at all.) # # So we provide this file, which has a silly filename so it's always # included after everything else. This provides aclocal with the # AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything # because those macros already exist, or will be overwritten later. # We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. # # Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here. # Yes, that means every name once taken will need to remain here until # we give up compatibility with versions before 1.7, at which point # we need to keep only those names which we still refer to. # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])]) m4_ifndef([AC_LIBTOOL_LINKER_OPTION], [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])]) m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP])]) m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])]) m4_ifndef([_LT_AC_SHELL_INIT], [AC_DEFUN([_LT_AC_SHELL_INIT])]) m4_ifndef([_LT_AC_SYS_LIBPATH_AIX], [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])]) m4_ifndef([_LT_PROG_LTMAIN], [AC_DEFUN([_LT_PROG_LTMAIN])]) m4_ifndef([_LT_AC_TAGVAR], [AC_DEFUN([_LT_AC_TAGVAR])]) m4_ifndef([AC_LTDL_ENABLE_INSTALL], [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])]) m4_ifndef([AC_LTDL_PREOPEN], [AC_DEFUN([AC_LTDL_PREOPEN])]) m4_ifndef([_LT_AC_SYS_COMPILER], [AC_DEFUN([_LT_AC_SYS_COMPILER])]) m4_ifndef([_LT_AC_LOCK], [AC_DEFUN([_LT_AC_LOCK])]) m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE], [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])]) m4_ifndef([_LT_AC_TRY_DLOPEN_SELF], [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])]) m4_ifndef([AC_LIBTOOL_PROG_CC_C_O], [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])]) m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])]) m4_ifndef([AC_LIBTOOL_OBJDIR], [AC_DEFUN([AC_LIBTOOL_OBJDIR])]) m4_ifndef([AC_LTDL_OBJDIR], [AC_DEFUN([AC_LTDL_OBJDIR])]) m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])]) m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP], [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])]) m4_ifndef([AC_PATH_MAGIC], [AC_DEFUN([AC_PATH_MAGIC])]) m4_ifndef([AC_PROG_LD_GNU], [AC_DEFUN([AC_PROG_LD_GNU])]) m4_ifndef([AC_PROG_LD_RELOAD_FLAG], [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])]) m4_ifndef([AC_DEPLIBS_CHECK_METHOD], [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])]) m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])]) m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])]) m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])]) m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])]) m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])]) m4_ifndef([LT_AC_PROG_EGREP], [AC_DEFUN([LT_AC_PROG_EGREP])]) m4_ifndef([LT_AC_PROG_SED], [AC_DEFUN([LT_AC_PROG_SED])]) m4_ifndef([_LT_CC_BASENAME], [AC_DEFUN([_LT_CC_BASENAME])]) m4_ifndef([_LT_COMPILER_BOILERPLATE], [AC_DEFUN([_LT_COMPILER_BOILERPLATE])]) m4_ifndef([_LT_LINKER_BOILERPLATE], [AC_DEFUN([_LT_LINKER_BOILERPLATE])]) m4_ifndef([_AC_PROG_LIBTOOL], [AC_DEFUN([_AC_PROG_LIBTOOL])]) m4_ifndef([AC_LIBTOOL_SETUP], [AC_DEFUN([AC_LIBTOOL_SETUP])]) m4_ifndef([_LT_AC_CHECK_DLFCN], [AC_DEFUN([_LT_AC_CHECK_DLFCN])]) m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])]) m4_ifndef([_LT_AC_TAGCONFIG], [AC_DEFUN([_LT_AC_TAGCONFIG])]) m4_ifndef([AC_DISABLE_FAST_INSTALL], [AC_DEFUN([AC_DISABLE_FAST_INSTALL])]) m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])]) m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])]) m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])]) m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])]) m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])]) m4_ifndef([_LT_AC_LANG_CXX_CONFIG], [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])]) m4_ifndef([_LT_AC_LANG_F77_CONFIG], [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])]) m4_ifndef([_LT_AC_LANG_GCJ_CONFIG], [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])]) m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])]) m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])]) m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])]) m4_ifndef([_LT_REQUIRED_DARWIN_CHECKS], [AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])]) m4_ifndef([_LT_AC_PROG_CXXCPP], [AC_DEFUN([_LT_AC_PROG_CXXCPP])]) m4_ifndef([_LT_PREPARE_SED_QUOTE_VARS], [AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])]) m4_ifndef([_LT_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])]) m4_ifndef([_LT_PROG_F77], [AC_DEFUN([_LT_PROG_F77])]) m4_ifndef([_LT_PROG_FC], [AC_DEFUN([_LT_PROG_FC])]) m4_ifndef([_LT_PROG_CXX], [AC_DEFUN([_LT_PROG_CXX])]) pgpool-II-4.1.4/Makefile.in0000664000175000017500000006136713730350075012327 00000000000000# Makefile.in generated by automake 1.13.4 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 = . DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(top_srcdir)/configure $(am__configure_deps) mkinstalldirs \ AUTHORS COPYING ChangeLog INSTALL NEWS README TODO compile \ config.guess config.sub depcomp install-sh missing ylwrap \ ltmain.sh ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/docbook.m4 \ $(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) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno config.status.lineno 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 = depcomp = am__depfiles_maybe = 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 \ cscope distdir dist dist-all distcheck 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 CSCOPE = cscope DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) am__remove_distdir = \ if test -d "$(distdir)"; then \ find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ && rm -rf "$(distdir)" \ || { sleep 5 && rm -rf "$(distdir)"; }; \ else :; fi am__post_remove_distdir = $(am__remove_distdir) 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" DIST_ARCHIVES = $(distdir).tar.gz GZIP_ENV = --best DIST_TARGETS = dist-gzip distuninstallcheck_listfiles = find . -type f -print am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' distcleancheck_listfiles = find . -type f -print ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CATALOG = @CATALOG@ CC = @CC@ CFLAGS = @CFLAGS@ COLLATEINDEX = @COLLATEINDEX@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DLLTOOL = @DLLTOOL@ DOCBOOKSTYLE = @DOCBOOKSTYLE@ 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@ JADE = @JADE@ 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@ LYNX = @LYNX@ 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@ NSGMLS = @NSGMLS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OSX = @OSX@ 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@ PERL = @PERL@ PGCONFIG = @PGCONFIG@ PGSQL_BIN_DIR = @PGSQL_BIN_DIR@ PGSQL_INCLUDE_DIR = @PGSQL_INCLUDE_DIR@ PGSQL_LIB_DIR = @PGSQL_LIB_DIR@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ STYLE = @STYLE@ SUNIFDEF = @SUNIFDEF@ VERSION = @VERSION@ XMLLINT = @XMLLINT@ XSLTPROC = @XSLTPROC@ XSLTPROC_HTML_FLAGS = @XSLTPROC_HTML_FLAGS@ 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__leading_dot = @am__leading_dot@ 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@ have_docbook = @have_docbook@ 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 -I @PGSQL_INCLUDE_DIR@ AUTOMAKE_OPTIONS = subdir-objects # suggested by libtoolize ACLOCAL_AMFLAGS = -I m4 SUBDIRS = src DIST_SUBDIRS = src doc doc.ja all: all-recursive .SUFFIXES: am--refresh: Makefile @: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ echo ' cd $(srcdir) && $(AUTOMAKE) --foreign --ignore-deps'; \ $(am__cd) $(srcdir) && $(AUTOMAKE) --foreign --ignore-deps \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign --ignore-deps Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign --ignore-deps Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ echo ' $(SHELL) ./config.status'; \ $(SHELL) ./config.status;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) $(am__cd) $(srcdir) && $(AUTOCONF) $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool config.lt # 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" cscope: cscope.files test ! -s cscope.files \ || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS) clean-cscope: -rm -f cscope.files cscope.files: clean-cscope cscopelist 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 -rm -f cscope.out cscope.in.out cscope.po.out cscope.files distdir: $(DISTFILES) $(am__remove_distdir) test -d "$(distdir)" || mkdir "$(distdir)" @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 -test -n "$(am__skip_mode_fix)" \ || find "$(distdir)" -type d ! -perm -755 \ -exec chmod u+rwx,go+rx {} \; -o \ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ || chmod -R a+r "$(distdir)" dist-gzip: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__post_remove_distdir) dist-bzip2: distdir tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 $(am__post_remove_distdir) dist-lzip: distdir tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz $(am__post_remove_distdir) dist-xz: distdir tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz $(am__post_remove_distdir) dist-tarZ: distdir tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__post_remove_distdir) dist-shar: distdir shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz $(am__post_remove_distdir) dist-zip: distdir -rm -f $(distdir).zip zip -rq $(distdir).zip $(distdir) $(am__post_remove_distdir) dist dist-all: $(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:' $(am__post_remove_distdir) # This target untars the dist file and tries a VPATH configuration. Then # it guarantees that the distribution is self-contained by making another # tarfile. distcheck: dist case '$(DIST_ARCHIVES)' in \ *.tar.gz*) \ GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ *.tar.lz*) \ lzip -dc $(distdir).tar.lz | $(am__untar) ;;\ *.tar.xz*) \ xz -dc $(distdir).tar.xz | $(am__untar) ;;\ *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ esac chmod -R a-w $(distdir) chmod u+w $(distdir) mkdir $(distdir)/_build $(distdir)/_inst chmod a-w $(distdir) test -d $(distdir)/_build || exit 0; \ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && am__cwd=`pwd` \ && $(am__cd) $(distdir)/_build \ && ../configure --srcdir=.. --prefix="$$dc_install_base" \ $(AM_DISTCHECK_CONFIGURE_FLAGS) \ $(DISTCHECK_CONFIGURE_FLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ && $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ && $(MAKE) $(AM_MAKEFLAGS) uninstall \ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ distuninstallcheck \ && chmod -R a-w "$$dc_install_base" \ && ({ \ (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ } || { rm -rf "$$dc_destdir"; exit 1; }) \ && rm -rf "$$dc_destdir" \ && $(MAKE) $(AM_MAKEFLAGS) dist \ && rm -rf $(DIST_ARCHIVES) \ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ && cd "$$am__cwd" \ || exit 1 $(am__post_remove_distdir) @(echo "$(distdir) archives ready for distribution: "; \ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' distuninstallcheck: @test -n '$(distuninstallcheck_dir)' || { \ echo 'ERROR: trying to run $@ with an empty' \ '$$(distuninstallcheck_dir)' >&2; \ exit 1; \ }; \ $(am__cd) '$(distuninstallcheck_dir)' || { \ echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \ exit 1; \ }; \ test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left after uninstall:" ; \ if test -n "$(DESTDIR)"; then \ echo " (check DESTDIR support)"; \ fi ; \ $(distuninstallcheck_listfiles) ; \ exit 1; } >&2 distcleancheck: distclean @if test '$(srcdir)' = . ; then \ echo "ERROR: distcleancheck can only run from a VPATH build" ; \ exit 1 ; \ fi @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left in build directory after distclean:" ; \ $(distcleancheck_listfiles) ; \ exit 1; } >&2 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 $(am__CONFIG_DISTCLEAN_FILES) -rm -f Makefile distclean-am: clean-am distclean-generic distclean-libtool \ 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 $(am__CONFIG_DISTCLEAN_FILES) -rm -rf $(top_srcdir)/autom4te.cache -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 \ am--refresh check check-am clean clean-cscope clean-generic \ clean-libtool cscope cscopelist-am ctags ctags-am dist \ dist-all dist-bzip2 dist-gzip dist-lzip dist-shar dist-tarZ \ dist-xz dist-zip distcheck distclean distclean-generic \ distclean-libtool distclean-tags distcleancheck distdir \ distuninstallcheck 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 docs: $(MAKE) -C doc all && $(MAKE) -C doc.ja all .PHONY: docs # 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-4.1.4/Makefile.am0000664000175000017500000000037113730350075012302 00000000000000#AM_CPPFLAGS = -D_GNU_SOURCE -I @PGSQL_INCLUDE_DIR@ AUTOMAKE_OPTIONS = subdir-objects # suggested by libtoolize ACLOCAL_AMFLAGS = -I m4 docs: $(MAKE) -C doc all && $(MAKE) -C doc.ja all .PHONY: docs SUBDIRS = src DIST_SUBDIRS = src doc doc.ja pgpool-II-4.1.4/configure0000775000175000017500000174317013730350127012167 00000000000000#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.69 for pgpool-II 4.1.4. # # 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@pgpool.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='4.1.4' PACKAGE_STRING='pgpool-II 4.1.4' PACKAGE_BUGREPORT='pgpool-hackers@pgpool.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_BIN_DIR PGSQL_LIB_DIR PGSQL_INCLUDE_DIR MEMCACHED_RPATH_OPT MEMCACHED_LINK_OPT MEMCACHED_INCLUDE_OPT PGCONFIG use_repl_snprintf_FALSE use_repl_snprintf_TRUE LIBOBJS STYLE_ENV_SET_FALSE STYLE_ENV_SET_TRUE STYLE XSLTPROC_HTML_FLAGS SUNIFDEF LYNX PERL OSX XMLLINT XSLTPROC COLLATEINDEX CATALOG DOCBOOKSTYLE have_docbook can_build_docs_FALSE can_build_docs_TRUE JADE NSGMLS 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__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_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_pgsql_bindir with_sunifdef 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 DOCBOOKSTYLE' # 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 4.1.4 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 4.1.4:";; 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-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-pgsql-bindir=DIR site executable files for PostgreSQL in DIR --with-sunifdef=DIR install path for sunifdef utility --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. DOCBOOKSTYLE location of DocBook stylesheets 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 4.1.4 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@pgpool.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 4.1.4, 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 am__api_version='1.13' 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"` # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` 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 # 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='4.1.4' 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 -' { $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" if test "x$CC" != xcc; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC and cc understand -c and -o together" >&5 $as_echo_n "checking whether $CC and cc understand -c and -o together... " >&6; } else { $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; } fi set dummy $CC; ac_cc=`$as_echo "$2" | sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'` if eval \${ac_cv_prog_cc_${ac_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. # We do the test twice because some compilers refuse to overwrite an # existing .o file with -o, though they will create one. ac_try='$CC -c conftest.$ac_ext -o conftest2.$ac_objext >&5' rm -f conftest2.* if { { 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; } && test -f conftest2.$ac_objext && { { 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 eval ac_cv_prog_cc_${ac_cc}_c_o=yes if test "x$CC" != xcc; then # Test first that cc exists at all. if { ac_try='cc -c conftest.$ac_ext >&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_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then ac_try='cc -c conftest.$ac_ext -o conftest2.$ac_objext >&5' rm -f conftest2.* if { { 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; } && test -f conftest2.$ac_objext && { { 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 # cc works too. : else # cc exists but doesn't like -o. eval ac_cv_prog_cc_${ac_cc}_c_o=no fi fi fi else eval ac_cv_prog_cc_${ac_cc}_c_o=no fi rm -f core conftest* fi if eval test \$ac_cv_prog_cc_${ac_cc}_c_o = yes; 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" >&5 $as_echo "no" >&6; } $as_echo "#define NO_MINUS_C_MINUS_O 1" >>confdefs.h fi # FIXME: we rely on the cache variable name because # there is no other way. set dummy $CC am_cc=`echo $2 | sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'` eval am_t=\$ac_cv_prog_cc_${am_cc}_c_o if test "$am_t" != 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 # Check for docbook for ac_prog in onsgmls nsgmls 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_NSGMLS+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$NSGMLS"; then ac_cv_prog_NSGMLS="$NSGMLS" # 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_NSGMLS="$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 NSGMLS=$ac_cv_prog_NSGMLS if test -n "$NSGMLS"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NSGMLS" >&5 $as_echo "$NSGMLS" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$NSGMLS" && break done for ac_prog in openjade jade 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_JADE+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$JADE"; then ac_cv_prog_JADE="$JADE" # 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_JADE="$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 JADE=$ac_cv_prog_JADE if test -n "$JADE"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $JADE" >&5 $as_echo "$JADE" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$JADE" && break done { $as_echo "$as_me:${as_lineno-$LINENO}: checking for DocBook V4.2" >&5 $as_echo_n "checking for DocBook V4.2... " >&6; } if ${pgac_cv_check_docbook+:} false; then : $as_echo_n "(cached) " >&6 else cat >conftest.sgml < test random testsect text EOF pgac_cv_check_docbook=no if test -n "$NSGMLS"; then $NSGMLS -s conftest.sgml 1>&5 2>&1 if test $? -eq 0; then pgac_cv_check_docbook=yes fi fi rm -f conftest.sgml fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_check_docbook" >&5 $as_echo "$pgac_cv_check_docbook" >&6; } have_docbook=$pgac_cv_check_docbook if test "$pgac_cv_check_docbook" = "yes"; then can_build_docs_TRUE= can_build_docs_FALSE='#' else can_build_docs_TRUE='#' can_build_docs_FALSE= fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for DocBook stylesheets" >&5 $as_echo_n "checking for DocBook stylesheets... " >&6; } if ${pgac_cv_path_stylesheets+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DOCBOOKSTYLE"; then pgac_cv_path_stylesheets=$DOCBOOKSTYLE else for pgac_prefix in /usr /usr/local /opt /sw; do for pgac_infix in share lib; do for pgac_postfix in \ sgml/stylesheets/nwalsh-modular \ sgml/stylesheets/docbook \ sgml/stylesheets/dsssl/docbook \ sgml/docbook-dsssl \ sgml/docbook/dsssl/modular \ sgml/docbook/stylesheet/dsssl/modular \ sgml/docbook/dsssl-stylesheets \ sgml/dsssl/docbook-dsssl-nwalsh do pgac_candidate=$pgac_prefix/$pgac_infix/$pgac_postfix if test -r "$pgac_candidate/html/docbook.dsl" \ && test -r "$pgac_candidate/print/docbook.dsl" then pgac_cv_path_stylesheets=$pgac_candidate break 3 fi done done done fi fi DOCBOOKSTYLE=$pgac_cv_path_stylesheets if test -n "$DOCBOOKSTYLE"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DOCBOOKSTYLE" >&5 $as_echo "$DOCBOOKSTYLE" >&6; } CATALOG="-c ${DOCBOOKSTYLE}/catalog" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } CATALOG= fi if test -n "$DOCBOOKSTYLE" -a -r "$DOCBOOKSTYLE/bin/collateindex.pl"; then COLLATEINDEX="$DOCBOOKSTYLE/bin/collateindex.pl" else # Extract the first word of "collateindex.pl", so it can be a program name with args. set dummy collateindex.pl; 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_path_COLLATEINDEX+:} false; then : $as_echo_n "(cached) " >&6 else case $COLLATEINDEX in [\\/]* | ?:[\\/]*) ac_cv_path_COLLATEINDEX="$COLLATEINDEX" # Let the user override the test with a path. ;; *) 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_path_COLLATEINDEX="$as_dir/$ac_word$ac_exec_ext" $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 ;; esac fi COLLATEINDEX=$ac_cv_path_COLLATEINDEX if test -n "$COLLATEINDEX"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $COLLATEINDEX" >&5 $as_echo "$COLLATEINDEX" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi for ac_prog in xsltproc 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_XSLTPROC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$XSLTPROC"; then ac_cv_prog_XSLTPROC="$XSLTPROC" # 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_XSLTPROC="$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 XSLTPROC=$ac_cv_prog_XSLTPROC if test -n "$XSLTPROC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XSLTPROC" >&5 $as_echo "$XSLTPROC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$XSLTPROC" && break done for ac_prog in xmllint 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_XMLLINT+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$XMLLINT"; then ac_cv_prog_XMLLINT="$XMLLINT" # 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_XMLLINT="$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 XMLLINT=$ac_cv_prog_XMLLINT if test -n "$XMLLINT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XMLLINT" >&5 $as_echo "$XMLLINT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$XMLLINT" && break done for ac_prog in osx sgml2xml sx 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_OSX+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OSX"; then ac_cv_prog_OSX="$OSX" # 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_OSX="$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 OSX=$ac_cv_prog_OSX if test -n "$OSX"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OSX" >&5 $as_echo "$OSX" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$OSX" && break done for ac_prog in perl 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_PERL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$PERL"; then ac_cv_prog_PERL="$PERL" # 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_PERL="$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 PERL=$ac_cv_prog_PERL if test -n "$PERL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PERL" >&5 $as_echo "$PERL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$PERL" && break done for ac_prog in lynx 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_LYNX+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$LYNX"; then ac_cv_prog_LYNX="$LYNX" # 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_LYNX="$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 LYNX=$ac_cv_prog_LYNX if test -n "$LYNX"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LYNX" >&5 $as_echo "$LYNX" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$LYNX" && break done for ac_prog in sunifdef 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_SUNIFDEF+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$SUNIFDEF"; then ac_cv_prog_SUNIFDEF="$SUNIFDEF" # 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_SUNIFDEF="$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 SUNIFDEF=$ac_cv_prog_SUNIFDEF if test -n "$SUNIFDEF"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $SUNIFDEF" >&5 $as_echo "$SUNIFDEF" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$SUNIFDEF" && break done if test ! -z "$STYLE"; then STYLE_ENV_SET_TRUE= STYLE_ENV_SET_FALSE='#' else STYLE_ENV_SET_TRUE='#' STYLE_ENV_SET_FALSE= fi 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 ac_fn_c_check_header_mongrel "$LINENO" "termios.h" "ac_cv_header_termios_h" "$ac_includes_default" if test "x$ac_cv_header_termios_h" = xyes; then : $as_echo "#define HAVE_TERMIOS_H 1" >>confdefs.h fi { $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 # config/c-compiler.m4 # PGAC_C_SIGNED # ------------- # Check if the C compiler understands signed types. # PGAC_C_SIGNED # PGAC_C_PRINTF_ARCHETYPE # ----------------------- # Select the format archetype to be used by gcc to check printf-type functions. # We prefer "gnu_printf", as that most closely matches the features supported # by src/port/snprintf.c (particularly the %m conversion spec). However, # on some NetBSD versions, that doesn't work while "__syslog__" does. # If all else fails, use "printf". # PGAC_PRINTF_ARCHETYPE # Subroutine: test $pgac_cv_printf_archetype, set $ac_archetype_ok to yes or no # PGAC_TEST_PRINTF_ARCHETYPE # 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_TYPE_128BIT_INT # --------------------- # Check if __int128 is a working 128 bit integer type, and if so # define PG_INT128_TYPE to that typename, and define ALIGNOF_PG_INT128_TYPE # as its alignment requirement. # # This currently only detects a GCC/clang extension, but support for other # environments may be added in the future. # # For the moment we only test for support for 128bit math; support for # 128bit literals and snprintf is not required. # PGAC_TYPE_128BIT_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_C_STATIC_ASSERT # -------------------- # Check if the C compiler understands _Static_assert(), # and define HAVE__STATIC_ASSERT if so. # # We actually check the syntax ({ _Static_assert(...) }), because we need # gcc-style compound expressions to be able to wrap the thing into macros. # PGAC_C_STATIC_ASSERT # PGAC_C_TYPEOF # ------------- # Check if the C compiler understands typeof or a variant. Define # HAVE_TYPEOF if so, and define 'typeof' to the actual key word. # # PGAC_C_TYPEOF # PGAC_C_TYPES_COMPATIBLE # ----------------------- # Check if the C compiler understands __builtin_types_compatible_p, # and define HAVE__BUILTIN_TYPES_COMPATIBLE_P if so. # # We check usage with __typeof__, though it's unlikely any compiler would # have the former and not the latter. # PGAC_C_TYPES_COMPATIBLE # PGAC_C_BUILTIN_CONSTANT_P # ------------------------- # Check if the C compiler understands __builtin_constant_p(), # and define HAVE__BUILTIN_CONSTANT_P if so. # We need __builtin_constant_p("string literal") to be true, but some older # compilers don't think that, so test for that case explicitly. # PGAC_C_BUILTIN_CONSTANT_P # PGAC_C_BUILTIN_OP_OVERFLOW # ------------------------- # Check if the C compiler understands __builtin_$op_overflow(), # and define HAVE__BUILTIN_OP_OVERFLOW if so. # # Check for the most complicated case, 64 bit multiplication, as a # proxy for all of the operations. To detect the case where the compiler # knows the function but library support is missing, we must link not just # compile, and store the results in global variables so the compiler doesn't # optimize away the call. # PGAC_C_BUILTIN_OP_OVERFLOW # PGAC_C_BUILTIN_UNREACHABLE # -------------------------- # Check if the C compiler understands __builtin_unreachable(), # and define HAVE__BUILTIN_UNREACHABLE if so. # # NB: Don't get the idea of putting a for(;;); or such before the # __builtin_unreachable() call. Some compilers would remove it before linking # and only a warning instead of an error would be produced. # PGAC_C_BUILTIN_UNREACHABLE # PGAC_C_COMPUTED_GOTO # ----------------------- # Check if the C compiler knows computed gotos (gcc extension, also # available in at least clang). If so, define HAVE_COMPUTED_GOTO. # # Checking whether computed gotos are supported syntax-wise ought to # be enough, as the syntax is otherwise illegal. # PGAC_C_COMPUTED_GOTO # PGAC_CHECK_BUILTIN_FUNC # ----------------------- # This is similar to AC_CHECK_FUNCS(), except that it will work for compiler # builtin functions, as that usually fails to. # The first argument is the function name, eg [__builtin_clzl], and the # second is its argument list, eg [unsigned long x]. The current coding # works only for a single argument named x; we might generalize that later. # It's assumed that the function's result type is coercible to int. # On success, we define "HAVEfuncname" (there's usually more than enough # underscores already, so we don't add another one). # PGAC_CHECK_BUILTIN_FUNC # PGAC_PROG_VARCC_VARFLAGS_OPT # ----------------------- # Given a compiler, variable name and a string, check if the compiler # supports the string as a command-line option. If it does, add the # string to the given variable. # PGAC_PROG_VARCC_VARFLAGS_OPT # 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_VAR_OPT # ----------------------- # Given a variable name and a string, check if the compiler supports # the string as a command-line option. If it does, add the string to # the given variable. # PGAC_PROG_CC_VAR_OPT # PGAC_PROG_VARCXX_VARFLAGS_OPT # ----------------------- # Given a compiler, variable name and a string, check if the compiler # supports the string as a command-line option. If it does, add the # string to the given variable. # PGAC_PROG_VARCXX_VARFLAGS_OPT # PGAC_PROG_CXX_CFLAGS_OPT # ----------------------- # Given a string, check if the compiler supports the string as a # command-line option. If it does, add the string to CXXFLAGS. # PGAC_PROG_CXX_VAR_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 # PGAC_HAVE_GCC__SYNC_CHAR_TAS # ------------------------- # Check if the C compiler understands __sync_lock_test_and_set(char), # and define HAVE_GCC__SYNC_CHAR_TAS # # NB: There are platforms where test_and_set is available but compare_and_swap # is not, so test this separately. # NB: Some platforms only do 32bit tas, others only do 8bit tas. Test both. # PGAC_HAVE_GCC__SYNC_CHAR_TAS # PGAC_HAVE_GCC__SYNC_INT32_TAS # ------------------------- # Check if the C compiler understands __sync_lock_test_and_set(), # and define HAVE_GCC__SYNC_INT32_TAS # PGAC_HAVE_GCC__SYNC_INT32_TAS # PGAC_HAVE_GCC__SYNC_INT32_CAS # ------------------------- # Check if the C compiler understands __sync_compare_and_swap() for 32bit # types, and define HAVE_GCC__SYNC_INT32_CAS if so. # PGAC_HAVE_GCC__SYNC_INT32_CAS # PGAC_HAVE_GCC__SYNC_INT64_CAS # ------------------------- # Check if the C compiler understands __sync_compare_and_swap() for 64bit # types, and define HAVE_GCC__SYNC_INT64_CAS if so. # PGAC_HAVE_GCC__SYNC_INT64_CAS # PGAC_HAVE_GCC__ATOMIC_INT32_CAS # ------------------------- # Check if the C compiler understands __atomic_compare_exchange_n() for 32bit # types, and define HAVE_GCC__ATOMIC_INT32_CAS if so. # PGAC_HAVE_GCC__ATOMIC_INT32_CAS # PGAC_HAVE_GCC__ATOMIC_INT64_CAS # ------------------------- # Check if the C compiler understands __atomic_compare_exchange_n() for 64bit # types, and define HAVE_GCC__ATOMIC_INT64_CAS if so. # PGAC_HAVE_GCC__ATOMIC_INT64_CAS # PGAC_SSE42_CRC32_INTRINSICS # ----------------------- # Check if the compiler supports the x86 CRC instructions added in SSE 4.2, # using the _mm_crc32_u8 and _mm_crc32_u32 intrinsic functions. (We don't # test the 8-byte variant, _mm_crc32_u64, but it is assumed to be present if # the other ones are, on x86-64 platforms) # # An optional compiler flag can be passed as argument (e.g. -msse4.2). If the # intrinsics are supported, sets pgac_sse42_crc32_intrinsics, and CFLAGS_SSE42. # PGAC_SSE42_CRC32_INTRINSICS # PGAC_ARMV8_CRC32C_INTRINSICS # ----------------------- # Check if the compiler supports the CRC32C instructions using the __crc32cb, # __crc32ch, __crc32cw, and __crc32cd intrinsic functions. These instructions # were first introduced in ARMv8 in the optional CRC Extension, and became # mandatory in ARMv8.1. # # An optional compiler flag can be passed as argument (e.g. # -march=armv8-a+crc). If the intrinsics are supported, sets # pgac_armv8_crc32c_intrinsics, and CFLAGS_ARMV8_CRC32C. # PGAC_ARMV8_CRC32C_INTRINSICS # 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 for ac_func in snprintf do : ac_fn_c_check_func "$LINENO" "snprintf" "ac_cv_func_snprintf" if test "x$ac_cv_func_snprintf" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_SNPRINTF 1 _ACEOF else pgac_need_repl_snprintf=yes fi done for ac_func in vsnprintf do : ac_fn_c_check_func "$LINENO" "vsnprintf" "ac_cv_func_vsnprintf" if test "x$ac_cv_func_vsnprintf" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_VSNPRINTF 1 _ACEOF else pgac_need_repl_snprintf=yes fi done { $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; } int main() { return (! 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; } int main() { return (! 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 # disable useless truncation warnings from gcc 8+ NOT_THE_CFLAGS="" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${CC} supports -Wformat-truncation, for NOT_THE_CFLAGS" >&5 $as_echo_n "checking whether ${CC} supports -Wformat-truncation, for NOT_THE_CFLAGS... " >&6; } if ${pgac_cv_prog_CC_cflags__Wformat_truncation+:} false; then : $as_echo_n "(cached) " >&6 else pgac_save_CFLAGS=$CFLAGS pgac_save_CC=$CC CC=${CC} CFLAGS="${NOT_THE_CFLAGS} -Wformat-truncation" ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : pgac_cv_prog_CC_cflags__Wformat_truncation=yes else pgac_cv_prog_CC_cflags__Wformat_truncation=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="$pgac_save_CFLAGS" CC="$pgac_save_CC" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_CC_cflags__Wformat_truncation" >&5 $as_echo "$pgac_cv_prog_CC_cflags__Wformat_truncation" >&6; } if test x"$pgac_cv_prog_CC_cflags__Wformat_truncation" = x"yes"; then NOT_THE_CFLAGS="${NOT_THE_CFLAGS} -Wformat-truncation" fi if test -n "$NOT_THE_CFLAGS"; then CFLAGS="$CFLAGS -Wno-format-truncation" 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 if test $pgac_need_repl_snprintf = yes; then use_repl_snprintf_TRUE= use_repl_snprintf_FALSE='#' else use_repl_snprintf_TRUE='#' use_repl_snprintf_FALSE= 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 syslog 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 __builtin_types_compatible_p" >&5 $as_echo_n "checking for __builtin_types_compatible_p... " >&6; } if ${pgac_cv__types_compatible+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { int x; static int y[__builtin_types_compatible_p(__typeof__(x), int)]; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : pgac_cv__types_compatible=yes else pgac_cv__types_compatible=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv__types_compatible" >&5 $as_echo "$pgac_cv__types_compatible" >&6; } if test x"$pgac_cv__types_compatible" = xyes ; then $as_echo "#define HAVE__BUILTIN_TYPES_COMPATIBLE_P 1" >>confdefs.h fi 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 PGSQL_BIN_DIR=/usr/local/pgsql/bin else PGSQL_INCLUDE_DIR=`pg_config --includedir` PGSQL_LIB_DIR=`pg_config --libdir` PGSQL_BIN_DIR=`pg_config --bindir` 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 PGSQL_BIN_DIR="$withval"/bin 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-pgsql-bindir was given. if test "${with_pgsql_bindir+set}" = set; then : withval=$with_pgsql_bindir; case "$withval" in "" | y | ye | yes | n | no) as_fn_error $? "*** You must supply an argument to the --with-pgsql-bindir option." "$LINENO" 5 ;; esac PGSQL_BIN_DIR="$withval" fi # Check whether --with-sunifdef was given. if test "${with_sunifdef+set}" = set; then : withval=$with_sunifdef; case "$withval" in "" | y | ye | yes | n | no) as_fn_error $? "*** You must supply an argument to the --with-sunifdef option." "$LINENO" 5 ;; esac SUNIFDEF="$withval"/sunifdef 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_new in -lssl" >&5 $as_echo_n "checking for SSL_new in -lssl... " >&6; } if ${ac_cv_lib_ssl_SSL_new+:} 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_new (); int main () { return SSL_new (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_ssl_SSL_new=yes else ac_cv_lib_ssl_SSL_new=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_new" >&5 $as_echo "$ac_cv_lib_ssl_SSL_new" >&6; } if test "x$ac_cv_lib_ssl_SSL_new" = 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 CFLAGS="$CFLAGS -fno-strict-aliasing" OLD_LDFLAGS="$LDFLAGS" LDFLAGS="-L$PGSQL_LIB_DIR $LDFLAGS" 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 doc/src/Makefile doc/src/sgml/Makefile doc.ja/Makefile doc.ja/src/Makefile doc.ja/src/sgml/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/pgenc/Makefile src/tools/pcp/Makefile src/tools/pgproto/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 -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 "${can_build_docs_TRUE}" && test -z "${can_build_docs_FALSE}"; then as_fn_error $? "conditional \"can_build_docs\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${STYLE_ENV_SET_TRUE}" && test -z "${STYLE_ENV_SET_FALSE}"; then as_fn_error $? "conditional \"STYLE_ENV_SET\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${use_repl_snprintf_TRUE}" && test -z "${use_repl_snprintf_FALSE}"; then as_fn_error $? "conditional \"use_repl_snprintf\" 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 4.1.4, 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 4.1.4 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 # # 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 "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" ;; "doc/src/Makefile") CONFIG_FILES="$CONFIG_FILES doc/src/Makefile" ;; "doc/src/sgml/Makefile") CONFIG_FILES="$CONFIG_FILES doc/src/sgml/Makefile" ;; "doc.ja/Makefile") CONFIG_FILES="$CONFIG_FILES doc.ja/Makefile" ;; "doc.ja/src/Makefile") CONFIG_FILES="$CONFIG_FILES doc.ja/src/Makefile" ;; "doc.ja/src/sgml/Makefile") CONFIG_FILES="$CONFIG_FILES doc.ja/src/sgml/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/pgenc/Makefile") CONFIG_FILES="$CONFIG_FILES src/tools/pgenc/Makefile" ;; "src/tools/pcp/Makefile") CONFIG_FILES="$CONFIG_FILES src/tools/pcp/Makefile" ;; "src/tools/pgproto/Makefile") CONFIG_FILES="$CONFIG_FILES src/tools/pgproto/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 "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-4.1.4/c-compiler.m40000664000175000017500000006000713730350075012544 00000000000000# Macros to detect C compiler features # config/c-compiler.m4 # PGAC_C_SIGNED # ------------- # Check if the C compiler understands signed types. AC_DEFUN([PGAC_C_SIGNED], [AC_CACHE_CHECK(for signed types, pgac_cv_c_signed, [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [signed char c; signed short s; signed int i;])], [pgac_cv_c_signed=yes], [pgac_cv_c_signed=no])]) if test x"$pgac_cv_c_signed" = xno ; then AC_DEFINE(signed,, [Define to empty if the C compiler does not understand signed types.]) fi])# PGAC_C_SIGNED # PGAC_C_PRINTF_ARCHETYPE # ----------------------- # Select the format archetype to be used by gcc to check printf-type functions. # We prefer "gnu_printf", as that most closely matches the features supported # by src/port/snprintf.c (particularly the %m conversion spec). However, # on some NetBSD versions, that doesn't work while "__syslog__" does. # If all else fails, use "printf". AC_DEFUN([PGAC_PRINTF_ARCHETYPE], [AC_CACHE_CHECK([for printf format archetype], pgac_cv_printf_archetype, [pgac_cv_printf_archetype=gnu_printf PGAC_TEST_PRINTF_ARCHETYPE if [[ "$ac_archetype_ok" = no ]]; then pgac_cv_printf_archetype=__syslog__ PGAC_TEST_PRINTF_ARCHETYPE if [[ "$ac_archetype_ok" = no ]]; then pgac_cv_printf_archetype=printf fi fi]) AC_DEFINE_UNQUOTED([PG_PRINTF_ATTRIBUTE], [$pgac_cv_printf_archetype], [Define to best printf format archetype, usually gnu_printf if available.]) ])# PGAC_PRINTF_ARCHETYPE # Subroutine: test $pgac_cv_printf_archetype, set $ac_archetype_ok to yes or no AC_DEFUN([PGAC_TEST_PRINTF_ARCHETYPE], [ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes AC_COMPILE_IFELSE([AC_LANG_PROGRAM( [extern void pgac_write(int ignore, const char *fmt,...) __attribute__((format($pgac_cv_printf_archetype, 2, 3)));], [pgac_write(0, "error %s: %m", "foo");])], [ac_archetype_ok=yes], [ac_archetype_ok=no]) ac_c_werror_flag=$ac_save_c_werror_flag ])# PGAC_TEST_PRINTF_ARCHETYPE # 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. AC_DEFUN([PGAC_TYPE_64BIT_INT], [define([Ac_define], [translit([have_$1_64], [a-z *], [A-Z_P])])dnl define([Ac_cachevar], [translit([pgac_cv_type_$1_64], [ *], [_p])])dnl AC_CACHE_CHECK([whether $1 is 64 bits], [Ac_cachevar], [AC_RUN_IFELSE([AC_LANG_SOURCE( [typedef $1 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; } int main() { return (! does_int64_work()); }])], [Ac_cachevar=yes], [Ac_cachevar=no], [# If cross-compiling, check the size reported by the compiler and # trust that the arithmetic works. AC_COMPILE_IFELSE([AC_LANG_BOOL_COMPILE_TRY([], [sizeof($1) == 8])], Ac_cachevar=yes, Ac_cachevar=no)])]) Ac_define=$Ac_cachevar if test x"$Ac_cachevar" = xyes ; then AC_DEFINE(Ac_define, 1, [Define to 1 if `]$1[' works and is 64 bits.]) fi undefine([Ac_define])dnl undefine([Ac_cachevar])dnl ])# PGAC_TYPE_64BIT_INT # PGAC_TYPE_128BIT_INT # --------------------- # Check if __int128 is a working 128 bit integer type, and if so # define PG_INT128_TYPE to that typename, and define ALIGNOF_PG_INT128_TYPE # as its alignment requirement. # # This currently only detects a GCC/clang extension, but support for other # environments may be added in the future. # # For the moment we only test for support for 128bit math; support for # 128bit literals and snprintf is not required. AC_DEFUN([PGAC_TYPE_128BIT_INT], [AC_CACHE_CHECK([for __int128], [pgac_cv__128bit_int], [AC_LINK_IFELSE([AC_LANG_PROGRAM([ /* * We don't actually run this test, just link it to verify that any support * functions needed for __int128 are present. * * These are globals to discourage the compiler from folding all the * arithmetic tests down to compile-time constants. We do not have * convenient support for 128bit literals at this point... */ __int128 a = 48828125; __int128 b = 97656250; ],[ __int128 c,d; a = (a << 12) + 1; /* 200000000001 */ b = (b << 12) + 5; /* 400000000005 */ /* try the most relevant arithmetic ops */ c = a * b; d = (c + b) / b; /* must use the results, else compiler may optimize arithmetic away */ if (d != a+1) return 1; ])], [pgac_cv__128bit_int=yes], [pgac_cv__128bit_int=no])]) if test x"$pgac_cv__128bit_int" = xyes ; then # Use of non-default alignment with __int128 tickles bugs in some compilers. # If not cross-compiling, we can test for bugs and disable use of __int128 # with buggy compilers. If cross-compiling, hope for the best. # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83925 AC_CACHE_CHECK([for __int128 alignment bug], [pgac_cv__128bit_int_bug], [AC_RUN_IFELSE([AC_LANG_PROGRAM([ /* This must match the corresponding code in c.h: */ #if defined(__GNUC__) || defined(__SUNPRO_C) || defined(__IBMC__) #define pg_attribute_aligned(a) __attribute__((aligned(a))) #endif typedef __int128 int128a #if defined(pg_attribute_aligned) pg_attribute_aligned(8) #endif ; int128a holder; void pass_by_val(void *buffer, int128a par) { holder = par; } ],[ long int i64 = 97656225L << 12; int128a q; pass_by_val(main, (int128a) i64); q = (int128a) i64; if (q != holder) return 1; ])], [pgac_cv__128bit_int_bug=ok], [pgac_cv__128bit_int_bug=broken], [pgac_cv__128bit_int_bug="assuming ok"])]) if test x"$pgac_cv__128bit_int_bug" != xbroken ; then AC_DEFINE(PG_INT128_TYPE, __int128, [Define to the name of a signed 128-bit integer type.]) AC_CHECK_ALIGNOF(PG_INT128_TYPE) fi fi])# PGAC_TYPE_128BIT_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. AC_DEFUN([PGAC_C_FUNCNAME_SUPPORT], [AC_CACHE_CHECK(for __func__, pgac_cv_funcname_func_support, [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include ], [printf("%s\n", __func__);])], [pgac_cv_funcname_func_support=yes], [pgac_cv_funcname_func_support=no])]) if test x"$pgac_cv_funcname_func_support" = xyes ; then AC_DEFINE(HAVE_FUNCNAME__FUNC, 1, [Define to 1 if your compiler understands __func__.]) else AC_CACHE_CHECK(for __FUNCTION__, pgac_cv_funcname_function_support, [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include ], [printf("%s\n", __FUNCTION__);])], [pgac_cv_funcname_function_support=yes], [pgac_cv_funcname_function_support=no])]) if test x"$pgac_cv_funcname_function_support" = xyes ; then AC_DEFINE(HAVE_FUNCNAME__FUNCTION, 1, [Define to 1 if your compiler understands __FUNCTION__.]) fi fi])# PGAC_C_FUNCNAME_SUPPORT # PGAC_C_STATIC_ASSERT # -------------------- # Check if the C compiler understands _Static_assert(), # and define HAVE__STATIC_ASSERT if so. # # We actually check the syntax ({ _Static_assert(...) }), because we need # gcc-style compound expressions to be able to wrap the thing into macros. AC_DEFUN([PGAC_C_STATIC_ASSERT], [AC_CACHE_CHECK(for _Static_assert, pgac_cv__static_assert, [AC_LINK_IFELSE([AC_LANG_PROGRAM([], [({ _Static_assert(1, "foo"); })])], [pgac_cv__static_assert=yes], [pgac_cv__static_assert=no])]) if test x"$pgac_cv__static_assert" = xyes ; then AC_DEFINE(HAVE__STATIC_ASSERT, 1, [Define to 1 if your compiler understands _Static_assert.]) fi])# PGAC_C_STATIC_ASSERT # PGAC_C_TYPEOF # ------------- # Check if the C compiler understands typeof or a variant. Define # HAVE_TYPEOF if so, and define 'typeof' to the actual key word. # AC_DEFUN([PGAC_C_TYPEOF], [AC_CACHE_CHECK(for typeof, pgac_cv_c_typeof, [pgac_cv_c_typeof=no for pgac_kw in typeof __typeof__ decltype; do AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [int x = 0; $pgac_kw(x) y; y = x; return y;])], [pgac_cv_c_typeof=$pgac_kw]) test "$pgac_cv_c_typeof" != no && break done]) if test "$pgac_cv_c_typeof" != no; then AC_DEFINE(HAVE_TYPEOF, 1, [Define to 1 if your compiler understands `typeof' or something similar.]) if test "$pgac_cv_c_typeof" != typeof; then AC_DEFINE_UNQUOTED(typeof, $pgac_cv_c_typeof, [Define to how the compiler spells `typeof'.]) fi fi])# PGAC_C_TYPEOF # PGAC_C_TYPES_COMPATIBLE # ----------------------- # Check if the C compiler understands __builtin_types_compatible_p, # and define HAVE__BUILTIN_TYPES_COMPATIBLE_P if so. # # We check usage with __typeof__, though it's unlikely any compiler would # have the former and not the latter. AC_DEFUN([PGAC_C_TYPES_COMPATIBLE], [AC_CACHE_CHECK(for __builtin_types_compatible_p, pgac_cv__types_compatible, [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [[ int x; static int y[__builtin_types_compatible_p(__typeof__(x), int)]; ]])], [pgac_cv__types_compatible=yes], [pgac_cv__types_compatible=no])]) if test x"$pgac_cv__types_compatible" = xyes ; then AC_DEFINE(HAVE__BUILTIN_TYPES_COMPATIBLE_P, 1, [Define to 1 if your compiler understands __builtin_types_compatible_p.]) fi])# PGAC_C_TYPES_COMPATIBLE # PGAC_C_BUILTIN_CONSTANT_P # ------------------------- # Check if the C compiler understands __builtin_constant_p(), # and define HAVE__BUILTIN_CONSTANT_P if so. # We need __builtin_constant_p("string literal") to be true, but some older # compilers don't think that, so test for that case explicitly. AC_DEFUN([PGAC_C_BUILTIN_CONSTANT_P], [AC_CACHE_CHECK(for __builtin_constant_p, pgac_cv__builtin_constant_p, [AC_COMPILE_IFELSE([AC_LANG_SOURCE( [[static int x; static int y[__builtin_constant_p(x) ? x : 1]; static int z[__builtin_constant_p("string literal") ? 1 : x]; ]] )], [pgac_cv__builtin_constant_p=yes], [pgac_cv__builtin_constant_p=no])]) if test x"$pgac_cv__builtin_constant_p" = xyes ; then AC_DEFINE(HAVE__BUILTIN_CONSTANT_P, 1, [Define to 1 if your compiler understands __builtin_constant_p.]) fi])# PGAC_C_BUILTIN_CONSTANT_P # PGAC_C_BUILTIN_OP_OVERFLOW # ------------------------- # Check if the C compiler understands __builtin_$op_overflow(), # and define HAVE__BUILTIN_OP_OVERFLOW if so. # # Check for the most complicated case, 64 bit multiplication, as a # proxy for all of the operations. To detect the case where the compiler # knows the function but library support is missing, we must link not just # compile, and store the results in global variables so the compiler doesn't # optimize away the call. AC_DEFUN([PGAC_C_BUILTIN_OP_OVERFLOW], [AC_CACHE_CHECK(for __builtin_mul_overflow, pgac_cv__builtin_op_overflow, [AC_LINK_IFELSE([AC_LANG_PROGRAM([ PG_INT64_TYPE a = 1; PG_INT64_TYPE b = 1; PG_INT64_TYPE result; int oflo; ], [oflo = __builtin_mul_overflow(a, b, &result);])], [pgac_cv__builtin_op_overflow=yes], [pgac_cv__builtin_op_overflow=no])]) if test x"$pgac_cv__builtin_op_overflow" = xyes ; then AC_DEFINE(HAVE__BUILTIN_OP_OVERFLOW, 1, [Define to 1 if your compiler understands __builtin_$op_overflow.]) fi])# PGAC_C_BUILTIN_OP_OVERFLOW # PGAC_C_BUILTIN_UNREACHABLE # -------------------------- # Check if the C compiler understands __builtin_unreachable(), # and define HAVE__BUILTIN_UNREACHABLE if so. # # NB: Don't get the idea of putting a for(;;); or such before the # __builtin_unreachable() call. Some compilers would remove it before linking # and only a warning instead of an error would be produced. AC_DEFUN([PGAC_C_BUILTIN_UNREACHABLE], [AC_CACHE_CHECK(for __builtin_unreachable, pgac_cv__builtin_unreachable, [AC_LINK_IFELSE([AC_LANG_PROGRAM([], [__builtin_unreachable();])], [pgac_cv__builtin_unreachable=yes], [pgac_cv__builtin_unreachable=no])]) if test x"$pgac_cv__builtin_unreachable" = xyes ; then AC_DEFINE(HAVE__BUILTIN_UNREACHABLE, 1, [Define to 1 if your compiler understands __builtin_unreachable.]) fi])# PGAC_C_BUILTIN_UNREACHABLE # PGAC_C_COMPUTED_GOTO # ----------------------- # Check if the C compiler knows computed gotos (gcc extension, also # available in at least clang). If so, define HAVE_COMPUTED_GOTO. # # Checking whether computed gotos are supported syntax-wise ought to # be enough, as the syntax is otherwise illegal. AC_DEFUN([PGAC_C_COMPUTED_GOTO], [AC_CACHE_CHECK(for computed goto support, pgac_cv_computed_goto, [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [[void *labeladdrs[] = {&&my_label}; goto *labeladdrs[0]; my_label: return 1; ]])], [pgac_cv_computed_goto=yes], [pgac_cv_computed_goto=no])]) if test x"$pgac_cv_computed_goto" = xyes ; then AC_DEFINE(HAVE_COMPUTED_GOTO, 1, [Define to 1 if your compiler handles computed gotos.]) fi])# PGAC_C_COMPUTED_GOTO # PGAC_CHECK_BUILTIN_FUNC # ----------------------- # This is similar to AC_CHECK_FUNCS(), except that it will work for compiler # builtin functions, as that usually fails to. # The first argument is the function name, eg [__builtin_clzl], and the # second is its argument list, eg [unsigned long x]. The current coding # works only for a single argument named x; we might generalize that later. # It's assumed that the function's result type is coercible to int. # On success, we define "HAVEfuncname" (there's usually more than enough # underscores already, so we don't add another one). AC_DEFUN([PGAC_CHECK_BUILTIN_FUNC], [AC_CACHE_CHECK(for $1, pgac_cv$1, [AC_LINK_IFELSE([AC_LANG_PROGRAM([ int call$1($2) { return $1(x); }], [])], [pgac_cv$1=yes], [pgac_cv$1=no])]) if test x"${pgac_cv$1}" = xyes ; then AC_DEFINE_UNQUOTED(AS_TR_CPP([HAVE$1]), 1, [Define to 1 if your compiler understands $1.]) fi])# PGAC_CHECK_BUILTIN_FUNC # PGAC_PROG_VARCC_VARFLAGS_OPT # ----------------------- # Given a compiler, variable name and a string, check if the compiler # supports the string as a command-line option. If it does, add the # string to the given variable. AC_DEFUN([PGAC_PROG_VARCC_VARFLAGS_OPT], [define([Ac_cachevar], [AS_TR_SH([pgac_cv_prog_$1_cflags_$3])])dnl AC_CACHE_CHECK([whether ${$1} supports $3, for $2], [Ac_cachevar], [pgac_save_CFLAGS=$CFLAGS pgac_save_CC=$CC CC=${$1} CFLAGS="${$2} $3" ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes _AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [Ac_cachevar=yes], [Ac_cachevar=no]) ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="$pgac_save_CFLAGS" CC="$pgac_save_CC"]) if test x"$Ac_cachevar" = x"yes"; then $2="${$2} $3" fi undefine([Ac_cachevar])dnl ])# PGAC_PROG_VARCC_VARFLAGS_OPT # 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. AC_DEFUN([PGAC_PROG_CC_CFLAGS_OPT], [ PGAC_PROG_VARCC_VARFLAGS_OPT(CC, CFLAGS, $1) ])# PGAC_PROG_CC_CFLAGS_OPT # PGAC_PROG_CC_VAR_OPT # ----------------------- # Given a variable name and a string, check if the compiler supports # the string as a command-line option. If it does, add the string to # the given variable. AC_DEFUN([PGAC_PROG_CC_VAR_OPT], [PGAC_PROG_VARCC_VARFLAGS_OPT(CC, $1, $2) ])# PGAC_PROG_CC_VAR_OPT # PGAC_PROG_VARCXX_VARFLAGS_OPT # ----------------------- # Given a compiler, variable name and a string, check if the compiler # supports the string as a command-line option. If it does, add the # string to the given variable. AC_DEFUN([PGAC_PROG_VARCXX_VARFLAGS_OPT], [define([Ac_cachevar], [AS_TR_SH([pgac_cv_prog_$1_cxxflags_$3])])dnl AC_CACHE_CHECK([whether ${$1} supports $3, for $2], [Ac_cachevar], [pgac_save_CXXFLAGS=$CXXFLAGS pgac_save_CXX=$CXX CXX=${$1} CXXFLAGS="${$2} $3" ac_save_cxx_werror_flag=$ac_cxx_werror_flag ac_cxx_werror_flag=yes AC_LANG_PUSH(C++) _AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [Ac_cachevar=yes], [Ac_cachevar=no]) AC_LANG_POP([]) ac_cxx_werror_flag=$ac_save_cxx_werror_flag CXXFLAGS="$pgac_save_CXXFLAGS" CXX="$pgac_save_CXX"]) if test x"$Ac_cachevar" = x"yes"; then $2="${$2} $3" fi undefine([Ac_cachevar])dnl ])# PGAC_PROG_VARCXX_VARFLAGS_OPT # PGAC_PROG_CXX_CFLAGS_OPT # ----------------------- # Given a string, check if the compiler supports the string as a # command-line option. If it does, add the string to CXXFLAGS. AC_DEFUN([PGAC_PROG_CXX_CFLAGS_OPT], [PGAC_PROG_VARCXX_VARFLAGS_OPT(CXX, CXXFLAGS, $1) ])# PGAC_PROG_CXX_VAR_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 :-( AC_DEFUN([PGAC_PROG_CC_LDFLAGS_OPT], [define([Ac_cachevar], [AS_TR_SH([pgac_cv_prog_cc_ldflags_$1])])dnl AC_CACHE_CHECK([whether $CC supports $1], [Ac_cachevar], [pgac_save_LDFLAGS=$LDFLAGS LDFLAGS="$pgac_save_LDFLAGS $1" AC_RUN_IFELSE([AC_LANG_PROGRAM([extern void $2 (); void (*fptr) () = $2;],[])], [Ac_cachevar=yes], [Ac_cachevar=no], [Ac_cachevar="assuming no"]) LDFLAGS="$pgac_save_LDFLAGS"]) if test x"$Ac_cachevar" = x"yes"; then LDFLAGS="$LDFLAGS $1" fi undefine([Ac_cachevar])dnl ])# PGAC_PROG_CC_LDFLAGS_OPT # PGAC_HAVE_GCC__SYNC_CHAR_TAS # ------------------------- # Check if the C compiler understands __sync_lock_test_and_set(char), # and define HAVE_GCC__SYNC_CHAR_TAS # # NB: There are platforms where test_and_set is available but compare_and_swap # is not, so test this separately. # NB: Some platforms only do 32bit tas, others only do 8bit tas. Test both. AC_DEFUN([PGAC_HAVE_GCC__SYNC_CHAR_TAS], [AC_CACHE_CHECK(for builtin __sync char locking functions, pgac_cv_gcc_sync_char_tas, [AC_LINK_IFELSE([AC_LANG_PROGRAM([], [char lock = 0; __sync_lock_test_and_set(&lock, 1); __sync_lock_release(&lock);])], [pgac_cv_gcc_sync_char_tas="yes"], [pgac_cv_gcc_sync_char_tas="no"])]) if test x"$pgac_cv_gcc_sync_char_tas" = x"yes"; then AC_DEFINE(HAVE_GCC__SYNC_CHAR_TAS, 1, [Define to 1 if you have __sync_lock_test_and_set(char *) and friends.]) fi])# PGAC_HAVE_GCC__SYNC_CHAR_TAS # PGAC_HAVE_GCC__SYNC_INT32_TAS # ------------------------- # Check if the C compiler understands __sync_lock_test_and_set(), # and define HAVE_GCC__SYNC_INT32_TAS AC_DEFUN([PGAC_HAVE_GCC__SYNC_INT32_TAS], [AC_CACHE_CHECK(for builtin __sync int32 locking functions, pgac_cv_gcc_sync_int32_tas, [AC_LINK_IFELSE([AC_LANG_PROGRAM([], [int lock = 0; __sync_lock_test_and_set(&lock, 1); __sync_lock_release(&lock);])], [pgac_cv_gcc_sync_int32_tas="yes"], [pgac_cv_gcc_sync_int32_tas="no"])]) if test x"$pgac_cv_gcc_sync_int32_tas" = x"yes"; then AC_DEFINE(HAVE_GCC__SYNC_INT32_TAS, 1, [Define to 1 if you have __sync_lock_test_and_set(int *) and friends.]) fi])# PGAC_HAVE_GCC__SYNC_INT32_TAS # PGAC_HAVE_GCC__SYNC_INT32_CAS # ------------------------- # Check if the C compiler understands __sync_compare_and_swap() for 32bit # types, and define HAVE_GCC__SYNC_INT32_CAS if so. AC_DEFUN([PGAC_HAVE_GCC__SYNC_INT32_CAS], [AC_CACHE_CHECK(for builtin __sync int32 atomic operations, pgac_cv_gcc_sync_int32_cas, [AC_LINK_IFELSE([AC_LANG_PROGRAM([], [int val = 0; __sync_val_compare_and_swap(&val, 0, 37);])], [pgac_cv_gcc_sync_int32_cas="yes"], [pgac_cv_gcc_sync_int32_cas="no"])]) if test x"$pgac_cv_gcc_sync_int32_cas" = x"yes"; then AC_DEFINE(HAVE_GCC__SYNC_INT32_CAS, 1, [Define to 1 if you have __sync_val_compare_and_swap(int *, int, int).]) fi])# PGAC_HAVE_GCC__SYNC_INT32_CAS # PGAC_HAVE_GCC__SYNC_INT64_CAS # ------------------------- # Check if the C compiler understands __sync_compare_and_swap() for 64bit # types, and define HAVE_GCC__SYNC_INT64_CAS if so. AC_DEFUN([PGAC_HAVE_GCC__SYNC_INT64_CAS], [AC_CACHE_CHECK(for builtin __sync int64 atomic operations, pgac_cv_gcc_sync_int64_cas, [AC_LINK_IFELSE([AC_LANG_PROGRAM([], [PG_INT64_TYPE lock = 0; __sync_val_compare_and_swap(&lock, 0, (PG_INT64_TYPE) 37);])], [pgac_cv_gcc_sync_int64_cas="yes"], [pgac_cv_gcc_sync_int64_cas="no"])]) if test x"$pgac_cv_gcc_sync_int64_cas" = x"yes"; then AC_DEFINE(HAVE_GCC__SYNC_INT64_CAS, 1, [Define to 1 if you have __sync_val_compare_and_swap(int64 *, int64, int64).]) fi])# PGAC_HAVE_GCC__SYNC_INT64_CAS # PGAC_HAVE_GCC__ATOMIC_INT32_CAS # ------------------------- # Check if the C compiler understands __atomic_compare_exchange_n() for 32bit # types, and define HAVE_GCC__ATOMIC_INT32_CAS if so. AC_DEFUN([PGAC_HAVE_GCC__ATOMIC_INT32_CAS], [AC_CACHE_CHECK(for builtin __atomic int32 atomic operations, pgac_cv_gcc_atomic_int32_cas, [AC_LINK_IFELSE([AC_LANG_PROGRAM([], [int val = 0; int expect = 0; __atomic_compare_exchange_n(&val, &expect, 37, 0, __ATOMIC_SEQ_CST, __ATOMIC_RELAXED);])], [pgac_cv_gcc_atomic_int32_cas="yes"], [pgac_cv_gcc_atomic_int32_cas="no"])]) if test x"$pgac_cv_gcc_atomic_int32_cas" = x"yes"; then AC_DEFINE(HAVE_GCC__ATOMIC_INT32_CAS, 1, [Define to 1 if you have __atomic_compare_exchange_n(int *, int *, int).]) fi])# PGAC_HAVE_GCC__ATOMIC_INT32_CAS # PGAC_HAVE_GCC__ATOMIC_INT64_CAS # ------------------------- # Check if the C compiler understands __atomic_compare_exchange_n() for 64bit # types, and define HAVE_GCC__ATOMIC_INT64_CAS if so. AC_DEFUN([PGAC_HAVE_GCC__ATOMIC_INT64_CAS], [AC_CACHE_CHECK(for builtin __atomic int64 atomic operations, pgac_cv_gcc_atomic_int64_cas, [AC_LINK_IFELSE([AC_LANG_PROGRAM([], [PG_INT64_TYPE val = 0; PG_INT64_TYPE expect = 0; __atomic_compare_exchange_n(&val, &expect, 37, 0, __ATOMIC_SEQ_CST, __ATOMIC_RELAXED);])], [pgac_cv_gcc_atomic_int64_cas="yes"], [pgac_cv_gcc_atomic_int64_cas="no"])]) if test x"$pgac_cv_gcc_atomic_int64_cas" = x"yes"; then AC_DEFINE(HAVE_GCC__ATOMIC_INT64_CAS, 1, [Define to 1 if you have __atomic_compare_exchange_n(int64 *, int64 *, int64).]) fi])# PGAC_HAVE_GCC__ATOMIC_INT64_CAS # PGAC_SSE42_CRC32_INTRINSICS # ----------------------- # Check if the compiler supports the x86 CRC instructions added in SSE 4.2, # using the _mm_crc32_u8 and _mm_crc32_u32 intrinsic functions. (We don't # test the 8-byte variant, _mm_crc32_u64, but it is assumed to be present if # the other ones are, on x86-64 platforms) # # An optional compiler flag can be passed as argument (e.g. -msse4.2). If the # intrinsics are supported, sets pgac_sse42_crc32_intrinsics, and CFLAGS_SSE42. AC_DEFUN([PGAC_SSE42_CRC32_INTRINSICS], [define([Ac_cachevar], [AS_TR_SH([pgac_cv_sse42_crc32_intrinsics_$1])])dnl AC_CACHE_CHECK([for _mm_crc32_u8 and _mm_crc32_u32 with CFLAGS=$1], [Ac_cachevar], [pgac_save_CFLAGS=$CFLAGS CFLAGS="$pgac_save_CFLAGS $1" AC_LINK_IFELSE([AC_LANG_PROGRAM([#include ], [unsigned int crc = 0; crc = _mm_crc32_u8(crc, 0); crc = _mm_crc32_u32(crc, 0); /* return computed value, to prevent the above being optimized away */ return crc == 0;])], [Ac_cachevar=yes], [Ac_cachevar=no]) CFLAGS="$pgac_save_CFLAGS"]) if test x"$Ac_cachevar" = x"yes"; then CFLAGS_SSE42="$1" pgac_sse42_crc32_intrinsics=yes fi undefine([Ac_cachevar])dnl ])# PGAC_SSE42_CRC32_INTRINSICS # PGAC_ARMV8_CRC32C_INTRINSICS # ----------------------- # Check if the compiler supports the CRC32C instructions using the __crc32cb, # __crc32ch, __crc32cw, and __crc32cd intrinsic functions. These instructions # were first introduced in ARMv8 in the optional CRC Extension, and became # mandatory in ARMv8.1. # # An optional compiler flag can be passed as argument (e.g. # -march=armv8-a+crc). If the intrinsics are supported, sets # pgac_armv8_crc32c_intrinsics, and CFLAGS_ARMV8_CRC32C. AC_DEFUN([PGAC_ARMV8_CRC32C_INTRINSICS], [define([Ac_cachevar], [AS_TR_SH([pgac_cv_armv8_crc32c_intrinsics_$1])])dnl AC_CACHE_CHECK([for __crc32cb, __crc32ch, __crc32cw, and __crc32cd with CFLAGS=$1], [Ac_cachevar], [pgac_save_CFLAGS=$CFLAGS CFLAGS="$pgac_save_CFLAGS $1" AC_LINK_IFELSE([AC_LANG_PROGRAM([#include ], [unsigned int crc = 0; crc = __crc32cb(crc, 0); crc = __crc32ch(crc, 0); crc = __crc32cw(crc, 0); crc = __crc32cd(crc, 0); /* return computed value, to prevent the above being optimized away */ return crc == 0;])], [Ac_cachevar=yes], [Ac_cachevar=no]) CFLAGS="$pgac_save_CFLAGS"]) if test x"$Ac_cachevar" = x"yes"; then CFLAGS_ARMV8_CRC32C="$1" pgac_armv8_crc32c_intrinsics=yes fi undefine([Ac_cachevar])dnl ])# PGAC_ARMV8_CRC32C_INTRINSICS pgpool-II-4.1.4/c-library.m40000664000175000017500000002502413730350075012376 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-4.1.4/general.m40000664000175000017500000001351013730350075012124 00000000000000# $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") m4_define([pgac_arg_to_variable], [$1[]_[]patsubst($2, -, _)]) # 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. AC_DEFUN([PGAC_ARG], [ pgac_args="$pgac_args pgac_arg_to_variable([$1],[$2])" m4_case([$1], enable, [ AC_ARG_ENABLE([$2], [AS_HELP_STRING([--]m4_if($3, -, disable, enable)[-$2]m4_if($3, -, , $3), [$4])], [ case [$]enableval in yes) m4_default([$5], :) ;; no) m4_default([$6], :) ;; *) $7 ;; esac ], [$8])[]dnl AC_ARG_ENABLE ], with, [ AC_ARG_WITH([$2], [AS_HELP_STRING([--]m4_if($3, -, without, with)[-$2]m4_if($3, -, , $3), [$4])], [ case [$]withval in yes) m4_default([$5], :) ;; no) m4_default([$6], :) ;; *) $7 ;; esac ], [$8])[]dnl AC_ARG_WITH ], [m4_fatal([first argument of $0 must be 'enable' or 'with', not '$1'])] ) ])# 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. AC_DEFUN([PGAC_ARG_CHECK], [for pgac_var in `set | sed 's/=.*//' | $EGREP 'with_|enable_'`; do for pgac_arg in $pgac_args with_gnu_ld; do if test "$pgac_var" = "$pgac_arg"; then continue 2 fi done pgac_txt=`echo $pgac_var | sed 's/_/-/g'` AC_MSG_WARN([option ignored: --$pgac_txt]) done])# 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.) AC_DEFUN([PGAC_ARG_BOOL], [dnl The following hack is necessary because in a few instances this dnl macro is called twice for the same option with different default dnl values. But we only want it to appear once in the help. We achieve dnl that by making the help string look the same, which is why we need to dnl save the default that was passed in previously. m4_define([_pgac_helpdefault], m4_ifdef([pgac_defined_$1_$2_bool], [m4_defn([pgac_defined_$1_$2_bool])], [$3]))dnl PGAC_ARG([$1], [$2], [m4_if(_pgac_helpdefault, yes, -)], [$4], [$5], [$6], [AC_MSG_ERROR([no argument expected for --$1-$2 option])], [m4_case([$3], yes, [pgac_arg_to_variable([$1], [$2])=yes $5], no, [pgac_arg_to_variable([$1], [$2])=no $6], [m4_fatal([third argument of $0 must be 'yes' or 'no', not '$3'])])])[]dnl m4_define([pgac_defined_$1_$2_bool], [$3])dnl ])# 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. AC_DEFUN([PGAC_ARG_REQ], [PGAC_ARG([$1], [$2], [=$3], [$4], [AC_MSG_ERROR([argument required for --$1-$2 option])], [AC_MSG_ERROR([argument required for --$1-$2 option])], [$5], [$6])])# 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. AC_DEFUN([PGAC_ARG_OPTARG], [PGAC_ARG([$1], [$2], [@<:@=$3@:>@], [$4], [$5], [], [pgac_arg_to_variable([$1], [$2])=yes $6], [pgac_arg_to_variable([$1], [$2])=no]) dnl Add this code only if there's a ACTION-ENABLED or ACTION-DISABLED. m4_ifval([$7[]$8], [ if test "[$]pgac_arg_to_variable([$1], [$2])" = yes; then m4_default([$7], :) m4_ifval([$8], [else $8 ])[]dnl fi ])[]dnl ])# PGAC_ARG_OPTARG pgpool-II-4.1.4/ac_func_accept_argtypes.m40000664000175000017500000000707113730350075015347 00000000000000# $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.) dnl @synopsis AC_FUNC_ACCEPT_ARGTYPES dnl dnl Checks the data types of the three arguments to accept(). Results are dnl placed into the symbols ACCEPT_TYPE_RETURN and ACCEPT_TYPE_ARG[123], dnl consistent with the following example: dnl dnl #define ACCEPT_TYPE_RETURN int dnl #define ACCEPT_TYPE_ARG1 int dnl #define ACCEPT_TYPE_ARG2 struct sockaddr * dnl #define ACCEPT_TYPE_ARG3 socklen_t dnl dnl This macro requires AC_CHECK_HEADERS to have already verified the dnl presence or absence of sys/types.h and sys/socket.h. dnl dnl NOTE: This is just a modified version of the AC_FUNC_SELECT_ARGTYPES dnl macro. Credit for that one goes to David MacKenzie et. al. dnl dnl @version Id: ac_func_accept_argtypes.m4,v 1.1 1999/12/03 11:29:29 simons Exp $ dnl @author Daniel Richard G. dnl # 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_DEFUN([AC_FUNC_ACCEPT_ARGTYPES], [AC_MSG_CHECKING([types of arguments for accept()]) AC_CACHE_VAL(ac_cv_func_accept_return,dnl [AC_CACHE_VAL(ac_cv_func_accept_arg1,dnl [AC_CACHE_VAL(ac_cv_func_accept_arg2,dnl [AC_CACHE_VAL(ac_cv_func_accept_arg3,dnl [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 AC_TRY_COMPILE( [#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 *);], [], [ac_not_found=no; break 4], [ac_not_found=yes]) done done done done if test "$ac_not_found" = yes; then AC_MSG_ERROR([could not determine argument types]) fi if test "$ac_cv_func_accept_arg3" = "void"; then ac_cv_func_accept_arg3=int fi ])dnl AC_CACHE_VAL ])dnl AC_CACHE_VAL ])dnl AC_CACHE_VAL ])dnl AC_CACHE_VAL AC_MSG_RESULT([$ac_cv_func_accept_return, $ac_cv_func_accept_arg1, $ac_cv_func_accept_arg2, $ac_cv_func_accept_arg3 *]) AC_DEFINE_UNQUOTED(ACCEPT_TYPE_RETURN, $ac_cv_func_accept_return, [Define to the return type of 'accept']) AC_DEFINE_UNQUOTED(ACCEPT_TYPE_ARG1, $ac_cv_func_accept_arg1, [Define to the type of arg 1 of 'accept']) AC_DEFINE_UNQUOTED(ACCEPT_TYPE_ARG2, $ac_cv_func_accept_arg2, [Define to the type of arg 2 of 'accept']) AC_DEFINE_UNQUOTED(ACCEPT_TYPE_ARG3, $ac_cv_func_accept_arg3, [Define to the type of arg 3 of 'accept']) ]) pgpool-II-4.1.4/configure.ac0000664000175000017500000004007513730350127012537 00000000000000dnl Process this file with autoconf to produce a configure script. AC_INIT([pgpool-II], [4.1.4], [pgpool-hackers@pgpool.net], [pgpool-II]) dnl Checks for programs. AC_PROG_CC AM_INIT_AUTOMAKE([foreign no-dependencies subdir-objects]) dnl Disallow to rebuild configure. AM_MAINTAINER_MODE(disable) # AC_PROG_RANLIB AC_PROG_LIBTOOL AM_PROG_LEX AC_PROG_YACC AM_PROG_CC_C_O dnl suggested by libtoolize --force AC_CONFIG_MACRO_DIR([m4]) # Check for docbook PGAC_PROG_NSGMLS PGAC_PROG_JADE PGAC_CHECK_DOCBOOK(4.2) PGAC_PATH_DOCBOOK_STYLESHEETS PGAC_PATH_COLLATEINDEX AC_CHECK_PROGS(XSLTPROC, xsltproc) AC_CHECK_PROGS(XMLLINT, xmllint) AC_CHECK_PROGS(OSX, [osx sgml2xml sx]) AC_CHECK_PROGS(PERL, perl) AC_CHECK_PROGS(LYNX, lynx) AC_CHECK_PROGS(SUNIFDEF, sunifdef) AC_SUBST([XSLTPROC_HTML_FLAGS]) AC_SUBST([STYLE]) AM_CONDITIONAL([STYLE_ENV_SET], [test ! -z "$STYLE"]) dnl Check compiler option dnl check -Wall option OLD_CFLAGS=$CFLAGS CFLAGS="$CFLAGS -Wall" AC_MSG_CHECKING(for -Wall option) AC_CACHE_VAL(ac_cv_wall, AC_TRY_COMPILE([], [char a;], ac_cv_wall=yes, ac_cv_wall=no)) echo $ac_cv_wall if test $ac_cv_wall = no; then CFLAGS=$OLD_CFLAGS fi dnl check -Wmissing-prototypes OLD_CFLAGS=$CFLAGS CFLAGS="$CFLAGS -Wmissing-prototypes" AC_MSG_CHECKING(for -Wmissing-prototypes option) AC_CACHE_VAL(ac_cv_wmissing_prototypes, AC_TRY_COMPILE([], [char a;], ac_cv_wmissing_prototypes=yes, ac_cv_wmissing_prototypes=no)) echo $ac_cv_wmissing_prototypes if test $ac_cv_wmissing_prototypes = no; then CFLAGS=$OLD_CFLAGS fi dnl check -Wmissing-prototypes OLD_CFLAGS=$CFLAGS CFLAGS="$CFLAGS -Wmissing-declarations" AC_MSG_CHECKING(for -Wmissing-declarations option) AC_CACHE_VAL(ac_cv_wmissing_declarations, AC_TRY_COMPILE([], [char a;], ac_cv_wmissing_declarations=yes, ac_cv_wmissing_declarations=no)) echo $ac_cv_wmissing_declarations if test $ac_cv_wmissing_declarations = no; then CFLAGS=$OLD_CFLAGS fi dnl Checks for libraries. AC_CHECK_LIB(m, main) AC_CHECK_LIB(nsl, main) AC_CHECK_LIB(socket, main) AC_CHECK_LIB(ipc, main) AC_CHECK_LIB(IPC, main) AC_CHECK_LIB(lc, main) AC_CHECK_LIB(BSD, main) AC_CHECK_LIB(gen, main) AC_CHECK_LIB(PW, main) AC_CHECK_LIB(resolv, main) AC_CHECK_LIB(crypt, main) AC_CHECK_FUNCS([strlcat, strlcpy]) dnl Checks for header files. AC_HEADER_STDC AC_HEADER_SYS_WAIT AC_CHECK_HEADERS(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) AC_CHECK_HEADER([termios.h], [AC_DEFINE(HAVE_TERMIOS_H,1,checking termios)]) dnl Checks for typedefs, structures, and compiler characteristics. AC_C_CONST AC_TYPE_PID_T AC_HEADER_TIME dnl ===== Copied from PostgreSQL's configure start ===== dnl dnl Check to see if we have a working 64-bit integer type. dnl This breaks down into two steps: dnl (1) figure out if the compiler has a 64-bit int type with working dnl arithmetic, and if so dnl (2) see whether snprintf() can format the type correctly. (Currently, dnl snprintf is the only library routine we really need for int8 support.) dnl It's entirely possible to have a compiler that handles a 64-bit type dnl when the C library doesn't; this is fairly likely when using gcc on dnl an older platform, for example. dnl If there is no native snprintf() or it does not handle the 64-bit type, dnl we force our own version of snprintf() to be used instead. dnl Note this test must be run after our initial check for snprintf/vsnprintf. m4_include([c-compiler.m4]) m4_include([c-library.m4]) m4_include([general.m4]) dnl This mazic variable is set to "yes" in PostgreSQL's configure.in dnl if PORTNAME is "win32". dnl pgpool-II does not suppport Windows at the moment, so we set to "no". pgac_need_repl_snprintf=no AC_CHECK_FUNCS(snprintf, [], pgac_need_repl_snprintf=yes) AC_CHECK_FUNCS(vsnprintf, [], pgac_need_repl_snprintf=yes) PGAC_TYPE_64BIT_INT([long int]) if test x"$HAVE_LONG_INT_64" = x"no" ; then PGAC_TYPE_64BIT_INT([long long int]) fi dnl If we need to use "long long int", figure out whether nnnLL notation works. if test x"$HAVE_LONG_LONG_INT_64" = xyes ; then AC_TRY_COMPILE([ #define INT64CONST(x) x##LL long long int foo = INT64CONST(0x1234567890123456); ], [], [AC_DEFINE(HAVE_LL_CONSTANTS, 1, [Define to 1 if constants of type 'long long int' should have the suffix LL.])], []) 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 PGAC_FUNC_SNPRINTF_LONG_LONG_INT_FORMAT 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 # disable useless truncation warnings from gcc 8+ NOT_THE_CFLAGS="" PGAC_PROG_CC_VAR_OPT(NOT_THE_CFLAGS, [-Wformat-truncation]) if test -n "$NOT_THE_CFLAGS"; then CFLAGS="$CFLAGS -Wno-format-truncation" fi AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package]) AC_DEFINE_UNQUOTED(INT64_FORMAT, $INT64_FORMAT, [Define to the appropriate snprintf format for 64-bit ints, if any.]) AC_DEFINE_UNQUOTED(UINT64_FORMAT, $UINT64_FORMAT, [Define to the appropriate snprintf format for unsigned 64-bit ints, if any.]) # Now we have checked all the reasons to replace snprintf if test $pgac_need_repl_snprintf = yes; then AC_DEFINE(USE_REPL_SNPRINTF, 1, [Use replacement snprintf() functions.]) AC_LIBOBJ(snprintf) fi AM_CONDITIONAL(use_repl_snprintf, test $pgac_need_repl_snprintf = yes) # Need a #define for the size of Datum (unsigned long) AC_CHECK_SIZEOF([unsigned long]) # And check size of void *, size_t (enables tweaks for > 32bit address space) AC_CHECK_SIZEOF([void *]) AC_CHECK_SIZEOF([size_t]) # Decide whether float4 is passed by value: user-selectable, enabled by default AC_MSG_CHECKING([whether to build with float4 passed by value]) PGAC_ARG_BOOL(enable, float4-byval, yes, [disable float4 passed by value], [AC_DEFINE([USE_FLOAT4_BYVAL], 1, [Define to 1 if you want float4 values to be passed by value. (--enable-float4-byval)]) float4passbyval=true], [float4passbyval=false]) AC_MSG_RESULT([$enable_float4_byval]) AC_DEFINE_UNQUOTED([FLOAT4PASSBYVAL], [$float4passbyval], [float4 values are passed by value if 'true', by reference if 'false']) # 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. AC_MSG_CHECKING([whether to build with float8 passed by value]) if test $ac_cv_sizeof_unsigned_long -ge 8 ; then PGAC_ARG_BOOL(enable, float8-byval, yes, [disable float8 passed by value]) else PGAC_ARG_BOOL(enable, float8-byval, no, [disable float8 passed by value]) if test "$enable_float8_byval" = yes ; then AC_MSG_ERROR([--enable-float8-byval is not supported on 32-bit platforms.]) fi fi if test "$enable_float8_byval" = yes ; then AC_DEFINE([USE_FLOAT8_BYVAL], 1, [Define to 1 if you want float8, int8, etc values to be passed by value. (--enable-float8-byval)]) float8passbyval=true else float8passbyval=false fi AC_MSG_RESULT([$enable_float8_byval]) AC_DEFINE_UNQUOTED([FLOAT8PASSBYVAL], [$float8passbyval], [float8, int8, and related values are passed by value if 'true', by reference if 'false']) dnl Rest of part cannot be executed by autocnf-2.59. dnl AC_CHECK_ALIGNOF is supported autoconf-2.60 or higher. dnl ===== Copied from PostgreSQL's configure start ===== dnl Checks for sockaddr_storage structure, members and necessary types m4_include([ac_func_accept_argtypes.m4]) AC_CHECK_TYPES([struct sockaddr_storage], [], [], [#include #ifdef HAVE_SYS_SOCKET_H #include #endif ]) 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 ]) AC_CHECK_TYPES([union semun],[],[],[#include #include #include ]) dnl Checks for library functions. AC_TYPE_SIGNAL AC_FUNC_VPRINTF AC_FUNC_WAIT3 AC_FUNC_ACCEPT_ARGTYPES AC_CHECK_FUNCS(setsid select socket sigprocmask strdup strerror strftime strtok asprintf vasprintf gai_strerror hstrerror pstat setproctitle syslog) PGAC_C_TYPES_COMPATIBLE dnl Checks for pg_config command. AC_CHECK_PROGS(PGCONFIG, pg_config) if test -z $PGCONFIG then PGSQL_INCLUDE_DIR=/usr/local/pgsql/include PGSQL_LIB_DIR=/usr/local/pgsql/lib PGSQL_BIN_DIR=/usr/local/pgsql/bin else PGSQL_INCLUDE_DIR=`pg_config --includedir` PGSQL_LIB_DIR=`pg_config --libdir` PGSQL_BIN_DIR=`pg_config --bindir` fi AC_ARG_WITH(pgsql, [ --with-pgsql=DIR site header files for PostgreSQL in DIR], [ case "$withval" in "" | y | ye | yes | n | no) AC_MSG_ERROR([*** You must supply an argument to the --with-pgsql option.]) ;; esac PGSQL_INCLUDE_DIR="$withval"/include PGSQL_LIB_DIR="$withval"/lib PGSQL_BIN_DIR="$withval"/bin ]) AC_ARG_WITH(pgsql-includedir, [ --with-pgsql-includedir=DIR site header files for PostgreSQL in DIR], [ case "$withval" in "" | y | ye | yes | n | no) AC_MSG_ERROR([*** You must supply an argument to the --with-pgsql-includedir option.]) ;; esac PGSQL_INCLUDE_DIR="$withval" ]) AC_ARG_WITH(pgsql-libdir, [ --with-pgsql-libdir=DIR site library files for PostgreSQL in DIR], [ case "$withval" in "" | y | ye | yes | n | no) AC_MSG_ERROR([*** You must supply an argument to the --with-pgsql-libdir option.]) ;; esac PGSQL_LIB_DIR="$withval" ]) AC_ARG_WITH(pgsql-bindir, [ --with-pgsql-bindir=DIR site executable files for PostgreSQL in DIR], [ case "$withval" in "" | y | ye | yes | n | no) AC_MSG_ERROR([*** You must supply an argument to the --with-pgsql-bindir option.]) ;; esac PGSQL_BIN_DIR="$withval" ]) AC_ARG_WITH(sunifdef, [ --with-sunifdef=DIR install path for sunifdef utility ], [ case "$withval" in "" | y | ye | yes | n | no) AC_MSG_ERROR([*** You must supply an argument to the --with-sunifdef option.]) ;; esac SUNIFDEF="$withval"/sunifdef ]) AC_ARG_WITH(openssl, [ --with-openssl build with OpenSSL support], [], [openssl=no]) if test "$with_openssl" = yes || test "$with_openssl" = auto; then AC_CHECK_HEADERS(openssl/ssl.h, [AC_DEFINE([USE_SSL], 1, [Define to 1 to build with SSL support. (--with-openssl)])], [ if test "$with_openssl" = yes; then AC_MSG_ERROR([header file is required for SSL]) else AC_MSG_WARN([header file is required for SSL]) fi ]) AC_CHECK_LIB(crypto, CRYPTO_new_ex_data, [], [AC_MSG_ERROR([library 'crypto' is required for OpenSSL])]) AC_CHECK_LIB(ssl, SSL_new, [], [AC_MSG_ERROR([library 'ssl' is required for OpenSSL])]) fi AC_ARG_WITH(pam, [ --with-pam build with PAM support], [AC_DEFINE([USE_PAM], 1, [Define to 1 to build with PAM support. (--with-pam)])]) if test "$with_pam" = yes ; then AC_CHECK_LIB(pam, pam_start, [], [AC_MSG_ERROR([library 'pam' is required for PAM])]) AC_CHECK_HEADERS(security/pam_appl.h, [], [AC_CHECK_HEADERS(pam/pam_appl.h, [], [AC_MSG_ERROR([header file or is required for PAM.])])]) fi AC_ARG_WITH(memcached, [ --with-memcached=DIR site header files for libmemcached in DIR], [ case "$withval" in "" | y | ye | yes | n | no) AC_MSG_ERROR([*** You must supply an argument to the --with-memcached option.]) ;; *) MEMCACHED_INCLUDE_DIR="$withval"/include MEMCACHED_LIB_DIR="$withval"/lib OLD_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -I$MEMCACHED_INCLUDE_DIR" AC_CHECK_HEADERS( [libmemcached/memcached.h], [AC_DEFINE([USE_MEMCACHED], 1, [Define to 1 to build with memcached support])], [AC_MSG_ERROR([header file is required for memcached support])]) CFLAGS=$OLD_CFLAGS AC_CHECK_LIB(memcached, memcached_create, [], [AC_MSG_ERROR(libmemcached is not installed)]) MEMCACHED_INCLUDE_OPT="-I $MEMCACHED_INCLUDE_DIR" MEMCACHED_LINK_OPT="-L$MEMCACHED_LIB_DIR" MEMCACHED_RPATH_OPT="-rpath $MEMCACHED_LIB_DIR" ;; esac ]) CFLAGS="$CFLAGS -fno-strict-aliasing" AC_SUBST(MEMCACHED_INCLUDE_OPT) AC_SUBST(MEMCACHED_LINK_OPT) AC_SUBST(MEMCACHED_RPATH_OPT) OLD_LDFLAGS="$LDFLAGS" LDFLAGS="-L$PGSQL_LIB_DIR $LDFLAGS" OLD_LIBS="$LIBS" AC_CHECK_LIB(pq, PQexecPrepared, [], [AC_MSG_ERROR(libpq is not installed or libpq is old)]) AC_CHECK_FUNCS(PQprepare) LDFLAGS="$OLD_LDFLAGS" LIBS="$OLD_LIBS" AC_SUBST(PGSQL_INCLUDE_DIR) AC_SUBST(PGSQL_LIB_DIR) AC_SUBST(PGSQL_BIN_DIR) AC_SUBST(MEMCACHED_DIR) # --enable(disable)-rpath option AC_ARG_ENABLE(rpath, [ --disable-rpath do not embed shared library search path in executables], [case "${enableval}" in yes) rpath=yes ;; no) rpath=no ;; esac], [rpath=yes] ) AM_CONDITIONAL([enable_rpath], test x$rpath = xyes) # 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). AC_MSG_CHECKING([whether to use row lock against the sequence table for insert_lock]) PGAC_ARG_BOOL(enable, sequence-lock, no, [insert_lock compatible with pgpool-II 3.0 series (until 3.0.4)]) if test "$enable_sequence_lock" = yes && test "$enable_table_lock" = yes ; then AC_MSG_ERROR([--enable-table-lock cannot be enabled at the same time.]) fi if test "$enable_sequence_lock" = yes ; then AC_DEFINE([USE_SEQUENCE_LOCK], 1, [Define to 1 if you want to use row lock against the sequence table for insert_lock. (--enable-sequence-lock)]) fi AC_MSG_RESULT([$enable_sequence_lock]) # 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. AC_MSG_CHECKING([whether to use table lock against the target table for insert_lock]) PGAC_ARG_BOOL(enable, table-lock, no, [insert_lock compatible with pgpool-II 2.2 and 2.3 series]) if test "$enable_table_lock" = yes && test "$enable_sequence_lock" = yes ; then AC_MSG_ERROR([--enable-sequence-lock cannot be enabled at the same time.]) fi if test "$enable_table_lock" = yes ; then AC_DEFINE([USE_TABLE_LOCK], 1, [Define to 1 if you want to use table lock against the target table for insert_lock. (--enable-table-lock)]) fi AC_MSG_RESULT([$enable_table_lock]) PGAC_ARG_BOOL(enable, cassert, no, [build with assertion checks]) if test "$enable_cassert" = yes ; then AC_DEFINE([USE_ASSERT_CHECKING], 1, [Define to 1 to build with assertion checks. (--enable-cassert)]) fi AC_MSG_RESULT([enable cassert = $enable_cassert]) AM_CONFIG_HEADER(src/include/config.h) AC_OUTPUT([Makefile doc/Makefile doc/src/Makefile doc/src/sgml/Makefile doc.ja/Makefile doc.ja/src/Makefile doc.ja/src/sgml/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/pgenc/Makefile src/tools/pcp/Makefile src/tools/pgproto/Makefile src/watchdog/Makefile]) pgpool-II-4.1.4/aclocal.m40000664000175000017500000007422713730350075012121 00000000000000# generated automatically by aclocal 1.13.4 -*- Autoconf -*- # Copyright (C) 1996-2013 Free Software Foundation, Inc. # This file 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. m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])]) m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],, [m4_warning([this file was generated for autoconf 2.69. You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically 'autoreconf'.])]) # Copyright (C) 2002-2013 Free Software Foundation, Inc. # # This file 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. # AM_AUTOMAKE_VERSION(VERSION) # ---------------------------- # Automake X.Y traces this macro to ensure aclocal.m4 has been # generated from the m4 files accompanying Automake X.Y. # (This private macro should not be called outside this file.) AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version='1.13' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. m4_if([$1], [1.13.4], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) # _AM_AUTOCONF_VERSION(VERSION) # ----------------------------- # aclocal traces this macro to find the Autoconf version. # This is a private macro too. Using m4_define simplifies # the logic in aclocal, which can simply ignore this definition. m4_define([_AM_AUTOCONF_VERSION], []) # AM_SET_CURRENT_AUTOMAKE_VERSION # ------------------------------- # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], [AM_AUTOMAKE_VERSION([1.13.4])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- # Copyright (C) 2001-2013 Free Software Foundation, Inc. # # This file 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. # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets # $ac_aux_dir to '$srcdir/foo'. In other projects, it is set to # '$srcdir', '$srcdir/..', or '$srcdir/../..'. # # Of course, Automake must honor this variable whenever it calls a # tool from the auxiliary directory. The problem is that $srcdir (and # therefore $ac_aux_dir as well) can be either absolute or relative, # depending on how configure is run. This is pretty annoying, since # it makes $ac_aux_dir quite unusable in subdirectories: in the top # source directory, any form will work fine, but in subdirectories a # relative path needs to be adjusted first. # # $ac_aux_dir/missing # fails when called from a subdirectory if $ac_aux_dir is relative # $top_srcdir/$ac_aux_dir/missing # fails if $ac_aux_dir is absolute, # fails when called from a subdirectory in a VPATH build with # a relative $ac_aux_dir # # The reason of the latter failure is that $top_srcdir and $ac_aux_dir # are both prefixed by $srcdir. In an in-source build this is usually # harmless because $srcdir is '.', but things will broke when you # start a VPATH build or use an absolute $srcdir. # # So we could use something similar to $top_srcdir/$ac_aux_dir/missing, # iff we strip the leading $srcdir from $ac_aux_dir. That would be: # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` # and then we would define $MISSING as # MISSING="\${SHELL} $am_aux_dir/missing" # This will work as long as MISSING is not called from configure, because # unfortunately $(top_srcdir) has no meaning in configure. # However there are other variables, like CC, which are often used in # configure, and could therefore not use this "fixed" $ac_aux_dir. # # Another solution, used here, is to always expand $ac_aux_dir to an # absolute PATH. The drawback is that using absolute paths prevent a # configured tree to be moved without reconfiguration. AC_DEFUN([AM_AUX_DIR_EXPAND], [dnl Rely on autoconf to set up CDPATH properly. AC_PREREQ([2.50])dnl # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` ]) # AM_CONDITIONAL -*- Autoconf -*- # Copyright (C) 1997-2013 Free Software Foundation, Inc. # # This file 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. # AM_CONDITIONAL(NAME, SHELL-CONDITION) # ------------------------------------- # Define a conditional. AC_DEFUN([AM_CONDITIONAL], [AC_PREREQ([2.52])dnl m4_if([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl AC_SUBST([$1_TRUE])dnl AC_SUBST([$1_FALSE])dnl _AM_SUBST_NOTMAKE([$1_TRUE])dnl _AM_SUBST_NOTMAKE([$1_FALSE])dnl m4_define([_AM_COND_VALUE_$1], [$2])dnl if $2; then $1_TRUE= $1_FALSE='#' else $1_TRUE='#' $1_FALSE= fi AC_CONFIG_COMMANDS_PRE( [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then AC_MSG_ERROR([[conditional "$1" was never defined. Usually this means the macro was only invoked conditionally.]]) fi])]) # Do all the work for Automake. -*- Autoconf -*- # Copyright (C) 1996-2013 Free Software Foundation, Inc. # # This file 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 macro actually does too much. Some checks are only needed if # your package does certain things. But this isn't really a big deal. # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) # AM_INIT_AUTOMAKE([OPTIONS]) # ----------------------------------------------- # The call with PACKAGE and VERSION arguments is the old style # call (pre autoconf-2.50), which is being phased out. PACKAGE # and VERSION should now be passed to AC_INIT and removed from # the call to AM_INIT_AUTOMAKE. # We support both call styles for the transition. After # the next Automake release, Autoconf can make the AC_INIT # arguments mandatory, and then we can depend on a new Autoconf # release and drop the old call support. AC_DEFUN([AM_INIT_AUTOMAKE], [AC_PREREQ([2.65])dnl dnl Autoconf wants to disallow AM_ names. We explicitly allow dnl the ones we care about. m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl AC_REQUIRE([AC_PROG_INSTALL])dnl if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl # test to see if srcdir already configured if test -f $srcdir/config.status; then AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) 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 AC_SUBST([CYGPATH_W]) # Define the identity of the package. dnl Distinguish between old-style and new-style calls. m4_ifval([$2], [AC_DIAGNOSE([obsolete], [$0: two- and three-arguments forms are deprecated.]) m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl AC_SUBST([PACKAGE], [$1])dnl AC_SUBST([VERSION], [$2])], [_AM_SET_OPTIONS([$1])dnl dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. m4_if( m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]), [ok:ok],, [m4_fatal([AC_INIT should be called with package and version arguments])])dnl AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl _AM_IF_OPTION([no-define],, [AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package]) AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl # Some tools Automake needs. AC_REQUIRE([AM_SANITY_CHECK])dnl AC_REQUIRE([AC_ARG_PROGRAM])dnl AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}]) AM_MISSING_PROG([AUTOCONF], [autoconf]) AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}]) AM_MISSING_PROG([AUTOHEADER], [autoheader]) AM_MISSING_PROG([MAKEINFO], [makeinfo]) AC_REQUIRE([AM_PROG_INSTALL_SH])dnl AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl AC_REQUIRE([AC_PROG_MKDIR_P])dnl # For better backward compatibility. To be removed once Automake 1.9.x # dies out for good. For more background, see: # # AC_SUBST([mkdir_p], ['$(MKDIR_P)']) # We need awk for the "check" target. The system "awk" is bad on # some platforms. AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AM_SET_LEADING_DOT])dnl _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], [_AM_PROG_TAR([v7])])]) _AM_IF_OPTION([no-dependencies],, [AC_PROVIDE_IFELSE([AC_PROG_CC], [_AM_DEPENDENCIES([CC])], [m4_define([AC_PROG_CC], m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl AC_PROVIDE_IFELSE([AC_PROG_CXX], [_AM_DEPENDENCIES([CXX])], [m4_define([AC_PROG_CXX], m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJC], [_AM_DEPENDENCIES([OBJC])], [m4_define([AC_PROG_OBJC], m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJCXX], [_AM_DEPENDENCIES([OBJCXX])], [m4_define([AC_PROG_OBJCXX], m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl ]) AC_REQUIRE([AM_SILENT_RULES])dnl dnl The testsuite driver may need to know about EXEEXT, so add the dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below. AC_CONFIG_COMMANDS_PRE(dnl [m4_provide_if([_AM_COMPILER_EXEEXT], [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl ]) dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further dnl mangled by Autoconf and run in a shell conditional statement. m4_define([_AC_COMPILER_EXEEXT], m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) # When config.status generates a header, we must update the stamp-h file. # This file resides in the same directory as the config header # that is generated. The stamp files are numbered to have different names. # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the # loop where config.status creates the headers, so we can generate # our stamp files there. AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], [# Compute $1's index in $config_headers. _am_arg=$1 _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"])`/stamp-h[]$_am_stamp_count]) # Copyright (C) 2001-2013 Free Software Foundation, Inc. # # This file 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. # AM_PROG_INSTALL_SH # ------------------ # Define $install_sh. AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl 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 AC_SUBST([install_sh])]) # Copyright (C) 2003-2013 Free Software Foundation, Inc. # # This file 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. # Check whether the underlying file-system supports filenames # with a leading dot. For instance MS-DOS doesn't. AC_DEFUN([AM_SET_LEADING_DOT], [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 AC_SUBST([am__leading_dot])]) # Copyright (C) 1998-2013 Free Software Foundation, Inc. # # This file 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. # AM_PROG_LEX # ----------- # Autoconf leaves LEX=: if lex or flex can't be found. Change that to a # "missing" invocation, for better error output. AC_DEFUN([AM_PROG_LEX], [AC_PREREQ([2.50])dnl AC_REQUIRE([AM_MISSING_HAS_RUN])dnl AC_REQUIRE([AC_PROG_LEX])dnl if test "$LEX" = :; then LEX=${am_missing_run}flex fi]) # Add --enable-maintainer-mode option to configure. -*- Autoconf -*- # From Jim Meyering # Copyright (C) 1996-2013 Free Software Foundation, Inc. # # This file 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. # AM_MAINTAINER_MODE([DEFAULT-MODE]) # ---------------------------------- # Control maintainer-specific portions of Makefiles. # Default is to disable them, unless 'enable' is passed literally. # For symmetry, 'disable' may be passed as well. Anyway, the user # can override the default with the --enable/--disable switch. AC_DEFUN([AM_MAINTAINER_MODE], [m4_case(m4_default([$1], [disable]), [enable], [m4_define([am_maintainer_other], [disable])], [disable], [m4_define([am_maintainer_other], [enable])], [m4_define([am_maintainer_other], [enable]) m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])]) AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) dnl maintainer-mode's default is 'disable' unless 'enable' is passed AC_ARG_ENABLE([maintainer-mode], [AS_HELP_STRING([--]am_maintainer_other[-maintainer-mode], am_maintainer_other[ make rules and dependencies not useful (and sometimes confusing) to the casual installer])], [USE_MAINTAINER_MODE=$enableval], [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes])) AC_MSG_RESULT([$USE_MAINTAINER_MODE]) AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes]) MAINT=$MAINTAINER_MODE_TRUE AC_SUBST([MAINT])dnl ] ) # Copyright (C) 1999-2013 Free Software Foundation, Inc. # # This file 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. # AM_PROG_CC_C_O # -------------- # Like AC_PROG_CC_C_O, but changed for automake. AC_DEFUN([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC_C_O])dnl AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([compile])dnl # FIXME: we rely on the cache variable name because # there is no other way. set dummy $CC am_cc=`echo $[2] | sed ['s/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/']` eval am_t=\$ac_cv_prog_cc_${am_cc}_c_o if test "$am_t" != 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 dnl Make sure AC_PROG_CC is never called again, or it will override our dnl setting of CC. m4_define([AC_PROG_CC], [m4_fatal([AC_PROG_CC cannot be called after AM_PROG_CC_C_O])]) ]) # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- # Copyright (C) 1997-2013 Free Software Foundation, Inc. # # This file 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. # AM_MISSING_PROG(NAME, PROGRAM) # ------------------------------ AC_DEFUN([AM_MISSING_PROG], [AC_REQUIRE([AM_MISSING_HAS_RUN]) $1=${$1-"${am_missing_run}$2"} AC_SUBST($1)]) # AM_MISSING_HAS_RUN # ------------------ # Define MISSING if not defined so far and test if it is modern enough. # If it is, set am_missing_run to use it, otherwise, to nothing. AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([missing])dnl 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= AC_MSG_WARN(['missing' script is too old or missing]) fi ]) # -*- Autoconf -*- # Obsolete and "removed" macros, that must however still report explicit # error messages when used, to smooth transition. # # Copyright (C) 1996-2013 Free Software Foundation, Inc. # # This file 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. AC_DEFUN([AM_CONFIG_HEADER], [AC_DIAGNOSE([obsolete], ['$0': this macro is obsolete. You should use the 'AC][_CONFIG_HEADERS' macro instead.])dnl AC_CONFIG_HEADERS($@)]) AC_DEFUN([AM_PROG_CC_STDC], [AC_PROG_CC am_cv_prog_cc_stdc=$ac_cv_prog_cc_stdc AC_DIAGNOSE([obsolete], ['$0': this macro is obsolete. You should simply use the 'AC][_PROG_CC' macro instead. Also, your code should no longer depend upon 'am_cv_prog_cc_stdc', but upon 'ac_cv_prog_cc_stdc'.])]) AC_DEFUN([AM_C_PROTOTYPES], [AC_FATAL([automatic de-ANSI-fication support has been removed])]) AU_DEFUN([fp_C_PROTOTYPES], [AM_C_PROTOTYPES]) # Helper functions for option handling. -*- Autoconf -*- # Copyright (C) 2001-2013 Free Software Foundation, Inc. # # This file 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. # _AM_MANGLE_OPTION(NAME) # ----------------------- AC_DEFUN([_AM_MANGLE_OPTION], [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) # _AM_SET_OPTION(NAME) # -------------------- # Set option NAME. Presently that only means defining a flag for this option. AC_DEFUN([_AM_SET_OPTION], [m4_define(_AM_MANGLE_OPTION([$1]), [1])]) # _AM_SET_OPTIONS(OPTIONS) # ------------------------ # OPTIONS is a space-separated list of Automake options. AC_DEFUN([_AM_SET_OPTIONS], [m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) # ------------------------------------------- # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) # Check to make sure that the build environment is sane. -*- Autoconf -*- # Copyright (C) 1996-2013 Free Software Foundation, Inc. # # This file 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. # AM_SANITY_CHECK # --------------- AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane]) # 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]]*) AC_MSG_ERROR([unsafe absolute working directory name]);; esac case $srcdir in *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);; 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". AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken alias in your environment]) 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 AC_MSG_ERROR([newly created file is older than distributed files! Check your system clock]) fi AC_MSG_RESULT([yes]) # 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 AC_CONFIG_COMMANDS_PRE( [AC_MSG_CHECKING([that generated files are newer than configure]) if test -n "$am_sleep_pid"; then # Hide warnings about reused PIDs. wait $am_sleep_pid 2>/dev/null fi AC_MSG_RESULT([done])]) rm -f conftest.file ]) # Copyright (C) 2009-2013 Free Software Foundation, Inc. # # This file 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. # AM_SILENT_RULES([DEFAULT]) # -------------------------- # Enable less verbose build rules; with the default set to DEFAULT # ("yes" being less verbose, "no" or empty being verbose). AC_DEFUN([AM_SILENT_RULES], [AC_ARG_ENABLE([silent-rules], [dnl AS_HELP_STRING( [--enable-silent-rules], [less verbose build output (undo: "make V=1")]) AS_HELP_STRING( [--disable-silent-rules], [verbose build output (undo: "make V=0")])dnl ]) case $enable_silent_rules in @%:@ ((( yes) AM_DEFAULT_VERBOSITY=0;; no) AM_DEFAULT_VERBOSITY=1;; *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);; esac dnl dnl A few 'make' implementations (e.g., NonStop OS and NextStep) dnl do not support nested variable expansions. dnl See automake bug#9928 and bug#10237. am_make=${MAKE-make} AC_CACHE_CHECK([whether $am_make supports nested variables], [am_cv_make_support_nested_variables], [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]) if test $am_cv_make_support_nested_variables = yes; then dnl Using '$V' instead of '$(V)' breaks IRIX make. AM_V='$(V)' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' else AM_V=$AM_DEFAULT_VERBOSITY AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY fi AC_SUBST([AM_V])dnl AM_SUBST_NOTMAKE([AM_V])dnl AC_SUBST([AM_DEFAULT_V])dnl AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl AC_SUBST([AM_DEFAULT_VERBOSITY])dnl AM_BACKSLASH='\' AC_SUBST([AM_BACKSLASH])dnl _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl ]) # Copyright (C) 2001-2013 Free Software Foundation, Inc. # # This file 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. # AM_PROG_INSTALL_STRIP # --------------------- # One issue with vendor 'install' (even GNU) is that you can't # specify the program used to strip binaries. This is especially # annoying in cross-compiling environments, where the build's strip # is unlikely to handle the host's binaries. # Fortunately install-sh will honor a STRIPPROG variable, so we # always use install-sh in "make install-strip", and initialize # STRIPPROG with the value of the STRIP variable (set by the user). AC_DEFUN([AM_PROG_INSTALL_STRIP], [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl # 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. dnl Don't test for $cross_compiling = yes, because it might be 'maybe'. if test "$cross_compiling" != no; then AC_CHECK_TOOL([STRIP], [strip], :) fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) # Copyright (C) 2006-2013 Free Software Foundation, Inc. # # This file 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. # _AM_SUBST_NOTMAKE(VARIABLE) # --------------------------- # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. # This macro is traced by Automake. AC_DEFUN([_AM_SUBST_NOTMAKE]) # AM_SUBST_NOTMAKE(VARIABLE) # -------------------------- # Public sister of _AM_SUBST_NOTMAKE. AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) # Check how to create a tarball. -*- Autoconf -*- # Copyright (C) 2004-2013 Free Software Foundation, Inc. # # This file 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. # _AM_PROG_TAR(FORMAT) # -------------------- # Check how to create a tarball in format FORMAT. # FORMAT should be one of 'v7', 'ustar', or 'pax'. # # Substitute a variable $(am__tar) that is a command # writing to stdout a FORMAT-tarball containing the directory # $tardir. # tardir=directory && $(am__tar) > result.tar # # Substitute a variable $(am__untar) that extract such # a tarball read from stdin. # $(am__untar) < result.tar # AC_DEFUN([_AM_PROG_TAR], [# Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AC_SUBST([AMTAR], ['$${TAR-tar}']) # We'll loop over all known methods to create a tar archive until one works. _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' m4_if([$1], [v7], [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], [m4_case([$1], [ustar], [# The POSIX 1988 'ustar' format is defined with fixed-size fields. # There is notably a 21 bits limit for the UID and the GID. In fact, # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343 # and bug#13588). am_max_uid=2097151 # 2^21 - 1 am_max_gid=$am_max_uid # The $UID and $GID variables are not portable, so we need to resort # to the POSIX-mandated id(1) utility. Errors in the 'id' calls # below are definitely unexpected, so allow the users to see them # (that is, avoid stderr redirection). am_uid=`id -u || echo unknown` am_gid=`id -g || echo unknown` AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format]) if test $am_uid -le $am_max_uid; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) _am_tools=none fi AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format]) if test $am_gid -le $am_max_gid; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) _am_tools=none fi], [pax], [], [m4_fatal([Unknown tar format])]) AC_MSG_CHECKING([how to create a $1 tar archive]) # Go ahead even if we have the value already cached. We do so because we # need to set the values for the 'am__tar' and 'am__untar' variables. _am_tools=${am_cv_prog_tar_$1-$_am_tools} for _am_tool in $_am_tools; do case $_am_tool in gnutar) for _am_tar in tar gnutar gtar; do AM_RUN_LOG([$_am_tar --version]) && break done am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' am__untar="$_am_tar -xf -" ;; plaintar) # Must skip GNU tar: if it does not support --format= it doesn't create # ustar tarball either. (tar --version) >/dev/null 2>&1 && continue am__tar='tar chf - "$$tardir"' am__tar_='tar chf - "$tardir"' am__untar='tar xf -' ;; pax) am__tar='pax -L -x $1 -w "$$tardir"' am__tar_='pax -L -x $1 -w "$tardir"' am__untar='pax -r' ;; cpio) am__tar='find "$$tardir" -print | cpio -o -H $1 -L' am__tar_='find "$tardir" -print | cpio -o -H $1 -L' am__untar='cpio -i -H $1 -d' ;; none) am__tar=false am__tar_=false am__untar=false ;; esac # If the value was cached, stop now. We just wanted to have am__tar # and am__untar set. test -n "${am_cv_prog_tar_$1}" && break # tar/untar a dummy directory, and stop if the command works. rm -rf conftest.dir mkdir conftest.dir echo GrepMe > conftest.dir/file AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) rm -rf conftest.dir if test -s conftest.tar; then AM_RUN_LOG([$am__untar /dev/null 2>&1 && break fi done rm -rf conftest.dir AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) AC_MSG_RESULT([$am_cv_prog_tar_$1])]) AC_SUBST([am__tar]) AC_SUBST([am__untar]) ]) # _AM_PROG_TAR m4_include([m4/docbook.m4]) m4_include([m4/libtool.m4]) m4_include([m4/ltoptions.m4]) m4_include([m4/ltsugar.m4]) m4_include([m4/ltversion.m4]) m4_include([m4/lt~obsolete.m4]) pgpool-II-4.1.4/mkinstalldirs0000775000175000017500000000672213730350075013062 00000000000000#! /bin/sh # mkinstalldirs --- make directory hierarchy scriptversion=2009-04-28.21; # UTC # Original author: Noah Friedman # Created: 1993-05-16 # Public domain. # # This file is maintained in Automake, please report # bugs to or send patches to # . nl=' ' IFS=" "" $nl" errstatus=0 dirmode= usage="\ Usage: mkinstalldirs [-h] [--help] [--version] [-m MODE] DIR ... Create each directory DIR (with mode MODE, if specified), including all leading file name components. Report bugs to ." # process command line arguments while test $# -gt 0 ; do case $1 in -h | --help | --h*) # -h for help echo "$usage" exit $? ;; -m) # -m PERM arg shift test $# -eq 0 && { echo "$usage" 1>&2; exit 1; } dirmode=$1 shift ;; --version) echo "$0 $scriptversion" exit $? ;; --) # stop option processing shift break ;; -*) # unknown option echo "$usage" 1>&2 exit 1 ;; *) # first non-opt arg break ;; esac done for file do if test -d "$file"; then shift else break fi done case $# in 0) exit 0 ;; esac # Solaris 8's mkdir -p isn't thread-safe. If you mkdir -p a/b and # mkdir -p a/c at the same time, both will detect that a is missing, # one will create a, then the other will try to create a and die with # a "File exists" error. This is a problem when calling mkinstalldirs # from a parallel make. We use --version in the probe to restrict # ourselves to GNU mkdir, which is thread-safe. case $dirmode in '') if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then echo "mkdir -p -- $*" exec mkdir -p -- "$@" else # On NextStep and OpenStep, the `mkdir' command does not # recognize any option. It will interpret all options as # directories to create, and then abort because `.' already # exists. test -d ./-p && rmdir ./-p test -d ./--version && rmdir ./--version fi ;; *) if mkdir -m "$dirmode" -p --version . >/dev/null 2>&1 && test ! -d ./--version; then echo "mkdir -m $dirmode -p -- $*" exec mkdir -m "$dirmode" -p -- "$@" else # Clean up after NextStep and OpenStep mkdir. for d in ./-m ./-p ./--version "./$dirmode"; do test -d $d && rmdir $d done fi ;; esac for file do case $file in /*) pathcomp=/ ;; *) pathcomp= ;; esac oIFS=$IFS IFS=/ set fnord $file shift IFS=$oIFS for d do test "x$d" = x && continue pathcomp=$pathcomp$d case $pathcomp in -*) pathcomp=./$pathcomp ;; esac if test ! -d "$pathcomp"; then echo "mkdir $pathcomp" mkdir "$pathcomp" || lasterr=$? if test ! -d "$pathcomp"; then errstatus=$lasterr else if test ! -z "$dirmode"; then echo "chmod $dirmode $pathcomp" lasterr= chmod "$dirmode" "$pathcomp" || lasterr=$? if test ! -z "$lasterr"; then errstatus=$lasterr fi fi fi fi pathcomp=$pathcomp/ done done exit $errstatus # Local Variables: # mode: shell-script # sh-indentation: 2 # 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-4.1.4/AUTHORS0000664000175000017500000000017313730350075011316 00000000000000Authors of pgpool pgpool was originally written by Tatsuo Ishii, then was contributed to pgpool Global Development Group. pgpool-II-4.1.4/COPYING0000664000175000017500000000123213730350075011276 00000000000000Copyright (c) 2003-2016 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. pgpool-II-4.1.4/ChangeLog0000664000175000017500000000001213730350075012010 00000000000000See NEWS. pgpool-II-4.1.4/INSTALL0000664000175000017500000003660013730350075011303 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-4.1.4/NEWS0000664000175000017500000153556513730350075010770 00000000000000 Release Notes =============================================================================== 3.6 Series (201x/xx/xx - ) =============================================================================== 3.6.0 (subaruboshi) 201x/xx/xx * Version 3.6.0 This is the first version of pgpool-II 3.6 series. That is, a "major version up" from 3.5 series. * Overview Major enhancements in Pgpool-II 3.6 include: - Improve the behavior of fail-over. In the steaming replication mode, client sessions will not be disconnected when a fail-over occurs any more if the session does not use the failed standby server. If the primary server goes down, still all sessions will be disconnected. Also it is possible to connect to Pgpool-II even if it is doing health checking retries. Before all attempt of connecting to Pgpool-II failed while doing health checking retries. - New PGPOOL SET command has been introduced. Certain configuration parameters now can be changed on the fly in a session. - Watchdog is significantly enhanced. It becomes more reliable than previous releases. - Handling of extended query protocol (e.g. used by Java applications) in streaming replication mode speeds up if many rows are returned in a result set. - Import parser of PostgreSQL 9.6. - In some cases pg_terminate_backend() now does not trigger a fail-over. - Change documentation format from raw HTML to SGML. The above items are explained in more detail in the sections below. * Major Enhancements - Improve the behavior of fail-over. (Tatsuo Ishii) In the steaming replication mode, client sessions will not be disconnected when a fail-over occurs any more if the session does not use the failed standby server. If the primary server goes down, still all sessions will be disconnected. Health check timeout case will also cause the full session disconnection. Other health check error, including retry over case does not trigger full session disconnection. For user's convenience, "show pool_nodes" command shows the session local load balance node info since this is important for users in case of fail-over. If the load balance node is not the failed node, the session will not be affected by fail-over. Also now it is possible to connect to Pgpool-II even if it is doing health checking retries. Before all attempt of connecting to Pgpool-II failed while doing health checking retries. Before any attempt to connect to Pgpool-II fails if it is doing a health check against failed node even if fail_over_on_backend_error is off because Pgpool-II child first tries to connect to all backend including the failed one and exits if it fails to connect to a backend (of course it fails). This is a temporary situation and will be resolved before pgpool executes fail-over. However if the health check is retrying, the temporary situation keeps longer depending on the setting of health_check_max_retries and health_check_retry_ delay. This is not good. Attached patch tries to mitigate the problem: When an attempt to connect to backend fails, give up connecting to the failed node and skip to other node, rather than exiting the process if operating in streaming replication mode and the node is not primary node. Mark the local status of the failed node to "down". This will let the primary node be selected as a load balance node and every queries will be sent to the primary node. If there's other healthy standby nodes, one of them will be chosen as the load balance node. After the session is over, the child process will suicide to not retain the local status. - Add PGPOOL SHOW, PGPOOL SET and PGPOOL RESET commands. (Muhammad Usama) These are similar to the PostgreSQL's SET and SHOW commands for GUC variables, adding the functionality in Pgpool-II to set and reset the value of config parameters for the current session, and for that it adds a new syntax in Pgpool-II which is similar to PostgreSQL's SET and RESET variable syntax with an addition of PGPOOL keyword at the start. Currently supported configuration parameters by PGPOOL SHOW/SET/RESET are: log_statement, log_per_node_statement, check_temp_table, check_unlogged_ table, allow_sql_comments, client_idle_limit, log_error_verbosity, client_min_messages, log_min_messages, client_idle_limit_in_recovery. - Sync inconsitent status of PostgreSQL nodes in Pgpool-II instances after restart. (Muhammad Usama) - At the Pgpool-II startup, the status of each configured backend node is loaded from the backend status file or otherwise initialized by querying the backend nodes. This technique works fine in stand alone mode and also with the watchdog enabled as long as the status of backend nodes remains consistent until all Pgpool-II nodes got up and running. But since Pgpool-II does not sync the backend node status from the watchdog cluster at startup time, so in some cases the Pgpool-II nodes participating in the watchdog cluster may get a different status for the same backend, especially if the Pgpool-II nodes part of the watchdog cluster starts at different times and between that time an unavailable backend PostgreSQL node had become available again. So to solve this, the commit implements the new startup procedure for the standby Pgpool-II, And now the standby Pgpool-II will load the backend status of all configured PostgreSQL nodes from the watchdog master/coordinator node at the time of startup. - Enhance performance of SELECT when lots of rows involved. (Tatsuo Ishii) Pgpool-II flushes data to network (calling write(2)) every time it sends a row data ("Data Row" message) to frontend. For example, if 10,000 rows needed to be transfer, 10,000 times write()s are issued. This is pretty expensive. Since after repeating to send row data, "Command Complete" message is sent, it's enough to issue a write() with the command complete message. Also there are unnecessary flushing are in handling the command complete message. Quick testing showed that from 47% to 62% performance enhancements were achieved in some cases. Unfortunately, performance in workloads where transferring few rows, will not be enhanced since such rows are needed to flush to network anyway. - Import PostgreSQL 9.6's SQL parser. (Bo Peng) This allows Pgpool-II to fully understand the newly added SQL syntax such as COPY INSERT RETURNING. - In some cases pg_terminate_backend() now does not trigger a fail-over. (Muhammad Usama) Since the pg_terminate_backend function in PostgreSQL is used to terminate the backend connection, So what happens is, when this function kills a PostgreSQL backend that is connected to the Pgpool-II, This disconnection of backend by pg_terminate_backend function is appeared as a backend node failure to the Pgpool-II. But the problem here is, PostgreSQL does not give any information to the client program that the connection is going to be killed because of the pg_terminate_backend call and on the client side, it looks similar to the backend node failure. Now to solve this in Pgpool-II we need two things. First is to identify the pg_terminate_backend function in the query and the Pgpool-II child process that hosts the particular backend connection which will be killed by that pg_terminate_backend function call, so that we get a heads up in advance about the backend termination, and secondly the routing of the query containing pg_terminate_backend also needs a new logic so that the query should be sent to the correct PostgreSQL node that hosts the backend with the PID referred by the pg_terminate_bakend() So how does this commit handles pg_terminate_backend()?? In the SimpleQuery() function which is the work horse of simple query processing in the Pgpool-II we start with the search of the pg_terminate_backend() function call in the query parse tree and if the search comes out to be successful, the next step is to locate the Pgpool-II child process and a backend node of that connection whose PID is specified in pg_terminate_backend function's argument. Once the connection and the Pgpool-II child process is identified, we just set the swallow_termination flag(added by this commit in ConnectionInfo structure) for that connection in the shared memory, and also set the query destination node to the backend node that hosts that particular connection and does not call pool_where_to_send() for this query so that the query should be sent to the correct backend node. Now when the query is routed to the correct node and consequently the backend gets killed, that results in the communication error on Pgpool-II side, the Pgpool-II already knows that this disconnection is due the pg_terminate_backend and not because of node failure as the swallow_termination flag is already set for the connection. Some works are still remaining. pg_terminate_backend is not handled with extended query protocol. Currently we only support pg_terminate_backend(constant number) function calls. If the expression or sub query is used in the argument of pg_terminate_backend then it would not be handled e.g pgpool=# select pg_terminate_backend(1025); -- Supported pgpool=# select pg_terminate_backend( 2 +1); -- NOT SUPPORTED pgpool=# select pg_terminate_backend((select 1)); -- NOT SUPPORTED Currently only one pg_terminate_backend call in a query is handled. - HTML documents are now generated from SGML documents. (Muhammad Usama, Tatsuo Ishii, Bo Peng) It is intended to have better construction, contents and maintainability. However, still there's tremendous room to enhance the SGML documents. Please help us! * Other Enhancements - Make authentication error message more user friendly. (Tatsuo Ishii) When attempt to connect to backend (including health checking), emit error messages from backend something like "sorry, too many clients already" instead of "invalid authentication message response type, Expecting 'R' and received '%c'" - Tighten up health check timer expired condition in pool_check_fd(). (Muhammad Usama) Check if the signal was actually the health check timer expire to make sure that we do not declare the timer expire due to some other signal arrived while waiting for data for health check in pool_check_fd(). - Add new script called "watchdog_setup". (Tatstuo Ishii) watchdog_setup is a command to create a temporary installation of Pgpool-II clusters with watchdog for mainly testings. Add "-pg" option to pgpool_setup. (Tatsuo Ishii) This is useful when you want to assign specific port numbers to PostgreSQL while using pgpool_setup. Also now pgpool_setup is installed in the standard bin directory which is same as pgpool. - Add "replication delay" column to "show pool_nodes". (Tatsuo Ishii) This column shows the replication delay value in bytes if operated in streaming replication mode. - Do not update status file if all backend nodes are in down status. (Chris Pacejo, Tatsuo Ishii) This commit tries to remove the data inconsitency in replication mode found in [pgpool-general: 3918] by not recording the status file when all backend nodes are in down status. This surprisingly simple but smart solution was provided by Chris Pacejo. - Allow to use multiple SSL cipher protocols. (Multiple Usama) By replacing TLSv1_method() with SSLv23_method() while initializing the SSL session, we can use more protocols than TLSv1 protocol. Allow to use arbitrary number of items in the black_function_list/white_function_list. (Muhammad Usama) Previously there were fixed limits for those. - Properly process empty queries (all comments). (Tatsuo Ishii) Pgpool-II now recognizes an empty query consisted of all comments (for example "/* DBD::Pg ping test v3.5.3 */") (note that no ';') as an empty query. Before such that query was recognized an error. Add some warning messages for wd_authkey hash calculation failure. (Yugo Nagata) Sometimes wd_authkey calculation fails for some reason other than authkey mismatch. The additional messages make these distinguishable for each other. * Changes - Change the default value of search_primary_node_timeout from 10 to 300. (Tatstuo Ishii) Prior default value 10 seconds is sometimes too short for a standby to be promoted. - Change the Makefile under directory src/sql/, that is proposed by [pgpool-hackers: 1611]. (Bo Peng) - Change the PID length of pcp_proc_count command output to 6 characters long. (Bo Peng) If the Pgpool-II process ID are over 5 characters, the 6th character of each process ID will be removed. This commit changes the process ID length of pcp_proc_count command output to 6 characters long. - Redirect all user queries to primary server. (Tatsuo Ishii) Up to now some user queries are sent to other than the primary server even if load_balance_mode = off. This commit changes the behavior: if load_balance_mode = off in streaming replication mode, now all the user queries are sent to the primary server only. * Bug fixes - Fix the case when all backends are down then 1 node attached. (Tatsuo Ishii) When all backends are down, no connection is accepted. Then 1 PostgreSQL becomes up, and attach the node using pcp_attach_node. It successfully finishes. However, when a new connection arrives, still the connection is refused becausePgpool-II child process looks into the cached status, in which the recovered node is still in down status if mode is streaming replication mode (native replication and other modes are fine). Solution is, if all nodes are down, force to restart all pgpool child. - Fix for avoiding downtime when Pgpool-II changes require a restart. (Muhammad Usama) To fix this, The verification mechanism of configuration parameter values is reversed, previously the standby nodes used to verify their parameter values against the respective values on the master Pgpool-II node and when the inconsistency was found the FATAL error was thrown, now with this commit the verification responsibility is delegated to the master Pgpool-II node. Now the master node will verify the configuration parameter values of each joining standby node against its local values and will produce a WARNING message instead of an error in case of a difference. This way the nodes having the different configurations will also be allowed to join the watchdog cluster and the user has to manually look out for the configuration inconsistency warnings in the master Pgpool-II log to avoid the surprises at the time of Pgpool-II master switch over. - Fix a problem with the watchdog failover_command locking mechanism. (Muhammad Usama) From Pgpool-II 3.5 watchdog was using the separate individual locks for each node-failover command (failover, failback and follow-master) and the lock was acquired just before executing the respective failover script and was released as soon as the script execution finishes. This technique although was very efficient but also had a problem. If the failover_command takes a very little time and gets finished before the lock request from other Pgpool-II node arrives, the other node is also granted a lock, since the lock was already released by the first node at that time. Consequently, both nodes ends up executing the failover script. So to fix this we are reverting back to the tested failover interlocking design used prior to Pgpool-II 3.5 where all the commands gets locked at the failover start by the node that becomes a lock-holder and each command lock is released after its execution finishes. And only the lock-holder node is allowed to acquire/release the individual command lock. That way the lock-holder node keeps the lock-holder status throughout the span of the failover execution and the system becomes less time sensitive. - Disable strict aliasing optimization. (Tatsuo Ishii) flatten_set_variable_args() was imported from PostgreSQL in Pgpool-II 3.5. To make the code work, a compiler flag -fno-strict-aliasing is necessary (PostgreSQL does so). Unfortunately when the function was imported, the compiler flag was not added. To fix this, configure.ac was modified. - Do not use random() while generating MD5 salt. (Tatsuo Ishii) random() should not be used in security related applications. To replace random(), import PostmasterRandom() from PostgreSQL. Also store current time at the start up of Pgpool-II main process for later use. - Don't ignore sync message from frontend when query cache is enabled. (Tatsuo Ishii) While returning cached query result, sync message sent from frontend is discarded. This is harmless because "ready for query" messages is sent to frontend afterward. Problem is, AccessShareLock held by previous parse message processing is not released until sync message is received by the backend. Fix is, forwarding the sync message to backend and discarding "ready for query" message returned from backend. - Fix bug that Pgpool-II fails to start if listen_addresses is empty string. (bug 237) (Muhammad Usama) The socket descriptor array (fds[]) was not getting the array end marker when TCP listen addresses are not used. - Create regression log directory if it does not exist yet. (Tatsuo Ishii) - Fixing the error messages when the socket operation fails. (Muhammad Usama) When some socket operation fails, we issue close socket before throwing an error which causes the errno value to be overwritten and consequently the error log does not print the correct failure reason. The solution is to save the errno before closing the socket and use the saved value to print error description. - Fix regression failure of 003.failover. (Tatsuo Ishii) Update expected data to reflect the changes made to show pool_nodes. Also fix show pool_nodes to proper use "_" instead of space for the column name. - Fix hang when portal suspend received. (bug 230) (Tatsuo Ishii) When portal suspend message is received, it's not enough to forward it to the client. Since backend expects to receive execute message, trying to read further more messages from backend will never succeed. To fix this, turn off the query in progress flag, which will pole incoming message from the client. - Fix pgpool doesn't de-escalate IP in case network restored. (bug 228) (Muhammad Usama) set_state function is made to de-escalate, when it is changing the local node's state from the coordinator state to some other state. - SIGUSR1 signal handler should be installed before watchdog initialization. (Muhammad Usama) Since there can be a case where a failover request from other watchdog nodes arrive at the same time when the watchdog has just been initialized, and if we wait any longer to install a SIGUSR1 signal handler, it can result in a potential crash - Fix for bug of inconsistent status of PostgreSQL nodes in Pgpool-II instances after restart. (bug 218) (Muhammad Usama) Watchdog does not synchronize status. Currently at the Pgpool-II startup, The status of each configured backend node is loaded from the backend status file or otherwise initialized by querying the backend nodes. This technique works fine in stand alone mode and also with the watchdog enabled as long as the status of backend nodes remains consistent until all Pgpool-II nodes got up and running. But since Pgpool-II does not sync the backend node status from the watchdog cluster at startup time, so in some cases the pgpool-II nodes participating in the watchdog cluster may get a different status for the same backend, especially if the Pgpool-II nodes part of the watchdog cluster starts at different times and between that time an unavailable backend PostgreSQL node had become available again. So to solve this, the commit implements the new startup procedure for the standby Pgpool-II, And now the standby Pgpool-II will load the backend status of all configured PostgreSQL nodes from the watchdog master/coordinator node at the time of startup. - Fix Pgpool-II doesn't escalate ip in case of another node inavailability. (bug 215) (Muhammad Usama) The heartbeat receiver fails to identify the heartbeat sender watchdog node when the heartbeat destination is specified in terms of an IP address while wd_hostname is configured as a hostname string or vice versa. - Fixing a coding mistake in watchdog code. (Muhammad Usama) wd_issue_failover_lock_command() function is supposed to forward command type passed in as an argument to the wd_send_failover_sync_command() function instead it was passing the NODE_FAILBACK_CMD command type. The commit also contains some log message enhancements. - Display human readable output for backend node status. (Muhammad Usama) Changed the output of pcp_node_info utility and show commands display human readable backend status string instead of internal status code. - Replace "MAJOR" macro to prevent occasional failure. (Tatsuo Ishii) The macro calls pool_virtual_master_db_node_id() and then access backend->slots[id]->con using the node id returned. In rare cases, it could point to 0 (in case when the DB node is not connected), which gives access to con->major, then it causes a segfault. - Fix "kind mismatch" error message in Pgpool-II. (Muhammad Usama) Many of "kind mismatch..." errors are caused by notice/warning messages produced by one or more of the DB nodes. In this case now Pgpool-II forwards the messages to frontend, rather than throwing the "kind mismatch..." error. This would reduce the chance of "kind mismatch..." errors. - Fix handling of pcp_listen_addresses config parameter. (Muhammad Usama) - Save and restore errno in each signal handler. (Tatsuo Ishii) - Fix usage of wait(2) in pgpool main process. (Tatsuo Ishii) When child process dies, SIGCHLD signal is raised and wait(2) knows the event. However, multiple child death does not necessarily creates exact same number of SIGCHLD signal as the number of dead children and wait(2) could wait for an event which never happens in this case. I Actually encountered this situation while testing Pgpool-II. Solution is, to use waitpid(2) instead of wait(2). - Fix confusing error messages. (Tatsuo Ishii) pool_read() does not emit error messages when read(2) returns -1 if fail_over_on_backend_error is off. In any case the cause of error should be emitted. I do not back port this because it's a too trivial enhancement. - Fix buffer over run problem in "show pool_nodes". (Tatsuo Ishii) While processing "show pool_nodes", the buffer for hostname was too short. It should be same size as the buffer used for pgpool.conf. Problem reported by a twitter user who is using pgpool on AWS (which could have very long hostname). - Fix [pgpool-hackers: 1638] pgpool-II does not use default configuration. (Muhammad Usama) Configuration file not found should just throw a WARNING message instead of ERROR or FATAL. - Fix bug with load balance node id info on shmem. (Tatsuo Ishii) There are few places where the load balance node was mistakenly put on wrong place. It should be placed on: ConnectionInfo *con_info[child id, connection pool_id, backend id].load_balancing_node]. In fact it was placed on: *con_info[child id, connection pool_id, 0].load_balancing_node]. As long as the backend id in question is 0, it is ok. However while testing Pgpool-II 3.6's enhancement regarding failover, if primary node is 1 (which is the load balance node) and standby is 0, a client connecting to node 1 is disconnected when failover happens on node 0. This is unexpected and the bug was revealed. It seems the bug was there since long time ago but it had not found until today by the reason above. - Fix for bug that pgpool hangs connections to database. (bug 197) (Muhammad Usama) The client connection was getting stuck when backend node and remote Pgpool-II node becomes unavailable at the same time. The reason was a missing command timeout handling in the function that sends the IPC commands to watchdog. - Fix a posible hang during health checking. (bug 204) (Yugo Nagata) Helath checking was hang when any data wasn't sent from backend after connect(2) succeeded. To fix this, pool_check_fd() returns 1 when select(2) exits with EINTR due to SIGALRM while health checkking is performed. - Deal with the case when the primary is not node 0 in streaming replication mode. (Tatsuo Ishii) http://www.pgpool.net/mantisbt/view.php?id=194#c837 reported that if primary is not node 0, then statement timeout could occur even after bug194-3.3.diff was applied. After some investigation, it appeared that MASTER macro could return other than primary or load balance node, which was not supposed to happen, thus do_query() sends queries to wrong node (this is not clear from the report but I confirmed it in my investigation). pool_virtual_master_db_node_id(), which is called in MASTER macro returns query_context->virtual_master_node_id if query context exists. This could return wrong node if the variable has not been set yet. To fix this, the function is modified: if the variable is not either load balance node or primary node, the primary node id is returned. For master and 3.5-stable, additional fixes/enhancements are made: pool_extended_send_and_wait() now issues flush message if the request is 'E' (execute). Before it was issued outside (in Execute), but this makes the logic to determine to which node the flush message to be sent unnecessary complex. A debug message in pool_write is enhanced by adding backend node id. - If statement timeout is enabled on backend and do_query() sends a query to primary node, and all of following user queries are sent to standby, it is possible that the next command, for example END, could cause a statement timeout error on the primary, and a kind mismatch error on pgpool-II is raised. (bug 194) (Tatsuo Ishii) This fix tries to mitigate the problem by sending sync message instead of flush message in do_query(), expecting that the sync message reset the statement timeout timer if we are in an explicit transaction. We cannot use this technique for implicit transaction case, because the sync message removes the unnamed portal if there's any. Plus, pg_stat_statement will no longer show the query issued by do_query() as "running". - Fix extended protocol handling in raw mode. (Tatsuo Ishii) Bug152 reveals that extended protocol handling in raw mode (actually other than in stream mode) was wrong in Describe() and Close(). Unlike stream mode, they should wait for backend response. - Fix confusing comments in pgpool.conf. (Tatsuo Ishii) - Fix Japanese and Chinese documetation bug about raw mode. (Yugo Nagata, Bo Peng) Connection pool is avalilable in raw mode. - Fix is_set_transaction_serializable() when SET default_transaction_isolation TO 'serializable'. (bug 191) (Bo Peng) SET default_transaction_isolation TO 'serializable' is sent to not only primary but also to standby server in streaming replication mode, and this causes an error. Fix is, in streaming replication mode, SET default_transaction_isolation TO 'serializable' is sent only to the primary server. - Fix extended protocol hang with empty query. (bug 190) (Tatsuo Ishii) The fixes related to extended protocol cases in 3.5.1 broke the case of empty query. In this case backend replies with "empty query response" which is same meaning as a command complete message. Problem is, when empty query response is received, pgpool does not reset the query in progress flag thus keeps on waiting for backend. However, backend will not send the ready for query message until it receives a sync message. Fix is, resetting the in progress flag after receiving the empty query response and reads from frontend expecting it sends a sync message. - Fix for [pgpool-general: 4569] Pgpool-II 3.5 : segfault. (Muhammad Usama) PostgreSQL's memory and exception manager APIs adopted by the Pgpool-II 3.4 are not thread safe and are causing the segmentation fault in the watchdog lifecheck process, as it uses the threads to ping configured trusted hosts for checking the upstream connections. Fix is to remove threads and use the child process approach instead. - Validating the PCP packet length. (Muhammad Usama) Without the validation check, a malformed PCP packet can crash the PCP child and/or can run the server out of memory by sending the packet with a very large data size. - Fix Pgpool-II hang bug (bug 167). (Tatsuo Ishii) Pgpool-II 3.5 or after in streaming replication mode does not wait for response from each phase such parse, bind anymore. However, if do_query is called, it sends flush message to retrieve the result of system catalog look up. This is only sent to primary node which may results in retrieving previous message results, for example parse complete. If standby is assigned to load balance node, the node does not return parse complete message, which will cause a problem in bug167 case, because parse message for "BEGIN" was sent to both the primary and the standby. Fix is, send flush message in do_query if the load balance node is one of standbys. - Fix pgpool_setup to not confuse log output. (Tatsuo Ishii) Before it simply redirects the stdout and stderr of pgpool process to a log file. This could cause log contents being garbled or even missed because of race condition caused by multiple process being writing concurrently. I and Usama found this while investigating the regression failure of 004.watchdog. To fix this, pgpool_setup now generates startall script so that pgpool now sends stdout/stderr to cat command and cat writes to the log file (It seems the race condition does not occur when writing to a pipe). - Fix for [pgpool-general: 4519] Worker Processes Exit and Are Not Re-spawned. (Muhammad Usama) The problem was due to a logical mistake in the code for checking the exiting child process type when the watchdog is enabled. I have also changed the severity of the message from FATAL to LOG, emitted for child exits due to max connection reached. - Fix pgpool hung after receiving error state from backend. (bug #169) (Tatsuo Ishii) This could happend if we execute an extended protocol query and it fails. After an error is received the "ignore till sync flag" is set and remained even if sync message was actually received. Thus any subsequent query (in the case above "DEALLOCATE message") is not procesed and pgpool waits for message from frontend and backend, and pgpool stucks here because no message will arrive from both side. To fix this, unconditionally reset the "ignore till sync flag" in ReadyforQuery(). This is safe because apparently we already received the ready for query message. - Fix query stack problems in extended protocol case. (bug 167, 168) (Tatstuo Ishii) - Fix [pgpool-hackers: 1440] yet another reset query stuck problem. (Tatsuo Ishii) After receiving X message from frontend, if Pgpool-II detects EOF on the connection before sending reset query, Pgpool-II could wait for backend which had not received the reset query. To fix this, if EOF received, treat this as FRONTEND_ERROR, rather than ERROR. - Fix for [pgpool-general: 4265] another reset query stuck problem. (Muhammad Usama) The solution is to report FRONTEND_ERROR instead of simple ERROR when pool_flush on front-end socket fails. - Fixing pgpool-recovery module compilation issue with PostgreSQL 9.6. (Muhammad Usama) Incorporating the change of function signature for GetConfigOption() functions in PostgreSQL 9.6 - Fix compile issue on freebsd. (Muhammad Usama) Add missing include files. The patch is contributed by the bug reporter and enhanced a little by me. - Fix regression test to check timeout of each test. (Yugo Nagata) - Add some warning messages for wd_authkey hash calculation failure. (Yugo Nagata) Sometimes wd_authkey calculation fails for some reason other than authkey mismatch. The additional messages make these distingushable for each other. =============================================================================== 3.5 Series (2016/01/29 - ) =============================================================================== 3.5.4 (ekieboshi) 2016/08/31 * Version 3.5.4 This is a bugfix release against pgpool-II 3.5.3. __________________________________________________________________ * Bug fixes - Fix buffer over run problem in "show pool_nodes". (Tatsuo Ishii) While processing "show pool_nodes", the buffer for hostname was too short. It should be same size as the buffer used for pgpool.conf. Problem reported by a twitter user who is using pgpool on AWS (which could have very long hostname). - Fix usage of wait(2) in pgpool main process. (Tatsuo Ishii) The usage of wait(2) in pgpool main could cause infinite wait in the system call. Solution is, to use waitpid(2) instead of wait(2). - Save and restore errno in each signal handler. (Tatsuo Ishii) - Fix handling of pcp_listen_addresses config parameter. (Muhammad Usama) - Fix "kind mismatch" error message in pgpool. (Muhammad Usama) Many of "kind mismatch..." errors are caused by notice/warning messages produced by one or more of the DB nodes. In this case now Pgpool-II forwards the messages to frontend, rather than throwing the "kind mismatch..." error. This would reduce the chance of "kind mismatch..." errors. See [pgpool-hackers: 1501] for more details. - Replace "MAJOR" macro to prevent occasional failure. (Tatsuo Ishii) The macro calls pool_virtual_master_db_node_id() and then access backend->slots[id]->con using the node id returned. In rare cases, it could point to 0 (in case when the DB node is not connected), which gives access to con->major, then it causes a segfault. See bug 225 for related info. - Fixing a coding mistake in watchdog code. (Muhammad Usama) wd_issue_failover_lock_command() function is supposed to forward command type passed in as an argument to the wd_send_failover_sync_command() function instead it was passing the NODE_FAILBACK_CMD command type. The commit also contains some log message enhancements. - doc : Fixing a typo in english doc (Muhammad Usama) - Fix for bun 215 that pgpool doesn't escalate ip in case of another node inavailability. (Muhammad Usama) The heartbeat receiver fails to identify the heartbeat sender watchdog node when the heartbeat destination is specified in terms of an IP address while wd_hostname is configured as a hostname string or vice versa. See bug 215 for related info. - Fix for bug of inconsistent status of Postgresql nodes in Pgpool instances after restart.(Muhammad Usama) Watchdog does not synchronize status. See bug 218 for related info. - SIGUSR1 signal handler should be installed before watchdog initialization. (Muhammad Usama) Since there can be a case where a failover request from other watchdog nodes arrive at the same time when the watchdog has just been initialized, and if we wait any longer to install a SIGUSR1 signal handler, it can result in a potential crash. - Fix for bug 228 that pgpool doesn't de-escalate IP in case network restored. (Muhammad Usama) See bug 228 for related info. - Fix hang when portal suspend received. (Tatsuo Ishii) See bug 230 for related info. - test : Add regression test for bug 230. (Tatsuo Ishii) - Fixing a typo in the log message. (Muhammad Usama) - Fixing the error messages when the socket operation fails. (Muhammad Usama) - Tighten up health check timer expired condition in pool_check_fd(). (Muhammad Usama) - doc : Add comment to the document about connection_cache. (Tatsuo Ishii) - Fix Handling of pcp_socket_dir was missing from pool_get_config(). (Muhammad Usama) - doc : Fix Japanese document typo. (Bo Peng) - Fix "out of memory" by using "pg_md5 -m".(Muhammad Usama) See bug 236 for related info. - Fix for 237 that Pgpool-II fails to start if listen_addresses is empty string. (Muhammad Usama) The socket descriptor array (fds[]) was not getting the array end marker when TCP listen addresses are not used. See bug 237 for related info. =============================================================================== 3.5.3 (ekieboshi) 2016/06/17 * Version 3.5.3 This is a bugfix release against pgpool-II 3.5.2. __________________________________________________________________ * New features - Allow to access to pgpool while doing health checking (Tatsuo Ishii) Currently any attempt to connect to pgpool fails if pgpool is doing health check against failed node even if fail_over_on_backend_error is off because pgpool child first tries to connect to all backend including the failed one and exits if it fails to connect to a backend (of course it fails). This is a temporary situation and will be resolved before pgpool executes failover. However if the health check is retrying, the temporary situation keeps longer depending on the setting of health_check_max_retries and health_check_retry_delay. This is not good. Attached patch tries to mitigate the problem: - When an attempt to connect to backend fails, give up connecting to the failed node and skip to other node, rather than exiting the process if operating in streaming replication mode and the node is not primary node. - Mark the local status of the failed node to "down". - This will let the primary node be selected as a load balance node and every queries will be sent to the primary node. If there's other healthy standby nodes, one of them will be chosen as the load balance node. - After the session is over, the child process will suicide to not retain the local status. Per [pgpool-hackers: 1531]. * Bug fixes - Fix is_set_transaction_serializable() when SET default_transaction_isolation TO 'serializable'. (Bo Peng) SET default_transaction_isolation TO 'serializable' is sent to not only primary but also to standby server in streaming replication mode, and this causes an error. Fix is, in streaming replication mode, SET default_transaction_isolation TO 'serializable' is sent only to the primary server. See bug 191 for related info. - Fix Chinese documetation bug about raw mode (Yugo Nagata, Bo Peng) Connection pool is avalilable in raw mode. - Fix confusing comments in pgpool.conf (Tatsuo Ishii) - Fix extended protocol handling in raw mode (Tatsuo Ishii) Bug152 reveals that extended protocol handling in raw mode (actually other than in stream mode) was wrong in Describe() and Close(). Unlike stream mode, they should wait for backend response. See bug 152 for related info. - Permit pgpool to support multiple SSL cipher protocols (Muhammad Usama) Currently TLSv1_method() is used to initialize the SSL context, that puts an unnecessary limitation to allow only TLSv1 protocol for SSL communication. While postgreSQL supports other ciphers protocols as well. The commit changes the above and initializes the SSLSession using the SSLv23_method() (same is also used by PostgreSQL). Because it can negotiate the use of the highest mutually supported protocol version and remove the limitation of one specific protocol version. - If statement timeout is enabled on backend and do_query() sends a (Tatsuo Ishii) query to primary node, and all of following user queries are sent to standby, it is possible that the next command, for example END, could cause a statement timeout error on the primary, and a kind mismatch error on pgpool-II is raised. This fix tries to mitigate the problem by sending sync message instead of flush message in do_query(), expecting that the sync message reset the statement timeout timer if we are in an explicit transaction. We cannot use this technique for implicit transaction case, because the sync message removes the unnamed portal if there's any. Plus, pg_stat_statement will no longer show the query issued by do_query() as "running". See bug 194 for related info. - Deal with the case when the primary is not node 0 in streaming replication mode. (Tatsuo Ishii) http://www.pgpool.net/mantisbt/view.php?id=194#c837 reported that if primary is not node 0, then statement timeout could occur even after bug194-3.3.diff was applied. After some investigation, it appeared that MASTER macro could return other than primary or load balance node, which was not supposed to happen, thus do_query() sends queries to wrong node (this is not clear from the report but I confirmed it in my investigation). pool_virtual_master_db_node_id(), which is called in MASTER macro returns query_context->virtual_master_node_id if query context exists. This could return wrong node if the variable has not been set yet. To fix this, the function is modified: if the variable is not either load balance node or primary node, the primary node id is returned. - Fix a posible hang during health checking (Yugo Nagata) Helath checking was hang when any data wasn't sent from backend after connect(2) succeeded. To fix this, pool_check_fd() returns 1 when select(2) exits with EINTR due to SIGALRM while health checkking is performed. Reported and patch provided by harukat and some modification by Yugo. See bug 204 for related info. - change the Makefile under this directory src/sql/,that is proposed by (Bo Peng) [pgpool-hackers: 1611] - fix for 0000197: pgpool hangs connections to database.. (Muhammad Usama) The client connection was getting stuck when backend node and remote pgpool-II node becomes unavailable at the same time. The reason was a missing command timeout handling in the function that sends the IPC commands to watchdog. - Fix bug with load balance node id info on shmem (Tatsuo Ishii) There are few places where the load balance node was mistakenly put on wrong place. It should be placed on: ConnectionInfo *con_info[child id, connection pool_id, backend id].load_balancing_node]. In fact it was placed on: *con_info[child id, connection pool_id, 0].load_balancing_node]. As long as the backend id in question is 0, it is ok. However while testing pgpool-II 3.6's enhancement regarding failover, if primary node is 1 (which is the load balance node) and standby is 0, a client connecting to node 1 is disconnected when failover happens on node 0. This is unexpected and the bug was revealed. It seems the bug was there since long time ago but it had not found until today by the reason above. - Fixing coverity scan reported issues. (Muhammad Usama) =============================================================================== 3.5.2 (ekieboshi) 2016/04/26 * Version 3.5.2 This is a bugfix release against pgpool-II 3.5.1. __________________________________________________________________ * Bug fixes - Fix for segfault during trusted_servers check (Muhammad Usama) PostgreSQL's memory and exception manager APIs adopted by the pgpool 3.4 are not thread safe and are causing the segmentation fault in the watchdog lifecheck process, as it uses the threads to ping configured trusted hosts for checking the upstream connections. Fix is to remove threads and use the child process approach instead. See [pgpool-general: 4569] for more details. - Removing the limit on the maximum number of items in the black_function_list and white_function_list lists (Muhammad Usama) extract_string_tokens in pool_config uses the fixed size malloc on the array to hold the black_function_list/white_function_list items. This imposes a limit of maximum items in these lists. The fix is to use realloc to increase the array size when it gets full. - Fix check "PCP Directory" in "Parameter Setting" in install (Nozomi Anzai) The command "pcp_system_info" was discarded in 3.5, but pgpoolAdmin still confirmed if it existed. Per bug #187. - Fix extended protocol hang with empty query (Tatsuo Ishii) The fixes related to extended protocol cases in 3.5.1 broke the case of empty query. In this case backend replies with "empty query response" which is same meaning as a command complete message. Problem is, when empty query response is received, pgpool does not reset the query in progress flag thus keeps on waiting for backend. However, backend will not send the ready for query message until it receives a sync message. Fix is, resetting the in progress flag after receiving the empty query response and reads from frontend expecting it sends a sync message. Per bug #190. - Redirect all user queries to primary server (Tatsuo Ishii) Up to now some user queries are sent to other than the primary server even if load_balance_mode = off. This commit changes the behavior: if load_balance_mode = off in streaming replication mode, now all the user queries are sent to the primary server only. Per bug #189. - Change the PID length of pcp_proc_count command result to 6 characters long (Bo Peng) If the pgpool process ID are over 5 characters, the 6th character of each process ID will be removed. This commit changes the process ID length of pcp_proc_count command result to 6 characters long. Per bug #188. =============================================================================== 3.5.1 (ekieboshi) 2016/04/04 * Version 3.5.1 This is a bugfix release against pgpool-II 3.5.0. __________________________________________________________________ * Bug fixes - Add some warning messages for wd_authkey hash calculation failure (Yugo Nagata) Sometimes wd_authkey calculation fails for some reason other than authkey mismatch. The additional messages make these distingushable for each other. - test: Fix regression test to check timeout of each test (Yugo Nagata) - test: Allow timeout value to be specified by the command option (Yugo Nagata) - Fix compile issue on FreeBSD (Muhammad Usama) Added missing include files. Per bug #166. The patch is contributed by the bug reporter and enhanced a little by Usama. - test: Fix test/regression/clean.sh to remove binary files of 010.rewrite_timestamp test (Yugo Nagata) - Fix memorry leak reported by Coverity (CID 1350095) (Yugo Nagata) - Fixing pgpool-recovery module compilation issue with PostgreSQL 9.6 (Muhammad Usama) Incorporating the change of function signature for GetConfigOption..() functions in PostgreSQL 9.6. - Fix to properly process an empty query that has only comments (Tatsuo Ishii) Pgpool-II recognized an empty query, for example "/* DBD::Pg ping test v3.5.3 */" (note that it has no ';') as an error and emits message "Unable to parse the query". This is because raw_parser() cannot distinguish an empty query from an error query due to the poor API design. To fix this new out parameter "*error" added to the function. If an error occurred, the variable is set to true and caller can know the reason why raw_parser() returns NIL is because of an error query or an empty query. Per bug #154. See [pgpool-hackers: 1359] for additional information. - Fix a reset query stuck problem (Muhammad Usama) The solution is to report FRONTEND_ERROR instead of simple ERROR when pool_flush on front-end socket fails. The original report is [pgpool-general: 4265] Pgpool - connection hangs in DISCARD ALL The patch was generated by Usama and Pawel Ufnalewski, and Gerhard Wiesinger helped to verify and test the fix. - Fix a reset query stuck problem (Tatsuo Ishii) After receiving X message from frontend, if pgpool-II detects EOF on the connection before sending reset query, pgpool-II could wait for a response from backend which had not received the reset query. To fix this, if EOF received, treat this as FRONTEND_ERROR, rather than ERROR. See "[pgpool-hackers: 1440] Yet another reset query stuck problem" for more details. - Fix query stuck problems in streaming replication mode with extended protocol queries (Tatsuo Ishii) This fix is for both bug #167 and #168. - Fix pgpool hung after receiving error state from backend (Tatsuo Ishii) This could happend if we execute an extended protocol query and it fails. Per bug #169. - Fix bug that child processes exit and are not re-spawned (Muhammad Usama) The problem was due to a logical mistake in the code for checking the exiting child process type when the watchdog is enabled. Also the severity of the message emitted for child exits due to max connection reached from FATAL to LOG. Per [pgpool-general: 4519] Worker Processes Exit and Are Not Re-spawned - Fix typo in configure (Tatsuo Ishii) Patch provided by Thomas Munro. - doc: Change description of backend_flag (Tatsuo Ishii) It is pointed out that restarting pgpool-II is not necessary. Per [pgpool-general-jp: 1394]. - doc: Fix installation procedure. (Tatsuo Ishii) With PostgreSQL 9.4 or later, installing pgpool_regclass is not needed. - test: Fix pgpool_setup to not confuse log output (Tatsuo Ishii) Before it simply redirects stdout and stderr of pgpool processes to a log file. This could cause the log contents being garbled or even missed because of race condition caused by multiple process being writing concurrently. To fix this, pgpool_setup now generates startall script in which pgpool sends stdout/stderr to cat command by pipe, and cat writes to the log file. - Fix to validate the PCP packet length (Muhammad Usama) Without the validation check, a malformed PCP packet can crash the PCP child and/or can run the server out of memory by sending the packet with a very large data size. =============================================================================== 3.5.0 (ekieboshi) 2016/01/29 * Version 3.5.0 This is the first version of pgpool-II 3.5 series. That is, a "major version up" from 3.4 series. __________________________________________________________________ * Incompatible changes - Remove parallel query mode codes (Yugo Nagata) There are very few users and the maintenance efforts are not worth it. Codes for system db are also removed, since this was used in only parallel query mode and old query cache on disk. - Rename parameter name from ifconfig_path to if_cmd_path (Yugo Nagata) ifconfig_path isn't appropriate for the parameter name because ifconfig command is obsolete and now ip command is used as default. - Change the syntax of pcp commands arguments (Muhammad Usama) - Change the output and the argument semantics of pcp_watchdog_info command (Muhammad Usama) The command is enhanced to show watchdog information about all pgpool-II nodes in the cluster. According to this, the argument to specify node index is changed so that 0 means local pgpool-II node instead of the first remote node. __________________________________________________________________ * New features - Add new parameter "serialize_accept" (Tatsuo Ishii) This parameter defines whether to serialize accept() call for incoming client connections. Default is off, which means no serializing (same behavior as pgpool-II 3.4 or before). If this is off, the kernel wakes up all of pgpool-II child process to execute accept() and one of them actually accepts the incoming connection. Problem here is, because so my child process wake up at a same time, heavy context switching occurred and the performance is affected. This phenomena is a classic problem called "the thundering herd problem". By enabling serialize_accept, only one of pgpool-II child process is woken up and executes accept() and the problem can be avoided. - Import parser of PostgreSQL 9.5 (Yugo Nagata) pgpool-II can understand new syntax introduced in PostgreSQL 9.5 now. Especially GROUPING SET, CUBE, ROLLUP and TABLESAMPLE can be be load balanced and can be used in query cache (except for TABLESAMPLE). Also INSERT...ON CONFLICT and UPDATE tab SET (col1, col2, ...) = (SELECT ...) ... can now be properly handled in query rewriting in native replication mode. - Allow to specify database for health check and streaming replication delay check. (Tatsuo Ishii) For this purpose new directive "health_check_database" and "sr_check_database" are added. __________________________________________________________________ * Enhancements - Performance improvement in extened query protocol (Tatsuo Ishii) Unnecessary "flush" messages which used to be sent in each step of extended protocol messages (parse, bind, describe and execute) and brought significant communication overhead are removed. For now it only affects to streaming replication mode, that is, the performance of other modes remains same. - watchdog feature enhancements (Muhammad Usama, Yugo Nagata) The goal of this enhancement is to address the shortcomings and problems in the pgpool watchdog and make the watchdog system more robust and adaptable. Patch created by Usama, and reviewed, tested, and debugged by Yugo. -- The watchdog should consider the quorum and only elect the master/leader node if the quorum exist in the watchdog cluster. -- All the participating pgpool-II nodes in the watchdog cluster should have similar pgpool-II configurations. -- Watchdog nodes should have configurable watchdog node priority, to give users more control on which node should become a leader node. -- More options for the node health-checking, especially watchdog should allow external/3rd party node health checking system to integrate with it. -- The watchdog should keep looking for problems like split-brain syndrome and should automatically recover from it. -- Allow user to provide scripts to be executed at time of escalation and de-escalation to master/leader nodes. Add these new parameters: -- wd_ipc_socket_dir: This parameter is used to specify the directory where the UNIX domain socket accepting pgpool-II watchdog IPC connections will be created. -- wd_priority: This new parameter can be used to elevate the current watchdog node priority in leader elections. The node with the higher wd_priority value will get selected as master/coordinator watchdog node when cluster will be electing its master node at cluster startup or in the event of old master watchdog node failure. -- wd_de_escalation_command: This parameter holds the command that watchdog will execute on the master pgpool-II watchdog node when that node resigns from the master node responsibilities. -- wd_monitoring_interfaces_list: This parameter holds a comma separated list of network device names to be monitored by the watchdog process for the network link state. - Overhauling pcp commands (Muhammad Usama) -- Improved handling of command argument: Long command line options can be used now. -- PCP password is safe: Don't pass password via command line, which causes security risks. -- Mutiple concurrent execution of pcp commands: Allow to execute a pcp command while running pcp_recovery_node which takes sometime to finish. - SELECT count statics in "show pool_nodes" command results (Tatsuo Ishii) show pool_nodes results which briefly describes the status of each backend now shows how many SELECTs are issued to them. So you can quickly recognize the effect of load balancing for example; test=# show pool_nodes; node_id | hostname | port | status | lb_weight | role | select_cnt ---------+----------+-------+--------+-----------+---------+------------ 0 | /tmp | 11002 | 2 | 0.500000 | primary | 338230 1 | /tmp | 11003 | 2 | 0.500000 | standby | 163939 (2 rows) - Parser enhancements for query rewriting (Yugo Nagata) INSERT/UPDATE/DELETE with WITH clause, writable CTE, RETURNING clause can now be properly handled in query rewriting in native replication mode. - Allow to open pool_passwd file in read only mode by pgpool-II main process (Tatsuo Ishii) - Allow to run pgpool in debug mode in regression tests (Tatsuo Ishii) - doc:Add pgpool_adm documents (Tatsuo Ishii) - doc:Update Chinese documents (Bambo Huang) __________________________________________________________________ * Bug fixes (since 3.4.3) - doc: Fix misinformation regarding load balancing in docs (Tatsuo Ishii) In streaming replication mode, DECLARE, FETCH, CLOSE and SHOW are sent to primary node only. Pointed out in [pgpool-general-jp: 1378]. - Issue fsync() when writing pgpool_status. (Tatsuo Ishii) This ensures that pgpool_status is saved to permanent storage and allow to survive after system crash. - Fix reset query stuck problem (Muhammad Usama) It is reported that reset query (DISCARD ALL etc.) occasionally does not finish and pgpool child remain waiting for reply from the backend thus client cannot connect to pgpool (for example bug report #107). The cause of problem is not identified yet but if client suddenly closes connection to pgpool in the middle of query processing, backend may not accept the reset queries because they are not ready for query. The fix is to keep track of the status of frontend socket state and not caching the PostgreSQL connection if the connection to frontend was not properly terminated. - test: Fix false alerm of regression tset 062 (Yugo Nagata) - test: Fix broken regression test for native replication (Yugo Nagata) Test for insert-lock didn't work. - test: Fix regress test to sleep after pgpool_reload (Yugo Nagata) Some regression tests modify configuration file and reloads. However, sometimes these were not applied to pgpool just after reloading. - Fix inconsistency of sequence values in replication mode (Yugo Nagata) When a schema name was provided, the table name was quoted wrongly as like "public.mytbl" instead of "public"."mytbl". So, pool_regclass and to_regclass couldn't find right talbe oid and insert lock was never executed. This caused inconsistency between DB nodes. - test: Fix complication error and segfault of timestamp rewrite test (Yugo Nagata) - doc: Fix untranslated sentence in Japanese document (Yugo Nagata) - Fix ancient bug of pool_push() and friends. (Tatsuo Ishii) It allocates buffer using realloc and uses the pointer returned. However it does the pointer calculation *before* realloc gets called. So the calculation uses the old pointer value, which causes various problems including segfault later. Also there were other problems with it. The buffer pointer and buffer size variable is not initialized. The buffer is not freed by pool_close. Typo in debugging message (3.4 or later only). They are fixed as well. - doc: Fix wrong description in documents about log_standby_delay (Yugo Nagata) - Fix segfalut that occurs when function is used in FROM clause (Yugo Nagata) PRPARE statements in streaming-reaplication mode and INSERT/UPDATE with SELECT in native-replication mode were affected. For example: - prepare p as select * from generate_series(1,1); - insert into tbl select now(), * from generate_series(1,1); - doc: Add caution about JDBC driver version regarding app_name_redirect_preference_list (Tatsuo Ishii) - Fix hang problmen reported in bug #145. (Tatsuo Ishii) The problem occurs when all the condition below are met: 1) pgpool-II 3.4 or later 2) streaming replication mode 3) primary node is also load balance node 4) extended protocol is used 5) client_idle_limit reached - Fix a in-memory query cache bug (Tatsuo Ishii) If extended query protocol is used and a bind/execute message arrives which uses a statement created by prior parse message, the temp_cache is not initialized by a parse messages. Thus messages are added to pre existing temp cache buffer which causes the trouble, that is, when the cached result returns, Data Row message and Command Complete message appeared twice. Per by bug #152. - test: Fix regression test 065. (Tatsuo Ishii) The path to JDBC driver was explicitly defined. This is wrong. This should be inherited from JDBC_DRIVER environment variable. - test: Fix possible hang-up of regression test 054.postgres_fdw (Yugo Nagata) - test: Add option to regress.sh and pgpool_setup for unix domain socket directory (Yugo Nagata) - doc: Add missing descriptions about default values to documents (Yugo Nagata) - test: Fix regression test 055 for rhel7 rpm (Yugo Nagata) - Fix reset query stuck problem (Muhammad Usama) The issue is already fixed in older branches and this fix adopts the same solution used by 3.3 series, i.e. closing the backend connection when client idle limit is reached. - Fix bug with "SET TRANSACTION READ ONLY" (Tatsuo Ishii) Pgpool-II remembers that non read only queries (including SET) were executed in an explicit transaction and adds a "writing transaction" mark to the transaction. The mark affects the query routing behavior of pgpool-II while running in streaming replication mode. Pgpool-II starts sending queries to the primary after the mark is set. Because the effect of writing queries may appear on standbys after some delay in streaming replication mode, it is safer to route read queries to the primary after the mark is set. However there's oversight here. "SET TRANSACTION READ ONLY" does no data modification and should be treated as an exception. Per bug #157. - test: Fix to use timeout command to handle time out of regress test 062 (Yugo Nagata) - Fix to show wrong error (Tatsuo Ishii) connect_with_timeout() does not show proper error info when getsockopt(SO_ERROR) reports an error. Pointed out in bug #159. - test: Add regress.sh missing \n in help messages (Yugo Nagata) - Fix the logic issue in get_backends_status() function (Muhammad Usama) get_backends_status () function counts the number of current valid and down backend nodes. The function assumed that the node was also invalid when its connection status was down. However, that is not always right. - Fix white/black_memqcache_table_list not to require quotaion (Yugo Nagata) The tables and schemas name specified in *_memqcache_table_list were needed to be quoted by double quotation. Patch contributed by Dang Minh Huong. Per [pgpool-hackers: 1323] - Fix FATAL error with reloading (Tatsuo Ishii) While reloading pgpool.conf, the number of DB nodes is tentatively set to 0, then counted up until reaching to the actual number of backends by the pgpool main process. Unfortunately the variable was on the shared memory and it confused pgpool child process when they were using the variable and this caused FATAL error. Per bug #156 report by harukat. - test: Add some tests for white/black_memqcache_table_list to regression test 006.memqcache (Yugo Nagata) - Fix reset query stuck problem (Muhammad Usama, Tatsuo Ishii) When pool_read fails to read from frontend or pool_flush fails to write to the frontend, report FRONTEND_ERROR, rather than ERROR to disconnect and terminate pgpool child process, to prevent the query stuck problem. - test: Fix some regression tests that failed in debug mode (Yugo Nagata) - Fix performance degradation while using IPv6 (Muhammad Usama) Per bug #165. =============================================================================== 3.4 Series (2014/11/07 - ) =============================================================================== 3.4.8 (tataraboshi) 2016/08/31 * Version 3.4.8 This is a bugfix release against pgpool-II 3.4.7. __________________________________________________________________ * Bug fixes - Fix buffer over run problem in "show pool_nodes". (Tatsuo Ishii) While processing "show pool_nodes", the buffer for hostname was too short. It should be same size as the buffer used for pgpool.conf. Problem reported by a twitter user who is using pgpool on AWS (which could have very long hostname). - Fix usage of wait(2) in pgpool main process. (Tatsuo Ishii) The usage of wait(2) in pgpool main could cause infinite wait in the system call. Solution is, to use waitpid(2) instead of wait(2). - Save and restore errno in each signal handler. (Tatsuo Ishii) - Fix handling of pcp_listen_addresses config parameter. (Muhammad Usama) - Fix "kind mismatch" error message in pgpool. (Muhammad Usama) Many of "kind mismatch..." errors are caused by notice/warning messages produced by one or more of the DB nodes. In this case now Pgpool-II forwards the messages to frontend, rather than throwing the "kind mismatch..." error. This would reduce the chance of "kind mismatch..." errors. See [pgpool-hackers: 1501] for more details. - Replace "MAJOR" macro to prevent occasional failure. (Tatsuo Ishii) The macro calls pool_virtual_master_db_node_id() and then access backend->slots[id]->con using the node id returned. In rare cases, it could point to 0 (in case when the DB node is not connected), which gives access to con->major, then it causes a segfault. See bug 225 for related info. - doc : Fixing a typo in english doc (Muhammad Usama) - doc : fix Japanese document typo. (Bo Peng) - Fixing a typo in the log message. (Muhammad Usama) - Tighten up health check timer expired condition in pool_check_fd(). (Muhammad Usama) - doc : Add comment to the document about connection_cache. (Tatsuo Ishii) - Fix for 237 that Pgpool-II fails to start if listen_addresses is empty string. (Muhammad Usama) The socket descriptor array (fds[]) was not getting the array end marker when TCP listen addresses are not used. See bug 237 for related info. =============================================================================== 3.4.7 (tataraboshi) 2016/06/17 * Version 3.4.7 This is a bugfix release against pgpool-II 3.4.6. __________________________________________________________________ * New features - Allow to access to pgpool while doing health checking (Tatsuo Ishii) Currently any attempt to connect to pgpool fails if pgpool is doing health check against failed node even if fail_over_on_backend_error is off because pgpool child first tries to connect to all backend including the failed one and exits if it fails to connect to a backend (of course it fails). This is a temporary situation and will be resolved before pgpool executes failover. However if the health check is retrying, the temporary situation keeps longer depending on the setting of health_check_max_retries and health_check_retry_delay. This is not good. Attached patch tries to mitigate the problem: - When an attempt to connect to backend fails, give up connecting to the failed node and skip to other node, rather than exiting the process if operating in streaming replication mode and the node is not primary node. - Mark the local status of the failed node to "down". - This will let the primary node be selected as a load balance node and every queries will be sent to the primary node. If there's other healthy standby nodes, one of them will be chosen as the load balance node. - After the session is over, the child process will suicide to not retain the local status. Per [pgpool-hackers: 1531]. * Bug fixes - Fix is_set_transaction_serializable() when SET default_transaction_isolation TO 'serializable'. (Bo Peng) SET default_transaction_isolation TO 'serializable' is sent to not only primary but also to standby server in streaming replication mode, and this causes an error. Fix is, in streaming replication mode, SET default_transaction_isolation TO 'serializable' is sent only to the primary server. See bug 191 for related info. - Fix Chinese documetation bug about raw mode (Yugo Nagata, Bo Peng) Connection pool is avalilable in raw mode. - Fix confusing comments in pgpool.conf (Tatsuo Ishii) - Permit pgpool to support multiple SSL cipher protocols (Muhammad Usama) Currently TLSv1_method() is used to initialize the SSL context, that puts an unnecessary limitation to allow only TLSv1 protocol for SSL communication. While postgreSQL supports other ciphers protocols as well. The commit changes the above and initializes the SSLSession using the SSLv23_method() (same is also used by PostgreSQL). Because it can negotiate the use of the highest mutually supported protocol version and remove the limitation of one specific protocol version. - If statement timeout is enabled on backend and do_query() sends a (Tatsuo Ishii) query to primary node, and all of following user queries are sent to standby, it is possible that the next command, for example END, could cause a statement timeout error on the primary, and a kind mismatch error on pgpool-II is raised. This fix tries to mitigate the problem by sending sync message instead of flush message in do_query(), expecting that the sync message reset the statement timeout timer if we are in an explicit transaction. We cannot use this technique for implicit transaction case, because the sync message removes the unnamed portal if there's any. Plus, pg_stat_statement will no longer show the query issued by do_query() as "running". See bug 194 for related info. - Fix a posible hang during health checking (Yugo Nagata) Helath checking was hang when any data wasn't sent from backend after connect(2) succeeded. To fix this, pool_check_fd() returns 1 when select(2) exits with EINTR due to SIGALRM while health checkking is performed. Reported and patch provided by harukat and some modification by Yugo. See bug 204 for related info. - change the Makefile under this directory src/sql/,that is proposed by (Bo Peng) [pgpool-hackers: 1611] - Fix bug with load balance node id info on shmem (Tatsuo Ishii) There are few places where the load balance node was mistakenly put on wrong place. It should be placed on: ConnectionInfo *con_info[child id, connection pool_id, backend id].load_balancing_node]. In fact it was placed on: *con_info[child id, connection pool_id, 0].load_balancing_node]. As long as the backend id in question is 0, it is ok. However while testing pgpool-II 3.6's enhancement regarding failover, if primary node is 1 (which is the load balance node) and standby is 0, a client connecting to node 1 is disconnected when failover happens on node 0. This is unexpected and the bug was revealed. It seems the bug was there since long time ago but it had not found until today by the reason above. - Deal with the case when the primary is not node 0 in streaming replication mode. (Tatsuo Ishii) http://www.pgpool.net/mantisbt/view.php?id=194#c837 reported that if primary is not node 0, then statement timeout could occur even after bug194-3.3.diff was applied. After some investigation, it appeared that MASTER macro could return other than primary or load balance node, which was not supposed to happen, thus do_query() sends queries to wrong node (this is not clear from the report but I confirmed it in my investigation). pool_virtual_master_db_node_id(), which is called in MASTER macro returns query_context->virtual_master_node_id if query context exists. This could return wrong node if the variable has not been set yet. To fix this, the function is modified: if the variable is not either load balance node or primary node, the primary node id is returned. =============================================================================== 3.4.6 (tataraboshi) 2016/04/26 * Version 3.4.6 This is a bugfix release against pgpool-II 3.4.5. __________________________________________________________________ * Bug fixes - Fix for segfault during trusted_servers check (Muhammad Usama) PostgreSQL's memory and exception manager APIs adopted by the pgpool 3.4 are not thread safe and are causing the segmentation fault in the watchdog lifecheck process, as it uses the threads to ping configured trusted hosts for checking the upstream connections. Fix is to remove threads and use the child process approach instead. See [pgpool-general: 4569] for more details. - Removing the limit on the maximum number of items in the black_function_list and white_function_list lists. (Muhammad Usama) extract_string_tokens in pool_config uses the fixed size malloc on the array to hold the black_function_list/white_function_list items. This imposes a limit of maximum items in these lists. The fix is to use realloc to increase the array size when it gets full. - Redirect all user queries to primary server (Tatsuo Ishii) Up to now some user queries are sent to other than the primary server even if load_balance_mode = off. This commit changes the behavior: if load_balance_mode = off in streaming replication mode, now all the user queries are sent to the primary server only. Per bug #189. - Change the PID length of pcp_proc_count command result to 6 characters long (Bo Peng) If the pgpool process ID are over 5 characters, the 6th character of each process ID will be removed. This commit changes the process ID length of pcp_proc_count command result to 6 characters long. Per bug #188. =============================================================================== 3.4.5 (tataraboshi) 2016/04/04 * Version 3.4.5 This is a bugfix release against pgpool-II 3.4.4. __________________________________________________________________ * Bug fixes - test: Fix test/regression/clean.sh to remove binary files of 010.rewrite_timestamp test (Yugo Nagata) - Fix memorry leak reported by Coverity (CID 1350095) (Yugo Nagata) - Fixing pgpool-recovery module compilation issue with PostgreSQL 9.6 (Muhammad Usama) Incorporating the change of function signature for GetConfigOption..() functions in PostgreSQL 9.6. - Fix a reset query stuck problem (Muhammad Usama) The solution is to report FRONTEND_ERROR instead of simple ERROR when pool_flush on front-end socket fails. The original report is [pgpool-general: 4265] Pgpool - connection hangs in DISCARD ALL The patch was generated by Usama and Pawel Ufnalewski, and Gerhard Wiesinger helped to verify and test the fix. - Fix typo in configure (Tatsuo Ishii) Patch provided by Thomas Munro. - doc: Change description of backend_flag (Tatsuo Ishii) It is pointed out that restarting pgpool-II is not necessary. Per [pgpool-general-jp: 1394]. - doc: Fix installation procedure. (Tatsuo Ishii) With PostgreSQL 9.4 or later, installing pgpool_regclass is not needed. - test: Fix pgpool_setup to not confuse log output (Tatsuo Ishii) Before it simply redirects stdout and stderr of pgpool processes to a log file. This could cause the log contents being garbled or even missed because of race condition caused by multiple process being writing concurrently. To fix this, pgpool_setup now generates startall script in which pgpool sends stdout/stderr to cat command by pipe, and cat writes to the log file. - Fix to validate the PCP packet length (Muhammad Usama) Without the validation check, a malformed PCP packet can crash the PCP child and/or can run the server out of memory by sending the packet with a very large data size. =============================================================================== 3.4.4 (tataraboshi) 2016/02/05 * Version 3.4.4 This is a bugfix release against pgpool-II 3.4.3. __________________________________________________________________ * Bug fixes - doc: Fix misinformation regarding load balancing in docs (Tatsuo Ishii) In streaming replication mode, DECLARE, FETCH, CLOSE and SHOW are sent to primary node only. Pointed out in [pgpool-general-jp: 1378]. - Issue fsync() when writing pgpool_status (Tatsuo Ishii) This ensures that pgpool_status is saved to permanent storage and allow to survive after system crash. - Fix reset query stuck problem (Muhammad Usama) It is reported that reset query (DISCARD ALL etc.) occasionally does not finish and pgpool child remain waiting for reply from the backend thus client cannot connect to pgpool (for example bug report #107). The cause of problem is not identified yet but if client suddenly closes connection to pgpool in the middle of query processing, backend may not accept the reset queries because they are not ready for query. The fix is to keep track of the status of frontend socket state and not caching the PostgreSQL connection if the connection to frontend was not properly terminated. - test: Fix false alerm of regression tset 062 (Yugo Nagata) - test: Fix broken regression test for native replication (Yugo Nagata) Test for insert lock didn't work. - test: Fix regress test to sleep after pgpool_reload (Yugo Nagata) Some regression tests modify configuration file and reloads. However, sometimes these were not applied to pgpool just after reloading. - Fix inconsistency of sequence values in replication mode (Yugo Nagata) When a schema name was provided, the table name was quoted wrongly as like "public.mytbl" instead of "public"."mytbl". So, pool_regclass and to_regclass couldn't find right talbe oid and insert lock was never executed. This caused inconsistency between DB nodes. - test: Fix complication error and segfault of timestamp rewrite test (Yugo Nagata) - test: Add timestamp-rewrite unit test to regression test suite (Yugo Nagata) - doc: Fix untranslated sentence in Japanese document (Yugo Nagata) - Fix ancient bug of pool_push() and friends (Tatsuo Ishii) It allocates buffer using realloc and uses the pointer returned. However it does the pointer calculation *before* realloc gets called. So the calculation uses the old pointer value, which causes various problems including segfault later. Also there were other problems with it. The buffer pointer and buffer size variable is not initialized. The buffer is not freed by pool_close. Typo in debugging message (3.4 or later only). They are fixed as well. - doc: Fix wrong description about log_standby_delay in the document (Yugo Nagata) - doc: Add caution about JDBC driver version regarding app_name_redirect_preference_list (Tatsuo Ishii) - Fix hang problem reported in bug#145 (Tatsuo Ishii) The problem occurs when all the condition below are met: 1) pgpool-II 3.4 or later 2) streaming replication mode 3) primary node is also load balance node 4) extended protocol is used 5) client_idle_limit reached - test: Fix regression test 065 (Tatsuo Ishii) The path to JDBC driver was explicitly defined. This is wrong. This should be inherited from JDBC_DRIVER environment variable. - test: Fix possible hang-up of regression test 054.postgres_fdw (Yugo Nagata) - test: Add option to regress.sh and pgpool_setup for unix domain socket directory (Yugo Nagata) - doc: Add missing descriptions about default values to documents (Yugo Nagata) - test: Fix a bug of regress.sh option handling (Yugo Nagata) - test: Fix regression test 055.backend_all_down to use PGSOCKET_DIR for PostgreSQL rhel7 rpm (Yugo Nagata) - Fix reset query stuck problem (Muhammad Usama) The issue is already fixed in older branches and this fix adopts the same solution used by 3.3 series, i.e. closing the backend connection when client idle limit is reached. - Fix bug with "SET TRANSACTION READ ONLY" (Tatsuo Ishii) Pgpool-II remembers that non read only queries (including SET) were executed in an explicit transaction and adds a "writing transaction" mark to the transaction. The mark affects the query routing behavior of pgpool-II while running in streaming replication mode. Pgpool-II starts sending queries to the primary after the mark is set. Because the effect of writing queries may appear on standbys after some delay in streaming replication mode, it is safer to route read queries to the primary after the mark is set. However there's oversight here. "SET TRANSACTION READ ONLY" does no data modification and should be treated as an exception. Per bug #157. - test: Fix to use timeout command to handle time out of regress test 062 (Yugo Nagata) - Fix to show wrong error (Tatsuo Ishii) connect_with_timeout() does not show proper error info when getsockopt(SO_ERROR) reports an error. Pointed out in bug #159. - test: Add missing \n in help messages (Yugo Nagata) - Fixing the logic issue in get_backends_status() function (Muhammad Usama) get_backends_status () function counts the number of current valid and down backend nodes. The function assumed that the node was also invalid when its connection status was down. However, that is not always right. - test: Fix regression test 003.failover for rhel7 postgresql rpm (Yugo Nagata) The expected result of 'show pool_nodes' is fixed to use PGSOCKET_DIR in hostname column. - Fix white/black_memqcache_table_list not require quotaion (Yugo Nagata) The tables and schemas name specified in *_memqcache_table_list were needed to be quoted by double quotation. Patch contributed by Dang Minh Huong. Per [pgpool-hackers: 1323] - Fix FATAL error with reloading (Tatsuo Ishii) While reloading pgpool.conf, the number of DB nodes is tentatively set to 0, then counted up until reaching to the actual number of backends by the pgpool main process. Unfortunately the variable was on the shared memory and it confused pgpool child process when they were using the variable and this caused FATAL error. Per bug #156 report by harukat. - test: Add some tests for white/black_memqcache_table_list to regression test 006.memqcache (Yugo Nagata) - Fix reset query stuck problem (Muhammad Usama, Tatsuo Ishii) When pool_read fails to read from frontend or pool_flush fails to write to the frontend, report FRONTEND_ERROR, rather than ERROR to disconnect and terminate pgpool child process, to prevent the query stuck problem. - test: Fix regression test 008 & 009 failure in debug mode (Yugo Nagata) - Fix performance degradation while using IPv6 (Muhammad Usama) Per bug #165. - Add some warning messages for wd_authkey hash calculation failure (Yugo Nagata) Sometimes wd_authkey calculation fails for some reason other than authkey mismatch. The additional messages make these distingushable for each other. - test: Fix regression test to check timeout of each test (Yugo Nagata) - test: Allow timeout value to be specified by the command option (Yugo Nagata) - Fix bugs with data modifying WITH clause. (Tatsuo Ishii) pgpool-II did not recognize the data modifying WITH clause despite pgpool-II 3.3 or after has SQL parser which recognizes it. The bug has been fixed in pgpool-II 3.5 (having PostgreSQL 9.5 parser), and the fix is back ported to pgpool-II 3.3 and 3.4. Per bug #153. - Fix segfalut that occurs when function is used in FROM clause (Yugo Nagata) PRPARE statements in streaming-reaplication mode and INSERT/UPDATE with SELECT in native-replication mode were affected. For example: - prepare p as select * from generate_series(1,1); - insert into tbl select now(), * from generate_series(1,1); - Fix broken arping_cmd configuration check(Muhammad Usama) wd_chk_setuid() function was bailing out with the NOTICE message as soon as it finds the setuid bit is not set on any configured network command and was ignoring the rest of configurations. Per bug #139. - doc: Add restriction about starting multiple pgpool simultaneously (Yugo Nagata) - Fix to use saved errno for erreport instead of the direct value (Yugo Nagata) Some system calls are called in errmsg() and errhint(), and it isn't safe to pass errno directly as an argument. This caused the confusable log message as below. DETAIL: connect() reports failure "Success" - Fix a in-memory query cache bug (Tatsuo Ishii) If extended query protocol is used and a bind/execute message arrives which uses a statement created by prior parse message, the temp_cache is not initialized by a parse messages. Thus messages are added to pre existing temp cache buffer which causes the trouble, that is, when the cached result returns, Data Row message and Command Complete message appeared twice. Per by bug #152. - Fix a compile issue on freebsd, added missing include files (Muhammad Usama) =============================================================================== 3.4.3 (tataraboshi) 2015/07/24 * Version 3.4.3 This is a bugfix release against pgpool-II 3.4.2. __________________________________________________________________ * Bug fixes - Fix "cannot find xlog functions" error in pgpool-recovery (Muhammad Usama) The argument data type of PostgreSQL's pg_xlogfile_name() function has been changed from text to pg_lsn since PostgreSQL 9.4. And pgpool-recovery was still trying to locate the function by old signature. - Fix problem with memory cache invalidation (Muhammad Usama) The internal buffer for storing the table oids needs to be homed in long living memory context as it has to survive throughout the child life. See [pgpool-general: 3643] for details. - Pass empty string parameters in failover command when pgpool-II does not have a value for any particular parameter (Muhammad Usama) Instead of omitting the values for the parameters when pgpool-II does not have any value for a particular parameter, it now passes an empty string to the failover command. This makes sure that failover script will always receive the exact number of expected parameters. - pgpool-II should use the local definition of snprintf functions only if they are not provided by OS (Muhammad Usama) - Add debug info to show how much shared memory is allocated (Tatsuo Ishii) - Downgrading the error level for EOF on backend connection for main process (Muhammad Usama) Throwing the FATAL error when EOF is encountered with backend is very harsh in pgpool main process and can cause undesirable behavior. Downgrading it to simple ERROR. - doc: Clarify load balancing condition (Tatsuo Ishii) - doc: Clarify description of pcp_promote_node (Tatsuo Ishii) It does not actually promote PostgreSQL standby. - doc: Fix outdated limitation description about load balancing using JDBC driver (Tatsuo Ishii) Even if autocommit is false, load balancing is possible in certain conditions. - Fix a misplaced code which makes a log code unreachable and rephrase the log message (Muhammad Usama) - Fix a problem in elog.c when forwarding a message to frontend clients (Muhammad Usama) Error while forwarding the message to the frontend client can potentially cause the infinite recursion and terminate the child with ERRORDATA_STACK_SIZE exceeded error. Fix is to check the recursion depth of send_message_to_frontend() function and pulling the plug if it is more than two levels deep. - Fix "select() system call interrupted" error (Tatsuo Ishii) The health check process complains above and then: ERROR: failed to make persistent db connection DETAIL: connection to host:"x.x.x.x:5432 failed However, the healthchek triggers neither fail over nor retrying. So, except the annoying messages above, everything goes well. This could occur more easily if 1) num_init_children is big and 2) pgpool children go into idle state (no query arrived from client for child_life_time seconds). Original bug report is [pgpool-general: 3756] Connection Interrupted. Patch created by Tatsuo Ishii. Enhancement from Usama. - Fix the case when user table includes spaces (Tatsuo Ishii) For example if table names including spaces are used, pgpool-II cannot be handled correctly by the internal functions which access system catalogs and it results in SQL errors. Solution is, to always use delimited identifier. Per bug #136. http://www.pgpool.net/mantisbt/view.php?id=136 Also see [pgpool-general: 3818]. - Allow to use in-memory query cache size more than 4GB (Tatsuo Ishii) This should have been allowed since in memory query cache was born. - Do not send a query for checking insert lock in non replication mode with extended query (Tatsuo Ishii) - Save pgpool_status to disk each time when it is changed (Tatsuo Ishii) Previously, pgpool-II saves pgpool_status file when pgpool-II explicitly is going shutdown. This is fine in most cases and it saves slight CPU cycles. But if pgpool-II killed abnormally or the system forces pgpool-II to go down by OOM killer, next pgpool-II restarting could load obsolete status file. =============================================================================== 3.4.3 (tataraboshi) 2015/07/24 * Version 3.4.3 This is a bugfix release against pgpool-II 3.4.2. __________________________________________________________________ * Bug fixes - Fix "cannot find xlog functions" error in pgpool-recovery (Muhammad Usama) The argument data type of PostgreSQL's pg_xlogfile_name() function has been changed from text to pg_lsn since PostgreSQL 9.4. And pgpool-recovery was still trying to locate the function by old signature. - Fix problem with memory cache invalidation (Muhammad Usama) The internal buffer for storing the table oids needs to be homed in long living memory context as it has to survive throughout the child life. See [pgpool-general: 3643] for details. - Pass empty string parameters in failover command when pgpool-II does not have a value for any particular parameter (Muhammad Usama) Instead of omitting the values for the parameters when pgpool-II does not have any value for a particular parameter, it now passes an empty string to the failover command. This makes sure that failover script will always receive the exact number of expected parameters. - pgpool-II should use the local definition of snprintf functions only if they are not provided by OS (Muhammad Usama) - Add debug info to show how much shared memory is allocated (Tatsuo Ishii) - Downgrading the error level for EOF on backend connection for main process (Muhammad Usama) Throwing the FATAL error when EOF is encountered with backend is very harsh in pgpool main process and can cause undesirable behavior. Downgrading it to simple ERROR. - doc: Clarify load balancing condition (Tatsuo Ishii) - doc: Clarify description of pcp_promote_node (Tatsuo Ishii) It does not actually promote PostgreSQL standby. - doc: Fix outdated limitation description about load balancing using JDBC driver (Tatsuo Ishii) Even if autocommit is false, load balancing is possible in certain conditions. - Fix a misplaced code which makes a log code unreachable and rephrase the log message (Muhammad Usama) - Fix a problem in elog.c when forwarding a message to frontend clients (Muhammad Usama) Error while forwarding the message to the frontend client can potentially cause the infinite recursion and terminate the child with ERRORDATA_STACK_SIZE exceeded error. Fix is to check the recursion depth of send_message_to_frontend() function and pulling the plug if it is more than two levels deep. - Fix "select() system call interrupted" error (Tatsuo Ishii) The health check process complains above and then: ERROR: failed to make persistent db connection DETAIL: connection to host:"x.x.x.x:5432 failed However, the healthchek triggers neither fail over nor retrying. So, except the annoying messages above, everything goes well. This could occur more easily if 1) num_init_children is big and 2) pgpool children go into idle state (no query arrived from client for child_life_time seconds). Original bug report is [pgpool-general: 3756] Connection Interrupted. Patch created by Tatsuo Ishii. Enhancement from Usama. - Fix the case when user table includes spaces (Tatsuo Ishii) For example if table names including spaces are used, pgpool-II cannot be handled correctly by the internal functions which access system catalogs and it results in SQL errors. Solution is, to always use delimited identifier. Per bug #136. http://www.pgpool.net/mantisbt/view.php?id=136 Also see [pgpool-general: 3818]. - Allow to use in-memory query cache size more than 4GB (Tatsuo Ishii) This should have been allowed since in memory query cache was born. - Do not send a query for checking insert lock in non replication mode with extended query (Tatsuo Ishii) - Save pgpool_status to disk each time when it is changed (Tatsuo Ishii) Previously, pgpool-II saves pgpool_status file when pgpool-II explicitly is going shutdown. This is fine in most cases and it saves slight CPU cycles. But if pgpool-II killed abnormally or the system forces pgpool-II to go down by OOM killer, next pgpool-II restarting could load obsolete status file. =============================================================================== 3.4.2 (tataraboshi) 2015/04/08 * Version 3.4.2 This is a bugfix release against pgpool-II 3.4.1. __________________________________________________________________ * Bug fixes - rpm: Fix %tmpfiles_create to not be executed in RHEL/CentOS 6 (Nozomi Anzai) - Fix to reset on_exit call back functions in exec_if_cmd and exec_ping worker processes (Muhammad Usama) exec_if and exec_ping child processes were inheriting the parent exit callback functions which could result in undesired behavior if one of these commands fails. Fixed by adding on_exit_reset() at child start-up in both processes. - Fix to use void * type for receiving return value of thread function (Yugo Nagata) Previously int type was used and this could occur stack buffer overflow. This caused an infinity loop of ping error at bringing up or down VIP. - Fix to set SIGCHLD to SIG_DFL instead of SIG_IGN in watchdog processes (Yugo Nagata) When using waitpid, it isn't necessary to set SIGCHLD to SIG_IGN. Rather, it is harmful, and due to this it was regarded that ping command exited abnormally in error even when this succeeded. - Fix to use waitpid instead of wait in exec_ifconifg (Yugo Nagata) - Remove an unnecessary include directive (Yugo Nagata) - Enlarge POOLCONFIG_MAXDESCLEN to 80 (Tatsuo Ishii) This is used in show pool_status command and limits the length of parameter description. Unfortunately recovery_timeout description is 64 chars, which is 1 byte longer than former definition of the macro. - doc: Update document of condition for load balancig (Yugo Nagata) Load balancing is possible in an explicit transaction block even in replication mode since 3.3.0. - Support SSL certificate chains in the certificate file for incoming frontend connections (Muhammad Usama) - Use to_regclass if available in time stamp rewriting in replication mode (Tatsuo Ishii) - Fix to not emits a fatal error message when clear text password auth is used (Muhammad Usama) The problem was introduced in pgpool-II after inclusion of exception manager. EOF on the frontend connection during client authentication should not be treated as an error when the password authentication method is used. psql disconnects from the server in such case to get the password from the terminal, reconnects and sends the read password to server. - previous session for the same child had exited because of some ERROR. (Muhammad Usama) - Fix a hang when an error occurs in a transaction block with replication mode (Yugo Nagata) When an error occurs at a backend node in a transaction block with replication mode, pgpool-II sends an invalid query to other backends to sync transaction states. However, previously, this was not sent to master node, and pgpool-II was waiting for master's response forever. - Fix a problem with pcp_detach_node about graceful node detach (Muhammad Usama) When graceful node detach is requested gracefully, pcp_detach_node should check if it is allowed to process detach_node command on the particular node before blocking the incoming connections and closing the existing connections. - doc: Update table and flowchart of where a query should be sent to (Yugo Nagata) - rpm: pgpool.spec is required only in RHEL/CentOS 7 (Nozomi Anzai) - Fix a compilation issue about sighandler_t type on BSD variants (Muhammad Usama) =============================================================================== 3.4.1 (tataraboshi) 2015/02/05 * Version 3.4.1 This is a bugfix release against pgpool-II 3.4.0. __________________________________________________________________ * Bug fixes - RPM: Add to support for memcached. (Tatsuo Ishii) - Fix number of parameters of pgpool_recovery from 3 to 4. (Tatsuo Ishii) This really should be done before releasing 3.4.0. - test: Allow pgpool_setup to set configuration file directory by setting environment variable PGPOOLDIR (Tatsuo Ishii) - RPM: Rename RPM file (Yugo Nagata) Rename filename to include the RHEL version number like PostgreSQL's official RPM file. (e.g. pgpool-II-pg93-3.4.0-2pgdg.rhel6.x86_64.rpm) - Fix node id range check bug in trigger_failover_command(). (Tatsuo Ishii) The node id should be lower than NUM_BACKENDS. Probably harmless since callers never pass node ids greater or equal to NUM_BACKENDS. - Fix occasional stuck that occures when a NOTIFY message is sent from a backend. (Muhammad Usama) The issue happens in master slave mode with load balancing when the client is doing extended query messaging. per bug #116 http://www.pgpool.net/mantisbt/view.php?id=116 - test: Fix failover script of pgpool_setup to use absolute path to the database cluster (Tatsuo Ishii) - test: Reorganize port numbers assigned in pgpool_setup (Tatsuo Ishii) Assign base port (11000 by default) to pgpool, base port + 1 to pcp, port + 2 to PostgreSQL node0, port + 3 to PostgreSQL node1 and so on. - Fix a bug that pgpool-II 3.4 can't cancel query (Muhammad Usama) - test: Add regression test for cancelling query (Muhammad Usama) - Fix to not use non-thread-safe APIs in thread functions (Muhammad Usama) pgpool-II has borrowed the Memory and Exception managers from PostgreSQL which never utilizes the threads so its APIs are not thread safe. Previously, those API functions which manipulate the global variables in thread functions, and it caused to undefined behavior or a segmentation fault. Especially, the main process could die silently. - test: Add memory leak regression test (Tatsuo Ishii) - Fix a memory leak with long-lived connections (Muhammad Usama) Problem reporeted in [pgpool-general: 3325]. - Change the log level of "Frontend Terminated" message to DEBUG1 from LOG (Muhammad Usama) - Fix ill signal befavior of SIGCHLD in exec_ifconfig() (Tatsuo Ishii) For some reason SIGCHLD was set to SIG_IGN *and* tries to wait child process which always fails because SIGCHLD is never delivered. Due to this "ifconfig up" fails when switching to watchdog master. See "[pgpool-general: 3310] for more details. - Allow $_IP_$ having address prefix in if_up_cmd and if_down_cmd (Muhammad Usama) Previously, it is assumed that "$_IP_$" keyword will always have a white space at the end, and when "$_IP_$" has address prefix (e.g. $_IP_$/24), this prefix was ignored. Per bug #122. http://www.pgpool.net/mantisbt/view.php?id=122 - Fix to not send signal to init process (Muhammad Usama) This is more of a guard against a situation where a crash of the pgpool main process can make the child processes to send the signal to system's init process. Per bug #119. http://www.pgpool.net/mantisbt/view.php?id=119 - RPM: Fix "error: Installed (but unpackaged) file(s) found" while creating RPMs for PostgreSQL 9.4 (Tatsuo Ishii) - Allow "show pool_nodes" to print node ids having more than one digits (Muhammad Usama) Problem reported in [pgpool-general: 3374]. - Prevent "WARNING: failed to execute regex matching, pattern is NULL" message that could happen when application name is not set in the old clients (Tatsuo Ishii) - Fix pgpool main process to shutdown in case of child process start-up failures (Muhammad Usama) Problem rported in [pgpool-general: 3358]. - Fix a segmentation fault that could happen in child process error (Muhammad Usama) Problem reported in [pgpool-general: 3377]. - Fix occasional failure in regression test '004.watchdog' (Yugo Nagata) The patch provided by uehara in bug #127. http://www.pgpool.net/mantisbt/view.php?id=127 - Fix client connection leak (Tatsuo Ishii) Since 3.4.0 pgpool-II child does not close the connection to client when it ends the session. This leads to serious "CLOSE_WAIT" flood, which makes pgpool-II unusable since no new connection from clients accepted. Problem reported by Pablo Sanchez in [pgpool-general: 3394]. - Restore SIGCHLD handler to its original after executing if_up/down_cmd (Yugo Nagata) Previously SIGCHLD was set to SIGIGN always after if_up/down_cmd. This led to a incorrect error handling of ping or other commands execution, and warning messages were output to log even when the command exited successfully. - RPM: Add pgpool.service for systemd in RHEL/CentOS 7 (Nozomi Anzai) - Fix process termination after several reload with enabled_pool_hba (Muhammad Usama) - Tighten up checking for app_name_redirect_preference_list and database_redirect_preference_list (Tatsuo Ishii) Before empty application name or database name or invalid DB node number were silently accepted. Now they are strictly checked and let raise fatal error when starting up. Problem reported in [pgpool-general-jp: 1337]. - RPM: Change to use systemd if it is available (Nozomi Anzai) - Fix the behavior of "client_min_messages" configuration parameter (Muhammad Usama) This parameter controls the minimum message levels to be sent to the frontend. Previously, regardless of the value of the parameter all the messages with severity less than NOTICE level were not being forwarded to the client. =============================================================================== 3.4.0 (tataraboshi) 2014/11/07 * Version 3.4.0 This is the first version of pgpool-II 3.4 series. That is, a "major version up" from 3.3 series. __________________________________________________________________ * Incompatible changes - Parallel query mode is obsoleted and is removed from pgpool.conf. This is due to the very few users using the mode (and the relatively high cost to maintain it). Actual codes for the mode are still there and users can use the mode if they specify necessary parameters in pgpool.conf. Note, however, the next version of pgpool-II (will be 3.5.0) will actually remove the code. - "print_timestamp" parameter is removed. Instead new "log_line_prefix" should be used. - Recovery script now accepts 4 parameters, rather than 3 (the 4th parameter is the port number of master PostgreSQL). Existing 3-parameter-style recovery scripts can be used if you don't care about information provided by the 4th parameter. __________________________________________________________________ * New features - Allow fine control of load balancing by using application name or database name. For example, if a client has particular application name, read queries can be redirect to master node, rather than to one of slave nodes (Tatsuo Ishii) - Allow to print pgpool-II process names in the log output. New parameter "log_line_prefix", which is the printf-style string that is output at the beginning of each log line (Muhammad Usama) - Allow to control log verbosity like PostgreSQL. For this purpose new parameters "log_error_verbosity", "client_min_messages", "log_min_messages" are added (Muhammad Usama) - Allow to use SQL comments without disturbing load balancing if new parameter "allow_sql_comments" is on. If it's off, previous behavior is kept (Tatsuo Ishii) - Allow to skip unlogged tables checking by using new parameter "check_unlogged_table". This reduces the number of pgpool-II's internal catalog look up queries and enhances performance (Tatsuo Ishii) - Prevent listen backlog overflow by using new parameter "listen_backlog_multiplier" for very busy systems (Tatsuo Ishii) - Prevent connection timeout to backend by using new parameter "connect_timeout". This is useful in unstable networks (Tatsuo Ishii) __________________________________________________________________ * Enhancements - Builtin SQL parser is now compatible with PostgreSQL 9.4 (Muhammad Usama) - Import PostgreSQL's memory manager and exception manager (Muhammad Usama) - Reorganize source code tree (Muhammad Usama) - The status file "pgpool_status" is now a plain ASCII file. This allows to register down PostgreSQL nodes before pgpool-II starts for example (Tatsuo Ishii) - Allow to use IPv6 address for PostgreSQ (Michael Stapelberg) - Allow to use IPv6 bind address for pgpool-II (Michael Stapelberg) - Rename all occurrence of "on memory query cache" to "in memory query cache" because latter is more correct in English (Tatsuo Ishii) - Add 4th paramter "master node port number" to recovery script (Tatsuo Ishii) - Allow to handle more than 3 database nodes in pgpool_setup (Tatsuo Ishii) __________________________________________________________________ * Bug fixes (since 3.3.4) - Fix failover deadlock problem in watchdog (Muhammad Usama). See bug #105 and [pgpool-committers: 2195] for more details. - As per the PostgreSQL specification, calling close on non existing portals is not an error. So on the same footings this commit ignores all such packets and return the 'close complete' message to client with out going to backend (Muhammad Usama) - Fix many issues/bugs found by Coverity (Muhammad Usama, Tatsuo Ishii) =============================================================================== 3.3 Series (2013/07/30 - ) =============================================================================== 3.3.12 (tokakiboshi) 2016/08/31 * Version 3.3.12 This is a bugfix release against pgpool-II 3.3.11. __________________________________________________________________ * Bug fixes - Fix buffer over run problem in "show pool_nodes". (Tatsuo Ishii) While processing "show pool_nodes", the buffer for hostname was too short. It should be same size as the buffer used for pgpool.conf. Problem reported by a twitter user who is using pgpool on AWS (which could have very long hostname). - Fix usage of wait(2) in pgpool main process. (Tatsuo Ishii) The usage of wait(2) in pgpool main could cause infinite wait in the system call. Solution is, to use waitpid(2) instead of wait(2). - Fix "kind mismatch" error message in pgpool. (Muhammad Usama) Many of "kind mismatch..." errors are caused by notice/warning messages produced by one or more of the DB nodes. In this case now Pgpool-II forwards the messages to frontend, rather than throwing the "kind mismatch..." error. This would reduce the chance of "kind mismatch..." errors. See [pgpool-hackers: 1501] for more details. - Replace "MAJOR" macro to prevent occasional failure. (Tatsuo Ishii) The macro calls pool_virtual_master_db_node_id() and then access backend->slots[id]->con using the node id returned. In rare cases, it could point to 0 (in case when the DB node is not connected), which gives access to con->major, then it causes a segfault. See bug 225 for related info. - doc : Fixing a typo in english doc (Muhammad Usama) - doc : fix Japanese document typo. (Bo Peng) - Fixing a typo in the log message. (Muhammad Usama) - doc : Add comment to the document about connection_cache. (Tatsuo Ishii) =============================================================================== 3.3.11 (tokakiboshi) 2016/06/17 * Version 3.3.11 This is a bugfix release against pgpool-II 3.3.10. __________________________________________________________________ * New features - Allow to access to pgpool while doing health checking (Tatsuo Ishii) Currently any attempt to connect to pgpool fails if pgpool is doing health check against failed node even if fail_over_on_backend_error is off because pgpool child first tries to connect to all backend including the failed one and exits if it fails to connect to a backend (of course it fails). This is a temporary situation and will be resolved before pgpool executes failover. However if the health check is retrying, the temporary situation keeps longer depending on the setting of health_check_max_retries and health_check_retry_delay. This is not good. Attached patch tries to mitigate the problem: - When an attempt to connect to backend fails, give up connecting to the failed node and skip to other node, rather than exiting the process if operating in streaming replication mode and the node is not primary node. - Mark the local status of the failed node to "down". - This will let the primary node be selected as a load balance node and every queries will be sent to the primary node. If there's other healthy standby nodes, one of them will be chosen as the load balance node. - After the session is over, the child process will suicide to not retain the local status. Per [pgpool-hackers: 1531]. * Bug fixes - Fix is_set_transaction_serializable() when SET default_transaction_isolation TO 'serializable'. (Bo Peng) SET default_transaction_isolation TO 'serializable' is sent to not only primary but also to standby server in streaming replication mode, and this causes an error. Fix is, in streaming replication mode, SET default_transaction_isolation TO 'serializable' is sent only to the primary server. See bug 191 for related info. - Fix Chinese documetation bug about raw mode (Yugo Nagata, Bo Peng) Connection pool is avalilable in raw mode. - Fix confusing comments in pgpool.conf (Tatsuo Ishii) - Permit pgpool to support multiple SSL cipher protocols (Muhammad Usama) Currently TLSv1_method() is used to initialize the SSL context, that puts an unnecessary limitation to allow only TLSv1 protocol for SSL communication. While postgreSQL supports other ciphers protocols as well. The commit changes the above and initializes the SSLSession using the SSLv23_method() (same is also used by PostgreSQL). Because it can negotiate the use of the highest mutually supported protocol version and remove the limitation of one specific protocol version. - If statement timeout is enabled on backend and do_query() sends a (Tatsuo Ishii) query to primary node, and all of following user queries are sent to standby, it is possible that the next command, for example END, could cause a statement timeout error on the primary, and a kind mismatch error on pgpool-II is raised. This fix tries to mitigate the problem by sending sync message instead of flush message in do_query(), expecting that the sync message reset the statement timeout timer if we are in an explicit transaction. We cannot use this technique for implicit transaction case, because the sync message removes the unnamed portal if there's any. Plus, pg_stat_statement will no longer show the query issued by do_query() as "running". See bug 194 for related info. - Deal with the case when the primary is not node 0 in streaming replication mode. (Tatsuo Ishii) http://www.pgpool.net/mantisbt/view.php?id=194#c837 reported that if primary is not node 0, then statement timeout could occur even after bug194-3.3.diff was applied. After some investigation, it appeared that MASTER macro could return other than primary or load balance node, which was not supposed to happen, thus do_query() sends queries to wrong node (this is not clear from the report but I confirmed it in my investigation). pool_virtual_master_db_node_id(), which is called in MASTER macro returns query_context->virtual_master_node_id if query context exists. This could return wrong node if the variable has not been set yet. To fix this, the function is modified: if the variable is not either load balance node or primary node, the primary node id is returned. - change the Makefile under the directory src/sql/, that is proposed (Bo Peng) by [pgpool-hackers: 1611] - Fix a posible hang during health checking (Yugo Nagata) Helath checking was hang when any data wasn't sent from backend after connect(2) succeeded. To fix this, pool_check_fd() returns 1 when select(2) exits with EINTR due to SIGALRM while health checkking is performed. Reported and patch provided by harukat and some modification by Yugo. Per bug #204. backported from 3.4 or later; https://git.postgresql.org/gitweb/?p=pgpool2.git;a=commitdiff;h=ed9f2900f1b611f5cfd52e8f758c3616861e60c0 - Fix bug with load balance node id info on shmem (Tatsuo Ishii) There are few places where the load balance node was mistakenly put on wrong place. It should be placed on: ConnectionInfo *con_info[child id, connection pool_id, backend id].load_balancing_node]. In fact it was placed on: *con_info[child id, connection pool_id, 0].load_balancing_node]. As long as the backend id in question is 0, it is ok. However while testing pgpool-II 3.6's enhancement regarding failover, if primary node is 1 (which is the load balance node) and standby is 0, a client connecting to node 1 is disconnected when failover happens on node 0. This is unexpected and the bug was revealed. It seems the bug was there since long time ago but it had not found until today by the reason above. =============================================================================== 3.3.10 (tokakiboshi) 2016/04/26 * Version 3.3.10 This is a bugfix release against pgpool-II 3.3.9. __________________________________________________________________ * Bug fixes - Removing the limit on the maximum number of items in the black_function_list and white_function_list lists. (Muhammad Usama) extract_string_tokens in pool_config uses the fixed size malloc on the array to hold the black_function_list/white_function_list items. This imposes a limit of maximum items in these lists. The fix is to use realloc to increase the array size when it gets full. - Redirect all user queries to primary server (Tatsuo Ishii) Up to now some user queries are sent to other than the primary server even if load_balance_mode = off. This commit changes the behavior: if load_balance_mode = off in streaming replication mode, now all the user queries are sent to the primary server only. Per bug #189. - Change the PID length of pcp_proc_count command result to 6 characters long (Bo Peng) If the pgpool process ID are over 5 characters, the 6th character of each process ID will be removed. This commit changes the process ID length of pcp_proc_count command result to 6 characters long. Per bug #188. =============================================================================== 3.3.9 (tokakiboshi) 2016/04/04 * Version 3.3.9 This is a bugfix release against pgpool-II 3.3.8. __________________________________________________________________ * Bug fixes - test: Fix test/regression/clean.sh to remove binary files of 010.rewrite_timestamp test (Yugo Nagata) - Fix memorry leak reported by Coverity (CID 1350095) (Yugo Nagata) - Fixing pgpool-recovery module compilation issue with PostgreSQL 9.6 (Muhammad Usama) Incorporating the change of function signature for GetConfigOption..() functions in PostgreSQL 9.6. - Fix typo in configure (Tatsuo Ishii) Patch provided by Thomas Munro. - doc: Change description of backend_flag (Tatsuo Ishii) It is pointed out that restarting pgpool-II is not necessary. Per [pgpool-general-jp: 1394]. - doc: Fix installation procedure. (Tatsuo Ishii) With PostgreSQL 9.4 or later, installing pgpool_regclass is not needed. - test: Fix pgpool_setup to not confuse log output (Tatsuo Ishii) Before it simply redirects stdout and stderr of pgpool processes to a log file. This could cause the log contents being garbled or even missed because of race condition caused by multiple process being writing concurrently. To fix this, pgpool_setup now generates startall script in which pgpool sends stdout/stderr to cat command by pipe, and cat writes to the log file. - Fix to validate the PCP packet length (Muhammad Usama) Without the validation check, a malformed PCP packet can crash the PCP child and/or can run the server out of memory by sending the packet with a very large data size. - Fix a reset query stuck problem (Muhammad Usama) The solution is to return POOL_END_WITH_FRONTEND_ERROR instead of POOL_END when pool_flush on front-end socket fails. The original report is [pgpool-general: 4265] Pgpool - connection hangs in DISCARD ALL =============================================================================== 3.3.8 (tokakiboshi) 2016/02/05 * Version 3.3.8 This is a bugfix release against pgpool-II 3.3.7. __________________________________________________________________ * Bug fixes - doc: Fix misinformation regarding load balancing in docs (Tatsuo Ishii) In streaming replication mode, DECLARE, FETCH, CLOSE and SHOW are sent to primary node only. Pointed out in [pgpool-general-jp: 1378]. - Issue fsync() when writing pgpool_status (Tatsuo Ishii) This ensures that pgpool_status is saved to permanent storage and allow to survive after system crash. - test: Fix false alerm of regression tset 062 (Yugo Nagata) - test: Fix broken regression test for native replication (Yugo Nagata) Test for insert lock didn't work. - test: Fix regress test to sleep after pgpool_reload (Yugo Nagata) Some regression tests modify configuration file and reloads. However, sometimes these were not applied to pgpool just after reloading. - Fix inconsistency of sequence values in replication mode (Yugo Nagata) When a schema name was provided, the table name was quoted wrongly as like "public.mytbl" instead of "public"."mytbl". So, pool_regclass and to_regclass couldn't find right talbe oid and insert lock was never executed. This caused inconsistency between DB nodes. - test: Fix complication error and segfault of timestamp rewrite test (Yugo Nagata) - test: Add timestamp-rewrite unit test to regression test suite (Yugo Nagata) - Fix ancient bug of pool_push() and friends (Tatsuo Ishii) It allocates buffer using realloc and uses the pointer returned. However it does the pointer calculation *before* realloc gets called. So the calculation uses the old pointer value, which causes various problems including segfault later. Also there were other problems with it. The buffer pointer and buffer size variable is not initialized. The buffer is not freed by pool_close. Typo in debugging message (3.4 or later only). They are fixed as well. - doc: Fix wrong description about log_standby_delay in the document (Yugo Nagata) - test: Fix regression test 065 (Tatsuo Ishii) The path to JDBC driver was explicitly defined. This is wrong. This should be inherited from JDBC_DRIVER environment variable. - test: Add option to regress.sh and pgpool_setup for unix domain socket directory (Yugo Nagata) - doc: Add missing descriptions about default values to documents (Yugo Nagata) - test: Fix a bug of regress.sh option handling (Yugo Nagata) - test: Fix regression test 055.backend_all_down to use PGSOCKET_DIR for PostgreSQL rhel7 rpm (Yugo Nagata) - Fix bug with "SET TRANSACTION READ ONLY" (Tatsuo Ishii) Pgpool-II remembers that non read only queries (including SET) were executed in an explicit transaction and adds a "writing transaction" mark to the transaction. The mark affects the query routing behavior of pgpool-II while running in streaming replication mode. Pgpool-II starts sending queries to the primary after the mark is set. Because the effect of writing queries may appear on standbys after some delay in streaming replication mode, it is safer to route read queries to the primary after the mark is set. However there's oversight here. "SET TRANSACTION READ ONLY" does no data modification and should be treated as an exception. Per bug #157. - test: Fix to use timeout command to handle time out of regress test 062 (Yugo Nagata) - test: Add missing \n in help messages (Yugo Nagata) - test: Fix regression test 003.failover for rhel7 postgresql rpm (Yugo Nagata) The expected result of 'show pool_nodes' is fixed to use PGSOCKET_DIR in hostname column. - Fix white/black_memqcache_table_list not require quotaion (Yugo Nagata) The tables and schemas name specified in *_memqcache_table_list were needed to be quoted by double quotation. Patch contributed by Dang Minh Huong. Per [pgpool-hackers: 1323] - Fix FATAL error with reloading (Tatsuo Ishii) While reloading pgpool.conf, the number of DB nodes is tentatively set to 0, then counted up until reaching to the actual number of backends by the pgpool main process. Unfortunately the variable was on the shared memory and it confused pgpool child process when they were using the variable and this caused FATAL error. Per bug #156 report by harukat. - test: Add some tests for white/black_memqcache_table_list to regression test 006.memqcache (Yugo Nagata) - Add some warning messages for wd_authkey hash calculation failure (Yugo Nagata) Sometimes wd_authkey calculation fails for some reason other than authkey mismatch. The additional messages make these distingushable for each other. - test: Fix regression test to check timeout of each test (Yugo Nagata) - test: Allow timeout value to be specified by the command option (Yugo Nagata) - Fix bugs with data modifying WITH clause. (Tatsuo Ishii) pgpool-II did not recognize the data modifying WITH clause despite pgpool-II 3.3 or after has SQL parser which recognizes it. The bug has been fixed in pgpool-II 3.5 (having PostgreSQL 9.5 parser), and the fix is back ported to pgpool-II 3.3 and 3.4. Per bug #153. - Fix broken arping_cmd configuration check(Muhammad Usama) wd_chk_setuid() function was bailing out with the NOTICE message as soon as it finds the setuid bit is not set on any configured network command and was ignoring the rest of configurations. Per bug #139. - doc: Add restriction about starting multiple pgpool simultaneously (Yugo Nagata) - Fix a in-memory query cache bug (Tatsuo Ishii) If extended query protocol is used and a bind/execute message arrives which uses a statement created by prior parse message, the temp_cache is not initialized by a parse messages. Thus messages are added to pre existing temp cache buffer which causes the trouble, that is, when the cached result returns, Data Row message and Command Complete message appeared twice. Per by bug #152. - Ignore close statement/portal request if they do not exist (Tatsuo Ishii) In this case just returns a close complete message to client. This is a back port of the following commit from pgpool-II 3.4: 1a37e1c35bd8b6f10f524693bbcb7b51f73b4bf0 - test: Fix port numbers in expected result of show pool_nodes (Yugo Nagata) =============================================================================== 3.3.7 (tokakiboshi) 2015/07/24 * Version 3.3.7 This is a bugfix release against pgpool-II 3.3.6. __________________________________________________________________ * Bug fixes - Fix "cannot find xlog functions" error in pgpool-recovery (Muhammad Usama) The argument data type of PostgreSQL's pg_xlogfile_name() function has been changed from text to pg_lsn since PostgreSQL 9.4. And pgpool-recovery was still trying to locate the function by old signature. - Pass empty string parameters in failover command when pgpool-II does not have a value for any particular parameter (Muhammad Usama) Instead of omitting the values for the parameters when pgpool-II does not have any value for a particular parameter, it now passes an empty string to the failover command. This makes sure that failover script will always receive the exact number of expected parameters. - doc: Clarify load balancing condition (Tatsuo Ishii) - doc: Clarify description of pcp_promote_node (Tatsuo Ishii) It does not actually promote PostgreSQL standby. - doc: Fix outdated limitation description about load balancing using JDBC driver (Tatsuo Ishii) Even if autocommit is false, load balancing is possible in certain conditions. - Fix "select() system call interrupted" error (Tatsuo Ishii) The health check process complains above and then: ERROR: failed to make persistent db connection DETAIL: connection to host:"x.x.x.x:5432 failed However, the healthchek triggers neither fail over nor retrying. So, except the annoying messages above, everything goes well. This could occur more easily if 1) num_init_children is big and 2) pgpool children go into idle state (no query arrived from client for child_life_time seconds). Original bug report is [pgpool-general: 3756] Connection Interrupted. Patch created by Tatsuo Ishii. Enhancement from Usama. - Fix the case when user table includes spaces (Tatsuo Ishii) For example if table names including spaces are used, pgpool-II cannot be handled correctly by the internal functions which access system catalogs and it results in SQL errors. Solution is, to always use delimited identifier. Per bug #136. http://www.pgpool.net/mantisbt/view.php?id=136 Also see [pgpool-general: 3818]. - Allow to use in-memory query cache size more than 4GB (Tatsuo Ishii) This should have been allowed since in memory query cache was born. - Do not send a query for checking insert lock in non replication mode with extended query (Tatsuo Ishii) =============================================================================== 3.3.6 (tokakiboshi) 2015/04/08 * Version 3.3.6 This is a bugfix release against pgpool-II 3.3.5. __________________________________________________________________ * Bug fixes - rpm: Fix %tmpfiles_create to not be executed in RHEL/CentOS 6 (Nozomi Anzai) - Fix to use void * type for receiving return value of thread function (Yugo Nagata) Previously int type was used and this could occur stack buffer overflow. This caused an infinity loop of ping error at bringing up or down VIP. - Fix to set SIGCHLD to SIG_DFL instead of SIG_IGN in watchdog processes (Yugo Nagata) When using waitpid, it isn't necessary to set SIGCHLD to SIG_IGN. Rather, it is harmful, and due to this it was regarded that ping command exited abnormally in error even when this succeeded. - Remove an unnecessary include directive (Yugo Nagata) - Enlarge POOLCONFIG_MAXDESCLEN to 80 (Tatsuo Ishii) This is used in show pool_status command and limits the length of parameter description. Unfortunately recovery_timeout description is 64 chars, which is 1 byte longer than former definition of the macro. - doc: Update document of condition for load balancig (Yugo Nagata) Load balancing is possible in an explicit transaction block even in replication mode since 3.3.0. - Support SSL certificate chains in the certificate file for incoming frontend connections (Muhammad Usama) - Use to_regclass if available in time stamp rewriting in replication mode (Tatsuo Ishii) - Fix a hang when an error occurs in a transaction block with replication mode (Yugo Nagata) When an error occurs at a backend node in a transaction block with replication mode, pgpool-II sends an invalid query to other backends to sync transaction states. However, previously, this was not sent to master node, and pgpool-II was waiting for master's response forever. - Fix a problem with pcp_detach_node about graceful node detach (Muhammad Usama) When graceful node detach is requested gracefully, pcp_detach_node should check if it is allowed to process detach_node command on the particular node before blocking the incoming connections and closing the existing connections. - doc: Update table and flowchart of where a query should be sent to (Yugo Nagata) - rpm: pgpool.service is required only in RHEL/CentOS 7 (Nozomi Anzai) =============================================================================== 3.3.5 (tokakiboshi) 2015/02/05 * Version 3.3.5 This is a bugfix release against pgpool-II 3.3.4. __________________________________________________________________ * Bug fixes - doc: Describe explicitly that the number of slave nodes is not necessarily 1 (Tatsuo Ishii) - Fix occasinal deadlock in failover with watchdog enabled (Muhammad Usama) per bug #105 http://www.pgpool.net/mantisbt/view.php?id=105 - Fix uninitialized variable (Tatsuo Ishii) Per Coverity 1234603. - doc: Fix missing release note entries in the previous release (Tatsuo Ishii) - test: Fix wait_for_pgpool_startup in pgpool_setup to use "postgres" database rather than "test" (Tatsuo Ishii) The test database may or may not exist and if it does not, it will always retry until timeout expired (20 seconds), and regression test takes unnecessary long. - Fix possible segmentation fault in query cache (Tatsuo Ishii) - RPM: Add to support for memcached. (Tatsuo Ishii) - test: Allow pgpool_setup to set configuration file directory by setting environment variable PGPOOLDIR (Tatsuo Ishii) - RPM: Rename RPM file (Yugo Nagata) Rename filename to include the RHEL version number like PostgreSQL's official RPM file. (e.g. pgpool-II-pg93-3.4.0-2pgdg.rhel6.x86_64.rpm) - Fix node id range check bug in trigger_failover_command(). (Tatsuo Ishii) The node id should be lower than NUM_BACKENDS. Probably harmless since callers never pass node ids greater or equal to NUM_BACKENDS. - test: Fix failover script of pgpool_setup to use absolute path to the database cluster (Tatsuo Ishii) - test: Add memory leak regression test (Tatsuo Ishii) - Fix ill signal befavior of SIGCHLD in exec_ifconfig() (Tatsuo Ishii) For some reason SIGCHLD was set to SIG_IGN *and* tries to wait child process which always fails because SIGCHLD is never delivered. Due to this "ifconfig up" fails when switching to watchdog master. See "[pgpool-general: 3310] for more details. - Allow $_IP_$ having address prefix in if_up_cmd and if_down_cmd (Muhammad Usama) Previously, it is assumed that "$_IP_$" keyword will always have a white space at the end, and when "$_IP_$" has address prefix (e.g. $_IP_$/24), this prefix was ignored. Per bug #122. http://www.pgpool.net/mantisbt/view.php?id=122 - Allow "show pool_nodes" to print node ids having more than one digits (Muhammad Usama) Problem reported in [pgpool-general: 3374]. - Fix occasional failure in regression test '004.watchdog' (Yugo Nagata) The patch provided by uehara in bug #127. http://www.pgpool.net/mantisbt/view.php?id=127 - Restore SIGCHLD handler to its original after executing if_up/down_cmd (Yugo Nagata) Previously SIGCHLD was set to SIGIGN always after if_up/down_cmd. This led to a incorrect error handling of ping or other commands execution, and warning messages were output to log even when the command exited successfully. - RPM: Add pgpool.service for systemd in RHEL/CentOS 7 (Nozomi Anzai) - RPM: Split pgpool_regclass and pgpool_recovery as a separate extension package (Tatsuo Ishii) On PostgreSQL server, only the extension package is required, no pgpool full package is necessary. Per Andrew N Golovkov. - RPM: Fix wrong SSL configure option in the RPM spec file (Tatsuo Ishii) SSL enabling option is "--with-openssl=/usr" and this is wrong. This should be "--with-openssl". Per bug #115. http://www.pgpool.net/mantisbt/view.php?id=115 - RPM: Change to use systemd if it is available and adopt to PostgreSQL 9.4 (Nozomi Anzai) - Fix to disable debug mode by reloading config (Yugo Nagata) Per bug #114 http://www.pgpool.net/mantisbt/view.php?id=114 =============================================================================== 3.3.4 (tokakiboshi) 2014/09/05 * Version 3.3.4 This is a bugfix release against pgpool-II 3.3.3. __________________________________________________________________ * Bug fixes - Fix a typo of pgpool.spec (Yugo Nagata) - Fix bug that worker child process keeps failing when there's no primary backend (Tatsuo Ishii) Problem identified and fix contributed by Junegunn Choi. See [pgpool-hackers: 471] for more details. - Close listen socket when smart shutdown request is made (Tatsuo Ishii) When smart shutdown process starts, pgpool children still listen on the port and clients can send further connection requests which fail in the end. Which is not only waste of time, but also prevents a load balancer which sits in front of pgpool from realizing the pgpool is going down. Problem analyzed and patch provided by Junegunn Choi in [pgpool-hackers 474], and enhanced to take care not only inet domain socket but UNIX domain socket by Tatsuo Ishii. - doc: Add cautions that recovery commands are killed by statement_timeout of PostgreSQL. (Tatsuo Ishii) - test: Fix bug that wait_for_pgpool_startup does not work. (Tatsuo Ishii) - test: Fix test driver for watchdog to use wait_for_pgpool_startup correctly (Tatsuo Ishii) - Fix to ignore a harmless error code when executing ifconfig command (Yugo Nagata) When executing command such as ifconfig or ping by execv() in a forked child proess, wait() can fails with an error code ECHILD, although the process exists exactly, if SIGCHLD is set to SIG_IGN in Linux. We should ignore this and not treat as failure of the command. - test: Add undocumented "-j" option to the script comment. (Tatsuo Ishii) - test: Fix unwanted JDBC regression test failure (Tatsuo Ishii) - test: Fix to prevent regression test failures on slow machines (Tatsuo Ishii) - test: Allow to specify PostgreSQL library directory by environment variable (Tatsuo Ishii) - Adopt PostgreSQL 9.4 having to_regclass (Tatsuo Ishii) PostgreSQL 9.4 has built-in function "to_regclass", which has equivalent functionality of pgpool_regclass. Now pgpool searches to_regclass first then try pgpool_regclass. - Fix unportable code related to SO_REUSEPORT (Tatsuo Ishii) There are several places using setsockopt(sock, SOL_SOCKET, SO_REUSEPORT...). SO_REUSEPORT is not available on all Linux kernels and the source code uses ifdef to detect the feature in the compile time. Problem is, the binary created with kernel which provides the feature cannot run on a kernel which does not provide the feature. Fix is, detecting the feature in the run time by checking error code returned by setsockopt() and ignore it if the cause of the error is lacking the feature. - doc: Remove old restriction description which is no longer true (Tatsuo Ishii) - Fix return type of text_to_lsn() function (Yugo Nagata) This caused compile warning. - Fix file descriptor leak when daemonize. (Tatsuo Ishii) Per Coverity 1111471. - Fix memory leak. (Tatsuo Ishii) Per Coverity 1111442. - Fix pgpool.init's long-standing bug of stop/restart failure (Yugo Nagata) In previous, pgpool.init uses killproc for stopping pgpool, but there are several problems. In the new version, "pgpool -m fast stop" is used in stop command. Original patch contributed by Ryan DeShone and modified by Yugo Nagata. See [pgpool-hackers: 239][pgpool-hackers: 512]. - Allow to run pgpool_setup and regression test on Ubuntu box (Tatsuo Ishii) - test: Fix -i option (install directory of pgpool) not working (Tatsuo Ishii) - Add missing include file sys/wait.h. (Tatsuo Ishii) Per bug #104. http://www.pgpool.net/mantisbt/view.php?id=104 - Fix an infinite loop of ping error at new active pgpool when virtual IP switching (Yugo Nagata) This bug also caused hangs of the old active pgpool, since this waits response from the new active pgpool, which is in the infinite loop and not able to respond. This problem is reported by Qian Peng in [pgpool-hackers: 520]. - Disbale statement_timeout of PostgreSQL while executing online recovery (Tatsuo Ishii) Online recovery may take very long time and user may enable statement timeout. To prevent online recovery canceled by statement timeout, disable statement timeout in the connection used by online recovery. See [pgpool-general: 2919] for more details. - Fix pool_table_name_to_oid in case new to_regclass used which is introduced in PostgreSQL 9.4 (Tatsuo Ishii) The relcache func used here should return 0 if target table is not found. However to_regclass returns NULL in this case. To fix the problem now COALESCE is used. - test: Fix regression test 057 hung if run against PostgreSQL 9.4 or later (Tatsuo Ishii) PostgreSQL 9.4 or later changed libpq behavior: NULL username for connection string does not cause an error, which was expected in the test. - Fix to close pipe when ping command exits with failure (Yugo Nagata) This bug causes pipe open error: Too many open files, which leads to failure of connecting to trusted servers, and then pgpool goes to down status. - Fix Resource leaks (Muhammad Usama) Coverity issue #1222998 and #1222999. - Add a description that pcp_detach_node command disconnects existing sessions (Tatsuo Ishii) - Fix failover.sh produced by pgpool_setup (Tatsuo Ishii) It did not support there's more than 2 nodes case. It always tries to promoto node0 or node1. - Remove meaningless minus check because of unsigned int variable (Tatsuo Ishii) Coverity issue #1111419, #1111420, #1111422. - replacing strcpy() with much safer and recomended call strlcpy() (Muhammad Usama) Coverity issue #1111480. - Fix pgpool.spec to support openssl (Tatsuo Ishii) - Fix pgpool.spec to use 3.3-stable tree head (Tatsuo Ishii) - Remove unnecessary call to pool_shmem_exit() which removes semaphore when it shouldn't (Tatsuo Ishii) exit_handler checks if the process is parent or not. This is good. However, even if it is a child process, it calls pool_shmem_exit() which removes semaphore and shmem when it should not. It should be called only from parent process. Per bug #102. http://www.pgpool.net/mantisbt/view.php?id=102 - Fix get_insert_command_table_name() function not to use freed pointer (Muhammad Usama) Coverity issue #1223007. - Fix pool_handle_query_cache() to not free NULL pointer (Tatsuo Ishii) - Change connect() timeout longer (10 seconds) for flaky network (Tatsuo Ishii) Change connect() timeout in connect_inet_domain_socket_by_port() from 1 second to 10 seconds for flaky network such as AWS. This should help reducing frequent failover. - Fix reset query stuck problem. (Tatsuo Ishii) It is reported that reset query (DISCARD ALL etc.) occasionally does not finish and pgpool child remain waiting for reply from backend thus client cannot connect to pgpool. The cause of problem is not identified yet but if client suddenly closes connection to pgpool in the middle of query processing, backend may not accept the reset queries because they are not ready for query. The fix is, if frontend closes connection in unexpected way, query process loop immediately returns with new state: POOL_END_WITH_FRONTEND_ERROR and pgpool closes connection to PostgreSQL then goes back to new connection request waiting loop. Also, pgpool closes connections to backend when client_idle_limit is set and the idle limit. Per bug #107. http://www.pgpool.net/mantisbt/view.php?id=107 - Fix other dozens of coverity issues (Muhammad Usama) =============================================================================== 3.3.3 (tokakiboshi) 2014/03/24 * Version 3.3.3 This is a bugfix release against pgpool-II 3.3.2. __________________________________________________________________ * Bug fixes - installer: Fix bug that install of pgpool-II RPM fails (Yugo Nagata) - installer: Fix to set up passwordless SSH from apache@localhost to postgres@localhost (Yugo Nagata) - Fix bug that restarted pgpool's watchdog status is regarded as down (Yugo Nagata) - doc: Add mention about "listen queue" and how to increase the "backlog" in the num_init_children section. (Tatsuo Ishii) - Fix bug that watchdog status goes down even when only one of trusted servers get unpingable (Yugo Nagata) - Fix bad performance of unlogged tables detection code. (Tatsuo Ishii) Pointed out at [pgpool-hackers: 435][[pgpool-general:2325]. - Fix primary node detection logic. (Tatsuo Ishii) There's a possibility that primary node is not detected. This happens in following situation. node 0: primary, node 1: standby. Node 0 goes down. Health checking detects the fact but local status is not updated yet. Primary node finding (find_primary_node) runs. Node 0's status is yet healthy. Because find_primary_node fails to connect to node 0, it immediately returns -1 and fails to find that fact that node 1 is now primary. Fix is just continuing to look for primary node when fails to connect to a node. Per [pgpool-general: 2409]. - Add raw mode support to pgpool_setup. (Tatsuo Ishii) - test: Integrate jdbc test to regression test. (Tatsuo Ishii) - Fix jdbc DML fails when operated in raw mode and auto commit is off. (Tatsuo Ishii) This is reported in bug #92. - Fix to output error message when wd_escalation_command fails with exit code other than 0 (Yugo Nagata) This is suggested by Sergey Arlashin in [pgpool-general: 2457]. - test: Add new regression test for query cache. (Tatsuo Ishii) - Fix query cache bug with extended protocol. (Tatsuo Ishii) SELECT retrieves outdated cache even DML was executed in an expilicit transaction. The bug had been there since in memory query cache was born. Per [pgpool-general-jp: 1252]. - Add missing entries "relcache_size" and "check_temp_table" to show pool_status (Tatsuo Ishii) - Fix to output error message when if_up_cmd fails. (Yugo Nagata) This is suggested by Sergey Arlashin in [pgpool-general: 2457]. - Avoid to send queries to unrelated nodes in streaming replication mode. (Tatsuo Ishii) Pgpool-II sends certain queries, such as BEGIN, END and SET commands to all of DB nodes. However in streaming replication mode, only primary node and at most one standby node are only concerned (if primacy node is selected as the load balance node, only 1 node is concerned). See [pgpool-hackers: 464] for more details. - Fix possible buffer overrun problem and memory leak. (Tatsuo Ishii) Per Coverity 1111465 and 1111482. - Fix possible buffer overrun. (Tatsuo Ishii) Replace strcpy() with strlcpy(). Per Coverity report 1111478, 1111480, 1111481. - Add dubug messages for analyzing errors in if_up_cmd (Yugo Nagata) - Fix freeing NULL. (Tatsuo Ishii) Per Coverity 1111384. - Do not enable query cache on materialized views. (Tatsuo Ishii) Per bug #95. - Fix memory leak. (Tatsuo Ishii) Per Coverity 1111446. - Fix a segmentation fault in parallel mode with system_db_hostname is empty (Yugo Nagata) - Fix to output debug messages in processing pgpool.conf with -d option (Yugo Nagata) Previously, some debug messages in pool_get_config() ware not output even when -d option was used. - Fix JDBC exception of prepared statement including now() in replication mode (Yugo Nagata) With JDBC, when a prepared statement is executed more than PrepareThreshold times, the statement is named and Describe message is sent after Parse. With named statement, pgpool rewrite now() to parameter in replication mode. Hence, rewritten query has additonal parameter than original. In this case, ParameterDescription message sent to frontend (response of Describe) should include OIDs of the same number os original query's parameters. Otherwize, JDBC throws ArrayIndexoutOfBoundsException. This is reported in [pgpool-general-jp: 1192]. - Fix backend error of prepared statement about table which has column whoes default value is now() in replication mode (Yugo Nagata) When pgpool parses a named prepared statement with default now(), timestamps are replaced to additional parameters. So, Bind message also should inclued additional parameter format codes. However, when the number of original parameter was one, pgpool didn't handle this. This caused a error like "incorrect binary data format in bind parameter 2". - test: Fix a bug of regression test of JDBC that shows OK even when this fails (Yugo Nagata) - test: Add a new regression test for JDBC's PrepareThreshold (Yugo Nagata) - doc: Add description about parallel mode doesn't support PREPARE (Yugo Nagata) Per bug #93 =============================================================================== 3.3.2 (tokakiboshi) 2013/11/29 * Version 3.3.2 This is a bugfix release against pgpool-II 3.3.1. __________________________________________________________________ * Bug fixes - Fix incorrect time stamp rewriting in replication mode for certain time zones. (Tatsuo Ishii) Time stamp rewriting calls "SELECT now()" to get current time. Unfortunately the buffer for the current time is too small for certain time zones such as "02:30". Note that non-30-minutes-time-zone such as "0900" does not reveal the problem. This explains why we haven't the bug report until today. Bug reported in [pgpool-general: 2113] and fix provided by Sean Hogan. http://www.sraoss.jp/pipermail/pgpool-general/2013-September/002142.html - installer: Fix the way to specify pgpoolAdmin version in redhat/rpm_installer/getsources.sh. (Yugo Nagata) - Makefile: Replace pg_config by $(PG_CONFIG) in Makefiles so it can be overridden at build time when compiling for different PG major versions. (Tatsuo Ishii) Patch contributed by Christoph Berg ([pgpool-general: 2127]). http://www.sraoss.jp/pipermail/pgpool-general/2013-September/002156.html - watchdog: Fix a warning/error when compiling with -Werror=format-security. (Tatsuo Ishii) Patch contributed by Christoph Berg ([pgpool-general: 2127]). http://www.sraoss.jp/pipermail/pgpool-general/2013-September/002156.html - configure: Remove -lcompat because it confuses FreeBSD per bug#15. (Tatsuo Ishii) http://www.pgpool.net/mantisbt/view.php?id=15 - Fix segfault when pgpool.conf does not set log_standby_delay. (Tatsuo Ishii) This is caused by wrong initialization for log_standby_delay in pool_config.l. Per bug#74. http://www.pgpool.net/mantisbt/view.php?id=74 - doc: Modify descriptions about restrictions of parallel mode Muliple rows INSERT using VALUES are not supported in parallel mode. (Yugo Nagata) - Avoid calling find_primary_node_repeatedly() when standby node goes down. (Tatsuo Ishii) This will reduce the time to failover. Per bug #75, patch modified by Tatsuo Ishii. http://www.pgpool.net/mantisbt/view.php?id=75 - Fix data inconsistency problem with native replication mode + extended protocol case. (Tatsuo Ishii) It is reported that concurrent INSERT using JDBC driver causes data difference among database node. This only happens following conditions are all met: 1) Native replication mode 2) Extended protocol used 3) The portal created by parse message is reused by bind message 4) autocommit is on 5) SERIAL (sequence) is used Pgpool-II's parse message function knows it has to lock the target table when INSERT (plus #5) is issued by clients. Unfortunately bind message function did not know it. Once parse/bind/execute finishes, pgpool releases the lock obtained by parse because of #4. JDBC wants to reuse the portal and starts the cycle from bind message, which does not obtain lock. As as result, lock-free INSERT are floating around which causes data inconsistency of course. The solution is, lock the table in bind phase. For this bind needs to issue LOCK in extended protocol. This was a little bit hard because the module (do_command()) to issue internal SQL command (other than SELECT) does not support extended protocol. To solve the problem do_query() is modified so that it accepts other than SELECT because it already accepts extended protocol. The modification is minimum and is only tested for the case called from insert_lock(). I do not recommend to replace every occurrence of do_command () with do_query() at this point. BTW the reason why the bug is not reported is, most users uses JDBC with auto commit = off. In this case, the lock obtained by parse persists until user explicitly issues commit or rollback. Per bug report by Steve Kuekes in [pgpool-general: 2142]. http://www.sraoss.jp/pipermail/pgpool-general/2013-September/002171.html - Fix memory allocation size bug in the code path of query cache. (Tatsuo Ishii) In execute() memory allocation size is too small incertain case. No bug has been reported so far, but certainly this is a bug. - Fix occasional segfault in query cache + extended protocol. (Tatsuo Ishii) When the query is not "cache safe", bind_msg->param_offset was not set in Bind(). However, Execute() unconditionally uses bind_msg->param_offset to convert bind parameters to string so that they can be added to the cached query string and it causes segfault because bind_msg->param_offset is a garbage. Also logic bug to calculate bind_msg->param_offset is corrected. Per bug#76. http://www.pgpool.net/mantisbt/view.php?id=76 - Avoid to run out free query cache hash index entry. (Tatsuo Ishii) If hash index entries are run out, pgpool-II cannot reuse old cache entry because pgpool-II always expects there's at least one empty hash index entry. To mitigate the problem, if free hash index entries are run out, look for victim cache block to reuse the hash index entry. Per bug #70. http://www.pgpool.net/mantisbt/view.php?id=70 - installer: checkEnv() didn't do anything and always returned 0. (Nozomi Anzai) - Fix inappropriate shared memory allocation size for clock hand. (Tatsuo Ishii) The memory for clock hand was allocated as sizeof(pool_fsmm_clock_hand)) which is 8 bytes long because the variable is declared as: static int *pool_fsmm_clock_hand; This is plain wrong. The memory size actually needed is only 4 bytes, which is sizeof(*pool_fsmm_clock_hand)). In other word, the bug allocated unnecessary 4 bytes, which did nothing bd for the execution of program. But a bug is a bug. Per covery report "1111476 Wrong sizeof argument" - Fix "show pool_status" always shows memqcache_auto_cache_invalidation as 0. (Tatsuo Ishii) Per bug #80. http://www.pgpool.net/mantisbt/view.php?id=80 - Fix error message in read_password_packet(). (Tatsuo Ishii) - watchdog: Fix to pass big parameter by pointer instead of by value at some function. (Yugo Nagata) - Fix memory leak when SSL is requested. (Tatsuo Ishii) When SSL is requested, pgpool child retries to read start up packet. However it does not free the memory for previous start up packet. Per Coverity report "1111443 Resource". - Fix memory leak when do_query() fails in timestamp rewriting. (Tatsuo Ishii) For this purpose free_select_result() is changed to accept NULL argument. Per Coverity report "1111454, 1111455 Resource leak". - Fix load balance bug in replication mode. (Tatsuo Ishii) When load_balance_mode = off, SELECTs including writing function should be sent to all the DB nodes. Per [pgpool-general: 2221]. http://www.sraoss.jp/pipermail/pgpool-general/2013-October/002250.html The bug was introduced in: http://git.postgresql.org/gitweb/?p=pgpool2.git;a=commitdiff;h=1ac45a28258074ea4d9d902aca016f970d31f311 (3.3.1). - watchdog: Fix to put null character at end of ping result string used in watchdog. (Yugo Nagata) - Fix target node selection logic when "DEALLOCATE portal|statement". (Tatsuo Ishii) When "DEALLOCATE portal|statement" is used and last prepared statement or portal was not found, target node selection map is not set. Probably this is not actually harmful because prepared statement or portal was not found is an error case. The bug was there since day 0. Per Coverity report "1111491 Structurally dead code". - Fix range check bug of MAX_NUM_BACKENDS in corner case. (Tatsuo Ishii) MAX_NUM_BACKENDS is the allowed max number of DB nodes (128, at this point). In reality, probably no one ever tried more than 128 DB nodes and that's the reason why nobody noticed. Per Coverity report "1111429, 1111430 and 1111431 Out-of-bounds write". - Do not set/unset fronted connection info for dead backend. (Tatsuo Ishii) Per bug #82. http://www.pgpool.net/mantisbt/view.php?id=82 - Fix that the script forgets to allow public access to pgpool_catalog. (Tatsuo Ishii) The bug prevents inserting data into user tables if pgpool_catalog is created in native replication mode. The bug was there from day 1. I wonder why nobody noticed until today. Per [pgpool-general-jp: 1229]. http://www.sraoss.jp/pipermail/pgpool-general-jp/2013-November/001228.html - doc: Add description that it is recommended to specify multiple servers to trusted_servers. (Yugo Nagata) - Fix uninitialized variable in error case in pool_do_auth(). (Tatsuo Ishii) If there's no valid backend, pgpool will return garbage pid to frontend in auth phase. Actually because no backend is available, frontend will be disconnected later on. So this is harmless. Per Coverity report "1127331 Uninitialized scalar variable". - Fix to add node id range check when issue an error message using node id. (Tatsuo Ishii) Per Coverity report #1111433 "Out-of-bounds read". - Fix buffer overrun bug and resource leak bug of parse_copy_data(). (Tatsuo Ishii) Per Coverity report 1111427 "Out-of-bounds write" and 1111453 "Resource leak". - Fix possible segfault in CopyDataRaws(). (Tatsuo Ishii) Coverity pointed out that if pool_get_id() returns an error, VALID_BACKEND will access out of array. Per Coverity report 1111413 "Memory - illegal accesses". - Fix query cache is enabled and protocol version = 2 case. (Tatsuo Ishii) When the protocol version = 2, we assume that session state is "idle". This is not feasible but no way. I recommend to not use query cache with protocol 2. Per Coverity report 1111488 "Uninitialized scalar variable". - Fix strftime() usage in pool_pools(). (Tatsuo Ishii) The buffer is not large enough as expected by the second parameter. This is not harmless because the format string will not produce longer result string than the buffer. Per Coverity report 1111426 "Out-of-bounds access". - RPM: Improved to specify the versions of pgool-II and PostgreSQL in the. spec file. (Nozomi Anzai) - Fix resource leak in make_persistent_db_connection. (Tatsio Ishii) For this pupose, new static function free_persisten_db_connection_memory is added. Per Coverity report #1111468. - Fix a bug that connection check to trusted servers fails when the RTT is very short. (Yugo Nagata) - Fix several small bug fixes detected by Coverity. (Tatsuo Ishii) =============================================================================== 3.3.1 (tokakiboshi) 2013/09/06 * Version 3.3.1 This is a bugfix release against pgpool-II 3.3.0. __________________________________________________________________ * Bug fixes - Fix to add the regression test suite for making tar boll (Tatsuo Ishii) This isn't included in the tar ball of 3.3.0 release. - Fix watchdog test script in regression test (Tatsuo Ishii) - Fix a memory overrun bug (Tatsuo Ishii) This problem is pointed out in [pgpool-general: 1956] by Sean Hogan. [pgpool-general: 1956] memory overrun bug? http://www.sraoss.jp/pipermail/pgpool-general/2013-July/001984.html - Fix a compile error (Yugo Nagata) - Fix child process termination with sig abort when memory query cache is enabled (Tatsuo Ishii) This is due to double free bug that occurs when multiple bind/execute messages come after a parse message. When a parse messages comes, query context is created along with temp cache. The pointer to the temp cache is added to the temp cache array when the query executed. Subsequent bind messages uses the same temp cache pointer. This is the source of double free bug when the cache array discarded. This is reported in Bug track #68 by harukat. #68: child process termination with sigabort when memory_cache_enabled = on http://www.pgpool.net/mantisbt/view.php?id=68 - Add some test cases to regression test (Tatsuo Ishii) - Fix typos of the document in installation of pgpool-recovery section. (Tatsuo Ishii) - Fix a typo of log message (Yugo Nagata) - Fix typos of the japanese document (Yugo Nagata) - Fix to send SELECT to master node only when load_balance_mode is off in replication mode (Tatsuo Ishii) When load_balance_mode is off in replication mode, SELECT queries should be sent to master node only, rather than sent to all nodes in an explicit transaction. This problem is reported in [pgpool-general: 2038] by Rypl Lukas. [pgpool-general: 2038] SELECT sent to both nodes in replication mode http://www.sraoss.jp/pipermail/pgpool-general/2013-August/002066.html - Fix pgpool_setup to work in standalone. (Tatsuo Ishii) =============================================================================== 3.3.0 (tokakiboshi) 2013/07/30 * Version 3.3.0 This is the first version of pgpool-II 3.3 series. That is, a "major version up" from 3.2 series. __________________________________________________________________ * Incompatible changes - All the follwing are about watchdog. See "New features" section below for details of these changes. - Default monitoring method was changed from query mode to heartbeat mode. - Failover/failback commands are executed in only one pgpool-II. - In default, all the query caches on shared memory are cleared when standby pgpool-II escalates to active. - Database name, user name, and password used for monitring other pgpool-II by query are specified by dedicated parameters. Previously, template1, recovery_user, and recovery_password are used. __________________________________________________________________ * New features ** Watchdog - Add a new monitring method using heartbeat signal of UDP packet in lifecheck. (Yugo Nagata) You can select a method from either of two methods, "heartbeat" mode or "query" mode. The heartbeat mode is the new method. In this mode, watchdog monitors other pgpool-II process by using heartbeat signal. Watchdog receives heartbeat signals sent by other pgpool-II periodically. If there are no signal for a certain period, watchdog regards it as failure of the pgpool-II. For redundancy you can use multiple networks for heartbeat exchange between pgpool-IIs. This mode is default and recommended one. The query mode is the conventional method. In this mode, watchdog monitors pgpool-II's service rather than process. Watchdog sends queries to other pgpool-II and checks the response. Note that this method requires connections from other pgpool-IIs, so it would fail motoring if num_init_children isn't large enough. This mode is deprecated and left for backward compatibility. Add these new parameters: - wd_lifecheck_method - wd_heartbeat_port - wd_heartbeat_keepalive - wd_heartbeat_deadtime - heartbeat_destinationX - heartbeat_destination_portX - heartbeat_deviceX - Add interlocking mechanism of exclusive failover/failback command execution. (Yugo Nagata) When using multiple pgpool-IIs with watchdog enabled, failover commands (failover_command, failback_command, and follow_master_command) get executed only at one pgpool-II. Previously, these command got executed at all pgpool-IIs. - Add authentication mechanism for watchdog packet communication. (Yugo Nagata) Watchdog packets (include heartbeat signal) from pgpool-II with wrong authentication key are rejected. All pgpool-IIs must have the same key, which is specified wd_authkey parameter in pgpool.conf. pgpool-II with wrong authkey can't even start watchdog, because the startup packet is rejected by other pgpool-IIs. - Add clear_memqcache_on_escalation parameter. (Yugo Nagata) If this is on, all the query caches on shared memory are cleared when standby pgpool-II escalates to active. This is aimed to prevent the new active pgpool-II from using inconsistent query caches with the previous active. - Add wd_escalation_command parameter. (Yugo Nagata) This specifies command which is executed at escalation on the new active pgpool-II server. The timing is just before virtual IP is brought up. - Add parameters wd_lifecheck_dbname, wd_lifecheck_user, and wd_lifecheck_password. (Yugo Nagata) These parameters specify the database name, the user name, and password used in query mode lifecheck of watchdog . Previously, these are hard coded to use template1, recovery_user, and recovery_password. - When delegate_IP parameter is emply, viertual IP is neither brought up nor switched. (Yugo Nagata) This allows multi-master like configuration without virtual IP. - Add pcp_watchdog_info command (Yugo Nagata) This is PCP command for retrieving the watchdog status. ** Others - Import PostgreSQL 9.2 raw parser. (Nozomi Anzai, Tatsuo Ishii) - Add a tool called pgpool_setup to set up pgpool-II and PostgreSQL temporary installation in current directory for *testing* purpose. (Tatsuo Ishii) usage: pgpool_setup [-m r|s][-n num_clusters][--no-stop] -m s: create an installation as streaming replication mode. (the default) -m r: create an installation as native replication mode. -n num_clusters: create num_clusters PostgreSQL database cluster nodes -p base_port: specify base port. The first PostgreSQL node's port is base_port. Second PostgreSQL node's port is base_port+1 ... nth PostgreSQL node's port is base_port+n-1, pgpool port is base_port+n, pcp port is base_port+n+1. --no-stop: do not stop pgpool and PostgreSQL after the work - Support installation method using CREATE EXTENSION for pgpool-recovery and pgpool-regclass. (Tatsuo Ishii) Older installtion method is still preserved. Note: extension names are "pgpool_recovery" and "pgpool_regclass", not "pgpool-recovery" and "pgpool-regclass" because latters are not convenient in using CREATE EXTENSION command (requires double quotes). - Add a function "pgpool_pgctl()" which enebles to execute pg_ctl stop/restart/reload (except for start) by SQL. (Nozomi Anzai) $ psql sales -c "select pgpool_pgctl('reload', 'fast')"; pgpool_pgctl -------------- t (1 row) This function always ignores the actual result and returns 't', so the user can't know if pg_ctl succeeded or failed. To use this we have to set the custom variable for security which limits the users to execute pg_ctl who has the permission of data directory. - Add shell scripts to install pgpool-II and pgpoolAdmin by RPM. (Nozomi Anzai, Yugo Nagata) To make the installer package execute getsources.sh, and the directory named "work" will be created. And you rpmbuild each spec files in work/, put RPMs into work/installer and make tar ball of work/installer. The installer does not only install RPMs but also edit postgresql.conf, pgpool.conf, pg_hba.conf, recovery.conf and scripts for failover and online recovery. This assumes two-nodes configuration and the install script have to be executed in both nodes. - Add new parameter "search_primary_node_timeout". (Muhammad Usama, Tatsuo Ishii) The parameter specifies the maximum amount of time in seconds to search for a primary node when a failover scenario occurs. Patch contributed by Muhammad Usama. Japanese doc and slight editing of English doc by Tatsuo Ishii. - Chinese tutorials for memqcache and watchdog. (Bambo Huang) - Add regression test suit. (Tatsuo Ishii) __________________________________________________________________ * Bug fixes - Consider timeout waiting for compeletion of failback request in on line recovery. (Tatsuo Ishii) This will prevent the situation that recovery operation continues forever and we cannot even shutdown pgpool-II main process. This could happen especially while executing follow master command. - Fix a bug that %H of follow_master_command is not assigned correctly the new primary node in stream replication mode. (Tatsuo Ishii) - Fix not to execute escalation when the pgpool-II which is already active receives down notification from other pgpool-II. (Yugo Nagata) - Fix wd_create_send_socket() not to execute select() before connect(). (Yugo Nagata) How select() works on an unconnected socket is undefined, and differs between platform. On Linux, this returns 2 and it is eventually harmless. However, on Soraris, this returns 0 and it is indistinguishable from time timeout, so watchdog wouldn't work correctly. - Fix error when pgpool_regclass is not installed. (Tatsuo Ishii) The query used in pool_has_pgpool_regclass() fails if pgpool_regclass does not exist. The bug was introduced in 3.2.4. See [pgpool-general: 1722] for more details. [pgpool-general: 1722] [PgPool-II 3.2.4] pgpool_regclass now mandatory? http://www.sraoss.jp/pipermail/pgpool-general/2013-May/001749.html - Fix do_query() not to hang when PostgreSQL returns an error. (Tatsuo Ishii) The typical symptom is "I see SELECT is keep on running according to pg_stat_activity". To fix this pgpool-II just exits the process and kill the existig connection. This is not gentle but at this point I believe this is the best solution. - Fix possible deadlock during failover with watchdog enabled. (Yugo Nagata) This is reported in Bug track #54 by arshu arora http://www.pgpool.net/mantisbt/view.php?id=54 - Fix unnecessary degeneration caused by error on commit. (Tatsuo Ishii) In master slave mode, if master gets an error at commit, while other slaves are normal at commit, we don't need to degenrate any backend because it is likely that the "kind mismatch error" was caused by a deferred trigger. - Fix bug with do_query which causes hung in extended protocol. (Tatsuo Ishii) This problem could occur when insert lock is enabled and pgpool_catalog.insert_lock exists, See [pgpool-general: 1684] for more details. [pgpool-general: 1684] insert_lock hangs http://www.sraoss.jp/pipermail/pgpool-general/2013-May/001711.html - Fix possible failure of query cache invalidation for DML in transaction. (Tatsuo Ishii) CREATE TABLE t1(i INTEGER); CREATE TABLE t2(i INTEGER); SELECT * FROM t1; BEGIN; DELETE FROM t2 WHERE i = 0; INSERT INTO t1(i) VALUES(1); COMMIT; SELECT * FROM t1; At commit pgpool tries to delete cache for t2 but failes because there's no oid table entry for t2. Problem is, it fails to check oid table for t1. So cahce for t1 remains and the last SELECT incorrectly returns cached data. Fix is, continuing to check oid table entries. This is reported in Bug track #58 by wms http://www.pgpool.net/mantisbt/view.php?id=58 - Fix to register pgpool_regclass in pg_catalog schema (Tatsuo Ishii) This is necessary to deal with clients which restricts schema search path to pg_catalog only. Postgres_fdw is such a client. - Fix a hang of "pgpool -m f stop" (Tatsuo Ishii) This is caused by unmanaged pgpool children remaining. This could happen when multiple PostgreSQLs are going down or even when pgpool is started before PostgreSQL startup. - Fix a potential crash in pg_md5 command (Muhammad Usama) - Fix a segmentation fault that occurs when on memory query cache enabled and the query is issued in extended query mode and the result is too large (Tatsuo Ishii) This is reported in Bug track #63 by harukat. Analysis and a test case are also provided. #63 Child process was terminated by segmentation fault with memcached http://www.pgpool.net/mantisbt/view.php?id=63 - Fix a segmentation fault of a child process that occurs when a startup packet has no PostgreSQL user information (Yugo Nagata) You can reproduce it by $ psql -p 9999 -U '' If enable_pool_hba is on, a child process terminates by segmentation fault. Otherwise if enable_pool_hba is off, the error message is ERROR: pool_discard_cp: cannot get connection pool for user (null) database (null) In both cases, psql terminates with no message on frontend. In the fixed version, if PostgreSQL user is not specified in startup packet, the message as following is output to both log and frontend. This is the same behavior as PostgreSQL. FATAL: no PostgreSQL user name specified in startup packet - Fix memory allocation logic in extended query processing with on-memory query cache enabled (Tatsuo Ishii) When very long query string (> 1024 bytes) supplied in extended query with bind parameters, it fails to allocate enough memory. - Fix to verify the backend node number in pcp_recovery_node (Yugo Nagata) When an invalid number is used, null value is passed as an arguments of recovery script, and this causes a malfunction. In especially, rsync may delete unrelated files in basebackup scripts. - Fix a segmentation fault on main process that could occures after backend error detection (Tatsuo Ishii) This is reported in Bug track #62 by tuomas. #62 Slave network outage causes a segmentation fault on main process http://www.pgpool.net/mantisbt/view.php?id=62 - Fix bug with health check when used with child_life_time (Tatsuo Ishii) Failover could happen even if the backend was running fine. This problem is reported in [pgpool-general: 1892] by larisa sabban. [pgpool-general: 1892] Pgpool is unable to connect backend PostgreSQL http://www.sraoss.jp/pipermail/pgpool-general/2013-July/001920.html - Fix bug in parsing prepared statements with transaction handling in replication mode (Tatsuo Ishii) Parse() automatically starts a transaction for non SELECT query to keep consistency among nodes in replication mode. But this wasn't closed. If wrong query comes in, the transaction goes into an abort state but pgpool does not close the transaction. Thus next query causes error because the transaction is still in abort status. This problem was reported in [pgpool-general: 1877] by Sean Hogan. [pgpool-general: 1877] current transaction is aborted, commands ignored http://www.sraoss.jp/pipermail/pgpool-general/2013-July/001905.html __________________________________________________________________ * Enhancements - Add mention about "-D" option to the man page. (Tatsuo Ishii) - Fix to restart watchdog processes automatically when these exit abnormally. (Yugo Nagata) - Add more error checks and reportings to functions executing ping command with watchdog enabled. (Tatsuo Ishii) - Replace some unsafe functions, sprintf and strncpy, with more safe ones, snprintf and strlcpy respectively. (Yugo Nagata) - Replace "sticky bit" to "setuid bit" in log message, comments and funcation names. (Yugo Nagata) These words were used mistakenly and caused confusion. - Fix description on SSL in pool_hba.conf.sample. (Tatsuo Ishii) - Allow to load balancing in an explicit transaction in replication mode. (Tatsuo Ishii) The condition to allow the load balancing is as follows: 1) replicate_select is off 2) no writing functions are used 3) transaction isolation level is not serializable 4) no DML/DDL are issued in the transaction - Chinese manual is updated to the latest especially about watchdog. (Bambo Huang) - Add mention about "-D" option to the man page. (Tatsuo Ishii) - Move ssl_ca_cert and ssl_ca_cert_dir descriptions to the SSL section in the document (Yugo Nagata) - Add ssl_ca_cert and ssl_ca_cert_dir descriptions to the japanese document (Yugo Nagata) =============================================================================== 3.2 Series (2012/08/03 - ) =============================================================================== 3.2.17 (namameboshi) 2016/08/31 * Version 3.2.17 This is a bugfix release against pgpool-II 3.2.16. __________________________________________________________________ * Bug fixes - Fix buffer over run problem in "show pool_nodes". (Tatsuo Ishii) While processing "show pool_nodes", the buffer for hostname was too short. It should be same size as the buffer used for pgpool.conf. Problem reported by a twitter user who is using pgpool on AWS (which could have very long hostname). - Fix usage of wait(2) in pgpool main process. (Tatsuo Ishii) The usage of wait(2) in pgpool main could cause infinite wait in the system call. Solution is, to use waitpid(2) instead of wait(2). - Fix "kind mismatch" error message in pgpool. (Muhammad Usama) Many of "kind mismatch..." errors are caused by notice/warning messages produced by one or more of the DB nodes. In this case now Pgpool-II forwards the messages to frontend, rather than throwing the "kind mismatch..." error. This would reduce the chance of "kind mismatch..." errors. See [pgpool-hackers: 1501] for more details. - Replace "MAJOR" macro to prevent occasional failure. (Tatsuo Ishii) The macro calls pool_virtual_master_db_node_id() and then access backend->slots[id]->con using the node id returned. In rare cases, it could point to 0 (in case when the DB node is not connected), which gives access to con->major, then it causes a segfault. See bug 225 for related info. - doc : fix Japanese document typo. (Bo Peng) - Fixing a typo in the log message. (Muhammad Usama) - doc : Add comment to the document about connection_cache. (Tatsuo Ishii) =============================================================================== 3.2.16 (namameboshi) 2016/06/17 * Version 3.2.16 This is a bugfix release against pgpool-II 3.2.15. __________________________________________________________________ * New features - Allow to access to pgpool while doing health checking (Tatsuo Ishii) Currently any attempt to connect to pgpool fails if pgpool is doing health check against failed node even if fail_over_on_backend_error is off because pgpool child first tries to connect to all backend including the failed one and exits if it fails to connect to a backend (of course it fails). This is a temporary situation and will be resolved before pgpool executes failover. However if the health check is retrying, the temporary situation keeps longer depending on the setting of health_check_max_retries and health_check_retry_delay. This is not good. Attached patch tries to mitigate the problem: - When an attempt to connect to backend fails, give up connecting to the failed node and skip to other node, rather than exiting the process if operating in streaming replication mode and the node is not primary node. - Mark the local status of the failed node to "down". - This will let the primary node be selected as a load balance node and every queries will be sent to the primary node. If there's other healthy standby nodes, one of them will be chosen as the load balance node. - After the session is over, the child process will suicide to not retain the local status. * Bug fixes - Fix is_set_transaction_serializable() when SET default_transaction_isolation TO 'serializable'. (Bo Peng) SET default_transaction_isolation TO 'serializable' is sent to not only primary but also to standby server in streaming replication mode, and this causes an error. Fix is, in streaming replication mode, SET default_transaction_isolation TO 'serializable' is sent only to the primary server. See bug 191 for related info. - Fix Chinese documetation bug about raw mode (Yugo Nagata, Bo Peng) Connection pool is avalilable in raw mode. - Fix confusing comments in pgpool.conf (Tatsuo Ishii) - Permit pgpool to support multiple SSL cipher protocols (Muhammad Usama) Currently TLSv1_method() is used to initialize the SSL context, that puts an unnecessary limitation to allow only TLSv1 protocol for SSL communication. While postgreSQL supports other ciphers protocols as well. The commit changes the above and initializes the SSLSession using the SSLv23_method() (same is also used by PostgreSQL). Because it can negotiate the use of the highest mutually supported protocol version and remove the limitation of one specific protocol version. - If statement timeout is enabled on backend and do_query() sends a (Tatsuo Ishii) query to primary node, and all of following user queries are sent to standby, it is possible that the next command, for example END, could cause a statement timeout error on the primary, and a kind mismatch error on pgpool-II is raised. This fix tries to mitigate the problem by sending sync message instead of flush message in do_query(), expecting that the sync message reset the statement timeout timer if we are in an explicit transaction. We cannot use this technique for implicit transaction case, because the sync message removes the unnamed portal if there's any. Plus, pg_stat_statement will no longer show the query issued by do_query() as "running". See bug 194 for related info. - Deal with the case when the primary is not node 0 in streaming replication mode. (Tatsuo Ishii) http://www.pgpool.net/mantisbt/view.php?id=194#c837 reported that if primary is not node 0, then statement timeout could occur even after bug194-3.3.diff was applied. After some investigation, it appeared that MASTER macro could return other than primary or load balance node, which was not supposed to happen, thus do_query() sends queries to wrong node (this is not clear from the report but I confirmed it in my investigation). pool_virtual_master_db_node_id(), which is called in MASTER macro returns query_context->virtual_master_node_id if query context exists. This could return wrong node if the variable has not been set yet. To fix this, the function is modified: if the variable is not either load balance node or primary node, the primary node id is returned. - change the Makefile under the directory src/sql/, that is proposed (Bo Peng) by [pgpool-hackers: 1611] - Fix a posible hang during health checking (Yugo Nagata) Helath checking was hang when any data wasn't sent from backend after connect(2) succeeded. To fix this, pool_check_fd() returns 1 when select(2) exits with EINTR due to SIGALRM while health checkking is performed. Reported and patch provided by harukat and some modification by Yugo. Per bug #204. backported from 3.4 or later; https://git.postgresql.org/gitweb/?p=pgpool2.git;a=commitdiff;h=ed9f2900f1b611f5cfd52e8f758c3616861e60c0 - Fix bug with load balance node id info on shmem (Tatsuo Ishii) There are few places where the load balance node was mistakenly put on wrong place. It should be placed on: ConnectionInfo *con_info[child id, connection pool_id, backend id].load_balancing_node]. In fact it was placed on: *con_info[child id, connection pool_id, 0].load_balancing_node]. As long as the backend id in question is 0, it is ok. However while testing pgpool-II 3.6's enhancement regarding failover, if primary node is 1 (which is the load balance node) and standby is 0, a client connecting to node 1 is disconnected when failover happens on node 0. This is unexpected and the bug was revealed. It seems the bug was there since long time ago but it had not found until today by the reason above. =============================================================================== 3.2.15 (namameboshi) 2016/04/26 * Version 3.2.15 This is a bugfix release against pgpool-II 3.2.14. __________________________________________________________________ * Bug fixes - Removing the limit on the maximum number of items in the black_function_list and white_function_list lists. (Muhammad Usama) extract_string_tokens in pool_config uses the fixed size malloc on the array to hold the black_function_list/white_function_list items. This imposes a limit of maximum items in these lists. The fix is to use realloc to increase the array size when it gets full. - Redirect all user queries to primary server (Tatsuo Ishii) Up to now some user queries are sent to other than the primary server even if load_balance_mode = off. This commit changes the behavior: if load_balance_mode = off in streaming replication mode, now all the user queries are sent to the primary server only. Per bug #189. - Change the PID length of pcp_proc_count command result to 6 characters long (Bo Peng) If the pgpool process ID are over 5 characters, the 6th character of each process ID will be removed. This commit changes the process ID length of pcp_proc_count command result to 6 characters long. Per bug #188. =============================================================================== 3.2.14 (namameboshi) 2016/04/04 * Version 3.2.14 This is a bugfix release against pgpool-II 3.2.13. __________________________________________________________________ * Bug fixes - doc: Change description of backend_flag (Tatsuo Ishii) It is pointed out that restarting pgpool-II is not necessary. Per [pgpool-general-jp: 1394]. - doc: Fix installation procedure. (Tatsuo Ishii) With PostgreSQL 9.4 or later, installing pgpool_regclass is not needed. - Fix to validate the PCP packet length (Muhammad Usama) Without the validation check, a malformed PCP packet can crash the PCP child and/or can run the server out of memory by sending the packet with a very large data size. - Fix a reset query stuck problem (Muhammad Usama) The solution is to return POOL_END_WITH_FRONTEND_ERROR instead of POOL_END when pool_flush on front-end socket fails. The original report is [pgpool-general: 4265] Pgpool - connection hangs in DISCARD ALL =============================================================================== 3.2.13 (namameboshi) 2016/02/05 * Version 3.2.13 This is a bugfix release against pgpool-II 3.2.12. __________________________________________________________________ * Bug fixes - doc: Fix misinformation regarding load balancing in docs (Tatsuo Ishii) In streaming replication mode, DECLARE, FETCH, CLOSE and SHOW are sent to primary node only. Pointed out in [pgpool-general-jp: 1378]. - Issue fsync() when writing pgpool_status (Tatsuo Ishii) This ensures that pgpool_status is saved to permanent storage and allow to survive after system crash. - Fix ancient bug of pool_push() and friends (Tatsuo Ishii) It allocates buffer using realloc and uses the pointer returned. However it does the pointer calculation *before* realloc gets called. So the calculation uses the old pointer value, which causes various problems including segfault later. Also there were other problems with it. The buffer pointer and buffer size variable is not initialized. The buffer is not freed by pool_close. Typo in debugging message (3.4 or later only). They are fixed as well. - doc: Fix wrong description about log_standby_delay in the document (Yugo Nagata) - Fix bug with "SET TRANSACTION READ ONLY" (Tatsuo Ishii) Pgpool-II remembers that non read only queries (including SET) were executed in an explicit transaction and adds a "writing transaction" mark to the transaction. The mark affects the query routing behavior of pgpool-II while running in streaming replication mode. Pgpool-II starts sending queries to the primary after the mark is set. Because the effect of writing queries may appear on standbys after some delay in streaming replication mode, it is safer to route read queries to the primary after the mark is set. However there's oversight here. "SET TRANSACTION READ ONLY" does no data modification and should be treated as an exception. Per bug #157. - Fix FATAL error with reloading (Tatsuo Ishii) While reloading pgpool.conf, the number of DB nodes is tentatively set to 0, then counted up until reaching to the actual number of backends by the pgpool main process. Unfortunately the variable was on the shared memory and it confused pgpool child process when they were using the variable and this caused FATAL error. Per bug #156 report by harukat. - doc: Add restriction about starting multiple pgpool simultaneously (Yugo Nagata) - Fix a in-memory query cache bug (Tatsuo Ishii) If extended query protocol is used and a bind/execute message arrives which uses a statement created by prior parse message, the temp_cache is not initialized by a parse messages. Thus messages are added to pre existing temp cache buffer which causes the trouble, that is, when the cached result returns, Data Row message and Command Complete message appeared twice. Per by bug #152. - Ignore close statement/portal request if they do not exist (Tatsuo Ishii) In this case just returns a close complete message to client. This is a back port of the following commit from pgpool-II 3.4: 1a37e1c35bd8b6f10f524693bbcb7b51f73b4bf0 =============================================================================== 3.2.12 (namameboshi) 2015/07/24 * Version 3.2.12 This is a bugfix release against pgpool-II 3.2.11. __________________________________________________________________ * Bug fixes - Fix "cannot find xlog functions" error in pgpool-recovery (Muhammad Usama) The argument data type of PostgreSQL's pg_xlogfile_name() function has been changed from text to pg_lsn since PostgreSQL 9.4. And pgpool-recovery was still trying to locate the function by old signature. - Pass empty string parameters in failover command when pgpool-II does not have a value for any particular parameter (Muhammad Usama) Instead of omitting the values for the parameters when pgpool-II does not have any value for a particular parameter, it now passes an empty string to the failover command. This makes sure that failover script will always receive the exact number of expected parameters. - doc: Fix outdated limitation description about load balancing using JDBC driver (Tatsuo Ishii) Even if autocommit is false, load balancing is possible in certain conditions. - Allow to use in-memory query cache size more than 4GB (Tatsuo Ishii) This should have been allowed since in memory query cache was born. - Do not send a query for checking insert lock in non replication mode with extended query (Tatsuo Ishii) =============================================================================== 3.2.11 (namameboshi) 2015/04/08 * Version 3.2.11 This is a bugfix release against pgpool-II 3.2.10. __________________________________________________________________ * Bug fixes - Fix to use void * type for receiving return value of thread function (Yugo Nagata) Previously int type was used and this could occur stack buffer overflow. This caused an infinity loop of ping error at bringing up or down VIP. - Fix to set SIGCHLD to SIG_DFL instead of SIG_IGN in watchdog processes (Yugo Nagata) When using waitpid, it isn't necessary to set SIGCHLD to SIG_IGN. Rather, it is harmful, and due to this it was regarded that ping command exited abnormally in error even when this succeeded. - Remove an unnecessary include directive (Yugo Nagata) - Enlarge POOLCONFIG_MAXDESCLEN to 80 (Tatsuo Ishii) This is used in show pool_status command and limits the length of parameter description. Unfortunately recovery_timeout description is 64 chars, which is 1 byte longer than former definition of the macro. - Support SSL certificate chains in the certificate file for incoming frontend connections (Muhammad Usama) - Fix a problem with pcp_detach_node about graceful node detach (Muhammad Usama) When graceful node detach is requested gracefully, pcp_detach_node should check if it is allowed to process detach_node command on the particular node before blocking the incoming connections and closing the existing connections. =============================================================================== 3.2.10 (namameboshi) 2015/02/05 * Version 3.2.10 This is a bugfix release against pgpool-II 3.2.9. __________________________________________________________________ * Bug fixes - doc: Describe explicitly that the number of slave nodes is not necessarily 1 (Tatsuo Ishii) - Fix uninitialized variable (Tatsuo Ishii) Per Coverity 1234603. - doc: Fix missing release note entries in the previous release (Tatsuo Ishii) - Fix possible segmentation fault in query cache (Tatsuo Ishii) - Fix node id range check bug in trigger_failover_command(). (Tatsuo Ishii) The node id should be lower than NUM_BACKENDS. Probably harmless since callers never pass node ids greater or equal to NUM_BACKENDS. - Allow $_IP_$ having address prefix in if_up_cmd and if_down_cmd (Muhammad Usama) Previously, it is assumed that "$_IP_$" keyword will always have a white space at the end, and when "$_IP_$" has address prefix (e.g. $_IP_$/24), this prefix was ignored. Per bug #122. http://www.pgpool.net/mantisbt/view.php?id=122 - Allow "show pool_nodes" to print node ids having more than one digits (Muhammad Usama) Problem reported in [pgpool-general: 3374]. - Fix to disable debug mode by reloading config (Yugo Nagata) Per bug #114 http://www.pgpool.net/mantisbt/view.php?id=114 =============================================================================== 3.2.9 (namameboshi) 2014/09/05 * Version 3.2.9 This is a bugfix release against pgpool-II 3.2.8. __________________________________________________________________ * Bug fixes - Fix a typo of pgpool.spec (Yugo Nagata) - Fix bug that worker child process keeps failing when there's no primary backend (Tatsuo Ishii) Problem identified and fix contributed by Junegunn Choi. See [pgpool-hackers: 471] for more details. - Close listen socket when smart shutdown request is made (Tatsuo Ishii) When smart shutdown process starts, pgpool children still listen on the port and clients can send further connection requests which fail in the end. Which is not only waste of time, but also prevents a load balancer which sits in front of pgpool from realizing the pgpool is going down. Problem analyzed and patch provided by Junegunn Choi in [pgpool-hackers 474], and enhanced to take care not only inet domain socket but UNIX domain socket by Tatsuo Ishii. - doc: Add cautions that recovery commands are killed by statement_timeout of PostgreSQL. (Tatsuo Ishii) - doc: Remove old restriction description which is no longer true (Tatsuo Ishii) - Fix return type of text_to_lsn() function (Yugo Nagata) This caused compile warning. - Fix file descriptor leak when daemonize. (Tatsuo Ishii) Per Coverity 1111471. - Fix memory leak. (Tatsuo Ishii) Per Coverity 1111442. - Fix pgpool.init's long-standing bug of stop/restart failure (Yugo Nagata) In previous, pgpool.init uses killproc for stopping pgpool, but there are several problems. In the new version, "pgpool -m fast stop" is used in stop command. Original patch contributed by Ryan DeShone and modified by Yugo Nagata. See [pgpool-hackers: 239][pgpool-hackers: 512]. - Add missing include file sys/wait.h. (Tatsuo Ishii) Per bug #104. http://www.pgpool.net/mantisbt/view.php?id=104 - Disbale statement_timeout of PostgreSQL while executing online recovery (Tatsuo Ishii) Online recovery may take very long time and user may enable statement timeout. To prevent online recovery canceled by statement timeout, disable statement timeout in the connection used by online recovery. See [pgpool-general: 2919] for more details. - Remove unnecessary call to pool_shmem_exit() which removes semaphore when it shouldn't (Tatsuo Ishii) exit_handler checks if the process is parent or not. This is good. However, even if it is a child process, it calls pool_shmem_exit() which removes semaphore and shmem when it should not. It should be called only from parent process. Per bug #102. http://www.pgpool.net/mantisbt/view.php?id=102 - Fix reset query stuck problem. (Tatsuo Ishii) It is reported that reset query (DISCARD ALL etc.) occasionally does not finish and pgpool child remain waiting for reply from backend thus client cannot connect to pgpool. The cause of problem is not identified yet but if client suddenly closes connection to pgpool in the middle of query processing, backend may not accept the reset queries because they are not ready for query. The fix is, if frontend closes connection in unexpected way, query process loop immediately returns with new state: POOL_END_WITH_FRONTEND_ERROR and pgpool closes connection to PostgreSQL then goes back to new connection request waiting loop. Also, pgpool closes connections to backend when client_idle_limit is set and the idle limit. Per bug #107. http://www.pgpool.net/mantisbt/view.php?id=107 =============================================================================== 3.2.8 (namameboshi) 2014/03/24 * Version 3.2.8 This is a bugfix release against pgpool-II 3.2.7. __________________________________________________________________ * Bug fixes - doc: Add mention about "listen queue" and how to increase the "backlog" in the num_init_children section. (Tatsuo Ishii) - Fix bug that watchdog status goes down even when only one of trusted servers get unpingable (Yugo Nagata) - Fix bad performance of unlogged tables detection code. (Tatsuo Ishii) Pointed out at [pgpool-hackers: 435][[pgpool-general:2325]. - Fix primary node detection logic. (Tatsuo Ishii) There's a possibility that primary node is not detected. This happens in following situation. node 0: primary, node 1: standby. Node 0 goes down. Health checking detects the fact but local status is not updated yet. Primary node finding (find_primary_node) runs. Node 0's status is yet healthy. Because find_primary_node fails to connect to node 0, it immediately returns -1 and fails to find that fact that node 1 is now primary. Fix is just continuing to look for primary node when fails to connect to a node. Per [pgpool-general: 2409]. - Fix jdbc DML fails when operated in raw mode and auto commit is off. (Tatsuo Ishii) This is reported in bug #92. - Fix query cache bug with extended protocol. (Tatsuo Ishii) SELECT retrieves outdated cache even DML was executed in an expilicit transaction. The bug had been there since in memory query cache was born. Per [pgpool-general-jp: 1252]. - Add missing entries "relcache_size" and "check_temp_table" to show pool_status (Tatsuo Ishii) - Avoid to send queries to unrelated nodes in streaming replication mode. (Tatsuo Ishii) Pgpool-II sends certain queries, such as BEGIN, END and SET commands to all of DB nodes. However in streaming replication mode, only primary node and at most one standby node are only concerned (if primacy node is selected as the load balance node, only 1 node is concerned). See [pgpool-hackers: 464] for more details. - Fix possible buffer overrun problem and memory leak. (Tatsuo Ishii) Per Coverity 1111465 and 1111482. - Fix possible buffer overrun. (Tatsuo Ishii) Replace strcpy() with strlcpy(). Per Coverity report 1111478, 1111480, 1111481. - Fix freeing NULL. (Tatsuo Ishii) Per Coverity 1111384. - Do not enable query cache on materialized views. (Tatsuo Ishii) Per bug #95. - Fix memory leak. (Tatsuo Ishii) Per Coverity 1111446. - Fix a segmentation fault in parallel mode with system_db_hostname is empty (Yugo Nagata) - Fix to output debug messages in processing pgpool.conf with -d option (Yugo Nagata) Previously, some debug messages in pool_get_config() ware not output even when -d option was used. - Fix JDBC exception of prepared statement including now() in replication mode (Yugo Nagata) With JDBC, when a prepared statement is executed more than PrepareThreshold times, the statement is named and Describe message is sent after Parse. With named statement, pgpool rewrite now() to parameter in replication mode. Hence, rewritten query has additonal parameter than original. In this case, ParameterDescription message sent to frontend (response of Describe) should include OIDs of the same number os original query's parameters. Otherwize, JDBC throws ArrayIndexoutOfBoundsException. This is reported in [pgpool-general-jp: 1192]. - Fix backend error of prepared statement about table which has column whoes default value is now() in replication mode (Yugo Nagata) When pgpool parses a named prepared statement with default now(), timestamps are replaced to additional parameters. So, Bind message also should inclued additional parameter format codes. However, when the number of original parameter was one, pgpool didn't handle this. This caused a error like "incorrect binary data format in bind parameter 2". - doc: Add description about parallel mode doesn't support PREPARE (Yugo Nagata) Per bug #93 =============================================================================== 3.2.7 (tokakiboshi) 2013/12/06 * Version 3.2.7 This is a bugfix release against pgpool-II 3.2.6. __________________________________________________________________ * Bug fixes - Fix incorrect time stamp rewriting in replication mode for certain time zones. (Tatsuo Ishii) Time stamp rewriting calls "SELECT now()" to get current time. Unfortunately the buffer for the current time is too small for certain time zones such as "02:30". Note that non-30-minutes-time-zone such as "0900" does not reveal the problem. This explains why we haven't the bug report until today. Bug reported in [pgpool-general: 2113] and fix provided by Sean Hogan. http://www.sraoss.jp/pipermail/pgpool-general/2013-September/002142.html - Makefile: Replace pg_config by $(PG_CONFIG) in Makefiles so it can be overridden at build time when compiling for different PG major versions. (Tatsuo Ishii) Patch contributed by Christoph Berg ([pgpool-general: 2127]). http://www.sraoss.jp/pipermail/pgpool-general/2013-September/002156.html - Remove -lcompat because it confuses FreeBSD per bug#15. (Tatsuo Ishii http://www.pgpool.net/mantisbt/view.php?id=15 - Fix segfault when pgpool.conf does not set log_standby_delay. (Tatsuo Ishii) This is caused by wrong initialization for log_standby_delay in pool_config.l. Per bug#74. http://www.pgpool.net/mantisbt/view.php?id=74 - doc: Modify descriptions about restrictions of parallel mode Muliple rows INSERT using VALUES are not supported in parallel mode. (Yugo Nagata) - Avoid calling find_primary_node_repeatedly() when standby node goes down. (Tatsuo Ishii) This will reduce the time to failover. Per bug #75, patch modified by Tatsuo Ishii. http://www.pgpool.net/mantisbt/view.php?id=75 - Fix data inconsistency problem with native replication mode + extended protocol case. (Tatsuo Ishii) It is reported that concurrent INSERT using JDBC driver causes data difference among database node. This only happens following conditions are all met: 1) Native replication mode 2) Extended protocol used 3) The portal created by parse message is reused by bind message 4) autocommit is on 5) SERIAL (sequence) is used Pgpool-II's parse message function knows it has to lock the target table when INSERT (plus #5) is issued by clients. Unfortunately bind message function did not know it. Once parse/bind/execute finishes, pgpool releases the lock obtained by parse because of #4. JDBC wants to reuse the portal and starts the cycle from bind message, which does not obtain lock. As as result, lock-free INSERT are floating around which causes data inconsistency of course. The solution is, lock the table in bind phase. For this bind needs to issue LOCK in extended protocol. This was a little bit hard because the module (do_command()) to issue internal SQL command (other than SELECT) does not support extended protocol. To solve the problem do_query() is modified so that it accepts other than SELECT because it already accepts extended protocol. The modification is minimum and is only tested for the case called from insert_lock(). I do not recommend to replace every occurrence of do_command () with do_query() at this point. BTW the reason why the bug is not reported is, most users uses JDBC with auto commit = off. In this case, the lock obtained by parse persists until user explicitly issues commit or rollback. Per bug report by Steve Kuekes in [pgpool-general: 2142]. http://www.sraoss.jp/pipermail/pgpool-general/2013-September/002171.html - Fix memory allocation size bug in the code path of query cache. (Tatsuo Ishii) In execute() memory allocation size is too small incertain case. No bug has been reported so far, but certainly this is a bug. - Fix occasional segfault in query cache + extended protocol. (Tatsuo Ishii) When the query is not "cache safe", bind_msg->param_offset was not set in Bind(). However, Execute() unconditionally uses bind_msg->param_offset to convert bind parameters to string so that they can be added to the cached query string and it causes segfault because bind_msg->param_offset is a garbage. Also logic bug to calculate bind_msg->param_offset is corrected. Per bug#76. http://www.pgpool.net/mantisbt/view.php?id=76 - Avoid to run out free query cache hash index entry. (Tatsuo Ishii) If hash index entries are run out, pgpool-II cannot reuse old cache entry because pgpool-II always expects there's at least one empty hash index entry. To mitigate the problem, if free hash index entries are run out, look for victim cache block to reuse the hash index entry. Per bug #70. http://www.pgpool.net/mantisbt/view.php?id=70 - Fix inappropriate shared memory allocation size for clock hand. (Tatsuo Ishii) The memory for clock hand was allocated as sizeof(pool_fsmm_clock_hand)) which is 8 bytes long because the variable is declared as: static int *pool_fsmm_clock_hand; This is plain wrong. The memory size actually needed is only 4 bytes, which is sizeof(*pool_fsmm_clock_hand)). In other word, the bug allocated unnecessary 4 bytes, which did nothing bd for the execution of program. But a bug is a bug. Per covery report "1111476 Wrong sizeof argument" - Fix "show pool_status" always shows memqcache_auto_cache_invalidation as 0. (Tatsuo Ishii) Per bug #80. http://www.pgpool.net/mantisbt/view.php?id=80 - Fix error message in read_password_packet(). (Tatsuo Ishii) - watchdog: Fix to pass big parameter by pointer instead of by value at some function. (Yugo Nagata) - Fix memory leak when SSL is requested. (Tatsuo Ishii) When SSL is requested, pgpool child retries to read start up packet. However it does not free the memory for previous start up packet. Per Coverity report "1111443 Resource". - Fix memory leak when do_query() fails in timestamp rewriting. (Tatsuo Ishii) For this purpose free_select_result() is changed to accept NULL argument. Per Coverity report "1111454, 1111455 Resource leak". - watchdog: Fix to put null character at end of ping result string used in watchdog. (Yugo Nagata) - Fix target node selection logic when "DEALLOCATE portal|statement". (Tatsuo Ishii) When "DEALLOCATE portal|statement" is used and last prepared statement or portal was not found, target node selection map is not set. Probably this is not actually harmful because prepared statement or portal was not found is an error case. The bug was there since day 0. Per Coverity report "1111491 Structurally dead code". - Fix range check bug of MAX_NUM_BACKENDS in corner case. (Tatsuo Ishii) MAX_NUM_BACKENDS is the allowed max number of DB nodes (128, at this point). In reality, probably no one ever tried more than 128 DB nodes and that's the reason why nobody noticed. Per Coverity report "1111429, 1111430 and 1111431 Out-of-bounds write". - Do not set/unset fronted connection info for dead backend. (Tatsuo Ishii) Per bug #82. http://www.pgpool.net/mantisbt/view.php?id=82 - Fix that the script forgets to allow public access to pgpool_catalog. (Tatsuo Ishii) The bug prevents inserting data into user tables if pgpool_catalog is created in native replication mode. The bug was there from day 1. I wonder why nobody noticed until today. Per [pgpool-general-jp: 1229]. http://www.sraoss.jp/pipermail/pgpool-general-jp/2013-November/001228.html - Fix uninitialized variable in error case in pool_do_auth(). (Tatsuo Ishii) If there's no valid backend, pgpool will return garbage pid to frontend in auth phase. Actually because no backend is available, frontend will be disconnected later on. So this is not harmless. Per Coverity report "1127331 Uninitialized scalar variable". - Fix to add node id range check when issue an error message using node id. (Tatsuo Ishii) Per Coverity report #1111433 "Out-of-bounds read". - Fix buffer overrun bug and resource leak bug of parse_copy_data(). (Tatsuo Ishii) Per Coverity report 1111427 "Out-of-bounds write" and 1111453 "Resource leak". - Fix possible segfault in CopyDataRaws(). (Tatsuo Ishii) Coverity pointed out that if pool_get_id() returns an error, VALID_BACKEND will access out of array. Per Coverity report 1111413 "Memory - illegal accesses". - Fix query cache is enabled and protocol version = 2 case. (Tatsuo Ishii) When the protocol version = 2, we assume that session state is "idle". This is not feasible but no way. I recommend to not use query cache with protocol 2. Per Coverity report 1111488 "Uninitialized scalar variable". - Fix strftime() usage in pool_pools(). (Tatsuo Ishii) The buffer is not large enough as expected by the second parameter. This is not harmless because the format string will not produce longer result string than the buffer. Per Coverity report 1111426 "Out-of-bounds access". - Fix resource leak in make_persistent_db_connection. (Tatsio Ishii) For this pupose, new static function free_persisten_db_connection_memory is added. Per Coverity report #1111468. - Fix a bug that connection check to trusted servers fails when the RTT is very short. (Yugo Nagata) - Fix several small bug fixes detected by Coverity. (Tatsuo Ishii) =============================================================================== 3.2.6 (namameboshi) 2013/09/06 * Version 3.2.6 This is a bugfix release against pgpool-II 3.2.5. __________________________________________________________________ * Bug fixes - Fix a segmentation fault on main process that could occures after backend error detection (Tatsuo Ishii) This is reported in Bug track #62 by tuomas. #62 Slave network outage causes a segmentation fault on main process http://www.pgpool.net/mantisbt/view.php?id=62 - Fix a bug with health check when used with child_life_time (Tatsuo Ishii) Failover could happen even if the backend was running fine. This problem is reported in [pgpool-general: 1892] by larisa sabban. [pgpool-general: 1892] Pgpool is unable to connect backend PostgreSQL http://www.sraoss.jp/pipermail/pgpool-general/2013-July/001920.html - Fix "Deploying pgpool-II" section in the document (Tatsuo Ishii) Update descriptions about watchdog use. - Fix a mistake in ssh command of doc/basebackup.sh (Tatsuo Ishii) - Fix a bug in parsing prepared statements with transaction handling in replication mode (Tatsuo Ishii) Parse() automatically starts a transaction for non SELECT query to keep consistency among nodes in replication mode. But this wasn't closed. If wrong query comes in, the transaction goes into an abort state but pgpool does not close the transaction. Thus next query causes error because the transaction is still in abort status. This problem was reported in [pgpool-general: 1877] by Sean Hogan. [pgpool-general: 1877] current transaction is aborted, commands ignored http://www.sraoss.jp/pipermail/pgpool-general/2013-July/001905.html - Fix child process termination with sig abort when memory query cache is enabled (Tatsuo Ishii) This is due to double free bug that occurs when multiple bind/execute messages come after a parse message. When a parse messages comes, query context is created along with temp cache. The pointer to the temp cache is added to the temp cache array when the query executed. Subsequent bind messages uses the same temp cache pointer. This is the source of double free bug when the cache array discarded. This is reported in Bug track #68 by harukat. #68: child process termination with sigabort when memory_cache_enabled = on http://www.pgpool.net/mantisbt/view.php?id=68 - Fix typos of the japanese document (Yugo Nagata) =============================================================================== 3.2.5 (namameboshi) 2013/07/10 * Version 3.2.5 This is a bugfix release against pgpool-II 3.2.4. __________________________________________________________________ * Bug fixes - Add mention about "-D" option to the man page. (Tatsuo Ishii) - Consider timeout waiting for compeletion of failback request in on line recovery (Tatsuo Ishii) This will prevent the situation that recovery operation continues forever and we cannot even shutdown pgpool-II main process. This could happen especially while executing follow master command. - Fix a bug that %H of follow_master_command is not assigned correctly the new primary node in stream replication mode (Tatsuo Ishii) - Fix wd_create_send_socket() to not execute select() before connect() (Yugo Nagata) How select() works on an unconnected socket is undefined, and differs between platform. On Linux, this returns 2 and it is eventually harmless. However, on Soraris, this returns 0 and it is indistinguishable from time timeout, so watchdog wouldn't work correctly. - Fix error when pgpool_regclass is not installed (Tatsuo Ishii) The query used in pool_has_pgpool_regclass() fails if pgpool_regclass does not exist. The bug was introduced in 3.2.4. See [pgpool-general: 1722] for more details. [pgpool-general: 1722] [PgPool-II 3.2.4] pgpool_regclass now mandatory? http://www.sraoss.jp/pipermail/pgpool-general/2013-May/001749.html - Fix do_query() to not hang when PostgreSQL returns an error (Tatsuo Ishii) The typical symptom is "I see SELECT is keep on running according to pg_stat_activity". To fix this pgpool-II just exits the process and kill the existig connection. This is not gentle but at this point I believe this is the best solution. - Fix possible deadlock during failover with watchdog enabled (Yugo Nagata) This is reported in Bug track #54 by arshu arora #54 pgpool-II semaphore lock problem http://www.pgpool.net/mantisbt/view.php?id=54 - Fix bug with do_query which causes hung in extended protocol (Tatsuo Ishii) This problem could occur when insert lock is enabled and pgpool_catalog.insert_lock exists, See [pgpool-general: 1684] for more details. [pgpool-general: 1684] insert_lock hangs http://www.sraoss.jp/pipermail/pgpool-general/2013-May/001711.html - Fix unnecessary degeneration caused by error on commit (Tatsuo Ishii) In master slave mode, if master gets an error at commit, while other slaves are normal at commit, we don't need to degenrate any backend because it is likely that the "kind mismatch error" was caused by a deferred trigger. - Fix possible failure of query cache invalidation for DML in transaction (Tatsuo Ishii) CREATE TABLE t1(i INTEGER); CREATE TABLE t2(i INTEGER); SELECT * FROM t1; BEGIN; DELETE FROM t2 WHERE i = 0; INSERT INTO t1(i) VALUES(1); COMMIT; SELECT * FROM t1; At commit pgpool tries to delete cache for t2 but failes because there's no oid table entry for t2. Problem is, it fails to check oid table for t1. So cahce for t1 remains and the last SELECT incorrectly returns cached data. Fix is, continuing to check oid table entries. This is reported in Bug track #58 by wms #58 query cache invalidation does not fire for multiple DML in transaction http://www.pgpool.net/mantisbt/view.php?id=58 - Fix to register pgpool_regclass in pg_catalog schema (Tatsuo Ishii) This is necessary to deal with clients which restricts schema search path to pg_catalog only. Postgres_fdw is such a client. - Fix a potential crash in pg_md5 command (Muhammad Usama) - Fix a segmentation fault that occurs when on memory query cache enabled and the query is issued in extended query mode and the result is too large (Tatsuo Ishii) This is reported in Bug track #63 by harukat. Analysis and a test case are also provided. #63 Child process was terminated by segmentation fault with memcached http://www.pgpool.net/mantisbt/view.php?id=63 - Fix a segmentation fault of a child process that occurs when a startup packet has no PostgreSQL user information (Yugo Nagata) You can reproduce it by $ psql -p 9999 -U '' If enable_pool_hba is on, a child process terminates by segmentation fault. Otherwise if enable_pool_hba is off, the error message is ERROR: pool_discard_cp: cannot get connection pool for user (null) database (null) In both cases, psql terminates with no message on frontend. In the fixed version, if PostgreSQL user is not specified in startup packet, the message as following is output to both log and frontend. This is the same behavior as PostgreSQL. FATAL: no PostgreSQL user name specified in startup packet - Fix memory allocation logic in extended query processing with on-memory query cache enabled (Tatsuo Ishii) When very long query string (> 1024 bytes) supplied in extended query with bind parameters, it fails to allocate enough memory. - Move ssl_ca_cert and ssl_ca_cert_dir descriptions to the SSL section (Yugo Nagata) - Add ssl_ca_cert and ssl_ca_cert_dir descriptions to the japanese document (Yugo Nagata) - Fix to verify the backend node number in pcp_recovery_node (Yugo Nagata) When an invalid number is used, null value is passed as an arguments of recovery script, and this causes a malfunction. In especially, rsync may delete unrelated files in basebackup scripts. =============================================================================== 3.2.4 (namameboshi) 2013/04/26 * Version 3.2.4 This is a bugfix release against pgpool-II 3.2.3. __________________________________________________________________ * Bug fixes - Fix connect_inet_domain_socket_by_port() to set more appropriate value for timeout parameter of select(2). (Tatsuo Ishii) Some platforms such as Solaris do not allow to specify too large microseconds timeout value (>=1000000). So divide the timeout value to seconds and microseconds. - Fix connect_inet_domain_socket_by_port() to not return as normal when interrupted by alarm. (Tatsuo Ishii) This confuses health checking because connect_inet_domain_socket_by_port() returns unsable fd. This makes detecting errors in health checking longer. See the following for more details: [pgpool-general: 1458] health check timeout in pgpool-II-3.2.3 http://www.pgpool.net/pipermail/pgpool-general/2013-March/001482.html - Fix long standing bug with timestamp rewriting code for processing extended protocol. (Tatsuo Ishii) Parse() allocate memory using palloc() while rewriting the parse message. Problem is, the rewritten message was kept in the data which is managed by pool_create_sent_message() etc. The function assumes that all the data is in session context memory. However, palloc() allocates memory in query context of course, and gets freeed later on when the query context disappears. And the function tries to free the memory as well, which causes various problems, including segfault and double free. To fix this, memory to store rewritten message is allocated using session context. The bug was there since pgpool-II 3.0 was born. Problem analysis and patch contributed by Naoya Anzai. [pgpoolgenera-jp: 1146]. (in Japanese) http://www.pgpool.net/pipermail/pgpool-general-jp/2013-March/001145.html - Fix bug with md5 auth long user name handling. (Tatsuo Ishii) If user name is longer than 32 bytes, md5 authentication doesn't work. Problem reported in [pgpool-general: 1526] by Thomas Martin. [pgpool-general: 1526] [pgPool-II 3.2.3] MD5 authentication and username longer than 32 characters. http://www.pgpool.net/pipermail/pgpool-general/2013-March/001551.html - Fix to calculate replication delay only if standby server is behind from the primay server. (Yugo Nagata) When the primary server is behind from standby server, negative value of delay is calculated and the value is assigned to unsigned variable. It causes a log message informing negative replication delay. And what is worse, it also causes SELECT queries to be sent to the primary in load balance even though there are no replication delay in fact. The problem is reported and analyzed by Saitoh Hidenori in [pgpool-genera-jp: 1145]. [pgpool-general-jp: 1145] (in Japanese) http://www.pgpool.net/pipermail/pgpool-general-jp/2013-March/001144.html - pgpool-recovery adopts PostgreSQL 9.3. (Tatsuo Ishii) Patch contributed by Asif Rehman. Slight editing by Tatsuo Ishii. [pgpool-hackers: 180] compile error in ppool-recovery http://www.pgpool.net/pipermail/pgpool-hackers/2013-April/000179.html - Fix pool_has_pgpool_regclass() to check execute privilege of pgpool_regclass(). (Tatsuo Ishii) Even though pgpool_regclass() exists, if pgpool cannot execute the function, the connection to backend hangs. You can reproduce the problem by just dropping the execute privilege from pgpool_regclass and do some insert in native replication mode. The problem is reported in bugtrack #53. #53 pgpool_regclas hangs all connections Date: 2013-04-04 13:35 Reporter: tmandke http://www.pgpool.net/mantisbt/view.php?id=53 - Fix error message mistakes in detect_postmaster_down_error(). (Tatsuo Ishii) For example, "LOG: detect_stop_postmaster_error: detect_error error" is fixed to "LOG: detect_postmaster_down_error: detect_error error", and so on. - Remove root user check when watchdog is enabled. (Tatsuo Ishii) Per discussion [pgpool-general: 1627] Re: watchdog root requirement. [pgpool-general: 1627] Re: watchdog root requirement. http://www.pgpool.net/pipermail/pgpool-general/2013-April/001654.html - Fix bug with on memory query cache in handling UPDATE/DELETE with table alias. (Tatsuo Ishii) If UPDATE/DELETE is with table alias (UPDATE t1 AS foo...) pgpool thinks the table name is "t1 AS foo" and fails to invalidate query cache. This is caused by _outRangeVar() called from nodeToString() which generates a query string from RangeVar node in raw parse tree. The solution is removing "AS foo" part from the output of the string. Reported in bugtrack #56. #56 UPDATE with alias does not discard cache Date: 2013-04-18 17:33 Reporter: harukat http://www.pgpool.net/mantisbt/view.php?id=56 =============================================================================== 3.2.3 (namameboshi) 2013/02/18 * Version 3.2.3 This is a bug fix release against pgpool-II 3.2.2. Main purpose of this release is to fix fatal problem with pgpool-II 3.2.2's health checking. If all of following conditions are met, pgpool main process disappeared and all client connections to pgpool-II hang forever when failover happens. And the only way to recover from it is, manualy killing the pgpool child process and restart pgpool-II. - health checking is enabled - connecting method to PostgreSQL is TCP/IP, not UNIX domain socket(i.e. "backend_hostnameN" is not empty string) __________________________________________________________________ * Bug fixes - Fix connect_inet_domain_socket_by_port() bug introduced in 3.2.2. (Tatsuo Ishii) When non blocking connect() reports EINPROGRESS or EALREADY, it calls select(2) to wait for read or write fd ready. However it mistakenly checks error condition using getsockopt(). It should be called when select() returns > 0, rather than 0. Because of this, connect_inet_domain_socket_by_port() could return succeeded fd even it actually failed. And what is worse, this health_check() mistakenly believes that backend is alive and tries to write to backend socket, which of course fails. This triggers to call notice_backend_error(), which sends SIGUSR1 signal to pgpool main's parent process. This will result in various weird things: for example, if you start pgpool from a shell, the signal kills the shell. If you start pgpool in background, pgpool's parent is the process #1. As long as you started pgpool as non root, it's ok. Even if you start pgpool as root, init just reopens /dev/initctl by receiving SIGUSR1. These all annoying bugs have been there since pgpool was born. The connect_inet_domain_socket_by_port() bug just reveals it. To fix this, I modified notice_backend_error and child_exit() so that it does nothing when called from pgpool main process itself to prevent pgpool from shooting itself in the foot. - Fix to show pool_passwd in "SHOW pool_status". (Yugo Nagata) - Fix a typo at configure's help in configure.in. (Yugo Nagata) =============================================================================== 3.2.2 (namameboshi) 2013/02/08 * Version 3.2.2 This is a bugfix release against pgpool-II 3.2.1. __________________________________________________________________ * Bug fixes - Fix compile errors on FreeBSD. (Tatsuo Ishii) - Fix pgpool does not recognize VIEWs other than in default schema, which is usually "public". (Tatsuo Ishii) This makes pgpool to create caches for such a VIEW's query results, which of course should not be allowed. Problem reported and patch provided by jgentsch in bug id #30. #30 pgpool 3.2.1 - views in schema other than public are caching Reporter: jgentsch Date: 2012-10-19 23:13 http://www.pgpool.net/mantisbt/view.php?id=30 - Fix race condition when using md5 authentication. (Tatsuo Ishii) The file descriptor to pool_passwd is opened in pgpool main and pgpool child inherits it. When concurrent connections try to authenticate md5 method, they call pool_get_passwd and seek the fd and cause random md5 auth failure because underlying fd is shared. Fix is, let individual pgpool child open the file by calling pool_reopen_passwd_file. Problem reported and analyzed by Jason Slagle in pgpool-general:1141. [pgpool-general: 1141] Possible race condition in pool_get_passwd From: Jason Slagle Date: Sun, 28 Oct 2012 01:12:52 -0400 http://www.sraoss.jp/pipermail/pgpool-general/2012-October/001160.html - Clarify load balance condition information in manual. (Tatsuo Ishii) - Fix segfault due to bug with query cache array handling. (Tatsuo Ishii) The cache arrary is used to keep temporary cache results in a transaction. If there are more than 128 SELECTs in a transaction, the module expands cache_arrary by using realloc. However it does not record the new pointer returned by realloc. So the module keeps on using the old pointer which is absoleted. This problem is reported in bug track #31 by jgentsch. #31 pgpool V3_2_STABLE - segfault in pool_memqcache.c:2529 Reporter:jgentsch Date: 2012-10-23 06:25 http://www.pgpool.net/mantisbt/view.php?id=31 - Fix hung up while repeating pcp_attach_node and pcp_detatch_node (Tatsuo Ishii) When node status is changed by pcp_attach_node and pcp_detatch_node, failover() sends SIGUSR1 to pcp_child process expecting it exits to refresh node status. In this situation lots of pgpool children exit and produce SIGCHLD as well. The SIGCHLD handler reaper() tries catch all SIGCHLD but sometimes it fails depending on the system load and timing. If SIGCHLD produced by pcp child is not caught, the process becomes zombie and never restarted. This problem is reported in bug track #32 (by oleg_myrk) etc. #32 PGPool hangs on pcp_attach/detach Reporter: oleg_myrk Date: 2012-10-24 00:01 http://www.pgpool.net/mantisbt/view.php?id=32 - Fix pool_send_severity_message() not to use uninitialized memory. (Tatsuo Ishii) It cause a segmentaion fault. Reported in Bug #33's attached valgrind output by dudee. #33 pgpool-II 3.2.1 segfault Reporter: dudee Date: 2012-10-30 19:16 http://www.pgpool.net/mantisbt/view.php?id=33 - Fix bug with query cache returning incorrect data in some cases when a persistent table and temp table have same name. (Tatsuo Ishii) Here is a sequence to trigger the bug: 1) CREATE TABLE t1(i int); -- create a persistent table 2) INSERT INTO t1 VALUES(1); 3) SELECT * FROM t1; -- query cache entry created 4) CREATE TEMP TABLE t1(i int); -- create a temp table 5) SELECT * FROM t1; -- query cache entry mistakenly created! Problem is #3 creates relcache entry for t1, and #5 incorrecly uses it and believes that temp table t1 is not a temp table. - Add a description about "-f" to help message. (Tatsuo Ishii) - Fix reaper() not to exit wait3() loop when catches pcp or worker child exit event. (Tatsuo Ishii) Otherwise reaper() mistakenly ignore some process exit event and make a risk of creating zombie process and forgetting to create new process. Problem reported and fix suggested by Goto in [pgpool-general-jp: 1123]. http://www.sraoss.jp/pipermail/pgpool-general-jp/2012-November/001122.html (in Japanese) - Fix a typo of configure help message. (Yugo Nagata) - Add wd_hostname to pool_process_reporting.c. (Yugo Nagata) Otherwise, wd_hostname is not contained in results of SHOW pool_status and cp_pool_status. - Fix connect_inet_domain_socket_by_port() to not error out when connect(2) returns EISCONN (Socket is already connected) error. (Tatsuo Ishii) This could happen with non blocking socket and should be treated as normal. Per bug track #29 (by spork) and pgpool-general 1218 (by Mikola Rose). #29 pgpool 3.2.1 cannot connect to db hosts Reporter: spork Date: 2012-10-18 15:03 http://www.pgpool.net/mantisbt/view.php?id=29 [pgpool-general: 1218] pgpool 3.2.1 - Health check failing to connect From: Mikola Rose Date: Tue, 4 Dec 2012 20:21:55 +0000 http://www.sraoss.jp/pipermail/pgpool-general/2012-December/001237.html - Fix health_check() to check the health check timer before retrying with template1 database. (Tatuo Ishii) Without this, the retry with node 0 always fails because health check timer may be already expired. - Fix pool_search_relcache() to use MASTER or MASTER_NODE_ID macro, rather than REAL_MASTER_NODE_ID. (Tatsuo Ishii) In case node 0 fail back in streaming replication mode, pgpool does not restart child process. So REAL_MASTER_NODE_ID looks for node 0 con info, which is not present until new connection to backend made. Thus referring to node con info results in segfault. MASTER or MASTER_NODE_ID are safe in this situation because they look at cached former master node id. - Fix long standing bug "portal not found" error when replication delay is too much in streaming replication mode. (Tatsuo Ishii) The bug had been there since the delay threshold was introduced. We changed destination DB node if delay threshold exceeds in bind, describe and execute. However, if parse sends to different node, bind, describe or execute will fail because no parsed statement or portal exists. Solution is, not to send to different parse node even if delay threshold is too much. - Fix pg_md5 to output "\n" after user inputs password. (Yugo Nagata) - Fix to print error message when the port number for watchdog is already used. (Yugo Nagata) This issue was reported by Will Ferguson in [pgpool-general: 1167]. [pgpool-general: 1167] Re: Watchdog error - wd_init: delegate_IP already exists From: Will Ferguson Date: Tue, 6 Nov 2012 13:03:36 +0000 http://www.sraoss.jp/pipermail/pgpool-general/2012-November/001186.html - Fix child_exit() to not call send_frontend_exits() if there's no connection pool. (Tatsuo Ishii) Otherwise, it segfaults because send_frontend_exits() referes to objects pointed to by pool_connection_pool. Per bug track #44 by tuomas. #44 pgpool went haywire after slave shutdown triggering master failover Reporter: tuomas Date: 2012-12-11 00:33 http://www.pgpool.net/mantisbt/view.php?id=44 - Fix bug that only tables in white_memqcache_table_list was cached when black_memqcache_table_list has any tables. (Yugo Nagata) - Fix read_startup_packet() to reset alarm and free StartupPacket when pool_read() returns 0 which means incorrect packet length. (Nozomi Anzai) Previously, authentication timeout occurs when connected by a program monitoring the pgpool port.It is reported in bug track #35. #35 Authentication is timeout Reporter: tuomas Date: 2012-11-20 11:54 http://www.pgpool.net/mantisbt/view.php?id=35 - Fix long standing bug with pool_open(). (Tatsuo Ishii) It initializes wrong buffer pointer. Actually this is harmless because the pointer is initialized by prior memset() call, though. - Log that failover is avoided because "fail_over_on_backend_error" is turned off. (Tatsuo Ishii) - Fix LISTEN/NOTIFY handling bugs. (Tatsuo Ishii) 1) In streaming replication mode: Session 1: LISTEN aaa; Session 2: NOTIFY aaa; Session 1: LISTEN aaa; --- hangs (If LISTEN and NOTIFY are issued in a same session, it works fine.) We assume that packets come from all nodes. However in streaming replication mode, notification message only comes from primary node and we should avoid reading from standby nodes. 2) In streaming replication mode: If primary node is not node 0, it hangs like #1 even if fix applies. This is because MASTER_NODE_ID macro (actually pool_virtual_master_db_node_id()) always returns REAL_MASTER_NODE_ID, which is node 0 (if it is alive). The function should return PRIMARY_NODE_ID in master/slave mode. 3) In replication mode, LISTEN/NOTIFY simply does not work. In the mode, NOTIFY is sent to all backends. However the order of arrival of 'Notification response' is not necessarily the master first and then slaves. So if it arrives slave first, we should try to read from master, rather than just discard it. Fixed in pool_process_query(). 4) In replication mode, if LISTEN and NOTIFY are issued in a same session, the session is disconnected because do_command() may receive other than 'N', 'E', 'S' and 'C'. The solution is, put 'A' packet on a stack and pop out when it is convenient. For this purpose, new functions pool_push(), pool_pop() and pool_stacklen() are added. This probmel is reported in but grack #45 by rpashin. #45 LISTEN/NOTIFY doesn't work if cluster contains more then 1 node in streaming replication mode Reporter: rpashin Date: 2012-12-12 00:09 http://www.pgpool.net/mantisbt/view.php?id=45 Considering the size of the patch, I do not back patch to 3.1 or before(so far, we have not heard any complaints on 3.1 or before). - Fix connect_inet_domain_socket_by_port() to call select(2) rather than error out when connect(2) returns EINPROGESS or EALREADY error. (Tatsuo Ishii) When using non-blocking socket, despite the errors like "Connection timed out", actually connection has been established. To solve the problem we should use select(2) to wait for connection establishing when connect(2) reports EINPROGRESS or EALREADY, instead of doing a retry tight loop. This problem is reported in bug track #46 by mcousin. #46 Watchdog failing to connect sometimes Reporter: mcousin Date: 2012-12-15 01:01 http://www.pgpool.net/mantisbt/view.php?id=46 - Add caution to increase num_init_children if watchdog enabled in manual. (Tatsuo Ishii) See [pgpool-general: 1330] for more details. [pgpool-general: 1330] WatchDog and pgool sudden stop working From: Tomas Halgas Date: Fri, 18 Jan 2013 14:47:23 +0100 http://www.sraoss.jp/pipermail/pgpool-general/2013-January/001350.html - Fix segmentation fault while pgpool-II stating up or fail over when watchdog is enabled. (Yugo Nagata) This is caused by wrong usage of pthread, namely pthread_detach and pthread_join are mixed together. Solution is to use pthread_join only if we need to get status of child thread. BTW, the problem could occu on moderately modern OS such as Fedora 17, but the reason why the problem is not observed on other OSs is, just we were lucky. Problem reported in [pgpool-general: 1179] by Lonni J Friedman. [pgpool-general: 1179] 3.2.1 segfaults at startup on Fedora17. From: Lonni J Friedman Date: Mon, 12 Nov 2012 15:58:29 -0800 http://www.sraoss.jp/pipermail/pgpool-general/2012-November/001198.html Patch provided by chads in bug track #48. pthread_detach is being used wrong; causes pgpool to segfault. Reporter: chads Date: 2013-01-16 05:44 http://www.pgpool.net/mantisbt/view.php?id=48 - Avoid split-brain situation reported in [pgpool-general: 1046] (Yugo Nagata) After all backend nodes are detached from pgpools and then some backend node are attached to these, multiple active pgpools could exist simultaneously, that is to say, split-brain situation occurs. In this fix, when once all backend DB nodes are detached from pgpool, the pgpool stays DOWN status until this is restarted. The pgpool in DOWN status cannot escalate to active (delegate IP holder), so split-brain situation is avoided. [pgpool-general: 1046] watchdog enabled delegate_IP on multiple nodes simultaneously From: Lonni J Friedman Date: Wed, 26 Sep 2012 09:05:09 -0700 http://www.sraoss.jp/pipermail/pgpool-general/2012-September/001064.html - Avoid a possible hang during the active pgpool exits. (Yugo Nagata) When exiting, the active pgpool brings down the virtual IP and then sends a packet to other pgpools. However, the packet sometimes is sent before the virtual IP is brought down completely. In this case the packet sender is set to this IP. When the IP is brought down before other pgpools respond, the active pgpool can not recieve the response, and hang up. In this fix, the active pgpool confirms that the virtual IP is brought down before sending the packet. - Modify descriptions of restrictions on watchdog. (Yugo Nagata) - Modify pgpool.conf.sample* and documents to correct information of whether a certain parameter change requires restart. (Yugo Nagata) - Add pool_passwd option to pgpool.conf.sample*, pool_process_reporting.c, and documents. (Yugo Nagata) Otherwise, wd_hostname is not contained in results of SHOW pool_status and pcp_pool_status. =============================================================================== 3.2.1 (namameboshi) 2012/10/12 * Version 3.2.1 This is a bugfix release against pgpool-II 3.2.0. __________________________________________________________________ * Bug fixes - Fix send_cached_messages(). (Tatsuo Ishii) Before it had 8192 bytes fix length buffer for each row data and if data exceeded 8192 bytes, it just crashed. To fix this, eliminate copying raw data which is passed as an argument to buffer and pass the pointer to send_message. - Fix that extended queries failed due to query cache. (Nozomi Anzai) - Fix read_startup_packet(). (Tatsuo Ishii) If packet length is lower than 0, it should have returned immediately. Otherwise it would cause memory allocation error later on. per pgpool-general:886. Also add canceling alarm. [pgpool-general: 886] read_startup_packet: out of memory From: Lonni J Friedman Date: Wed, 8 Aug 2012 10:18:15 -0700 http://www.sraoss.jp/pipermail/pgpool-general/2012-August/000896.html - Fix too watchdog process's aggressively kill other processes when pgpool shuts down. (Tatsuo Ishii) watchdog process calls kill(0,SIG) to kill all processes related to watchdog. Unfortunately this will kill not only watchdog related processes but parent pgpool and even httpd in case when pgpool was invoked from pgpoolAdmin because they are in the same process group. So for now, fix is removing call to the kill() and setpgid() because setpgid() does nothing useful. In the future, we should call setsid() to establish new process group in any case. - Fix query cache to regist such queries that start with "-- comment" or have comments more than one. (Nozomi Anzai) - Fix query cache to ignore multi statement. (Nozomi Anzai) In previous, queries like "SELECT 1;UPDATE..." were cached, too, but it was wrong. - Add a watchdog restriction to documents. (Yugo Nagata) - Add NOTICE message handling to s_do_auth(). (Tatsuo Ishii) Without this, health check responses false alarm and causes failover. per bug track: #25 s_do_auth doesn't handle NoticeResponse (N) message Date: 2012-08-28 03:57 Reporter: singh.gurjeet Date: http://www.pgpool.net/mantisbt/view.php?id=25 - Remove unnecessary/confusing debug log from s_do_auth().(Tatsuo Ishii) - Fix buffer overrun in Execute when memory cache enabled. (Tatsuo Ishii) If one of bind parameter < 0, it was possible to produce more than 2 byte string for "%02X" due to sign extention. Also use snprintf, rather than sprintf to prevent from possible buffer overrun in the future. - Fix long standing memory leak bug with free_select_result() since pgpool-II 2.3 was born in December 2009. (Tatsuo Ishii) Actually this bug only appears when operated in replication mode (triggered by timestamp rewriting process by coincidence). Per bug track #24: #24 Severe memory leak in an OLTP environment Date: 2012-08-28 03:43 Reporter: singh.gurjeet Date: http://www.pgpool.net/mantisbt/view.php?id=24 - Fix typo in cache_reporting(). (Tatsuo Ishii) - Fix inifinit loop in SSL mode. (Tatsuo Ishii) When there's pending data in SSL layer of frontend, pool_process_query() checks pending data in backend. If there's non, it loops again and checks frontend/backend receive buffer by using is_cache_empty(). Unfortunately it first checks pending data in SSL layer of frontend, thus goes to backend data and checks again (infinite loop). The solution is, if there's pending data in SSL layer of frontend and query is not in progress, call ProcessFrontendResponse() to process new request from frontend. - Fix is_system_catalog() to use pgpool_regclass if available. (Tatsuo Ishii) - Fix memory leak in pool_get_insert_table_name(). (Tatsuo Ishii) If session context's memory contex is used for nodeToString(), memory is not freed until session ends. See bug track #24 for more details. #24 Severe memory leak in an OLTP environment Date: 2012-08-28 03:43 Reporter: singh.gurjeet http://www.pgpool.net/mantisbt/view.php?id=24 - Use fcntl(2) rather than flock(2) to lock oid map files. (Tatsuo Ishii) flock(2) is not portable and cannot be used on Solaris. Patch contributed by Ibrar Ahmed. - Fix oversight of get_next_master_node() when operated in raw mode. (Tatsuo Ishii) If master node goes down, it always returned master node id 0. See [pgpool-general: 1039] for more details. [pgpool-general: 1039] Raw failover not working as expected on pgpool-II v3.2.0 From: Quentin White Date: Tue, 25 Sep 2012 07:45:34 +0000 http://www.sraoss.jp/pipermail/pgpool-general/2012-September/001057.html - Fix segfault of do_query(). (Tatsuo Ishii) When memqcache enabled and extended protocol is used, do_query() accesses system catalog and use pool_read2(). Unfortunately parse message packet is given to Parse() and the packet contents is on pool_read2's buffer. Thus do_query could break the packet contents, and it leads to segfault. Solution is, allocate memory and copies the packet contents and pass to Parse(). Note that query context holds query string, which is in the packet as well. So we need to copy it and save the pointer in the query context. We think the problem is not only with Parse() but with other protocol modules. So this fix is not Parse() only, rather for other modules. For this purpose ProcessFrontendResponse() is changed. See bugtrack in detai. #21 pgpool-II 3.2.0 cannot execute sql through jdbc Date: 2012-08-17 16:31 Reporter: elisechiang http://www.pgpool.net/mantisbt/view.php?id=21 - Fix to set unix domain socket path for pgpool PCP communication before setting up signal handlers. (Yugo Nagata) Previously, unlink of the socket in exitting process was failed because the path of the socket was not set. Patch contributed by Gilles Darold [pgpool-hackers: 131] Found bug with watchdog resulting in pgpool segmentation fault From: Gilles Darold Date: Thu, 13 Sep 2012 18:54:42 +0200 http://www.sraoss.jp/pipermail/pgpool-hackers/2012-September/000130.html - Fix to output the message when, in watchdog, ifup/down or arping command does not exist. (Yugo Nagata) - Fix long standing problem with do_query(). (Tatsuo Ishii) When 1) extended protocol used and 2)unnamed portal is used and 3) no explicit transaction is used, user's unnamed portal is removed by Sync message. This is because Sync message closes transaction and unnamed portal is removed. This leads to "portal "" does not exist" error. Fix is, use "Flush" message instead of Sync. Main difference between using Sync and Flush is, Flush does not return Ready for Query message. So do_query() does not return until all expected responses are returned. It seems the order of messages returned from backend is random, and do_query () manages it by using state bits. =============================================================================== 3.2.0 (namameboshi) 2012/08/03 * Version 3.2.0 This is the first version of pgpool-II 3.2 series. That is, a "major version up" from 3.1 series. __________________________________________________________________ * Incompatible changes - The new query cache "On memory query cache" took the place of the old one. - Now the parameter "enable_query_cache" is deleted. __________________________________________________________________ * New features ** Memory based query cache Original author is Masanori Yamazaki, improved by Development Group. (Tatsuo Ishii, Nozomi Anzai, Yugo Nagata) Overview: On memory query cache is faster because cache storage is on memory. Moreover you don't need to restart pgpool-II when the cache is outdated because the underlying table gets updated. On memory cache saves pair of SELECT statements (with its Bind parameters if the SELECT is an extended query). If the same SELECTs comes in, it returns the value from cache. Since no SQL parsing nor access to PostgreSQL are involed, it's extremely fast. On the other hand, it might be slower than the normal path because it adds some overhead to store cache. Moreover when a table is updated, pgpool automatically deletes all the caches related to the table. So the prformace will be degraded by a system with a lot of updates. If the cache_hit_ratio is lower than 70%, you might want to disable onl memory cache. Choosing cache storage: You can choose a cache storage: shared memory or memcached (you can't use the both). Query cache with shared memory is fast and easy because you don't have to install and config memcached, but restricted the max size of cache by the one of shared memory. Query cache with memcached needs a overhead to access network, but you can set the size as you like. Restrictions: - On memory query cache deletes the all cache of an updated table automatically with monitoring if the executed query is UPDATE, INSERT, ALTER TABLE and so on. But pgpool-II isn't able to recognize implicit updates due to trigers, foreign keys and DROP TABLE CASCADE. You can avoid this problem with memqcache_expire by which pgpool deletes old cache in a fixed time automatically, or with black_memqcache_table_list by which pgpool's memory cache flow ignores the tables. - If you want to use multiple instances of pgpool-II with online memory cache which uses shared memory, it could happen that one pgpool deletes cache, and the other one doesn't do it thus finds old cached result when a table gets updated. Memcached is the better cache storage in this case. New parameters: - Add parameters for on memoey query cache as follows: memory_cache_enabled, memqcache_method, memqcache_expire, memqcache_maxcache, memqcache_oiddir. (Tatsuo Ishii) - Add parameters about shared memory for on memory query cache as follows: memqcache_total_size, memqcache_max_num_cache, memqcache_cache_block_size. (Tatsuo Ishii) - Add parameters about memcached for on memory query cache as follows: memqcache_memcached_host, memqcache_memcached_port. (Tatsuo Ishii) - Add parameters about relation cache for on memory query cache as follows: relcache_expire, relcache_size. (Tatsuo Ishii) - Add a parameter "check_temp_table" to check if the SELECTed table is temp table. (Tatsuo Ishii) - Add the parameters of white_memqcache_table_list, black_memqcache_table_list that check if the SELECTed tables, temp tables and views are to be cached or not. (Nozomi Anzai) - Add a parameter "memqcache_auto_cache_invalidation" of the flag if query cache is triggered by corresponding DDL/DML/DCL (and memqcache_expire). (Yugo Nagata) New commands: - Add "SHOW pool cache" which shows hit ratio of query cache and the status of cache storage. - Add "--with-memcached" option to configure. (Nozomi Anzai) - Add "-C, --clear-oidmaps" option to "pgpool" command. (Nozomi Anzai) If pgpool with memcached starts / restarts with -C option, discard oid maps, if not, it can reuse old oid maps and query caches. ** Watchdog The author is Atsushi Mitani, tested by Yugo Nagata. Overview: "Watchdog" is a sub process of pgpool-II aiming for adding high availability feature to it. Features added by watchdog include: - Life checking of pgpool service Watchdog monitors responses of pgpool service rather than process. It sends queries to PostgreSQL via pgpool which is being monitored by watchdog and watchdog checks the response. Also watchdog monitors connections to up stream servers (application servers etc.) from the pgpool. The connection between the up stream servers and the pgpool is monitored as service of pgpool. - Mutual monitoring of watchdog processes Watchdog processes exchange information on the monitored servers to keep the information up to date, and to allow watchdog processes to mutually monitor each other. - Changing active/standby state in case of certain faults detected When a fault is detected in the pgpool service, watchdog notifies the other watchdogs of it. Watchdogs decide the new active pgpool if previous active pgpool is broken by voting and change active/standby state. - Automatic virtual IP address assigning synchronous to server switching When a standby pgpool server promotes to active, the new active server brings up virtual IP interface. Meanwhile, the previous active server brings down the virtual IP interface. This enables the active pgpool to work using the same IP address even when servers is switched over. - Automatic registration of a server as standby in recovery When broken server recovers or new server is attached, the watchdog process notifies the other watchdog process along with information of the new server, and the watchdog process receives information on the active server and other servers. Then, the attached server is registered as standby. New parameters: - Add a parameter to enable watchdog: use_watchdog. (Atsushi Mitani) - Add the parameters about life checking of pgpool service as follows: wd_interval,other_pgpool_port wd_life_point, wd_lifecheck_query, other_pgpool_hostname, other_pgpool_port. (Atsushi Mitani) - Add the parameters about up to stream connection (e.g. to application servers) as follows: trusted_servers, ping_path. (Atsushi Mitani) - Add the parameters about mutual monitoring of watchdog processes as follows: wd_hostname, wd_port, other_wd_port. (Atsushi Mitani) - Add the parameters about virtual IP as follows: ifconfig_path, if_up_cmd, if_down_cmd, arping_path, arping_cmd. (Atsushi Mitani) __________________________________________________________________ * Enhancements - Retry if health check faied rather than immediately do failover. For this purpose new directives "health_check_max_retries" and "health_check_retry_delay" were added. (Tatsuo Ishii) Patch contributed by Matt Solnit. Subject: [Pgpool-hackers] Health check retries (patch) From: Matt Solnit Date: Fri, 18 Nov 2011 16:28:44 -0500 - Log client IP and port number when pgpool failed to parse given query. (Tasuo) This is usefull to identify which client gives wrong query without enabling log_connections, which produces too many log entries on busy web systems. - Refactor pool_process_query(). (Tatsuo Ishii) Deal with the case when: 1) query not in progress 2) other than master node has pending data. It is reported that pgpool goes into infinite loop in this case. [pgpool-general: 43] Re: [Pgpool-general] seemingly hung pgpool process consuming 100% CPU http://www.pgpool.net/pipermail/pgpool-general/2011-December/000042.html - Add "role" which represents "primary" or "standby" iin streaming replication mode for example to "SHOW pool_nodes" command.(Tatsuo Ishii) - Add params to the result of "SHOW pool_status": backend_data_directory, ssl_ca_cert, ssl_ca_cert_dir, and sort by orders in pgpool.conf. (Anzai) - Commentout params about system db from pgpool.conf.sample-*. (Nozomi Anzai) - Add new parameter to failover/failback/followmaster command. (Tatsuo Ishii) %r: new master port number %R: new master database cluster path - Allow to reload to recognize md5 password change. (Tatsuo Ishii) Before, the only way to recognize md5 password change was restarting pgpool-II. Patch contributed by Gurjeet Singh. - Remove unused parameter "query" from is_set_transaction_serializable(). (Tastuo Ishii) - Fix on memory query cache section's comments in pgpool.com in the way which other sections employ. (Tastuo Ishii) - Add missing health_check_max_retries and health_check_retry_delay directives to pgpool.conf.sample-master-slave, pgpool.conf.sample-replication pgpool.conf.sample-stream. (Tastuo Ishii) - Fix pool_ssl_write. It seems someone forgot to do retrying when SSL returns SSL_ERROR_WANT_READ or SSL_ERROR_WANT_WRITE. Per [pgpool-general: 797] [pgpool-general: 797] Re: Problem with pgpool when using SSL, for client/pgpool communication http://www.sraoss.jp/pipermail/pgpool-general/2012-July/000807.html - Improve the design of manuals. (Nozomi Anzai) __________________________________________________________________ * Bug Fix - Fix memory leak in Raw mode.(Tatsuo Ishii) - Fix failover/failback in Raw mode. (Tatsuo Ishii) - Simply does not failover if target node is not master. - Fail to select master node if the node is in CON_UP. - Allow health check retry while connect(). (Tatsuo Ishii) It is reported that connect() blocks sigalarm under some conditions, for example: When system is configured for security reasons not to return destination host unreachable messages ([pgpool-general: 131]) Part of changes are contributed by Stevo Slavic. [pgpool-general: 131] Healthcheck timeout not always respected http://www.pgpool.net/pipermail/pgpool-general/2012-January/000131.html - Fix pool_send_and_wait() to send or not to send COMMIT / ABORT depending on the transaction state on each node. (Tatsuo Ishii) It is possible that only primary is in an explicit transaction but standby is not in it if multi statement query has been sent. Per bug report [pgpool-general-jp: 1049]. - Fix load balance in Solaris. (Tatsuo Ishii) Problem is, random() in using random() in Solaris results in strange load balancing calculation. Use srand()/rand() instead although they produce lesser quality random Problem reported at [pgpool-general: 396]. [pgpool-general: 396] strange load balancing issue in Solaris http://www.pgpool.net/pipermail/pgpool-general/2012-April/000397.html - Fix segfault of pcp_systemdb_info not in parallel mode. (Nozomi Anzai) - Fix "unnamed prepared statment does not exist" error. (Tatsuo Ishii) This is caused by pgpool's internal query, which breaks client's unnamed statements. To fix this, if extended query is used, named statement/portal for internal are used for internal query. - Fix hangup when query conflict occurs in Hot-Standby mode. (Yugo Nagata) Query example to reproduce: (S1) BEGIN; (S1) SELECT * FROM t; (S2) DELETE FROM t; (S2) VACUUM t; - Fix pool_process_query() bug reported in [pgpool-general: 672]. (Tatsuo Ishii) This is caused by the function waits for primary node which does not have pending data, while standbys have pending data. [pgpool-general: 672] Transaction never finishes http://www.pgpool.net/pipermail/pgpool-general/2012-June/000676.html - Fix wait_for_query_response() not to send param status to frontend if frontend is NULL. (Tatsuo Ishii) This could happen while processing reset_query_list and occur crash. - Fix bug with treatment of BEGIN TRANSACTION in master/slave mode. (Tatsuo Ishii) Original complain is [pgpool-general: 714]. From 3.1, pgpool-II sends BEGIN.. to all DB nodes. Of course we cannot send BEGIN TRANSACTION READ WRITE to standby nodes. Problem is, we did not check BEGIN WORK ISOLATION LEVEL SERIALIZABLE; and sent to standby nodes. Of course this is wrong, since it's not allowed to run transactions in serializable mode on standby nodes. So added check for BEGIN WORK ISOLATION LEVEL SERIALIZABLE case. [pgpool-general: 714] Load Balancing / Streaming Replication / Isolation Level serializable http://www.pgpool.net/pipermail/pgpool-general/2012-July/000719.html - Fix send_to_where() to send the query to only primary if the it is like SET TRANSACTION ISOLATION LEVELSERIALIZABLE etc. (Tatsuo Ishii) Case in streaming replication mode. Previously, it was sent to not only primary but also to standby and of course this causes an error. Similar SQLs are: SET SESSION CHARACTERISTICS AS TRANSACTION ISOLATION LEVEL SERIALIZABLE or SET transaction_isolation TO 'serializable' SET default_transaction_isolation TO 'serializable' Original complain is [pgpool-general: 715]. [pgpool-general: 715] Re: Load Balancing / Streaming Replication / Isolation Level serializable http://www.pgpool.net/pipermail/pgpool-general/2012-July/000720.html - Prevent errors even if memcached is not available with on memory query cache enabled and cache storage is memcached. (Tatsuo Ishii) This is mainly achieved by modifying pool_fetch_cache to pretend "cache not found" if memcached_get returns error other than MEMCACHED_NOTFOUND. Also we set pool_config->memory_cache_enabled to 0 to prevent future errors by accessing memcached. - Run rerun libtoolize with --copy and --force option. (Tatsuo Ishii) This should prevent build problems in different environment. Following commands were executed: libtoolize --copy --force aclocal autoheader automake -a autoconf - Fix pool_ssl_read. (Tatsuo Ishii) When SSL_read returns unknown error, treat as if EOF detected and returns 0 to caller (pool_read). This is same as libpq's behavior. Also this will avoid unwanted failover in pool_read. pool_read triggers failover if underlying I/O functions, read(2) or pool_ssl_read returns -1. - Fix pool_process_query. (Tatsuo Ishii) When other than primary sends packet, pgpool tries to terminate session gracefully and hung because now ssl_read returns EOF, rather than error and triggers failover. For example [pgpool-general: 766] reported this: 2012-07-17 00:11:03 NZST [15692]: [257-1] ERROR: canceling statement due to conflict with recovery 2012-07-17 00:11:03 NZST [15692]: [258-1] DETAIL: User query might have needed to see row versions that must be removed. 2012-07-17 00:11:03 NZST [15692]: [259-1] STATEMENT: 2012-07-17 00:11:03 NZST [15696]: [366-1] FATAL: terminating connection due to conflict with recovery 2012-07-17 00:11:03 NZST [15696]: [367-1] DETAIL: User query might have needed to see row versions that must be removed. In this case pool_process_query should return POOL_ERROR, rather than POOL_END. [pgpool-general: 766] Re: pgpool dropping backends too much http://www.pgpool.net/pipermail/pgpool-general/2012-July/000774.html - If frontend terminates while reading large number of query results from backend, pgpool continues to read from backend and write to frontend until all query results consumued. (Tatsuo Ishii) This will take very long time if query results is huge. To finish pgpool session as soon as possible, modify pool_flush_it to returns error if fail to write to frontend when operated in other than replication mode. In replication mode, we need to keep the previous behavior to save consistency among backends). Also fix SimpleForwardToFrontend to return pool_write_and_flush error status. Before it was ignored. =============================================================================== 3.1 Series (2011/09/08 - ) =============================================================================== 3.1.20 (hatsuiboshi) 2016/08/31 * Version 3.1.20 This is a bugfix release against pgpool-II 3.1.19. __________________________________________________________________ * Bug fixes - Fix buffer over run problem in "show pool_nodes". (Tatsuo Ishii) While processing "show pool_nodes", the buffer for hostname was too short. It should be same size as the buffer used for pgpool.conf. Problem reported by a twitter user who is using pgpool on AWS (which could have very long hostname). - Fix usage of wait(2) in pgpool main process. (Tatsuo Ishii) The usage of wait(2) in pgpool main could cause infinite wait in the system call. Solution is, to use waitpid(2) instead of wait(2). - Fix "kind mismatch" error message in pgpool. (Muhammad Usama) Many of "kind mismatch..." errors are caused by notice/warning messages produced by one or more of the DB nodes. In this case now Pgpool-II forwards the messages to frontend, rather than throwing the "kind mismatch..." error. This would reduce the chance of "kind mismatch..." errors. See [pgpool-hackers: 1501] for more details. - Replace "MAJOR" macro to prevent occasional failure. (Tatsuo Ishii) The macro calls pool_virtual_master_db_node_id() and then access backend->slots[id]->con using the node id returned. In rare cases, it could point to 0 (in case when the DB node is not connected), which gives access to con->major, then it causes a segfault. See bug 225 for related info. - doc : fix Japanese document typo. (Bo Peng) - Fixing a typo in the log message. (Muhammad Usama) - doc : Add comment to the document about connection_cache. (Tatsuo Ishii) =============================================================================== 3.1.19 (hatsuiboshi) 2016/06/17 * Version 3.1.19 This is a bugfix release against pgpool-II 3.1.18. __________________________________________________________________ * Bug fixes - Fix is_set_transaction_serializable() when SET default_transaction_isolation TO 'serializable'. (Bo Peng) SET default_transaction_isolation TO 'serializable' is sent to not only primary but also to standby server in streaming replication mode, and this causes an error. Fix is, in streaming replication mode, SET default_transaction_isolation TO 'serializable' is sent only to the primary server. See bug 191 for related info. - Fix Chinese documetation bug about raw mode (Yugo Nagata, Bo Peng) Connection pool is avalilable in raw mode. - Fix confusing comments in pgpool.conf (Tatsuo Ishii) - Permit pgpool to support multiple SSL cipher protocols (Muhammad Usama) Currently TLSv1_method() is used to initialize the SSL context, that puts an unnecessary limitation to allow only TLSv1 protocol for SSL communication. While postgreSQL supports other ciphers protocols as well. The commit changes the above and initializes the SSLSession using the SSLv23_method() (same is also used by PostgreSQL). Because it can negotiate the use of the highest mutually supported protocol version and remove the limitation of one specific protocol version. - If statement timeout is enabled on backend and do_query() sends a (Tatsuo Ishii) query to primary node, and all of following user queries are sent to standby, it is possible that the next command, for example END, could cause a statement timeout error on the primary, and a kind mismatch error on pgpool-II is raised. This fix tries to mitigate the problem by sending sync message instead of flush message in do_query(), expecting that the sync message reset the statement timeout timer if we are in an explicit transaction. We cannot use this technique for implicit transaction case, because the sync message removes the unnamed portal if there's any. Plus, pg_stat_statement will no longer show the query issued by do_query() as "running". See bug 194 for related info. - Deal with the case when the primary is not node 0 in streaming replication mode. (Tatsuo Ishii) http://www.pgpool.net/mantisbt/view.php?id=194#c837 reported that if primary is not node 0, then statement timeout could occur even after bug194-3.3.diff was applied. After some investigation, it appeared that MASTER macro could return other than primary or load balance node, which was not supposed to happen, thus do_query() sends queries to wrong node (this is not clear from the report but I confirmed it in my investigation). pool_virtual_master_db_node_id(), which is called in MASTER macro returns query_context->virtual_master_node_id if query context exists. This could return wrong node if the variable has not been set yet. To fix this, the function is modified: if the variable is not either load balance node or primary node, the primary node id is returned. - change the Makefile under the directory src/sql/, that is proposed (Bo Peng) by [pgpool-hackers: 1611] - Fix a posible hang during health checking (Yugo Nagata) Helath checking was hang when any data wasn't sent from backend after connect(2) succeeded. To fix this, pool_check_fd() returns 1 when select(2) exits with EINTR due to SIGALRM while health checkking is performed. Reported and patch provided by harukat and some modification by Yugo. Per bug #204. backported from 3.4 or later; https://git.postgresql.org/gitweb/?p=pgpool2.git;a=commitdiff;h=ed9f2900f1b611f5cfd52e8f758c3616861e60c0 - Fix bug with load balance node id info on shmem (Tatsuo Ishii) There are few places where the load balance node was mistakenly put on wrong place. It should be placed on: ConnectionInfo *con_info[child id, connection pool_id, backend id].load_balancing_node]. In fact it was placed on: *con_info[child id, connection pool_id, 0].load_balancing_node]. As long as the backend id in question is 0, it is ok. However while testing pgpool-II 3.6's enhancement regarding failover, if primary node is 1 (which is the load balance node) and standby is 0, a client connecting to node 1 is disconnected when failover happens on node 0. This is unexpected and the bug was revealed. It seems the bug was there since long time ago but it had not found until today by the reason above. =============================================================================== 3.1.18 (hatsuiboshi) 2016/04/26 * Version 3.1.18 This is a bugfix release against pgpool-II 3.1.17. __________________________________________________________________ * Bug fixes - Removing the limit on the maximum number of items in the black_function_list and white_function_list lists. (Muhammad Usama) extract_string_tokens in pool_config uses the fixed size malloc on the array to hold the black_function_list/white_function_list items. This imposes a limit of maximum items in these lists. The fix is to use realloc to increase the array size when it gets full. - Redirect all user queries to primary server (Tatsuo Ishii) Up to now some user queries are sent to other than the primary server even if load_balance_mode = off. This commit changes the behavior: if load_balance_mode = off in streaming replication mode, now all the user queries are sent to the primary server only. Per bug #189. - Change the PID length of pcp_proc_count command result to 6 characters long (Bo Peng) If the pgpool process ID are over 5 characters, the 6th character of each process ID will be removed. This commit changes the process ID length of pcp_proc_count command result to 6 characters long. Per bug #188. =============================================================================== 3.1.17 (hatsuiboshi) 2016/04/04 * Version 3.1.17 This is a bugfix release against pgpool-II 3.1.16. __________________________________________________________________ * Bug fixes - doc: Change description of backend_flag (Tatsuo Ishii) It is pointed out that restarting pgpool-II is not necessary. Per [pgpool-general-jp: 1394]. - doc: Fix installation procedure. (Tatsuo Ishii) With PostgreSQL 9.4 or later, installing pgpool_regclass is not needed. - Fix to validate the PCP packet length (Muhammad Usama) Without the validation check, a malformed PCP packet can crash the PCP child and/or can run the server out of memory by sending the packet with a very large data size. - Fix a reset query stuck problem (Muhammad Usama) The solution is to return POOL_END_WITH_FRONTEND_ERROR instead of POOL_END when pool_flush on front-end socket fails. The original report is [pgpool-general: 4265] Pgpool - connection hangs in DISCARD ALL =============================================================================== 3.1.16 (hatsuiboshi) 2016/02/05 * Version 3.1.16 This is a bugfix release against pgpool-II 3.1.15. __________________________________________________________________ * Bug fixes - doc: Fix misinformation regarding load balancing in docs (Tatsuo Ishii) In streaming replication mode, DECLARE, FETCH, CLOSE and SHOW are sent to primary node only. Pointed out in [pgpool-general-jp: 1378]. - Issue fsync() when writing pgpool_status (Tatsuo Ishii) This ensures that pgpool_status is saved to permanent storage and allow to survive after system crash. - doc: Fix wrong description about log_standby_delay in the document (Yugo Nagata) - Fix bug with "SET TRANSACTION READ ONLY" (Tatsuo Ishii) Pgpool-II remembers that non read only queries (including SET) were executed in an explicit transaction and adds a "writing transaction" mark to the transaction. The mark affects the query routing behavior of pgpool-II while running in streaming replication mode. Pgpool-II starts sending queries to the primary after the mark is set. Because the effect of writing queries may appear on standbys after some delay in streaming replication mode, it is safer to route read queries to the primary after the mark is set. However there's oversight here. "SET TRANSACTION READ ONLY" does no data modification and should be treated as an exception. Per bug #157. - Fix FATAL error with reloading (Tatsuo Ishii) While reloading pgpool.conf, the number of DB nodes is tentatively set to 0, then counted up until reaching to the actual number of backends by the pgpool main process. Unfortunately the variable was on the shared memory and it confused pgpool child process when they were using the variable and this caused FATAL error. Per bug #156 report by harukat. - Ignore close statement/portal request if they do not exist (Tatsuo Ishii) In this case just returns a close complete message to client. This is a back port of the following commit from pgpool-II 3.4: 1a37e1c35bd8b6f10f524693bbcb7b51f73b4bf0 =============================================================================== 3.1.15 (hatsuiboshi) 2015/07/24 * Version 3.1.15 This is a bugfix release against pgpool-II 3.1.14. __________________________________________________________________ * Bug fixes - Fix "cannot find xlog functions" error in pgpool-recovery (Muhammad Usama) The argument data type of PostgreSQL's pg_xlogfile_name() function has been changed from text to pg_lsn since PostgreSQL 9.4. And pgpool-recovery was still trying to locate the function by old signature. - Do not send a query for checking insert lock in non replication mode with extended query (Tatsuo Ishii) =============================================================================== 3.1.14 (hatsuiboshi) 2015/04/08 * Version 3.1.14 This is a bugfix release against pgpool-II 3.1.13. __________________________________________________________________ * Bug fixes - Enlarge POOLCONFIG_MAXDESCLEN to 80 (Tatsuo Ishii) This is used in show pool_status command and limits the length of parameter description. Unfortunately recovery_timeout description is 64 chars, which is 1 byte longer than former definition of the macro. - Support SSL certificate chains in the certificate file for incoming frontend connections (Muhammad Usama) - Fix a problem with pcp_detach_node about graceful node detach (Muhammad Usama) When graceful node detach is requested gracefully, pcp_detach_node should check if it is allowed to process detach_node command on the particular node before blocking the incoming connections and closing the existing connections. =============================================================================== 3.1.13 (hatsuiboshi) 2015/02/05 * Version 3.1.13 This is a bugfix release against pgpool-II 3.1.12. __________________________________________________________________ * Bug fixes - doc: Describe explicitly that the number of slave nodes is not necessarily 1 (Tatsuo Ishii) - Fix uninitialized variable (Tatsuo Ishii) Per Coverity 1234603. - doc: Fix missing release note entries in the previous release (Tatsuo Ishii) - Fix node id range check bug in trigger_failover_command(). (Tatsuo Ishii) The node id should be lower than NUM_BACKENDS. Probably harmless since callers never pass node ids greater or equal to NUM_BACKENDS. - Fix to disable debug mode by reloading config (Yugo Nagata) Per bug #114 http://www.pgpool.net/mantisbt/view.php?id=114 =============================================================================== 3.1.12 (hatsuiboshi) 2014/09/05 * Version 3.1.12 This is a bugfix release against pgpool-II 3.1.11. __________________________________________________________________ * Bug fixes - Fix a typo of pgpool.spec (Yugo Nagata) - Fix bug that worker child process keeps failing when there's no primary backend (Tatsuo Ishii) Problem identified and fix contributed by Junegunn Choi. See [pgpool-hackers: 471] for more details. - Close listen socket when smart shutdown request is made (Tatsuo Ishii) When smart shutdown process starts, pgpool children still listen on the port and clients can send further connection requests which fail in the end. Which is not only waste of time, but also prevents a load balancer which sits in front of pgpool from realizing the pgpool is going down. Problem analyzed and patch provided by Junegunn Choi in [pgpool-hackers 474], and enhanced to take care not only inet domain socket but UNIX domain socket by Tatsuo Ishii. - doc: Add cautions that recovery commands are killed by statement_timeout of PostgreSQL. (Tatsuo Ishii) - doc: Remove old restriction description which is no longer true (Tatsuo Ishii) - Fix return type of text_to_lsn() function (Yugo Nagata) This caused compile warning. - Fix file descriptor leak when daemonize. (Tatsuo Ishii) Per Coverity 1111471. - Fix memory leak. (Tatsuo Ishii) Per Coverity 1111442. - Fix pgpool.init's long-standing bug of stop/restart failure (Yugo Nagata) In previous, pgpool.init uses killproc for stopping pgpool, but there are several problems. In the new version, "pgpool -m fast stop" is used in stop command. Original patch contributed by Ryan DeShone and modified by Yugo Nagata. See [pgpool-hackers: 239][pgpool-hackers: 512]. - Disbale statement_timeout of PostgreSQL while executing online recovery (Tatsuo Ishii) Online recovery may take very long time and user may enable statement timeout. To prevent online recovery canceled by statement timeout, disable statement timeout in the connection used by online recovery. See [pgpool-general: 2919] for more details. - Remove unnecessary call to pool_shmem_exit() which removes semaphore when it shouldn't (Tatsuo Ishii) exit_handler checks if the process is parent or not. This is good. However, even if it is a child process, it calls pool_shmem_exit() which removes semaphore and shmem when it should not. It should be called only from parent process. Per bug #102. http://www.pgpool.net/mantisbt/view.php?id=102 - Fix reset query stuck problem. (Tatsuo Ishii) It is reported that reset query (DISCARD ALL etc.) occasionally does not finish and pgpool child remain waiting for reply from backend thus client cannot connect to pgpool. The cause of problem is not identified yet but if client suddenly closes connection to pgpool in the middle of query processing, backend may not accept the reset queries because they are not ready for query. The fix is, if frontend closes connection in unexpected way, query process loop immediately returns with new state: POOL_END_WITH_FRONTEND_ERROR and pgpool closes connection to PostgreSQL then goes back to new connection request waiting loop. Also, pgpool closes connections to backend when client_idle_limit is set and the idle limit. Per bug #107. http://www.pgpool.net/mantisbt/view.php?id=107 =============================================================================== 3.1.11 (hatsuiboshi) 2014/03/24 * Version 3.1.11 This is a bugfix release against pgpool-II 3.1.10. __________________________________________________________________ * Bug fixes - doc: Add mention about "listen queue" and how to increase the "backlog" in the num_init_children section. (Tatsuo Ishii) - Fix bad performance of unlogged tables detection code. (Tatsuo Ishii) Pointed out at [pgpool-hackers: 435][[pgpool-general:2325]. - Fix primary node detection logic. (Tatsuo Ishii) There's a possibility that primary node is not detected. This happens in following situation. node 0: primary, node 1: standby. Node 0 goes down. Health checking detects the fact but local status is not updated yet. Primary node finding (find_primary_node) runs. Node 0's status is yet healthy. Because find_primary_node fails to connect to node 0, it immediately returns -1 and fails to find that fact that node 1 is now primary. Fix is just continuing to look for primary node when fails to connect to a node. Per [pgpool-general: 2409]. - Fix jdbc DML fails when operated in raw mode and auto commit is off. (Tatsuo Ishii) This is reported in bug #92. - Avoid to send queries to unrelated nodes in streaming replication mode. (Tatsuo Ishii) Pgpool-II sends certain queries, such as BEGIN, END and SET commands to all of DB nodes. However in streaming replication mode, only primary node and at most one standby node are only concerned (if primacy node is selected as the load balance node, only 1 node is concerned). See [pgpool-hackers: 464] for more details. - Fix possible buffer overrun problem and memory leak. (Tatsuo Ishii) Per Coverity 1111465 and 1111482. - Fix possible buffer overrun. (Tatsuo Ishii) Replace strcpy() with strlcpy(). Per Coverity report 1111478, 1111480, 1111481. - Fix freeing NULL. (Tatsuo Ishii) Per Coverity 1111384. - Fix memory leak. (Tatsuo Ishii) Per Coverity 1111446. - Fix a segmentation fault in parallel mode with system_db_hostname is empty (Yugo Nagata) - Fix to output debug messages in processing pgpool.conf with -d option (Yugo Nagata) Previously, some debug messages in pool_get_config() ware not output even when -d option was used. - Fix JDBC exception of prepared statement including now() in replication mode (Yugo Nagata) With JDBC, when a prepared statement is executed more than PrepareThreshold times, the statement is named and Describe message is sent after Parse. With named statement, pgpool rewrite now() to parameter in replication mode. Hence, rewritten query has additonal parameter than original. In this case, ParameterDescription message sent to frontend (response of Describe) should include OIDs of the same number os original query's parameters. Otherwize, JDBC throws ArrayIndexoutOfBoundsException. This is reported in [pgpool-general-jp: 1192]. - Fix backend error of prepared statement about table which has column whoes default value is now() in replication mode (Yugo Nagata) When pgpool parses a named prepared statement with default now(), timestamps are replaced to additional parameters. So, Bind message also should inclued additional parameter format codes. However, when the number of original parameter was one, pgpool didn't handle this. This caused a error like "incorrect binary data format in bind parameter 2". - doc: Add description about parallel mode doesn't support PREPARE (Yugo Nagata) Per bug #93 =============================================================================== 3.1.10 (hatsuiboshi) 2013/12/06 * Version 3.1.10 This is a bugfix release against pgpool-II 3.1.9. __________________________________________________________________ * Bug fixes - Fix incorrect time stamp rewriting in replication mode for certain time zones. (Tatsuo Ishii) Time stamp rewriting calls "SELECT now()" to get current time. Unfortunately the buffer for the current time is too small for certain time zones such as "02:30". Note that non-30-minutes-time-zone such as "0900" does not reveal the problem. This explains why we haven't the bug report until today. Bug reported in [pgpool-general: 2113] and fix provided by Sean Hogan. http://www.sraoss.jp/pipermail/pgpool-general/2013-September/002142.html - Makefile: Replace pg_config by $(PG_CONFIG) in Makefiles so it can be overridden at build time when compiling for different PG major versions. (Tatsuo Ishii) Patch contributed by Christoph Berg ([pgpool-general: 2127]). http://www.sraoss.jp/pipermail/pgpool-general/2013-September/002156.html - configure: Remove -lcompat because it confuses FreeBSD per bug#15. (Tatsuo Ishii) http://www.pgpool.net/mantisbt/view.php?id=15 - Fix segfault when pgpool.conf does not set log_standby_delay. (Tatsuo Ishii) This is caused by wrong initialization for log_standby_delay in pool_config.l. Per bug#74. http://www.pgpool.net/mantisbt/view.php?id=74 - doc: Modify descriptions about restrictions of parallel mode Muliple rows INSERT using VALUES are not supported in parallel mode. (Yugo Nagata) - Avoid calling find_primary_node_repeatedly() when standby node goes down. (Tatsuo Ishii) This will reduce the time to failover. Per bug #75, patch modified by Tatsuo Ishii. http://www.pgpool.net/mantisbt/view.php?id=75 - Fix data inconsistency problem with native replication mode + extended protocol case. (Tatsuo Ishii) It is reported that concurrent INSERT using JDBC driver causes data difference among database node. This only happens following conditions are all met: 1) Native replication mode 2) Extended protocol used 3) The portal created by parse message is reused by bind message 4) autocommit is on 5) SERIAL (sequence) is used Pgpool-II's parse message function knows it has to lock the target table when INSERT (plus #5) is issued by clients. Unfortunately bind message function did not know it. Once parse/bind/execute finishes, pgpool releases the lock obtained by parse because of #4. JDBC wants to reuse the portal and starts the cycle from bind message, which does not obtain lock. As as result, lock-free INSERT are floating around which causes data inconsistency of course. The solution is, lock the table in bind phase. For this bind needs to issue LOCK in extended protocol. This was a little bit hard because the module (do_command()) to issue internal SQL command (other than SELECT) does not support extended protocol. To solve the problem do_query() is modified so that it accepts other than SELECT because it already accepts extended protocol. The modification is minimum and is only tested for the case called from insert_lock(). I do not recommend to replace every occurrence of do_command () with do_query() at this point. BTW the reason why the bug is not reported is, most users uses JDBC with auto commit = off. In this case, the lock obtained by parse persists until user explicitly issues commit or rollback. Per bug report by Steve Kuekes in [pgpool-general: 2142]. http://www.sraoss.jp/pipermail/pgpool-general/2013-September/002171.html - Fix error message in read_password_packet(). (Tatsuo Ishii) - Fix memory leak when do_query() fails in timestamp rewriting. (Tatsuo Ishii) For this purpose free_select_result() is changed to accept NULL argument. Per Coverity report "1111454, 1111455 Resource leak". - Fix target node selection logic when "DEALLOCATE portal|statement". (Tatsuo Ishii) When "DEALLOCATE portal|statement" is used and last prepared statement or portal was not found, target node selection map is not set. Probably this is not actually harmful because prepared statement or portal was not found is an error case. The bug was there since day 0. Per Coverity report "1111491 Structurally dead code". - Fix range check bug of MAX_NUM_BACKENDS in corner case. (Tatsuo Ishii) MAX_NUM_BACKENDS is the allowed max number of DB nodes (128, at this point). In reality, probably no one ever tried more than 128 DB nodes and that's the reason why nobody noticed. Per Coverity report "1111429, 1111430 and 1111431 Out-of-bounds write". - Fix that the script forgets to allow public access to pgpool_catalog. (Tatsuo Ishii) The bug prevents inserting data into user tables if pgpool_catalog is created in native replication mode. The bug was there from day 1. I wonder why nobody noticed until today. Per [pgpool-general-jp: 1229]. http://www.sraoss.jp/pipermail/pgpool-general-jp/2013-November/001228.html - Fix uninitialized variable in error case in pool_do_auth(). (Tatsuo Ishii) If there's no valid backend, pgpool will return garbage pid to frontend in auth phase. Actually because no backend is available, frontend will be disconnected later on. So this is not harmless. Per Coverity report "1127331 Uninitialized scalar variable". - Fix to add node id range check when issue an error message using node id. (Tatsuo Ishii) Per Coverity report #1111433 "Out-of-bounds read". - Fix buffer overrun bug and resource leak bug of parse_copy_data(). (Tatsuo Ishii) Per Coverity report 1111427 "Out-of-bounds write" and 1111453 "Resource leak". - Fix possible segfault in CopyDataRaws(). (Tatsuo Ishii) Coverity pointed out that if pool_get_id() returns an error, VALID_BACKEND will access out of array. Per Coverity report 1111413 "Memory - illegal accesses". - Fix resource leak in make_persistent_db_connection. (Tatsio Ishii) For this pupose, new static function free_persisten_db_connection_memory is added. Per Coverity report #1111468. =============================================================================== 3.1.9 (hatsuiboshi) 2013/09/06 * Version 3.1.9 This is a bugfix release against pgpool-II 3.1.8. __________________________________________________________________ * Bug fixes - Fix a mistake in ssh command of doc/basebackup.sh (Tatsuo Ishii) - Fix a bug in parsing prepared statements with transaction handling in replication mode (Tatsuo Ishii) Parse() automatically starts a transaction for non SELECT query to keep consistency among nodes in replication mode. But this wasn't closed. If wrong query comes in, the transaction goes into an abort state but pgpool does not close the transaction. Thus next query causes error because the transaction is still in abort status. This problem was reported in [pgpool-general: 1877] by Sean Hogan. [pgpool-general: 1877] current transaction is aborted, commands ignored http://www.sraoss.jp/pipermail/pgpool-general/2013-July/001905.html - Fix typos of the japanese document (Yugo Nagata) =============================================================================== 3.1.8 (hatsuiboshi) 2013/07/10 * Version 3.1.8 This is a bugfix release against pgpool-II 3.1.7. __________________________________________________________________ * Bug fixes - Add mention about "-D" option to the man page. (Tatsuo Ishii) - Consider timeout waiting for compeletion of failback request in on line recovery (Tatsuo Ishii) This will prevent the situation that recovery operation continues forever and we cannot even shutdown pgpool-II main process. This could happen especially while executing follow master command. - Fix a bug that %H of follow_master_command is not assigned correctly the new primary node in stream replication mode (Tatsuo Ishii) - Fix do_query() to not hang when PostgreSQL returns an error (Tatsuo Ishii) The typical symptom is "I see SELECT is keep on running according to pg_stat_activity". To fix this pgpool-II just exits the process and kill the existig connection. This is not gentle but at this point I believe this is the best solution. - Fix bug with do_query which causes hung in extended protocol (Tatsuo Ishii) This problem could occur when insert lock is enabled and pgpool_catalog.insert_lock exists, See [pgpool-general: 1684] for more details. [pgpool-general: 1684] insert_lock hangs http://www.sraoss.jp/pipermail/pgpool-general/2013-May/001711.html - Fix unnecessary degeneration caused by error on commit (Tatsuo Ishii) In master slave mode, if master gets an error at commit, while other slaves are normal at commit, we don't need to degenrate any backend because it is likely that the "kind mismatch error" was caused by a deferred trigger. - Fix to register pgpool_regclass in pg_catalog schema (Tatsuo Ishii) This is necessary to deal with clients which restricts schema search path to pg_catalog only. Postgres_fdw is such a client. - Fix a potential crash in pg_md5 command (Muhammad Usama) - Fix a segmentation fault of a child process that occurs when a startup packet has no PostgreSQL user information (Yugo Nagata) You can reproduce it by $ psql -p 9999 -U '' If enable_pool_hba is on, a child process terminates by segmentation fault. Otherwise if enable_pool_hba is off, the error message is ERROR: pool_discard_cp: cannot get connection pool for user (null) database (null) In both cases, psql terminates with no message on frontend. In the fixed version, if PostgreSQL user is not specified in startup packet, the message as following is output to both log and frontend. This is the same behavior as PostgreSQL. FATAL: no PostgreSQL user name specified in startup packet - Move ssl_ca_cert and ssl_ca_cert_dir descriptions to the SSL section (Yugo Nagata) - Add ssl_ca_cert and ssl_ca_cert_dir descriptions to the japanese document (Yugo Nagata) - Fix to verify the backend node number in pcp_recovery_node (Yugo Nagata) When an invalid number is used, null value is passed as an arguments of recovery script, and this causes a malfunction. In especially, rsync may delete unrelated files in basebackup scripts. =============================================================================== 3.1.7 (hatsuiboshi) 2013/4/26 * Version 3.1.7 This is a bugfix release against pgpool-II 3.1.6 __________________________________________________________________ * Bug fixes - Fix to show pool_passwd in "SHOW pool_status". (Yugo Nagata) - Fix long standing bug with timestamp rewriting code for processing extended protocol. (Tatsuo Ishii) Parse() allocate memory using palloc() while rewriting the parse message. Problem is, the rewritten message was kept in the data which is managed by pool_create_sent_message() etc. The function assumes that all the data is in session context memory. However, palloc() allocates memory in query context of course, and gets freeed later on when the query context disappears. And the function tries to free the memory as well, which causes various problems, including segfault and double free. To fix this, memory to store rewritten message is allocated using session context. The bug was there since pgpool-II 3.0 was born. Problem analysis and patch contributed by Naoya Anzai. [pgpoolgenera-jp: 1146]. (in Japanese) http://www.pgpool.net/pipermail/pgpool-general-jp/2013-March/001145.html - Fix bug with md5 auth long user name handling. (Tatsuo Ishii) If user name is longer than 32 bytes, md5 authentication doesn't work. Problem reported in [pgpool-general: 1526] by Thomas Martin. [pgpool-general: 1526] [pgPool-II 3.2.3] MD5 authentication and username longer than 32 characters. http://www.pgpool.net/pipermail/pgpool-general/2013-March/001551.html - Fix to calculate replication delay only if standby server is behind from the primay server. (Yugo Nagata) When the primary server is behind from standby server, negative value of delay is calculated and the value is assigned to unsigned variable. It causes a log message informing negative replication delay. And what is worse, it also causes SELECT queries to be sent to the primary in load balance even though there are no replication delay in fact. The problem is reported and analyzed by Saitoh Hidenori in [pgpool-genera-jp: 1145]. [pgpool-general-jp: 1145] (in Japanese) http://www.pgpool.net/pipermail/pgpool-general-jp/2013-March/001144.html - pgpool-recovery adopts PostgreSQL 9.3. (Tatsuo Ishii) Patch contributed by Asif Rehman. Slight editing by Tatsuo Ishii. [pgpool-hackers: 180] compile error in ppool-recovery http://www.pgpool.net/pipermail/pgpool-hackers/2013-April/000179.html - Fix pool_has_pgpool_regclass() to check execute privilege of pgpool_regclass(). (Tatsuo Ishii) Even though pgpool_regclass() exists, if pgpool cannot execute the function, the connection to backend hangs. You can reproduce the problem by just dropping the execute privilege from pgpool_regclass and do some insert in native replication mode. The problem is reported in bugtrack #53. #53 pgpool_regclas hangs all connections Date: 2013-04-04 13:35 Reporter: tmandke http://www.pgpool.net/mantisbt/view.php?id=53 - Fix error message mistakes in detect_postmaster_down_error(). (Tatsuo Ishii) For example, "LOG: detect_stop_postmaster_error: detect_error error" is fixed to "LOG: detect_postmaster_down_error: detect_error error", and so on. =============================================================================== 3.1.6 (hatsuiboshi) 2013/2/8 * Version 3.1.6 This is a bugfix release against pgpool-II 3.1.5 __________________________________________________________________ * Bug fixes - Fix race condition when using md5 authentication. (Tatsuo Ishii) The file descriptor to pool_passwd is opened in pgpool main and pgpool child inherits it. When concurrent connections try to authenticate md5 method, they call pool_get_passwd and seek the fd and cause random md5 auth failure because underlying fd is shared. Fix is, let individual pgpool child open the file by calling pool_reopen_passwd_file. Problem reported and analyzed by Jason Slagle in pgpool-general:1141. [pgpool-general: 1141] Possible race condition in pool_get_passwd From: Jason Slagle Date: Sun, 28 Oct 2012 01:12:52 -0400 http://www.sraoss.jp/pipermail/pgpool-general/2012-October/001160.html - Fix hung up while repeating pcp_attach_node and pcp_detatch_node (Tatsuo Ishii) When node status is changed by pcp_attach_node and pcp_detatch_node, failover() sends SIGUSR1 to pcp_child process expecting it exits to refresh node status. In this situation lots of pgpool children exit and produce SIGCHLD as well. The SIGCHLD handler reaper() tries catch all SIGCHLD but sometimes it fails depending on the system load and timing. If SIGCHLD produced by pcp child is not caught, the process becomes zombie and never restarted. This problem is reported in bug track #32 (by oleg_myrk) etc. #32 PGPool hangs on pcp_attach/detach Reporter: oleg_myrk $B!!(BDate: 2012-10-24 00:01 http://www.pgpool.net/mantisbt/view.php?id=32 - Fix pool_send_severity_message() not to use uninitialized memory. (Tatsuo Ishii) It cause a segmentaion fault. Reported in Bug #33's attached valgrind output by dudee. #33 pgpool-II 3.2.1 segfault Reporter: dudee Date: 2012-10-30 19:16 http://www.pgpool.net/mantisbt/view.php?id=33 - Add a description about "-f" to help message. (Tatsuo Ishii) - Fix reaper() not to exit wait3() loop when catches pcp or worker child exit event. (Tatsuo Ishii) Otherwise reaper() mistakenly ignore some process exit event and make a risk of creating zombie process and forgetting to create new process. Problem reported and fix suggested by Goto in [pgpool-general-jp: 1123]. http://www.sraoss.jp/pipermail/pgpool-general-jp/2012-November/001122.html (in Japanese) - Fix pool_search_relcache() to use MASTER or MASTER_NODE_ID macro, rather than REAL_MASTER_NODE_ID. (Tatsuo Ishii) In case node 0 fail back in streaming replication mode, pgpool does not restart child process. So REAL_MASTER_NODE_ID looks for node 0 con info, which is not present until new connection to backend made. Thus referring to node con info results in segfault. MASTER or MASTER_NODE_ID are safe in this situation because they look at cached former master node id. - Fix long standing bug "portal not found" error when replication delay is too much in streaming replication mode. (Tatsuo Ishii) The bug had been there since the delay threshold was introduced. We changed destination DB node if delay threshold exceeds in bind, describe and execute. However, if parse sends to different node, bind, describe or execute will fail because no parsed statement or portal exists. Solution is, not to send to different parse node even if delay threshold is too much. - Fix pg_md5 to output "\n" after user inputs password. (Yugo Nagata) - Fix child_exit() to not call send_frontend_exits() if there's no connection pool. (Tatsuo Ishii) Otherwise, it segfaults because send_frontend_exits() referes to objects pointed to by pool_connection_pool. Per bug track #44 by tuomas. #44 pgpool went haywire after slave shutdown triggering master failover Reporter: tuomas Date: 2012-12-11 00:33 http://www.pgpool.net/mantisbt/view.php?id=4 - Fix read_startup_packet() to reset alarm and free StartupPacket when pool_read() returns 0 which means incorrect packet length. (Nozomi Anzai) Previously, authentication timeout occurs when connected by a program monitoring the pgpool port.It is reported in bug track #35 by tuomas. #35 Authentication is timeout Reporter: tuomas Date: 2012-11-20 11:54 http://www.pgpool.net/mantisbt/view.php?id=3 - Fix long standing bug with pool_open(). (Tatsuo Ishii) It initializes wrong buffer pointer. Actually this is harmless because the pointer is initialized by prior memset() call, though. - Modify documents to correct information of whether a certain parameter change requires restart. (Yugo Nagata) - Add pool_passwd option to pgpool.conf.sample*, and documents. (Yugo Nagata) =============================================================================== 3.1.5 (hatsuiboshi) 2012/10/12 * Version 3.1.5 This is a bugfix release against pgpool-II 3.1.4 __________________________________________________________________ * Bug fixes - Fix read_startup_packet. (Tatsuo Ishii) If packet length is lower than 0, it should have returned immediately. Otherwise it would cause memory allocation error later on. per pgpool-general:886. Also add canceling alarm. - Add NOTICE message handling to s_do_auth. (Tatsuo Ishii) Without this, health check responses false alarm and causes failover. per bug track: http://www.pgpool.net/mantisbt/view.php?id=25 Also allow to receive ready for query packet *not* right after backend keydata. I'm not sure if this could happen in the real world but the protocol seems to allow this. - Remove unnecessary/confusing debug log from s_do_auth.(Tatsuo Ishii) - Fix inifinit loop in SSL mode. When there's pending data in SSL layer of frontend, pool_process_query() checks pending data in backend. (Tatsuo Ishii) If there's non, it loops again and checks frontend/backend receive buffer by using is_cache_empty(). Unfortunately it first checks pending data in SSL layer of frontend, thus goes to backend data and checks again (infinite loop). The solution is, if there's pending data in SSL layer of frontend and query is not in progress, call ProcessFrontendResponse() to process new request from frontend. - Fix is_system_catalog to use pgpool_regclass if available. (Tatsuo Ishii) - Fix memory leak in pool_get_insert_table_name(). (Tatsuo Ishii) If session context's memory contex is used for nodeToString(), memory is not freed until session ends. - Fix possible memory leak in nodeToString(). (Tatsuo Ishii) Since the memory context could be session context, memory used for String object may be considerable if user session continues for hours or days. See bug track #24 for more details. - Fix long standing problem with do_query(). (Tatsuo Ishii) When 1) extended protocol used and 2)unnamed portal is used and 3) no explicit transaction is used, user's unnamed portal is removed by Sync message. This is because Sync message closes transaction and unnamed portal is removed. This leads to "portal "" does not exist" error. Fix is, use "Flush" message instead of Sync. Main difference between using Sync and Flush is, Flush does not return Ready for Query message. So do_query() does not return until all expected responses are returned. It seems the order of messages returned from backend is random, and do_query () manages it by using state bits. =============================================================================== 3.1.4 (hatsuiboshi) 2012/08/06 * Version 3.1.4 This is a bugfix release against pgpool-II 3.1.3. __________________________________________________________________ * General - Adopt PostgreSQL 9.2. (Tatsuo Ishii) __________________________________________________________________ * Bug fixes - Fix pool_send_and_wait() to send or not to send COMMIT / ABORT depending on the transaction state on each node. (Tatsuo Ishii) It is possible that only primary is in an explicit transaction but standby is not in it if multi statement query has been sent. Per bug report [pgpool-general-jp: 1049]. - Fix load balance in Solaris. (Tatsuo Ishii) Problem is, random() in using random() in Solaris results in strange load balancing calculation. Use srand()/rand() instead although they produce lesser quality random Problem reported at [pgpool-general: 396]. [pgpool-general: 396] strange load balancing issue in Solaris http://www.pgpool.net/pipermail/pgpool-general/2012-April/000397.html - Add params to the result of "SHOW pool_status": backend_data_directory, ssl_ca_cert, ssl_ca_cert_dir. (Nozomi Anzai) - Fix segfault of pcp_systemdb_info not in parallel mode. (Nozomi Anzai) - Fix "unnamed prepared statment does not exist" error. (Tatsuo Ishii) This is caused by pgpool's internal query, which breaks client's unnamed statements. To fix this, if extended query is used, named statement/portal for internal are used for internal query. - Fix is_system_catalog(). Its relcach was accidently defined as "session local". (Tatsuo Ishii) - Fix hangup when query conflict occurs in Hot-Standby mode. (Yugo Nagata) Query example to reproduce: (S1) BEGIN; (S1) SELECT * FROM t; (S2) DELETE FROM t; (S2) VACUUM t; - Improve reading and writing pid_file. (Tatsuo Ishii) - Fix pool_process_query() bug reported in [pgpool-general: 672]. (Tatsuo Ishii) This is caused by the function waits for primary node which does not have pending data, while standbys have pending data. [pgpool-general: 672] Transaction never finishes http://www.pgpool.net/pipermail/pgpool-general/2012-June/000676.html - Fix wait_for_query_response() not to send param status to frontend if frontend is NULL. (Tatsuo Ishii) This could happen while processing reset_query_list and occur crash. - Fix bug with treatment of BEGIN TRANSACTION in master/slave mode. (Tatsuo Ishii) Original complain is [pgpool-general: 714]. From 3.1, pgpool-II sends BEGIN.. to all DB nodes. Of course we cannot send BEGIN TRANSACTION READ WRITE to standby nodes. Problem is, we did not check BEGIN WORK ISOLATION LEVEL SERIALIZABLE; and sent to standby nodes. Of course this is wrong, since it's not allowed to run transactions in serializable mode on standby nodes. So added check for BEGIN WORK ISOLATION LEVEL SERIALIZABLE case. [pgpool-general: 714] Load Balancing / Streaming Replication / Isolation Level serializable http://www.pgpool.net/pipermail/pgpool-general/2012-July/000719.html - Fix send_to_where() to send the query to only primary if the it is like SET TRANSACTION ISOLATION LEVELSERIALIZABLE etc. (Tatsuo Ishii) Case in streaming replication mode. Previously, it was sent to not only primary but also to standby and of course this causes an error. Similar SQLs are: SET SESSION CHARACTERISTICS AS TRANSACTION ISOLATION LEVEL SERIALIZABLE or SET transaction_isolation TO 'serializable' SET default_transaction_isolation TO 'serializable' Original complain is [pgpool-general: 715]. [pgpool-general: 715] Re: Load Balancing / Streaming Replication / Isolation Level serializable http://www.pgpool.net/pipermail/pgpool-general/2012-July/000720.html =============================================================================== 3.1.3 (hatsuiboshi) 2012/04/23 * Version 3.1.3 This is a bugfix release against pgpool-II 3.1.2. __________________________________________________________________ * Bug fixes - Add m4 files. This should prevent compiling problem on older OS's. (Tatsuo Ishii) - Fix to handle failover properly in detect_postmaster_down_error(). (Tatsuo Ishii) It is possible that it fails to read backend socket after detecting backend errors and before actually detaching the backend. - Fix bug that the process exits before unlocking semaphore by a signal interrupt. (Tatsuo Ishii) - Fix a memory leak in case of reset_query. (Tatsuo Ishii) - Fix pool_ssl_read() to deal with large data reading. (Tatsuo Ishii) Original complain is here: http://www.pgpool.net/pipermail/pgpool-general/2012-March/000299.html - Fix deadlock by enabling log_destination = syslog. (Tatsuo Ishii) Reported in bug tracker http://www.pgpool.net/mantisbt/view.php?id=9. Patch provided by Gilles Darold. - Allow to use multi statement in master/slave mode. (Tatsuo Ishii) From 3.1 transactional statements such as "BEGIN" are sent to not only primary but also standbys. This brings an unfortunate side effect: if the multi statement is "BEGIN;DELETE FROM table;END", this will be sent to standy as well and cause an error because standby does notallow write SQL. So fix is, if a query is a multi statement one, then send it to primary only. - Allow to have private cache of master node id. (Tatsuo Ishii) When master goes down running pgpool children look into NULL pointer because the process does not connect to the new master yet. The private cache returns the old master node id and will avoid the situation. Per bug reported in http://www.pgpool.net/mantisbt/view.php?id=51 - Fix pool_start_query() so that it uses my_master_node_id instead of REAL_MASTER_NODE_ID for initial virtual_master_node_id. (Tatsuo Ishii) Real master node could be changed while pgpool is running in streaming replication mode. Previously it is assigned REAL_MASTER_NODE_ID, which could have no connections after fail over and cause segafult. - Fix pool_setall_node_to_be_sent() to use private_backend_status instead of BACKEND_INFO macro. (Tatsuo Ishii) It is possible that while processing, the node returned by BACKEND_INFO is not usable any more. - Fix failover(). (Tatsuo Ishii) Before it only restarts worker child only when pgpool child do not need restart. This is wrong. We need to restart worker child in any case. Otherwise it continues to send replication time lag check request to down the node. - Fix debug log message so that it does not contain null characters. (Toshihiro Kitagawa) - Fix SimpleQuery() so that it restores parser memory context when: 1) Builtin show commands are used 2) Parallel query mode 3) Query cache is used (Tatsuo Ishii) - Fix hangup when PREPARE statement causes error. (Toshihiro Kitagawa) This issue was reported by Tomonari Katsumata: Subject: [pgpool-general: 121] question of pgpool's behavior - Add doc/pgpool-fr.html to Makefile.am. (Tatsuo Ishii) This had been forgotten when the doc was added. - Fix hangup during md5 authentication that occurs in daemon mode and log_destination is 'syslog'. (Yugo Nagata) Reported in bug tracker http://www.pgpool.net/mantisbt/view.php?id=2. =============================================================================== 3.1.2 (hatsuiboshi) 2012/01/31 * Version 3.1.2 This is a bugfix release against pgpool-II 3.1.1. __________________________________________________________________ * Bug fixes - Fix to recognize READ UNCOMMITTED and REPEATABLE READ of transaction isolation levels. (Tatsuo Ishii) - Fix infinite loop reported in this thread (Tatsuo Ishii): http://www.pgpool.net/pipermail/pgpool-general/2011-December/000099.html It was not considered the case that, when received buffer in primary was empty but the one in a standby was not, the standby spontaneously sent packet to pgpool. This could happen when, for example, reloading postgresql.conf. The fix is that such buffer in standby is discarded. =============================================================================== 3.1.1 (hatsuiboshi) 2011/12/06 * Version 3.1.1 This is a bugfix release against pgpool-II 3.1. __________________________________________________________________ * Bug fixes - Fix add_regex_pattern(). It does not allocate enough memory for each black/white_function_list items. The function adds "^" and "$" to each function items which do not contain those characters. Unfortunately the function forgot to add extra 2 bytes for those characters. This may lead to memory corruption errors when pgpool starting up. - Fix error message of check_replication_time_lag(Tatsuo Ishii). It emitted wrong error message when it failed to connect to PostgreSQL while checking streaming replication delay. Because it does not use health_check_user anymore. - Fix memory leak(Toshihiro Kitagawa). This is essentially same as the fix made for 3.0.5(commit 19a4ea9215da0b61728741fc0da2271958b09238). - Major cleanup for strncpy(Tatsuo Ishii). There are several places where strncpy() is used. Problem is some of them do not consider the case when copy lengh == buffer size. In this case copied buffer is not null terminated and may cause tons of problems later. To fix this, most of them are replaced by strlcpy(). - Update cached backend status whenever possible(Tatsuo Ishii). This solves the problem of follow_master_command not being able to lookup backend status correctly which was reported by Jeff Frost: Subject: [Pgpool-general] diagnosing BackendError from pcp_recovery_node To: pgpool-general@pgfoundry.org Date: Wed, 05 Oct 2011 15:15:07 -0700 - Fix buffer overrun problem when pcp password is longer than 32(Tatsuo Ishii). - Remove PGDLLIMPORTI which is only neccessary for Windows and cause a problem for non gcc. Patch contributed by Ibrar Ahmed. =============================================================================== 3.1 (hatsuiboshi) 2011/09/08 * Version 3.1 This is the first version of pgpool-II 3.1 series. That is, a "major version up" from 3.0 series. __________________________________________________________________ * Incompatible changes - Change the lock method of insert_lock. The previous insert_lock uses row locking against the sequence relation, but the current one uses row locking against pgpool_catalog.insert_lock table. The reason is that PostgreSQL core developers decided to disallow row locking against the sequence relation to avoid an internal error which it leads. So creating insert_lock table in all databases which are accessed via pgpool-II beforehand is required. If does not exist insert_lock table, pgpool-II locks the insert target table. This behavior is same as pgpool-II 2.2 and 2.3 series. If you want to use insert_lock which is compatible with older releases, you can specify lock method by configure options: --enable-sequence-lock, --enable-table-lock(Toshihiro Kitagawa) - Deprecate backend_socket_dir. Instead, if backend_hostname starts with '/' it is regarded the as path to Unix domain. If backend_hostname is left empty, then default Unix domain path(/tmp) is used. This follows the convention of libpq interface. Patch contributed by Jehan-Guillaume (ioguix) de Rorthais. - Now "pgpool_walrecrunning()" was not used. pgpool-II used to consider the node that is promoted a primary node using the function. Now, pgpool-II waits for completing of the promotion to primary node because it did not work as we intended. But we still have a problem that pgpool-II waits while recovery_timeout, when there is no primary node(Toshihiro Kitagawa) - Add node_id to each PostgreSQL DB node info in the output of show pool_nodes(Jean-Paul Argudo) - Change the handling of sequence functions(nextval, setval) so that they completely obey setting of black/white_function_list. They were always handled as write functions before(Toshihiro Kitagawa) __________________________________________________________________ * New features - Add syslog support. Patch contributed by Gilles Darold. Review and editing by Guillaume Lelarge. - Adapt application_name introduced in PostgreSQL 9.0. When reusing connection, send application_name in the startup packet to backend and send parameter status to frontend(Tatsuo Ishii) - Add relcache_expire directive to control the expiration of the internal system catalog cache. ALTER TABLE might make these cache values obsoleted and the new directive will make the risk lower(Tatsuo Ishii). - Add follow_master_command directive. This directive specifies a command to run in master/slave streaming replication only after a master failover. Patch contributed by Gilles Darold. - Add pcp_promote_node command. This command promotes a new master node to pgpool-II. This can use in master/slave streaming replication only. Patch contributed by Gilles Darold. - Add pcp_pool_status command which produces similar output of show pool_status. Also C API for this command is added. Patch contributed by Jehan-Guillaume (ioguix) de Rorthais. - Add new per backend directive "backend_flag". This controls per backend behavior. Currently "ALLOW_TO_FAILOVER" or "DISALLOW_TO_FAILOVER" are allowed(Tatsuo Ishii) - Add health_check_password directive, but is not yet implemented (Nicolas Thauvin) - Add sr_check_period, sr_check_user and sr_check_password directives. These are used for streaming replication delay checking and determining primary node(Tatsuo Ishii) - Add --username(or -u) option to pg_md5 command. This allows to manage users which do not have UNIX accounts. Japanese document change by Tatsuo Ishii(Nicolas Thauvin) - Add pgpool_adm functions to pgpool_adm/. These are user-defined functions written in C language which work like pcp commands (Jehan-Guillaume (ioguix) de Rorthais) - Add Simplified Chinese version of documents(Huang Jian, Sun Peng) - Add SQL files to uninstall functions to sql/(Nicolas Thauvin) - In master/slave mode, SELECTs to unlogged table execute only on master/primary(Toshihiro Kitagawa) __________________________________________________________________ * Bug fixes - Fix bug which cannot use the cursors of JDBC driver on standby node. The transaction commands come to be sent to all nodes by this fix in master/slave mode(Toshihiro Kitagawa) - Fix bug with the handling of empty queries. The empty queries come to be handled the same as SELECT queries. This fix allows load-balance after the empty query(Toshihiro Kitagawa) - Fix insert_lock so that it works correctly even if the column definition such as "DEFAULT nextval(('"x_seq"'::text)::regclass)" (Toshihiro Kitagawa) - Fix pcp_attach_node command so that it emits error message while doing failover(Toshihiro Kitagawa) - Fix log message which is emitted when pgpool-II cannot parse the query in the extended query protocol so that it shows the query (Toshihiro Kitagawa) - Fix description about backend_weight inpgpool-II manual. It can be changed by reloading pgpool.conf(Tatsuo Ishii) - Fix and enhance wording in English tutorial document. Fix suggested by Huang Jian(Tatsuo Ishii) - Fix bug which does not update the node status when reattaching the node in raw mode(Guillaume Lelarge) - Fix incorrect calculation of the replication delay in streaming replication mode(Tatsuo Ishii) - Replace wrong function name "notice_backend_error" with correct one "degenerate_backend_set" in the failover log message(Tatsuo Ishii) - Remove unnecessary logging at the end of pgpool.conf parsing(Tatsuo Ishii) - Fix possible crash of pgpool/worker child after attaching new backend. Fix suggested by Gurjeet Singh(Tatsuo Ishii) - Fix bug that SELECTs which have subquery with FOR SHARE/UPDATE clause are sent to slave/standby(Tatsuo Ishii) - Fix bug which rewriting timestamp of default value fails in PREPARE statements. This used to work but was broken in 3.0(Toshihiro Kitagawa) - Fix fail to compile pcp commands on the environment without getopt_long()(Tatsuo Ishii) - Fix crash of pgpool child when frontend connects if in raw mode, enable_hba is off and more than 2 backends(Toshihiro Kitagawa) - Fix some memory leaks(Toshihiro Kitagawa) __________________________________________________________________ * Enhancements - Enhance online recovery in streaming replication mode. Now restarting pgpool-II children is avoided when recovery finished. So existing sessions can be continued while doing online recovery(Tatsuo Ishii) - pcp_attach_node does not diconnect existing sessions in streaming replication mode. In other mode, pcp_attache_node still disconnects existing sessions(Tatsuo Ishii). - Import PostgreSQL 9.0 parser. This allows to use CREATE INDEX with implicit index name, which is new in 9.0. Patch contributed by Akio Ishida. - Allow to use regular expressions in black and white function list. Patch contributed by Gilles Darold. Patch reviewed by Guillaume Lelarge. - Reorganize pgpool.conf sample files so that they are easier to read (Guillaume Lelarge) - Add tags into all parameters in the pgpool-II user manual(Haruka Takatsuka) - Enhance online recovery documents in streaming replication(Tatsuo Ishii) - Change the function to check the replication delay in streaming replication mode. Currently, pgpool uses pg_last_xlog_replay_location() instead of pg_last_xlog_receive_location(). Fix suggested by Anton Yuzhaninov (Tatsuo Ishii) - Allow time stamp rewriting to work with arbitrary expression in default value of a column. Before we detected anything including now() then simply replaced it to now(). This will lead to wrong rewriting of default value. for example, timezone('utc'::text, now()). Note that, however, this only adopts to simple queries. Extended protocols(for example Java, PHP PDO) or SQL "PREPARE" still remain same(Tatsuo Ishii) - Enhance the error message which is emitted when failed to check replication delay(Nicolas Thauvin) - Change error message "do_md5: read_password_packet failed" into debug level(Toshihiro Kitagawa) - Allow to compile pgpool-regclass() against PostgreSQL 9.1(Tatsuo Ishii) - Update and sync pgpool-II manuals of English version and Japanese version(Tatsuo Ishii) =============================================================================== 3.0 Series (2013/07/30 - ) =============================================================================== 3.0.20 (umiyameboshi) 2016/02/05 * Version 3.0.20 This is a bugfix release against pgpool-II 3.0.19. This is the final release of the series. pgpool-II 3.0 has reached End of Life, and is no longer maintained and does not receive any updates. __________________________________________________________________ * Bug fixes - doc: Fix misinformation regarding load balancing in docs (Tatsuo Ishii) In streaming replication mode, DECLARE, FETCH, CLOSE and SHOW are sent to primary node only. Pointed out in [pgpool-general-jp: 1378]. - Issue fsync() when writing pgpool_status (Tatsuo Ishii) This ensures that pgpool_status is saved to permanent storage and allow to survive after system crash. - doc: Fix wrong description about log_standby_delay in the document (Yugo Nagata) - Fix bug with "SET TRANSACTION READ ONLY" (Tatsuo Ishii) Pgpool-II remembers that non read only queries (including SET) were executed in an explicit transaction and adds a "writing transaction" mark to the transaction. The mark affects the query routing behavior of pgpool-II while running in streaming replication mode. Pgpool-II starts sending queries to the primary after the mark is set. Because the effect of writing queries may appear on standbys after some delay in streaming replication mode, it is safer to route read queries to the primary after the mark is set. However there's oversight here. "SET TRANSACTION READ ONLY" does no data modification and should be treated as an exception. Per bug #157. - Fix FATAL error with reloading (Tatsuo Ishii) While reloading pgpool.conf, the number of DB nodes is tentatively set to 0, then counted up until reaching to the actual number of backends by the pgpool main process. Unfortunately the variable was on the shared memory and it confused pgpool child process when they were using the variable and this caused FATAL error. Per bug #156 report by harukat. - Ignore close statement/portal request if they do not exist (Tatsuo Ishii) In this case just returns a close complete message to client. This is a back port of the following commit from pgpool-II 3.4: 1a37e1c35bd8b6f10f524693bbcb7b51f73b4bf0 =============================================================================== 3.0.19 (umiyameboshi) 2015/07/24 * Version 3.0.19 This is a bugfix release against pgpool-II 3.0.18. __________________________________________________________________ * Bug fixes - Fix "cannot find xlog functions" error in pgpool-recovery (Muhammad Usama) The argument data type of PostgreSQL's pg_xlogfile_name() function has been changed from text to pg_lsn since PostgreSQL 9.4. And pgpool-recovery was still trying to locate the function by old signature. - Do not send a query for checking insert lock in non replication mode with extended query (Tatsuo Ishii) =============================================================================== 3.0.18 (umiyameboshi) 2015/04/08 * Version 3.0.18 This is a bugfix release against pgpool-II 3.0.17. __________________________________________________________________ * Bug fixes - Enlarge POOLCONFIG_MAXDESCLEN to 80 (Tatsuo Ishii) This is used in show pool_status command and limits the length of parameter description. Unfortunately recovery_timeout description is 64 chars, which is 1 byte longer than former definition of the macro. - Support SSL certificate chains in the certificate file for incoming frontend connections (Muhammad Usama) - Fix a problem with pcp_detach_node about graceful node detach (Muhammad Usama) When graceful node detach is requested gracefully, pcp_detach_node should check if it is allowed to process detach_node command on the particular node before blocking the incoming connections and closing the existing connections. =============================================================================== 3.0.17 (umiyameboshi) 2015/02/05 * Version 3.0.17 This is a bugfix release against pgpool-II 3.0.16. __________________________________________________________________ * Bug fixes - doc: Describe explicitly that the number of slave nodes is not necessarily 1 (Tatsuo Ishii) - Fix uninitialized variable (Tatsuo Ishii) Per Coverity 1234603. - doc: Fix missing release note entries in the previous release (Tatsuo Ishii) - Fix node id range check bug in trigger_failover_command(). (Tatsuo Ishii) The node id should be lower than NUM_BACKENDS. Probably harmless since callers never pass node ids greater or equal to NUM_BACKENDS. - Fix to disable debug mode by reloading config (Yugo Nagata) Per bug #114 http://www.pgpool.net/mantisbt/view.php?id=114 =============================================================================== 3.0.16 (umiyameboshi) 2014/09/05 * Version 3.0.16 This is a bugfix release against pgpool-II 3.0.15. __________________________________________________________________ * Bug fixes - Fix a typo of pgpool.spec (Yugo Nagata) - Fix bug that worker child process keeps failing when there's no primary backend (Tatsuo Ishii) Problem identified and fix contributed by Junegunn Choi. See [pgpool-hackers: 471] for more details. - Close listen socket when smart shutdown request is made (Tatsuo Ishii) When smart shutdown process starts, pgpool children still listen on the port and clients can send further connection requests which fail in the end. Which is not only waste of time, but also prevents a load balancer which sits in front of pgpool from realizing the pgpool is going down. Problem analyzed and patch provided by Junegunn Choi in [pgpool-hackers 474], and enhanced to take care not only inet domain socket but UNIX domain socket by Tatsuo Ishii. - doc: Add cautions that recovery commands are killed by statement_timeout of PostgreSQL. (Tatsuo Ishii) - doc: Remove old restriction description which is no longer true (Tatsuo Ishii) - Fix return type of text_to_lsn() function (Yugo Nagata) This caused compile warning. - Fix file descriptor leak when daemonize. (Tatsuo Ishii) Per Coverity 1111471. - Fix memory leak. (Tatsuo Ishii) Per Coverity 1111442. - Fix pgpool.init's long-standing bug of stop/restart failure (Yugo Nagata) In previous, pgpool.init uses killproc for stopping pgpool, but there are several problems. In the new version, "pgpool -m fast stop" is used in stop command. Original patch contributed by Ryan DeShone and modified by Yugo Nagata. See [pgpool-hackers: 239][pgpool-hackers: 512]. - Disbale statement_timeout of PostgreSQL while executing online recovery (Tatsuo Ishii) Online recovery may take very long time and user may enable statement timeout. To prevent online recovery canceled by statement timeout, disable statement timeout in the connection used by online recovery. See [pgpool-general: 2919] for more details. - Remove unnecessary call to pool_shmem_exit() which removes semaphore when it shouldn't (Tatsuo Ishii) exit_handler checks if the process is parent or not. This is good. However, even if it is a child process, it calls pool_shmem_exit() which removes semaphore and shmem when it should not. It should be called only from parent process. Per bug #102. http://www.pgpool.net/mantisbt/view.php?id=102 =============================================================================== 3.0.15 (umiyameboshi) 2014/03/24 * Version 3.0.15 This is a bugfix release against pgpool-II 3.0.14. __________________________________________________________________ * Bug fixes - doc: Add mention about "listen queue" and how to increase the "backlog" in the num_init_children section. (Tatsuo Ishii) - Fix bad performance of unlogged tables detection code. (Tatsuo Ishii) Pointed out at [pgpool-hackers: 435][[pgpool-general:2325]. - Fix primary node detection logic. (Tatsuo Ishii) There's a possibility that primary node is not detected. This happens in following situation. node 0: primary, node 1: standby. Node 0 goes down. Health checking detects the fact but local status is not updated yet. Primary node finding (find_primary_node) runs. Node 0's status is yet healthy. Because find_primary_node fails to connect to node 0, it immediately returns -1 and fails to find that fact that node 1 is now primary. Fix is just continuing to look for primary node when fails to connect to a node. Per [pgpool-general: 2409]. - Fix jdbc DML fails when operated in raw mode and auto commit is off. (Tatsuo Ishii) This is reported in bug #92. - Avoid to send queries to unrelated nodes in streaming replication mode. (Tatsuo Ishii) Pgpool-II sends certain queries, such as BEGIN, END and SET commands to all of DB nodes. However in streaming replication mode, only primary node and at most one standby node are only concerned (if primacy node is selected as the load balance node, only 1 node is concerned). See [pgpool-hackers: 464] for more details. - Fix possible buffer overrun problem and memory leak. (Tatsuo Ishii) Per Coverity 1111465 and 1111482. - Fix freeing NULL. (Tatsuo Ishii) Per Coverity 1111384. - Fix memory leak. (Tatsuo Ishii) Per Coverity 1111446. - Fix a segmentation fault in parallel mode with system_db_hostname is empty (Yugo Nagata) - Fix to output debug messages in processing pgpool.conf with -d option (Yugo Nagata) Previously, some debug messages in pool_get_config() ware not output even when -d option was used. - Fix JDBC exception of prepared statement including now() in replication mode (Yugo Nagata) With JDBC, when a prepared statement is executed more than PrepareThreshold times, the statement is named and Describe message is sent after Parse. With named statement, pgpool rewrite now() to parameter in replication mode. Hence, rewritten query has additonal parameter than original. In this case, ParameterDescription message sent to frontend (response of Describe) should include OIDs of the same number os original query's parameters. Otherwize, JDBC throws ArrayIndexoutOfBoundsException. This is reported in [pgpool-general-jp: 1192]. - Fix backend error of prepared statement about table which has column whoes default value is now() in replication mode (Yugo Nagata) When pgpool parses a named prepared statement with default now(), timestamps are replaced to additional parameters. So, Bind message also should inclued additional parameter format codes. However, when the number of original parameter was one, pgpool didn't handle this. This caused a error like "incorrect binary data format in bind parameter 2". - doc: Add description about parallel mode doesn't support PREPARE (Yugo Nagata) Per bug #93 =============================================================================== 3.0.14 (umiyameboshi) 2013/12/06 * Version 3.0.14 This is a bugfix release against pgpool-II 3.0.13. __________________________________________________________________ * Bug fixes - Fix incorrect time stamp rewriting in replication mode for certain time zones. (Tatsuo Ishii) Time stamp rewriting calls "SELECT now()" to get current time. Unfortunately the buffer for the current time is too small for certain time zones such as "02:30". Note that non-30-minutes-time-zone such as "0900" does not reveal the problem. This explains why we haven't the bug report until today. Bug reported in [pgpool-general: 2113] and fix provided by Sean Hogan. http://www.sraoss.jp/pipermail/pgpool-general/2013-September/002142.html - Makefile: Replace pg_config by $(PG_CONFIG) in Makefiles so it can be overridden at build time when compiling for different PG major versions. (Tatsuo Ishii) Patch contributed by Christoph Berg ([pgpool-general: 2127]). http://www.sraoss.jp/pipermail/pgpool-general/2013-September/002156.html - configure: Remove -lcompat because it confuses FreeBSD per bug#15. (Tatsuo Ishii) http://www.pgpool.net/mantisbt/view.php?id=15 - Fix segfault when pgpool.conf does not set log_standby_delay. (Tatsuo Ishii) This is caused by wrong initialization for log_standby_delay in pool_config.l. Per bug#74. http://www.pgpool.net/mantisbt/view.php?id=74 - doc: Modify descriptions about restrictions of parallel mode Muliple rows INSERT using VALUES are not supported in parallel mode. (Yugo Nagata) - Avoid calling find_primary_node_repeatedly() when standby node goes down. (Tatsuo Ishii) This will reduce the time to failover. Per bug #75, patch modified by Tatsuo Ishii. http://www.pgpool.net/mantisbt/view.php?id=75 - Fix error message in read_password_packet(). (Tatsuo Ishii) - Fix memory leak when do_query() fails in timestamp rewriting. (Tatsuo Ishii) For this purpose free_select_result() is changed to accept NULL argument. Per Coverity report "1111454, 1111455 Resource leak". - Fix target node selection logic when "DEALLOCATE portal|statement". (Tatsuo Ishii) When "DEALLOCATE portal|statement" is used and last prepared statement or portal was not found, target node selection map is not set. Probably this is not actually harmful because prepared statement or portal was not found is an error case. The bug was there since day 0. Per Coverity report "1111491 Structurally dead code". - Fix range check bug of MAX_NUM_BACKENDS in corner case. (Tatsuo Ishii) MAX_NUM_BACKENDS is the allowed max number of DB nodes (128, at this point). In reality, probably no one ever tried more than 128 DB nodes and that's the reason why nobody noticed. Per Coverity report "1111429, 1111430 and 1111431 Out-of-bounds write". - Fix that the script forgets to allow public access to pgpool_catalog. (Tatsuo Ishii) The bug prevents inserting data into user tables if pgpool_catalog is created in native replication mode. The bug was there from day 1. I wonder why nobody noticed until today. Per [pgpool-general-jp: 1229]. http://www.sraoss.jp/pipermail/pgpool-general-jp/2013-November/001228.html - Fix uninitialized variable in error case in pool_do_auth(). (Tatsuo Ishii) If there's no valid backend, pgpool will return garbage pid to frontend in auth phase. Actually because no backend is available, frontend will be disconnected later on. So this is not harmless. Per Coverity report "1127331 Uninitialized scalar variable". - Fix to add node id range check when issue an error message using node id. (Tatsuo Ishii) Per Coverity report #1111433 "Out-of-bounds read". - Fix buffer overrun bug and resource leak bug of parse_copy_data(). (Tatsuo Ishii) Per Coverity report 1111427 "Out-of-bounds write" and 1111453 "Resource leak". - Fix possible segfault in CopyDataRaws(). (Tatsuo Ishii) Coverity pointed out that if pool_get_id() returns an error, VALID_BACKEND will access out of array. Per Coverity report 1111413 "Memory - illegal accesses". - Fix strftime() usage in pool_pools(). (Tatsuo Ishii) The buffer is not large enough as expected by the second parameter. This is not harmless because the format string will not produce longer result string than the buffer. Per Coverity report 1111426 "Out-of-bounds access". - Fix resource leak in make_persistent_db_connection. (Tatsio Ishii) For this pupose, new static function free_persisten_db_connection_memory is added. Per Coverity report #1111468. =============================================================================== 3.0.13 (umiyameboshi) 2013/09/06 * Version 3.0.13 This is a bugfix release against pgpool-II 3.0.12. __________________________________________________________________ * Bug fixes - Fix a mistake in ssh command of doc/basebackup.sh (Tatsuo Ishii) - Fix a bug in parsing prepared statements with transaction handling in replication mode (Tatsuo Ishii) Parse() automatically starts a transaction for non SELECT query to keep consistency among nodes in replication mode. But this wasn't closed. If wrong query comes in, the transaction goes into an abort state but pgpool does not close the transaction. Thus next query causes error because the transaction is still in abort status. This problem was reported in [pgpool-general: 1877] by Sean Hogan. [pgpool-general: 1877] current transaction is aborted, commands ignored http://www.sraoss.jp/pipermail/pgpool-general/2013-July/001905.html - Fix typos of the japanese document (Yugo Nagata) =============================================================================== 3.0.12 (umiyameboshi) 2013/07/10 * Version 3.0.12 This is a bugfix release against pgpool-II 3.0.11. __________________________________________________________________ * Bug fixes - Add mention about "-D" option to the man page. (Tatsuo Ishii) - Consider timeout waiting for compeletion of failback request in on line recovery (Tatsuo Ishii) This will prevent the situation that recovery operation continues forever and we cannot even shutdown pgpool-II main process. This could happen especially while executing follow master command. - Fix do_query() to not hang when PostgreSQL returns an error (Tatsuo Ishii) The typical symptom is "I see SELECT is keep on running according to pg_stat_activity". To fix this pgpool-II just exits the process and kill the existig connection. This is not gentle but at this point I believe this is the best solution. - Fix bug with do_query which causes hung in extended protocol (Tatsuo Ishii) This problem could occur when insert lock is enabled and pgpool_catalog.insert_lock exists, See [pgpool-general: 1684] for more details. [pgpool-general: 1684] insert_lock hangs http://www.sraoss.jp/pipermail/pgpool-general/2013-May/001711.html - Fix unnecessary degeneration caused by error on commit (Tatsuo Ishii) In master slave mode, if master gets an error at commit, while other slaves are normal at commit, we don't need to degenrate any backend because it is likely that the "kind mismatch error" was caused by a deferred trigger. - Fix to register pgpool_regclass in pg_catalog schema (Tatsuo Ishii) This is necessary to deal with clients which restricts schema search path to pg_catalog only. Postgres_fdw is such a client. - Fix a potential crash in pg_md5 command (Muhammad Usama) - Fix a segmentation fault of a child process that occurs when a startup packet has no PostgreSQL user information (Yugo Nagata) You can reproduce it by $ psql -p 9999 -U '' If enable_pool_hba is on, a child process terminates by segmentation fault. Otherwise if enable_pool_hba is off, the error message is ERROR: pool_discard_cp: cannot get connection pool for user (null) database (null) In both cases, psql terminates with no message on frontend. In the fixed version, if PostgreSQL user is not specified in startup packet, the message as following is output to both log and frontend. This is the same behavior as PostgreSQL. FATAL: no PostgreSQL user name specified in startup packet - Move ssl_ca_cert and ssl_ca_cert_dir descriptions to the SSL section (Yugo Nagata) - Add ssl_ca_cert and ssl_ca_cert_dir descriptions to the japanese document (Yugo Nagata) - Fix to verify the backend node number in pcp_recovery_node (Yugo Nagata) When an invalid number is used, null value is passed as an arguments of recovery script, and this causes a malfunction. In especially, rsync may delete unrelated files in basebackup scripts. - Fix reset query stuck problem. (Tatsuo Ishii) It is reported that reset query (DISCARD ALL etc.) occasionally does not finish and pgpool child remain waiting for reply from backend thus client cannot connect to pgpool. The cause of problem is not identified yet but if client suddenly closes connection to pgpool in the middle of query processing, backend may not accept the reset queries because they are not ready for query. The fix is, if frontend closes connection in unexpected way, query process loop immediately returns with new state: POOL_END_WITH_FRONTEND_ERROR and pgpool closes connection to PostgreSQL then goes back to new connection request waiting loop. Also, pgpool closes connections to backend when client_idle_limit is set and the idle limit. Per bug #107. http://www.pgpool.net/mantisbt/view.php?id=107 =============================================================================== 3.0.11 (umiyameboshi) 2013/04/26 * Version 3.0.11 This is a bugfix release against pgpool-II 3.0.10. __________________________________________________________________ * Buf fixes - Fix to show pool_passwd in "SHOW pool_status". (Yugo Nagata) - Fix long standing bug with timestamp rewriting code for processing extended protocol. (Tatsuo Ishii) Parse() allocate memory using palloc() while rewriting the parse message. Problem is, the rewritten message was kept in the data which is managed by pool_create_sent_message() etc. The function assumes that all the data is in session context memory. However, palloc() allocates memory in query context of course, and gets freeed later on when the query context disappears. And the function tries to free the memory as well, which causes various problems, including segfault and double free. To fix this, memory to store rewritten message is allocated using session context. The bug was there since pgpool-II 3.0 was born. Problem analysis and patch contributed by Naoya Anzai. [pgpoolgenera-jp: 1146]. (in Japanese) http://www.pgpool.net/pipermail/pgpool-general-jp/2013-March/001145.html - Fix bug with md5 auth long user name handling. (Tatsuo Ishii) If user name is longer than 32 bytes, md5 authentication doesn't work. Problem reported in [pgpool-general: 1526] by Thomas Martin. [pgpool-general: 1526] [pgPool-II 3.2.3] MD5 authentication and username longer than 32 characters. http://www.pgpool.net/pipermail/pgpool-general/2013-March/001551.html - Fix to calculate replication delay only if standby server is behind from the primay server. (Yugo Nagata) When the primary server is behind from standby server, negative value of delay is calculated and the value is assigned to unsigned variable. It causes a log message informing negative replication delay. And what is worse, it also causes SELECT queries to be sent to the primary in load balance even though there are no replication delay in fact. The problem is reported and analyzed by Saitoh Hidenori in [pgpool-genera-jp: 1145]. [pgpool-general-jp: 1145] (in Japanese) http://www.pgpool.net/pipermail/pgpool-general-jp/2013-March/001144.html - pgpool-recovery adopts PostgreSQL 9.3. (Tatsuo Ishii) Patch contributed by Asif Rehman. Slight editing by Tatsuo Ishii. [pgpool-hackers: 180] compile error in ppool-recovery http://www.pgpool.net/pipermail/pgpool-hackers/2013-April/000179.html - Fix pool_has_pgpool_regclass() to check execute privilege of pgpool_regclass(). (Tatsuo Ishii) Even though pgpool_regclass() exists, if pgpool cannot execute the function, the connection to backend hangs. You can reproduce the problem by just dropping the execute privilege from pgpool_regclass and do some insert in native replication mode. The problem is reported in bugtrack #53. #53 pgpool_regclas hangs all connections Date: 2013-04-04 13:35 Reporter: tmandke http://www.pgpool.net/mantisbt/view.php?id=53 - Fix error message mistakes in detect_postmaster_down_error(). (Tatsuo Ishii) For example, "LOG: detect_stop_postmaster_error: detect_error error" is fixed to "LOG: detect_postmaster_down_error: detect_error error", and so on. =============================================================================== 3.0.10 (umiyameboshi) 2013/02/08 * Version 3.0.10 This is a bugfix release against pgpool-II 3.0.9. __________________________________________________________________ * General - Fix race condition when using md5 authentication. (Tatsuo Ishii) The file descriptor to pool_passwd is opened in pgpool main and pgpool child inherits it. When concurrent connections try to authenticate md5 method, they call pool_get_passwd and seek the fd and cause random md5 auth failure because underlying fd is shared. Fix is, let individual pgpool child open the file by calling pool_reopen_passwd_file. Problem reported and analyzed by Jason Slagle in pgpool-general:1141. [pgpool-general: 1141] Possible race condition in pool_get_passwd From: Jason Slagle Date: Sun, 28 Oct 2012 01:12:52 -0400 http://www.sraoss.jp/pipermail/pgpool-general/2012-October/001160.html - Fix pool_send_severity_message() not to use uninitialized memory. (Tatsuo Ishii) It cause a segmentaion fault. Reported in Bug #33's attached valgrind output by dudee. #33 pgpool-II 3.2.1 segfault Reporter: dudee Date: 2012-10-30 19:16 http://www.pgpool.net/mantisbt/view.php?id=33 - Fix reaper() not to exit wait3() loop when catches pcp or worker child exit event. (Tatsuo Ishii) Otherwise reaper() mistakenly ignore some process exit event and make a risk of creating zombie process and forgetting to create new process. Problem reported and fix suggested by Goto in [pgpool-general-jp: 1123]. http://www.sraoss.jp/pipermail/pgpool-general-jp/2012-November/001122.html (in Japanese) - Fix pool_search_relcache() to use MASTER or MASTER_NODE_ID macro, rather than REAL_MASTER_NODE_ID. (Tatsuo Ishii) In case node 0 fail back in streaming replication mode, pgpool does not restart child process. So REAL_MASTER_NODE_ID looks for node 0 con info, which is not present until new connection to backend made. Thus referring to node con info results in segfault. MASTER or MASTER_NODE_ID are safe in this situation because they look at cached former master node id. - Fix long standing bug "portal not found" error when replication delay is too much in streaming replication mode. (Tatsuo Ishii) The bug had been there since the delay threshold was introduced. We changed destination DB node if delay threshold exceeds in bind, describe and execute. However, if parse sends to different node, bind, describe or execute will fail because no parsed statement or portal exists. Solution is, not to send to different parse node even if delay threshold is too much. - Fix pg_md5 to output "\n" after user inputs password. (Yugo Nagata) - Fix child_exit() to not call send_frontend_exits() if there's no connection pool. (Tatsuo Ishii) Otherwise, it segfaults because send_frontend_exits() referes to objects pointed to by pool_connection_pool. Per bug track #44 by tuomas. #44 pgpool went haywire after slave shutdown triggering master failover Reporter: tuomas Date: 2012-12-11 00:33 http://www.pgpool.net/mantisbt/view.php?id=44 - Fix read_startup_packet() to reset alarm and free StartupPacket when pool_read() returns 0 which means incorrect packet length. (Nozomi Anzai) Previously, authentication timeout occurs when connected by a program monitoring the pgpool port.It is reported in bug track #35 by tuomas. #35 Authentication is timeout Reporter: tuomas Date: 2012-11-20 11:54 http://www.pgpool.net/mantisbt/view.php?id=35 - Fix long standing bug with pool_open(). (Tatsuo Ishii) It initializes wrong buffer pointer. Actually this is harmless because the pointer is initialized by prior memset() call, though. - Add a description about "-f" to help message. (Tatsuo Ishii) - Modify documents to correct information of whether a certain parameter change requires restart. (Yugo Nagata) - Add pool_passwd option to pgpool.conf.sample*, and documents. (Yugo Nagata) =============================================================================== 3.0.9 (umiyameboshi) 2012/10/12 * Version 3.0.9 This is a bugfix release against pgpool-II 3.0.8. __________________________________________________________________ * General - Fix read_startup_packet. (Tatsuo Ishii) If packet length is lower than 0, it should have returned immediately. Otherwise it would cause memory allocation error later on. per pgpool-general:886. Also add canceling alarm. - Add NOTICE message handling to s_do_auth. (Tatsuo Ishii) Without this, health check responses false alarm and causes failover. per bug track: http://www.pgpool.net/mantisbt/view.php?id=25 Also allow to receive ready for query packet *not* right after backend keydata. I'm not sure if this could happen in the real world but the protocol seems to allow this. - Remove unnecessary/confusing debug log from s_do_auth.(Tatsuo Ishii) - Fix inifinit loop in SSL mode. When there's pending data in SSL layer of frontend, pool_process_query() checks pending data in backend. (Tatsuo Ishii) If there's non, it loops again and checks frontend/backend receive buffer by using is_cache_empty(). Unfortunately it first checks pending data in SSL layer of frontend, thus goes to backend data and checks again (infinite loop). The solution is, if there's pending data in SSL layer of frontend and query is not in progress, call ProcessFrontendResponse() to process new request from frontend. - Fix is_system_catalog to use pgpool_regclass if available. (Tatsuo Ishii) - Fix memory leak in pool_get_insert_table_name(). (Tatsuo Ishii) If session context's memory contex is used for nodeToString(), memory is not freed until session ends. - Fix possible memory leak in nodeToString(). (Tatsuo Ishii) Since the memory context could be session context, memory used for String object may be considerable if user session continues for hours or days. See bug track #24 for more details. - Fix long standing problem with do_query(). (Tatsuo Ishii) When 1) extended protocol used and 2)unnamed portal is used and 3) no explicit transaction is used, user's unnamed portal is removed by Sync message. This is because Sync message closes transaction and unnamed portal is removed. This leads to "portal "" does not exist" error. Fix is, use "Flush" message instead of Sync. Main difference between using Sync and Flush is, Flush does not return Ready for Query message. So do_query() does not return until all expected responses are returned. It seems the order of messages returned from backend is random, and do_query () manages it by using state bits. =============================================================================== 3.0.8 (umiyameboshi) 2012/08/06 * Version 3.0.8 This is a bugfix release against pgpool-II 3.0.7. __________________________________________________________________ * General - Adopt PostgreSQL 9.2. (Tatsuo Ishii) __________________________________________________________________ * Bug fixes - Fix load balance in Solaris. (Tatsuo Ishii) Problem is, random() in using random() in Solaris results in strange load balancing calculation. Use srand()/rand() instead although they produce lesser quality random Problem reported at [pgpool-general: 396]. [pgpool-general: 396] strange load balancing issue in Solaris http://www.pgpool.net/pipermail/pgpool-general/2012-April/000397.html - Fix segfault of pcp_systemdb_info not in parallel mode. (Nozomi Anzai) - Fix "unnamed prepared statment does not exist" error. (Tatsuo Ishii) This is caused by pgpool's internal query, which breaks client's unnamed statements. To fix this, if extended query is used, named statement/portal for internal are used for internal query. - Fix is_system_catalog(). Its relcach was accidently defined as "session local". (Tatsuo Ishii) - Improve reading and writing pid_file. (Tatsuo Ishii) - Fix pool_process_query() bug reported in [pgpool-general: 672]. (Tatsuo Ishii) This is caused by the function waits for primary node which does not have pending data, while standbys have pending data. [pgpool-general: 672] Transaction never finishes http://www.pgpool.net/pipermail/pgpool-general/2012-June/000676.html - Fix wait_for_query_response() not to send param status to frontend if frontend is NULL. (Tatsuo Ishii) This could happen while processing reset_query_list and occur crash. =============================================================================== 3.0.7 (umiyameboshi) 2012/04/23 * Version 3.0.7 This is a bugfix release against pgpool-II 3.0.6. __________________________________________________________________ * Bug fixes - Add m4 files. This should prevent compiling problem on older OS's. (Tatsuo Ishii) - Fix bug that the process exits before unlocking semaphore by a signal interrupt. (Tatsuo Ishii) - Fix a memory leak in case of reset_query. (Tatsuo Ishii) - Fix SimpleQuery() so that it restores parser memory context when: 1) Builtin show commands are used 2) Parallel query mode 3) Query cache is used (Tatsuo Ishii) - Fix pool_ssl_read() to deal with large data reading. (Tatsuo Ishii) Original complain is here: http://www.pgpool.net/pipermail/pgpool-general/2012-March/000299.html - Fix hangup when PREPARE statement causes error. (Toshihiro Kitagawa) This issue was reported by Tomonari Katsumata: Subject: [pgpool-general: 121] question of pgpool's behavior =============================================================================== 3.0.6 (umiyameboshi) 2012/01/31 * Version 3.0.6 This version fixes various bugs since 3.0.5. __________________________________________________________________ * Bug fixes - Fix infinite loop reported in this thread (Tatsuo Ishii): http://www.pgpool.net/pipermail/pgpool-general/2011-December/000099.html It was not considered the case that, when received buffer in primary was empty but the one in a standby was not, the standby spontaneously sent packet to pgpool. This could happen when, for example, reloading postgresql.conf. The fix is that such buffer in standby is discarded. =============================================================================== 3.0.5 (umiyameboshi) 2011/10/31 * Version 3.0.5 This version fixes various bugs since 3.0.4. __________________________________________________________________ * Bug fixes - Fix bug with the handling of empty queries. The empty queries come to be handled the same as SELECT queries. This fix allows load-balance after the empty query(Toshihiro Kitagawa) - Fix insert_lock so that it works correctly even if the column definition such as "DEFAULT nextval(('"x_seq"'::text)::regclass)" (Toshihiro Kitagawa) - Fix log message which is emitted when pgpool-II cannot parse the query in the extended query protocol so that it shows the query (Toshihiro Kitagawa) - Fix description about backend_weight inpgpool-II manual. It can be changed by reloading pgpool.conf(Tatsuo Ishii) - Fix bug which does not update the node status when reattaching the node in raw mode(Guillaume Lelarge) - Fix bug that SELECTs which have subquery with FOR SHARE/UPDATE clause are sent to slave/standby(Tatsuo Ishii) - Fix bug which rewriting timestamp of default value fails in PREPARE statements. This used to work but was broken in 3.0(Toshihiro Kitagawa) - Fix crash of pgpool child when frontend connects if in raw mode, enable_hba is off and more than 2 backends(Toshihiro Kitagawa) - Fix some memory leaks(Toshihiro Kitagawa) __________________________________________________________________ * Enhancements - Allow time stamp rewriting to work with arbitrary expression in default value of a column. Before we detected anything including now() then simply replaced it to now(). This will lead to wrong rewriting of default value. for example, timezone('utc'::text, now()). Note that, however, this only adopts to simple queries. Extended protocols(for example Java, PHP PDO) or SQL "PREPARE" still remain same(Tatsuo Ishii) - Change error message "do_md5: read_password_packet failed" into debug level(Toshihiro Kitagawa) =============================================================================== 3.0.4 (umiyameboshi) 2011/06/01 * Version 3.0.4 This version fixes various bugs since 3.0.3. __________________________________________________________________ * Incompatible changes - In streaming replication, if delay_threshold is 0 or health checking is disabled, the delay checking is not performed. This is the behaviour according to a description of the pgpool-II manual. But, so far the delay checking was performed even if health checking was disabled(Guillaume Lelarge) __________________________________________________________________ * Bug fixes - Fix pgpool-regclass() to be compiled in PostgreSQL 8.0 or later. 7.4 still produces errors(Tatsuo Ishii) - Fix possible hangup when using /*NO LOAD BALANCE*/ comment in streaming replication(Toshihiro Kitagawa) - Fix hangup when received Flush(H) message or CloseComplete(C) message(Toshihiro Kitagawa) - Fix possible hangup that happen for the receiving timing of ReadyForQuery(Z) message after pgpool-II connects to backends(Toshihiro Kitagawa) - Add description about parameters for recovery_1st_stage_command and recovery_2nd_stage_command(Tatsuo Ishii) - Increase size of the internal system catalog cache from 32 to 128. This has the effect of reducing "unnamed prepared statement does not exist" error(Tatsuo, Kitagawa) - Fix bug with pcp_connect() which causes double free. Patch contributed by Jehan-Guillaume (ioguix) de Rorthais(Tatsuo Ishii) - Fix bug with start_recoery() which is apparently wrong usage of PQfinish()(Tatsuo Ishii) - Fix incorrect error message which is sent to the frontend when client idle time reached client_idle_limit(Tatsuo Ishii) - Fix "backend status" variable name correctly in pool_status. Replace the space with a '_'(Guillaume Lelarge) - Fix hangup when using md5 authentication method and running as daemon. Patch contributed by Nicolas Thauvin(Tatsuo Ishii) - Fix log_per_node_statement so that it prints statements in the extended query protocol. This used to work but was broken in 3.0 (Toshihiro Kitagawa) __________________________________________________________________ * Enhancements - Add currval() and lastval() to black_function_list of sample configuration files. If they are load balanced, currval() or lastval() may be called before the result of nextval() or setval() is propagated to slaves(Tatsuo Ishii) =============================================================================== 3.0.3 (umiyameboshi) 2011/02/23 * Version 3.0.3 This version fixes various bugs since 3.0.1. Please note that 3.0.2 was canceled due to a packaging problem. __________________________________________________________________ * Incompatible changes - Now installing C function "pgpool_walrecrunning()" is recommended if you plan to use streaming replication mode. This is necessary for better use of online recovery in the mode. Also new variable "%P" can be used in the online recovery script. If you do not install the function, these functionalities cannot be used(Tatsuo Ishii). - In raw mode if there's only one DB node and if a problem arises with the DB node, it will be brought to down status. However if the DB node goes into good condition again, you can use the DB node without restarting pgpool. This change has been included in 3.0, but did not work(Tatsuo, Kitagawa) __________________________________________________________________ * Bug fixes - Fix non portable code in password authentication. Bug report from a FreeBSD user(Tatsuo Ishii) - Fix bug that insert_lock locks all rows in user table (Tatsuo, Kitagawa) - Fix bug with password authentication. If user name is 32 bytes long, pgpool child segfaults.(Tatsuo Ishii) - Fix bug with md5 authentication. If raw mode or number of backend is 1, pgpool child segfaults. Patch contributed by Rob Shepherd(Tatsuo Ishii) - Fix long standing bug with timestamp rewriting against array and complex types. Patch contributed by Akio Ishida(Tatsuo Ishii) - Fix bug that debug_level directive doesn't work. Patch contributed by Gilles Darold(Tatsuo Ishii) - Fix possible crash of pgpool child while doing failover(Toshihiro Kitagawa) - Fix white/black_function_list so that it works correctly when user calls function with schema name(Tatsuo Ishii) - Fix bug that DROP DATABASE fails by connection cache(Toshihiro Kitagawa) - Fix bug that failover fails in raw mode(Toshihiro Kitagawa) - Fix possible termination of pgpool child when both simple query protocol and extended query protocol are used in one session (Toshihiro Kitagawa) - Fix possible hang up when an error occurs while using extended query protocol(Toshihiro Kitagawa) - Fix pgpool-regclass() so that it doesn't use PG_TRY/CATCH. It appeared that using PG_TRY/CATCH is not safe, sometimes backend dies with PANIC: ERRORDATA_STACK_SIZE exceeded.(Tatsuo Ishii) - Fix bug that select query isn't sent to master node when it meets the following conditions(Toshihiro Kitagawa) - in MASTER/SLAVE mode - use extended query protocol - started transaction explicitly - after write queries - Fix bug with load_balance that JDBC driver sends BEGIN to master node many times(Toshihiro Kitagawa) - Fix pool_status so that failback_command and fail_over_on_backend_error show correct values(Toshihiro Kitagawa) - Remove parameters from pool_status: recovery_password, system_db_password(Toshihiro Kitagawa) - Fix online recovery problem in the streaming replication mode(Tatsuo Ishii). Consider following scenario. Suppose node 0 is the initial primary server and 1 is the initial standby server. 1) Node 0 going down and node 1 promotes to new primary. 2) Recover node 0 as new standby. 3) pgpool-II assumes that node 0 is the new primary. This problem happens because pgpool-II regarded unconditionally the youngest node to be the primary. pgpool-II 3.0.3 now checks each node by using pgpool_walrecrunning() to see if it is a actually primary or not and is able to avoid the problem and regards node as standby correctly. Also you can use new variable "%P" to be used in the recovery script. If you do not install the function, the above problem is not resolved. - Fix backend complaining "unexpected EOF on client connection" while doing failover in streaming replication mode(Tatsuo Ishii) - Fix pgpool crashes when all backends go down(Tatsuo Ishii) - Fix replication delay checking so that it does not keep persistent connection to backends. Because the persistent connection may become bogus if a node down and then wake up between replication delay checking period(Tatsuo Ishii) - Rewrite and review english document(Marc Cousin, Gleu) __________________________________________________________________ * Enhancements - Emit log if particular backend is down status while reading the status file(Tatsuo Ishii) - Emit error message if an error occurred by the query that pgpool executed(Tatsuo Ishii) - Add sql directories main Makefile(Tatsuo Ishii) =============================================================================== 3.0.1 (umiyameboshi) 2010/10/19 * Version 3.0.1 This version fixes various bug in 3.0. __________________________________________________________________ * Bug fixes - Fix bug with md5 auth. If there's more than 1 servers to be authenticated, it segfaults(Tatsuo Ishii) - Fix bug that a child process crashes when clients execute a query contains syntax error in extended query protocol(Toshihiro Kitagawa) - Fix bug with handling of portal information, it terminates a child process(Toshihiro Kitagawa) - Fix hungup when a query sent to one node caused an error in extended query protocol(Toshihiro Kitagawa) - Fix typo in English doc. Patch contributed by Asaf Ohaion(Tatsuo Ishii) =============================================================================== 3.0 (umiyameboshi) 2010/09/10 * Version 3.0 This is the first version of pgpool-II 3.0 series. That is, a "major version up" from 2.2 or 2.3 series. The biggest news is, this version adapts to PostgreSQL 9.0's new feature: Streaming Replication/Hot Standby. Streaming replication can be used as a sub mode of master slave mode. Master slave mode itself heavily enhanced: - SELECTs in explicit transactions can be load balanced - In extended protocol, PARSE/BIND/DESCRIBE messages are sent to the node which execute EXECUTE message, not all node. This will reduce lock contentions. - Auto start of transaction happens only when it needed. - Temporary tables can be used safely. - SELECT which calls functions possibly write to database executes on master(primary) Also many new features are added and major refactoring has been made to the internal structure of pgpoo-II. For example, in replication mode, SELECTs calling functions possibly write to database will not allow to load balance. __________________________________________________________________ * New features - Online recovery can be used with master/slave/streaming replication mode(Tatsuo Ishii) - New directive "delay_threshold" is added to monitor replication delay in master/slave/streaming replication mode. If replication delay is too much, SELECTs are not load balanced(Tatsuo Ishii) - show pool_status shows replication delay in master/slave/streaming replication mode(Tatsuo Ishii) - New directive "log_standby_delay" is added to control logging of replication delay in master/slave/streaming replication mode(Tatsuo Ishii) - When insert_lock is enabled and the table includes SERIAL data type, issue row lock on the sequence table. Before we issues table lock. Problem is, the table lock conflicts with auto vacuum and sometimes caused excessive lock waiting(Tatsuo Ishii) - Add support for more "SHOW" commands: pool_nodes, pool_processes, pool_pools, and pool_version(Guillaume Lelarge) - Backend process id and whether frontend connects to this connection pool or not are added to pcp_proc_info's output(Tatsuo Ishii) - "Gracefuly detach" option is added to pcp_detatch_node. With this option, pcp_detatch_node waits until all frontends disconnected(Tatsuo Ishii) - New directive "white_function_list" and "black_function_list" are added to register functions those do not or do write to database(Tatsuo Ishii) - In master/slave mode, SELECTs to system catalogs executes only on master/primary(Tatsuo Ishii) - In master/slave mode, SELECTs to temporary table executes only on master/primary(Tatsuo Ishii) - In master/slave mode, write queries outside of explicit transactions no longer trigger to start internal transaction(Tatsuo Ishii) - In master/slave mode, SELECTs inside explicit transactions are load balanced(Tatsuo, Kitagawa) - In master/slave mode, commands are no longer sent to all DB nodes. This will prevent unnecessary locking(Tatsuo, Kitagawa) - New command option adds to ignore the status file when starting up(Tatsuo Ishii) - Supports PostgreSQL 9.0's new VACUUM syntax(Tatsuo Ishii) - New directive "failover_if_affected_tuples_mismatch" controls the behavior when number of result rows of INSERT/UPDATE/DELETE are differ(Tatsuo Ishii) - When number of result rows of INSERT/UPDATE/DELETE are differ, each number are logged(Tatsuo Ishii) - md5 authentication is supported in replication mode and master/slave mode(Tatsuo Ishii) - Allow to force to move to online recovery second stage even there are connecting frontends(Tatsuo Ishii) - If there's only one DB node and it triggers failover, pgpool-II will automatically connects if the DB node coming up(Tatsuo Ishii) - Pcp commands supports long options(Guillaume Lelarge) - New directive "debug_level" added to control the debug message logging(Tatsuo Ishii) - Allow to use various boolean representations as PostgreSQL in pgpool.conf(Toshihiro Kitagawa) - New C language function pgpool_switch_xlog for online recovery added(Toshihiro Kitagawa) - New C language function pgpool_regclass added to avoid a trouble about handling of duplicate table names in different schema(Tatsuo Ishii) __________________________________________________________________ * Bug fixes - Do not rewrite statement which accesses columns having now() etc. as the default value but the data type are not timestamp etc. Otherwise we have an error in DMLs(Tatsuo Ishii) - Fix timestamp rewriting not to omit schema qualification(Tatsuo Ishii) - Fix bug with timeout handling in pcp commands(Tatsuo Ishii) - Fix SSL hang when large amount of data transfered(Tatsuo Ishii) - Fix failover when there's only one DB node(Tatsuo Ishii) - Fix bug with postmaster start check in online recovery. Before it continued infinitely to try to connect to postmaster if the first attempt failed(Tatsuo Ishii) =============================================================================== 2.3 Series (2009/12/07 - 2012/08/06) =============================================================================== 2.3.4 (tomiteboshi) 2012/08/06 * Version 2.3.4 This version fixes various bugs since 2.3.3. __________________________________________________________________ * Bug fixes - Fix do_error_execute_command() so that it discards responses from backend until ErrorResponse received. (Toshihiro Kitagawa) Note that we need to preserve non-error responses (i.e. ReadyForQuery) and put back them using pool_unread(). Otherwise, ReadyForQuery response of DEALLOCATE. This could happen if PHP PDO used. - Fix SimpleForwardToFrontend() so that it reset select_in_transaction flag and execute_select flag when bind error occurred while executing SELECT. (Toshihiro Kitagawa) - Fix SSL connection sometimes hung if lots of data read from backend. This is caused by the buffering in OpenSSL layer. To fix the problem, (Tatsuo Ishii) we check the buffer has any pending data by using SSL_pending() before calling select(2). See thread [Pgpool-general] Fwd: PGPOOL II 2.3.3 hang in ssl mode for more details. - Fix bug with pcp_check_fd()'s timeout handling. (Tatsuo Ishii) Per erboles. Subject: [Pgpool-general] question about pcp_check_fd Date: Sun, 23 May 2010 18:21:41 -0500 To: pgpool - Do not force replication of DEALLOCATE if operated in master/slave mode. Reported by Jan Kantert. (Toshihiro Kitagawa) See: Subject: [Pgpool-hackers] Problems with PgPool 2.3.3 Prepare / Deallocation handling in Master/Slave mode Date: Fri, 28 May 2010 20:59:47 +0200 For more details. - Make timestamp rewriting schema aware. (Tatsuo Ishii) - Do not rewrite statement which accesses columns having now() etc. as the default value but the data type are not timestamp etc. (Tatsuo Ishii) Otherwise we have an error in DMLS. See: Subject: [Pgpool-general] function epoch seems to be causing error To: pgpool-general@pgfoundry.org Date: Mon, 16 Aug 2010 21:48:31 +0000 (UTC) For more details. - Fix insert_lock to be schema aware. (Tatsuo Ishii) - Fix long standing bug with timestamp rewriting against array and complex types. (Tatsuo Ishii) Failed examples are: INSERT INTO r1(col[1], col2.foo) VALUES (1, 2); -- insert_column_item UPDATE r1 SET col1[1] = 1, col2.foo = 1; -- set_target PREPARE "p" (int4[]) AS SELECT $1[1]; -- c_expr SELECT (ARRAY[1,2,3])[1]; SELECT (ARRAY[ARRAY[1]])[1][1]; SELECT ('{1,2,3}'::int[])[1]; SELECT ('{1,2,3}'::int[3])[1]; SELECT r1.col[1], (r1.col1).bar, (r1.col1).* FROM r1; -- columnref SELECT (r1.col1).baz[1], (r1.col1).baz[1][2] FROM r1; Patch provided by Akio Ishida. - Fix buffer overrun problem when pcp password is longer than 32. (Tatsuo Ishii) - Fix wait_for_query_response() not to send param status to frontend if frontend is NULL. This could happen while processing reset_query_list. (Tatsuo Ishii) =============================================================================== 2.3.3 (tomiteboshi) 2010/04/23 * Version 2.3.3 This version fixes various bugs since 2.3.2.2. __________________________________________________________________ * Incompatible changes - Please note that this version of pgpool consumes more shared memory than before. If you encounter problems when starting up pgpool, please look into pgpool log. If you find messages something like "could not create shared memory segment: Cannot allocate memory", please increase the shared memory on your system. - Now parallel mode requires replication mode turned on. parallel mode without replication mode turned on has been broken since pgpool-II was born anyway(Toshihiro Kitagawa) - Change default value for insert_lock to false since there's no point in turning this on in master/slave mode. Fix suggested by Fujii Masao(Tatsuo Ishii) __________________________________________________________________ * Newly added documents - README.online-recovery, which is an internal document of online recovery, added(Tatsuo Ishii) __________________________________________________________________ * Bug fixes - Fix long standing bug since pgpool-II 1.0 which causes segfault of pgpool child process. This was caused by miscalculation of shmem size in pgpool parent. Bug analysis by Kitagawa patch created by Tatsuo - Add restriction for parallel mode(Toshihiro Kitagawa) - The Natural Join is not supported - The USING CLAUSE is converted to ON CLAUSE by query rewrite process - Fix possible crash during rewriting JOIN syntax that have USING in parallel query mode(Toshihiro Kitagawa) This fix is supporting such as following JOIN syntax. example: - SELECT * FROM a JOIN b USING (aid) JOIN c USING (cid); - SELECT * FROM a JOIN b USING (aid) JOIN c USING (cid) JOIN d USING (did) - Fix parallel query so that it can parse INSERT statements that have current_time before a partitioning key column (Toshihiro Kitagawa) - Fix SimpleForwardToBackend() so that pgpool doesn't keep waiting for reply from a backend, when clients using the extended query protocol cause a command error such as bind error. This bug occur in master/slave, raw, and connection pool mode. This fix is, sending SYNC message to recover error after command error(Toshihiro Kitagawa) - Fix SIGINT/SIGQUIT is ignored if pgpool child is in select(). In this case pgpool retries select() thus the signal is ignored(Tatsuo Ishii) - Fix connect_inet_domain_socket_by_port/ connect_unix_domain_socket_by_port so that they check if SIGTERM/SIGINT/SIGQUIT signal has been delivered. Per bug report from Daniel Codina(Tatsuo Ishii) - Fix possible crash during creating "kind mismatch" error message. This used to work but was broken in 2.3.2(Tatsuo Ishii) - Fix bug with healh checking. If a network problem such as unplugged wire happens while calling connect(), health checking does not work since connect_unix_domain_socket()/connect_inet_domain_socket() do retry if connect() is interrupted by ALARM signal. Added new retry argument which controls the retrying behavior to those functions. Per bug report and problem analysis by Daniel Codina(Tatsuo Ishii) - Fix enbug in 2.3.2.2 with time stamp rewriting in SimpleForwardToBackend. Per bug report from Bugtrack #1010771. Report from Peter Pramberge(Tatsuo Ishii) - Fix rewriting "*" in paralell query. Patch conributed by sho-san(Toshihiro Kitagawa) - Fix connect_inet_domain_socket_by_port() so that it print out error message by using hstrerror(), rather than strerror()(Tatsuo Ishii) =============================================================================== 2.3.2.2 (tomiteboshi) 2010/02/22 * Version 2.3.2.2 This version fixes various bug in 2.3.x. - When rewriting timestamp in extended query, it allocated less than what it actually needed. This causes random problematic behavior, typically "message: invalid string in message" error in backend(Tatsuo Ishii). - In extended query, if one of parameters contains NULL, ppool crashes(Tatsuo Ishii). - If in previous status file all nodes were marked down status, it is regarded that this file is bogus. This will prevent "all node down" syndrome(Tatsuo Ishii). =============================================================================== 2.3.2.1 (tomiteboshi) 2010/02/11 * Version 2.3.2.1 This version fixes bug in 2.3.x. It is identfied that pgpool-II 2.3.x has a problem with erroneous query processing(Akio Ishida). =============================================================================== 2.3.2 (tomiteboshi) 2010/02/07 * Version 2.3.2 This version includes various fixes for bugs in 2.3.1 or before. All 2.3.x users are encouraged to upgrade to 2.3.2 as soon as possible. Also this version enables long awaited SSL support and large object replication support. __________________________________________________________________ * Enhancements - SSL support(Sean Finney) - Large object replication support. You need PostgreSQL 8.1 or later, however(Tatsuo Ishii) - Emit statement log when error or notice message comes from query parsing process. This is usefull because PostgreSQL does not log particular statement if the error was detected *before* raw parser get executed. This typlically happens when encoding error was found(Tatsuo Ishii) - Display original query to log if kind mismatch error was caused by DEALLOCATE(Tatsuo Ishii) - While health checking and recovery use postgres database if possible. If postgres database does not exist, use template1 as it stands now. While connecting template1, certain commands, for example DROP DATABASE cannot used. Using postgres database allows to use these commands while recovery(Tatsuo Ishii) __________________________________________________________________ * Bug fixes - Fix errors in timestamp rewriting which occasionaly cause broken packet sentto slave nodes(Tatsuo Ishii) - Fix errors when timestamp rewriting is used with V2 protocol(Toshihiro Kitagawa) - Propagate Bind, Describe and Close messages to only master node if running in master/slave and in transaction (Tatsuo Ishii) - Fix do_child() so that check_stop_request() exits immediately when smart shutdown signal has been sent. This has been used to work in 2.2(Toshihiro Kitagawa) - Fix ProcessFrontendResponse not to accept invalid frotend packet(Xavier Noguer) - Use %dz for sizeof in fprintf for more portability(Tatsuo Ishii) - Fix compiler warnings(Tatsuo Ishii) - Do not force replication of DEALLOCATE if operated in master/slave mode. Now that pgpool do not execute PARSE in all nodes, this was pointless and caused problem (kind mismatch when executing DEALLOCATE)(Tatsuo Ishii) =============================================================================== 2.3.1 (tomiteboshi) 2009/12/18 * Version 2.3.1 This version includes various fixes for bugs in 2.3 or before. All 2.3 users are encouraged to upgrade to 2.3.1 as soon as possible. __________________________________________________________________ * Bug fixes - If all of following conditions met, incorrect data is written to DB(Tatsuo Ishii) - pgpool is running in replication mode - pgpool is running on 64bit OS - INSERT or UPDATE are used which explicitly include now(), - CURRENT_TIMESTAMP, CURRENT_DATE, CURRENT_TIME. Or the target - Table's default value use above functions - The SQL statement inclludes out of 32bit integer value(-2147483648 to 2147483647 in decimal) Example SQL: INSERT INTO t1(id, regdate) VALUES(98887776655, NOW()); - Fix crush in case of more than 18 DB nodes are used(Tatsuo Ishii) - Enhance kind mismatch error message. If kind is ERROR or NOTICE, the error or notice message from PostgreSQL will be printed (Tatsuo Ishii) =============================================================================== 2.3 (tomiteboshi) 2009/12/07 * Version 2.3 This version enhances replication, especially CURRENT_TIMESTAMP, CURRENT_DATE, now() etc. now can be properly replicated. Also perforance of replication when num_init_children == 1 is enhanced. Pgpool-II now records the status of down nodes, and remember when it restarts to ensure that keep the node status as before. Also some logs are enhanced and more fine fail over controls are added. Please note that pgpool-II 2.3 includes all of enhancements and fixes of pgpool-II 2.2.1 to 2.2.6. __________________________________________________________________ * Incompatibilities from 2.2.x - pgpool_status file is created under logdir. So you need to give write permission to the directory so that pgpool-II can read/write pgpool_status file. __________________________________________________________________ * Enhancements - Enable proper replication of results of temporal functions (CURRENT_TIMESTAMP, CURRENT_DATE, now() etc.). Now applications can execute INSERT/UPDATE tables which include defaut values using those temporal functions. There are small limitations. See restriction sections of docs for more details (Akio Ishida) - Use PostgreSQL 8.4's SQL parser(Akio Ishida) - Enhance the performance 20% to 100% of replication when num_init_children == 1(Tatsuo Ishii) - Add new directive log_per_node_statement which is similar to log_statement except that prints info for each DB node to make it easier which query is sent to which DB node(Tatsuo Ishii) - Add new directive fail_over_on_backend_error to control the behaviro of fail over(Tatsuo Ishii) - Record DB node status and remember when pgpool-II restarts(Tatsuo Ishii) - EXPLAIN and EXPLAIN ANALYZE for SELECT query are now load balanced. This will prevent unwanted kind mismatch errors when EXPLAIN produces slightly different plan(Tatsuo Ishii) - Enhance CSS of pgpool-ja.html(Tatsuo Ishii) - Add sample configuration file for replication mode and master/slave mode(Tatsuo Ishii) - Add test for temporal data(Akio Ishida) =============================================================================== 2.2 Series (2009/02/08 - 2012/08/06) =============================================================================== 2.2.8 (urukiboshi) 2012/08/06 * Version 2.2.8 It includes various fixes for bugs various bug fixes in 2.2.7. __________________________________________________________________ * Bug fixes - Fix do_error_execute_command() so that it discards responses from backend until ErrorResponse received. (Toshihiro Kitagawa) Note that we need to preserve non-error responses (i.e. ReadyForQuery) and put back them using pool_unread(). Otherwise, ReadyForQuery response of DEALLOCATE. This could happen if PHP PDO used. - Fix SimpleForwardToFrontend() so that it reset select_in_transaction flag and execute_select flag when bind error occurred while executing SELECT. (Toshihiro Kitagawa) - Fix bug with pcp_check_fd()'s timeout handling. (Tatsuo Ishii) Per erboles. Subject: [Pgpool-general] question about pcp_check_fd Date: Sun, 23 May 2010 18:21:41 -0500 To: pgpool - Fix buffer overrun problem when pcp password is longer than 32. (Tatsuo Ishii) - Fix wait_for_query_response() not to send param status to frontend if frontend is NULL. This could happen while processing reset_query_list. (Tatsuo Ishii) =============================================================================== 2.2.7 (urukiboshi) 2010/04/15 * Version 2.2.7 This version enhances displaying error messages when kind mismatch error occurs. Also it includes various fixes for bugs in 2.2.6 or before as usual. __________________________________________________________________ * Bug fixes - Fix occasional hangup in extend protocol + master/slave mode, row mode or connection pool mode. Back patch from 2.3 tree(Toshihiro Kitagawa) - Fix long standing bug since pgpool-II 1.0 which causes segfault of pgpool child process. This was caused by miscalculation of shmem size in pgpool parent. Bug analysis by Kitagawa patch created by Tatsuo - Send Parse, Bind, Describe and Close message to only master node if operated in explicit transaction and master/slave mode(Tatsuo Ishii). - Emit a log when postmaster goes down(Tatsuo Ishii) - Fix memory leak in make_persistent_db_connection(Xavier Noguer) - Do not force replication of DEALLOCATE if operated in master/slave mode. Now that pgpool do not execute PARSE in all nodes, this was pointless and caused problem (kind mismatch when executing DEALLOCATE) (Tatsuo Ishii) - Fix crash with show pool_status when there many (more than 18) DB nodes(Tatsuo Ishii) - Enhance "kind mismatch" message. If kind is ERROR or NOTICE, print the ERROR/NOTICE message to help users to find what's going on(Tatsuo Ishii) =============================================================================== 2.2.6 (urukiboshi) 2009/12/01 * Version 2.2.6 This version enhances handling of backend weight. Also it allows to use temp tables in master/slave mode. It includes various fixes for bugs in 2.2.5 or before as usual. __________________________________________________________________ * Bug fixes - Do not allow to load balance DECLARE, CLOSE, FETCH and MOVE. If data gets updated and CLOSE issued after transaction commit(i.e. holdbale cursor), this will cause data inconsistency since CLOSE is executed one of the severs, rather than all(Tatsuo Ishii) - In master/slave mode, execute Parse message on only master node. In previous versions Parse executed on all nodes, which grabbed unneccessary lock(Tatsuo Ishii) - Remove init script from all runlevels before uninstall(Devrim) - Fix pgpoo.spec(Devrim) - Do not execute REINDEX DATABASE or SYSTEM, CREATE/DROP TABLE SPACE inside a transaction block(Tatsuo Ishii) __________________________________________________________________ * Enhancements - Allow to change weight by reloading pgool.conf. This will take effect for next client sessions(Tatsuo Ishii) - Reply with usefull error messages, rather than "server closed the connection unexpectedly" when authentication fails(Glyn Astill) - Add info to logs when writing to sockets falis to know if it was for backend or frontend(Tatsuo Ishii) - Do not complain when writing to socket of frontend fails(Tatsuo Ishii) - Allow to use temp tables in master/slave mode. INSERT/UPDATE/DELETE will automatically be sent to master only. Still SELECT you need to add /*NO LOAD BALANCE*/ comment(Tatsuo Ishii) - Add temp table test to test/jdbc(Tatsuo Ishii) =============================================================================== 2.2.5 (urukiboshi) 2009/10/4 * Version 2.2.5 This version fixes various bugs in 2.2.4 or before. __________________________________________________________________ * Bug fixes - Fix connection_count_down(). It decrements the connection counter too much in some corner cases and causes online recover never completes(Tatsuo Ishii) - Detect frontend exiting while waiting for commands complete in other cases such as internal locks are issued and Parse (Tatsuo Ishii) - Fix inifinit loop in reset_backend(Xavier Noguer, Tatsuo) - Fix Parse() to print actual query when it detects kind mismatch error(Tatsuo Ishii) - Document enhancements(Tatsuo Ishii) =============================================================================== 2.2.4 (urukiboshi) 2009/8/24 * Version 2.2.4 This version fixes various bugs in 2.2.3 or before. __________________________________________________________________ * Bug fixes - Fix possible bug introduced in pgpool-II 2.2.2. Load balance control variables may remain not be restored and subsequent DML/DDL call might sent to only master node(Tatsuo Ishii) - Send NOTICE message to frontend periodically if V2 protocol is used. This is ifdef out since it affectes visible change to applications. 2.2.3 unconditionaly sends param packet to client even it uses version 2 protocol, which is apparentlt wrong. Also tweak checking period from 1 second to 30 seconds since 1 second seems too aggressive(Tatsuo Ishii) - Block signals before forking children rather after. Otherwise parent will be killed by failover signal if it receives a signal before establishing signal handler(Tatsuo Ishii) - Remove unnecessary spaces and tabs at the end of line(Jun Kuriyama) =============================================================================== 2.2.3 (urukiboshi) 2009/8/11 * Version 2.2.3 This version fixes various bugs in 2.2.2 or before. __________________________________________________________________ * Bug fixes - Fix child process death if one of backends is not available(Tatsuo Ishii). - Fix various parallel query bugs(Yoshiharu Mori) - Fix message corruption for kid mismatch error(Akio Ishida) - Now stetmemt_time works(Tatsuo Ishii) - Enhance health checking to detect postmaster stopping by SIGSTOP(Tatsuo Ishii) - Detect frontend abnormal exiting while waiting for reply from backend. This only works with V3 protocol(Tatsuo Ishii) - Do not start internal transaction if command is CLUSTER without arguments(Tatsuo Ishii) - Fix bug with COPY FROM in that backend process remains after COPY failed(Tatsuo Ishii) __________________________________________________________________ * Enhancements - Show last query for extended protocol(Akio Ishida) - Allow to compile sql/pgpool-recovery/pgpool-recovery.c with PostgreSQL 8.4(Tatsuo Ishii) =============================================================================== 2.2.2 (urukiboshi) 2009/5/5 * Version 2.2.2 This version fixes various bugs in 2.2.1 or before. Please note that an importan fix is made to avoid data incositency risk, which could happen when client does not exit gracely(without sending "X" packet) while pgpool is trying to send data to it. This could happen with all version of pgpool-II. __________________________________________________________________ * Bug fixes - Ignore write error on frontend connection. This is needed to continue processing with backend, otherwise we risk data incositency(Tatsuo Ishii) - Fix bug introduced in 2.2.1 (In master slave mode, sometimes DEALLOCATE fails). If prepared statement reused, pgpool hangs(Toshihiro Kitagawa) - Fix pgpool crash when SQL command PREPARE and protocol level EXECUTE are mixed. The bug was introduced in 2.2(Tatsuo Ishii) - Avoid "unexpected EOF on client connection" error in PostgreSQL when reset query fails(Tatsuo Ishii) =============================================================================== 2.2.1 (urukiboshi) 2009/4/25 * Version 2.2.1 This version fixes various bugs in 2.2. __________________________________________________________________ * Bug fixes - In master slave mode, sometimes DEALLOCATE fails. This is caused by that the first PREPARE was not executed on the slave(Toshihiro Kitagawa) - Update pgpool.spec along with related files(Devrim) - Fix inser_lock so that it is ignored when protocol version is 2(Tatsuo Ishii) - Remove excessive log messages regarding parameter change notice(Tatsuo Ishii) - Add missing files to doc(Tatsuo Ishii) =============================================================================== 2.2 (urukiboshi) 2009/2/28 * Version 2.2 This version enhances SERIAL data type handling and on line recovery. Also an important bug, serializable transactions could cause data inconsistency among DB nodes, is fixed. Query cancelation, which never worked since pgpool-II was born, is finally fixed. __________________________________________________________________ * New features/enhancements - With insert_lock, now a table is locked only if it has SERIAL data type and now the default value for insert_lock is true(Tatsuo Ishii) - Start internal transaction other than INSERT, UPDATE, DELETE and SELECT to keep node consistency(Tatsuo Ishii) - Add client_idle_limit_in_recovery directive. This will prevent 2nd stage of on line recovery from not going forward by idle clients sitting forever(Tatsuo Ishii) - Add pid_file_name directive which specifies a path to the file containing pgpool process id. "logdir" is no more used(Tatsuo Ishii) - Allow to load balance DECLARE, FETCH and CLOSE(Tatsuo Ishii) - Add -d option to pcp commands(Jun Kuriyama) - Enahnce kind mismatch error message to include originarl query string(Tatsuo Ishii) __________________________________________________________________ * Bug fixes - Close all file descriptors when running in daemon mode. Otherwise we inherit sockets from apache when it's started by pgpoolAdmin. This results in that port 80 is occupied for example. Patch provided by Akio Ishida. Also add chdir("/"). This is always good for daemon programs(Tatsuo Ishii) - Allow MD5 authentication in raw mode as stated in docs(Tatsuo Ishii) - Check transaction serialization failure error in serializable mode and abort all nodes if so. Otherwise we allow data inconsistency among DB nodes(Tatsuo Ishii). See following scenario: (M:master, S:slave) M:S1:BEGIN; M:S2:BEGIN; S:S1:BEGIN; S:S2:BEGIN; M:S1:SET TRANSACTION ISOLATION LEVEL SERIALIZABLE; M:S2:SET TRANSACTION ISOLATION LEVEL SERIALIZABLE; S:S1:SET TRANSACTION ISOLATION LEVEL SERIALIZABLE; S:S2:SET TRANSACTION ISOLATION LEVEL SERIALIZABLE; M:S1:UPDATE t1 SET i = i + 1; S:S1:UPDATE t1 SET i = i + 1; M:S2:UPDATE t1 SET i = i + 1; <-- blocked S:S1:COMMIT; M:S1:COMMIT; M:S2:ERROR: could not serialize access due to concurrent update S:S2:UPDATE t1 SET i = i + 1; <-- success in UPDATE and data becomes inconsistent! - avoid kind mismatch error caused by "SET TRANSACTION ISOLATION LEVEL must be called before any query"(Tatsuo Ishii). This could happen in following scenario: M:S1:BEGIN; S:S1:BEGIN; M:S1:SELECT 1; <-- only sent to MASTER M:S1:SET TRANSACTION ISOLATION LEVEL SERIALIZABLE; S:S1:SET TRANSACTION ISOLATION LEVEL SERIALIZABLE; M: <-- error S: <-- ok since no previous SELECT is sent. kind mismatch error occurs! - Process status display has extra space on FreeeBSD(Jun Kuriyama) - Fix incorrect kind mismatch detection case. e.g: BEGIN; BEGIN; (Tatsuo Ishii) - If PostgreSQL sends lots of DEBUG message, sometimes pgpool complains: 2008-11-08 22:41:53 ERROR: pid 23744: do_command: backend does not return ReadyForQuery. This due to a wrong assumption for the client/server protocol(Tatsuo Ishii) - Fix the case when sending an erronous query to abort transaction. It assumed that after sending an error query, always ReadyForQuery came right after that. If some debugging or logging verboseness is set, PostgreSQL might sends NOTICE before ReadyForQuery(Tatsuo Ishii) - Query cancelation now works. It never worked since pgpool-II was born(Tatsuo Ishii) - Fix online recovery to wait for failback done before allowing to accept connections from clients. It was supposed to work like this but actually was not since the day 0 when online recovery was born. Without the fix there could be potential data inconsistency among DB nodes(Tatsuo Ishii) - Fix pgpool-II crash after on line recovery. This happens after the failback process adds a recovered node which has no connection to the node(Tatsuo Ishii) - Fix pgpool-II errors when postgresql.conf is reloaded. This was caused by parameter status packet sent asynchronously from backend, which indicates the internal setting of backend has been changed(Tatsuo Ishii) __________________________________________________________________ * Incompatible changes - Always fail over and restart all children. Before we do restart only if master has not been changed. This is wrong. If we have trouble with network cable or something, TCP/IP stack keeps on retrying for long time and the only way to prevent it is restarting process(Tatsuo Ishii) - "logdir" is no more used. Instead use "pid_file_name"(Tatsuo Ishii) - Default value for insert_lock is now true(Tatsuo Ishii) =============================================================================== 2.1 Series (2008/07/25 - 2008/07/25) =============================================================================== 2.1 (inamiboshi) 2008/7/25 * Version 2.1 __________________________________________________________________ * New feature - Add '%m' format to failover_command and failback_command to obtain new master node ID. (Yoshiyuki Asaba) - Add '%m' format to failover_command and failback_command to obtain old master node ID. (Yoshiyuki Asaba) - Add new directive "recovery_timeout" to specify recovery timeout in second. (Taiki Yamaguchi) - Add optino '-v' to print pgpool version. (Yoshiyuki Asaba) __________________________________________________________________ * Incompatibility - Restrict pgpool_recovery() and pgpool_remote_start() functions to superusers. (Yoshiyuki Asaba) - Do not create a connection pool to standby node in raw mode. (Yoshiyuki Asaba) - Remove "replication_timeout" parameter. (Yoshiyuki Asaba) - This enabled if replication_strict was false. However, replication_strict was already removed. - Ignore timeout argument of pcp commands. (Taiki Yamaguchi) - Do not replicate "COPY TO STDOUT" when replicate_select is false. (Yoshiyuki Asaba) __________________________________________________________________ * Bug fix ** General - Fix crash when CloseComplete message was received. (Yoshiyuki Asaba) - Improve network I/O routine. (Yoshiyuki Asaba) - Fix compile errors on Solaris 10. (Yoshiyuki Asaba) - Improve log messages of health check and recovery. (Tatsuo Ishii) - Change error level of the "failed to read kind from frontend" message from ERROR to LOG. (Yoshiyuki Asaba) - Fix failover failure in raw mode. (Taiki Yamaguchi) - Fix zombie process bug. (Yoshiyuki Asaba) - Fix health_check_timeout to work correctly. (Kenichi Sawada) - Support ps status on FreeBSD. (ISHIDA Akio) - Improve bind(2) failure report. (Jun Kuriyama) - Improve error message when client authentication failed. (Tatsuo Ishii) ** Replication - Fix replicate_select to work correctly. (Tatsuo Ishii) - Fix a wrong rollback bug with extended query. (Yoshiyuki Asaba) - Fix a bug with asynchronous query. (Yoshiyuki Asaba) - Fix hint clause handling like /*REPLICATION*/ with extended query. (Yoshiyuki Asaba) - Fix crash of "DEALLOCATE ALL". (Yoshiyuki Asaba) - Fix hang up when a backend node does immediate shutdown. (Yoshiyuki Asaba) - Fix hang up online recovery in high load. (Yoshiyuki Asaba) - Fix hang up with extended query protocol when SELECT is failed inside a transaction block. (Yoshiyuki Asaba) ** Master Slave - Fix load balancing to work correctly. (Yoshiyuki Asaba) - Fix crash if SET, PREPARE or DEALLOCATE is executed inside a transaction block. (Yoshiyuki Asaba) ** Parallel query - Fix INSERT failure. (Yoshiharu Mori) - Fix syntax error when a query contains "AS" in FROM clause. (sho) - Fix Hung up when two or more statment was executed in parallel mode (Yoshiharu Mori) - Fix Query rewriting of Join Expression and DISTINCT ON (Yoshiharu Mori) =============================================================================== 2.0 Series (2007/11/16 - 2007/11/21) =============================================================================== 2.0.1 (hikitsuboshi) 2007/11/21 * Version 2.0.1 * Fix process down with UPDATE or DELETE query.(Yoshiyuki Asaba) * Send a syntax query only to a master node if master_slave is true.(Yoshiyuki Asaba) =============================================================================== 2.0 (hikitsuboshi) 2007/11/16 * Version 2.0 __________________________________________________________________ * Incompatibility since pgpool-II 1.x - the default value for ignore_leading_white_space is now true(Yoshiyuki Asaba) - replicate_strict is removed. The value is always true(Yoshiyuki Asaba) __________________________________________________________________ * General - Allow to reload pgpool.conf(Yoshiyuki Asaba) - The paraser is now compatible with PostgreSQL 8.3(Yoshiyuki Asaba) - Add new directive "failover_command" to specify command when a node is detached(Yoshiyuki Asaba) - Add new directive "client_idle_limit" to specify the time out since the last command is arrived from a client(Tatsuo Ishii) __________________________________________________________________ * Replication - Always start a new transaction even if the query is not in an explicit transaction to enhance the reliabilty of replication(Yoshiyuki Asaba) - Enhance the performance of replication for write queries. Now the worst case is 1/2 compared with single DB node regardless the number of DB nodes. Previous release tends to degrade according to the numer of DB nodes(Yoshiyuki Asaba) - Add "online recovery" which allows to add a DB node and sync with other DB nodes without stopping the pgpool server(Yoshiyuki Asaba) - Abort a transaction if INSERT, UPDATE and DELETE reports different number of result rows(Yoshiyuki Asaba) x=# update t set a = a + 1; ERROR: pgpool detected difference of the number of update tuples HINT: check data consistency between master and other db node - If the results from DB nodes do not match, select the possible correct result by "decide by majority". Previous release always trust the result of the master DB node(Yoshiyuki Asaba) - Allow load balance in V2 frontend/backend protocol(Yoshiyuki Asaba) __________________________________________________________________ * Parallel query - Allow "partial replication" to enhance the performance of the parallel query(Yoshiharu Mori) =============================================================================== 1.3 Series (2007/10/23 - 2007/10/23) =============================================================================== 1.3 (sohiboshi) 2007/10/23 * Version 1.3 * Add new "authentication_timeout" directive, being the default value is 60. (Yoshiyuki Asaba) - Maximum time in seconds to complete client authentication. * Reject a connection when startup packet length is greater than 10,000 byte. (Yoshiyuki Asaba) * Fix invalid memory access when pgpool processed DEALLOCATE statement. (Yoshiyuki Asaba) * Fix hang up in load balance mode. (Yoshiyuki Asaba) - This was introduced in V1.2. * Fix segmentation fault in 64-bit environment when query cache is enable. (Yoshiyuki Asaba) =============================================================================== 1.2 Series (2007/08/01 - 2007/09/28) =============================================================================== 1.2.1 (tomoboshi) 2007/09/28 * Version 1.2.1 * Fix deadlock while processing Parse message. (Yoshiyuki Asaba) * Fix memory leak in reset_prepared_list(). (Yoshiyuki Asaba) * Fix compile error on FreeBSD 4.11. (Yoshiyuki Asaba) * SET, PREPARE and DEALLOCATE statements are replicated in master/slave mode. (Yoshiyuki Asaba) =============================================================================== 1.2 (tomoboshi) 2007/08/01 * Version 1.2 * Add new "replicate_select" directive, being the default value is false. (Yoshiyuki Asaba) - If it is true, SELECT query is replicated. This behavior is same as V3.2 or earlier. * Improve signal handling. (Yoshiyuki Asaba) - Occasionaly, zombie processes were remained. Or processes were unstable. * Fix hang up when SELECT was error inside a transaction block. The bug was introduced in V3.3. (Yoshiyuki Asaba) * Fix PREPARE/EXECUTE handling in master slave mode. (Yoshiyuki Asaba) * Fix "kind mismatch error" when deadlock error * Fix hang up and SEGV in extended query protocol when a warning SQL like "SELECT '\'';" executed. (Yoshiyuki Asaba) * Fix hang up when postmaster did fast or immediate shutdown. (Yoshiyuki Asaba) * Fix memory leak when connection cache was full. (Yoshiyuki Asaba) * Load balancing node is selected when a session starts. (Yoshiyuki Asaba) * Fix buffer overrun if connection_life_time was set. (Yoshiyuki Asaba) =============================================================================== 1.1 Series (2007/5/25 - 2007/6/15) =============================================================================== 1.1.1 (amiboshi) 2007/6/15 * Version 1.1.1 * Fix "kind mismatch" bug when load_balance_mode is true introduced in 1.1 (Yoshiyuki Asaba) * Fix deadlock with extended query protocol(Yoshiyuki Asaba) * Fix numerous bugs with protocol V2(Yoshiyuki Asaba) =============================================================================== 1.1 (amiboshi) 2007/5/25 * Version 1.1 * Support HBA authentication(Taiki Yamaguchi) * Support log_connections(Taiki Yamaguchi) * Support log_hostname(Taiki Yamaguchi) * Show pgpool status in ps command(Taiki Yamaguchi) * Fix compile error on MacOS X(Yoshiyuki Asaba) * Allow load balancing with extended protocol(Yoshiyuki Asaba) * Improve replication. SELECT nextval() and SELECT setval() are now replicated. (Yoshiyuki Asaba) * Change SELECT query is only sent to the master node. (Yoshiyuki Asaba) - Use /*REPLICATION*/ comment to repliate a SELECT query. * Fix unexpected failover error due to receiving an interrupt signal while connecting to the backend. (Yoshiyuki Asaba) * Add "pgpool.pam" file, for PAM configuration file, to be installed under "$PREFIX/share/pgpool-II/". (Taiki Yamaguchi) * Fix core dump when executing large SQL. (Yoshiyuki Asaba) =============================================================================== 1.0 Series (2006/09/08 - 2007/02/12) =============================================================================== 1.0.2 (suboshi) 2007/02/12 * Version 1.0.2 * Fix bug when executing large SQL to prevent pgpool goes into infinite loop(Yoshiyuki Asaba) * Fix bug with extended protocol handling(Yoshiyuki Asaba) * Enhance log for failover and failback(Tatsuo Ishii) * Add backend status info to show pool_status(Tatsuo Ishii) * Fix UPDATE/DELETE returns wrong number of rows(Tatsuo Ishii) * Fix configure fails to link libpq when used with older version of gcc(Yoshiyuki Asaba) * Fix DEALLOCATE treatment when used with PHP:PDO DBD-Pg(Yoshiyuki Asaba) * Do not load balance SELECT FOR UPDATE, SELECT INTO and SELECT with comments. This behavior is compatible with pgpool-I(Yoshiyuki Asaba) * Obtain path to libpq using pg_config. --with-pgsql will be removed in next version(Yoshiyuki Asaba) * When reusing connection pool, reconnect to backend if the socket is broken(Yoshiyuki Asaba) * Fix error with configure when used with PostgreSQL 7.4(Yoshiyuki Asaba) =============================================================================== 1.0.1 (suboshi) 2006/09/22 * Version 1.0.1 * This version fixes bugs including master/slave not being working, deadlock problem in COPY FROM STDIN. Also documents are improved. =============================================================================== 1.0 (suboshi) 2006/09/08 * Initial release Local Variables: mode: outline End: pgpool-II-4.1.4/README0000664000175000017500000000004013730350075011117 00000000000000See the file doc/pgpool-en.html pgpool-II-4.1.4/TODO0000664000175000017500000000451513730350075010742 00000000000000$Header$ * General - Reset application name to "pgppol" when client disconnects(3.1. why not use set command?) -> Done. - Use reset_query_list to reset to "pgpool" for client disconnection - Reset to client specified application name when reusing existing connection. - Allow to call pcp commands/show commands as a stored procedures of PostgreSQL(3.1 SRAOSS) - Allow client encoding conversion. This was possible in pgpool-I - Avoid cross pgpool process deadlock situation. This is a long standing problem since pgpool-II was born (pgpool-I avoids this by setting timeout) - If DISCARD ALL is specified in the reset_query_list and transaction is not closed when client disconnects, automatically issue ABORT before issuing DISCARD ALL - Allow to specify queries issued when starting sessions - Audit functionality? - Make accept queue - Graceful attaching a node * Query handling - Allow multi statement - Enhance DROP DATABASE handling (not disconnect all idle connections) * Replication - Allow per table replication - Allow per session level and query level load balancing - More reliable way to replicate SEQUENCES - Allow to replicate OIDs, XIDs * Master/slave mode - Allow to use more than 1 standbys(3.1) * On line recovery * Query cache - Cache invalidation - More effcient cache (memcache?) * Log - Mutiple log levels(3.1, but low priority) - Multiple log destinations(3.1, but low priority) * Parallel query - Performance enhance for more complex queries - Allow to handle transaction - Allow to handle extended queries - process alias in FROM clause db=# select * from data1 as d1 inner join data2 as d2 on d1.id=d2.id; ERROR: sql error DETAIL: ERROR: missing FROM-clause entry for table "d1" LINE 1: SELECT pool_parallel("SELECT d1.id, d1.aaaa, d1.bbbb... ^ 2008-03-11 10:28:17 LOG: pid 6186: statement: SELECT pool_parallel("SELECT d1.id, d1.aaaa, d1.bbbb, a.cccc FROM data1") - process USING clause in JOIN * pgpoolAdmin - Allow to use double quotation in reset_query_list - German messages - Allow to run pgpoolAdmin on a host different from a host which pgpool-II is running on(3.2?) - Allow to stop PostgeSQL from pgpoolAdmin to make the on-line recovery more convenient(pgpool_stop()?) * Docs - Write libpcp API docs - French documentations(3.1) - German documentations(3.1) pgpool-II-4.1.4/compile0000664000175000017500000000000013730350075011606 00000000000000pgpool-II-4.1.4/config.guess0000775000175000017500000012743213730350075012576 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-4.1.4/config.sub0000775000175000017500000010517613730350075012242 00000000000000#! /bin/sh # Configuration validation subroutine script. # 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 (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software # can handle that machine. It does not imply ALL GNU software can. # # 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. # Please send patches to . Submit a context # diff and a properly formatted GNU ChangeLog entry. # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. # If it is invalid, we print an error message on stderr and exit with code 1. # Otherwise, we print the canonical config type on stdout and succeed. # You can get the latest version of this script from: # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases # that are meaningful with *any* GNU software. # Each package is responsible for reporting which valid configurations # it does not support. The user should be able to distinguish # a failure to support a valid configuration from a meaningless # configuration. # The goal of this file is to map all the various variations of a given # machine specification into a single specification in the form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or in some cases, the newer four-part form: # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # It is wrong to echo any other type of specification. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] CPU-MFR-OPSYS $0 [OPTION] ALIAS Canonicalize a configuration name. 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.sub ($timestamp) 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" exit 1 ;; *local*) # First pass through any local machine types. echo $1 exit ;; * ) break ;; esac done case $# in 0) echo "$me: missing argument$help" >&2 exit 1;; 1) ;; *) echo "$me: too many arguments$help" >&2 exit 1;; esac # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). # Here we must recognize all the valid KERNEL-OS combinations. maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ knetbsd*-gnu* | netbsd*-gnu* | \ kopensolaris*-gnu* | \ storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; android-linux) os=-linux-android basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown ;; *) basic_machine=`echo $1 | sed 's/-[^-]*$//'` if [ $basic_machine != $1 ] then os=`echo $1 | sed 's/.*-/-/'` else os=; fi ;; esac ### Let's recognize common machines as not being operating systems so ### that things like config.sub decstation-3100 work. We also ### recognize some manufacturers as not being operating systems, so we ### can provide default operating systems below. case $os in -sun*os*) # Prevent following clause from handling this invalid input. ;; -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ -apple | -axis | -knuth | -cray | -microblaze) os= basic_machine=$1 ;; -bluegene*) os=-cnk ;; -sim | -cisco | -oki | -wec | -winbond) os= basic_machine=$1 ;; -scout) ;; -wrs) os=-vxworks basic_machine=$1 ;; -chorusos*) os=-chorusos basic_machine=$1 ;; -chorusrdb) os=-chorusrdb basic_machine=$1 ;; -hiux*) os=-hiuxwe2 ;; -sco6) os=-sco5v6 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5) os=-sco3.2v5 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco4) os=-sco3.2v4 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2.[4-9]*) os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2v[4-9]*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5v6*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco*) os=-sco3.2v2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -udk*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -isc) os=-isc2.2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -clix*) basic_machine=clipper-intergraph ;; -isc*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -lynx*) os=-lynxos ;; -ptx*) basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` ;; -windowsnt*) os=`echo $os | sed -e 's/windowsnt/winnt/'` ;; -psos*) os=-psos ;; -mint | -mint[0-9]*) basic_machine=m68k-atari os=-mint ;; esac # Decode aliases for certain CPU-COMPANY combinations. case $basic_machine in # Recognize the basic CPU types without company name. # Some are omitted here because they have special meanings below. 1750a | 580 \ | a29k \ | aarch64 | aarch64_be \ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | am33_2.0 \ | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \ | be32 | be64 \ | bfin \ | c4x | clipper \ | d10v | d30v | dlx | dsp16xx \ | epiphany \ | fido | fr30 | frv \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | hexagon \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ | le32 | le64 \ | lm32 \ | m32c | m32r | m32rle | m68000 | m68k | m88k \ | maxq | mb | microblaze | mcore | mep | metag \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ | mips64octeon | mips64octeonel \ | mips64orion | mips64orionel \ | mips64r5900 | mips64r5900el \ | mips64vr | mips64vrel \ | mips64vr4100 | mips64vr4100el \ | mips64vr4300 | mips64vr4300el \ | mips64vr5000 | mips64vr5000el \ | mips64vr5900 | mips64vr5900el \ | mipsisa32 | mipsisa32el \ | mipsisa32r2 | mipsisa32r2el \ | mipsisa64 | mipsisa64el \ | mipsisa64r2 | mipsisa64r2el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ | moxie \ | mt \ | msp430 \ | nds32 | nds32le | nds32be \ | nios | nios2 \ | ns16k | ns32k \ | open8 \ | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle \ | pyramid \ | rl78 | rx \ | score \ | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ | spu \ | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ | ubicom32 \ | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ | we32k \ | x86 | xc16x | xstormy16 | xtensa \ | z8k | z80) basic_machine=$basic_machine-unknown ;; c54x) basic_machine=tic54x-unknown ;; c55x) basic_machine=tic55x-unknown ;; c6x) basic_machine=tic6x-unknown ;; m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | picochip) basic_machine=$basic_machine-unknown os=-none ;; m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) ;; ms1) basic_machine=mt-unknown ;; strongarm | thumb | xscale) basic_machine=arm-unknown ;; xgate) basic_machine=$basic_machine-unknown os=-none ;; xscaleeb) basic_machine=armeb-unknown ;; xscaleel) basic_machine=armel-unknown ;; # We use `pc' rather than `unknown' # because (1) that's what they normally are, and # (2) the word "unknown" tends to confuse beginning users. i*86 | x86_64) basic_machine=$basic_machine-pc ;; # Object if more than one company name word. *-*-*) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; # Recognize the basic CPU types with company name. 580-* \ | a29k-* \ | aarch64-* | aarch64_be-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* | avr32-* \ | be32-* | be64-* \ | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* \ | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | elxsi-* \ | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | hexagon-* \ | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* | iq2000-* \ | le32-* | le64-* \ | lm32-* \ | m32c-* | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ | m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ | mips64octeon-* | mips64octeonel-* \ | mips64orion-* | mips64orionel-* \ | mips64r5900-* | mips64r5900el-* \ | mips64vr-* | mips64vrel-* \ | mips64vr4100-* | mips64vr4100el-* \ | mips64vr4300-* | mips64vr4300el-* \ | mips64vr5000-* | mips64vr5000el-* \ | mips64vr5900-* | mips64vr5900el-* \ | mipsisa32-* | mipsisa32el-* \ | mipsisa32r2-* | mipsisa32r2el-* \ | mipsisa64-* | mipsisa64el-* \ | mipsisa64r2-* | mipsisa64r2el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipstx39-* | mipstx39el-* \ | mmix-* \ | mt-* \ | msp430-* \ | nds32-* | nds32le-* | nds32be-* \ | nios-* | nios2-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | open8-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ | pyramid-* \ | rl78-* | romp-* | rs6000-* | rx-* \ | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ | sparclite-* \ | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \ | tahoe-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ | tile*-* \ | tron-* \ | ubicom32-* \ | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ | vax-* \ | we32k-* \ | x86-* | x86_64-* | xc16x-* | xps100-* \ | xstormy16-* | xtensa*-* \ | ymp-* \ | z8k-* | z80-*) ;; # Recognize the basic CPU types without company name, with glob match. xtensa*) basic_machine=$basic_machine-unknown ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. 386bsd) basic_machine=i386-unknown os=-bsd ;; 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) basic_machine=m68000-att ;; 3b*) basic_machine=we32k-att ;; a29khif) basic_machine=a29k-amd os=-udi ;; abacus) basic_machine=abacus-unknown ;; adobe68k) basic_machine=m68010-adobe os=-scout ;; alliant | fx80) basic_machine=fx80-alliant ;; altos | altos3068) basic_machine=m68k-altos ;; am29k) basic_machine=a29k-none os=-bsd ;; amd64) basic_machine=x86_64-pc ;; amd64-*) basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; amdahl) basic_machine=580-amdahl os=-sysv ;; amiga | amiga-*) basic_machine=m68k-unknown ;; amigaos | amigados) basic_machine=m68k-unknown os=-amigaos ;; amigaunix | amix) basic_machine=m68k-unknown os=-sysv4 ;; apollo68) basic_machine=m68k-apollo os=-sysv ;; apollo68bsd) basic_machine=m68k-apollo os=-bsd ;; aros) basic_machine=i386-pc os=-aros ;; aux) basic_machine=m68k-apple os=-aux ;; balance) basic_machine=ns32k-sequent os=-dynix ;; blackfin) basic_machine=bfin-unknown os=-linux ;; blackfin-*) basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; bluegene*) basic_machine=powerpc-ibm os=-cnk ;; c54x-*) basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c55x-*) basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c6x-*) basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c90) basic_machine=c90-cray os=-unicos ;; cegcc) basic_machine=arm-unknown os=-cegcc ;; convex-c1) basic_machine=c1-convex os=-bsd ;; convex-c2) basic_machine=c2-convex os=-bsd ;; convex-c32) basic_machine=c32-convex os=-bsd ;; convex-c34) basic_machine=c34-convex os=-bsd ;; convex-c38) basic_machine=c38-convex os=-bsd ;; cray | j90) basic_machine=j90-cray os=-unicos ;; craynv) basic_machine=craynv-cray os=-unicosmp ;; cr16 | cr16-*) basic_machine=cr16-unknown os=-elf ;; crds | unos) basic_machine=m68k-crds ;; crisv32 | crisv32-* | etraxfs*) basic_machine=crisv32-axis ;; cris | cris-* | etrax*) basic_machine=cris-axis ;; crx) basic_machine=crx-unknown os=-elf ;; da30 | da30-*) basic_machine=m68k-da30 ;; decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) basic_machine=mips-dec ;; decsystem10* | dec10*) basic_machine=pdp10-dec os=-tops10 ;; decsystem20* | dec20*) basic_machine=pdp10-dec os=-tops20 ;; delta | 3300 | motorola-3300 | motorola-delta \ | 3300-motorola | delta-motorola) basic_machine=m68k-motorola ;; delta88) basic_machine=m88k-motorola os=-sysv3 ;; dicos) basic_machine=i686-pc os=-dicos ;; djgpp) basic_machine=i586-pc os=-msdosdjgpp ;; dpx20 | dpx20-*) basic_machine=rs6000-bull os=-bosx ;; dpx2* | dpx2*-bull) basic_machine=m68k-bull os=-sysv3 ;; ebmon29k) basic_machine=a29k-amd os=-ebmon ;; elxsi) basic_machine=elxsi-elxsi os=-bsd ;; encore | umax | mmax) basic_machine=ns32k-encore ;; es1800 | OSE68k | ose68k | ose | OSE) basic_machine=m68k-ericsson os=-ose ;; fx2800) basic_machine=i860-alliant ;; genix) basic_machine=ns32k-ns ;; gmicro) basic_machine=tron-gmicro os=-sysv ;; go32) basic_machine=i386-pc os=-go32 ;; h3050r* | hiux*) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; h8300hms) basic_machine=h8300-hitachi os=-hms ;; h8300xray) basic_machine=h8300-hitachi os=-xray ;; h8500hms) basic_machine=h8500-hitachi os=-hms ;; harris) basic_machine=m88k-harris os=-sysv3 ;; hp300-*) basic_machine=m68k-hp ;; hp300bsd) basic_machine=m68k-hp os=-bsd ;; hp300hpux) basic_machine=m68k-hp os=-hpux ;; hp3k9[0-9][0-9] | hp9[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k2[0-9][0-9] | hp9k31[0-9]) basic_machine=m68000-hp ;; hp9k3[2-9][0-9]) basic_machine=m68k-hp ;; hp9k6[0-9][0-9] | hp6[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k7[0-79][0-9] | hp7[0-79][0-9]) basic_machine=hppa1.1-hp ;; hp9k78[0-9] | hp78[0-9]) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[0-9][13679] | hp8[0-9][13679]) basic_machine=hppa1.1-hp ;; hp9k8[0-9][0-9] | hp8[0-9][0-9]) basic_machine=hppa1.0-hp ;; hppa-next) os=-nextstep3 ;; hppaosf) basic_machine=hppa1.1-hp os=-osf ;; hppro) basic_machine=hppa1.1-hp os=-proelf ;; i370-ibm* | ibm*) basic_machine=i370-ibm ;; i*86v32) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv32 ;; i*86v4*) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv4 ;; i*86v) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv ;; i*86sol2) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-solaris2 ;; i386mach) basic_machine=i386-mach os=-mach ;; i386-vsta | vsta) basic_machine=i386-unknown os=-vsta ;; iris | iris4d) basic_machine=mips-sgi case $os in -irix*) ;; *) os=-irix4 ;; esac ;; isi68 | isi) basic_machine=m68k-isi os=-sysv ;; m68knommu) basic_machine=m68k-unknown os=-linux ;; m68knommu-*) basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; m88k-omron*) basic_machine=m88k-omron ;; magnum | m3230) basic_machine=mips-mips os=-sysv ;; merlin) basic_machine=ns32k-utek os=-sysv ;; microblaze) basic_machine=microblaze-xilinx ;; mingw32) basic_machine=i386-pc os=-mingw32 ;; mingw32ce) basic_machine=arm-unknown os=-mingw32ce ;; miniframe) basic_machine=m68000-convergent ;; *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) basic_machine=m68k-atari os=-mint ;; mips3*-*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` ;; mips3*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown ;; monitor) basic_machine=m68k-rom68k os=-coff ;; morphos) basic_machine=powerpc-unknown os=-morphos ;; msdos) basic_machine=i386-pc os=-msdos ;; ms1-*) basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` ;; msys) basic_machine=i386-pc os=-msys ;; mvs) basic_machine=i370-ibm os=-mvs ;; nacl) basic_machine=le32-unknown os=-nacl ;; ncr3000) basic_machine=i486-ncr os=-sysv4 ;; netbsd386) basic_machine=i386-unknown os=-netbsd ;; netwinder) basic_machine=armv4l-rebel os=-linux ;; news | news700 | news800 | news900) basic_machine=m68k-sony os=-newsos ;; news1000) basic_machine=m68030-sony os=-newsos ;; news-3600 | risc-news) basic_machine=mips-sony os=-newsos ;; necv70) basic_machine=v70-nec os=-sysv ;; next | m*-next ) basic_machine=m68k-next case $os in -nextstep* ) ;; -ns2*) os=-nextstep2 ;; *) os=-nextstep3 ;; esac ;; nh3000) basic_machine=m68k-harris os=-cxux ;; nh[45]000) basic_machine=m88k-harris os=-cxux ;; nindy960) basic_machine=i960-intel os=-nindy ;; mon960) basic_machine=i960-intel os=-mon960 ;; nonstopux) basic_machine=mips-compaq os=-nonstopux ;; np1) basic_machine=np1-gould ;; neo-tandem) basic_machine=neo-tandem ;; nse-tandem) basic_machine=nse-tandem ;; nsr-tandem) basic_machine=nsr-tandem ;; op50n-* | op60c-*) basic_machine=hppa1.1-oki os=-proelf ;; openrisc | openrisc-*) basic_machine=or32-unknown ;; os400) basic_machine=powerpc-ibm os=-os400 ;; OSE68000 | ose68000) basic_machine=m68000-ericsson os=-ose ;; os68k) basic_machine=m68k-none os=-os68k ;; pa-hitachi) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; paragon) basic_machine=i860-intel os=-osf ;; parisc) basic_machine=hppa-unknown os=-linux ;; parisc-*) basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; pbd) basic_machine=sparc-tti ;; pbb) basic_machine=m68k-tti ;; pc532 | pc532-*) basic_machine=ns32k-pc532 ;; pc98) basic_machine=i386-pc ;; pc98-*) basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium | p5 | k5 | k6 | nexgen | viac3) basic_machine=i586-pc ;; pentiumpro | p6 | 6x86 | athlon | athlon_*) basic_machine=i686-pc ;; pentiumii | pentium2 | pentiumiii | pentium3) basic_machine=i686-pc ;; pentium4) basic_machine=i786-pc ;; pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumpro-* | p6-* | 6x86-* | athlon-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium4-*) basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pn) basic_machine=pn-gould ;; power) basic_machine=power-ibm ;; ppc | ppcbe) basic_machine=powerpc-unknown ;; ppc-* | ppcbe-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppcle | powerpclittle | ppc-le | powerpc-little) basic_machine=powerpcle-unknown ;; ppcle-* | powerpclittle-*) basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64) basic_machine=powerpc64-unknown ;; ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64le | powerpc64little | ppc64-le | powerpc64-little) basic_machine=powerpc64le-unknown ;; ppc64le-* | powerpc64little-*) basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ps2) basic_machine=i386-ibm ;; pw32) basic_machine=i586-unknown os=-pw32 ;; rdos) basic_machine=i386-pc os=-rdos ;; rom68k) basic_machine=m68k-rom68k os=-coff ;; rm[46]00) basic_machine=mips-siemens ;; rtpc | rtpc-*) basic_machine=romp-ibm ;; s390 | s390-*) basic_machine=s390-ibm ;; s390x | s390x-*) basic_machine=s390x-ibm ;; sa29200) basic_machine=a29k-amd os=-udi ;; sb1) basic_machine=mipsisa64sb1-unknown ;; sb1el) basic_machine=mipsisa64sb1el-unknown ;; sde) basic_machine=mipsisa32-sde os=-elf ;; sei) basic_machine=mips-sei os=-seiux ;; sequent) basic_machine=i386-sequent ;; sh) basic_machine=sh-hitachi os=-hms ;; sh5el) basic_machine=sh5le-unknown ;; sh64) basic_machine=sh64-unknown ;; sparclite-wrs | simso-wrs) basic_machine=sparclite-wrs os=-vxworks ;; sps7) basic_machine=m68k-bull os=-sysv2 ;; spur) basic_machine=spur-unknown ;; st2000) basic_machine=m68k-tandem ;; stratus) basic_machine=i860-stratus os=-sysv4 ;; strongarm-* | thumb-*) basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'` ;; sun2) basic_machine=m68000-sun ;; sun2os3) basic_machine=m68000-sun os=-sunos3 ;; sun2os4) basic_machine=m68000-sun os=-sunos4 ;; sun3os3) basic_machine=m68k-sun os=-sunos3 ;; sun3os4) basic_machine=m68k-sun os=-sunos4 ;; sun4os3) basic_machine=sparc-sun os=-sunos3 ;; sun4os4) basic_machine=sparc-sun os=-sunos4 ;; sun4sol2) basic_machine=sparc-sun os=-solaris2 ;; sun3 | sun3-*) basic_machine=m68k-sun ;; sun4) basic_machine=sparc-sun ;; sun386 | sun386i | roadrunner) basic_machine=i386-sun ;; sv1) basic_machine=sv1-cray os=-unicos ;; symmetry) basic_machine=i386-sequent os=-dynix ;; t3e) basic_machine=alphaev5-cray os=-unicos ;; t90) basic_machine=t90-cray os=-unicos ;; tile*) basic_machine=$basic_machine-unknown os=-linux-gnu ;; tx39) basic_machine=mipstx39-unknown ;; tx39el) basic_machine=mipstx39el-unknown ;; toad1) basic_machine=pdp10-xkl os=-tops20 ;; tower | tower-32) basic_machine=m68k-ncr ;; tpf) basic_machine=s390x-ibm os=-tpf ;; udi29k) basic_machine=a29k-amd os=-udi ;; ultra3) basic_machine=a29k-nyu os=-sym1 ;; v810 | necv810) basic_machine=v810-nec os=-none ;; vaxv) basic_machine=vax-dec os=-sysv ;; vms) basic_machine=vax-dec os=-vms ;; vpp*|vx|vx-*) basic_machine=f301-fujitsu ;; vxworks960) basic_machine=i960-wrs os=-vxworks ;; vxworks68) basic_machine=m68k-wrs os=-vxworks ;; vxworks29k) basic_machine=a29k-wrs os=-vxworks ;; w65*) basic_machine=w65-wdc os=-none ;; w89k-*) basic_machine=hppa1.1-winbond os=-proelf ;; xbox) basic_machine=i686-pc os=-mingw32 ;; xps | xps100) basic_machine=xps100-honeywell ;; xscale-* | xscalee[bl]-*) basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'` ;; ymp) basic_machine=ymp-cray os=-unicos ;; z8k-*-coff) basic_machine=z8k-unknown os=-sim ;; z80-*-coff) basic_machine=z80-unknown os=-sim ;; none) basic_machine=none-none os=-none ;; # Here we handle the default manufacturer of certain CPU types. It is in # some cases the only manufacturer, in others, it is the most popular. w89k) basic_machine=hppa1.1-winbond ;; op50n) basic_machine=hppa1.1-oki ;; op60c) basic_machine=hppa1.1-oki ;; romp) basic_machine=romp-ibm ;; mmix) basic_machine=mmix-knuth ;; rs6000) basic_machine=rs6000-ibm ;; vax) basic_machine=vax-dec ;; pdp10) # there are many clones, so DEC is not a safe bet basic_machine=pdp10-unknown ;; pdp11) basic_machine=pdp11-dec ;; we32k) basic_machine=we32k-att ;; sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele) basic_machine=sh-unknown ;; sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) basic_machine=sparc-sun ;; cydra) basic_machine=cydra-cydrome ;; orion) basic_machine=orion-highlevel ;; orion105) basic_machine=clipper-highlevel ;; mac | mpw | mac-mpw) basic_machine=m68k-apple ;; pmac | pmac-mpw) basic_machine=powerpc-apple ;; *-unknown) # Make sure to match an already-canonicalized machine name. ;; *) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; esac # Here we canonicalize certain aliases for manufacturers. case $basic_machine in *-digital*) basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` ;; *-commodore*) basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` ;; *) ;; esac # Decode manufacturer-specific aliases for certain operating systems. if [ x"$os" != x"" ] then case $os in # First match some system type aliases # that might get confused with valid system types. # -solaris* is a basic system type, with this one exception. -auroraux) os=-auroraux ;; -solaris1 | -solaris1.*) os=`echo $os | sed -e 's|solaris1|sunos4|'` ;; -solaris) os=-solaris2 ;; -svr4*) os=-sysv4 ;; -unixware*) os=-sysv4.2uw ;; -gnu/linux*) os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` ;; # First accept the basic system types. # The portable systems comes first. # Each alternative MUST END IN A *, to match a version number. # -sysv* is not here because it comes later, after sysvr4. -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ | -sym* | -kopensolaris* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ | -aos* | -aros* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ | -openbsd* | -solidbsd* \ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -chorusos* | -chorusrdb* | -cegcc* \ | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -linux-gnu* | -linux-android* \ | -linux-newlib* | -linux-uclibc* \ | -uxpv* | -beos* | -mpeix* | -udk* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) case $basic_machine in x86-* | i*86-*) ;; *) os=-nto$os ;; esac ;; -nto-qnx*) ;; -nto*) os=`echo $os | sed -e 's|nto|nto-qnx|'` ;; -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) ;; -mac*) os=`echo $os | sed -e 's|mac|macos|'` ;; -linux-dietlibc) os=-linux-dietlibc ;; -linux*) os=`echo $os | sed -e 's|linux|linux-gnu|'` ;; -sunos5*) os=`echo $os | sed -e 's|sunos5|solaris2|'` ;; -sunos6*) os=`echo $os | sed -e 's|sunos6|solaris3|'` ;; -opened*) os=-openedition ;; -os400*) os=-os400 ;; -wince*) os=-wince ;; -osfrose*) os=-osfrose ;; -osf*) os=-osf ;; -utek*) os=-bsd ;; -dynix*) os=-bsd ;; -acis*) os=-aos ;; -atheos*) os=-atheos ;; -syllable*) os=-syllable ;; -386bsd) os=-bsd ;; -ctix* | -uts*) os=-sysv ;; -nova*) os=-rtmk-nova ;; -ns2 ) os=-nextstep2 ;; -nsk*) os=-nsk ;; # Preserve the version number of sinix5. -sinix5.*) os=`echo $os | sed -e 's|sinix|sysv|'` ;; -sinix*) os=-sysv4 ;; -tpf*) os=-tpf ;; -triton*) os=-sysv3 ;; -oss*) os=-sysv3 ;; -svr4) os=-sysv4 ;; -svr3) os=-sysv3 ;; -sysvr4) os=-sysv4 ;; # This must come after -sysvr4. -sysv*) ;; -ose*) os=-ose ;; -es1800*) os=-ose ;; -xenix) os=-xenix ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) os=-mint ;; -aros*) os=-aros ;; -kaos*) os=-kaos ;; -zvmoe) os=-zvmoe ;; -dicos*) os=-dicos ;; -nacl*) ;; -none) ;; *) # Get rid of the `-' at the beginning of $os. os=`echo $os | sed 's/[^-]*-//'` echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 exit 1 ;; esac else # Here we handle the default operating systems that come with various machines. # The value should be what the vendor currently ships out the door with their # machine or put another way, the most popular os provided with the machine. # Note that if you're going to try to match "-MANUFACTURER" here (say, # "-sun"), then you have to tell the case statement up towards the top # that MANUFACTURER isn't an operating system. Otherwise, code above # will signal an error saying that MANUFACTURER isn't an operating # system, and we'll never get to this point. case $basic_machine in score-*) os=-elf ;; spu-*) os=-elf ;; *-acorn) os=-riscix1.2 ;; arm*-rebel) os=-linux ;; arm*-semi) os=-aout ;; c4x-* | tic4x-*) os=-coff ;; tic54x-*) os=-coff ;; tic55x-*) os=-coff ;; tic6x-*) os=-coff ;; # This must come before the *-dec entry. pdp10-*) os=-tops20 ;; pdp11-*) os=-none ;; *-dec | vax-*) os=-ultrix4.2 ;; m68*-apollo) os=-domain ;; i386-sun) os=-sunos4.0.2 ;; m68000-sun) os=-sunos3 ;; m68*-cisco) os=-aout ;; mep-*) os=-elf ;; mips*-cisco) os=-elf ;; mips*-*) os=-elf ;; or32-*) os=-coff ;; *-tti) # must be before sparc entry or we get the wrong os. os=-sysv3 ;; sparc-* | *-sun) os=-sunos4.1.1 ;; *-be) os=-beos ;; *-haiku) os=-haiku ;; *-ibm) os=-aix ;; *-knuth) os=-mmixware ;; *-wec) os=-proelf ;; *-winbond) os=-proelf ;; *-oki) os=-proelf ;; *-hp) os=-hpux ;; *-hitachi) os=-hiux ;; i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) os=-sysv ;; *-cbm) os=-amigaos ;; *-dg) os=-dgux ;; *-dolphin) os=-sysv3 ;; m68k-ccur) os=-rtu ;; m88k-omron*) os=-luna ;; *-next ) os=-nextstep ;; *-sequent) os=-ptx ;; *-crds) os=-unos ;; *-ns) os=-genix ;; i370-*) os=-mvs ;; *-next) os=-nextstep3 ;; *-gould) os=-sysv ;; *-highlevel) os=-bsd ;; *-encore) os=-bsd ;; *-sgi) os=-irix ;; *-siemens) os=-sysv4 ;; *-masscomp) os=-rtu ;; f30[01]-fujitsu | f700-fujitsu) os=-uxpv ;; *-rom68k) os=-coff ;; *-*bug) os=-coff ;; *-apple) os=-macos ;; *-atari*) os=-mint ;; *) os=-none ;; esac fi # Here we handle the case where we know the os, and the CPU type, but not the # manufacturer. We pick the logical manufacturer. vendor=unknown case $basic_machine in *-unknown) case $os in -riscix*) vendor=acorn ;; -sunos*) vendor=sun ;; -cnk*|-aix*) vendor=ibm ;; -beos*) vendor=be ;; -hpux*) vendor=hp ;; -mpeix*) vendor=hp ;; -hiux*) vendor=hitachi ;; -unos*) vendor=crds ;; -dgux*) vendor=dg ;; -luna*) vendor=omron ;; -genix*) vendor=ns ;; -mvs* | -opened*) vendor=ibm ;; -os400*) vendor=ibm ;; -ptx*) vendor=sequent ;; -tpf*) vendor=ibm ;; -vxsim* | -vxworks* | -windiss*) vendor=wrs ;; -aux*) vendor=apple ;; -hms*) vendor=hitachi ;; -mpw* | -macos*) vendor=apple ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) vendor=atari ;; -vos*) vendor=stratus ;; esac basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` ;; esac echo $basic_machine$os exit # 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-4.1.4/depcomp0000775000175000017500000004755613730350075011643 00000000000000#! /bin/sh # depcomp - compile a program generating dependencies as side-effects scriptversion=2011-12-04.11; # UTC # Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009, 2010, # 2011 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 2, 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 Alexandre Oliva . case $1 in '') echo "$0: No command. Try \`$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: depcomp [--help] [--version] PROGRAM [ARGS] Run PROGRAMS ARGS to compile a file, generating dependencies as side-effects. Environment variables: depmode Dependency tracking mode. source Source file read by `PROGRAMS ARGS'. object Object file output by `PROGRAMS ARGS'. DEPDIR directory where to store dependencies. depfile Dependency file to output. tmpdepfile Temporary file to use when outputting dependencies. libtool Whether libtool is used (yes/no). Report bugs to . EOF exit $? ;; -v | --v*) echo "depcomp $scriptversion" exit $? ;; esac if test -z "$depmode" || test -z "$source" || test -z "$object"; then echo "depcomp: Variables source, object and depmode must be set" 1>&2 exit 1 fi # Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. depfile=${depfile-`echo "$object" | sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} rm -f "$tmpdepfile" # Some modes work just like other modes, but use different flags. We # parameterize here, but still list the modes in the big case below, # to make depend.m4 easier to write. Note that we *cannot* use a case # here, because this file can only contain one case statement. if test "$depmode" = hp; then # HP compiler uses -M and no extra arg. gccflag=-M depmode=gcc fi if test "$depmode" = dashXmstdout; then # This is just like dashmstdout with a different argument. dashmflag=-xM depmode=dashmstdout fi cygpath_u="cygpath -u -f -" if test "$depmode" = msvcmsys; then # This is just like msvisualcpp but w/o cygpath translation. # Just convert the backslash-escaped backslashes to single forward # slashes to satisfy depend.m4 cygpath_u='sed s,\\\\,/,g' depmode=msvisualcpp fi if test "$depmode" = msvc7msys; then # This is just like msvc7 but w/o cygpath translation. # Just convert the backslash-escaped backslashes to single forward # slashes to satisfy depend.m4 cygpath_u='sed s,\\\\,/,g' depmode=msvc7 fi case "$depmode" in gcc3) ## gcc 3 implements dependency tracking that does exactly what ## we want. Yay! Note: for some reason libtool 1.4 doesn't like ## it if -MD -MP comes after the -MF stuff. Hmm. ## Unfortunately, FreeBSD c89 acceptance of flags depends upon ## the command line argument order; so add the flags where they ## appear in depend2.am. Note that the slowdown incurred here ## affects only configure: in makefiles, %FASTDEP% shortcuts this. for arg do case $arg in -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;; *) set fnord "$@" "$arg" ;; esac shift # fnord shift # $arg done "$@" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi mv "$tmpdepfile" "$depfile" ;; gcc) ## There are various ways to get dependency output from gcc. Here's ## why we pick this rather obscure method: ## - Don't want to use -MD because we'd like the dependencies to end ## up in a subdir. Having to rename by hand is ugly. ## (We might end up doing this anyway to support other compilers.) ## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like ## -MM, not -M (despite what the docs say). ## - Using -M directly means running the compiler twice (even worse ## than renaming). if test -z "$gccflag"; then gccflag=-MD, fi "$@" -Wp,"$gccflag$tmpdepfile" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz ## The second -e expression handles DOS-style file names with drive letters. sed -e 's/^[^:]*: / /' \ -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" ## This next piece of magic avoids the `deleted header file' problem. ## The problem is that when a header file which appears in a .P file ## is deleted, the dependency causes make to die (because there is ## typically no way to rebuild the header). We avoid this by adding ## dummy dependencies for each header file. Too bad gcc doesn't do ## this for us directly. tr ' ' ' ' < "$tmpdepfile" | ## Some versions of gcc put a space before the `:'. On the theory ## that the space means something, we add a space to the output as ## well. hp depmode also adds that space, but also prefixes the VPATH ## to the object. Take care to not repeat it in the output. ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; sgi) if test "$libtool" = yes; then "$@" "-Wp,-MDupdate,$tmpdepfile" else "$@" -MDupdate "$tmpdepfile" fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files echo "$object : \\" > "$depfile" # Clip off the initial element (the dependent). Don't try to be # clever and replace this with sed code, as IRIX sed won't handle # lines with more than a fixed number of characters (4096 in # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; # the IRIX cc adds comments like `#:fec' to the end of the # dependency line. tr ' ' ' ' < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \ tr ' ' ' ' >> "$depfile" echo >> "$depfile" # The second pass generates a dummy entry for each header file. tr ' ' ' ' < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ >> "$depfile" else # The sourcefile does not contain any dependencies, so just # store a dummy comment line, to avoid errors with the Makefile # "include basename.Plo" scheme. echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; aix) # The C for AIX Compiler uses -M and outputs the dependencies # in a .u file. In older versions, this file always lives in the # current directory. Also, the AIX compiler puts `$object:' at the # start of each line; $object doesn't have directory information. # Version 6 uses the directory in both cases. dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` test "x$dir" = "x$object" && dir= base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` if test "$libtool" = yes; then tmpdepfile1=$dir$base.u tmpdepfile2=$base.u tmpdepfile3=$dir.libs/$base.u "$@" -Wc,-M else tmpdepfile1=$dir$base.u tmpdepfile2=$dir$base.u tmpdepfile3=$dir$base.u "$@" -M fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then # Each line is of the form `foo.o: dependent.h'. # Do two passes, one to just change these to # `$object: dependent.h' and one to simply `dependent.h:'. sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" # That's a tab and a space in the []. sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" else # The sourcefile does not contain any dependencies, so just # store a dummy comment line, to avoid errors with the Makefile # "include basename.Plo" scheme. echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; icc) # Intel's C compiler understands `-MD -MF file'. However on # icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c # ICC 7.0 will fill foo.d with something like # foo.o: sub/foo.c # foo.o: sub/foo.h # which is wrong. We want: # sub/foo.o: sub/foo.c # sub/foo.o: sub/foo.h # sub/foo.c: # sub/foo.h: # ICC 7.1 will output # foo.o: sub/foo.c sub/foo.h # and will wrap long lines using \ : # foo.o: sub/foo.c ... \ # sub/foo.h ... \ # ... "$@" -MD -MF "$tmpdepfile" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" # Each line is of the form `foo.o: dependent.h', # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. # Do two passes, one to just change these to # `$object: dependent.h' and one to simply `dependent.h:'. sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process this invocation # correctly. Breaking it into two sed invocations is a workaround. sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp2) # The "hp" stanza above does not work with aCC (C++) and HP's ia64 # compilers, which have integrated preprocessors. The correct option # to use with these is +Maked; it writes dependencies to a file named # 'foo.d', which lands next to the object file, wherever that # happens to be. # Much of this is similar to the tru64 case; see comments there. dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` test "x$dir" = "x$object" && dir= base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` if test "$libtool" = yes; then tmpdepfile1=$dir$base.d tmpdepfile2=$dir.libs/$base.d "$@" -Wc,+Maked else tmpdepfile1=$dir$base.d tmpdepfile2=$dir$base.d "$@" +Maked fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile1" "$tmpdepfile2" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile" # Add `dependent.h:' lines. sed -ne '2,${ s/^ *// s/ \\*$// s/$/:/ p }' "$tmpdepfile" >> "$depfile" else echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" "$tmpdepfile2" ;; tru64) # The Tru64 compiler uses -MD to generate dependencies as a side # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'. # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put # dependencies in `foo.d' instead, so we check for that too. # Subdirectories are respected. dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` test "x$dir" = "x$object" && dir= base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` if test "$libtool" = yes; then # With Tru64 cc, shared objects can also be used to make a # static library. This mechanism is used in libtool 1.4 series to # handle both shared and static libraries in a single compilation. # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d. # # With libtool 1.5 this exception was removed, and libtool now # generates 2 separate objects for the 2 libraries. These two # compilations output dependencies in $dir.libs/$base.o.d and # in $dir$base.o.d. We have to check for both files, because # one of the two compilations can be disabled. We should prefer # $dir$base.o.d over $dir.libs/$base.o.d because the latter is # automatically cleaned when .libs/ is deleted, while ignoring # the former would cause a distcleancheck panic. tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4 tmpdepfile2=$dir$base.o.d # libtool 1.5 tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5 tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504 "$@" -Wc,-MD else tmpdepfile1=$dir$base.o.d tmpdepfile2=$dir$base.d tmpdepfile3=$dir$base.d tmpdepfile4=$dir$base.d "$@" -MD fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" # That's a tab and a space in the []. sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" else echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; msvc7) if test "$libtool" = yes; then showIncludes=-Wc,-showIncludes else showIncludes=-showIncludes fi "$@" $showIncludes > "$tmpdepfile" stat=$? grep -v '^Note: including file: ' "$tmpdepfile" if test "$stat" = 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" # The first sed program below extracts the file names and escapes # backslashes for cygpath. The second sed program outputs the file # name when reading, but also accumulates all include files in the # hold buffer in order to output them again at the end. This only # works with sed implementations that can handle large buffers. sed < "$tmpdepfile" -n ' /^Note: including file: *\(.*\)/ { s//\1/ s/\\/\\\\/g p }' | $cygpath_u | sort -u | sed -n ' s/ /\\ /g s/\(.*\)/ \1 \\/p s/.\(.*\) \\/\1:/ H $ { s/.*/ / G p }' >> "$depfile" rm -f "$tmpdepfile" ;; msvc7msys) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; #nosideeffect) # This comment above is used by automake to tell side-effect # dependency tracking mechanisms from slower ones. dashmstdout) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout, regardless of -o. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # Remove `-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done test -z "$dashmflag" && dashmflag=-M # Require at least two characters before searching for `:' # in the target name. This is to cope with DOS-style filenames: # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise. "$@" $dashmflag | sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" tr ' ' ' ' < "$tmpdepfile" | \ ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; dashXmstdout) # This case only exists to satisfy depend.m4. It is never actually # run, as this mode is specially recognized in the preamble. exit 1 ;; makedepend) "$@" || exit $? # Remove any Libtool call if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # X makedepend shift cleared=no eat=no for arg do case $cleared in no) set ""; shift cleared=yes ;; esac if test $eat = yes; then eat=no continue fi case "$arg" in -D*|-I*) set fnord "$@" "$arg"; shift ;; # Strip any option that makedepend may not understand. Remove # the object too, otherwise makedepend will parse it as a source file. -arch) eat=yes ;; -*|$object) ;; *) set fnord "$@" "$arg"; shift ;; esac done obj_suffix=`echo "$object" | sed 's/^.*\././'` touch "$tmpdepfile" ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" rm -f "$depfile" # makedepend may prepend the VPATH from the source file name to the object. # No need to regex-escape $object, excess matching of '.' is harmless. sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile" sed '1,2d' "$tmpdepfile" | tr ' ' ' ' | \ ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" "$tmpdepfile".bak ;; cpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # Remove `-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done "$@" -E | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' | sed '$ s: \\$::' > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" cat < "$tmpdepfile" >> "$depfile" sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; msvisualcpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi IFS=" " for arg do case "$arg" in -o) shift ;; $object) shift ;; "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") set fnord "$@" shift shift ;; *) set fnord "$@" "$arg" shift shift ;; esac done "$@" -E 2>/dev/null | sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile" echo " " >> "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile" rm -f "$tmpdepfile" ;; msvcmsys) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; none) exec "$@" ;; *) echo "Unknown depmode $depmode" 1>&2 exit 1 ;; esac exit 0 # Local Variables: # mode: shell-script # sh-indentation: 2 # 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-4.1.4/install-sh0000775000175000017500000003325613730350075012262 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-4.1.4/missing0000775000175000017500000002415213730350075011650 00000000000000#! /bin/sh # Common stub for a few missing GNU programs while installing. scriptversion=2012-01-06.13; # UTC # Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006, # 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc. # Originally by Fran,cois Pinard , 1996. # 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 2, 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. if test $# -eq 0; then echo 1>&2 "Try \`$0 --help' for more information" exit 1 fi run=: sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p' sed_minuso='s/.* -o \([^ ]*\).*/\1/p' # In the cases where this matters, `missing' is being run in the # srcdir already. if test -f configure.ac; then configure_ac=configure.ac else configure_ac=configure.in fi msg="missing on your system" case $1 in --run) # Try to run requested program, and just exit if it succeeds. run= shift "$@" && exit 0 # Exit code 63 means version mismatch. This often happens # when the user try to use an ancient version of a tool on # a file that requires a minimum version. In this case we # we should proceed has if the program had been absent, or # if --run hadn't been passed. if test $? = 63; then run=: msg="probably too old" fi ;; -h|--h|--he|--hel|--help) echo "\ $0 [OPTION]... PROGRAM [ARGUMENT]... Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an error status if there is no known handling for PROGRAM. Options: -h, --help display this help and exit -v, --version output version information and exit --run try to run the given command, and emulate it if it fails Supported PROGRAM values: aclocal touch file \`aclocal.m4' autoconf touch file \`configure' autoheader touch file \`config.h.in' autom4te touch the output file, or create a stub one automake touch all \`Makefile.in' files bison create \`y.tab.[ch]', if possible, from existing .[ch] flex create \`lex.yy.c', if possible, from existing .c help2man touch the output file lex create \`lex.yy.c', if possible, from existing .c makeinfo touch the output file yacc create \`y.tab.[ch]', if possible, from existing .[ch] Version suffixes to PROGRAM as well as the prefixes \`gnu-', \`gnu', and \`g' are ignored when checking the name. Send bug reports to ." exit $? ;; -v|--v|--ve|--ver|--vers|--versi|--versio|--version) echo "missing $scriptversion (GNU Automake)" exit $? ;; -*) echo 1>&2 "$0: Unknown \`$1' option" echo 1>&2 "Try \`$0 --help' for more information" exit 1 ;; esac # normalize program name to check for. program=`echo "$1" | sed ' s/^gnu-//; t s/^gnu//; t s/^g//; t'` # Now exit if we have it, but it failed. Also exit now if we # don't have it and --version was passed (most likely to detect # the program). This is about non-GNU programs, so use $1 not # $program. case $1 in lex*|yacc*) # Not GNU programs, they don't have --version. ;; *) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 elif test "x$2" = "x--version" || test "x$2" = "x--help"; then # Could not run --version or --help. This is probably someone # running `$TOOL --version' or `$TOOL --help' to check whether # $TOOL exists and not knowing $TOOL uses missing. exit 1 fi ;; esac # If it does not exist, or fails to run (possibly an outdated version), # try to emulate it. case $program in aclocal*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`acinclude.m4' or \`${configure_ac}'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." touch aclocal.m4 ;; autoconf*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`${configure_ac}'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." touch configure ;; autoheader*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`acconfig.h' or \`${configure_ac}'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}` test -z "$files" && files="config.h" touch_files= for f in $files; do case $f in *:*) touch_files="$touch_files "`echo "$f" | sed -e 's/^[^:]*://' -e 's/:.*//'`;; *) touch_files="$touch_files $f.in";; esac done touch $touch_files ;; automake*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." find . -type f -name Makefile.am -print | sed 's/\.am$/.in/' | while read f; do touch "$f"; done ;; autom4te*) echo 1>&2 "\ WARNING: \`$1' is needed, but is $msg. You might have modified some files without having the proper tools for further handling them. You can get \`$1' as part of \`Autoconf' from any GNU archive site." file=`echo "$*" | sed -n "$sed_output"` test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` if test -f "$file"; then touch $file else test -z "$file" || exec >$file echo "#! /bin/sh" echo "# Created by GNU Automake missing as a replacement of" echo "# $ $@" echo "exit 0" chmod +x $file exit 1 fi ;; bison*|yacc*) echo 1>&2 "\ WARNING: \`$1' $msg. You should only need it if you modified a \`.y' file. You may need the \`Bison' package in order for those modifications to take effect. You can get \`Bison' from any GNU archive site." rm -f y.tab.c y.tab.h if test $# -ne 1; then eval LASTARG=\${$#} case $LASTARG in *.y) SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` if test -f "$SRCFILE"; then cp "$SRCFILE" y.tab.c fi SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` if test -f "$SRCFILE"; then cp "$SRCFILE" y.tab.h fi ;; esac fi if test ! -f y.tab.h; then echo >y.tab.h fi if test ! -f y.tab.c; then echo 'main() { return 0; }' >y.tab.c fi ;; lex*|flex*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a \`.l' file. You may need the \`Flex' package in order for those modifications to take effect. You can get \`Flex' from any GNU archive site." rm -f lex.yy.c if test $# -ne 1; then eval LASTARG=\${$#} case $LASTARG in *.l) SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` if test -f "$SRCFILE"; then cp "$SRCFILE" lex.yy.c fi ;; esac fi if test ! -f lex.yy.c; then echo 'main() { return 0; }' >lex.yy.c fi ;; help2man*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a dependency of a manual page. You may need the \`Help2man' package in order for those modifications to take effect. You can get \`Help2man' from any GNU archive site." file=`echo "$*" | sed -n "$sed_output"` test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` if test -f "$file"; then touch $file else test -z "$file" || exec >$file echo ".ab help2man is required to generate this page" exit $? fi ;; makeinfo*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a \`.texi' or \`.texinfo' file, or any other file indirectly affecting the aspect of the manual. The spurious call might also be the consequence of using a buggy \`make' (AIX, DU, IRIX). You might want to install the \`Texinfo' package or the \`GNU make' package. Grab either from any GNU archive site." # The file to touch is that specified with -o ... file=`echo "$*" | sed -n "$sed_output"` test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` if test -z "$file"; then # ... or it is the one specified with @setfilename ... infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` file=`sed -n ' /^@setfilename/{ s/.* \([^ ]*\) *$/\1/ p q }' $infile` # ... or it is derived from the source name (dir/f.texi becomes f.info) test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info fi # If the file does not exist, the user really needs makeinfo; # let's fail without touching anything. test -f $file || exit 1 touch $file ;; *) echo 1>&2 "\ WARNING: \`$1' is needed, and is $msg. You might have modified some files without having the proper tools for further handling them. Check the \`README' file, it often tells you about the needed prerequisites for installing this package. You may also peek at any GNU archive site, in case some other package would contain this missing \`$1' program." exit 1 ;; esac exit 0 # 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-4.1.4/ylwrap0000775000175000017500000001435713730350075011523 00000000000000#! /bin/sh # ylwrap - wrapper for lex/yacc invocations. scriptversion=2011-08-25.18; # UTC # Copyright (C) 1996, 1997, 1998, 1999, 2001, 2002, 2003, 2004, 2005, # 2007, 2009, 2010, 2011 Free Software Foundation, Inc. # # Written by Tom Tromey . # # 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 2, 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. # This file is maintained in Automake, please report # bugs to or send patches to # . case "$1" in '') echo "$0: No files given. Try \`$0 --help' for more information." 1>&2 exit 1 ;; --basedir) basedir=$2 shift 2 ;; -h|--h*) cat <<\EOF Usage: ylwrap [--help|--version] INPUT [OUTPUT DESIRED]... -- PROGRAM [ARGS]... Wrapper for lex/yacc invocations, renaming files as desired. INPUT is the input file OUTPUT is one file PROG generates DESIRED is the file we actually want instead of OUTPUT PROGRAM is program to run ARGS are passed to PROG Any number of OUTPUT,DESIRED pairs may be used. Report bugs to . EOF exit $? ;; -v|--v*) echo "ylwrap $scriptversion" exit $? ;; esac # The input. input="$1" shift case "$input" in [\\/]* | ?:[\\/]*) # Absolute path; do nothing. ;; *) # Relative path. Make it absolute. input="`pwd`/$input" ;; esac pairlist= while test "$#" -ne 0; do if test "$1" = "--"; then shift break fi pairlist="$pairlist $1" shift done # The program to run. prog="$1" shift # Make any relative path in $prog absolute. case "$prog" in [\\/]* | ?:[\\/]*) ;; *[\\/]*) prog="`pwd`/$prog" ;; esac # FIXME: add hostname here for parallel makes that run commands on # other machines. But that might take us over the 14-char limit. dirname=ylwrap$$ do_exit="cd '`pwd`' && rm -rf $dirname > /dev/null 2>&1;"' (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 mkdir $dirname || exit 1 cd $dirname case $# in 0) "$prog" "$input" ;; *) "$prog" "$@" "$input" ;; esac ret=$? if test $ret -eq 0; then set X $pairlist shift first=yes # Since DOS filename conventions don't allow two dots, # the DOS version of Bison writes out y_tab.c instead of y.tab.c # and y_tab.h instead of y.tab.h. Test to see if this is the case. y_tab_nodot="no" if test -f y_tab.c || test -f y_tab.h; then y_tab_nodot="yes" fi # The directory holding the input. input_dir=`echo "$input" | sed -e 's,\([\\/]\)[^\\/]*$,\1,'` # Quote $INPUT_DIR so we can use it in a regexp. # FIXME: really we should care about more than `.' and `\'. input_rx=`echo "$input_dir" | sed 's,\\\\,\\\\\\\\,g;s,\\.,\\\\.,g'` while test "$#" -ne 0; do from="$1" # Handle y_tab.c and y_tab.h output by DOS if test $y_tab_nodot = "yes"; then if test $from = "y.tab.c"; then from="y_tab.c" else if test $from = "y.tab.h"; then from="y_tab.h" fi fi fi if test -f "$from"; then # If $2 is an absolute path name, then just use that, # otherwise prepend `../'. case "$2" in [\\/]* | ?:[\\/]*) target="$2";; *) target="../$2";; esac # We do not want to overwrite a header file if it hasn't # changed. This avoid useless recompilations. However the # parser itself (the first file) should always be updated, # because it is the destination of the .y.c rule in the # Makefile. Divert the output of all other files to a temporary # file so we can compare them to existing versions. if test $first = no; then realtarget="$target" target="tmp-`echo $target | sed s/.*[\\/]//g`" fi # Edit out `#line' or `#' directives. # # We don't want the resulting debug information to point at # an absolute srcdir; it is better for it to just mention the # .y file with no path. # # We want to use the real output file name, not yy.lex.c for # instance. # # We want the include guards to be adjusted too. FROM=`echo "$from" | sed \ -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'\ -e 's/[^ABCDEFGHIJKLMNOPQRSTUVWXYZ]/_/g'` TARGET=`echo "$2" | sed \ -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'\ -e 's/[^ABCDEFGHIJKLMNOPQRSTUVWXYZ]/_/g'` sed -e "/^#/!b" -e "s,$input_rx,," -e "s,$from,$2," \ -e "s,$FROM,$TARGET," "$from" >"$target" || ret=$? # Check whether header files must be updated. if test $first = no; then if test -f "$realtarget" && cmp -s "$realtarget" "$target"; then echo "$2" is unchanged rm -f "$target" else echo updating "$2" mv -f "$target" "$realtarget" fi fi else # A missing file is only an error for the first file. This # is a blatant hack to let us support using "yacc -d". If -d # is not specified, we don't want an error when the header # file is "missing". if test $first = yes; then ret=1 fi fi shift shift first=no done else ret=$? fi # Remove the directory. cd .. rm -rf $dirname exit $ret # Local Variables: # mode: shell-script # sh-indentation: 2 # 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-4.1.4/ltmain.sh0000775000175000017500000105204013730350075012072 00000000000000 # libtool (GNU libtool) 2.4.2 # Written by Gordon Matzigkeit , 1996 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, # 2007, 2008, 2009, 2010, 2011 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. # 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. # Usage: $progname [OPTION]... [MODE-ARG]... # # Provide generalized library-building support services. # # --config show all configuration variables # --debug enable verbose shell tracing # -n, --dry-run display commands without modifying any files # --features display basic configuration information and exit # --mode=MODE use operation mode MODE # --preserve-dup-deps don't remove duplicate dependency libraries # --quiet, --silent don't print informational messages # --no-quiet, --no-silent # print informational messages (default) # --no-warn don't display warning messages # --tag=TAG use configuration variables from tag TAG # -v, --verbose print more informational messages than default # --no-verbose don't print the extra informational messages # --version print version information # -h, --help, --help-all print short, long, or detailed help message # # MODE must be one of the following: # # clean remove files from the build directory # compile compile a source file into a libtool object # execute automatically set library path, then run a program # finish complete the installation of libtool libraries # install install libraries or executables # link create a library or an executable # uninstall remove libraries from an installed directory # # MODE-ARGS vary depending on the MODE. When passed as first option, # `--mode=MODE' may be abbreviated as `MODE' or a unique abbreviation of that. # Try `$progname --help --mode=MODE' for a more detailed description of MODE. # # When reporting a bug, please describe a test case to reproduce it and # include the following information: # # host-triplet: $host # shell: $SHELL # compiler: $LTCC # compiler flags: $LTCFLAGS # linker: $LD (gnu? $with_gnu_ld) # $progname: (GNU libtool) 2.4.2 Debian-2.4.2-1ubuntu1 # automake: $automake_version # autoconf: $autoconf_version # # Report bugs to . # GNU libtool home page: . # General help using GNU software: . PROGRAM=libtool PACKAGE=libtool VERSION="2.4.2 Debian-2.4.2-1ubuntu1" TIMESTAMP="" package_revision=1.3337 # Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs 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 BIN_SH=xpg4; export BIN_SH # for Tru64 DUALCASE=1; export DUALCASE # for MKS sh # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $1 _LTECHO_EOF' } # NLS nuisances: We save the old values to restore during execute mode. lt_user_locale= lt_safe_locale= for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES do eval "if test \"\${$lt_var+set}\" = set; then save_$lt_var=\$$lt_var $lt_var=C export $lt_var lt_user_locale=\"$lt_var=\\\$save_\$lt_var; \$lt_user_locale\" lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\" fi" done LC_ALL=C LANGUAGE=C export LANGUAGE LC_ALL $lt_unset CDPATH # Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh # is ksh but when the shell is invoked as "sh" and the current value of # the _XPG environment variable is not equal to 1 (one), the special # positional parameter $0, within a function call, is the name of the # function. progpath="$0" : ${CP="cp -f"} test "${ECHO+set}" = set || ECHO=${as_echo-'printf %s\n'} : ${MAKE="make"} : ${MKDIR="mkdir"} : ${MV="mv -f"} : ${RM="rm -f"} : ${SHELL="${CONFIG_SHELL-/bin/sh}"} : ${Xsed="$SED -e 1s/^X//"} # Global variables: EXIT_SUCCESS=0 EXIT_FAILURE=1 EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing. EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake. exit_status=$EXIT_SUCCESS # Make sure IFS has a sensible default lt_nl=' ' IFS=" $lt_nl" dirname="s,/[^/]*$,," basename="s,^.*/,," # func_dirname file append nondir_replacement # Compute the dirname of FILE. If nonempty, add APPEND to the result, # otherwise set result to NONDIR_REPLACEMENT. func_dirname () { func_dirname_result=`$ECHO "${1}" | $SED "$dirname"` if test "X$func_dirname_result" = "X${1}"; then func_dirname_result="${3}" else func_dirname_result="$func_dirname_result${2}" fi } # func_dirname may be replaced by extended shell implementation # func_basename file func_basename () { func_basename_result=`$ECHO "${1}" | $SED "$basename"` } # func_basename may be replaced by extended shell implementation # func_dirname_and_basename file append nondir_replacement # perform func_basename and func_dirname in a single function # call: # dirname: Compute the dirname of FILE. If nonempty, # add APPEND to the result, otherwise set result # to NONDIR_REPLACEMENT. # value returned in "$func_dirname_result" # basename: Compute filename of FILE. # value retuned in "$func_basename_result" # Implementation must be kept synchronized with func_dirname # and func_basename. For efficiency, we do not delegate to # those functions but instead duplicate the functionality here. func_dirname_and_basename () { # Extract subdirectory from the argument. func_dirname_result=`$ECHO "${1}" | $SED -e "$dirname"` if test "X$func_dirname_result" = "X${1}"; then func_dirname_result="${3}" else func_dirname_result="$func_dirname_result${2}" fi func_basename_result=`$ECHO "${1}" | $SED -e "$basename"` } # func_dirname_and_basename may be replaced by extended shell implementation # func_stripname prefix suffix name # strip PREFIX and SUFFIX off of NAME. # PREFIX and SUFFIX must not contain globbing or regex special # characters, hashes, percent signs, but SUFFIX may contain a leading # dot (in which case that matches only a dot). # func_strip_suffix prefix name func_stripname () { case ${2} in .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; esac } # func_stripname may be replaced by extended shell implementation # These SED scripts presuppose an absolute path with a trailing slash. pathcar='s,^/\([^/]*\).*$,\1,' pathcdr='s,^/[^/]*,,' removedotparts=':dotsl s@/\./@/@g t dotsl s,/\.$,/,' collapseslashes='s@/\{1,\}@/@g' finalslash='s,/*$,/,' # func_normal_abspath PATH # Remove doubled-up and trailing slashes, "." path components, # and cancel out any ".." path components in PATH after making # it an absolute path. # value returned in "$func_normal_abspath_result" func_normal_abspath () { # Start from root dir and reassemble the path. func_normal_abspath_result= func_normal_abspath_tpath=$1 func_normal_abspath_altnamespace= case $func_normal_abspath_tpath in "") # Empty path, that just means $cwd. func_stripname '' '/' "`pwd`" func_normal_abspath_result=$func_stripname_result return ;; # The next three entries are used to spot a run of precisely # two leading slashes without using negated character classes; # we take advantage of case's first-match behaviour. ///*) # Unusual form of absolute path, do nothing. ;; //*) # Not necessarily an ordinary path; POSIX reserves leading '//' # and for example Cygwin uses it to access remote file shares # over CIFS/SMB, so we conserve a leading double slash if found. func_normal_abspath_altnamespace=/ ;; /*) # Absolute path, do nothing. ;; *) # Relative path, prepend $cwd. func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath ;; esac # Cancel out all the simple stuff to save iterations. We also want # the path to end with a slash for ease of parsing, so make sure # there is one (and only one) here. func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$removedotparts" -e "$collapseslashes" -e "$finalslash"` while :; do # Processed it all yet? if test "$func_normal_abspath_tpath" = / ; then # If we ascended to the root using ".." the result may be empty now. if test -z "$func_normal_abspath_result" ; then func_normal_abspath_result=/ fi break fi func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$pathcar"` func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$pathcdr"` # Figure out what to do with it case $func_normal_abspath_tcomponent in "") # Trailing empty path component, ignore it. ;; ..) # Parent dir; strip last assembled component from result. func_dirname "$func_normal_abspath_result" func_normal_abspath_result=$func_dirname_result ;; *) # Actual path component, append it. func_normal_abspath_result=$func_normal_abspath_result/$func_normal_abspath_tcomponent ;; esac done # Restore leading double-slash if one was found on entry. func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result } # func_relative_path SRCDIR DSTDIR # generates a relative path from SRCDIR to DSTDIR, with a trailing # slash if non-empty, suitable for immediately appending a filename # without needing to append a separator. # value returned in "$func_relative_path_result" func_relative_path () { func_relative_path_result= func_normal_abspath "$1" func_relative_path_tlibdir=$func_normal_abspath_result func_normal_abspath "$2" func_relative_path_tbindir=$func_normal_abspath_result # Ascend the tree starting from libdir while :; do # check if we have found a prefix of bindir case $func_relative_path_tbindir in $func_relative_path_tlibdir) # found an exact match func_relative_path_tcancelled= break ;; $func_relative_path_tlibdir*) # found a matching prefix func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir" func_relative_path_tcancelled=$func_stripname_result if test -z "$func_relative_path_result"; then func_relative_path_result=. fi break ;; *) func_dirname $func_relative_path_tlibdir func_relative_path_tlibdir=${func_dirname_result} if test "x$func_relative_path_tlibdir" = x ; then # Have to descend all the way to the root! func_relative_path_result=../$func_relative_path_result func_relative_path_tcancelled=$func_relative_path_tbindir break fi func_relative_path_result=../$func_relative_path_result ;; esac done # Now calculate path; take care to avoid doubling-up slashes. func_stripname '' '/' "$func_relative_path_result" func_relative_path_result=$func_stripname_result func_stripname '/' '/' "$func_relative_path_tcancelled" if test "x$func_stripname_result" != x ; then func_relative_path_result=${func_relative_path_result}/${func_stripname_result} fi # Normalisation. If bindir is libdir, return empty string, # else relative path ending with a slash; either way, target # file name can be directly appended. if test ! -z "$func_relative_path_result"; then func_stripname './' '' "$func_relative_path_result/" func_relative_path_result=$func_stripname_result fi } # The name of this program: func_dirname_and_basename "$progpath" progname=$func_basename_result # Make sure we have an absolute path for reexecution: case $progpath in [\\/]*|[A-Za-z]:\\*) ;; *[\\/]*) progdir=$func_dirname_result progdir=`cd "$progdir" && pwd` progpath="$progdir/$progname" ;; *) save_IFS="$IFS" IFS=${PATH_SEPARATOR-:} for progdir in $PATH; do IFS="$save_IFS" test -x "$progdir/$progname" && break done IFS="$save_IFS" test -n "$progdir" || progdir=`pwd` progpath="$progdir/$progname" ;; esac # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. Xsed="${SED}"' -e 1s/^X//' sed_quote_subst='s/\([`"$\\]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\(["`\\]\)/\\\1/g' # Sed substitution that turns a string into a regex matching for the # string literally. sed_make_literal_regex='s,[].[^$\\*\/],\\&,g' # Sed substitution that converts a w32 file name or path # which contains forward slashes, into one that contains # (escaped) backslashes. A very naive implementation. lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' # Re-`\' parameter expansions in output of double_quote_subst that were # `\'-ed in input to the same. If an odd number of `\' preceded a '$' # in input to double_quote_subst, that '$' was protected from expansion. # Since each input `\' is now two `\'s, look for any number of runs of # four `\'s followed by two `\'s and then a '$'. `\' that '$'. bs='\\' bs2='\\\\' bs4='\\\\\\\\' dollar='\$' sed_double_backslash="\ s/$bs4/&\\ /g s/^$bs2$dollar/$bs&/ s/\\([^$bs]\\)$bs2$dollar/\\1$bs2$bs$dollar/g s/\n//g" # Standard options: opt_dry_run=false opt_help=false opt_quiet=false opt_verbose=false opt_warning=: # func_echo arg... # Echo program name prefixed message, along with the current mode # name if it has been set yet. func_echo () { $ECHO "$progname: ${opt_mode+$opt_mode: }$*" } # func_verbose arg... # Echo program name prefixed message in verbose mode only. func_verbose () { $opt_verbose && func_echo ${1+"$@"} # A bug in bash halts the script if the last line of a function # fails when set -e is in force, so we need another command to # work around that: : } # func_echo_all arg... # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "$*" } # func_error arg... # Echo program name prefixed message to standard error. func_error () { $ECHO "$progname: ${opt_mode+$opt_mode: }"${1+"$@"} 1>&2 } # func_warning arg... # Echo program name prefixed warning message to standard error. func_warning () { $opt_warning && $ECHO "$progname: ${opt_mode+$opt_mode: }warning: "${1+"$@"} 1>&2 # bash bug again: : } # func_fatal_error arg... # Echo program name prefixed message to standard error, and exit. func_fatal_error () { func_error ${1+"$@"} exit $EXIT_FAILURE } # func_fatal_help arg... # Echo program name prefixed message to standard error, followed by # a help hint, and exit. func_fatal_help () { func_error ${1+"$@"} func_fatal_error "$help" } help="Try \`$progname --help' for more information." ## default # func_grep expression filename # Check whether EXPRESSION matches any line of FILENAME, without output. func_grep () { $GREP "$1" "$2" >/dev/null 2>&1 } # func_mkdir_p directory-path # Make sure the entire path to DIRECTORY-PATH is available. func_mkdir_p () { my_directory_path="$1" my_dir_list= if test -n "$my_directory_path" && test "$opt_dry_run" != ":"; then # Protect directory names starting with `-' case $my_directory_path in -*) my_directory_path="./$my_directory_path" ;; esac # While some portion of DIR does not yet exist... while test ! -d "$my_directory_path"; do # ...make a list in topmost first order. Use a colon delimited # list incase some portion of path contains whitespace. my_dir_list="$my_directory_path:$my_dir_list" # If the last portion added has no slash in it, the list is done case $my_directory_path in */*) ;; *) break ;; esac # ...otherwise throw away the child directory and loop my_directory_path=`$ECHO "$my_directory_path" | $SED -e "$dirname"` done my_dir_list=`$ECHO "$my_dir_list" | $SED 's,:*$,,'` save_mkdir_p_IFS="$IFS"; IFS=':' for my_dir in $my_dir_list; do IFS="$save_mkdir_p_IFS" # mkdir can fail with a `File exist' error if two processes # try to create one of the directories concurrently. Don't # stop in that case! $MKDIR "$my_dir" 2>/dev/null || : done IFS="$save_mkdir_p_IFS" # Bail out if we (or some other process) failed to create a directory. test -d "$my_directory_path" || \ func_fatal_error "Failed to create \`$1'" fi } # func_mktempdir [string] # Make a temporary directory that won't clash with other running # libtool processes, and avoids race conditions if possible. If # given, STRING is the basename for that directory. func_mktempdir () { my_template="${TMPDIR-/tmp}/${1-$progname}" if test "$opt_dry_run" = ":"; then # Return a directory name, but don't create it in dry-run mode my_tmpdir="${my_template}-$$" else # If mktemp works, use that first and foremost my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null` if test ! -d "$my_tmpdir"; then # Failing that, at least try and use $RANDOM to avoid a race my_tmpdir="${my_template}-${RANDOM-0}$$" save_mktempdir_umask=`umask` umask 0077 $MKDIR "$my_tmpdir" umask $save_mktempdir_umask fi # If we're not in dry-run mode, bomb out on failure test -d "$my_tmpdir" || \ func_fatal_error "cannot create temporary directory \`$my_tmpdir'" fi $ECHO "$my_tmpdir" } # func_quote_for_eval arg # Aesthetically quote ARG to be evaled later. # This function returns two values: FUNC_QUOTE_FOR_EVAL_RESULT # is double-quoted, suitable for a subsequent eval, whereas # FUNC_QUOTE_FOR_EVAL_UNQUOTED_RESULT has merely all characters # which are still active within double quotes backslashified. func_quote_for_eval () { case $1 in *[\\\`\"\$]*) func_quote_for_eval_unquoted_result=`$ECHO "$1" | $SED "$sed_quote_subst"` ;; *) func_quote_for_eval_unquoted_result="$1" ;; esac case $func_quote_for_eval_unquoted_result in # Double-quote args containing shell metacharacters to delay # word splitting, command substitution and and variable # expansion for a subsequent eval. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") func_quote_for_eval_result="\"$func_quote_for_eval_unquoted_result\"" ;; *) func_quote_for_eval_result="$func_quote_for_eval_unquoted_result" esac } # func_quote_for_expand arg # Aesthetically quote ARG to be evaled later; same as above, # but do not quote variable references. func_quote_for_expand () { case $1 in *[\\\`\"]*) my_arg=`$ECHO "$1" | $SED \ -e "$double_quote_subst" -e "$sed_double_backslash"` ;; *) my_arg="$1" ;; esac case $my_arg in # Double-quote args containing shell metacharacters to delay # word splitting and command substitution for a subsequent eval. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") my_arg="\"$my_arg\"" ;; esac func_quote_for_expand_result="$my_arg" } # func_show_eval cmd [fail_exp] # Unless opt_silent is true, then output CMD. Then, if opt_dryrun is # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP # is given, then evaluate it. func_show_eval () { my_cmd="$1" my_fail_exp="${2-:}" ${opt_silent-false} || { func_quote_for_expand "$my_cmd" eval "func_echo $func_quote_for_expand_result" } if ${opt_dry_run-false}; then :; else eval "$my_cmd" my_status=$? if test "$my_status" -eq 0; then :; else eval "(exit $my_status); $my_fail_exp" fi fi } # func_show_eval_locale cmd [fail_exp] # Unless opt_silent is true, then output CMD. Then, if opt_dryrun is # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP # is given, then evaluate it. Use the saved locale for evaluation. func_show_eval_locale () { my_cmd="$1" my_fail_exp="${2-:}" ${opt_silent-false} || { func_quote_for_expand "$my_cmd" eval "func_echo $func_quote_for_expand_result" } if ${opt_dry_run-false}; then :; else eval "$lt_user_locale $my_cmd" my_status=$? eval "$lt_safe_locale" if test "$my_status" -eq 0; then :; else eval "(exit $my_status); $my_fail_exp" fi fi } # func_tr_sh # Turn $1 into a string suitable for a shell variable name. # Result is stored in $func_tr_sh_result. All characters # not in the set a-zA-Z0-9_ are replaced with '_'. Further, # if $1 begins with a digit, a '_' is prepended as well. func_tr_sh () { case $1 in [0-9]* | *[!a-zA-Z0-9_]*) func_tr_sh_result=`$ECHO "$1" | $SED 's/^\([0-9]\)/_\1/; s/[^a-zA-Z0-9_]/_/g'` ;; * ) func_tr_sh_result=$1 ;; esac } # func_version # Echo version message to standard output and exit. func_version () { $opt_debug $SED -n '/(C)/!b go :more /\./!{ N s/\n# / / b more } :go /^# '$PROGRAM' (GNU /,/# warranty; / { s/^# // s/^# *$// s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/ p }' < "$progpath" exit $? } # func_usage # Echo short help message to standard output and exit. func_usage () { $opt_debug $SED -n '/^# Usage:/,/^# *.*--help/ { s/^# // s/^# *$// s/\$progname/'$progname'/ p }' < "$progpath" echo $ECHO "run \`$progname --help | more' for full usage" exit $? } # func_help [NOEXIT] # Echo long help message to standard output and exit, # unless 'noexit' is passed as argument. func_help () { $opt_debug $SED -n '/^# Usage:/,/# Report bugs to/ { :print s/^# // s/^# *$// s*\$progname*'$progname'* s*\$host*'"$host"'* s*\$SHELL*'"$SHELL"'* s*\$LTCC*'"$LTCC"'* s*\$LTCFLAGS*'"$LTCFLAGS"'* s*\$LD*'"$LD"'* s/\$with_gnu_ld/'"$with_gnu_ld"'/ s/\$automake_version/'"`(${AUTOMAKE-automake} --version) 2>/dev/null |$SED 1q`"'/ s/\$autoconf_version/'"`(${AUTOCONF-autoconf} --version) 2>/dev/null |$SED 1q`"'/ p d } /^# .* home page:/b print /^# General help using/b print ' < "$progpath" ret=$? if test -z "$1"; then exit $ret fi } # func_missing_arg argname # Echo program name prefixed message to standard error and set global # exit_cmd. func_missing_arg () { $opt_debug func_error "missing argument for $1." exit_cmd=exit } # func_split_short_opt shortopt # Set func_split_short_opt_name and func_split_short_opt_arg shell # variables after splitting SHORTOPT after the 2nd character. func_split_short_opt () { my_sed_short_opt='1s/^\(..\).*$/\1/;q' my_sed_short_rest='1s/^..\(.*\)$/\1/;q' func_split_short_opt_name=`$ECHO "$1" | $SED "$my_sed_short_opt"` func_split_short_opt_arg=`$ECHO "$1" | $SED "$my_sed_short_rest"` } # func_split_short_opt may be replaced by extended shell implementation # func_split_long_opt longopt # Set func_split_long_opt_name and func_split_long_opt_arg shell # variables after splitting LONGOPT at the `=' sign. func_split_long_opt () { my_sed_long_opt='1s/^\(--[^=]*\)=.*/\1/;q' my_sed_long_arg='1s/^--[^=]*=//' func_split_long_opt_name=`$ECHO "$1" | $SED "$my_sed_long_opt"` func_split_long_opt_arg=`$ECHO "$1" | $SED "$my_sed_long_arg"` } # func_split_long_opt may be replaced by extended shell implementation exit_cmd=: magic="%%%MAGIC variable%%%" magic_exe="%%%MAGIC EXE variable%%%" # Global variables. nonopt= preserve_args= lo2o="s/\\.lo\$/.${objext}/" o2lo="s/\\.${objext}\$/.lo/" extracted_archives= extracted_serial=0 # If this variable is set in any of the actions, the command in it # will be execed at the end. This prevents here-documents from being # left over by shells. exec_cmd= # func_append var value # Append VALUE to the end of shell variable VAR. func_append () { eval "${1}=\$${1}\${2}" } # func_append may be replaced by extended shell implementation # func_append_quoted var value # Quote VALUE and append to the end of shell variable VAR, separated # by a space. func_append_quoted () { func_quote_for_eval "${2}" eval "${1}=\$${1}\\ \$func_quote_for_eval_result" } # func_append_quoted may be replaced by extended shell implementation # func_arith arithmetic-term... func_arith () { func_arith_result=`expr "${@}"` } # func_arith may be replaced by extended shell implementation # func_len string # STRING may not start with a hyphen. func_len () { func_len_result=`expr "${1}" : ".*" 2>/dev/null || echo $max_cmd_len` } # func_len may be replaced by extended shell implementation # func_lo2o object func_lo2o () { func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"` } # func_lo2o may be replaced by extended shell implementation # func_xform libobj-or-source func_xform () { func_xform_result=`$ECHO "${1}" | $SED 's/\.[^.]*$/.lo/'` } # func_xform may be replaced by extended shell implementation # func_fatal_configuration arg... # Echo program name prefixed message to standard error, followed by # a configuration failure hint, and exit. func_fatal_configuration () { func_error ${1+"$@"} func_error "See the $PACKAGE documentation for more information." func_fatal_error "Fatal configuration error." } # func_config # Display the configuration for all the tags in this script. func_config () { re_begincf='^# ### BEGIN LIBTOOL' re_endcf='^# ### END LIBTOOL' # Default configuration. $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath" # Now print the configurations for the tags. for tagname in $taglist; do $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath" done exit $? } # func_features # Display the features supported by this script. func_features () { echo "host: $host" if test "$build_libtool_libs" = yes; then echo "enable shared libraries" else echo "disable shared libraries" fi if test "$build_old_libs" = yes; then echo "enable static libraries" else echo "disable static libraries" fi exit $? } # func_enable_tag tagname # Verify that TAGNAME is valid, and either flag an error and exit, or # enable the TAGNAME tag. We also add TAGNAME to the global $taglist # variable here. func_enable_tag () { # Global variable: tagname="$1" re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$" re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$" sed_extractcf="/$re_begincf/,/$re_endcf/p" # Validate tagname. case $tagname in *[!-_A-Za-z0-9,/]*) func_fatal_error "invalid tag name: $tagname" ;; esac # Don't test for the "default" C tag, as we know it's # there but not specially marked. case $tagname in CC) ;; *) if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then taglist="$taglist $tagname" # Evaluate the configuration. Be careful to quote the path # and the sed script, to avoid splitting on whitespace, but # also don't use non-portable quotes within backquotes within # quotes we have to do it in 2 steps: extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"` eval "$extractedcf" else func_error "ignoring unknown tag $tagname" fi ;; esac } # func_check_version_match # Ensure that we are using m4 macros, and libtool script from the same # release of libtool. func_check_version_match () { if test "$package_revision" != "$macro_revision"; then if test "$VERSION" != "$macro_version"; then if test -z "$macro_version"; then cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, but the $progname: definition of this LT_INIT comes from an older release. $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION $progname: and run autoconf again. _LT_EOF else cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, but the $progname: definition of this LT_INIT comes from $PACKAGE $macro_version. $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION $progname: and run autoconf again. _LT_EOF fi else cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision, $progname: but the definition of this LT_INIT comes from revision $macro_revision. $progname: You should recreate aclocal.m4 with macros from revision $package_revision $progname: of $PACKAGE $VERSION and run autoconf again. _LT_EOF fi exit $EXIT_MISMATCH fi } # Shorthand for --mode=foo, only valid as the first argument case $1 in clean|clea|cle|cl) shift; set dummy --mode clean ${1+"$@"}; shift ;; compile|compil|compi|comp|com|co|c) shift; set dummy --mode compile ${1+"$@"}; shift ;; execute|execut|execu|exec|exe|ex|e) shift; set dummy --mode execute ${1+"$@"}; shift ;; finish|finis|fini|fin|fi|f) shift; set dummy --mode finish ${1+"$@"}; shift ;; install|instal|insta|inst|ins|in|i) shift; set dummy --mode install ${1+"$@"}; shift ;; link|lin|li|l) shift; set dummy --mode link ${1+"$@"}; shift ;; uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u) shift; set dummy --mode uninstall ${1+"$@"}; shift ;; esac # Option defaults: opt_debug=: opt_dry_run=false opt_config=false opt_preserve_dup_deps=false opt_features=false opt_finish=false opt_help=false opt_help_all=false opt_silent=: opt_warning=: opt_verbose=: opt_silent=false opt_verbose=false # Parse options once, thoroughly. This comes as soon as possible in the # script to make things like `--version' happen as quickly as we can. { # this just eases exit handling while test $# -gt 0; do opt="$1" shift case $opt in --debug|-x) opt_debug='set -x' func_echo "enabling shell trace mode" $opt_debug ;; --dry-run|--dryrun|-n) opt_dry_run=: ;; --config) opt_config=: func_config ;; --dlopen|-dlopen) optarg="$1" opt_dlopen="${opt_dlopen+$opt_dlopen }$optarg" shift ;; --preserve-dup-deps) opt_preserve_dup_deps=: ;; --features) opt_features=: func_features ;; --finish) opt_finish=: set dummy --mode finish ${1+"$@"}; shift ;; --help) opt_help=: ;; --help-all) opt_help_all=: opt_help=': help-all' ;; --mode) test $# = 0 && func_missing_arg $opt && break optarg="$1" opt_mode="$optarg" case $optarg in # Valid mode arguments: clean|compile|execute|finish|install|link|relink|uninstall) ;; # Catch anything else as an error *) func_error "invalid argument for $opt" exit_cmd=exit break ;; esac shift ;; --no-silent|--no-quiet) opt_silent=false func_append preserve_args " $opt" ;; --no-warning|--no-warn) opt_warning=false func_append preserve_args " $opt" ;; --no-verbose) opt_verbose=false func_append preserve_args " $opt" ;; --silent|--quiet) opt_silent=: func_append preserve_args " $opt" opt_verbose=false ;; --verbose|-v) opt_verbose=: func_append preserve_args " $opt" opt_silent=false ;; --tag) test $# = 0 && func_missing_arg $opt && break optarg="$1" opt_tag="$optarg" func_append preserve_args " $opt $optarg" func_enable_tag "$optarg" shift ;; -\?|-h) func_usage ;; --help) func_help ;; --version) func_version ;; # Separate optargs to long options: --*=*) func_split_long_opt "$opt" set dummy "$func_split_long_opt_name" "$func_split_long_opt_arg" ${1+"$@"} shift ;; # Separate non-argument short options: -\?*|-h*|-n*|-v*) func_split_short_opt "$opt" set dummy "$func_split_short_opt_name" "-$func_split_short_opt_arg" ${1+"$@"} shift ;; --) break ;; -*) func_fatal_help "unrecognized option \`$opt'" ;; *) set dummy "$opt" ${1+"$@"}; shift; break ;; esac done # Validate options: # save first non-option argument if test "$#" -gt 0; then nonopt="$opt" shift fi # preserve --debug test "$opt_debug" = : || func_append preserve_args " --debug" case $host in *cygwin* | *mingw* | *pw32* | *cegcc*) # don't eliminate duplications in $postdeps and $predeps opt_duplicate_compiler_generated_deps=: ;; *) opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps ;; esac $opt_help || { # Sanity checks first: func_check_version_match if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then func_fatal_configuration "not configured to build any kind of library" fi # Darwin sucks eval std_shrext=\"$shrext_cmds\" # Only execute mode is allowed to have -dlopen flags. if test -n "$opt_dlopen" && test "$opt_mode" != execute; then func_error "unrecognized option \`-dlopen'" $ECHO "$help" 1>&2 exit $EXIT_FAILURE fi # Change the help message to a mode-specific one. generic_help="$help" help="Try \`$progname --help --mode=$opt_mode' for more information." } # Bail if the options were screwed $exit_cmd $EXIT_FAILURE } ## ----------- ## ## Main. ## ## ----------- ## # func_lalib_p file # True iff FILE is a libtool `.la' library or `.lo' object file. # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_lalib_p () { test -f "$1" && $SED -e 4q "$1" 2>/dev/null \ | $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1 } # func_lalib_unsafe_p file # True iff FILE is a libtool `.la' library or `.lo' object file. # This function implements the same check as func_lalib_p without # resorting to external programs. To this end, it redirects stdin and # closes it afterwards, without saving the original file descriptor. # As a safety measure, use it only where a negative result would be # fatal anyway. Works if `file' does not exist. func_lalib_unsafe_p () { lalib_p=no if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then for lalib_p_l in 1 2 3 4 do read lalib_p_line case "$lalib_p_line" in \#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;; esac done exec 0<&5 5<&- fi test "$lalib_p" = yes } # func_ltwrapper_script_p file # True iff FILE is a libtool wrapper script # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_script_p () { func_lalib_p "$1" } # func_ltwrapper_executable_p file # True iff FILE is a libtool wrapper executable # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_executable_p () { func_ltwrapper_exec_suffix= case $1 in *.exe) ;; *) func_ltwrapper_exec_suffix=.exe ;; esac $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1 } # func_ltwrapper_scriptname file # Assumes file is an ltwrapper_executable # uses $file to determine the appropriate filename for a # temporary ltwrapper_script. func_ltwrapper_scriptname () { func_dirname_and_basename "$1" "" "." func_stripname '' '.exe' "$func_basename_result" func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper" } # func_ltwrapper_p file # True iff FILE is a libtool wrapper script or wrapper executable # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_p () { func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1" } # func_execute_cmds commands fail_cmd # Execute tilde-delimited COMMANDS. # If FAIL_CMD is given, eval that upon failure. # FAIL_CMD may read-access the current command in variable CMD! func_execute_cmds () { $opt_debug save_ifs=$IFS; IFS='~' for cmd in $1; do IFS=$save_ifs eval cmd=\"$cmd\" func_show_eval "$cmd" "${2-:}" done IFS=$save_ifs } # func_source file # Source FILE, adding directory component if necessary. # Note that it is not necessary on cygwin/mingw to append a dot to # FILE even if both FILE and FILE.exe exist: automatic-append-.exe # behavior happens only for exec(3), not for open(2)! Also, sourcing # `FILE.' does not work on cygwin managed mounts. func_source () { $opt_debug case $1 in */* | *\\*) . "$1" ;; *) . "./$1" ;; esac } # func_resolve_sysroot PATH # Replace a leading = in PATH with a sysroot. Store the result into # func_resolve_sysroot_result func_resolve_sysroot () { func_resolve_sysroot_result=$1 case $func_resolve_sysroot_result in =*) func_stripname '=' '' "$func_resolve_sysroot_result" func_resolve_sysroot_result=$lt_sysroot$func_stripname_result ;; esac } # func_replace_sysroot PATH # If PATH begins with the sysroot, replace it with = and # store the result into func_replace_sysroot_result. func_replace_sysroot () { case "$lt_sysroot:$1" in ?*:"$lt_sysroot"*) func_stripname "$lt_sysroot" '' "$1" func_replace_sysroot_result="=$func_stripname_result" ;; *) # Including no sysroot. func_replace_sysroot_result=$1 ;; esac } # func_infer_tag arg # Infer tagged configuration to use if any are available and # if one wasn't chosen via the "--tag" command line option. # Only attempt this if the compiler in the base compile # command doesn't match the default compiler. # arg is usually of the form 'gcc ...' func_infer_tag () { $opt_debug if test -n "$available_tags" && test -z "$tagname"; then CC_quoted= for arg in $CC; do func_append_quoted CC_quoted "$arg" done CC_expanded=`func_echo_all $CC` CC_quoted_expanded=`func_echo_all $CC_quoted` case $@ in # Blanks in the command may have been stripped by the calling shell, # but not from the CC environment variable when configure was run. " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) ;; # Blanks at the start of $base_compile will cause this to fail # if we don't check for them as well. *) for z in $available_tags; do if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then # Evaluate the configuration. eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`" CC_quoted= for arg in $CC; do # Double-quote args containing other shell metacharacters. func_append_quoted CC_quoted "$arg" done CC_expanded=`func_echo_all $CC` CC_quoted_expanded=`func_echo_all $CC_quoted` case "$@ " in " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) # The compiler in the base compile command matches # the one in the tagged configuration. # Assume this is the tagged configuration we want. tagname=$z break ;; esac fi done # If $tagname still isn't set, then no tagged configuration # was found and let the user know that the "--tag" command # line option must be used. if test -z "$tagname"; then func_echo "unable to infer tagged configuration" func_fatal_error "specify a tag with \`--tag'" # else # func_verbose "using $tagname tagged configuration" fi ;; esac fi } # func_write_libtool_object output_name pic_name nonpic_name # Create a libtool object file (analogous to a ".la" file), # but don't create it if we're doing a dry run. func_write_libtool_object () { write_libobj=${1} if test "$build_libtool_libs" = yes; then write_lobj=\'${2}\' else write_lobj=none fi if test "$build_old_libs" = yes; then write_oldobj=\'${3}\' else write_oldobj=none fi $opt_dry_run || { cat >${write_libobj}T </dev/null` if test "$?" -eq 0 && test -n "${func_convert_core_file_wine_to_w32_tmp}"; then func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" | $SED -e "$lt_sed_naive_backslashify"` else func_convert_core_file_wine_to_w32_result= fi fi } # end: func_convert_core_file_wine_to_w32 # func_convert_core_path_wine_to_w32 ARG # Helper function used by path conversion functions when $build is *nix, and # $host is mingw, cygwin, or some other w32 environment. Relies on a correctly # configured wine environment available, with the winepath program in $build's # $PATH. Assumes ARG has no leading or trailing path separator characters. # # ARG is path to be converted from $build format to win32. # Result is available in $func_convert_core_path_wine_to_w32_result. # Unconvertible file (directory) names in ARG are skipped; if no directory names # are convertible, then the result may be empty. func_convert_core_path_wine_to_w32 () { $opt_debug # unfortunately, winepath doesn't convert paths, only file names func_convert_core_path_wine_to_w32_result="" if test -n "$1"; then oldIFS=$IFS IFS=: for func_convert_core_path_wine_to_w32_f in $1; do IFS=$oldIFS func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f" if test -n "$func_convert_core_file_wine_to_w32_result" ; then if test -z "$func_convert_core_path_wine_to_w32_result"; then func_convert_core_path_wine_to_w32_result="$func_convert_core_file_wine_to_w32_result" else func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result" fi fi done IFS=$oldIFS fi } # end: func_convert_core_path_wine_to_w32 # func_cygpath ARGS... # Wrapper around calling the cygpath program via LT_CYGPATH. This is used when # when (1) $build is *nix and Cygwin is hosted via a wine environment; or (2) # $build is MSYS and $host is Cygwin, or (3) $build is Cygwin. In case (1) or # (2), returns the Cygwin file name or path in func_cygpath_result (input # file name or path is assumed to be in w32 format, as previously converted # from $build's *nix or MSYS format). In case (3), returns the w32 file name # or path in func_cygpath_result (input file name or path is assumed to be in # Cygwin format). Returns an empty string on error. # # ARGS are passed to cygpath, with the last one being the file name or path to # be converted. # # Specify the absolute *nix (or w32) name to cygpath in the LT_CYGPATH # environment variable; do not put it in $PATH. func_cygpath () { $opt_debug if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null` if test "$?" -ne 0; then # on failure, ensure result is empty func_cygpath_result= fi else func_cygpath_result= func_error "LT_CYGPATH is empty or specifies non-existent file: \`$LT_CYGPATH'" fi } #end: func_cygpath # func_convert_core_msys_to_w32 ARG # Convert file name or path ARG from MSYS format to w32 format. Return # result in func_convert_core_msys_to_w32_result. func_convert_core_msys_to_w32 () { $opt_debug # awkward: cmd appends spaces to result func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null | $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"` } #end: func_convert_core_msys_to_w32 # func_convert_file_check ARG1 ARG2 # Verify that ARG1 (a file name in $build format) was converted to $host # format in ARG2. Otherwise, emit an error message, but continue (resetting # func_to_host_file_result to ARG1). func_convert_file_check () { $opt_debug if test -z "$2" && test -n "$1" ; then func_error "Could not determine host file name corresponding to" func_error " \`$1'" func_error "Continuing, but uninstalled executables may not work." # Fallback: func_to_host_file_result="$1" fi } # end func_convert_file_check # func_convert_path_check FROM_PATHSEP TO_PATHSEP FROM_PATH TO_PATH # Verify that FROM_PATH (a path in $build format) was converted to $host # format in TO_PATH. Otherwise, emit an error message, but continue, resetting # func_to_host_file_result to a simplistic fallback value (see below). func_convert_path_check () { $opt_debug if test -z "$4" && test -n "$3"; then func_error "Could not determine the host path corresponding to" func_error " \`$3'" func_error "Continuing, but uninstalled executables may not work." # Fallback. This is a deliberately simplistic "conversion" and # should not be "improved". See libtool.info. if test "x$1" != "x$2"; then lt_replace_pathsep_chars="s|$1|$2|g" func_to_host_path_result=`echo "$3" | $SED -e "$lt_replace_pathsep_chars"` else func_to_host_path_result="$3" fi fi } # end func_convert_path_check # func_convert_path_front_back_pathsep FRONTPAT BACKPAT REPL ORIG # Modifies func_to_host_path_result by prepending REPL if ORIG matches FRONTPAT # and appending REPL if ORIG matches BACKPAT. func_convert_path_front_back_pathsep () { $opt_debug case $4 in $1 ) func_to_host_path_result="$3$func_to_host_path_result" ;; esac case $4 in $2 ) func_append func_to_host_path_result "$3" ;; esac } # end func_convert_path_front_back_pathsep ################################################## # $build to $host FILE NAME CONVERSION FUNCTIONS # ################################################## # invoked via `$to_host_file_cmd ARG' # # In each case, ARG is the path to be converted from $build to $host format. # Result will be available in $func_to_host_file_result. # func_to_host_file ARG # Converts the file name ARG from $build format to $host format. Return result # in func_to_host_file_result. func_to_host_file () { $opt_debug $to_host_file_cmd "$1" } # end func_to_host_file # func_to_tool_file ARG LAZY # converts the file name ARG from $build format to toolchain format. Return # result in func_to_tool_file_result. If the conversion in use is listed # in (the comma separated) LAZY, no conversion takes place. func_to_tool_file () { $opt_debug case ,$2, in *,"$to_tool_file_cmd",*) func_to_tool_file_result=$1 ;; *) $to_tool_file_cmd "$1" func_to_tool_file_result=$func_to_host_file_result ;; esac } # end func_to_tool_file # func_convert_file_noop ARG # Copy ARG to func_to_host_file_result. func_convert_file_noop () { func_to_host_file_result="$1" } # end func_convert_file_noop # func_convert_file_msys_to_w32 ARG # Convert file name ARG from (mingw) MSYS to (mingw) w32 format; automatic # conversion to w32 is not available inside the cwrapper. Returns result in # func_to_host_file_result. func_convert_file_msys_to_w32 () { $opt_debug func_to_host_file_result="$1" if test -n "$1"; then func_convert_core_msys_to_w32 "$1" func_to_host_file_result="$func_convert_core_msys_to_w32_result" fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_msys_to_w32 # func_convert_file_cygwin_to_w32 ARG # Convert file name ARG from Cygwin to w32 format. Returns result in # func_to_host_file_result. func_convert_file_cygwin_to_w32 () { $opt_debug func_to_host_file_result="$1" if test -n "$1"; then # because $build is cygwin, we call "the" cygpath in $PATH; no need to use # LT_CYGPATH in this case. func_to_host_file_result=`cygpath -m "$1"` fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_cygwin_to_w32 # func_convert_file_nix_to_w32 ARG # Convert file name ARG from *nix to w32 format. Requires a wine environment # and a working winepath. Returns result in func_to_host_file_result. func_convert_file_nix_to_w32 () { $opt_debug func_to_host_file_result="$1" if test -n "$1"; then func_convert_core_file_wine_to_w32 "$1" func_to_host_file_result="$func_convert_core_file_wine_to_w32_result" fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_nix_to_w32 # func_convert_file_msys_to_cygwin ARG # Convert file name ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. # Returns result in func_to_host_file_result. func_convert_file_msys_to_cygwin () { $opt_debug func_to_host_file_result="$1" if test -n "$1"; then func_convert_core_msys_to_w32 "$1" func_cygpath -u "$func_convert_core_msys_to_w32_result" func_to_host_file_result="$func_cygpath_result" fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_msys_to_cygwin # func_convert_file_nix_to_cygwin ARG # Convert file name ARG from *nix to Cygwin format. Requires Cygwin installed # in a wine environment, working winepath, and LT_CYGPATH set. Returns result # in func_to_host_file_result. func_convert_file_nix_to_cygwin () { $opt_debug func_to_host_file_result="$1" if test -n "$1"; then # convert from *nix to w32, then use cygpath to convert from w32 to cygwin. func_convert_core_file_wine_to_w32 "$1" func_cygpath -u "$func_convert_core_file_wine_to_w32_result" func_to_host_file_result="$func_cygpath_result" fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_nix_to_cygwin ############################################# # $build to $host PATH CONVERSION FUNCTIONS # ############################################# # invoked via `$to_host_path_cmd ARG' # # In each case, ARG is the path to be converted from $build to $host format. # The result will be available in $func_to_host_path_result. # # Path separators are also converted from $build format to $host format. If # ARG begins or ends with a path separator character, it is preserved (but # converted to $host format) on output. # # All path conversion functions are named using the following convention: # file name conversion function : func_convert_file_X_to_Y () # path conversion function : func_convert_path_X_to_Y () # where, for any given $build/$host combination the 'X_to_Y' value is the # same. If conversion functions are added for new $build/$host combinations, # the two new functions must follow this pattern, or func_init_to_host_path_cmd # will break. # func_init_to_host_path_cmd # Ensures that function "pointer" variable $to_host_path_cmd is set to the # appropriate value, based on the value of $to_host_file_cmd. to_host_path_cmd= func_init_to_host_path_cmd () { $opt_debug if test -z "$to_host_path_cmd"; then func_stripname 'func_convert_file_' '' "$to_host_file_cmd" to_host_path_cmd="func_convert_path_${func_stripname_result}" fi } # func_to_host_path ARG # Converts the path ARG from $build format to $host format. Return result # in func_to_host_path_result. func_to_host_path () { $opt_debug func_init_to_host_path_cmd $to_host_path_cmd "$1" } # end func_to_host_path # func_convert_path_noop ARG # Copy ARG to func_to_host_path_result. func_convert_path_noop () { func_to_host_path_result="$1" } # end func_convert_path_noop # func_convert_path_msys_to_w32 ARG # Convert path ARG from (mingw) MSYS to (mingw) w32 format; automatic # conversion to w32 is not available inside the cwrapper. Returns result in # func_to_host_path_result. func_convert_path_msys_to_w32 () { $opt_debug func_to_host_path_result="$1" if test -n "$1"; then # Remove leading and trailing path separator characters from ARG. MSYS # behavior is inconsistent here; cygpath turns them into '.;' and ';.'; # and winepath ignores them completely. func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" func_to_host_path_result="$func_convert_core_msys_to_w32_result" func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_msys_to_w32 # func_convert_path_cygwin_to_w32 ARG # Convert path ARG from Cygwin to w32 format. Returns result in # func_to_host_file_result. func_convert_path_cygwin_to_w32 () { $opt_debug func_to_host_path_result="$1" if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_to_host_path_result=`cygpath -m -p "$func_to_host_path_tmp1"` func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_cygwin_to_w32 # func_convert_path_nix_to_w32 ARG # Convert path ARG from *nix to w32 format. Requires a wine environment and # a working winepath. Returns result in func_to_host_file_result. func_convert_path_nix_to_w32 () { $opt_debug func_to_host_path_result="$1" if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" func_to_host_path_result="$func_convert_core_path_wine_to_w32_result" func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_nix_to_w32 # func_convert_path_msys_to_cygwin ARG # Convert path ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. # Returns result in func_to_host_file_result. func_convert_path_msys_to_cygwin () { $opt_debug func_to_host_path_result="$1" if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" func_cygpath -u -p "$func_convert_core_msys_to_w32_result" func_to_host_path_result="$func_cygpath_result" func_convert_path_check : : \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" : "$1" fi } # end func_convert_path_msys_to_cygwin # func_convert_path_nix_to_cygwin ARG # Convert path ARG from *nix to Cygwin format. Requires Cygwin installed in a # a wine environment, working winepath, and LT_CYGPATH set. Returns result in # func_to_host_file_result. func_convert_path_nix_to_cygwin () { $opt_debug func_to_host_path_result="$1" if test -n "$1"; then # Remove leading and trailing path separator characters from # ARG. msys behavior is inconsistent here, cygpath turns them # into '.;' and ';.', and winepath ignores them completely. func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result" func_to_host_path_result="$func_cygpath_result" func_convert_path_check : : \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" : "$1" fi } # end func_convert_path_nix_to_cygwin # func_mode_compile arg... func_mode_compile () { $opt_debug # Get the compilation command and the source file. base_compile= srcfile="$nonopt" # always keep a non-empty value in "srcfile" suppress_opt=yes suppress_output= arg_mode=normal libobj= later= pie_flag= for arg do case $arg_mode in arg ) # do not "continue". Instead, add this to base_compile lastarg="$arg" arg_mode=normal ;; target ) libobj="$arg" arg_mode=normal continue ;; normal ) # Accept any command-line options. case $arg in -o) test -n "$libobj" && \ func_fatal_error "you cannot specify \`-o' more than once" arg_mode=target continue ;; -pie | -fpie | -fPIE) func_append pie_flag " $arg" continue ;; -shared | -static | -prefer-pic | -prefer-non-pic) func_append later " $arg" continue ;; -no-suppress) suppress_opt=no continue ;; -Xcompiler) arg_mode=arg # the next one goes into the "base_compile" arg list continue # The current "srcfile" will either be retained or ;; # replaced later. I would guess that would be a bug. -Wc,*) func_stripname '-Wc,' '' "$arg" args=$func_stripname_result lastarg= save_ifs="$IFS"; IFS=',' for arg in $args; do IFS="$save_ifs" func_append_quoted lastarg "$arg" done IFS="$save_ifs" func_stripname ' ' '' "$lastarg" lastarg=$func_stripname_result # Add the arguments to base_compile. func_append base_compile " $lastarg" continue ;; *) # Accept the current argument as the source file. # The previous "srcfile" becomes the current argument. # lastarg="$srcfile" srcfile="$arg" ;; esac # case $arg ;; esac # case $arg_mode # Aesthetically quote the previous argument. func_append_quoted base_compile "$lastarg" done # for arg case $arg_mode in arg) func_fatal_error "you must specify an argument for -Xcompile" ;; target) func_fatal_error "you must specify a target with \`-o'" ;; *) # Get the name of the library object. test -z "$libobj" && { func_basename "$srcfile" libobj="$func_basename_result" } ;; esac # Recognize several different file suffixes. # If the user specifies -o file.o, it is replaced with file.lo case $libobj in *.[cCFSifmso] | \ *.ada | *.adb | *.ads | *.asm | \ *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \ *.[fF][09]? | *.for | *.java | *.go | *.obj | *.sx | *.cu | *.cup) func_xform "$libobj" libobj=$func_xform_result ;; esac case $libobj in *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;; *) func_fatal_error "cannot determine name of library object from \`$libobj'" ;; esac func_infer_tag $base_compile for arg in $later; do case $arg in -shared) test "$build_libtool_libs" != yes && \ func_fatal_configuration "can not build a shared library" build_old_libs=no continue ;; -static) build_libtool_libs=no build_old_libs=yes continue ;; -prefer-pic) pic_mode=yes continue ;; -prefer-non-pic) pic_mode=no continue ;; esac done func_quote_for_eval "$libobj" test "X$libobj" != "X$func_quote_for_eval_result" \ && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \ && func_warning "libobj name \`$libobj' may not contain shell special characters." func_dirname_and_basename "$obj" "/" "" objname="$func_basename_result" xdir="$func_dirname_result" lobj=${xdir}$objdir/$objname test -z "$base_compile" && \ func_fatal_help "you must specify a compilation command" # Delete any leftover library objects. if test "$build_old_libs" = yes; then removelist="$obj $lobj $libobj ${libobj}T" else removelist="$lobj $libobj ${libobj}T" fi # On Cygwin there's no "real" PIC flag so we must build both object types case $host_os in cygwin* | mingw* | pw32* | os2* | cegcc*) pic_mode=default ;; esac if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then # non-PIC code in shared libraries is not supported pic_mode=default fi # Calculate the filename of the output object if compiler does # not support -o with -c if test "$compiler_c_o" = no; then output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.${objext} lockfile="$output_obj.lock" else output_obj= need_locks=no lockfile= fi # Lock this critical section if it is needed # We use this script file to make the link, it avoids creating a new file if test "$need_locks" = yes; then until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do func_echo "Waiting for $lockfile to be removed" sleep 2 done elif test "$need_locks" = warn; then if test -f "$lockfile"; then $ECHO "\ *** ERROR, $lockfile exists and contains: `cat $lockfile 2>/dev/null` This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi func_append removelist " $output_obj" $ECHO "$srcfile" > "$lockfile" fi $opt_dry_run || $RM $removelist func_append removelist " $lockfile" trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15 func_to_tool_file "$srcfile" func_convert_file_msys_to_w32 srcfile=$func_to_tool_file_result func_quote_for_eval "$srcfile" qsrcfile=$func_quote_for_eval_result # Only build a PIC object if we are building libtool libraries. if test "$build_libtool_libs" = yes; then # Without this assignment, base_compile gets emptied. fbsd_hideous_sh_bug=$base_compile if test "$pic_mode" != no; then command="$base_compile $qsrcfile $pic_flag" else # Don't build PIC code command="$base_compile $qsrcfile" fi func_mkdir_p "$xdir$objdir" if test -z "$output_obj"; then # Place PIC objects in $objdir func_append command " -o $lobj" fi func_show_eval_locale "$command" \ 'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE' if test "$need_locks" = warn && test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then $ECHO "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi # Just move the object if needed, then go on to compile the next one if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then func_show_eval '$MV "$output_obj" "$lobj"' \ 'error=$?; $opt_dry_run || $RM $removelist; exit $error' fi # Allow error messages only from the first compilation. if test "$suppress_opt" = yes; then suppress_output=' >/dev/null 2>&1' fi fi # Only build a position-dependent object if we build old libraries. if test "$build_old_libs" = yes; then if test "$pic_mode" != yes; then # Don't build PIC code command="$base_compile $qsrcfile$pie_flag" else command="$base_compile $qsrcfile $pic_flag" fi if test "$compiler_c_o" = yes; then func_append command " -o $obj" fi # Suppress compiler output if we already did a PIC compilation. func_append command "$suppress_output" func_show_eval_locale "$command" \ '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' if test "$need_locks" = warn && test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then $ECHO "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi # Just move the object if needed if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then func_show_eval '$MV "$output_obj" "$obj"' \ 'error=$?; $opt_dry_run || $RM $removelist; exit $error' fi fi $opt_dry_run || { func_write_libtool_object "$libobj" "$objdir/$objname" "$objname" # Unlock the critical section if it was locked if test "$need_locks" != no; then removelist=$lockfile $RM "$lockfile" fi } exit $EXIT_SUCCESS } $opt_help || { test "$opt_mode" = compile && func_mode_compile ${1+"$@"} } func_mode_help () { # We need to display help for each of the modes. case $opt_mode in "") # Generic help is extracted from the usage comments # at the start of this file. func_help ;; clean) $ECHO \ "Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE... Remove files from the build directory. RM is the name of the program to use to delete files associated with each FILE (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed to RM. If FILE is a libtool library, object or program, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; compile) $ECHO \ "Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE Compile a source file into a libtool library object. This mode accepts the following additional options: -o OUTPUT-FILE set the output file name to OUTPUT-FILE -no-suppress do not suppress compiler output for multiple passes -prefer-pic try to build PIC objects only -prefer-non-pic try to build non-PIC objects only -shared do not build a \`.o' file suitable for static linking -static only build a \`.o' file suitable for static linking -Wc,FLAG pass FLAG directly to the compiler COMPILE-COMMAND is a command to be used in creating a \`standard' object file from the given SOURCEFILE. The output file name is determined by removing the directory component from SOURCEFILE, then substituting the C source code suffix \`.c' with the library object suffix, \`.lo'." ;; execute) $ECHO \ "Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]... Automatically set library path, then run a program. This mode accepts the following additional options: -dlopen FILE add the directory containing FILE to the library path This mode sets the library path environment variable according to \`-dlopen' flags. If any of the ARGS are libtool executable wrappers, then they are translated into their corresponding uninstalled binary, and any of their required library directories are added to the library path. Then, COMMAND is executed, with ARGS as arguments." ;; finish) $ECHO \ "Usage: $progname [OPTION]... --mode=finish [LIBDIR]... Complete the installation of libtool libraries. Each LIBDIR is a directory that contains libtool libraries. The commands that this mode executes may require superuser privileges. Use the \`--dry-run' option if you just want to see what would be executed." ;; install) $ECHO \ "Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND... Install executables or libraries. INSTALL-COMMAND is the installation command. The first component should be either the \`install' or \`cp' program. The following components of INSTALL-COMMAND are treated specially: -inst-prefix-dir PREFIX-DIR Use PREFIX-DIR as a staging area for installation The rest of the components are interpreted as arguments to that command (only BSD-compatible install options are recognized)." ;; link) $ECHO \ "Usage: $progname [OPTION]... --mode=link LINK-COMMAND... Link object files or libraries together to form another library, or to create an executable program. LINK-COMMAND is a command using the C compiler that you would use to create a program from several object files. The following components of LINK-COMMAND are treated specially: -all-static do not do any dynamic linking at all -avoid-version do not add a version suffix if possible -bindir BINDIR specify path to binaries directory (for systems where libraries must be found in the PATH setting at runtime) -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) -export-symbols SYMFILE try to export only the symbols listed in SYMFILE -export-symbols-regex REGEX try to export only the symbols matching REGEX -LLIBDIR search LIBDIR for required installed libraries -lNAME OUTPUT-FILE requires the installed library libNAME -module build a library that can dlopened -no-fast-install disable the fast-install mode -no-install link a not-installable executable -no-undefined declare that a library does not refer to external symbols -o OUTPUT-FILE create OUTPUT-FILE from the specified objects -objectlist FILE Use a list of object files found in FILE to specify objects -precious-files-regex REGEX don't remove output files matching REGEX -release RELEASE specify package release information -rpath LIBDIR the created library will eventually be installed in LIBDIR -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries -shared only do dynamic linking of libtool libraries -shrext SUFFIX override the standard shared library file extension -static do not do any dynamic linking of uninstalled libtool libraries -static-libtool-libs do not do any dynamic linking of libtool libraries -version-info CURRENT[:REVISION[:AGE]] specify library version info [each variable defaults to 0] -weak LIBNAME declare that the target provides the LIBNAME interface -Wc,FLAG -Xcompiler FLAG pass linker-specific FLAG directly to the compiler -Wl,FLAG -Xlinker FLAG pass linker-specific FLAG directly to the linker -XCClinker FLAG pass link-specific FLAG to the compiler driver (CC) All other options (arguments beginning with \`-') are ignored. Every other argument is treated as a filename. Files ending in \`.la' are treated as uninstalled libtool libraries, other files are standard or library object files. If the OUTPUT-FILE ends in \`.la', then a libtool library is created, only library objects (\`.lo' files) may be specified, and \`-rpath' is required, except when creating a convenience library. If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created using \`ar' and \`ranlib', or on Windows using \`lib'. If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file is created, otherwise an executable program is created." ;; uninstall) $ECHO \ "Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE... Remove libraries from an installation directory. RM is the name of the program to use to delete files associated with each FILE (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed to RM. If FILE is a libtool library, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; *) func_fatal_help "invalid operation mode \`$opt_mode'" ;; esac echo $ECHO "Try \`$progname --help' for more information about other modes." } # Now that we've collected a possible --mode arg, show help if necessary if $opt_help; then if test "$opt_help" = :; then func_mode_help else { func_help noexit for opt_mode in compile link execute install finish uninstall clean; do func_mode_help done } | sed -n '1p; 2,$s/^Usage:/ or: /p' { func_help noexit for opt_mode in compile link execute install finish uninstall clean; do echo func_mode_help done } | sed '1d /^When reporting/,/^Report/{ H d } $x /information about other modes/d /more detailed .*MODE/d s/^Usage:.*--mode=\([^ ]*\) .*/Description of \1 mode:/' fi exit $? fi # func_mode_execute arg... func_mode_execute () { $opt_debug # The first argument is the command name. cmd="$nonopt" test -z "$cmd" && \ func_fatal_help "you must specify a COMMAND" # Handle -dlopen flags immediately. for file in $opt_dlopen; do test -f "$file" \ || func_fatal_help "\`$file' is not a file" dir= case $file in *.la) func_resolve_sysroot "$file" file=$func_resolve_sysroot_result # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$file" \ || func_fatal_help "\`$lib' is not a valid libtool archive" # Read the libtool library. dlname= library_names= func_source "$file" # Skip this library if it cannot be dlopened. if test -z "$dlname"; then # Warn if it was a shared library. test -n "$library_names" && \ func_warning "\`$file' was not linked with \`-export-dynamic'" continue fi func_dirname "$file" "" "." dir="$func_dirname_result" if test -f "$dir/$objdir/$dlname"; then func_append dir "/$objdir" else if test ! -f "$dir/$dlname"; then func_fatal_error "cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" fi fi ;; *.lo) # Just add the directory containing the .lo file. func_dirname "$file" "" "." dir="$func_dirname_result" ;; *) func_warning "\`-dlopen' is ignored for non-libtool libraries and objects" continue ;; esac # Get the absolute pathname. absdir=`cd "$dir" && pwd` test -n "$absdir" && dir="$absdir" # Now add the directory to shlibpath_var. if eval "test -z \"\$$shlibpath_var\""; then eval "$shlibpath_var=\"\$dir\"" else eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" fi done # This variable tells wrapper scripts just to set shlibpath_var # rather than running their programs. libtool_execute_magic="$magic" # Check if any of the arguments is a wrapper script. args= for file do case $file in -* | *.la | *.lo ) ;; *) # Do a test to see if this is really a libtool program. if func_ltwrapper_script_p "$file"; then func_source "$file" # Transform arg to wrapped name. file="$progdir/$program" elif func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" func_source "$func_ltwrapper_scriptname_result" # Transform arg to wrapped name. file="$progdir/$program" fi ;; esac # Quote arguments (to preserve shell metacharacters). func_append_quoted args "$file" done if test "X$opt_dry_run" = Xfalse; then if test -n "$shlibpath_var"; then # Export the shlibpath_var. eval "export $shlibpath_var" fi # Restore saved environment variables for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES do eval "if test \"\${save_$lt_var+set}\" = set; then $lt_var=\$save_$lt_var; export $lt_var else $lt_unset $lt_var fi" done # Now prepare to actually exec the command. exec_cmd="\$cmd$args" else # Display what would be done. if test -n "$shlibpath_var"; then eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\"" echo "export $shlibpath_var" fi $ECHO "$cmd$args" exit $EXIT_SUCCESS fi } test "$opt_mode" = execute && func_mode_execute ${1+"$@"} # func_mode_finish arg... func_mode_finish () { $opt_debug libs= libdirs= admincmds= for opt in "$nonopt" ${1+"$@"} do if test -d "$opt"; then func_append libdirs " $opt" elif test -f "$opt"; then if func_lalib_unsafe_p "$opt"; then func_append libs " $opt" else func_warning "\`$opt' is not a valid libtool archive" fi else func_fatal_error "invalid argument \`$opt'" fi done if test -n "$libs"; then if test -n "$lt_sysroot"; then sysroot_regex=`$ECHO "$lt_sysroot" | $SED "$sed_make_literal_regex"` sysroot_cmd="s/\([ ']\)$sysroot_regex/\1/g;" else sysroot_cmd= fi # Remove sysroot references if $opt_dry_run; then for lib in $libs; do echo "removing references to $lt_sysroot and \`=' prefixes from $lib" done else tmpdir=`func_mktempdir` for lib in $libs; do sed -e "${sysroot_cmd} s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \ > $tmpdir/tmp-la mv -f $tmpdir/tmp-la $lib done ${RM}r "$tmpdir" fi fi if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then for libdir in $libdirs; do if test -n "$finish_cmds"; then # Do each command in the finish commands. func_execute_cmds "$finish_cmds" 'admincmds="$admincmds '"$cmd"'"' fi if test -n "$finish_eval"; then # Do the single finish_eval. eval cmds=\"$finish_eval\" $opt_dry_run || eval "$cmds" || func_append admincmds " $cmds" fi done fi # Exit here if they wanted silent mode. $opt_silent && exit $EXIT_SUCCESS if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then echo "----------------------------------------------------------------------" echo "Libraries have been installed in:" for libdir in $libdirs; do $ECHO " $libdir" done echo echo "If you ever happen to want to link against installed libraries" echo "in a given directory, LIBDIR, you must either use libtool, and" echo "specify the full pathname of the library, or use the \`-LLIBDIR'" echo "flag during linking and do at least one of the following:" if test -n "$shlibpath_var"; then echo " - add LIBDIR to the \`$shlibpath_var' environment variable" echo " during execution" fi if test -n "$runpath_var"; then echo " - add LIBDIR to the \`$runpath_var' environment variable" echo " during linking" fi if test -n "$hardcode_libdir_flag_spec"; then libdir=LIBDIR eval flag=\"$hardcode_libdir_flag_spec\" $ECHO " - use the \`$flag' linker flag" fi if test -n "$admincmds"; then $ECHO " - have your system administrator run these commands:$admincmds" fi if test -f /etc/ld.so.conf; then echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'" fi echo echo "See any operating system documentation about shared libraries for" case $host in solaris2.[6789]|solaris2.1[0-9]) echo "more information, such as the ld(1), crle(1) and ld.so(8) manual" echo "pages." ;; *) echo "more information, such as the ld(1) and ld.so(8) manual pages." ;; esac echo "----------------------------------------------------------------------" fi exit $EXIT_SUCCESS } test "$opt_mode" = finish && func_mode_finish ${1+"$@"} # func_mode_install arg... func_mode_install () { $opt_debug # There may be an optional sh(1) argument at the beginning of # install_prog (especially on Windows NT). if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh || # Allow the use of GNU shtool's install command. case $nonopt in *shtool*) :;; *) false;; esac; then # Aesthetically quote it. func_quote_for_eval "$nonopt" install_prog="$func_quote_for_eval_result " arg=$1 shift else install_prog= arg=$nonopt fi # The real first argument should be the name of the installation program. # Aesthetically quote it. func_quote_for_eval "$arg" func_append install_prog "$func_quote_for_eval_result" install_shared_prog=$install_prog case " $install_prog " in *[\\\ /]cp\ *) install_cp=: ;; *) install_cp=false ;; esac # We need to accept at least all the BSD install flags. dest= files= opts= prev= install_type= isdir=no stripme= no_mode=: for arg do arg2= if test -n "$dest"; then func_append files " $dest" dest=$arg continue fi case $arg in -d) isdir=yes ;; -f) if $install_cp; then :; else prev=$arg fi ;; -g | -m | -o) prev=$arg ;; -s) stripme=" -s" continue ;; -*) ;; *) # If the previous option needed an argument, then skip it. if test -n "$prev"; then if test "x$prev" = x-m && test -n "$install_override_mode"; then arg2=$install_override_mode no_mode=false fi prev= else dest=$arg continue fi ;; esac # Aesthetically quote the argument. func_quote_for_eval "$arg" func_append install_prog " $func_quote_for_eval_result" if test -n "$arg2"; then func_quote_for_eval "$arg2" fi func_append install_shared_prog " $func_quote_for_eval_result" done test -z "$install_prog" && \ func_fatal_help "you must specify an install program" test -n "$prev" && \ func_fatal_help "the \`$prev' option requires an argument" if test -n "$install_override_mode" && $no_mode; then if $install_cp; then :; else func_quote_for_eval "$install_override_mode" func_append install_shared_prog " -m $func_quote_for_eval_result" fi fi if test -z "$files"; then if test -z "$dest"; then func_fatal_help "no file or destination specified" else func_fatal_help "you must specify a destination" fi fi # Strip any trailing slash from the destination. func_stripname '' '/' "$dest" dest=$func_stripname_result # Check to see that the destination is a directory. test -d "$dest" && isdir=yes if test "$isdir" = yes; then destdir="$dest" destname= else func_dirname_and_basename "$dest" "" "." destdir="$func_dirname_result" destname="$func_basename_result" # Not a directory, so check to see that there is only one file specified. set dummy $files; shift test "$#" -gt 1 && \ func_fatal_help "\`$dest' is not a directory" fi case $destdir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) for file in $files; do case $file in *.lo) ;; *) func_fatal_help "\`$destdir' must be an absolute directory name" ;; esac done ;; esac # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic="$magic" staticlibs= future_libdirs= current_libdirs= for file in $files; do # Do each installation. case $file in *.$libext) # Do the static libraries later. func_append staticlibs " $file" ;; *.la) func_resolve_sysroot "$file" file=$func_resolve_sysroot_result # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$file" \ || func_fatal_help "\`$file' is not a valid libtool archive" library_names= old_library= relink_command= func_source "$file" # Add the libdir to current_libdirs if it is the destination. if test "X$destdir" = "X$libdir"; then case "$current_libdirs " in *" $libdir "*) ;; *) func_append current_libdirs " $libdir" ;; esac else # Note the libdir as a future libdir. case "$future_libdirs " in *" $libdir "*) ;; *) func_append future_libdirs " $libdir" ;; esac fi func_dirname "$file" "/" "" dir="$func_dirname_result" func_append dir "$objdir" if test -n "$relink_command"; then # Determine the prefix the user has applied to our future dir. inst_prefix_dir=`$ECHO "$destdir" | $SED -e "s%$libdir\$%%"` # Don't allow the user to place us outside of our expected # location b/c this prevents finding dependent libraries that # are installed to the same prefix. # At present, this check doesn't affect windows .dll's that # are installed into $libdir/../bin (currently, that works fine) # but it's something to keep an eye on. test "$inst_prefix_dir" = "$destdir" && \ func_fatal_error "error: cannot install \`$file' to a directory not ending in $libdir" if test -n "$inst_prefix_dir"; then # Stick the inst_prefix_dir data into the link command. relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"` else relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"` fi func_warning "relinking \`$file'" func_show_eval "$relink_command" \ 'func_fatal_error "error: relink \`$file'\'' with the above command before installing it"' fi # See the names of the shared library. set dummy $library_names; shift if test -n "$1"; then realname="$1" shift srcname="$realname" test -n "$relink_command" && srcname="$realname"T # Install the shared library and build the symlinks. func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \ 'exit $?' tstripme="$stripme" case $host_os in cygwin* | mingw* | pw32* | cegcc*) case $realname in *.dll.a) tstripme="" ;; esac ;; esac if test -n "$tstripme" && test -n "$striplib"; then func_show_eval "$striplib $destdir/$realname" 'exit $?' fi if test "$#" -gt 0; then # Delete the old symlinks, and create new ones. # Try `ln -sf' first, because the `ln' binary might depend on # the symlink we replace! Solaris /bin/ln does not understand -f, # so we also need to try rm && ln -s. for linkname do test "$linkname" != "$realname" \ && func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })" done fi # Do each command in the postinstall commands. lib="$destdir/$realname" func_execute_cmds "$postinstall_cmds" 'exit $?' fi # Install the pseudo-library for information purposes. func_basename "$file" name="$func_basename_result" instname="$dir/$name"i func_show_eval "$install_prog $instname $destdir/$name" 'exit $?' # Maybe install the static library, too. test -n "$old_library" && func_append staticlibs " $dir/$old_library" ;; *.lo) # Install (i.e. copy) a libtool object. # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile="$destdir/$destname" else func_basename "$file" destfile="$func_basename_result" destfile="$destdir/$destfile" fi # Deduce the name of the destination old-style object file. case $destfile in *.lo) func_lo2o "$destfile" staticdest=$func_lo2o_result ;; *.$objext) staticdest="$destfile" destfile= ;; *) func_fatal_help "cannot copy a libtool object to \`$destfile'" ;; esac # Install the libtool object if requested. test -n "$destfile" && \ func_show_eval "$install_prog $file $destfile" 'exit $?' # Install the old object if enabled. if test "$build_old_libs" = yes; then # Deduce the name of the old-style object file. func_lo2o "$file" staticobj=$func_lo2o_result func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?' fi exit $EXIT_SUCCESS ;; *) # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile="$destdir/$destname" else func_basename "$file" destfile="$func_basename_result" destfile="$destdir/$destfile" fi # If the file is missing, and there is a .exe on the end, strip it # because it is most likely a libtool script we actually want to # install stripped_ext="" case $file in *.exe) if test ! -f "$file"; then func_stripname '' '.exe' "$file" file=$func_stripname_result stripped_ext=".exe" fi ;; esac # Do a test to see if this is really a libtool program. case $host in *cygwin* | *mingw*) if func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" wrapper=$func_ltwrapper_scriptname_result else func_stripname '' '.exe' "$file" wrapper=$func_stripname_result fi ;; *) wrapper=$file ;; esac if func_ltwrapper_script_p "$wrapper"; then notinst_deplibs= relink_command= func_source "$wrapper" # Check the variables that should have been set. test -z "$generated_by_libtool_version" && \ func_fatal_error "invalid libtool wrapper script \`$wrapper'" finalize=yes for lib in $notinst_deplibs; do # Check to see that each library is installed. libdir= if test -f "$lib"; then func_source "$lib" fi libfile="$libdir/"`$ECHO "$lib" | $SED 's%^.*/%%g'` ### testsuite: skip nested quoting test if test -n "$libdir" && test ! -f "$libfile"; then func_warning "\`$lib' has not been installed in \`$libdir'" finalize=no fi done relink_command= func_source "$wrapper" outputname= if test "$fast_install" = no && test -n "$relink_command"; then $opt_dry_run || { if test "$finalize" = yes; then tmpdir=`func_mktempdir` func_basename "$file$stripped_ext" file="$func_basename_result" outputname="$tmpdir/$file" # Replace the output file specification. relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'` $opt_silent || { func_quote_for_expand "$relink_command" eval "func_echo $func_quote_for_expand_result" } if eval "$relink_command"; then : else func_error "error: relink \`$file' with the above command before installing it" $opt_dry_run || ${RM}r "$tmpdir" continue fi file="$outputname" else func_warning "cannot relink \`$file'" fi } else # Install the binary that we compiled earlier. file=`$ECHO "$file$stripped_ext" | $SED "s%\([^/]*\)$%$objdir/\1%"` fi fi # remove .exe since cygwin /usr/bin/install will append another # one anyway case $install_prog,$host in */usr/bin/install*,*cygwin*) case $file:$destfile in *.exe:*.exe) # this is ok ;; *.exe:*) destfile=$destfile.exe ;; *:*.exe) func_stripname '' '.exe' "$destfile" destfile=$func_stripname_result ;; esac ;; esac func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?' $opt_dry_run || if test -n "$outputname"; then ${RM}r "$tmpdir" fi ;; esac done for file in $staticlibs; do func_basename "$file" name="$func_basename_result" # Set up the ranlib parameters. oldlib="$destdir/$name" func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 tool_oldlib=$func_to_tool_file_result func_show_eval "$install_prog \$file \$oldlib" 'exit $?' if test -n "$stripme" && test -n "$old_striplib"; then func_show_eval "$old_striplib $tool_oldlib" 'exit $?' fi # Do each command in the postinstall commands. func_execute_cmds "$old_postinstall_cmds" 'exit $?' done test -n "$future_libdirs" && \ func_warning "remember to run \`$progname --finish$future_libdirs'" if test -n "$current_libdirs"; then # Maybe just do a dry run. $opt_dry_run && current_libdirs=" -n$current_libdirs" exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs' else exit $EXIT_SUCCESS fi } test "$opt_mode" = install && func_mode_install ${1+"$@"} # func_generate_dlsyms outputname originator pic_p # Extract symbols from dlprefiles and create ${outputname}S.o with # a dlpreopen symbol table. func_generate_dlsyms () { $opt_debug my_outputname="$1" my_originator="$2" my_pic_p="${3-no}" my_prefix=`$ECHO "$my_originator" | sed 's%[^a-zA-Z0-9]%_%g'` my_dlsyms= if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then if test -n "$NM" && test -n "$global_symbol_pipe"; then my_dlsyms="${my_outputname}S.c" else func_error "not configured to extract global symbols from dlpreopened files" fi fi if test -n "$my_dlsyms"; then case $my_dlsyms in "") ;; *.c) # Discover the nlist of each of the dlfiles. nlist="$output_objdir/${my_outputname}.nm" func_show_eval "$RM $nlist ${nlist}S ${nlist}T" # Parse the name list into a source file. func_verbose "creating $output_objdir/$my_dlsyms" $opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\ /* $my_dlsyms - symbol resolution table for \`$my_outputname' dlsym emulation. */ /* Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION */ #ifdef __cplusplus extern \"C\" { #endif #if defined(__GNUC__) && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4)) #pragma GCC diagnostic ignored \"-Wstrict-prototypes\" #endif /* 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 /* External symbol declarations for the compiler. */\ " if test "$dlself" = yes; then func_verbose "generating symbol list for \`$output'" $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist" # Add our own program objects to the symbol list. progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP` for progfile in $progfiles; do func_to_tool_file "$progfile" func_convert_file_msys_to_w32 func_verbose "extracting global C symbols from \`$func_to_tool_file_result'" $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'" done if test -n "$exclude_expsyms"; then $opt_dry_run || { eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' } fi if test -n "$export_symbols_regex"; then $opt_dry_run || { eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' } fi # Prepare the list of exported symbols if test -z "$export_symbols"; then export_symbols="$output_objdir/$outputname.exp" $opt_dry_run || { $RM $export_symbols eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' case $host in *cygwin* | *mingw* | *cegcc* ) eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"' ;; esac } else $opt_dry_run || { eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"' eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' case $host in *cygwin* | *mingw* | *cegcc* ) eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' eval 'cat "$nlist" >> "$output_objdir/$outputname.def"' ;; esac } fi fi for dlprefile in $dlprefiles; do func_verbose "extracting global C symbols from \`$dlprefile'" func_basename "$dlprefile" name="$func_basename_result" case $host in *cygwin* | *mingw* | *cegcc* ) # if an import library, we need to obtain dlname if func_win32_import_lib_p "$dlprefile"; then func_tr_sh "$dlprefile" eval "curr_lafile=\$libfile_$func_tr_sh_result" dlprefile_dlbasename="" if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then # Use subshell, to avoid clobbering current variable values dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"` if test -n "$dlprefile_dlname" ; then func_basename "$dlprefile_dlname" dlprefile_dlbasename="$func_basename_result" else # no lafile. user explicitly requested -dlpreopen . $sharedlib_from_linklib_cmd "$dlprefile" dlprefile_dlbasename=$sharedlib_from_linklib_result fi fi $opt_dry_run || { if test -n "$dlprefile_dlbasename" ; then eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"' else func_warning "Could not compute DLL name from $name" eval '$ECHO ": $name " >> "$nlist"' fi func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe | $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'" } else # not an import lib $opt_dry_run || { eval '$ECHO ": $name " >> "$nlist"' func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" } fi ;; *) $opt_dry_run || { eval '$ECHO ": $name " >> "$nlist"' func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" } ;; esac done $opt_dry_run || { # Make sure we have at least an empty file. test -f "$nlist" || : > "$nlist" if test -n "$exclude_expsyms"; then $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T $MV "$nlist"T "$nlist" fi # Try sorting and uniquifying the output. if $GREP -v "^: " < "$nlist" | if sort -k 3 /dev/null 2>&1; then sort -k 3 else sort +2 fi | uniq > "$nlist"S; then : else $GREP -v "^: " < "$nlist" > "$nlist"S fi if test -f "$nlist"S; then eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"' else echo '/* NONE */' >> "$output_objdir/$my_dlsyms" fi echo >> "$output_objdir/$my_dlsyms" "\ /* The mapping between symbol names and symbols. */ typedef struct { const char *name; void *address; } lt_dlsymlist; extern LT_DLSYM_CONST lt_dlsymlist lt_${my_prefix}_LTX_preloaded_symbols[]; LT_DLSYM_CONST lt_dlsymlist lt_${my_prefix}_LTX_preloaded_symbols[] = {\ { \"$my_originator\", (void *) 0 }," case $need_lib_prefix in no) eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms" ;; *) eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms" ;; esac echo >> "$output_objdir/$my_dlsyms" "\ {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt_${my_prefix}_LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif\ " } # !$opt_dry_run pic_flag_for_symtable= case "$compile_command " in *" -static "*) ;; *) case $host in # compiling the symbol table file with pic_flag works around # a FreeBSD bug that causes programs to crash when -lm is # linked before any other PIC object. But we must not use # pic_flag when linking with -static. The problem exists in # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. *-*-freebsd2.*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;; *-*-hpux*) pic_flag_for_symtable=" $pic_flag" ;; *) if test "X$my_pic_p" != Xno; then pic_flag_for_symtable=" $pic_flag" fi ;; esac ;; esac symtab_cflags= for arg in $LTCFLAGS; do case $arg in -pie | -fpie | -fPIE) ;; *) func_append symtab_cflags " $arg" ;; esac done # Now compile the dynamic symbol file. func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?' # Clean up the generated files. func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T"' # Transform the symbol file into the correct name. symfileobj="$output_objdir/${my_outputname}S.$objext" case $host in *cygwin* | *mingw* | *cegcc* ) if test -f "$output_objdir/$my_outputname.def"; then compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` else compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` fi ;; *) compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` ;; esac ;; *) func_fatal_error "unknown suffix for \`$my_dlsyms'" ;; esac else # We keep going just in case the user didn't refer to # lt_preloaded_symbols. The linker will fail if global_symbol_pipe # really was required. # Nullify the symbol file. compile_command=`$ECHO "$compile_command" | $SED "s% @SYMFILE@%%"` finalize_command=`$ECHO "$finalize_command" | $SED "s% @SYMFILE@%%"` fi } # func_win32_libid arg # return the library type of file 'arg' # # Need a lot of goo to handle *both* DLLs and import libs # Has to be a shell function in order to 'eat' the argument # that is supplied when $file_magic_command is called. # Despite the name, also deal with 64 bit binaries. func_win32_libid () { $opt_debug win32_libid_type="unknown" win32_fileres=`file -L $1 2>/dev/null` case $win32_fileres in *ar\ archive\ import\ library*) # definitely import win32_libid_type="x86 archive import" ;; *ar\ archive*) # could be an import, or static # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD. if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then func_to_tool_file "$1" func_convert_file_msys_to_w32 win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" | $SED -n -e ' 1,100{ / I /{ s,.*,import, p q } }'` case $win32_nmres in import*) win32_libid_type="x86 archive import";; *) win32_libid_type="x86 archive static";; esac fi ;; *DLL*) win32_libid_type="x86 DLL" ;; *executable*) # but shell scripts are "executable" too... case $win32_fileres in *MS\ Windows\ PE\ Intel*) win32_libid_type="x86 DLL" ;; esac ;; esac $ECHO "$win32_libid_type" } # func_cygming_dll_for_implib ARG # # Platform-specific function to extract the # name of the DLL associated with the specified # import library ARG. # Invoked by eval'ing the libtool variable # $sharedlib_from_linklib_cmd # Result is available in the variable # $sharedlib_from_linklib_result func_cygming_dll_for_implib () { $opt_debug sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"` } # func_cygming_dll_for_implib_fallback_core SECTION_NAME LIBNAMEs # # The is the core of a fallback implementation of a # platform-specific function to extract the name of the # DLL associated with the specified import library LIBNAME. # # SECTION_NAME is either .idata$6 or .idata$7, depending # on the platform and compiler that created the implib. # # Echos the name of the DLL associated with the # specified import library. func_cygming_dll_for_implib_fallback_core () { $opt_debug match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"` $OBJDUMP -s --section "$1" "$2" 2>/dev/null | $SED '/^Contents of section '"$match_literal"':/{ # Place marker at beginning of archive member dllname section s/.*/====MARK====/ p d } # These lines can sometimes be longer than 43 characters, but # are always uninteresting /:[ ]*file format pe[i]\{,1\}-/d /^In archive [^:]*:/d # Ensure marker is printed /^====MARK====/p # Remove all lines with less than 43 characters /^.\{43\}/!d # From remaining lines, remove first 43 characters s/^.\{43\}//' | $SED -n ' # Join marker and all lines until next marker into a single line /^====MARK====/ b para H $ b para b :para x s/\n//g # Remove the marker s/^====MARK====// # Remove trailing dots and whitespace s/[\. \t]*$// # Print /./p' | # we now have a list, one entry per line, of the stringified # contents of the appropriate section of all members of the # archive which possess that section. Heuristic: eliminate # all those which have a first or second character that is # a '.' (that is, objdump's representation of an unprintable # character.) This should work for all archives with less than # 0x302f exports -- but will fail for DLLs whose name actually # begins with a literal '.' or a single character followed by # a '.'. # # Of those that remain, print the first one. $SED -e '/^\./d;/^.\./d;q' } # func_cygming_gnu_implib_p ARG # This predicate returns with zero status (TRUE) if # ARG is a GNU/binutils-style import library. Returns # with nonzero status (FALSE) otherwise. func_cygming_gnu_implib_p () { $opt_debug func_to_tool_file "$1" func_convert_file_msys_to_w32 func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'` test -n "$func_cygming_gnu_implib_tmp" } # func_cygming_ms_implib_p ARG # This predicate returns with zero status (TRUE) if # ARG is an MS-style import library. Returns # with nonzero status (FALSE) otherwise. func_cygming_ms_implib_p () { $opt_debug func_to_tool_file "$1" func_convert_file_msys_to_w32 func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'` test -n "$func_cygming_ms_implib_tmp" } # func_cygming_dll_for_implib_fallback ARG # Platform-specific function to extract the # name of the DLL associated with the specified # import library ARG. # # This fallback implementation is for use when $DLLTOOL # does not support the --identify-strict option. # Invoked by eval'ing the libtool variable # $sharedlib_from_linklib_cmd # Result is available in the variable # $sharedlib_from_linklib_result func_cygming_dll_for_implib_fallback () { $opt_debug if func_cygming_gnu_implib_p "$1" ; then # binutils import library sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"` elif func_cygming_ms_implib_p "$1" ; then # ms-generated import library sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"` else # unknown sharedlib_from_linklib_result="" fi } # func_extract_an_archive dir oldlib func_extract_an_archive () { $opt_debug f_ex_an_ar_dir="$1"; shift f_ex_an_ar_oldlib="$1" if test "$lock_old_archive_extraction" = yes; then lockfile=$f_ex_an_ar_oldlib.lock until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do func_echo "Waiting for $lockfile to be removed" sleep 2 done fi func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \ 'stat=$?; rm -f "$lockfile"; exit $stat' if test "$lock_old_archive_extraction" = yes; then $opt_dry_run || rm -f "$lockfile" fi if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then : else func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" fi } # func_extract_archives gentop oldlib ... func_extract_archives () { $opt_debug my_gentop="$1"; shift my_oldlibs=${1+"$@"} my_oldobjs="" my_xlib="" my_xabs="" my_xdir="" for my_xlib in $my_oldlibs; do # Extract the objects. case $my_xlib in [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;; *) my_xabs=`pwd`"/$my_xlib" ;; esac func_basename "$my_xlib" my_xlib="$func_basename_result" my_xlib_u=$my_xlib while :; do case " $extracted_archives " in *" $my_xlib_u "*) func_arith $extracted_serial + 1 extracted_serial=$func_arith_result my_xlib_u=lt$extracted_serial-$my_xlib ;; *) break ;; esac done extracted_archives="$extracted_archives $my_xlib_u" my_xdir="$my_gentop/$my_xlib_u" func_mkdir_p "$my_xdir" case $host in *-darwin*) func_verbose "Extracting $my_xabs" # Do not bother doing anything if just a dry run $opt_dry_run || { darwin_orig_dir=`pwd` cd $my_xdir || exit $? darwin_archive=$my_xabs darwin_curdir=`pwd` darwin_base_archive=`basename "$darwin_archive"` darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true` if test -n "$darwin_arches"; then darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'` darwin_arch= func_verbose "$darwin_base_archive has multiple architectures $darwin_arches" for darwin_arch in $darwin_arches ; do func_mkdir_p "unfat-$$/${darwin_base_archive}-${darwin_arch}" $LIPO -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}" cd "unfat-$$/${darwin_base_archive}-${darwin_arch}" func_extract_an_archive "`pwd`" "${darwin_base_archive}" cd "$darwin_curdir" $RM "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" done # $darwin_arches ## Okay now we've a bunch of thin objects, gotta fatten them up :) darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$basename" | sort -u` darwin_file= darwin_files= for darwin_file in $darwin_filelist; do darwin_files=`find unfat-$$ -name $darwin_file -print | sort | $NL2SP` $LIPO -create -output "$darwin_file" $darwin_files done # $darwin_filelist $RM -rf unfat-$$ cd "$darwin_orig_dir" else cd $darwin_orig_dir func_extract_an_archive "$my_xdir" "$my_xabs" fi # $darwin_arches } # !$opt_dry_run ;; *) func_extract_an_archive "$my_xdir" "$my_xabs" ;; esac my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP` done func_extract_archives_result="$my_oldobjs" } # func_emit_wrapper [arg=no] # # Emit a libtool wrapper script on stdout. # Don't directly open a file because we may want to # incorporate the script contents within a cygwin/mingw # wrapper executable. Must ONLY be called from within # func_mode_link because it depends on a number of variables # set therein. # # ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR # variable will take. If 'yes', then the emitted script # will assume that the directory in which it is stored is # the $objdir directory. This is a cygwin/mingw-specific # behavior. func_emit_wrapper () { func_emit_wrapper_arg1=${1-no} $ECHO "\ #! $SHELL # $output - temporary wrapper script for $objdir/$outputname # Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION # # The $output program cannot be directly executed until all the libtool # libraries that it depends on are installed. # # This wrapper script should never be moved out of the build directory. # If it is, it will not operate correctly. # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. sed_quote_subst='$sed_quote_subst' # Be Bourne compatible if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs 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 BIN_SH=xpg4; export BIN_SH # for Tru64 DUALCASE=1; export DUALCASE # for MKS sh # 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 relink_command=\"$relink_command\" # This environment variable determines our operation mode. if test \"\$libtool_install_magic\" = \"$magic\"; then # install mode needs the following variables: generated_by_libtool_version='$macro_version' notinst_deplibs='$notinst_deplibs' else # When we are sourced in execute mode, \$file and \$ECHO are already set. if test \"\$libtool_execute_magic\" != \"$magic\"; then file=\"\$0\"" qECHO=`$ECHO "$ECHO" | $SED "$sed_quote_subst"` $ECHO "\ # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$1 _LTECHO_EOF' } ECHO=\"$qECHO\" fi # Very basic option parsing. These options are (a) specific to # the libtool wrapper, (b) are identical between the wrapper # /script/ and the wrapper /executable/ which is used only on # windows platforms, and (c) all begin with the string "--lt-" # (application programs are unlikely to have options which match # this pattern). # # There are only two supported options: --lt-debug and # --lt-dump-script. There is, deliberately, no --lt-help. # # The first argument to this parsing function should be the # script's $0 value, followed by "$@". lt_option_debug= func_parse_lt_options () { lt_script_arg0=\$0 shift for lt_opt do case \"\$lt_opt\" in --lt-debug) lt_option_debug=1 ;; --lt-dump-script) lt_dump_D=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\` test \"X\$lt_dump_D\" = \"X\$lt_script_arg0\" && lt_dump_D=. lt_dump_F=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%^.*/%%'\` cat \"\$lt_dump_D/\$lt_dump_F\" exit 0 ;; --lt-*) \$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&2 exit 1 ;; esac done # Print the debug banner immediately: if test -n \"\$lt_option_debug\"; then echo \"${outputname}:${output}:\${LINENO}: libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\" 1>&2 fi } # Used when --lt-debug. Prints its arguments to stdout # (redirection is the responsibility of the caller) func_lt_dump_args () { lt_dump_args_N=1; for lt_arg do \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[\$lt_dump_args_N]: \$lt_arg\" lt_dump_args_N=\`expr \$lt_dump_args_N + 1\` done } # Core function for launching the target application func_exec_program_core () { " case $host in # Backslashes separate directories on plain windows *-*-mingw | *-*-os2* | *-cegcc*) $ECHO "\ if test -n \"\$lt_option_debug\"; then \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir\\\\\$program\" 1>&2 func_lt_dump_args \${1+\"\$@\"} 1>&2 fi exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} " ;; *) $ECHO "\ if test -n \"\$lt_option_debug\"; then \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir/\$program\" 1>&2 func_lt_dump_args \${1+\"\$@\"} 1>&2 fi exec \"\$progdir/\$program\" \${1+\"\$@\"} " ;; esac $ECHO "\ \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2 exit 1 } # A function to encapsulate launching the target application # Strips options in the --lt-* namespace from \$@ and # launches target application with the remaining arguments. func_exec_program () { case \" \$* \" in *\\ --lt-*) for lt_wr_arg do case \$lt_wr_arg in --lt-*) ;; *) set x \"\$@\" \"\$lt_wr_arg\"; shift;; esac shift done ;; esac func_exec_program_core \${1+\"\$@\"} } # Parse options func_parse_lt_options \"\$0\" \${1+\"\$@\"} # Find the directory that this script lives in. thisdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*$%%'\` test \"x\$thisdir\" = \"x\$file\" && thisdir=. # Follow symbolic links until we get to the real thisdir. file=\`ls -ld \"\$file\" | $SED -n 's/.*-> //p'\` while test -n \"\$file\"; do destdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*\$%%'\` # If there was a directory component, then change thisdir. if test \"x\$destdir\" != \"x\$file\"; then case \"\$destdir\" in [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;; *) thisdir=\"\$thisdir/\$destdir\" ;; esac fi file=\`\$ECHO \"\$file\" | $SED 's%^.*/%%'\` file=\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\` done # Usually 'no', except on cygwin/mingw when embedded into # the cwrapper. WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1 if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then # special case for '.' if test \"\$thisdir\" = \".\"; then thisdir=\`pwd\` fi # remove .libs from thisdir case \"\$thisdir\" in *[\\\\/]$objdir ) thisdir=\`\$ECHO \"\$thisdir\" | $SED 's%[\\\\/][^\\\\/]*$%%'\` ;; $objdir ) thisdir=. ;; esac fi # Try to get the absolute directory name. absdir=\`cd \"\$thisdir\" && pwd\` test -n \"\$absdir\" && thisdir=\"\$absdir\" " if test "$fast_install" = yes; then $ECHO "\ program=lt-'$outputname'$exeext progdir=\"\$thisdir/$objdir\" if test ! -f \"\$progdir/\$program\" || { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\ test \"X\$file\" != \"X\$progdir/\$program\"; }; then file=\"\$\$-\$program\" if test ! -d \"\$progdir\"; then $MKDIR \"\$progdir\" else $RM \"\$progdir/\$file\" fi" $ECHO "\ # relink executable if necessary if test -n \"\$relink_command\"; then if relink_command_output=\`eval \$relink_command 2>&1\`; then : else $ECHO \"\$relink_command_output\" >&2 $RM \"\$progdir/\$file\" exit 1 fi fi $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || { $RM \"\$progdir/\$program\"; $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; } $RM \"\$progdir/\$file\" fi" else $ECHO "\ program='$outputname' progdir=\"\$thisdir/$objdir\" " fi $ECHO "\ if test -f \"\$progdir/\$program\"; then" # fixup the dll searchpath if we need to. # # Fix the DLL searchpath if we need to. Do this before prepending # to shlibpath, because on Windows, both are PATH and uninstalled # libraries must come first. if test -n "$dllsearchpath"; then $ECHO "\ # Add the dll search path components to the executable PATH PATH=$dllsearchpath:\$PATH " fi # Export our shlibpath_var if we have one. if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then $ECHO "\ # Add our own library path to $shlibpath_var $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" # Some systems cannot cope with colon-terminated $shlibpath_var # The second colon is a workaround for a bug in BeOS R4 sed $shlibpath_var=\`\$ECHO \"\$$shlibpath_var\" | $SED 's/::*\$//'\` export $shlibpath_var " fi $ECHO "\ if test \"\$libtool_execute_magic\" != \"$magic\"; then # Run the actual program with our arguments. func_exec_program \${1+\"\$@\"} fi else # The program doesn't exist. \$ECHO \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2 \$ECHO \"This script is just a wrapper for \$program.\" 1>&2 \$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2 exit 1 fi fi\ " } # func_emit_cwrapperexe_src # emit the source code for a wrapper executable on stdout # Must ONLY be called from within func_mode_link because # it depends on a number of variable set therein. func_emit_cwrapperexe_src () { cat < #include #ifdef _MSC_VER # include # include # include #else # include # include # ifdef __CYGWIN__ # include # endif #endif #include #include #include #include #include #include #include #include /* declarations of non-ANSI functions */ #if defined(__MINGW32__) # ifdef __STRICT_ANSI__ int _putenv (const char *); # endif #elif defined(__CYGWIN__) # ifdef __STRICT_ANSI__ char *realpath (const char *, char *); int putenv (char *); int setenv (const char *, const char *, int); # endif /* #elif defined (other platforms) ... */ #endif /* portability defines, excluding path handling macros */ #if defined(_MSC_VER) # define setmode _setmode # define stat _stat # define chmod _chmod # define getcwd _getcwd # define putenv _putenv # define S_IXUSR _S_IEXEC # ifndef _INTPTR_T_DEFINED # define _INTPTR_T_DEFINED # define intptr_t int # endif #elif defined(__MINGW32__) # define setmode _setmode # define stat _stat # define chmod _chmod # define getcwd _getcwd # define putenv _putenv #elif defined(__CYGWIN__) # define HAVE_SETENV # define FOPEN_WB "wb" /* #elif defined (other platforms) ... */ #endif #if defined(PATH_MAX) # define LT_PATHMAX PATH_MAX #elif defined(MAXPATHLEN) # define LT_PATHMAX MAXPATHLEN #else # define LT_PATHMAX 1024 #endif #ifndef S_IXOTH # define S_IXOTH 0 #endif #ifndef S_IXGRP # define S_IXGRP 0 #endif /* path handling portability macros */ #ifndef DIR_SEPARATOR # define DIR_SEPARATOR '/' # define PATH_SEPARATOR ':' #endif #if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \ defined (__OS2__) # define HAVE_DOS_BASED_FILE_SYSTEM # define FOPEN_WB "wb" # ifndef DIR_SEPARATOR_2 # define DIR_SEPARATOR_2 '\\' # endif # ifndef PATH_SEPARATOR_2 # define PATH_SEPARATOR_2 ';' # endif #endif #ifndef DIR_SEPARATOR_2 # define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR) #else /* DIR_SEPARATOR_2 */ # define IS_DIR_SEPARATOR(ch) \ (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2)) #endif /* DIR_SEPARATOR_2 */ #ifndef PATH_SEPARATOR_2 # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR) #else /* PATH_SEPARATOR_2 */ # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2) #endif /* PATH_SEPARATOR_2 */ #ifndef FOPEN_WB # define FOPEN_WB "w" #endif #ifndef _O_BINARY # define _O_BINARY 0 #endif #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) #define XFREE(stale) do { \ if (stale) { free ((void *) stale); stale = 0; } \ } while (0) #if defined(LT_DEBUGWRAPPER) static int lt_debug = 1; #else static int lt_debug = 0; #endif const char *program_name = "libtool-wrapper"; /* in case xstrdup fails */ void *xmalloc (size_t num); char *xstrdup (const char *string); const char *base_name (const char *name); char *find_executable (const char *wrapper); char *chase_symlinks (const char *pathspec); int make_executable (const char *path); int check_executable (const char *path); char *strendzap (char *str, const char *pat); void lt_debugprintf (const char *file, int line, const char *fmt, ...); void lt_fatal (const char *file, int line, const char *message, ...); static const char *nonnull (const char *s); static const char *nonempty (const char *s); void lt_setenv (const char *name, const char *value); char *lt_extend_str (const char *orig_value, const char *add, int to_end); void lt_update_exe_path (const char *name, const char *value); void lt_update_lib_path (const char *name, const char *value); char **prepare_spawn (char **argv); void lt_dump_script (FILE *f); EOF cat <= 0) && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH))) return 1; else return 0; } int make_executable (const char *path) { int rval = 0; struct stat st; lt_debugprintf (__FILE__, __LINE__, "(make_executable): %s\n", nonempty (path)); if ((!path) || (!*path)) return 0; if (stat (path, &st) >= 0) { rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR); } return rval; } /* Searches for the full path of the wrapper. Returns newly allocated full path name if found, NULL otherwise Does not chase symlinks, even on platforms that support them. */ char * find_executable (const char *wrapper) { int has_slash = 0; const char *p; const char *p_next; /* static buffer for getcwd */ char tmp[LT_PATHMAX + 1]; int tmp_len; char *concat_name; lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n", nonempty (wrapper)); if ((wrapper == NULL) || (*wrapper == '\0')) return NULL; /* Absolute path? */ #if defined (HAVE_DOS_BASED_FILE_SYSTEM) if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':') { concat_name = xstrdup (wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } else { #endif if (IS_DIR_SEPARATOR (wrapper[0])) { concat_name = xstrdup (wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } #if defined (HAVE_DOS_BASED_FILE_SYSTEM) } #endif for (p = wrapper; *p; p++) if (*p == '/') { has_slash = 1; break; } if (!has_slash) { /* no slashes; search PATH */ const char *path = getenv ("PATH"); if (path != NULL) { for (p = path; *p; p = p_next) { const char *q; size_t p_len; for (q = p; *q; q++) if (IS_PATH_SEPARATOR (*q)) break; p_len = q - p; p_next = (*q == '\0' ? q : q + 1); if (p_len == 0) { /* empty path: current directory */ if (getcwd (tmp, LT_PATHMAX) == NULL) lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", nonnull (strerror (errno))); tmp_len = strlen (tmp); concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, tmp, tmp_len); concat_name[tmp_len] = '/'; strcpy (concat_name + tmp_len + 1, wrapper); } else { concat_name = XMALLOC (char, p_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, p, p_len); concat_name[p_len] = '/'; strcpy (concat_name + p_len + 1, wrapper); } if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } } /* not found in PATH; assume curdir */ } /* Relative path | not found in path: prepend cwd */ if (getcwd (tmp, LT_PATHMAX) == NULL) lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", nonnull (strerror (errno))); tmp_len = strlen (tmp); concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, tmp, tmp_len); concat_name[tmp_len] = '/'; strcpy (concat_name + tmp_len + 1, wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); return NULL; } char * chase_symlinks (const char *pathspec) { #ifndef S_ISLNK return xstrdup (pathspec); #else char buf[LT_PATHMAX]; struct stat s; char *tmp_pathspec = xstrdup (pathspec); char *p; int has_symlinks = 0; while (strlen (tmp_pathspec) && !has_symlinks) { lt_debugprintf (__FILE__, __LINE__, "checking path component for symlinks: %s\n", tmp_pathspec); if (lstat (tmp_pathspec, &s) == 0) { if (S_ISLNK (s.st_mode) != 0) { has_symlinks = 1; break; } /* search backwards for last DIR_SEPARATOR */ p = tmp_pathspec + strlen (tmp_pathspec) - 1; while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) p--; if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) { /* no more DIR_SEPARATORS left */ break; } *p = '\0'; } else { lt_fatal (__FILE__, __LINE__, "error accessing file \"%s\": %s", tmp_pathspec, nonnull (strerror (errno))); } } XFREE (tmp_pathspec); if (!has_symlinks) { return xstrdup (pathspec); } tmp_pathspec = realpath (pathspec, buf); if (tmp_pathspec == 0) { lt_fatal (__FILE__, __LINE__, "could not follow symlinks for %s", pathspec); } return xstrdup (tmp_pathspec); #endif } char * strendzap (char *str, const char *pat) { size_t len, patlen; assert (str != NULL); assert (pat != NULL); len = strlen (str); patlen = strlen (pat); if (patlen <= len) { str += len - patlen; if (strcmp (str, pat) == 0) *str = '\0'; } return str; } void lt_debugprintf (const char *file, int line, const char *fmt, ...) { va_list args; if (lt_debug) { (void) fprintf (stderr, "%s:%s:%d: ", program_name, file, line); va_start (args, fmt); (void) vfprintf (stderr, fmt, args); va_end (args); } } static void lt_error_core (int exit_status, const char *file, int line, const char *mode, const char *message, va_list ap) { fprintf (stderr, "%s:%s:%d: %s: ", program_name, file, line, mode); vfprintf (stderr, message, ap); fprintf (stderr, ".\n"); if (exit_status >= 0) exit (exit_status); } void lt_fatal (const char *file, int line, const char *message, ...) { va_list ap; va_start (ap, message); lt_error_core (EXIT_FAILURE, file, line, "FATAL", message, ap); va_end (ap); } static const char * nonnull (const char *s) { return s ? s : "(null)"; } static const char * nonempty (const char *s) { return (s && !*s) ? "(empty)" : nonnull (s); } void lt_setenv (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_setenv) setting '%s' to '%s'\n", nonnull (name), nonnull (value)); { #ifdef HAVE_SETENV /* always make a copy, for consistency with !HAVE_SETENV */ char *str = xstrdup (value); setenv (name, str, 1); #else int len = strlen (name) + 1 + strlen (value) + 1; char *str = XMALLOC (char, len); sprintf (str, "%s=%s", name, value); if (putenv (str) != EXIT_SUCCESS) { XFREE (str); } #endif } } char * lt_extend_str (const char *orig_value, const char *add, int to_end) { char *new_value; if (orig_value && *orig_value) { int orig_value_len = strlen (orig_value); int add_len = strlen (add); new_value = XMALLOC (char, add_len + orig_value_len + 1); if (to_end) { strcpy (new_value, orig_value); strcpy (new_value + orig_value_len, add); } else { strcpy (new_value, add); strcpy (new_value + add_len, orig_value); } } else { new_value = xstrdup (add); } return new_value; } void lt_update_exe_path (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_update_exe_path) modifying '%s' by prepending '%s'\n", nonnull (name), nonnull (value)); if (name && *name && value && *value) { char *new_value = lt_extend_str (getenv (name), value, 0); /* some systems can't cope with a ':'-terminated path #' */ int len = strlen (new_value); while (((len = strlen (new_value)) > 0) && IS_PATH_SEPARATOR (new_value[len-1])) { new_value[len-1] = '\0'; } lt_setenv (name, new_value); XFREE (new_value); } } void lt_update_lib_path (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_update_lib_path) modifying '%s' by prepending '%s'\n", nonnull (name), nonnull (value)); if (name && *name && value && *value) { char *new_value = lt_extend_str (getenv (name), value, 0); lt_setenv (name, new_value); XFREE (new_value); } } EOF case $host_os in mingw*) cat <<"EOF" /* Prepares an argument vector before calling spawn(). Note that spawn() does not by itself call the command interpreter (getenv ("COMSPEC") != NULL ? getenv ("COMSPEC") : ({ OSVERSIONINFO v; v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); GetVersionEx(&v); v.dwPlatformId == VER_PLATFORM_WIN32_NT; }) ? "cmd.exe" : "command.com"). Instead it simply concatenates the arguments, separated by ' ', and calls CreateProcess(). We must quote the arguments since Win32 CreateProcess() interprets characters like ' ', '\t', '\\', '"' (but not '<' and '>') in a special way: - Space and tab are interpreted as delimiters. They are not treated as delimiters if they are surrounded by double quotes: "...". - Unescaped double quotes are removed from the input. Their only effect is that within double quotes, space and tab are treated like normal characters. - Backslashes not followed by double quotes are not special. - But 2*n+1 backslashes followed by a double quote become n backslashes followed by a double quote (n >= 0): \" -> " \\\" -> \" \\\\\" -> \\" */ #define SHELL_SPECIAL_CHARS "\"\\ \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" #define SHELL_SPACE_CHARS " \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" char ** prepare_spawn (char **argv) { size_t argc; char **new_argv; size_t i; /* Count number of arguments. */ for (argc = 0; argv[argc] != NULL; argc++) ; /* Allocate new argument vector. */ new_argv = XMALLOC (char *, argc + 1); /* Put quoted arguments into the new argument vector. */ for (i = 0; i < argc; i++) { const char *string = argv[i]; if (string[0] == '\0') new_argv[i] = xstrdup ("\"\""); else if (strpbrk (string, SHELL_SPECIAL_CHARS) != NULL) { int quote_around = (strpbrk (string, SHELL_SPACE_CHARS) != NULL); size_t length; unsigned int backslashes; const char *s; char *quoted_string; char *p; length = 0; backslashes = 0; if (quote_around) length++; for (s = string; *s != '\0'; s++) { char c = *s; if (c == '"') length += backslashes + 1; length++; if (c == '\\') backslashes++; else backslashes = 0; } if (quote_around) length += backslashes + 1; quoted_string = XMALLOC (char, length + 1); p = quoted_string; backslashes = 0; if (quote_around) *p++ = '"'; for (s = string; *s != '\0'; s++) { char c = *s; if (c == '"') { unsigned int j; for (j = backslashes + 1; j > 0; j--) *p++ = '\\'; } *p++ = c; if (c == '\\') backslashes++; else backslashes = 0; } if (quote_around) { unsigned int j; for (j = backslashes; j > 0; j--) *p++ = '\\'; *p++ = '"'; } *p = '\0'; new_argv[i] = quoted_string; } else new_argv[i] = (char *) string; } new_argv[argc] = NULL; return new_argv; } EOF ;; esac cat <<"EOF" void lt_dump_script (FILE* f) { EOF func_emit_wrapper yes | $SED -n -e ' s/^\(.\{79\}\)\(..*\)/\1\ \2/ h s/\([\\"]\)/\\\1/g s/$/\\n/ s/\([^\n]*\).*/ fputs ("\1", f);/p g D' cat <<"EOF" } EOF } # end: func_emit_cwrapperexe_src # func_win32_import_lib_p ARG # True if ARG is an import lib, as indicated by $file_magic_cmd func_win32_import_lib_p () { $opt_debug case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in *import*) : ;; *) false ;; esac } # func_mode_link arg... func_mode_link () { $opt_debug case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) # It is impossible to link a dll without this setting, and # we shouldn't force the makefile maintainer to figure out # which system we are compiling for in order to pass an extra # flag for every libtool invocation. # allow_undefined=no # FIXME: Unfortunately, there are problems with the above when trying # to make a dll which has undefined symbols, in which case not # even a static library is built. For now, we need to specify # -no-undefined on the libtool link line when we can be certain # that all symbols are satisfied, otherwise we get a static library. allow_undefined=yes ;; *) allow_undefined=yes ;; esac libtool_args=$nonopt base_compile="$nonopt $@" compile_command=$nonopt finalize_command=$nonopt compile_rpath= finalize_rpath= compile_shlibpath= finalize_shlibpath= convenience= old_convenience= deplibs= old_deplibs= compiler_flags= linker_flags= dllsearchpath= lib_search_path=`pwd` inst_prefix_dir= new_inherited_linker_flags= avoid_version=no bindir= dlfiles= dlprefiles= dlself=no export_dynamic=no export_symbols= export_symbols_regex= generated= libobjs= ltlibs= module=no no_install=no objs= non_pic_objects= precious_files_regex= prefer_static_libs=no preload=no prev= prevarg= release= rpath= xrpath= perm_rpath= temp_rpath= thread_safe=no vinfo= vinfo_number=no weak_libs= single_module="${wl}-single_module" func_infer_tag $base_compile # We need to know -static, to get the right output filenames. for arg do case $arg in -shared) test "$build_libtool_libs" != yes && \ func_fatal_configuration "can not build a shared library" build_old_libs=no break ;; -all-static | -static | -static-libtool-libs) case $arg in -all-static) if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then func_warning "complete static linking is impossible in this configuration" fi if test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=yes ;; -static) if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=built ;; -static-libtool-libs) if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=yes ;; esac build_libtool_libs=no build_old_libs=yes break ;; esac done # See if our shared archives depend on static archives. test -n "$old_archive_from_new_cmds" && build_old_libs=yes # Go through the arguments, transforming them on the way. while test "$#" -gt 0; do arg="$1" shift func_quote_for_eval "$arg" qarg=$func_quote_for_eval_unquoted_result func_append libtool_args " $func_quote_for_eval_result" # If the previous option needs an argument, assign it. if test -n "$prev"; then case $prev in output) func_append compile_command " @OUTPUT@" func_append finalize_command " @OUTPUT@" ;; esac case $prev in bindir) bindir="$arg" prev= continue ;; dlfiles|dlprefiles) if test "$preload" = no; then # Add the symbol object into the linking commands. func_append compile_command " @SYMFILE@" func_append finalize_command " @SYMFILE@" preload=yes fi case $arg in *.la | *.lo) ;; # We handle these cases below. force) if test "$dlself" = no; then dlself=needless export_dynamic=yes fi prev= continue ;; self) if test "$prev" = dlprefiles; then dlself=yes elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then dlself=yes else dlself=needless export_dynamic=yes fi prev= continue ;; *) if test "$prev" = dlfiles; then func_append dlfiles " $arg" else func_append dlprefiles " $arg" fi prev= continue ;; esac ;; expsyms) export_symbols="$arg" test -f "$arg" \ || func_fatal_error "symbol file \`$arg' does not exist" prev= continue ;; expsyms_regex) export_symbols_regex="$arg" prev= continue ;; framework) case $host in *-*-darwin*) case "$deplibs " in *" $qarg.ltframework "*) ;; *) func_append deplibs " $qarg.ltframework" # this is fixed later ;; esac ;; esac prev= continue ;; inst_prefix) inst_prefix_dir="$arg" prev= continue ;; objectlist) if test -f "$arg"; then save_arg=$arg moreargs= for fil in `cat "$save_arg"` do # func_append moreargs " $fil" arg=$fil # A libtool-controlled object. # Check to see that this really is a libtool object. if func_lalib_unsafe_p "$arg"; then pic_object= non_pic_object= # Read the .lo file func_source "$arg" if test -z "$pic_object" || test -z "$non_pic_object" || test "$pic_object" = none && test "$non_pic_object" = none; then func_fatal_error "cannot find name of object for \`$arg'" fi # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" if test "$pic_object" != none; then # Prepend the subdirectory the object is found in. pic_object="$xdir$pic_object" if test "$prev" = dlfiles; then if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then func_append dlfiles " $pic_object" prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi # CHECK ME: I think I busted this. -Ossama if test "$prev" = dlprefiles; then # Preload the old-style object. func_append dlprefiles " $pic_object" prev= fi # A PIC object. func_append libobjs " $pic_object" arg="$pic_object" fi # Non-PIC object. if test "$non_pic_object" != none; then # Prepend the subdirectory the object is found in. non_pic_object="$xdir$non_pic_object" # A standard non-PIC object func_append non_pic_objects " $non_pic_object" if test -z "$pic_object" || test "$pic_object" = none ; then arg="$non_pic_object" fi else # If the PIC object exists, use it instead. # $xdir was prepended to $pic_object above. non_pic_object="$pic_object" func_append non_pic_objects " $non_pic_object" fi else # Only an error if not doing a dry-run. if $opt_dry_run; then # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" func_lo2o "$arg" pic_object=$xdir$objdir/$func_lo2o_result non_pic_object=$xdir$func_lo2o_result func_append libobjs " $pic_object" func_append non_pic_objects " $non_pic_object" else func_fatal_error "\`$arg' is not a valid libtool object" fi fi done else func_fatal_error "link input file \`$arg' does not exist" fi arg=$save_arg prev= continue ;; precious_regex) precious_files_regex="$arg" prev= continue ;; release) release="-$arg" prev= continue ;; rpath | xrpath) # We need an absolute path. case $arg in [\\/]* | [A-Za-z]:[\\/]*) ;; *) func_fatal_error "only absolute run-paths are allowed" ;; esac if test "$prev" = rpath; then case "$rpath " in *" $arg "*) ;; *) func_append rpath " $arg" ;; esac else case "$xrpath " in *" $arg "*) ;; *) func_append xrpath " $arg" ;; esac fi prev= continue ;; shrext) shrext_cmds="$arg" prev= continue ;; weak) func_append weak_libs " $arg" prev= continue ;; xcclinker) func_append linker_flags " $qarg" func_append compiler_flags " $qarg" prev= func_append compile_command " $qarg" func_append finalize_command " $qarg" continue ;; xcompiler) func_append compiler_flags " $qarg" prev= func_append compile_command " $qarg" func_append finalize_command " $qarg" continue ;; xlinker) func_append linker_flags " $qarg" func_append compiler_flags " $wl$qarg" prev= func_append compile_command " $wl$qarg" func_append finalize_command " $wl$qarg" continue ;; *) eval "$prev=\"\$arg\"" prev= continue ;; esac fi # test -n "$prev" prevarg="$arg" case $arg in -all-static) if test -n "$link_static_flag"; then # See comment for -static flag below, for more details. func_append compile_command " $link_static_flag" func_append finalize_command " $link_static_flag" fi continue ;; -allow-undefined) # FIXME: remove this flag sometime in the future. func_fatal_error "\`-allow-undefined' must not be used because it is the default" ;; -avoid-version) avoid_version=yes continue ;; -bindir) prev=bindir continue ;; -dlopen) prev=dlfiles continue ;; -dlpreopen) prev=dlprefiles continue ;; -export-dynamic) export_dynamic=yes continue ;; -export-symbols | -export-symbols-regex) if test -n "$export_symbols" || test -n "$export_symbols_regex"; then func_fatal_error "more than one -exported-symbols argument is not allowed" fi if test "X$arg" = "X-export-symbols"; then prev=expsyms else prev=expsyms_regex fi continue ;; -framework) prev=framework continue ;; -inst-prefix-dir) prev=inst_prefix continue ;; # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:* # so, if we see these flags be careful not to treat them like -L -L[A-Z][A-Z]*:*) case $with_gcc/$host in no/*-*-irix* | /*-*-irix*) func_append compile_command " $arg" func_append finalize_command " $arg" ;; esac continue ;; -L*) func_stripname "-L" '' "$arg" if test -z "$func_stripname_result"; then if test "$#" -gt 0; then func_fatal_error "require no space between \`-L' and \`$1'" else func_fatal_error "need path for \`-L' option" fi fi func_resolve_sysroot "$func_stripname_result" dir=$func_resolve_sysroot_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) absdir=`cd "$dir" && pwd` test -z "$absdir" && \ func_fatal_error "cannot determine absolute directory name of \`$dir'" dir="$absdir" ;; esac case "$deplibs " in *" -L$dir "* | *" $arg "*) # Will only happen for absolute or sysroot arguments ;; *) # Preserve sysroot, but never include relative directories case $dir in [\\/]* | [A-Za-z]:[\\/]* | =*) func_append deplibs " $arg" ;; *) func_append deplibs " -L$dir" ;; esac func_append lib_search_path " $dir" ;; esac case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) testbindir=`$ECHO "$dir" | $SED 's*/lib$*/bin*'` case :$dllsearchpath: in *":$dir:"*) ;; ::) dllsearchpath=$dir;; *) func_append dllsearchpath ":$dir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; ::) dllsearchpath=$testbindir;; *) func_append dllsearchpath ":$testbindir";; esac ;; esac continue ;; -l*) if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*) # These systems don't actually have a C or math library (as such) continue ;; *-*-os2*) # These systems don't actually have a C library (as such) test "X$arg" = "X-lc" && continue ;; *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc due to us having libc/libc_r. test "X$arg" = "X-lc" && continue ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C and math libraries are in the System framework func_append deplibs " System.ltframework" continue ;; *-*-sco3.2v5* | *-*-sco5v6*) # Causes problems with __ctype test "X$arg" = "X-lc" && continue ;; *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) # Compiler inserts libc in the correct place for threads to work test "X$arg" = "X-lc" && continue ;; esac elif test "X$arg" = "X-lc_r"; then case $host in *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc_r directly, use -pthread flag. continue ;; esac fi func_append deplibs " $arg" continue ;; -module) module=yes continue ;; # Tru64 UNIX uses -model [arg] to determine the layout of C++ # classes, name mangling, and exception handling. # Darwin uses the -arch flag to determine output architecture. -model|-arch|-isysroot|--sysroot) func_append compiler_flags " $arg" func_append compile_command " $arg" func_append finalize_command " $arg" prev=xcompiler continue ;; -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) func_append compiler_flags " $arg" func_append compile_command " $arg" func_append finalize_command " $arg" case "$new_inherited_linker_flags " in *" $arg "*) ;; * ) func_append new_inherited_linker_flags " $arg" ;; esac continue ;; -multi_module) single_module="${wl}-multi_module" continue ;; -no-fast-install) fast_install=no continue ;; -no-install) case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*) # The PATH hackery in wrapper scripts is required on Windows # and Darwin in order for the loader to find any dlls it needs. func_warning "\`-no-install' is ignored for $host" func_warning "assuming \`-no-fast-install' instead" fast_install=no ;; *) no_install=yes ;; esac continue ;; -no-undefined) allow_undefined=no continue ;; -objectlist) prev=objectlist continue ;; -o) prev=output ;; -precious-files-regex) prev=precious_regex continue ;; -release) prev=release continue ;; -rpath) prev=rpath continue ;; -R) prev=xrpath continue ;; -R*) func_stripname '-R' '' "$arg" dir=$func_stripname_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; =*) func_stripname '=' '' "$dir" dir=$lt_sysroot$func_stripname_result ;; *) func_fatal_error "only absolute run-paths are allowed" ;; esac case "$xrpath " in *" $dir "*) ;; *) func_append xrpath " $dir" ;; esac continue ;; -shared) # The effects of -shared are defined in a previous loop. continue ;; -shrext) prev=shrext continue ;; -static | -static-libtool-libs) # The effects of -static are defined in a previous loop. # We used to do the same as -all-static on platforms that # didn't have a PIC flag, but the assumption that the effects # would be equivalent was wrong. It would break on at least # Digital Unix and AIX. continue ;; -thread-safe) thread_safe=yes continue ;; -version-info) prev=vinfo continue ;; -version-number) prev=vinfo vinfo_number=yes continue ;; -weak) prev=weak continue ;; -Wc,*) func_stripname '-Wc,' '' "$arg" args=$func_stripname_result arg= save_ifs="$IFS"; IFS=',' for flag in $args; do IFS="$save_ifs" func_quote_for_eval "$flag" func_append arg " $func_quote_for_eval_result" func_append compiler_flags " $func_quote_for_eval_result" done IFS="$save_ifs" func_stripname ' ' '' "$arg" arg=$func_stripname_result ;; -Wl,*) func_stripname '-Wl,' '' "$arg" args=$func_stripname_result arg= save_ifs="$IFS"; IFS=',' for flag in $args; do IFS="$save_ifs" func_quote_for_eval "$flag" func_append arg " $wl$func_quote_for_eval_result" func_append compiler_flags " $wl$func_quote_for_eval_result" func_append linker_flags " $func_quote_for_eval_result" done IFS="$save_ifs" func_stripname ' ' '' "$arg" arg=$func_stripname_result ;; -Xcompiler) prev=xcompiler continue ;; -Xlinker) prev=xlinker continue ;; -XCClinker) prev=xcclinker continue ;; # -msg_* for osf cc -msg_*) func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" ;; # Flags to be passed through unchanged, with rationale: # -64, -mips[0-9] enable 64-bit mode for the SGI compiler # -r[0-9][0-9]* specify processor for the SGI compiler # -xarch=*, -xtarget=* enable 64-bit mode for the Sun compiler # +DA*, +DD* enable 64-bit mode for the HP compiler # -q* compiler args for the IBM compiler # -m*, -t[45]*, -txscale* architecture-specific flags for GCC # -F/path path to uninstalled frameworks, gcc on darwin # -p, -pg, --coverage, -fprofile-* profiling flags for GCC # @file GCC response files # -tp=* Portland pgcc target processor selection # --sysroot=* for sysroot support # -O*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \ -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \ -O*|-flto*|-fwhopr*|-fuse-linker-plugin) func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" func_append compile_command " $arg" func_append finalize_command " $arg" func_append compiler_flags " $arg" continue ;; # Some other compiler flag. -* | +*) func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" ;; *.$objext) # A standard object. func_append objs " $arg" ;; *.lo) # A libtool-controlled object. # Check to see that this really is a libtool object. if func_lalib_unsafe_p "$arg"; then pic_object= non_pic_object= # Read the .lo file func_source "$arg" if test -z "$pic_object" || test -z "$non_pic_object" || test "$pic_object" = none && test "$non_pic_object" = none; then func_fatal_error "cannot find name of object for \`$arg'" fi # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" if test "$pic_object" != none; then # Prepend the subdirectory the object is found in. pic_object="$xdir$pic_object" if test "$prev" = dlfiles; then if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then func_append dlfiles " $pic_object" prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi # CHECK ME: I think I busted this. -Ossama if test "$prev" = dlprefiles; then # Preload the old-style object. func_append dlprefiles " $pic_object" prev= fi # A PIC object. func_append libobjs " $pic_object" arg="$pic_object" fi # Non-PIC object. if test "$non_pic_object" != none; then # Prepend the subdirectory the object is found in. non_pic_object="$xdir$non_pic_object" # A standard non-PIC object func_append non_pic_objects " $non_pic_object" if test -z "$pic_object" || test "$pic_object" = none ; then arg="$non_pic_object" fi else # If the PIC object exists, use it instead. # $xdir was prepended to $pic_object above. non_pic_object="$pic_object" func_append non_pic_objects " $non_pic_object" fi else # Only an error if not doing a dry-run. if $opt_dry_run; then # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" func_lo2o "$arg" pic_object=$xdir$objdir/$func_lo2o_result non_pic_object=$xdir$func_lo2o_result func_append libobjs " $pic_object" func_append non_pic_objects " $non_pic_object" else func_fatal_error "\`$arg' is not a valid libtool object" fi fi ;; *.$libext) # An archive. func_append deplibs " $arg" func_append old_deplibs " $arg" continue ;; *.la) # A libtool-controlled library. func_resolve_sysroot "$arg" if test "$prev" = dlfiles; then # This library was specified with -dlopen. func_append dlfiles " $func_resolve_sysroot_result" prev= elif test "$prev" = dlprefiles; then # The library was specified with -dlpreopen. func_append dlprefiles " $func_resolve_sysroot_result" prev= else func_append deplibs " $func_resolve_sysroot_result" fi continue ;; # Some other compiler argument. *) # Unknown arguments in both finalize_command and compile_command need # to be aesthetically quoted because they are evaled later. func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" ;; esac # arg # Now actually substitute the argument into the commands. if test -n "$arg"; then func_append compile_command " $arg" func_append finalize_command " $arg" fi done # argument parsing loop test -n "$prev" && \ func_fatal_help "the \`$prevarg' option requires an argument" if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then eval arg=\"$export_dynamic_flag_spec\" func_append compile_command " $arg" func_append finalize_command " $arg" fi oldlibs= # calculate the name of the file, without its directory func_basename "$output" outputname="$func_basename_result" libobjs_save="$libobjs" if test -n "$shlibpath_var"; then # get the directories listed in $shlibpath_var eval shlib_search_path=\`\$ECHO \"\${$shlibpath_var}\" \| \$SED \'s/:/ /g\'\` else shlib_search_path= fi eval sys_lib_search_path=\"$sys_lib_search_path_spec\" eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" func_dirname "$output" "/" "" output_objdir="$func_dirname_result$objdir" func_to_tool_file "$output_objdir/" tool_output_objdir=$func_to_tool_file_result # Create the object directory. func_mkdir_p "$output_objdir" # Determine the type of output case $output in "") func_fatal_help "you must specify an output file" ;; *.$libext) linkmode=oldlib ;; *.lo | *.$objext) linkmode=obj ;; *.la) linkmode=lib ;; *) linkmode=prog ;; # Anything else should be a program. esac specialdeplibs= libs= # Find all interdependent deplibs by searching for libraries # that are linked more than once (e.g. -la -lb -la) for deplib in $deplibs; do if $opt_preserve_dup_deps ; then case "$libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi func_append libs " $deplib" done if test "$linkmode" = lib; then libs="$predeps $libs $compiler_lib_search_path $postdeps" # Compute libraries that are listed more than once in $predeps # $postdeps and mark them as special (i.e., whose duplicates are # not to be eliminated). pre_post_deps= if $opt_duplicate_compiler_generated_deps; then for pre_post_dep in $predeps $postdeps; do case "$pre_post_deps " in *" $pre_post_dep "*) func_append specialdeplibs " $pre_post_deps" ;; esac func_append pre_post_deps " $pre_post_dep" done fi pre_post_deps= fi deplibs= newdependency_libs= newlib_search_path= need_relink=no # whether we're linking any uninstalled libtool libraries notinst_deplibs= # not-installed libtool libraries notinst_path= # paths that contain not-installed libtool libraries case $linkmode in lib) passes="conv dlpreopen link" for file in $dlfiles $dlprefiles; do case $file in *.la) ;; *) func_fatal_help "libraries can \`-dlopen' only libtool libraries: $file" ;; esac done ;; prog) compile_deplibs= finalize_deplibs= alldeplibs=no newdlfiles= newdlprefiles= passes="conv scan dlopen dlpreopen link" ;; *) passes="conv" ;; esac for pass in $passes; do # The preopen pass in lib mode reverses $deplibs; put it back here # so that -L comes before libs that need it for instance... if test "$linkmode,$pass" = "lib,link"; then ## FIXME: Find the place where the list is rebuilt in the wrong ## order, and fix it there properly tmp_deplibs= for deplib in $deplibs; do tmp_deplibs="$deplib $tmp_deplibs" done deplibs="$tmp_deplibs" fi if test "$linkmode,$pass" = "lib,link" || test "$linkmode,$pass" = "prog,scan"; then libs="$deplibs" deplibs= fi if test "$linkmode" = prog; then case $pass in dlopen) libs="$dlfiles" ;; dlpreopen) libs="$dlprefiles" ;; link) libs="$deplibs %DEPLIBS%" test "X$link_all_deplibs" != Xno && libs="$libs $dependency_libs" ;; esac fi if test "$linkmode,$pass" = "lib,dlpreopen"; then # Collect and forward deplibs of preopened libtool libs for lib in $dlprefiles; do # Ignore non-libtool-libs dependency_libs= func_resolve_sysroot "$lib" case $lib in *.la) func_source "$func_resolve_sysroot_result" ;; esac # Collect preopened libtool deplibs, except any this library # has declared as weak libs for deplib in $dependency_libs; do func_basename "$deplib" deplib_base=$func_basename_result case " $weak_libs " in *" $deplib_base "*) ;; *) func_append deplibs " $deplib" ;; esac done done libs="$dlprefiles" fi if test "$pass" = dlopen; then # Collect dlpreopened libraries save_deplibs="$deplibs" deplibs= fi for deplib in $libs; do lib= found=no case $deplib in -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else func_append compiler_flags " $deplib" if test "$linkmode" = lib ; then case "$new_inherited_linker_flags " in *" $deplib "*) ;; * ) func_append new_inherited_linker_flags " $deplib" ;; esac fi fi continue ;; -l*) if test "$linkmode" != lib && test "$linkmode" != prog; then func_warning "\`-l' is ignored for archives/objects" continue fi func_stripname '-l' '' "$deplib" name=$func_stripname_result if test "$linkmode" = lib; then searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path" else searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path" fi for searchdir in $searchdirs; do for search_ext in .la $std_shrext .so .a; do # Search the libtool library lib="$searchdir/lib${name}${search_ext}" if test -f "$lib"; then if test "$search_ext" = ".la"; then found=yes else found=no fi break 2 fi done done if test "$found" != yes; then # deplib doesn't seem to be a libtool library if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" fi continue else # deplib is a libtool library # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib, # We need to do some special things here, and not later. if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $deplib "*) if func_lalib_p "$lib"; then library_names= old_library= func_source "$lib" for l in $old_library $library_names; do ll="$l" done if test "X$ll" = "X$old_library" ; then # only static version available found=no func_dirname "$lib" "" "." ladir="$func_dirname_result" lib=$ladir/$old_library if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" fi continue fi fi ;; *) ;; esac fi fi ;; # -l *.ltframework) if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" if test "$linkmode" = lib ; then case "$new_inherited_linker_flags " in *" $deplib "*) ;; * ) func_append new_inherited_linker_flags " $deplib" ;; esac fi fi continue ;; -L*) case $linkmode in lib) deplibs="$deplib $deplibs" test "$pass" = conv && continue newdependency_libs="$deplib $newdependency_libs" func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; prog) if test "$pass" = conv; then deplibs="$deplib $deplibs" continue fi if test "$pass" = scan; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; *) func_warning "\`-L' is ignored for archives/objects" ;; esac # linkmode continue ;; # -L -R*) if test "$pass" = link; then func_stripname '-R' '' "$deplib" func_resolve_sysroot "$func_stripname_result" dir=$func_resolve_sysroot_result # Make sure the xrpath contains only unique directories. case "$xrpath " in *" $dir "*) ;; *) func_append xrpath " $dir" ;; esac fi deplibs="$deplib $deplibs" continue ;; *.la) func_resolve_sysroot "$deplib" lib=$func_resolve_sysroot_result ;; *.$libext) if test "$pass" = conv; then deplibs="$deplib $deplibs" continue fi case $linkmode in lib) # Linking convenience modules into shared libraries is allowed, # but linking other static libraries is non-portable. case " $dlpreconveniencelibs " in *" $deplib "*) ;; *) valid_a_lib=no case $deplibs_check_method in match_pattern*) set dummy $deplibs_check_method; shift match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` if eval "\$ECHO \"$deplib\"" 2>/dev/null | $SED 10q \ | $EGREP "$match_pattern_regex" > /dev/null; then valid_a_lib=yes fi ;; pass_all) valid_a_lib=yes ;; esac if test "$valid_a_lib" != yes; then echo $ECHO "*** Warning: Trying to link with static lib archive $deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because the file extensions .$libext of this argument makes me believe" echo "*** that it is just a static archive that I should not use here." else echo $ECHO "*** Warning: Linking the shared library $output against the" $ECHO "*** static library $deplib is not portable!" deplibs="$deplib $deplibs" fi ;; esac continue ;; prog) if test "$pass" != link; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi continue ;; esac # linkmode ;; # *.$libext *.lo | *.$objext) if test "$pass" = conv; then deplibs="$deplib $deplibs" elif test "$linkmode" = prog; then if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then # If there is no dlopen support or we're linking statically, # we need to preload. func_append newdlprefiles " $deplib" compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else func_append newdlfiles " $deplib" fi fi continue ;; %DEPLIBS%) alldeplibs=yes continue ;; esac # case $deplib if test "$found" = yes || test -f "$lib"; then : else func_fatal_error "cannot find the library \`$lib' or unhandled argument \`$deplib'" fi # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$lib" \ || func_fatal_error "\`$lib' is not a valid libtool archive" func_dirname "$lib" "" "." ladir="$func_dirname_result" dlname= dlopen= dlpreopen= libdir= library_names= old_library= inherited_linker_flags= # If the library was installed with an old release of libtool, # it will not redefine variables installed, or shouldnotlink installed=yes shouldnotlink=no avoidtemprpath= # Read the .la file func_source "$lib" # Convert "-framework foo" to "foo.ltframework" if test -n "$inherited_linker_flags"; then tmp_inherited_linker_flags=`$ECHO "$inherited_linker_flags" | $SED 's/-framework \([^ $]*\)/\1.ltframework/g'` for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do case " $new_inherited_linker_flags " in *" $tmp_inherited_linker_flag "*) ;; *) func_append new_inherited_linker_flags " $tmp_inherited_linker_flag";; esac done fi dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` if test "$linkmode,$pass" = "lib,link" || test "$linkmode,$pass" = "prog,scan" || { test "$linkmode" != prog && test "$linkmode" != lib; }; then test -n "$dlopen" && func_append dlfiles " $dlopen" test -n "$dlpreopen" && func_append dlprefiles " $dlpreopen" fi if test "$pass" = conv; then # Only check for convenience libraries deplibs="$lib $deplibs" if test -z "$libdir"; then if test -z "$old_library"; then func_fatal_error "cannot find name of link library for \`$lib'" fi # It is a libtool convenience library, so add in its objects. func_append convenience " $ladir/$objdir/$old_library" func_append old_convenience " $ladir/$objdir/$old_library" tmp_libs= for deplib in $dependency_libs; do deplibs="$deplib $deplibs" if $opt_preserve_dup_deps ; then case "$tmp_libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi func_append tmp_libs " $deplib" done elif test "$linkmode" != prog && test "$linkmode" != lib; then func_fatal_error "\`$lib' is not a convenience library" fi continue fi # $pass = conv # Get the name of the library we link against. linklib= if test -n "$old_library" && { test "$prefer_static_libs" = yes || test "$prefer_static_libs,$installed" = "built,no"; }; then linklib=$old_library else for l in $old_library $library_names; do linklib="$l" done fi if test -z "$linklib"; then func_fatal_error "cannot find name of link library for \`$lib'" fi # This library was specified with -dlopen. if test "$pass" = dlopen; then if test -z "$libdir"; then func_fatal_error "cannot -dlopen a convenience library: \`$lib'" fi if test -z "$dlname" || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then # If there is no dlname, no dlopen support or we're linking # statically, we need to preload. We also need to preload any # dependent libraries so libltdl's deplib preloader doesn't # bomb out in the load deplibs phase. func_append dlprefiles " $lib $dependency_libs" else func_append newdlfiles " $lib" fi continue fi # $pass = dlopen # We need an absolute path. case $ladir in [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;; *) abs_ladir=`cd "$ladir" && pwd` if test -z "$abs_ladir"; then func_warning "cannot determine absolute directory name of \`$ladir'" func_warning "passing it literally to the linker, although it might fail" abs_ladir="$ladir" fi ;; esac func_basename "$lib" laname="$func_basename_result" # Find the relevant object directory and library name. if test "X$installed" = Xyes; then if test ! -f "$lt_sysroot$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then func_warning "library \`$lib' was moved." dir="$ladir" absdir="$abs_ladir" libdir="$abs_ladir" else dir="$lt_sysroot$libdir" absdir="$lt_sysroot$libdir" fi test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes else if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then dir="$ladir" absdir="$abs_ladir" # Remove this search path later func_append notinst_path " $abs_ladir" else dir="$ladir/$objdir" absdir="$abs_ladir/$objdir" # Remove this search path later func_append notinst_path " $abs_ladir" fi fi # $installed = yes func_stripname 'lib' '.la' "$laname" name=$func_stripname_result # This library was specified with -dlpreopen. if test "$pass" = dlpreopen; then if test -z "$libdir" && test "$linkmode" = prog; then func_fatal_error "only libraries may -dlpreopen a convenience library: \`$lib'" fi case "$host" in # special handling for platforms with PE-DLLs. *cygwin* | *mingw* | *cegcc* ) # Linker will automatically link against shared library if both # static and shared are present. Therefore, ensure we extract # symbols from the import library if a shared library is present # (otherwise, the dlopen module name will be incorrect). We do # this by putting the import library name into $newdlprefiles. # We recover the dlopen module name by 'saving' the la file # name in a special purpose variable, and (later) extracting the # dlname from the la file. if test -n "$dlname"; then func_tr_sh "$dir/$linklib" eval "libfile_$func_tr_sh_result=\$abs_ladir/\$laname" func_append newdlprefiles " $dir/$linklib" else func_append newdlprefiles " $dir/$old_library" # Keep a list of preopened convenience libraries to check # that they are being used correctly in the link pass. test -z "$libdir" && \ func_append dlpreconveniencelibs " $dir/$old_library" fi ;; * ) # Prefer using a static library (so that no silly _DYNAMIC symbols # are required to link). if test -n "$old_library"; then func_append newdlprefiles " $dir/$old_library" # Keep a list of preopened convenience libraries to check # that they are being used correctly in the link pass. test -z "$libdir" && \ func_append dlpreconveniencelibs " $dir/$old_library" # Otherwise, use the dlname, so that lt_dlopen finds it. elif test -n "$dlname"; then func_append newdlprefiles " $dir/$dlname" else func_append newdlprefiles " $dir/$linklib" fi ;; esac fi # $pass = dlpreopen if test -z "$libdir"; then # Link the convenience library if test "$linkmode" = lib; then deplibs="$dir/$old_library $deplibs" elif test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$dir/$old_library $compile_deplibs" finalize_deplibs="$dir/$old_library $finalize_deplibs" else deplibs="$lib $deplibs" # used for prog,scan pass fi continue fi if test "$linkmode" = prog && test "$pass" != link; then func_append newlib_search_path " $ladir" deplibs="$lib $deplibs" linkalldeplibs=no if test "$link_all_deplibs" != no || test -z "$library_names" || test "$build_libtool_libs" = no; then linkalldeplibs=yes fi tmp_libs= for deplib in $dependency_libs; do case $deplib in -L*) func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; esac # Need to link against all dependency_libs? if test "$linkalldeplibs" = yes; then deplibs="$deplib $deplibs" else # Need to hardcode shared library paths # or/and link against static libraries newdependency_libs="$deplib $newdependency_libs" fi if $opt_preserve_dup_deps ; then case "$tmp_libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi func_append tmp_libs " $deplib" done # for deplib continue fi # $linkmode = prog... if test "$linkmode,$pass" = "prog,link"; then if test -n "$library_names" && { { test "$prefer_static_libs" = no || test "$prefer_static_libs,$installed" = "built,yes"; } || test -z "$old_library"; }; then # We need to hardcode the library path if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then # Make sure the rpath contains only unique directories. case "$temp_rpath:" in *"$absdir:"*) ;; *) func_append temp_rpath "$absdir:" ;; esac fi # Hardcode the library path. # Skip directories that are in the system default run-time # search path. case " $sys_lib_dlsearch_path " in *" $absdir "*) ;; *) case "$compile_rpath " in *" $absdir "*) ;; *) func_append compile_rpath " $absdir" ;; esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac ;; esac fi # $linkmode,$pass = prog,link... if test "$alldeplibs" = yes && { test "$deplibs_check_method" = pass_all || { test "$build_libtool_libs" = yes && test -n "$library_names"; }; }; then # We only need to search for static libraries continue fi fi link_static=no # Whether the deplib will be linked statically use_static_libs=$prefer_static_libs if test "$use_static_libs" = built && test "$installed" = yes; then use_static_libs=no fi if test -n "$library_names" && { test "$use_static_libs" = no || test -z "$old_library"; }; then case $host in *cygwin* | *mingw* | *cegcc*) # No point in relinking DLLs because paths are not encoded func_append notinst_deplibs " $lib" need_relink=no ;; *) if test "$installed" = no; then func_append notinst_deplibs " $lib" need_relink=yes fi ;; esac # This is a shared library # Warn about portability, can't link against -module's on some # systems (darwin). Don't bleat about dlopened modules though! dlopenmodule="" for dlpremoduletest in $dlprefiles; do if test "X$dlpremoduletest" = "X$lib"; then dlopenmodule="$dlpremoduletest" break fi done if test -z "$dlopenmodule" && test "$shouldnotlink" = yes && test "$pass" = link; then echo if test "$linkmode" = prog; then $ECHO "*** Warning: Linking the executable $output against the loadable module" else $ECHO "*** Warning: Linking the shared library $output against the loadable module" fi $ECHO "*** $linklib is not portable!" fi if test "$linkmode" = lib && test "$hardcode_into_libs" = yes; then # Hardcode the library path. # Skip directories that are in the system default run-time # search path. case " $sys_lib_dlsearch_path " in *" $absdir "*) ;; *) case "$compile_rpath " in *" $absdir "*) ;; *) func_append compile_rpath " $absdir" ;; esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac ;; esac fi if test -n "$old_archive_from_expsyms_cmds"; then # figure out the soname set dummy $library_names shift realname="$1" shift libname=`eval "\\$ECHO \"$libname_spec\""` # use dlname if we got it. it's perfectly good, no? if test -n "$dlname"; then soname="$dlname" elif test -n "$soname_spec"; then # bleh windows case $host in *cygwin* | mingw* | *cegcc*) func_arith $current - $age major=$func_arith_result versuffix="-$major" ;; esac eval soname=\"$soname_spec\" else soname="$realname" fi # Make a new name for the extract_expsyms_cmds to use soroot="$soname" func_basename "$soroot" soname="$func_basename_result" func_stripname 'lib' '.dll' "$soname" newlib=libimp-$func_stripname_result.a # If the library has no export list, then create one now if test -f "$output_objdir/$soname-def"; then : else func_verbose "extracting exported symbol list from \`$soname'" func_execute_cmds "$extract_expsyms_cmds" 'exit $?' fi # Create $newlib if test -f "$output_objdir/$newlib"; then :; else func_verbose "generating import library for \`$soname'" func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?' fi # make sure the library variables are pointing to the new library dir=$output_objdir linklib=$newlib fi # test -n "$old_archive_from_expsyms_cmds" if test "$linkmode" = prog || test "$opt_mode" != relink; then add_shlibpath= add_dir= add= lib_linked=yes case $hardcode_action in immediate | unsupported) if test "$hardcode_direct" = no; then add="$dir/$linklib" case $host in *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;; *-*-sysv4*uw2*) add_dir="-L$dir" ;; *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \ *-*-unixware7*) add_dir="-L$dir" ;; *-*-darwin* ) # if the lib is a (non-dlopened) module then we can not # link against it, someone is ignoring the earlier warnings if /usr/bin/file -L $add 2> /dev/null | $GREP ": [^:]* bundle" >/dev/null ; then if test "X$dlopenmodule" != "X$lib"; then $ECHO "*** Warning: lib $linklib is a module, not a shared library" if test -z "$old_library" ; then echo echo "*** And there doesn't seem to be a static archive available" echo "*** The link will probably fail, sorry" else add="$dir/$old_library" fi elif test -n "$old_library"; then add="$dir/$old_library" fi fi esac elif test "$hardcode_minus_L" = no; then case $host in *-*-sunos*) add_shlibpath="$dir" ;; esac add_dir="-L$dir" add="-l$name" elif test "$hardcode_shlibpath_var" = no; then add_shlibpath="$dir" add="-l$name" else lib_linked=no fi ;; relink) if test "$hardcode_direct" = yes && test "$hardcode_direct_absolute" = no; then add="$dir/$linklib" elif test "$hardcode_minus_L" = yes; then add_dir="-L$absdir" # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in [\\/]*) func_append add_dir " -L$inst_prefix_dir$libdir" ;; esac fi add="-l$name" elif test "$hardcode_shlibpath_var" = yes; then add_shlibpath="$dir" add="-l$name" else lib_linked=no fi ;; *) lib_linked=no ;; esac if test "$lib_linked" != yes; then func_fatal_configuration "unsupported hardcode properties" fi if test -n "$add_shlibpath"; then case :$compile_shlibpath: in *":$add_shlibpath:"*) ;; *) func_append compile_shlibpath "$add_shlibpath:" ;; esac fi if test "$linkmode" = prog; then test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" test -n "$add" && compile_deplibs="$add $compile_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" if test "$hardcode_direct" != yes && test "$hardcode_minus_L" != yes && test "$hardcode_shlibpath_var" = yes; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) func_append finalize_shlibpath "$libdir:" ;; esac fi fi fi if test "$linkmode" = prog || test "$opt_mode" = relink; then add_shlibpath= add_dir= add= # Finalize command for both is simple: just hardcode it. if test "$hardcode_direct" = yes && test "$hardcode_direct_absolute" = no; then add="$libdir/$linklib" elif test "$hardcode_minus_L" = yes; then add_dir="-L$libdir" add="-l$name" elif test "$hardcode_shlibpath_var" = yes; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) func_append finalize_shlibpath "$libdir:" ;; esac add="-l$name" elif test "$hardcode_automatic" = yes; then if test -n "$inst_prefix_dir" && test -f "$inst_prefix_dir$libdir/$linklib" ; then add="$inst_prefix_dir$libdir/$linklib" else add="$libdir/$linklib" fi else # We cannot seem to hardcode it, guess we'll fake it. add_dir="-L$libdir" # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in [\\/]*) func_append add_dir " -L$inst_prefix_dir$libdir" ;; esac fi add="-l$name" fi if test "$linkmode" = prog; then test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" test -n "$add" && finalize_deplibs="$add $finalize_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" fi fi elif test "$linkmode" = prog; then # Here we assume that one of hardcode_direct or hardcode_minus_L # is not unsupported. This is valid on all known static and # shared platforms. if test "$hardcode_direct" != unsupported; then test -n "$old_library" && linklib="$old_library" compile_deplibs="$dir/$linklib $compile_deplibs" finalize_deplibs="$dir/$linklib $finalize_deplibs" else compile_deplibs="-l$name -L$dir $compile_deplibs" finalize_deplibs="-l$name -L$dir $finalize_deplibs" fi elif test "$build_libtool_libs" = yes; then # Not a shared library if test "$deplibs_check_method" != pass_all; then # We're trying link a shared library against a static one # but the system doesn't support it. # Just print a warning and add the library to dependency_libs so # that the program can be linked against the static library. echo $ECHO "*** Warning: This system can not link to static lib archive $lib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have." if test "$module" = yes; then echo "*** But as you try to build a module library, libtool will still create " echo "*** a static module, that should work as long as the dlopening application" echo "*** is linked with the -dlopen flag to resolve symbols at runtime." if test -z "$global_symbol_pipe"; then echo echo "*** However, this would only work if libtool was able to extract symbol" echo "*** lists from a program, using \`nm' or equivalent, but libtool could" echo "*** not find such a program. So, this module is probably useless." echo "*** \`nm' from GNU binutils and a full rebuild may help." fi if test "$build_old_libs" = no; then build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi fi else deplibs="$dir/$old_library $deplibs" link_static=yes fi fi # link shared/static library? if test "$linkmode" = lib; then if test -n "$dependency_libs" && { test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes || test "$link_static" = yes; }; then # Extract -R from dependency_libs temp_deplibs= for libdir in $dependency_libs; do case $libdir in -R*) func_stripname '-R' '' "$libdir" temp_xrpath=$func_stripname_result case " $xrpath " in *" $temp_xrpath "*) ;; *) func_append xrpath " $temp_xrpath";; esac;; *) func_append temp_deplibs " $libdir";; esac done dependency_libs="$temp_deplibs" fi func_append newlib_search_path " $absdir" # Link against this library test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs" # ... and its dependency_libs tmp_libs= for deplib in $dependency_libs; do newdependency_libs="$deplib $newdependency_libs" case $deplib in -L*) func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result";; *) func_resolve_sysroot "$deplib" ;; esac if $opt_preserve_dup_deps ; then case "$tmp_libs " in *" $func_resolve_sysroot_result "*) func_append specialdeplibs " $func_resolve_sysroot_result" ;; esac fi func_append tmp_libs " $func_resolve_sysroot_result" done if test "$link_all_deplibs" != no; then # Add the search paths of all dependency libraries for deplib in $dependency_libs; do path= case $deplib in -L*) path="$deplib" ;; *.la) func_resolve_sysroot "$deplib" deplib=$func_resolve_sysroot_result func_dirname "$deplib" "" "." dir=$func_dirname_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;; *) absdir=`cd "$dir" && pwd` if test -z "$absdir"; then func_warning "cannot determine absolute directory name of \`$dir'" absdir="$dir" fi ;; esac if $GREP "^installed=no" $deplib > /dev/null; then case $host in *-*-darwin*) depdepl= eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib` if test -n "$deplibrary_names" ; then for tmp in $deplibrary_names ; do depdepl=$tmp done if test -f "$absdir/$objdir/$depdepl" ; then depdepl="$absdir/$objdir/$depdepl" darwin_install_name=`${OTOOL} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` if test -z "$darwin_install_name"; then darwin_install_name=`${OTOOL64} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` fi func_append compiler_flags " ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}" func_append linker_flags " -dylib_file ${darwin_install_name}:${depdepl}" path= fi fi ;; *) path="-L$absdir/$objdir" ;; esac else eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` test -z "$libdir" && \ func_fatal_error "\`$deplib' is not a valid libtool archive" test "$absdir" != "$libdir" && \ func_warning "\`$deplib' seems to be moved" path="-L$absdir" fi ;; esac case " $deplibs " in *" $path "*) ;; *) deplibs="$path $deplibs" ;; esac done fi # link_all_deplibs != no fi # linkmode = lib done # for deplib in $libs if test "$pass" = link; then if test "$linkmode" = "prog"; then compile_deplibs="$new_inherited_linker_flags $compile_deplibs" finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs" else compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` fi fi dependency_libs="$newdependency_libs" if test "$pass" = dlpreopen; then # Link the dlpreopened libraries before other libraries for deplib in $save_deplibs; do deplibs="$deplib $deplibs" done fi if test "$pass" != dlopen; then if test "$pass" != conv; then # Make sure lib_search_path contains only unique directories. lib_search_path= for dir in $newlib_search_path; do case "$lib_search_path " in *" $dir "*) ;; *) func_append lib_search_path " $dir" ;; esac done newlib_search_path= fi if test "$linkmode,$pass" != "prog,link"; then vars="deplibs" else vars="compile_deplibs finalize_deplibs" fi for var in $vars dependency_libs; do # Add libraries to $var in reverse order eval tmp_libs=\"\$$var\" new_libs= for deplib in $tmp_libs; do # FIXME: Pedantically, this is the right thing to do, so # that some nasty dependency loop isn't accidentally # broken: #new_libs="$deplib $new_libs" # Pragmatically, this seems to cause very few problems in # practice: case $deplib in -L*) new_libs="$deplib $new_libs" ;; -R*) ;; *) # And here is the reason: when a library appears more # than once as an explicit dependence of a library, or # is implicitly linked in more than once by the # compiler, it is considered special, and multiple # occurrences thereof are not removed. Compare this # with having the same library being listed as a # dependency of multiple other libraries: in this case, # we know (pedantically, we assume) the library does not # need to be listed more than once, so we keep only the # last copy. This is not always right, but it is rare # enough that we require users that really mean to play # such unportable linking tricks to link the library # using -Wl,-lname, so that libtool does not consider it # for duplicate removal. case " $specialdeplibs " in *" $deplib "*) new_libs="$deplib $new_libs" ;; *) case " $new_libs " in *" $deplib "*) ;; *) new_libs="$deplib $new_libs" ;; esac ;; esac ;; esac done tmp_libs= for deplib in $new_libs; do case $deplib in -L*) case " $tmp_libs " in *" $deplib "*) ;; *) func_append tmp_libs " $deplib" ;; esac ;; *) func_append tmp_libs " $deplib" ;; esac done eval $var=\"$tmp_libs\" done # for var fi # Last step: remove runtime libs from dependency_libs # (they stay in deplibs) tmp_libs= for i in $dependency_libs ; do case " $predeps $postdeps $compiler_lib_search_path " in *" $i "*) i="" ;; esac if test -n "$i" ; then func_append tmp_libs " $i" fi done dependency_libs=$tmp_libs done # for pass if test "$linkmode" = prog; then dlfiles="$newdlfiles" fi if test "$linkmode" = prog || test "$linkmode" = lib; then dlprefiles="$newdlprefiles" fi case $linkmode in oldlib) if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then func_warning "\`-dlopen' is ignored for archives" fi case " $deplibs" in *\ -l* | *\ -L*) func_warning "\`-l' and \`-L' are ignored for archives" ;; esac test -n "$rpath" && \ func_warning "\`-rpath' is ignored for archives" test -n "$xrpath" && \ func_warning "\`-R' is ignored for archives" test -n "$vinfo" && \ func_warning "\`-version-info/-version-number' is ignored for archives" test -n "$release" && \ func_warning "\`-release' is ignored for archives" test -n "$export_symbols$export_symbols_regex" && \ func_warning "\`-export-symbols' is ignored for archives" # Now set the variables for building old libraries. build_libtool_libs=no oldlibs="$output" func_append objs "$old_deplibs" ;; lib) # Make sure we only generate libraries of the form `libNAME.la'. case $outputname in lib*) func_stripname 'lib' '.la' "$outputname" name=$func_stripname_result eval shared_ext=\"$shrext_cmds\" eval libname=\"$libname_spec\" ;; *) test "$module" = no && \ func_fatal_help "libtool library \`$output' must begin with \`lib'" if test "$need_lib_prefix" != no; then # Add the "lib" prefix for modules if required func_stripname '' '.la' "$outputname" name=$func_stripname_result eval shared_ext=\"$shrext_cmds\" eval libname=\"$libname_spec\" else func_stripname '' '.la' "$outputname" libname=$func_stripname_result fi ;; esac if test -n "$objs"; then if test "$deplibs_check_method" != pass_all; then func_fatal_error "cannot build libtool library \`$output' from non-libtool objects on this host:$objs" else echo $ECHO "*** Warning: Linking the shared library $output against the non-libtool" $ECHO "*** objects $objs is not portable!" func_append libobjs " $objs" fi fi test "$dlself" != no && \ func_warning "\`-dlopen self' is ignored for libtool libraries" set dummy $rpath shift test "$#" -gt 1 && \ func_warning "ignoring multiple \`-rpath's for a libtool library" install_libdir="$1" oldlibs= if test -z "$rpath"; then if test "$build_libtool_libs" = yes; then # Building a libtool convenience library. # Some compilers have problems with a `.al' extension so # convenience libraries should have the same extension an # archive normally would. oldlibs="$output_objdir/$libname.$libext $oldlibs" build_libtool_libs=convenience build_old_libs=yes fi test -n "$vinfo" && \ func_warning "\`-version-info/-version-number' is ignored for convenience libraries" test -n "$release" && \ func_warning "\`-release' is ignored for convenience libraries" else # Parse the version information argument. save_ifs="$IFS"; IFS=':' set dummy $vinfo 0 0 0 shift IFS="$save_ifs" test -n "$7" && \ func_fatal_help "too many parameters to \`-version-info'" # convert absolute version numbers to libtool ages # this retains compatibility with .la files and attempts # to make the code below a bit more comprehensible case $vinfo_number in yes) number_major="$1" number_minor="$2" number_revision="$3" # # There are really only two kinds -- those that # use the current revision as the major version # and those that subtract age and use age as # a minor version. But, then there is irix # which has an extra 1 added just for fun # case $version_type in # correct linux to gnu/linux during the next big refactor darwin|linux|osf|windows|none) func_arith $number_major + $number_minor current=$func_arith_result age="$number_minor" revision="$number_revision" ;; freebsd-aout|freebsd-elf|qnx|sunos) current="$number_major" revision="$number_minor" age="0" ;; irix|nonstopux) func_arith $number_major + $number_minor current=$func_arith_result age="$number_minor" revision="$number_minor" lt_irix_increment=no ;; *) func_fatal_configuration "$modename: unknown library version type \`$version_type'" ;; esac ;; no) current="$1" revision="$2" age="$3" ;; esac # Check that each of the things are valid numbers. case $current in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "CURRENT \`$current' must be a nonnegative integer" func_fatal_error "\`$vinfo' is not valid version information" ;; esac case $revision in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "REVISION \`$revision' must be a nonnegative integer" func_fatal_error "\`$vinfo' is not valid version information" ;; esac case $age in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "AGE \`$age' must be a nonnegative integer" func_fatal_error "\`$vinfo' is not valid version information" ;; esac if test "$age" -gt "$current"; then func_error "AGE \`$age' is greater than the current interface number \`$current'" func_fatal_error "\`$vinfo' is not valid version information" fi # Calculate the version variables. major= versuffix= verstring= case $version_type in none) ;; darwin) # Like Linux, but with the current version available in # verstring for coding it into the library header func_arith $current - $age major=.$func_arith_result versuffix="$major.$age.$revision" # Darwin ld doesn't like 0 for these options... func_arith $current + 1 minor_current=$func_arith_result xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision" verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" ;; freebsd-aout) major=".$current" versuffix=".$current.$revision"; ;; freebsd-elf) major=".$current" versuffix=".$current" ;; irix | nonstopux) if test "X$lt_irix_increment" = "Xno"; then func_arith $current - $age else func_arith $current - $age + 1 fi major=$func_arith_result case $version_type in nonstopux) verstring_prefix=nonstopux ;; *) verstring_prefix=sgi ;; esac verstring="$verstring_prefix$major.$revision" # Add in all the interfaces that we are compatible with. loop=$revision while test "$loop" -ne 0; do func_arith $revision - $loop iface=$func_arith_result func_arith $loop - 1 loop=$func_arith_result verstring="$verstring_prefix$major.$iface:$verstring" done # Before this point, $major must not contain `.'. major=.$major versuffix="$major.$revision" ;; linux) # correct to gnu/linux during the next big refactor func_arith $current - $age major=.$func_arith_result versuffix="$major.$age.$revision" ;; osf) func_arith $current - $age major=.$func_arith_result versuffix=".$current.$age.$revision" verstring="$current.$age.$revision" # Add in all the interfaces that we are compatible with. loop=$age while test "$loop" -ne 0; do func_arith $current - $loop iface=$func_arith_result func_arith $loop - 1 loop=$func_arith_result verstring="$verstring:${iface}.0" done # Make executables depend on our current version. func_append verstring ":${current}.0" ;; qnx) major=".$current" versuffix=".$current" ;; sunos) major=".$current" versuffix=".$current.$revision" ;; windows) # Use '-' rather than '.', since we only want one # extension on DOS 8.3 filesystems. func_arith $current - $age major=$func_arith_result versuffix="-$major" ;; *) func_fatal_configuration "unknown library version type \`$version_type'" ;; esac # Clear the version info if we defaulted, and they specified a release. if test -z "$vinfo" && test -n "$release"; then major= case $version_type in darwin) # we can't check for "0.0" in archive_cmds due to quoting # problems, so we reset it completely verstring= ;; *) verstring="0.0" ;; esac if test "$need_version" = no; then versuffix= else versuffix=".0.0" fi fi # Remove version info from name if versioning should be avoided if test "$avoid_version" = yes && test "$need_version" = no; then major= versuffix= verstring="" fi # Check to see if the archive will have undefined symbols. if test "$allow_undefined" = yes; then if test "$allow_undefined_flag" = unsupported; then func_warning "undefined symbols not allowed in $host shared libraries" build_libtool_libs=no build_old_libs=yes fi else # Don't allow undefined symbols. allow_undefined_flag="$no_undefined_flag" fi fi func_generate_dlsyms "$libname" "$libname" "yes" func_append libobjs " $symfileobj" test "X$libobjs" = "X " && libobjs= if test "$opt_mode" != relink; then # Remove our outputs, but don't remove object files since they # may have been created when compiling PIC objects. removelist= tempremovelist=`$ECHO "$output_objdir/*"` for p in $tempremovelist; do case $p in *.$objext | *.gcno) ;; $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*) if test "X$precious_files_regex" != "X"; then if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1 then continue fi fi func_append removelist " $p" ;; *) ;; esac done test -n "$removelist" && \ func_show_eval "${RM}r \$removelist" fi # Now set the variables for building old libraries. if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then func_append oldlibs " $output_objdir/$libname.$libext" # Transform .lo files to .o files. oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; $lo2o" | $NL2SP` fi # Eliminate all temporary directories. #for path in $notinst_path; do # lib_search_path=`$ECHO "$lib_search_path " | $SED "s% $path % %g"` # deplibs=`$ECHO "$deplibs " | $SED "s% -L$path % %g"` # dependency_libs=`$ECHO "$dependency_libs " | $SED "s% -L$path % %g"` #done if test -n "$xrpath"; then # If the user specified any rpath flags, then add them. temp_xrpath= for libdir in $xrpath; do func_replace_sysroot "$libdir" func_append temp_xrpath " -R$func_replace_sysroot_result" case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac done if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then dependency_libs="$temp_xrpath $dependency_libs" fi fi # Make sure dlfiles contains only unique files that won't be dlpreopened old_dlfiles="$dlfiles" dlfiles= for lib in $old_dlfiles; do case " $dlprefiles $dlfiles " in *" $lib "*) ;; *) func_append dlfiles " $lib" ;; esac done # Make sure dlprefiles contains only unique files old_dlprefiles="$dlprefiles" dlprefiles= for lib in $old_dlprefiles; do case "$dlprefiles " in *" $lib "*) ;; *) func_append dlprefiles " $lib" ;; esac done if test "$build_libtool_libs" = yes; then if test -n "$rpath"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*) # these systems don't actually have a c library (as such)! ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C library is in the System framework func_append deplibs " System.ltframework" ;; *-*-netbsd*) # Don't link with libc until the a.out ld.so is fixed. ;; *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc due to us having libc/libc_r. ;; *-*-sco3.2v5* | *-*-sco5v6*) # Causes problems with __ctype ;; *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) # Compiler inserts libc in the correct place for threads to work ;; *) # Add libc to deplibs on all other systems if necessary. if test "$build_libtool_need_lc" = "yes"; then func_append deplibs " -lc" fi ;; esac fi # Transform deplibs into only deplibs that can be linked in shared. name_save=$name libname_save=$libname release_save=$release versuffix_save=$versuffix major_save=$major # I'm not sure if I'm treating the release correctly. I think # release should show up in the -l (ie -lgmp5) so we don't want to # add it in twice. Is that correct? release="" versuffix="" major="" newdeplibs= droppeddeps=no case $deplibs_check_method in pass_all) # Don't check for shared/static. Everything works. # This might be a little naive. We might want to check # whether the library exists or not. But this is on # osf3 & osf4 and I'm not really sure... Just # implementing what was already the behavior. newdeplibs=$deplibs ;; test_compile) # This code stresses the "libraries are programs" paradigm to its # limits. Maybe even breaks it. We compile a program, linking it # against the deplibs as a proxy for the library. Then we can check # whether they linked in statically or dynamically with ldd. $opt_dry_run || $RM conftest.c cat > conftest.c </dev/null` $nocaseglob else potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null` fi for potent_lib in $potential_libs; do # Follow soft links. if ls -lLd "$potent_lib" 2>/dev/null | $GREP " -> " >/dev/null; then continue fi # The statement above tries to avoid entering an # endless loop below, in case of cyclic links. # We might still enter an endless loop, since a link # loop can be closed while we follow links, # but so what? potlib="$potent_lib" while test -h "$potlib" 2>/dev/null; do potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'` case $potliblink in [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";; *) potlib=`$ECHO "$potlib" | $SED 's,[^/]*$,,'`"$potliblink";; esac done if eval $file_magic_cmd \"\$potlib\" 2>/dev/null | $SED -e 10q | $EGREP "$file_magic_regex" > /dev/null; then func_append newdeplibs " $a_deplib" a_deplib="" break 2 fi done done fi if test -n "$a_deplib" ; then droppeddeps=yes echo $ECHO "*** Warning: linker path does not have real file for library $a_deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because I did check the linker path looking for a file starting" if test -z "$potlib" ; then $ECHO "*** with $libname but no candidates were found. (...for file magic test)" else $ECHO "*** with $libname and none of the candidates passed a file format test" $ECHO "*** using a file magic. Last file checked: $potlib" fi fi ;; *) # Add a -L argument. func_append newdeplibs " $a_deplib" ;; esac done # Gone through all deplibs. ;; match_pattern*) set dummy $deplibs_check_method; shift match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` for a_deplib in $deplibs; do case $a_deplib in -l*) func_stripname -l '' "$a_deplib" name=$func_stripname_result if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $a_deplib "*) func_append newdeplibs " $a_deplib" a_deplib="" ;; esac fi if test -n "$a_deplib" ; then libname=`eval "\\$ECHO \"$libname_spec\""` for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do potential_libs=`ls $i/$libname[.-]* 2>/dev/null` for potent_lib in $potential_libs; do potlib="$potent_lib" # see symlink-check above in file_magic test if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \ $EGREP "$match_pattern_regex" > /dev/null; then func_append newdeplibs " $a_deplib" a_deplib="" break 2 fi done done fi if test -n "$a_deplib" ; then droppeddeps=yes echo $ECHO "*** Warning: linker path does not have real file for library $a_deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because I did check the linker path looking for a file starting" if test -z "$potlib" ; then $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)" else $ECHO "*** with $libname and none of the candidates passed a file format test" $ECHO "*** using a regex pattern. Last file checked: $potlib" fi fi ;; *) # Add a -L argument. func_append newdeplibs " $a_deplib" ;; esac done # Gone through all deplibs. ;; none | unknown | *) newdeplibs="" tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'` if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then for i in $predeps $postdeps ; do # can't use Xsed below, because $i might contain '/' tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s,$i,,"` done fi case $tmp_deplibs in *[!\ \ ]*) echo if test "X$deplibs_check_method" = "Xnone"; then echo "*** Warning: inter-library dependencies are not supported in this platform." else echo "*** Warning: inter-library dependencies are not known to be supported." fi echo "*** All declared inter-library dependencies are being dropped." droppeddeps=yes ;; esac ;; esac versuffix=$versuffix_save major=$major_save release=$release_save libname=$libname_save name=$name_save case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library with the System framework newdeplibs=`$ECHO " $newdeplibs" | $SED 's/ -lc / System.ltframework /'` ;; esac if test "$droppeddeps" = yes; then if test "$module" = yes; then echo echo "*** Warning: libtool could not satisfy all declared inter-library" $ECHO "*** dependencies of module $libname. Therefore, libtool will create" echo "*** a static module, that should work as long as the dlopening" echo "*** application is linked with the -dlopen flag." if test -z "$global_symbol_pipe"; then echo echo "*** However, this would only work if libtool was able to extract symbol" echo "*** lists from a program, using \`nm' or equivalent, but libtool could" echo "*** not find such a program. So, this module is probably useless." echo "*** \`nm' from GNU binutils and a full rebuild may help." fi if test "$build_old_libs" = no; then oldlibs="$output_objdir/$libname.$libext" build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi else echo "*** The inter-library dependencies that have been dropped here will be" echo "*** automatically added whenever a program is linked with this library" echo "*** or is declared to -dlopen it." if test "$allow_undefined" = no; then echo echo "*** Since this library must not contain undefined symbols," echo "*** because either the platform does not support them or" echo "*** it was explicitly requested with -no-undefined," echo "*** libtool will only create a static version of it." if test "$build_old_libs" = no; then oldlibs="$output_objdir/$libname.$libext" build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi fi fi fi # Done checking deplibs! deplibs=$newdeplibs fi # Time to change all our "foo.ltframework" stuff back to "-framework foo" case $host in *-*-darwin*) newdeplibs=`$ECHO " $newdeplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` new_inherited_linker_flags=`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` deplibs=`$ECHO " $deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` ;; esac # move library search paths that coincide with paths to not yet # installed libraries to the beginning of the library search list new_libs= for path in $notinst_path; do case " $new_libs " in *" -L$path/$objdir "*) ;; *) case " $deplibs " in *" -L$path/$objdir "*) func_append new_libs " -L$path/$objdir" ;; esac ;; esac done for deplib in $deplibs; do case $deplib in -L*) case " $new_libs " in *" $deplib "*) ;; *) func_append new_libs " $deplib" ;; esac ;; *) func_append new_libs " $deplib" ;; esac done deplibs="$new_libs" # All the library-specific variables (install_libdir is set above). library_names= old_library= dlname= # Test again, we may have decided not to build it any more if test "$build_libtool_libs" = yes; then # Remove ${wl} instances when linking with ld. # FIXME: should test the right _cmds variable. case $archive_cmds in *\$LD\ *) wl= ;; esac if test "$hardcode_into_libs" = yes; then # Hardcode the library paths hardcode_libdirs= dep_rpath= rpath="$finalize_rpath" test "$opt_mode" != relink && rpath="$compile_rpath$rpath" for libdir in $rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then func_replace_sysroot "$libdir" libdir=$func_replace_sysroot_result if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append dep_rpath " $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) func_append perm_rpath " $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval "dep_rpath=\"$hardcode_libdir_flag_spec\"" fi if test -n "$runpath_var" && test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do func_append rpath "$dir:" done eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" fi test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" fi shlibpath="$finalize_shlibpath" test "$opt_mode" != relink && shlibpath="$compile_shlibpath$shlibpath" if test -n "$shlibpath"; then eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" fi # Get the real and link names of the library. eval shared_ext=\"$shrext_cmds\" eval library_names=\"$library_names_spec\" set dummy $library_names shift realname="$1" shift if test -n "$soname_spec"; then eval soname=\"$soname_spec\" else soname="$realname" fi if test -z "$dlname"; then dlname=$soname fi lib="$output_objdir/$realname" linknames= for link do func_append linknames " $link" done # Use standard objects if they are pic test -z "$pic_flag" && libobjs=`$ECHO "$libobjs" | $SP2NL | $SED "$lo2o" | $NL2SP` test "X$libobjs" = "X " && libobjs= delfiles= if test -n "$export_symbols" && test -n "$include_expsyms"; then $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp" export_symbols="$output_objdir/$libname.uexp" func_append delfiles " $export_symbols" fi orig_export_symbols= case $host_os in cygwin* | mingw* | cegcc*) if test -n "$export_symbols" && test -z "$export_symbols_regex"; then # exporting using user supplied symfile if test "x`$SED 1q $export_symbols`" != xEXPORTS; then # and it's NOT already a .def file. Must figure out # which of the given symbols are data symbols and tag # them as such. So, trigger use of export_symbols_cmds. # export_symbols gets reassigned inside the "prepare # the list of exported symbols" if statement, so the # include_expsyms logic still works. orig_export_symbols="$export_symbols" export_symbols= always_export_symbols=yes fi fi ;; esac # Prepare the list of exported symbols if test -z "$export_symbols"; then if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then func_verbose "generating symbol list for \`$libname.la'" export_symbols="$output_objdir/$libname.exp" $opt_dry_run || $RM $export_symbols cmds=$export_symbols_cmds save_ifs="$IFS"; IFS='~' for cmd1 in $cmds; do IFS="$save_ifs" # Take the normal branch if the nm_file_list_spec branch # doesn't work or if tool conversion is not needed. case $nm_file_list_spec~$to_tool_file_cmd in *~func_convert_file_noop | *~func_convert_file_msys_to_w32 | ~*) try_normal_branch=yes eval cmd=\"$cmd1\" func_len " $cmd" len=$func_len_result ;; *) try_normal_branch=no ;; esac if test "$try_normal_branch" = yes \ && { test "$len" -lt "$max_cmd_len" \ || test "$max_cmd_len" -le -1; } then func_show_eval "$cmd" 'exit $?' skipped_export=false elif test -n "$nm_file_list_spec"; then func_basename "$output" output_la=$func_basename_result save_libobjs=$libobjs save_output=$output output=${output_objdir}/${output_la}.nm func_to_tool_file "$output" libobjs=$nm_file_list_spec$func_to_tool_file_result func_append delfiles " $output" func_verbose "creating $NM input file list: $output" for obj in $save_libobjs; do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" done > "$output" eval cmd=\"$cmd1\" func_show_eval "$cmd" 'exit $?' output=$save_output libobjs=$save_libobjs skipped_export=false else # The command line is too long to execute in one step. func_verbose "using reloadable object file for export list..." skipped_export=: # Break out early, otherwise skipped_export may be # set to false by a later but shorter cmd. break fi done IFS="$save_ifs" if test -n "$export_symbols_regex" && test "X$skipped_export" != "X:"; then func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' func_show_eval '$MV "${export_symbols}T" "$export_symbols"' fi fi fi if test -n "$export_symbols" && test -n "$include_expsyms"; then tmp_export_symbols="$export_symbols" test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols" $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' fi if test "X$skipped_export" != "X:" && test -n "$orig_export_symbols"; then # The given exports_symbols file has to be filtered, so filter it. func_verbose "filter symbol list for \`$libname.la' to tag DATA exports" # FIXME: $output_objdir/$libname.filter potentially contains lots of # 's' commands which not all seds can handle. GNU sed should be fine # though. Also, the filter scales superlinearly with the number of # global variables. join(1) would be nice here, but unfortunately # isn't a blessed tool. $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter func_append delfiles " $export_symbols $output_objdir/$libname.filter" export_symbols=$output_objdir/$libname.def $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols fi tmp_deplibs= for test_deplib in $deplibs; do case " $convenience " in *" $test_deplib "*) ;; *) func_append tmp_deplibs " $test_deplib" ;; esac done deplibs="$tmp_deplibs" if test -n "$convenience"; then if test -n "$whole_archive_flag_spec" && test "$compiler_needs_object" = yes && test -z "$libobjs"; then # extract the archives, so we have objects to list. # TODO: could optimize this to just extract one archive. whole_archive_flag_spec= fi if test -n "$whole_archive_flag_spec"; then save_libobjs=$libobjs eval libobjs=\"\$libobjs $whole_archive_flag_spec\" test "X$libobjs" = "X " && libobjs= else gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_extract_archives $gentop $convenience func_append libobjs " $func_extract_archives_result" test "X$libobjs" = "X " && libobjs= fi fi if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then eval flag=\"$thread_safe_flag_spec\" func_append linker_flags " $flag" fi # Make a backup of the uninstalled library when relinking if test "$opt_mode" = relink; then $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $? fi # Do each of the archive commands. if test "$module" = yes && test -n "$module_cmds" ; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then eval test_cmds=\"$module_expsym_cmds\" cmds=$module_expsym_cmds else eval test_cmds=\"$module_cmds\" cmds=$module_cmds fi else if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then eval test_cmds=\"$archive_expsym_cmds\" cmds=$archive_expsym_cmds else eval test_cmds=\"$archive_cmds\" cmds=$archive_cmds fi fi if test "X$skipped_export" != "X:" && func_len " $test_cmds" && len=$func_len_result && test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then : else # The command line is too long to link in one step, link piecewise # or, if using GNU ld and skipped_export is not :, use a linker # script. # Save the value of $output and $libobjs because we want to # use them later. If we have whole_archive_flag_spec, we # want to use save_libobjs as it was before # whole_archive_flag_spec was expanded, because we can't # assume the linker understands whole_archive_flag_spec. # This may have to be revisited, in case too many # convenience libraries get linked in and end up exceeding # the spec. if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then save_libobjs=$libobjs fi save_output=$output func_basename "$output" output_la=$func_basename_result # Clear the reloadable object creation command queue and # initialize k to one. test_cmds= concat_cmds= objlist= last_robj= k=1 if test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "$with_gnu_ld" = yes; then output=${output_objdir}/${output_la}.lnkscript func_verbose "creating GNU ld script: $output" echo 'INPUT (' > $output for obj in $save_libobjs do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" >> $output done echo ')' >> $output func_append delfiles " $output" func_to_tool_file "$output" output=$func_to_tool_file_result elif test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "X$file_list_spec" != X; then output=${output_objdir}/${output_la}.lnk func_verbose "creating linker input file list: $output" : > $output set x $save_libobjs shift firstobj= if test "$compiler_needs_object" = yes; then firstobj="$1 " shift fi for obj do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" >> $output done func_append delfiles " $output" func_to_tool_file "$output" output=$firstobj\"$file_list_spec$func_to_tool_file_result\" else if test -n "$save_libobjs"; then func_verbose "creating reloadable object files..." output=$output_objdir/$output_la-${k}.$objext eval test_cmds=\"$reload_cmds\" func_len " $test_cmds" len0=$func_len_result len=$len0 # Loop over the list of objects to be linked. for obj in $save_libobjs do func_len " $obj" func_arith $len + $func_len_result len=$func_arith_result if test "X$objlist" = X || test "$len" -lt "$max_cmd_len"; then func_append objlist " $obj" else # The command $test_cmds is almost too long, add a # command to the queue. if test "$k" -eq 1 ; then # The first file doesn't have a previous command to add. reload_objs=$objlist eval concat_cmds=\"$reload_cmds\" else # All subsequent reloadable object files will link in # the last one created. reload_objs="$objlist $last_robj" eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\" fi last_robj=$output_objdir/$output_la-${k}.$objext func_arith $k + 1 k=$func_arith_result output=$output_objdir/$output_la-${k}.$objext objlist=" $obj" func_len " $last_robj" func_arith $len0 + $func_len_result len=$func_arith_result fi done # Handle the remaining objects by creating one last # reloadable object file. All subsequent reloadable object # files will link in the last one created. test -z "$concat_cmds" || concat_cmds=$concat_cmds~ reload_objs="$objlist $last_robj" eval concat_cmds=\"\${concat_cmds}$reload_cmds\" if test -n "$last_robj"; then eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\" fi func_append delfiles " $output" else output= fi if ${skipped_export-false}; then func_verbose "generating symbol list for \`$libname.la'" export_symbols="$output_objdir/$libname.exp" $opt_dry_run || $RM $export_symbols libobjs=$output # Append the command to create the export file. test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\" if test -n "$last_robj"; then eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\" fi fi test -n "$save_libobjs" && func_verbose "creating a temporary reloadable object file: $output" # Loop through the commands generated above and execute them. save_ifs="$IFS"; IFS='~' for cmd in $concat_cmds; do IFS="$save_ifs" $opt_silent || { func_quote_for_expand "$cmd" eval "func_echo $func_quote_for_expand_result" } $opt_dry_run || eval "$cmd" || { lt_exit=$? # Restore the uninstalled library and exit if test "$opt_mode" = relink; then ( cd "$output_objdir" && \ $RM "${realname}T" && \ $MV "${realname}U" "$realname" ) fi exit $lt_exit } done IFS="$save_ifs" if test -n "$export_symbols_regex" && ${skipped_export-false}; then func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' func_show_eval '$MV "${export_symbols}T" "$export_symbols"' fi fi if ${skipped_export-false}; then if test -n "$export_symbols" && test -n "$include_expsyms"; then tmp_export_symbols="$export_symbols" test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols" $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' fi if test -n "$orig_export_symbols"; then # The given exports_symbols file has to be filtered, so filter it. func_verbose "filter symbol list for \`$libname.la' to tag DATA exports" # FIXME: $output_objdir/$libname.filter potentially contains lots of # 's' commands which not all seds can handle. GNU sed should be fine # though. Also, the filter scales superlinearly with the number of # global variables. join(1) would be nice here, but unfortunately # isn't a blessed tool. $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter func_append delfiles " $export_symbols $output_objdir/$libname.filter" export_symbols=$output_objdir/$libname.def $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols fi fi libobjs=$output # Restore the value of output. output=$save_output if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then eval libobjs=\"\$libobjs $whole_archive_flag_spec\" test "X$libobjs" = "X " && libobjs= fi # Expand the library linking commands again to reset the # value of $libobjs for piecewise linking. # Do each of the archive commands. if test "$module" = yes && test -n "$module_cmds" ; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then cmds=$module_expsym_cmds else cmds=$module_cmds fi else if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then cmds=$archive_expsym_cmds else cmds=$archive_cmds fi fi fi if test -n "$delfiles"; then # Append the command to remove temporary files to $cmds. eval cmds=\"\$cmds~\$RM $delfiles\" fi # Add any objects from preloaded convenience libraries if test -n "$dlprefiles"; then gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_extract_archives $gentop $dlprefiles func_append libobjs " $func_extract_archives_result" test "X$libobjs" = "X " && libobjs= fi save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $opt_silent || { func_quote_for_expand "$cmd" eval "func_echo $func_quote_for_expand_result" } $opt_dry_run || eval "$cmd" || { lt_exit=$? # Restore the uninstalled library and exit if test "$opt_mode" = relink; then ( cd "$output_objdir" && \ $RM "${realname}T" && \ $MV "${realname}U" "$realname" ) fi exit $lt_exit } done IFS="$save_ifs" # Restore the uninstalled library and exit if test "$opt_mode" = relink; then $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $? if test -n "$convenience"; then if test -z "$whole_archive_flag_spec"; then func_show_eval '${RM}r "$gentop"' fi fi exit $EXIT_SUCCESS fi # Create links to the real library. for linkname in $linknames; do if test "$realname" != "$linkname"; then func_show_eval '(cd "$output_objdir" && $RM "$linkname" && $LN_S "$realname" "$linkname")' 'exit $?' fi done # If -module or -export-dynamic was specified, set the dlname. if test "$module" = yes || test "$export_dynamic" = yes; then # On all known operating systems, these are identical. dlname="$soname" fi fi ;; obj) if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then func_warning "\`-dlopen' is ignored for objects" fi case " $deplibs" in *\ -l* | *\ -L*) func_warning "\`-l' and \`-L' are ignored for objects" ;; esac test -n "$rpath" && \ func_warning "\`-rpath' is ignored for objects" test -n "$xrpath" && \ func_warning "\`-R' is ignored for objects" test -n "$vinfo" && \ func_warning "\`-version-info' is ignored for objects" test -n "$release" && \ func_warning "\`-release' is ignored for objects" case $output in *.lo) test -n "$objs$old_deplibs" && \ func_fatal_error "cannot build library object \`$output' from non-libtool objects" libobj=$output func_lo2o "$libobj" obj=$func_lo2o_result ;; *) libobj= obj="$output" ;; esac # Delete the old objects. $opt_dry_run || $RM $obj $libobj # Objects from convenience libraries. This assumes # single-version convenience libraries. Whenever we create # different ones for PIC/non-PIC, this we'll have to duplicate # the extraction. reload_conv_objs= gentop= # reload_cmds runs $LD directly, so let us get rid of # -Wl from whole_archive_flag_spec and hope we can get by with # turning comma into space.. wl= if test -n "$convenience"; then if test -n "$whole_archive_flag_spec"; then eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\" reload_conv_objs=$reload_objs\ `$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'` else gentop="$output_objdir/${obj}x" func_append generated " $gentop" func_extract_archives $gentop $convenience reload_conv_objs="$reload_objs $func_extract_archives_result" fi fi # If we're not building shared, we need to use non_pic_objs test "$build_libtool_libs" != yes && libobjs="$non_pic_objects" # Create the old-style object. reload_objs="$objs$old_deplibs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; /\.lib$/d; $lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test output="$obj" func_execute_cmds "$reload_cmds" 'exit $?' # Exit if we aren't doing a library object file. if test -z "$libobj"; then if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi exit $EXIT_SUCCESS fi if test "$build_libtool_libs" != yes; then if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi # Create an invalid libtool object if no PIC, so that we don't # accidentally link it into a program. # $show "echo timestamp > $libobj" # $opt_dry_run || eval "echo timestamp > $libobj" || exit $? exit $EXIT_SUCCESS fi if test -n "$pic_flag" || test "$pic_mode" != default; then # Only do commands if we really have different PIC objects. reload_objs="$libobjs $reload_conv_objs" output="$libobj" func_execute_cmds "$reload_cmds" 'exit $?' fi if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi exit $EXIT_SUCCESS ;; prog) case $host in *cygwin*) func_stripname '' '.exe' "$output" output=$func_stripname_result.exe;; esac test -n "$vinfo" && \ func_warning "\`-version-info' is ignored for programs" test -n "$release" && \ func_warning "\`-release' is ignored for programs" test "$preload" = yes \ && test "$dlopen_support" = unknown \ && test "$dlopen_self" = unknown \ && test "$dlopen_self_static" = unknown && \ func_warning "\`LT_INIT([dlopen])' not used. Assuming no dlopen support." case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library is the System framework compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's/ -lc / System.ltframework /'` finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's/ -lc / System.ltframework /'` ;; esac case $host in *-*-darwin*) # Don't allow lazy linking, it breaks C++ global constructors # But is supposedly fixed on 10.4 or later (yay!). if test "$tagname" = CXX ; then case ${MACOSX_DEPLOYMENT_TARGET-10.0} in 10.[0123]) func_append compile_command " ${wl}-bind_at_load" func_append finalize_command " ${wl}-bind_at_load" ;; esac fi # Time to change all our "foo.ltframework" stuff back to "-framework foo" compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` ;; esac # move library search paths that coincide with paths to not yet # installed libraries to the beginning of the library search list new_libs= for path in $notinst_path; do case " $new_libs " in *" -L$path/$objdir "*) ;; *) case " $compile_deplibs " in *" -L$path/$objdir "*) func_append new_libs " -L$path/$objdir" ;; esac ;; esac done for deplib in $compile_deplibs; do case $deplib in -L*) case " $new_libs " in *" $deplib "*) ;; *) func_append new_libs " $deplib" ;; esac ;; *) func_append new_libs " $deplib" ;; esac done compile_deplibs="$new_libs" func_append compile_command " $compile_deplibs" func_append finalize_command " $finalize_deplibs" if test -n "$rpath$xrpath"; then # If the user specified any rpath flags, then add them. for libdir in $rpath $xrpath; do # This is the magic to use -rpath. case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac done fi # Now hardcode the library paths rpath= hardcode_libdirs= for libdir in $compile_rpath $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append rpath " $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) func_append perm_rpath " $libdir" ;; esac fi case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) testbindir=`${ECHO} "$libdir" | ${SED} -e 's*/lib$*/bin*'` case :$dllsearchpath: in *":$libdir:"*) ;; ::) dllsearchpath=$libdir;; *) func_append dllsearchpath ":$libdir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; ::) dllsearchpath=$testbindir;; *) func_append dllsearchpath ":$testbindir";; esac ;; esac done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval rpath=\" $hardcode_libdir_flag_spec\" fi compile_rpath="$rpath" rpath= hardcode_libdirs= for libdir in $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append rpath " $flag" fi elif test -n "$runpath_var"; then case "$finalize_perm_rpath " in *" $libdir "*) ;; *) func_append finalize_perm_rpath " $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval rpath=\" $hardcode_libdir_flag_spec\" fi finalize_rpath="$rpath" if test -n "$libobjs" && test "$build_old_libs" = yes; then # Transform all the library objects into standard objects. compile_command=`$ECHO "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP` finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $NL2SP` fi func_generate_dlsyms "$outputname" "@PROGRAM@" "no" # template prelinking step if test -n "$prelink_cmds"; then func_execute_cmds "$prelink_cmds" 'exit $?' fi wrappers_required=yes case $host in *cegcc* | *mingw32ce*) # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway. wrappers_required=no ;; *cygwin* | *mingw* ) if test "$build_libtool_libs" != yes; then wrappers_required=no fi ;; *) if test "$need_relink" = no || test "$build_libtool_libs" != yes; then wrappers_required=no fi ;; esac if test "$wrappers_required" = no; then # Replace the output file specification. compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'` link_command="$compile_command$compile_rpath" # We have no uninstalled library dependencies, so finalize right now. exit_status=0 func_show_eval "$link_command" 'exit_status=$?' if test -n "$postlink_cmds"; then func_to_tool_file "$output" postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` func_execute_cmds "$postlink_cmds" 'exit $?' fi # Delete the generated files. if test -f "$output_objdir/${outputname}S.${objext}"; then func_show_eval '$RM "$output_objdir/${outputname}S.${objext}"' fi exit $exit_status fi if test -n "$compile_shlibpath$finalize_shlibpath"; then compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command" fi if test -n "$finalize_shlibpath"; then finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command" fi compile_var= finalize_var= if test -n "$runpath_var"; then if test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do func_append rpath "$dir:" done compile_var="$runpath_var=\"$rpath\$$runpath_var\" " fi if test -n "$finalize_perm_rpath"; then # We should set the runpath_var. rpath= for dir in $finalize_perm_rpath; do func_append rpath "$dir:" done finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " fi fi if test "$no_install" = yes; then # We don't need to create a wrapper script. link_command="$compile_var$compile_command$compile_rpath" # Replace the output file specification. link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output"'%g'` # Delete the old output file. $opt_dry_run || $RM $output # Link the executable and exit func_show_eval "$link_command" 'exit $?' if test -n "$postlink_cmds"; then func_to_tool_file "$output" postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` func_execute_cmds "$postlink_cmds" 'exit $?' fi exit $EXIT_SUCCESS fi if test "$hardcode_action" = relink; then # Fast installation is not supported link_command="$compile_var$compile_command$compile_rpath" relink_command="$finalize_var$finalize_command$finalize_rpath" func_warning "this platform does not like uninstalled shared libraries" func_warning "\`$output' will be relinked during installation" else if test "$fast_install" != no; then link_command="$finalize_var$compile_command$finalize_rpath" if test "$fast_install" = yes; then relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'` else # fast_install is set to needless relink_command= fi else link_command="$compile_var$compile_command$compile_rpath" relink_command="$finalize_var$finalize_command$finalize_rpath" fi fi # Replace the output file specification. link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` # Delete the old output files. $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname func_show_eval "$link_command" 'exit $?' if test -n "$postlink_cmds"; then func_to_tool_file "$output_objdir/$outputname" postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` func_execute_cmds "$postlink_cmds" 'exit $?' fi # Now create the wrapper script. func_verbose "creating $output" # Quote the relink command for shipping. if test -n "$relink_command"; then # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else func_quote_for_eval "$var_value" relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" fi done relink_command="(cd `pwd`; $relink_command)" relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` fi # Only actually do things if not in dry run mode. $opt_dry_run || { # win32 will think the script is a binary if it has # a .exe suffix, so we strip it off here. case $output in *.exe) func_stripname '' '.exe' "$output" output=$func_stripname_result ;; esac # test for cygwin because mv fails w/o .exe extensions case $host in *cygwin*) exeext=.exe func_stripname '' '.exe' "$outputname" outputname=$func_stripname_result ;; *) exeext= ;; esac case $host in *cygwin* | *mingw* ) func_dirname_and_basename "$output" "" "." output_name=$func_basename_result output_path=$func_dirname_result cwrappersource="$output_path/$objdir/lt-$output_name.c" cwrapper="$output_path/$output_name.exe" $RM $cwrappersource $cwrapper trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15 func_emit_cwrapperexe_src > $cwrappersource # The wrapper executable is built using the $host compiler, # because it contains $host paths and files. If cross- # compiling, it, like the target executable, must be # executed on the $host or under an emulation environment. $opt_dry_run || { $LTCC $LTCFLAGS -o $cwrapper $cwrappersource $STRIP $cwrapper } # Now, create the wrapper script for func_source use: func_ltwrapper_scriptname $cwrapper $RM $func_ltwrapper_scriptname_result trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15 $opt_dry_run || { # note: this script will not be executed, so do not chmod. if test "x$build" = "x$host" ; then $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result else func_emit_wrapper no > $func_ltwrapper_scriptname_result fi } ;; * ) $RM $output trap "$RM $output; exit $EXIT_FAILURE" 1 2 15 func_emit_wrapper no > $output chmod +x $output ;; esac } exit $EXIT_SUCCESS ;; esac # See if we need to build an old-fashioned archive. for oldlib in $oldlibs; do if test "$build_libtool_libs" = convenience; then oldobjs="$libobjs_save $symfileobj" addlibs="$convenience" build_libtool_libs=no else if test "$build_libtool_libs" = module; then oldobjs="$libobjs_save" build_libtool_libs=no else oldobjs="$old_deplibs $non_pic_objects" if test "$preload" = yes && test -f "$symfileobj"; then func_append oldobjs " $symfileobj" fi fi addlibs="$old_convenience" fi if test -n "$addlibs"; then gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_extract_archives $gentop $addlibs func_append oldobjs " $func_extract_archives_result" fi # Do each command in the archive commands. if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then cmds=$old_archive_from_new_cmds else # Add any objects from preloaded convenience libraries if test -n "$dlprefiles"; then gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_extract_archives $gentop $dlprefiles func_append oldobjs " $func_extract_archives_result" fi # POSIX demands no paths to be encoded in archives. We have # to avoid creating archives with duplicate basenames if we # might have to extract them afterwards, e.g., when creating a # static archive out of a convenience library, or when linking # the entirety of a libtool archive into another (currently # not supported by libtool). if (for obj in $oldobjs do func_basename "$obj" $ECHO "$func_basename_result" done | sort | sort -uc >/dev/null 2>&1); then : else echo "copying selected object files to avoid basename conflicts..." gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_mkdir_p "$gentop" save_oldobjs=$oldobjs oldobjs= counter=1 for obj in $save_oldobjs do func_basename "$obj" objbase="$func_basename_result" case " $oldobjs " in " ") oldobjs=$obj ;; *[\ /]"$objbase "*) while :; do # Make sure we don't pick an alternate name that also # overlaps. newobj=lt$counter-$objbase func_arith $counter + 1 counter=$func_arith_result case " $oldobjs " in *[\ /]"$newobj "*) ;; *) if test ! -f "$gentop/$newobj"; then break; fi ;; esac done func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj" func_append oldobjs " $gentop/$newobj" ;; *) func_append oldobjs " $obj" ;; esac done fi func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 tool_oldlib=$func_to_tool_file_result eval cmds=\"$old_archive_cmds\" func_len " $cmds" len=$func_len_result if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then cmds=$old_archive_cmds elif test -n "$archiver_list_spec"; then func_verbose "using command file archive linking..." for obj in $oldobjs do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" done > $output_objdir/$libname.libcmd func_to_tool_file "$output_objdir/$libname.libcmd" oldobjs=" $archiver_list_spec$func_to_tool_file_result" cmds=$old_archive_cmds else # the command line is too long to link in one step, link in parts func_verbose "using piecewise archive linking..." save_RANLIB=$RANLIB RANLIB=: objlist= concat_cmds= save_oldobjs=$oldobjs oldobjs= # Is there a better way of finding the last object in the list? for obj in $save_oldobjs do last_oldobj=$obj done eval test_cmds=\"$old_archive_cmds\" func_len " $test_cmds" len0=$func_len_result len=$len0 for obj in $save_oldobjs do func_len " $obj" func_arith $len + $func_len_result len=$func_arith_result func_append objlist " $obj" if test "$len" -lt "$max_cmd_len"; then : else # the above command should be used before it gets too long oldobjs=$objlist if test "$obj" = "$last_oldobj" ; then RANLIB=$save_RANLIB fi test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\" objlist= len=$len0 fi done RANLIB=$save_RANLIB oldobjs=$objlist if test "X$oldobjs" = "X" ; then eval cmds=\"\$concat_cmds\" else eval cmds=\"\$concat_cmds~\$old_archive_cmds\" fi fi fi func_execute_cmds "$cmds" 'exit $?' done test -n "$generated" && \ func_show_eval "${RM}r$generated" # Now create the libtool archive. case $output in *.la) old_library= test "$build_old_libs" = yes && old_library="$libname.$libext" func_verbose "creating $output" # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else func_quote_for_eval "$var_value" relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" fi done # Quote the link command for shipping. relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` if test "$hardcode_automatic" = yes ; then relink_command= fi # Only create the output if not a dry run. $opt_dry_run || { for installed in no yes; do if test "$installed" = yes; then if test -z "$install_libdir"; then break fi output="$output_objdir/$outputname"i # Replace all uninstalled libtool libraries with the installed ones newdependency_libs= for deplib in $dependency_libs; do case $deplib in *.la) func_basename "$deplib" name="$func_basename_result" func_resolve_sysroot "$deplib" eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result` test -z "$libdir" && \ func_fatal_error "\`$deplib' is not a valid libtool archive" func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name" ;; -L*) func_stripname -L '' "$deplib" func_replace_sysroot "$func_stripname_result" func_append newdependency_libs " -L$func_replace_sysroot_result" ;; -R*) func_stripname -R '' "$deplib" func_replace_sysroot "$func_stripname_result" func_append newdependency_libs " -R$func_replace_sysroot_result" ;; *) func_append newdependency_libs " $deplib" ;; esac done dependency_libs="$newdependency_libs" newdlfiles= for lib in $dlfiles; do case $lib in *.la) func_basename "$lib" name="$func_basename_result" eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` test -z "$libdir" && \ func_fatal_error "\`$lib' is not a valid libtool archive" func_append newdlfiles " ${lt_sysroot:+=}$libdir/$name" ;; *) func_append newdlfiles " $lib" ;; esac done dlfiles="$newdlfiles" newdlprefiles= for lib in $dlprefiles; do case $lib in *.la) # Only pass preopened files to the pseudo-archive (for # eventual linking with the app. that links it) if we # didn't already link the preopened objects directly into # the library: func_basename "$lib" name="$func_basename_result" eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` test -z "$libdir" && \ func_fatal_error "\`$lib' is not a valid libtool archive" func_append newdlprefiles " ${lt_sysroot:+=}$libdir/$name" ;; esac done dlprefiles="$newdlprefiles" else newdlfiles= for lib in $dlfiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; *) abs=`pwd`"/$lib" ;; esac func_append newdlfiles " $abs" done dlfiles="$newdlfiles" newdlprefiles= for lib in $dlprefiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; *) abs=`pwd`"/$lib" ;; esac func_append newdlprefiles " $abs" done dlprefiles="$newdlprefiles" fi $RM $output # place dlname in correct position for cygwin # In fact, it would be nice if we could use this code for all target # systems that can't hard-code library paths into their executables # and that have no shared library path variable independent of PATH, # but it turns out we can't easily determine that from inspecting # libtool variables, so we have to hard-code the OSs to which it # applies here; at the moment, that means platforms that use the PE # object format with DLL files. See the long comment at the top of # tests/bindir.at for full details. tdlname=$dlname case $host,$output,$installed,$module,$dlname in *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll) # If a -bindir argument was supplied, place the dll there. if test "x$bindir" != x ; then func_relative_path "$install_libdir" "$bindir" tdlname=$func_relative_path_result$dlname else # Otherwise fall back on heuristic. tdlname=../bin/$dlname fi ;; esac $ECHO > $output "\ # $outputname - a libtool library file # Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION # # Please DO NOT delete this file! # It is necessary for linking the library. # The name that we can dlopen(3). dlname='$tdlname' # Names of this library. library_names='$library_names' # The name of the static archive. old_library='$old_library' # Linker flags that can not go in dependency_libs. inherited_linker_flags='$new_inherited_linker_flags' # Libraries that this one depends upon. dependency_libs='$dependency_libs' # Names of additional weak libraries provided by this library weak_library_names='$weak_libs' # Version information for $libname. current=$current age=$age revision=$revision # Is this an already installed library? installed=$installed # Should we warn about portability when linking against -modules? shouldnotlink=$module # Files to dlopen/dlpreopen dlopen='$dlfiles' dlpreopen='$dlprefiles' # Directory that this library needs to be installed in: libdir='$install_libdir'" if test "$installed" = no && test "$need_relink" = yes; then $ECHO >> $output "\ relink_command=\"$relink_command\"" fi done } # Do a symbolic link so that the libtool archive can be found in # LD_LIBRARY_PATH before the program is installed. func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?' ;; esac exit $EXIT_SUCCESS } { test "$opt_mode" = link || test "$opt_mode" = relink; } && func_mode_link ${1+"$@"} # func_mode_uninstall arg... func_mode_uninstall () { $opt_debug RM="$nonopt" files= rmforce= exit_status=0 # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic="$magic" for arg do case $arg in -f) func_append RM " $arg"; rmforce=yes ;; -*) func_append RM " $arg" ;; *) func_append files " $arg" ;; esac done test -z "$RM" && \ func_fatal_help "you must specify an RM program" rmdirs= for file in $files; do func_dirname "$file" "" "." dir="$func_dirname_result" if test "X$dir" = X.; then odir="$objdir" else odir="$dir/$objdir" fi func_basename "$file" name="$func_basename_result" test "$opt_mode" = uninstall && odir="$dir" # Remember odir for removal later, being careful to avoid duplicates if test "$opt_mode" = clean; then case " $rmdirs " in *" $odir "*) ;; *) func_append rmdirs " $odir" ;; esac fi # Don't error if the file doesn't exist and rm -f was used. if { test -L "$file"; } >/dev/null 2>&1 || { test -h "$file"; } >/dev/null 2>&1 || test -f "$file"; then : elif test -d "$file"; then exit_status=1 continue elif test "$rmforce" = yes; then continue fi rmfiles="$file" case $name in *.la) # Possibly a libtool archive, so verify it. if func_lalib_p "$file"; then func_source $dir/$name # Delete the libtool libraries and symlinks. for n in $library_names; do func_append rmfiles " $odir/$n" done test -n "$old_library" && func_append rmfiles " $odir/$old_library" case "$opt_mode" in clean) case " $library_names " in *" $dlname "*) ;; *) test -n "$dlname" && func_append rmfiles " $odir/$dlname" ;; esac test -n "$libdir" && func_append rmfiles " $odir/$name $odir/${name}i" ;; uninstall) if test -n "$library_names"; then # Do each command in the postuninstall commands. func_execute_cmds "$postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1' fi if test -n "$old_library"; then # Do each command in the old_postuninstall commands. func_execute_cmds "$old_postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1' fi # FIXME: should reinstall the best remaining shared library. ;; esac fi ;; *.lo) # Possibly a libtool object, so verify it. if func_lalib_p "$file"; then # Read the .lo file func_source $dir/$name # Add PIC object to the list of files to remove. if test -n "$pic_object" && test "$pic_object" != none; then func_append rmfiles " $dir/$pic_object" fi # Add non-PIC object to the list of files to remove. if test -n "$non_pic_object" && test "$non_pic_object" != none; then func_append rmfiles " $dir/$non_pic_object" fi fi ;; *) if test "$opt_mode" = clean ; then noexename=$name case $file in *.exe) func_stripname '' '.exe' "$file" file=$func_stripname_result func_stripname '' '.exe' "$name" noexename=$func_stripname_result # $file with .exe has already been added to rmfiles, # add $file without .exe func_append rmfiles " $file" ;; esac # Do a test to see if this is a libtool program. if func_ltwrapper_p "$file"; then if func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" relink_command= func_source $func_ltwrapper_scriptname_result func_append rmfiles " $func_ltwrapper_scriptname_result" else relink_command= func_source $dir/$noexename fi # note $name still contains .exe if it was in $file originally # as does the version of $file that was added into $rmfiles func_append rmfiles " $odir/$name $odir/${name}S.${objext}" if test "$fast_install" = yes && test -n "$relink_command"; then func_append rmfiles " $odir/lt-$name" fi if test "X$noexename" != "X$name" ; then func_append rmfiles " $odir/lt-${noexename}.c" fi fi fi ;; esac func_show_eval "$RM $rmfiles" 'exit_status=1' done # Try to remove the ${objdir}s in the directories where we deleted files for dir in $rmdirs; do if test -d "$dir"; then func_show_eval "rmdir $dir >/dev/null 2>&1" fi done exit $exit_status } { test "$opt_mode" = uninstall || test "$opt_mode" = clean; } && func_mode_uninstall ${1+"$@"} test -z "$opt_mode" && { help="$generic_help" func_fatal_help "you must specify a MODE" } test -z "$exec_cmd" && \ func_fatal_help "invalid operation mode \`$opt_mode'" if test -n "$exec_cmd"; then eval exec "$exec_cmd" exit $EXIT_FAILURE fi exit $exit_status # The TAGs below are defined such that we never get into a situation # in which we disable both kinds of libraries. Given conflicting # choices, we go for a static library, that is the most portable, # since we can't tell whether shared libraries were disabled because # the user asked for that or because the platform doesn't support # them. This is particularly important on AIX, because we don't # support having both static and shared libraries enabled at the same # time on that platform, so we default to a shared-only configuration. # If a disable-shared tag is given, we'll fallback to a static-only # configuration. But we'll never go from static-only to shared-only. # ### BEGIN LIBTOOL TAG CONFIG: disable-shared build_libtool_libs=no build_old_libs=yes # ### END LIBTOOL TAG CONFIG: disable-shared # ### BEGIN LIBTOOL TAG CONFIG: disable-static build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac` # ### END LIBTOOL TAG CONFIG: disable-static # Local Variables: # mode:shell-script # sh-indentation:2 # End: # vi:sw=2 pgpool-II-4.1.4/src/0000775000175000017500000000000013730350746011121 500000000000000pgpool-II-4.1.4/src/auth/0000775000175000017500000000000013730350746012062 500000000000000pgpool-II-4.1.4/src/auth/md5.c0000664000175000017500000002501513730350075012631 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; } void bytesToHex(char *b, int len, char *s) { static const char *hex = "0123456789abcdef"; int q, w; for (q = 0, w = 0; q < len; 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((char *) sum, 16, 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-4.1.4/src/auth/pool_auth.c0000664000175000017500000020643413730350127014142 00000000000000/* -*-pgsql-c-*- */ /* * pgpool: a language independent connection pool server for PostgreSQL * written by Tatsuo Ishii * * Copyright (c) 2003-2020 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_auth.c: authentication stuff * */ #include "pool.h" #include "context/pool_session_context.h" #include "utils/pool_stream.h" #include "pool_config.h" #include "auth/pool_hba.h" #include "auth/pool_passwd.h" #include "auth/scram.h" #include "utils/elog.h" #include "utils/palloc.h" #include "utils/memutils.h" #include "auth/md5.h" #ifdef HAVE_CRYPT_H #include #endif #ifdef HAVE_SYS_TYPES_H #include #endif #ifdef HAVE_NETINET_IN_H #include #endif #ifdef HAVE_PARAM_H #include #endif #ifdef USE_SSL #include #endif #include #include #include #define AUTHFAIL_ERRORCODE "28000" #define MAX_SASL_PAYLOAD_LEN 1024 static POOL_STATUS pool_send_backend_key_data(POOL_CONNECTION * frontend, int pid, int key, int protoMajor); static int do_clear_text_password(POOL_CONNECTION * backend, POOL_CONNECTION * frontend, int reauth, int protoMajor); static void pool_send_auth_fail(POOL_CONNECTION * frontend, POOL_CONNECTION_POOL * cp); static int do_crypt(POOL_CONNECTION * backend, POOL_CONNECTION * frontend, int reauth, int protoMajor); static int do_md5(POOL_CONNECTION * backend, POOL_CONNECTION * frontend, int reauth, int protoMajor, char *storedPassword, PasswordType passwordType); static int do_md5_single_backend(POOL_CONNECTION * backend, POOL_CONNECTION * frontend, int reauth, int protoMajor); static void send_md5auth_request(POOL_CONNECTION * frontend, int protoMajor, char *salt); static int read_password_packet(POOL_CONNECTION * frontend, int protoMajor, char *password, int *pwdSize); static int send_password_packet(POOL_CONNECTION * backend, int protoMajor, char *password); static int send_auth_ok(POOL_CONNECTION * frontend, int protoMajor); static void sendAuthRequest(POOL_CONNECTION * frontend, int protoMajor, int32 auth_req_type, char *extradata, int extralen); static long PostmasterRandom(void); static int pg_SASL_continue(POOL_CONNECTION * backend, char *payload, int payloadlen, void *sasl_state, bool final); static void *pg_SASL_init(POOL_CONNECTION * backend, char *payload, int payloadlen, char *username, char *storedPassword); static bool do_SCRAM(POOL_CONNECTION * frontend, POOL_CONNECTION * backend, int protoMajor, int message_length, char *username, char *storedPassword, PasswordType passwordType); static void authenticate_frontend_md5(POOL_CONNECTION * backend, POOL_CONNECTION * frontend, int reauth, int protoMajor); static void authenticate_frontend_cert(POOL_CONNECTION * frontend); static void authenticate_frontend_SCRAM(POOL_CONNECTION * backend, POOL_CONNECTION * frontend, int reauth); static void authenticate_frontend_clear_text(POOL_CONNECTION * frontend); static bool get_auth_password(POOL_CONNECTION * backend, POOL_CONNECTION * frontend, int reauth, char **password, PasswordType *passwordType); /* * Do authentication. Assuming the only caller is * make_persistent_db_connection(). */ void connection_do_auth(POOL_CONNECTION_POOL_SLOT * cp, char *password) { char kind; int length; int auth_kind; char state; char *p; int pid, key; bool keydata_done; /* * read kind expecting 'R' packet (authentication response) */ pool_read_with_error(cp->con, &kind, sizeof(kind), "authentication message response type"); if (kind != 'R') { char *msg; int sts = 0; if (kind == 'E' || kind == 'N') { sts = pool_extract_error_message(false, cp->con, cp->sp->major, false, &msg); } if (sts == 1) /* succeeded in extracting error/notice * message */ { ereport(ERROR, (errmsg("failed to authenticate"), errdetail("%s", msg))); pfree(msg); } ereport(ERROR, (errmsg("failed to authenticate"), errdetail("invalid authentication message response type, Expecting 'R' and received '%c'", kind))); } /* read message length */ pool_read_with_error(cp->con, &length, sizeof(length), "authentication message response length"); length = ntohl(length); /* read auth kind */ pool_read_with_error(cp->con, &auth_kind, sizeof(auth_kind), "authentication method from response"); auth_kind = ntohl(auth_kind); ereport(DEBUG1, (errmsg("authenticate kind = %d", auth_kind))); if (auth_kind == AUTH_REQ_OK) /* trust authentication? */ { cp->con->auth_kind = AUTH_REQ_OK; } else if (auth_kind == AUTH_REQ_PASSWORD) /* clear text password? */ { kind = send_password_packet(cp->con, PROTO_MAJOR_V3, password); if (kind != AUTH_REQ_OK) ereport(ERROR, (errmsg("password authentication failed for user:%s", cp->sp->user), errdetail("backend replied with invalid kind"))); cp->con->auth_kind = AUTH_REQ_OK; } else if (auth_kind == AUTH_REQ_CRYPT) /* crypt password? */ { char salt[3]; char *crypt_password; pool_read_with_error(cp->con, &salt, 2, "crypt salt"); salt[2] = '\0'; crypt_password = crypt(password, salt); if (crypt_password == NULL) ereport(ERROR, (errmsg("crypt authentication failed for user:%s", cp->sp->user), errdetail("failed to encrypt the password"))); /* Send password packet to backend and receive auth response */ kind = send_password_packet(cp->con, PROTO_MAJOR_V3, crypt_password); if (kind != AUTH_REQ_OK) ereport(ERROR, (errmsg("crypt authentication failed for user:%s", cp->sp->user), errdetail("backend replied with invalid kind"))); cp->con->auth_kind = AUTH_REQ_OK; } else if (auth_kind == AUTH_REQ_MD5) /* md5 password? */ { char salt[4]; char *buf, *buf1; pool_read_with_error(cp->con, &salt, sizeof(salt), "authentication md5 salt"); buf = palloc0(2 * (MD5_PASSWD_LEN + 4)); /* hash + "md5" + '\0' */ /* set buffer address for building md5 password */ buf1 = buf + MD5_PASSWD_LEN + 4; /* * If the supplied password is already in md5 hash format, we just * copy it. Otherwise calculate the md5 hash value. */ if (!strncmp("md5", password, 3) && (strlen(password) - 3) == MD5_PASSWD_LEN) memcpy(buf1, password + 3, MD5_PASSWD_LEN + 1); else pool_md5_encrypt(password, cp->sp->user, strlen(cp->sp->user), buf1); pool_md5_encrypt(buf1, salt, 4, buf + 3); memcpy(buf, "md5", 3); /* Send password packet to backend and receive auth response */ kind = send_password_packet(cp->con, PROTO_MAJOR_V3, buf); pfree(buf); if (kind != AUTH_REQ_OK) ereport(ERROR, (errmsg("md5 authentication failed for user:%s", cp->sp->user), errdetail("backend replied with invalid kind"))); cp->con->auth_kind = AUTH_REQ_OK; } else if (auth_kind == AUTH_REQ_SASL) { if (do_SCRAM(NULL, cp->con, PROTO_MAJOR_V3, length, cp->sp->user, password, PASSWORD_TYPE_PLAINTEXT) == false) { ereport(ERROR, (errmsg("failed to authenticate with backend"), errdetail("SCRAM authentication failed for user:%s", cp->sp->user))); } ereport(DEBUG1, (errmsg("SCRAM authentication successful for user:%s", cp->sp->user))); cp->con->auth_kind = AUTH_REQ_OK; } else { ereport(ERROR, (errmsg("failed to authenticate"), errdetail("auth kind %d is not yet supported", auth_kind))); } /* * Read backend key data and wait until Ready for query arriving or error * happens. */ keydata_done = false; for (;;) { pool_read_with_error(cp->con, &kind, sizeof(kind), "authentication message kind"); switch (kind) { case 'K': /* backend key data */ keydata_done = true; ereport(DEBUG1, (errmsg("authenticate backend: key data received"))); /* read message length */ pool_read_with_error(cp->con, &length, sizeof(length), "message length for authentication kind 'K'"); if (ntohl(length) != 12) { ereport(ERROR, (errmsg("failed to authenticate"), errdetail("invalid backend key data length. received %d bytes when expecting 12 bytes" ,ntohl(length)))); } /* read pid */ pool_read_with_error(cp->con, &pid, sizeof(pid), "pid for authentication kind 'K'"); cp->pid = pid; /* read key */ pool_read_with_error(cp->con, &key, sizeof(key), "key for authentication kind 'K'"); cp->key = key; break; case 'Z': /* Ready for query */ /* read message length */ pool_read_with_error(cp->con, &length, sizeof(length), "message length for authentication kind 'Z'"); length = ntohl(length); /* read transaction state */ pool_read_with_error(cp->con, &state, sizeof(state), "transaction state for authentication kind 'Z'"); ereport(DEBUG1, (errmsg("authenticate backend: transaction state: %c", state))); cp->con->tstate = state; if (!keydata_done) { ereport(ERROR, (errmsg("failed to authenticate"), errdetail("ready for query arrived before receiving keydata"))); } return; break; case 'S': /* parameter status */ case 'N': /* notice response */ case 'E': /* error response */ /* Just throw away data */ pool_read_with_error(cp->con, &length, sizeof(length), "backend message length"); length = ntohl(length); length -= 4; p = pool_read2(cp->con, length); if (p == NULL) ereport(ERROR, (errmsg("failed to authenticate"), errdetail("unable to read data from socket"))); break; default: ereport(ERROR, (errmsg("failed to authenticate"), errdetail("unknown authentication message response received '%c'", kind))); break; } } ereport(ERROR, (errmsg("failed to authenticate"))); } /* * After sending the start up packet to the backend, do the * authentication against backend. if success return 0 otherwise non * 0. */ int pool_do_auth(POOL_CONNECTION * frontend, POOL_CONNECTION_POOL * cp) { signed char kind; int pid; int key; int protoMajor; int length; int authkind; int i; int message_length = 0; StartupPacket *sp; protoMajor = MASTER_CONNECTION(cp)->sp->major; kind = pool_read_kind(cp); if (kind < 0) ereport(ERROR, (errmsg("invalid authentication packet from backend"), errdetail("failed to get response kind"))); /* error response? */ if (kind == 'E') { /* * we assume error response at this stage is likely version protocol * mismatch (v3 frontend vs. v2 backend). So we throw a V2 protocol * error response in the hope that v3 frontend will negotiate again * using v2 protocol. */ ErrorResponse(frontend, cp); ereport(ERROR, (errmsg("backend authentication failed"), errdetail("backend response with kind \'E\' when expecting \'R\'"), errhint("This issue can be caused by version mismatch (current version %d)", protoMajor))); } else if (kind != 'R') ereport(ERROR, (errmsg("backend authentication failed"), errdetail("backend response with kind \'%c\' when expecting \'R\'", kind))); /* * message length (v3 only) */ if (protoMajor == PROTO_MAJOR_V3) { message_length = pool_read_message_length(cp); if (message_length <= 0) ereport(ERROR, (errmsg("invalid authentication packet from backend"), errdetail("failed to get the authentication packet length"), errhint("This is likely caused by the inconsistency of auth method among DB nodes. \ Please check the previous error messages (hint: length field) \ from pool_read_message_length and recheck the pg_hba.conf settings."))); } /*------------------------------------------------------------------------- * read authentication request kind. * * 0: authentication ok * 1: kerberos v4 * 2: kerberos v5 * 3: clear text password * 4: crypt password * 5: md5 password * 6: scm credential * * in replication mode, we only support kind = 0, 3. this is because "salt" * cannot be replicated. * in non replication mode, we support kind = 0, 3, 4, 5 *------------------------------------------------------------------------- */ authkind = pool_read_int(cp); if (authkind < 0) ereport(ERROR, (errmsg("invalid authentication packet from backend"), errdetail("failed to get auth kind"))); authkind = ntohl(authkind); ereport(DEBUG1, (errmsg("authentication backend"), errdetail("auth kind:%d", authkind))); /* trust? */ if (authkind == AUTH_REQ_OK) { int msglen; pool_write(frontend, "R", 1); if (protoMajor == PROTO_MAJOR_V3) { msglen = htonl(8); pool_write(frontend, &msglen, sizeof(msglen)); } msglen = htonl(0); pool_write_and_flush(frontend, &msglen, sizeof(msglen)); MASTER(cp)->auth_kind = AUTH_REQ_OK; } /* clear text password authentication? */ else if (authkind == AUTH_REQ_PASSWORD) { for (i = 0; i < NUM_BACKENDS; i++) { if (!VALID_BACKEND(i)) continue; ereport(DEBUG1, (errmsg("authentication backend"), errdetail("trying clear text password authentication"))); authkind = do_clear_text_password(CONNECTION(cp, i), frontend, 0, protoMajor); if (authkind < 0) { ereport(DEBUG1, (errmsg("authentication backend"), errdetail("clear text password failed in slot %d", i))); pool_send_auth_fail(frontend, cp); ereport(ERROR, (errmsg("failed to authenticate with backend"), errdetail("do_clear_text_password failed in slot %d", i))); } } } /* crypt authentication? */ else if (authkind == AUTH_REQ_CRYPT) { for (i = 0; i < NUM_BACKENDS; i++) { if (!VALID_BACKEND(i)) continue; ereport(DEBUG1, (errmsg("authentication backend"), errdetail("trying crypt authentication"))); authkind = do_crypt(CONNECTION(cp, i), frontend, 0, protoMajor); if (authkind < 0) { pool_send_auth_fail(frontend, cp); ereport(ERROR, (errmsg("failed to authenticate with backend"), errdetail("do_crypt_text_password failed in slot %d", i))); } } } /* md5 authentication? */ else if (authkind == AUTH_REQ_MD5) { char *password = NULL; PasswordType passwordType = PASSWORD_TYPE_UNKNOWN; /* * check if we can use md5 authentication. */ if (!RAW_MODE && NUM_BACKENDS > 1) { if (get_auth_password(MASTER(cp), frontend, 0, &password, &passwordType) == false) { /* * We do not have any passeord, we can still get the password * from client using plain text authentication if it is * allowed by user */ if (frontend->pool_hba == NULL && pool_config->allow_clear_text_frontend_auth) { ereport(LOG, (errmsg("using clear text authentication with frontend"), errdetail("backend will still use md5 auth"), errhint("you can disable this behavior by setting allow_clear_text_frontend_auth to off"))); authenticate_frontend_clear_text(frontend); /* now check again if we have a password now */ if (get_auth_password(MASTER(cp), frontend, 0, &password, &passwordType) == false) { ereport(ERROR, (errmsg("failed to authenticate with backend using md5"), errdetail("unable to get the password"))); } } } /* we have a password to use, validate the password type */ if (passwordType != PASSWORD_TYPE_PLAINTEXT && passwordType != PASSWORD_TYPE_MD5 && passwordType != PASSWORD_TYPE_AES) { ereport(ERROR, (errmsg("failed to authenticate with backend using md5"), errdetail("valid password not found"))); } } for (i = 0; i < NUM_BACKENDS; i++) { if (!VALID_BACKEND(i)) continue; ereport(DEBUG1, (errmsg("authentication backend: %d", i), errdetail("trying md5 authentication"))); authkind = do_md5(CONNECTION(cp, i), frontend, 0, protoMajor, password, passwordType); if (authkind < 0) { pool_send_auth_fail(frontend, cp); ereport(ERROR, (errmsg("failed to authenticate with backend"), errdetail("MD5 authentication failed in slot [%d].", i))); } } } /* SCRAM authentication? */ else if (authkind == AUTH_REQ_SASL) { char *password; PasswordType passwordType = PASSWORD_TYPE_UNKNOWN; if (get_auth_password(MASTER(cp), frontend, 0, &password, &passwordType) == false) { /* * We do not have any password, we can still get the password from * client using plain text authentication if it is allowed by user */ if (frontend->pool_hba == NULL && pool_config->allow_clear_text_frontend_auth) { ereport(LOG, (errmsg("using clear text authentication with frontend"), errdetail("backend will still use SCRAM auth"), errhint("you can disable this behavior by setting allow_clear_text_frontend_auth to off"))); authenticate_frontend_clear_text(frontend); /* now check again if we have a password now */ if (get_auth_password(MASTER(cp), frontend, 0, &password, &passwordType) == false) { ereport(ERROR, (errmsg("failed to authenticate with backend using SCRAM"), errdetail("unable to get the password"))); } } } /* * if we have encrypted password, Decrypt it before going any further */ if (passwordType == PASSWORD_TYPE_AES) { password = get_decrypted_password(password); if (password == NULL) ereport(ERROR, (errmsg("SCRAM authentication failed"), errdetail("unable to decrypt password from pool_passwd"), errhint("verify the valid pool_key exists"))); /* we have converted the password to plain text */ passwordType = PASSWORD_TYPE_PLAINTEXT; } /* we have a password to use, validate the password type */ if (passwordType != PASSWORD_TYPE_PLAINTEXT) { ereport(ERROR, (errmsg("failed to authenticate with backend using SCRAM"), errdetail("valid password not found"))); } for (i = 0; i < NUM_BACKENDS; i++) { if (!VALID_BACKEND(i)) continue; ereport(DEBUG1, (errmsg("authentication backend %d", i), errdetail("trying SCRAM authentication"))); if (do_SCRAM(frontend, CONNECTION(cp, i), protoMajor, message_length, frontend->username, password, passwordType) == false) { pool_send_auth_fail(frontend, cp); ereport(ERROR, (errmsg("failed to authenticate with backend"), errdetail("SCRAM authentication failed in slot [%d].", i))); } ereport(DEBUG1, (errmsg("SCRAM authentication successful for backend %d", i))); } send_auth_ok(frontend, protoMajor); authkind = 0; } else { ereport(ERROR, (errmsg("failed to authenticate with backend"), errdetail("unsupported auth kind received from backend: authkind:%d", authkind))); } if (authkind != 0) ereport(ERROR, (errmsg("failed to authenticate with backend"), errdetail("invalid auth kind received from backend: authkind:%d", authkind))); /* * authentication ok. now read pid and secret key from the backend */ for (;;) { char *message = NULL; kind = pool_read_kind(cp); if (kind < 0) { ereport(ERROR, (errmsg("authentication failed from backend"), errdetail("failed to read kind before BackendKeyData"))); } else if (kind == 'K') break; if (protoMajor == PROTO_MAJOR_V3) { switch (kind) { case 'S': /* process parameter status */ if (ParameterStatus(frontend, cp) != POOL_CONTINUE) return -1; pool_flush(frontend); break; case 'N': if (pool_extract_error_message(false, MASTER(cp), protoMajor, true, &message) == 1) { ereport(NOTICE, (errmsg("notice from backend"), errdetail("BACKEND NOTICE: \"%s\"", message))); pfree(message); } /* process notice message */ if (SimpleForwardToFrontend(kind, frontend, cp)) ereport(ERROR, (errmsg("authentication failed"), errdetail("failed to forward message to frontend"))); pool_flush(frontend); break; /* process error message */ case 'E': if (pool_extract_error_message(false, MASTER(cp), protoMajor, true, &message) == 1) { ereport(LOG, (errmsg("backend throws an error message"), errdetail("%s", message))); } SimpleForwardToFrontend(kind, frontend, cp); pool_flush(frontend); ereport(ERROR, (errmsg("authentication failed, backend node replied with an error"), errdetail("SERVER ERROR:\"%s\"", message ? message : "could not extract backend message"))); if (message) pfree(message); break; default: ereport(ERROR, (errmsg("authentication failed"), errdetail("unknown response \"%c\" before processing BackendKeyData", kind))); break; } } else { /* V2 case */ switch (kind) { case 'N': /* process notice message */ NoticeResponse(frontend, cp); break; /* process error message */ case 'E': ErrorResponse(frontend, cp); /* fallthrough */ default: ereport(ERROR, (errmsg("authentication failed"), errdetail("invalid response \"%c\" before processing BackendKeyData", kind))); break; } } } /* * message length (V3 only) */ if (protoMajor == PROTO_MAJOR_V3) { if ((length = pool_read_message_length(cp)) != 12) { ereport(ERROR, (errmsg("authentication failed"), errdetail("invalid messages length(%d) for BackendKeyData", length))); } } /* * OK, read pid and secret key */ sp = MASTER_CONNECTION(cp)->sp; pid = -1; for (i = 0; i < NUM_BACKENDS; i++) { if (VALID_BACKEND(i)) { /* read pid */ if (pool_read(CONNECTION(cp, i), &pid, sizeof(pid)) < 0) { ereport(ERROR, (errmsg("authentication failed"), errdetail("failed to read pid in slot %d", i))); } ereport(DEBUG1, (errmsg("authentication backend"), errdetail("cp->info[i]:%p pid:%u", &cp->info[i], ntohl(pid)))); CONNECTION_SLOT(cp, i)->pid = cp->info[i].pid = pid; /* read key */ if (pool_read(CONNECTION(cp, i), &key, sizeof(key)) < 0) { ereport(ERROR, (errmsg("authentication failed"), errdetail("failed to read key in slot %d", i))); } CONNECTION_SLOT(cp, i)->key = cp->info[i].key = key; cp->info[i].major = sp->major; cp->info[i].minor = sp->minor; strlcpy(cp->info[i].database, sp->database, sizeof(cp->info[i].database)); strlcpy(cp->info[i].user, sp->user, sizeof(cp->info[i].user)); cp->info[i].counter = 1; CONNECTION(cp, i)->con_info = &cp->info[i]; cp->info[i].swallow_termination = 0; } } if (pid == -1) { ereport(ERROR, (errmsg("authentication failed"), errdetail("pool_do_auth: all backends are down"))); } if (pool_send_backend_key_data(frontend, pid, key, protoMajor)) ereport(ERROR, (errmsg("authentication failed"), errdetail("failed to send backend data to frontend"))); return 0; } /* * do re-authentication for reused connection. if success return 0 otherwise throws ereport. */ int pool_do_reauth(POOL_CONNECTION * frontend, POOL_CONNECTION_POOL * cp) { int protoMajor; int msglen; protoMajor = MAJOR(cp); /* * if hba is enabled we would already have passed authentication */ if (!frontend->frontend_authenticated) { switch (MASTER(cp)->auth_kind) { case AUTH_REQ_OK: /* trust */ break; case AUTH_REQ_PASSWORD: /* clear text password */ do_clear_text_password(MASTER(cp), frontend, 1, protoMajor); break; case AUTH_REQ_CRYPT: /* crypt password */ do_crypt(MASTER(cp), frontend, 1, protoMajor); break; case AUTH_REQ_MD5: /* md5 password */ authenticate_frontend_md5(MASTER(cp), frontend, 1, protoMajor); break; case AUTH_REQ_SASL: /* SCRAM */ authenticate_frontend_SCRAM(MASTER(cp), frontend, 1); break; default: ereport(ERROR, (errmsg("authentication failed"), errdetail("unknown authentication request code %d", MASTER(cp)->auth_kind))); } } pool_write(frontend, "R", 1); if (protoMajor == PROTO_MAJOR_V3) { msglen = htonl(8); pool_write(frontend, &msglen, sizeof(msglen)); } msglen = htonl(0); pool_write_and_flush(frontend, &msglen, sizeof(msglen)); pool_send_backend_key_data(frontend, MASTER_CONNECTION(cp)->pid, MASTER_CONNECTION(cp)->key, protoMajor); return 0; } /* * send authentication failure message text to frontend */ static void pool_send_auth_fail(POOL_CONNECTION * frontend, POOL_CONNECTION_POOL * cp) { int messagelen; char *errmessage; int protoMajor; bool send_error_to_frontend = true; protoMajor = MAJOR(cp); messagelen = strlen(MASTER_CONNECTION(cp)->sp->user) + 100; errmessage = (char *) palloc(messagelen + 1); snprintf(errmessage, messagelen, "password authentication failed for user \"%s\"", MASTER_CONNECTION(cp)->sp->user); if (send_error_to_frontend) pool_send_fatal_message(frontend, protoMajor, "XX000", errmessage, "", "", __FILE__, __LINE__); pfree(errmessage); } /* * Send backend key data to frontend. if success return 0 otherwise non 0. */ static POOL_STATUS pool_send_backend_key_data(POOL_CONNECTION * frontend, int pid, int key, int protoMajor) { char kind; int len; /* Send backend key data */ kind = 'K'; pool_write(frontend, &kind, 1); if (protoMajor == PROTO_MAJOR_V3) { len = htonl(12); pool_write(frontend, &len, sizeof(len)); } ereport(DEBUG1, (errmsg("sending backend key data"), errdetail("send pid %d to frontend", ntohl(pid)))); pool_write(frontend, &pid, sizeof(pid)); pool_write_and_flush(frontend, &key, sizeof(key)); return 0; } static void authenticate_frontend_clear_text(POOL_CONNECTION * frontend) { static int size; char password[MAX_PASSWORD_SIZE]; char userPassword[MAX_PASSWORD_SIZE]; char *storedPassword = NULL; char *userPwd = NULL; sendAuthRequest(frontend, frontend->protoVersion, AUTH_REQ_PASSWORD, NULL, 0); /* Read password packet */ read_password_packet(frontend, frontend->protoVersion, password, &size); /* save the password in frontend */ frontend->auth_kind = AUTH_REQ_PASSWORD; frontend->pwd_size = size; memcpy(frontend->password, password, frontend->pwd_size); frontend->password[size] = 0; /* Null terminate the password string */ frontend->passwordType = PASSWORD_TYPE_PLAINTEXT; if (!frontend->passwordMapping) { /* * if the password is not present in pool_passwd just bail out from * here */ return; } storedPassword = frontend->passwordMapping->pgpoolUser.password; userPwd = password; /* * If we have md5 password stored in pool_passwd, convert the user * supplied password to md5 for comparison */ if (frontend->passwordMapping->pgpoolUser.passwordType == PASSWORD_TYPE_MD5) { pg_md5_encrypt(password, frontend->username, strlen(frontend->username), userPassword); userPwd = userPassword; size = strlen(userPwd); } else if (frontend->passwordMapping->pgpoolUser.passwordType == PASSWORD_TYPE_AES) { /* * decrypt the stored AES password for comparing it */ storedPassword = get_decrypted_password(storedPassword); if (storedPassword == NULL) ereport(ERROR, (errmsg("clear text authentication failed"), errdetail("unable to decrypt password from pool_passwd"), errhint("verify the valid pool_key exists"))); } else if (frontend->passwordMapping->pgpoolUser.passwordType == PASSWORD_TYPE_TEXT_PREFIXED) { storedPassword = frontend->passwordMapping->pgpoolUser.password + strlen(PASSWORD_TEXT_PREFIX); } else if (frontend->passwordMapping->pgpoolUser.passwordType != PASSWORD_TYPE_PLAINTEXT) { ereport(ERROR, (errmsg("clear text authentication failed"), errdetail("password type stored in pool_passwd can't be used for clear text authentication"))); } if (memcmp(userPwd, storedPassword, size)) { /* Password does not match */ ereport(ERROR, (errmsg("clear text authentication failed"), errdetail("password does not match"))); } ereport(DEBUG1, (errmsg("clear text authentication successful with frontend"))); if (frontend->passwordMapping->pgpoolUser.passwordType == PASSWORD_TYPE_AES) pfree(storedPassword); frontend->frontend_authenticated = true; } /* * perform clear text password authentication */ static int do_clear_text_password(POOL_CONNECTION * backend, POOL_CONNECTION * frontend, int reauth, int protoMajor) { static int size; char *pwd = NULL; int kind; PasswordType passwordType = PASSWORD_TYPE_UNKNOWN; if (reauth && frontend->frontend_authenticated) { /* frontend and backend are both authenticated already */ return 0; } if (get_auth_password(backend, frontend, reauth, &pwd, &passwordType) == false) { /* * We do not have any passeord, we can still get the password * from client using plain text authentication if it is * allowed by user */ if (frontend->pool_hba == NULL || frontend->pool_hba->auth_method == uaPassword || pool_config->allow_clear_text_frontend_auth ) { ereport(DEBUG1, (errmsg("using clear text authentication with frontend"), errdetail("backend is using password authentication"))); authenticate_frontend_clear_text(frontend); /* now check again if we have a password now */ if (get_auth_password(backend, frontend, reauth, &pwd, &passwordType) == false) { ereport(FATAL, (return_code(2), errmsg("clear text password authentication failed"), errdetail("unable to get the password for user: \"%s\"", frontend->username))); } } } if (passwordType == PASSWORD_TYPE_AES) { /* * decrypt the stored AES password for comparing it */ pwd = get_decrypted_password(pwd); if (pwd == NULL) ereport(ERROR, (errmsg("clear text password authentication failed"), errdetail("unable to decrypt password from pool_passwd"), errhint("verify the valid pool_key exists"))); /* we have converted the password to plain text */ passwordType = PASSWORD_TYPE_PLAINTEXT; } if (pwd == NULL || passwordType != PASSWORD_TYPE_PLAINTEXT) { /* If we still do not have a password. we can't proceed */ ereport(ERROR, (errmsg("clear text password authentication failed"), errdetail("unable to get the password"))); return 0; } size = strlen(pwd); /* connection reusing? */ if (reauth) { if (size != backend->pwd_size) ereport(ERROR, (errmsg("clear text password authentication failed"), errdetail("password size does not match"))); if (memcmp(pwd, backend->password, backend->pwd_size) != 0) ereport(ERROR, (errmsg("clear text password authentication failed"), errdetail("password does not match"))); return 0; } kind = send_password_packet(backend, protoMajor, pwd); /* if authenticated, save info */ if (kind == AUTH_REQ_OK) { if (IS_MASTER_NODE_ID(backend->db_node_id)) { send_auth_ok(frontend, protoMajor); } backend->auth_kind = AUTH_REQ_PASSWORD; backend->pwd_size = size; memcpy(backend->password, pwd, backend->pwd_size); backend->passwordType = PASSWORD_TYPE_PLAINTEXT; } return kind; } /* * perform crypt authentication */ static int do_crypt(POOL_CONNECTION * backend, POOL_CONNECTION * frontend, int reauth, int protoMajor) { char salt[2]; static int size; static char password[MAX_PASSWORD_SIZE]; char response; int kind; int len; if (!reauth) { /* read salt */ pool_read(backend, salt, sizeof(salt)); } else { memcpy(salt, backend->salt, sizeof(salt)); } /* master? */ if (IS_MASTER_NODE_ID(backend->db_node_id)) { pool_write(frontend, "R", 1); /* authentication */ if (protoMajor == PROTO_MAJOR_V3) { len = htonl(10); pool_write(frontend, &len, sizeof(len)); } kind = htonl(4); /* crypt authentication */ pool_write(frontend, &kind, sizeof(kind)); /* indicating crypt * authentication */ pool_write_and_flush(frontend, salt, sizeof(salt)); /* salt */ /* read password packet */ if (protoMajor == PROTO_MAJOR_V2) { pool_read(frontend, &size, sizeof(size)); } else { char k; pool_read(frontend, &k, sizeof(k)); if (k != 'p') { ereport(ERROR, (errmsg("crypt authentication failed"), errdetail("invalid password packet. Packet does not starts with \"p\""))); } pool_read(frontend, &size, sizeof(size)); } if ((ntohl(size) - 4) > sizeof(password)) { ereport(ERROR, (errmsg("crypt authentication failed"), errdetail("password is too long, password size is %d", ntohl(size) - 4))); } pool_read(frontend, password, ntohl(size) - 4); } /* connection reusing? */ if (reauth) { ereport(DEBUG1, (errmsg("performing crypt authentication"), errdetail("size: %d saved_size: %d", (ntohl(size) - 4), backend->pwd_size))); if ((ntohl(size) - 4) != backend->pwd_size) ereport(ERROR, (errmsg("crypt authentication failed"), errdetail("password size does not match"))); if (memcmp(password, backend->password, backend->pwd_size) != 0) ereport(ERROR, (errmsg("crypt authentication failed"), errdetail("password does not match"))); return 0; } /* send password packet to backend */ if (protoMajor == PROTO_MAJOR_V3) pool_write(backend, "p", 1); pool_write(backend, &size, sizeof(size)); pool_write_and_flush(backend, password, ntohl(size) - 4); pool_read(backend, &response, sizeof(response)); if (response != 'R') { if (response == 'E') /* Backend has thrown an error instead */ { char *message = NULL; if (pool_extract_error_message(false, backend, protoMajor, false, &message) == 1) { ereport(ERROR, (errmsg("crypt authentication failed"), errdetail("%s", message ? message : "backend throws authentication error"))); } if (message) pfree(message); } ereport(ERROR, (errmsg("crypt authentication failed"), errdetail("invalid packet from backend. backend does not return R while processing clear text password authentication"))); } if (protoMajor == PROTO_MAJOR_V3) { pool_read(backend, &len, sizeof(len)); if (ntohl(len) != 8) ereport(ERROR, (errmsg("crypt authentication failed"), errdetail("invalid packet from backend. incorrect authentication packet size (%d)", ntohl(len)))); } /* expect to read "Authentication OK" response. kind should be 0... */ pool_read(backend, &kind, sizeof(kind)); /* if authenticated, save info */ if (kind == 0) { int msglen; pool_write(frontend, "R", 1); if (protoMajor == PROTO_MAJOR_V3) { msglen = htonl(8); pool_write(frontend, &msglen, sizeof(msglen)); } msglen = htonl(0); pool_write_and_flush(frontend, &msglen, sizeof(msglen)); backend->auth_kind = 4; backend->pwd_size = ntohl(size) - 4; memcpy(backend->password, password, backend->pwd_size); memcpy(backend->salt, salt, sizeof(salt)); } return kind; } /* * Do the SCRAM authentication with the frontend using the stored * password in the pool_passwd file. */ static void authenticate_frontend_SCRAM(POOL_CONNECTION * backend, POOL_CONNECTION * frontend, int reauth) { void *scram_opaq; char *output = NULL; int outputlen = 0; char *input; int inputlen; int result; bool initial; char *logdetail = NULL; char *shadow_pass; PasswordType storedPasswordType = PASSWORD_TYPE_UNKNOWN; char *storedPassword = NULL; if (get_auth_password(backend, frontend, reauth,&storedPassword, &storedPasswordType) == false) { ereport(FATAL, (return_code(2), errmsg("SCRAM authentication failed"), errdetail("pool_passwd file does not contain an entry for \"%s\"", frontend->username))); } if (storedPasswordType == PASSWORD_TYPE_AES) { /* * decrypt the stored AES password for comparing it */ storedPassword = get_decrypted_password(storedPassword); if (storedPassword == NULL) ereport(ERROR, (errmsg("SCRAM authentication failed"), errdetail("unable to decrypt password from pool_passwd"), errhint("verify the valid pool_key exists"))); /* we have converted the password to plain text */ storedPasswordType = PASSWORD_TYPE_PLAINTEXT; } if (storedPasswordType != PASSWORD_TYPE_PLAINTEXT) { ereport(ERROR, (errmsg("SCRAM authentication failed"), errdetail("username \"%s\" has invalid password type", frontend->username))); } shadow_pass = pg_be_scram_build_verifier(storedPassword); if (!shadow_pass) ereport(ERROR, (errmsg("authentication failed"), errdetail("faild to build the scram verifier"))); /* * SASL auth is not supported for protocol versions before 3, because it * relies on the overall message length word to determine the SASL payload * size in AuthenticationSASLContinue and PasswordMessage messages. (We * used to have a hard rule that protocol messages must be parsable * without relying on the length word, but we hardly care about older * protocol version anymore.) */ if (frontend->protoVersion < PROTO_MAJOR_V3) ereport(FATAL, (errmsg("SASL authentication is not supported in protocol version 2"))); /* * Send the SASL authentication request to user. It includes the list of * authentication mechanisms (which is trivial, because we only support * SCRAM-SHA-256 at the moment). The extra "\0" is for an empty string to * terminate the list. */ sendAuthRequest(frontend, frontend->protoVersion, AUTH_REQ_SASL, SCRAM_SHA_256_NAME "\0", strlen(SCRAM_SHA_256_NAME) + 2); /* * Initialize the status tracker for message exchanges. * * If the user doesn't exist, or doesn't have a valid password, or it's * expired, we still go through the motions of SASL authentication, but * tell the authentication method that the authentication is "doomed". * That is, it's going to fail, no matter what. * * This is because we don't want to reveal to an attacker what usernames * are valid, nor which users have a valid password. */ scram_opaq = pg_be_scram_init(frontend->username, shadow_pass); /* * Loop through SASL message exchange. This exchange can consist of * multiple messages sent in both directions. First message is always * from the client. All messages from client to server are password * packets (type 'p'). */ initial = true; do { static int size; static char data[MAX_PASSWORD_SIZE]; /* Read password packet */ read_password_packet(frontend, frontend->protoVersion, data, &size); ereport(DEBUG4, (errmsg("Processing received SASL response of length %d", size))); /* * The first SASLInitialResponse message is different from the others. * It indicates which SASL mechanism the client selected, and contains * an optional Initial Client Response payload. The subsequent * SASLResponse messages contain just the SASL payload. */ if (initial) { const char *selected_mech; char *ptr = data; /* * We only support SCRAM-SHA-256 at the moment, so anything else * is an error. */ selected_mech = data; if (strcmp(selected_mech, SCRAM_SHA_256_NAME) != 0) { ereport(ERROR, (errmsg("client selected an invalid SASL authentication mechanism"))); } /* get the length of trailing optional data */ ptr += strlen(selected_mech) + 1; memcpy(&inputlen, ptr, sizeof(int)); inputlen = ntohl(inputlen); if (inputlen == -1) input = NULL; else input = ptr + 4; initial = false; } else { inputlen = size; input = data; } Assert(input == NULL || input[inputlen] == '\0'); /* * we pass 'logdetail' as NULL when doing a mock authentication, * because we should already have a better error message in that case */ result = pg_be_scram_exchange(scram_opaq, input, inputlen, &output, &outputlen, &logdetail); /* input buffer no longer used */ if (output) { /* * Negotiation generated data to be sent to the client. */ ereport(DEBUG4, (errmsg("sending SASL challenge of length %u", outputlen))); if (result == SASL_EXCHANGE_SUCCESS) sendAuthRequest(frontend, frontend->protoVersion, AUTH_REQ_SASL_FIN, output, outputlen); else sendAuthRequest(frontend, frontend->protoVersion, AUTH_REQ_SASL_CONT, output, outputlen); pfree(output); } } while (result == SASL_EXCHANGE_CONTINUE); /* Oops, Something bad happened */ if (result != SASL_EXCHANGE_SUCCESS) { ereport(ERROR, (errmsg("authentication failed"), errdetail("username \"%s\" or password does not exist in backend", frontend->username))); } frontend->frontend_authenticated = true; } void authenticate_frontend(POOL_CONNECTION * frontend) { switch (frontend->pool_hba->auth_method) { case uaMD5: authenticate_frontend_md5(NULL, frontend, 0, frontend->protoVersion); break; case uaCert: authenticate_frontend_cert(frontend); break; case uaSCRAM: authenticate_frontend_SCRAM(NULL, frontend, 0); break; case uaPassword: authenticate_frontend_clear_text(frontend); break; case uaImplicitReject: case uaReject: ereport(ERROR, (errmsg("authentication with pgpool failed for user \"%s\" rejected", frontend->username))); break; case uaTrust: frontend->frontend_authenticated = true; break; #ifdef USE_PAM case uaPAM: break; #endif /* USE_PAM */ } } #ifdef USE_SSL static void authenticate_frontend_cert(POOL_CONNECTION * frontend) { if (frontend->client_cert_loaded == true && frontend->cert_cn) { ereport(DEBUG1, (errmsg("connecting user is \"%s\" and ssl certificate CN is \"%s\"", frontend->username, frontend->cert_cn))); if (strcasecmp(frontend->username, frontend->cert_cn) == 0) { frontend->frontend_authenticated = true; ereport(LOG, (errmsg("SSL certificate authentication for user \"%s\" with Pgpool-II is successful", frontend->username))); return; } else { frontend->frontend_authenticated = false; ereport(LOG, (errmsg("SSL certificate authentication for user \"%s\" failed", frontend->username))); } } ereport(ERROR, (errmsg("CERT authentication failed"), errdetail("no valid certificate presented"))); } #else static void authenticate_frontend_cert(POOL_CONNECTION * frontend) { ereport(ERROR, (errmsg("CERT authentication failed"), errdetail("CERT authentication is not supported without SSL"))); } #endif static void authenticate_frontend_md5(POOL_CONNECTION * backend, POOL_CONNECTION * frontend, int reauth, int protoMajor) { char salt[4]; static int size; char password[MAX_PASSWORD_SIZE]; char userPassword[MAX_PASSWORD_SIZE]; char encbuf[POOL_PASSWD_LEN + 1]; char *md5; PasswordType storedPasswordType = PASSWORD_TYPE_UNKNOWN; char *storedPassword = NULL; if (RAW_MODE || NUM_BACKENDS == 1) { if (backend) do_md5_single_backend(backend, frontend, reauth, protoMajor); return; /* This will be handled later */ } if (get_auth_password(backend, frontend, reauth,&storedPassword, &storedPasswordType) == false) { ereport(FATAL, (return_code(2), errmsg("md5 authentication failed"), errdetail("pool_passwd file does not contain an entry for \"%s\"", frontend->username))); } pool_random_salt(salt); send_md5auth_request(frontend, frontend->protoVersion, salt); /* Read password packet */ read_password_packet(frontend, frontend->protoVersion, password, &size); /* If we have clear text password stored in pool_passwd, convert it to md5 */ if (storedPasswordType == PASSWORD_TYPE_PLAINTEXT || storedPasswordType == PASSWORD_TYPE_AES) { char *pwd; if (storedPasswordType == PASSWORD_TYPE_AES) { pwd = get_decrypted_password(storedPassword); if (pwd == NULL) ereport(ERROR, (errmsg("md5 authentication failed"), errdetail("unable to decrypt password from pool_passwd"), errhint("verify the valid pool_key exists"))); } else { pwd = storedPassword; } pg_md5_encrypt(pwd, frontend->username, strlen(frontend->username), userPassword); if (storedPasswordType == PASSWORD_TYPE_AES) pfree(pwd); md5 = userPassword; } else if (storedPasswordType == PASSWORD_TYPE_MD5) { md5 = storedPassword; } else { ereport(FATAL, (return_code(2), errmsg("md5 authentication failed"), errdetail("unable to get the password for \"%s\"", frontend->username))); } /* Check the password using my salt + pool_passwd */ pg_md5_encrypt(md5 + strlen("md5"), salt, sizeof(salt), encbuf); if (strcmp(password, encbuf)) { /* Password does not match */ ereport(ERROR, (errmsg("md5 authentication failed"), errdetail("password does not match"))); } ereport(DEBUG1, (errmsg("md5 authentication successful with frontend"))); frontend->frontend_authenticated = true; } /* * perform MD5 authentication */ static int do_md5_single_backend(POOL_CONNECTION * backend, POOL_CONNECTION * frontend, int reauth, int protoMajor) { char salt[4]; static int size; static char password[MAX_PASSWORD_SIZE]; int kind; if (!reauth) { /* read salt from backend */ pool_read(backend, salt, sizeof(salt)); ereport(DEBUG1, (errmsg("performing md5 authentication"), errdetail("DB node id: %d salt: %hhx%hhx%hhx%hhx", backend->db_node_id, salt[0], salt[1], salt[2], salt[3]))); } else { /* Use the saved salt */ memcpy(salt, backend->salt, sizeof(salt)); } /* Send md5 auth request to frontend */ send_md5auth_request(frontend, protoMajor, salt); /* Read password packet */ read_password_packet(frontend, protoMajor, password, &size); /* connection reusing? compare it with saved password */ if (reauth) { if (backend->passwordType != PASSWORD_TYPE_MD5) ereport(ERROR, (errmsg("md5 authentication failed"), errdetail("invalid password type"))); if (size != backend->pwd_size) ereport(ERROR, (errmsg("md5 authentication failed"), errdetail("password does not match"))); if (memcmp(password, backend->password, backend->pwd_size) != 0) ereport(ERROR, (errmsg("md5 authentication failed"), errdetail("password does not match"))); return 0; } else { /* Send password packet to backend and receive auth response */ kind = send_password_packet(backend, protoMajor, password); if (kind < 0) ereport(ERROR, (errmsg("md5 authentication failed"), errdetail("backend replied with invalid kind"))); /* If authenticated, reply back to frontend and save info */ if (kind == AUTH_REQ_OK) { send_auth_ok(frontend, protoMajor); backend->passwordType = PASSWORD_TYPE_MD5; backend->auth_kind = AUTH_REQ_MD5; backend->pwd_size = size; memcpy(backend->password, password, backend->pwd_size); memcpy(backend->salt, salt, sizeof(salt)); } } return kind; } static bool get_auth_password(POOL_CONNECTION * backend, POOL_CONNECTION * frontend, int reauth, char **password, PasswordType *passwordType) { /* First preference is to use the pool_passwd file */ if (frontend->passwordMapping == NULL) frontend->passwordMapping = pool_get_user_credentials(frontend->username); if (frontend->passwordMapping == NULL) { /* * check if we have password stored in the frontend connection. that * could come by using the clear text auth */ if (frontend->pwd_size > 0 && frontend->passwordType == PASSWORD_TYPE_PLAINTEXT) { *password = frontend->password; *passwordType = frontend->passwordType; return true; } else if (reauth && backend && backend->pwd_size > 0) { *password = backend->password; *passwordType = backend->passwordType; return true; } } else { if (frontend->passwordMapping->pgpoolUser.passwordType == PASSWORD_TYPE_TEXT_PREFIXED) { /* convert the TEXT prefixed password to plain text password */ *passwordType = PASSWORD_TYPE_PLAINTEXT; *password = frontend->passwordMapping->pgpoolUser.password + strlen(PASSWORD_TEXT_PREFIX); } else { *password = frontend->passwordMapping->pgpoolUser.password; *passwordType = frontend->passwordMapping->pgpoolUser.passwordType; } return true; } return false; } /* * perform MD5 authentication */ static int do_md5(POOL_CONNECTION * backend, POOL_CONNECTION * frontend, int reauth, int protoMajor, char *storedPassword, PasswordType passwordType) { char salt[4]; static char userPassword[MAX_PASSWORD_SIZE]; int kind; bool password_decrypted = false; char encbuf[POOL_PASSWD_LEN + 1]; char *pool_passwd = NULL; if (RAW_MODE || NUM_BACKENDS == 1) return do_md5_single_backend(backend, frontend, reauth, protoMajor); if (passwordType == PASSWORD_TYPE_AES) { /* * decrypt the stored AES password for comparing it */ storedPassword = get_decrypted_password(storedPassword); if (storedPassword == NULL) ereport(ERROR, (errmsg("md5 authentication failed"), errdetail("unable to decrypt password from pool_passwd"), errhint("verify the valid pool_key exists"))); /* we have converted the password to plain text */ passwordType = PASSWORD_TYPE_PLAINTEXT; password_decrypted = true; } if (passwordType == PASSWORD_TYPE_PLAINTEXT) { pg_md5_encrypt(storedPassword, frontend->username, strlen(frontend->username), userPassword); pool_passwd = userPassword; } else if (passwordType == PASSWORD_TYPE_MD5) { pool_passwd = storedPassword; } else { ereport(ERROR, (errmsg("md5 authentication failed"), errdetail("unable to get the password"))); } /* master? */ if (IS_MASTER_NODE_ID(backend->db_node_id) && frontend->frontend_authenticated == false) { /* * If frontend is not authenticated and do it it first. but if we have * already received the password from frontend using the clear text * auth, we may not need to authenticate it */ if (pool_config->allow_clear_text_frontend_auth && frontend->auth_kind == AUTH_REQ_PASSWORD && frontend->pwd_size > 0 && frontend->passwordType == PASSWORD_TYPE_PLAINTEXT) { ereport(DEBUG2, (errmsg("MD5 authentication using the password from frontend"))); /* save this password in backend for the re-auth */ backend->pwd_size = frontend->pwd_size; memcpy(backend->password, frontend->password, frontend->pwd_size); backend->password[backend->pwd_size] = 0; /* null terminate */ backend->passwordType = frontend->passwordType; } else { authenticate_frontend_md5(backend, frontend, reauth, protoMajor); } } if (!reauth) { /* * now authenticate the backend */ /* Read salt */ pool_read(backend, salt, sizeof(salt)); ereport(DEBUG2, (errmsg("performing md5 authentication"), errdetail("DB node id: %d salt: %hhx%hhx%hhx%hhx", backend->db_node_id, salt[0], salt[1], salt[2], salt[3]))); /* Encrypt password in pool_passwd using the salt */ pg_md5_encrypt(pool_passwd + strlen("md5"), salt, sizeof(salt), encbuf); /* Send password packet to backend and receive auth response */ kind = send_password_packet(backend, protoMajor, encbuf); if (kind < 0) ereport(ERROR, (errmsg("md5 authentication failed"), errdetail("backend replied with invalid kind"))); } if (!reauth && kind == 0) { if (IS_MASTER_NODE_ID(backend->db_node_id)) { /* Send auth ok to frontend */ send_auth_ok(frontend, protoMajor); } /* Save the auth info */ backend->auth_kind = AUTH_REQ_MD5; } if (password_decrypted && storedPassword) pfree(storedPassword); return 0; } /* * Send an authentication request packet to the frontend. */ static void sendAuthRequest(POOL_CONNECTION * frontend, int protoMajor, int32 auth_req_type, char *extradata, int extralen) { int kind = htonl(auth_req_type); pool_write(frontend, "R", 1); /* authentication */ if (protoMajor == PROTO_MAJOR_V3) { int len = 8 + extralen; len = htonl(len); pool_write(frontend, &len, sizeof(len)); } pool_write(frontend, &kind, sizeof(kind)); if (extralen > 0) pool_write_and_flush(frontend, extradata, extralen); else pool_flush(frontend); } /* * Send md5 authentication request packet to frontend */ static void send_md5auth_request(POOL_CONNECTION * frontend, int protoMajor, char *salt) { sendAuthRequest(frontend, protoMajor, AUTH_REQ_MD5, salt, 4); } /* * Read password packet from frontend */ static int read_password_packet(POOL_CONNECTION * frontend, int protoMajor, char *password, int *pwdSize) { int size; /* Read password packet */ if (protoMajor == PROTO_MAJOR_V2) { pool_read(frontend, &size, sizeof(size)); } else { char k; pool_read(frontend, &k, sizeof(k)); if (k != 'p') ereport(ERROR, (errmsg("authentication failed"), errdetail("invalid authentication packet. password packet does not start with \"p\""))); pool_read(frontend, &size, sizeof(size)); } *pwdSize = ntohl(size) - 4; if (*pwdSize > MAX_PASSWORD_SIZE) { ereport(ERROR, (errmsg("authentication failed"), errdetail("invalid authentication packet. password is too long. password length is %d", *pwdSize))); /* * We do not read to throw away packet here. Since it is possible that * it's a denial of service attack. */ } else if (*pwdSize <= 0) ereport(ERROR, (errmsg("authentication failed"), errdetail("invalid authentication packet. invalid password length. password length is %d", *pwdSize))); pool_read(frontend, password, *pwdSize); password[*pwdSize] = '\0'; return 0; } /* * Send password packet to backend and receive authentication response * packet. Return value is the last field of authentication * response. If it's 0, authentication was successful. * "password" must be null-terminated. */ static int send_password_packet(POOL_CONNECTION * backend, int protoMajor, char *password) { int size; int len; int kind; char response; /* Send password packet to backend */ if (protoMajor == PROTO_MAJOR_V3) pool_write(backend, "p", 1); size = htonl(sizeof(size) + strlen(password) + 1); pool_write(backend, &size, sizeof(size)); pool_write_and_flush(backend, password, strlen(password) + 1); pool_read(backend, &response, sizeof(response)); if (response != 'R') { if (response == 'E') /* Backend has thrown an error instead */ { char *message = NULL; if (pool_extract_error_message(false, backend, protoMajor, false, &message) == 1) { ereport(ERROR, (errmsg("authentication failed"), errdetail("%s", message ? message : "backend throws authentication error"))); } if (message) pfree(message); } ereport(ERROR, (errmsg("authentication failed"), errdetail("invalid backend response. Response does not replied with \"R\""))); } if (protoMajor == PROTO_MAJOR_V3) { pool_read(backend, &len, sizeof(len)); if (ntohl(len) != 8) ereport(ERROR, (errmsg("authentication failed"), errdetail("invalid authentication packet. incorrect authentication packet size (%d)", ntohl(len)))); } /* Expect to read "Authentication OK" response. kind should be 0... */ pool_read(backend, &kind, sizeof(kind)); return kind; } /* * Send auth ok to frontend */ static int send_auth_ok(POOL_CONNECTION * frontend, int protoMajor) { int msglen; pool_write(frontend, "R", 1); if (protoMajor == PROTO_MAJOR_V3) { msglen = htonl(8); pool_write(frontend, &msglen, sizeof(msglen)); } msglen = htonl(0); pool_write_and_flush(frontend, &msglen, sizeof(msglen)); return 0; } /* * read message length (V3 only) */ int pool_read_message_length(POOL_CONNECTION_POOL * cp) { int length, length0; int i; /* read message from master node */ pool_read(CONNECTION(cp, MASTER_NODE_ID), &length0, sizeof(length0)); length0 = ntohl(length0); ereport(DEBUG5, (errmsg("reading message length"), errdetail("slot: %d length: %d", MASTER_NODE_ID, length0))); for (i = 0; i < NUM_BACKENDS; i++) { if (!VALID_BACKEND(i) || IS_MASTER_NODE_ID(i)) { continue; } pool_read(CONNECTION(cp, i), &length, sizeof(length)); length = ntohl(length); ereport(DEBUG5, (errmsg("reading message length"), errdetail("slot: %d length: %d", i, length))); if (length != length0) { ereport(LOG, (errmsg("unable to read message length"), errdetail("message length (%d) in slot %d does not match with slot 0(%d)", length, i, length0))); return -1; } } if (length0 < 0) ereport(ERROR, (errmsg("unable to read message length"), errdetail("invalid message length (%d)", length))); return length0; } /* * read message length2 (V3 only) * unlike pool_read_message_length, this returns an array of message length. * The array is in the static storage, thus it will be destroyed by subsequent calls. */ int * pool_read_message_length2(POOL_CONNECTION_POOL * cp) { int length, length0; int i; static int length_array[MAX_CONNECTION_SLOTS]; /* read message from master node */ pool_read(CONNECTION(cp, MASTER_NODE_ID), &length0, sizeof(length0)); length0 = ntohl(length0); length_array[MASTER_NODE_ID] = length0; ereport(DEBUG5, (errmsg("reading message length"), errdetail("master slot: %d length: %d", MASTER_NODE_ID, length0))); for (i = 0; i < NUM_BACKENDS; i++) { if (VALID_BACKEND(i) && !IS_MASTER_NODE_ID(i)) { pool_read(CONNECTION(cp, i), &length, sizeof(length)); length = ntohl(length); ereport(DEBUG5, (errmsg("reading message length"), errdetail("master slot: %d length: %d", i, length))); if (length != length0) { ereport(LOG, (errmsg("reading message length"), errdetail("message length (%d) in slot %d does not match with slot 0(%d)", length, i, length0))); } if (length < 0) { ereport(ERROR, (errmsg("unable to read message length"), errdetail("invalid message length (%d)", length))); } length_array[i] = length; } } return &length_array[0]; } signed char pool_read_kind(POOL_CONNECTION_POOL * cp) { char kind0, kind; int i; kind = -1; kind0 = 0; for (i = 0; i < NUM_BACKENDS; i++) { if (!VALID_BACKEND(i)) { continue; } pool_read(CONNECTION(cp, i), &kind, sizeof(kind)); if (IS_MASTER_NODE_ID(i)) { kind0 = kind; } else { if (kind != kind0) { char *message; if (kind0 == 'E') { if (pool_extract_error_message(false, MASTER(cp), MAJOR(cp), true, &message) == 1) { ereport(LOG, (errmsg("pool_read_kind: error message from master backend:%s", message))); pfree(message); } } else if (kind == 'E') { if (pool_extract_error_message(false, CONNECTION(cp, i), MAJOR(cp), true, &message) == 1) { ereport(LOG, (errmsg("pool_read_kind: error message from %d th backend:%s", i, message))); pfree(message); } } ereport(ERROR, (errmsg("unable to read message kind"), errdetail("kind does not match between master(%x) slot[%d] (%x)", kind0, i, kind))); } } } return kind; } int pool_read_int(POOL_CONNECTION_POOL * cp) { int data0, data; int i; data = -1; data0 = 0; for (i = 0; i < NUM_BACKENDS; i++) { if (!VALID_BACKEND(i)) { continue; } pool_read(CONNECTION(cp, i), &data, sizeof(data)); if (IS_MASTER_NODE_ID(i)) { data0 = data; } else { if (data != data0) { ereport(ERROR, (errmsg("unable to read int value"), errdetail("data does not match between between master(%x) slot[%d] (%x)", data0, i, data))); } } } return data; } void pool_random(void *buf, size_t len) { int ret = 0; #ifdef USE_SSL ret = RAND_bytes(buf, len); #endif /* if RND_bytes fails or not present use the old technique */ if (ret == 0) { int i; char *ptr = buf; for (i = 0; i < len; i++) { long rand = PostmasterRandom(); ptr[i] = (rand % 255) + 1; } } } /* * pool_random_salt */ void pool_random_salt(char *md5Salt) { pool_random(md5Salt, 4); } /* * PostmasterRandom */ static long PostmasterRandom(void) { extern struct timeval random_start_time; static unsigned int random_seed = 0; /* * Select a random seed at the time of first receiving a request. */ if (random_seed == 0) { do { struct timeval random_stop_time; gettimeofday(&random_stop_time, NULL); /* * We are not sure how much precision is in tv_usec, so we swap * the high and low 16 bits of 'random_stop_time' and XOR them * with 'random_start_time'. On the off chance that the result is * 0, we loop until it isn't. */ random_seed = random_start_time.tv_usec ^ ((random_stop_time.tv_usec << 16) | ((random_stop_time.tv_usec >> 16) & 0xffff)); } while (random_seed == 0); srandom(random_seed); } return random(); } static bool do_SCRAM(POOL_CONNECTION * frontend, POOL_CONNECTION * backend, int protoMajor, int message_length, char *username, char *storedPassword, PasswordType passwordType) { /* read the packet first */ void *sasl_state = NULL; int payload_len = message_length - 4 - 4; int auth_kind = AUTH_REQ_SASL; char payload[MAX_SASL_PAYLOAD_LEN]; if (passwordType != PASSWORD_TYPE_PLAINTEXT) { ereport(ERROR, (errmsg("SCRAM authentication failed"), errdetail("invalid password type"))); } if (storedPassword == NULL) { ereport(ERROR, (errmsg("SCRAM authentication failed"), errdetail("password not found"))); } /* master? */ if (frontend && IS_MASTER_NODE_ID(backend->db_node_id) && frontend->frontend_authenticated == false) { /* * If frontend is not authenticated and do it it first. but if we have * already received the password from frontend using the clear text * auth, we may not need to authenticate it */ if (pool_config->allow_clear_text_frontend_auth && frontend->auth_kind == AUTH_REQ_PASSWORD && frontend->pwd_size > 0 && frontend->passwordType == PASSWORD_TYPE_PLAINTEXT) { ereport(DEBUG2, (errmsg("SCRAM authentication using the password from frontend"))); /* save this password in backend for the re-auth */ backend->pwd_size = frontend->pwd_size; memcpy(backend->password, frontend->password, frontend->pwd_size); backend->password[backend->pwd_size] = 0; /* null terminate */ backend->passwordType = frontend->passwordType; } else { authenticate_frontend_SCRAM(backend, frontend, 0); } } for (;;) { char kind; int len; /* * at this point we have already read kind, message length and * authkind */ if (payload_len > MAX_SASL_PAYLOAD_LEN) ereport(ERROR, (errmsg("invalid authentication data too big"))); pool_read(backend, payload, payload_len); switch (auth_kind) { case AUTH_REQ_OK: /* Save the auth info in backend */ backend->auth_kind = AUTH_REQ_SASL; if (sasl_state) pg_fe_scram_free(sasl_state); return true; break; case AUTH_REQ_SASL: /* * The request contains the name (as assigned by IANA) of the * authentication mechanism. */ sasl_state = pg_SASL_init(backend, payload, payload_len, username, storedPassword); if (!sasl_state) { ereport(ERROR, (errmsg("invalid authentication request from server"))); return false; } break; case AUTH_REQ_SASL_CONT: case AUTH_REQ_SASL_FIN: if (sasl_state == NULL) { ereport(ERROR, (errmsg("invalid authentication request from server: AUTH_REQ_SASL_CONT without AUTH_REQ_SASL"))); return false; } if (pg_SASL_continue(backend, payload, payload_len, sasl_state, (auth_kind == AUTH_REQ_SASL_FIN)) != 0) { /* Use error message, if set already */ ereport(ERROR, (errmsg("error in SASL authentication"))); } break; default: ereport(ERROR, (errmsg("invalid authentication request from server: unknown auth kind %d", auth_kind))); } /* Read next backend */ pool_read(backend, &kind, sizeof(kind)); pool_read(backend, &len, sizeof(len)); if (kind != 'R') ereport(ERROR, (errmsg("backend authentication failed"), errdetail("backend response with kind \'%c\' when expecting \'R\'", kind))); message_length = ntohl(len); if (message_length < 8) ereport(ERROR, (errmsg("backend authentication failed"), errdetail("backend response with no data "))); pool_read(backend, &auth_kind, sizeof(auth_kind)); auth_kind = ntohl(auth_kind); payload_len = message_length - 4 - 4; } return false; } static void * pg_SASL_init(POOL_CONNECTION * backend, char *payload, int payloadlen, char *username, char *storedPassword) { char *initialresponse = NULL; int initialresponselen; bool done; bool success; const char *selected_mechanism; char *mechanism_buf = payload; void *sasl_state = NULL; int size; int send_msg_len; /* * Parse the list of SASL authentication mechanisms in the * AuthenticationSASL message, and select the best mechanism that we * support. (Only SCRAM-SHA-256 is supported at the moment.) */ selected_mechanism = NULL; for (;;) { /* An empty string indicates end of list */ if (mechanism_buf[0] == '\0') break; /* * If we have already selected a mechanism, just skip through the rest * of the list. */ if (selected_mechanism) continue; /* * Do we support this mechanism? */ if (strcmp(mechanism_buf, SCRAM_SHA_256_NAME) == 0) { /* * This is the password which we need to send to the PG backend * for authentication. It is stored in the file */ if (storedPassword == NULL || storedPassword[0] == '\0') { ereport(ERROR, (errmsg("password not found"))); } sasl_state = pg_fe_scram_init(username, storedPassword); if (!sasl_state) ereport(ERROR, (errmsg("SASL authentication error\n"))); selected_mechanism = SCRAM_SHA_256_NAME; } mechanism_buf += strlen(mechanism_buf) + 1; } if (!selected_mechanism) { ereport(ERROR, (errmsg("none of the server's SASL authentication mechanisms are supported\n"))); } /* Get the mechanism-specific Initial Client Response, if any */ pg_fe_scram_exchange(sasl_state, NULL, -1, &initialresponse, &initialresponselen, &done, &success); if (done && !success) ereport(ERROR, (errmsg("SASL authentication error"))); send_msg_len = strlen(selected_mechanism) + 1; if (initialresponse) { send_msg_len += 4; send_msg_len += initialresponselen; } size = htonl(send_msg_len + 4); pool_write(backend, "p", 1); pool_write(backend, &size, sizeof(size)); pool_write(backend, (void *) selected_mechanism, strlen(selected_mechanism) + 1); if (initialresponse) { size = htonl(initialresponselen); pool_write(backend, &size, sizeof(size)); pool_write(backend, initialresponse, initialresponselen); } pool_flush(backend); if (initialresponse) pfree(initialresponse); return sasl_state; } /* * Exchange a message for SASL communication protocol with the backend. * This should be used after calling pg_SASL_init to set up the status of * the protocol. */ static int pg_SASL_continue(POOL_CONNECTION * backend, char *payload, int payloadlen, void *sasl_state, bool final) { char *output; int outputlen; bool done; bool success; char *challenge; /* Read the SASL challenge from the AuthenticationSASLContinue message. */ challenge = palloc(payloadlen + 1); memcpy(challenge, payload, payloadlen); challenge[payloadlen] = '\0'; /* For safety and convenience, ensure the buffer is NULL-terminated. */ pg_fe_scram_exchange(sasl_state, challenge, payloadlen, &output, &outputlen, &done, &success); pfree(challenge); /* don't need the input anymore */ if (final && !done) { if (outputlen != 0) pfree(output); ereport(ERROR, (errmsg("AuthenticationSASLFinal received from server, but SASL authentication was not completed"))); return -1; } if (outputlen != 0) { /* * Send the SASL response to the server. */ int size = htonl(outputlen + 4); pool_write(backend, "p", 1); pool_write(backend, &size, sizeof(size)); pool_write_and_flush(backend, output, outputlen); pfree(output); return 0; } if (done && !success) return -1; return 0; } pgpool-II-4.1.4/src/auth/pool_passwd.c0000664000175000017500000003433013730350075014476 00000000000000/* -*-pgsql-c-*- */ /* * * $Header$ * * pgpool: a language independent connection pool server for PostgreSQL * written by Tatsuo Ishii * * Copyright (c) 2003-2018 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" #include "utils/ssl_utils.h" #include "utils/base64.h" #ifndef POOL_PRIVATE #include "utils/elog.h" #else #include "utils/fe_ports.h" #endif #include static FILE *passwd_fd = NULL; /* File descriptor for pool_passwd */ static char saved_passwd_filename[POOLMAXPATHLEN + 1]; static char *userMatchesString(char *buf, char *user); static POOL_PASSWD_MODE pool_passwd_mode; /* * Initialize this module. * If pool_passwd does not exist yet, create it. * Open pool_passwd. */ void pool_init_pool_passwd(char *pool_passwd_filename, POOL_PASSWD_MODE mode) { char *openmode; if (passwd_fd) return; pool_passwd_mode = mode; 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'; } if (mode == POOL_PASSWD_R) openmode = "r"; else openmode = "r+"; passwd_fd = fopen(pool_passwd_filename, openmode); 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) { #define LINE_LEN \ MAX_USER_NAME_LEN + 1 + MAX_POOL_PASSWD_LEN + 2 char linebuf[LINE_LEN]; char *writebuf = NULL; int len; bool updated = false; if (!passwd_fd) ereport(ERROR, (errmsg("error updating password, password file descriptor is NULL"))); if (pool_passwd_mode != POOL_PASSWD_RW) ereport(ERROR, (errmsg("pool_create_passwdent should be called with pool_passwd opened with read/write mode"))); len = strlen(passwd); if (len <= 0) ereport(ERROR, (errmsg("error updating password, invalid password length:%d", len))); rewind(passwd_fd); while (!feof(passwd_fd) && !ferror(passwd_fd)) { char *t = linebuf; int len; if (fgets(linebuf, sizeof(linebuf), passwd_fd) == NULL) break; len = strlen(linebuf); if (len == 0) continue; if (!updated && userMatchesString(t, username)) { len = snprintf(linebuf, sizeof(linebuf), "%s:%s\n", username, passwd); updated = true; } if (writebuf == NULL) writebuf = palloc0(len + 1); else { writebuf = repalloc(writebuf, (len + strlen(writebuf) + 1)); } strcat(writebuf, linebuf); } if (!updated) { /* password was not update, append this at the end */ len = snprintf(linebuf, sizeof(linebuf), "%s:%s\n", username, passwd); if (writebuf == NULL) writebuf = palloc0(len + 1); else { writebuf = repalloc(writebuf, (len + strlen(writebuf) + 1)); } strcat(writebuf, linebuf); } if(!writebuf) return 0; fclose(passwd_fd); passwd_fd = fopen(saved_passwd_filename, "w+"); if (!passwd_fd) { ereport(ERROR, (errmsg("pool_passwd reopen failed"))); } /* write pool_passwd file. */ fwrite(writebuf, 1, strlen(writebuf), passwd_fd); pfree(writebuf); return 0; #undef LINE_LEN } /* * 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[MAX_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; } /* * return the next token if the current token matches the * user */ static char * getNextToken(char *buf, char **token) { #define MAX_TOKEN_LEN 128 char *tbuf, *p; bool bslash = false; char tok[MAX_TOKEN_LEN + 1]; int readlen = 0; *token = NULL; if (buf == NULL) return NULL; tbuf = buf; p = tok; while (*tbuf != 0 && readlen < MAX_TOKEN_LEN) { if (*tbuf == '\\' && !bslash) { tbuf++; bslash = true; } if (*tbuf == ':' && !bslash) { *p = '\0'; if (readlen) *token = pstrdup(tok); return tbuf + 1; } /* just copy to the tok */ bslash = false; *p++ = *tbuf++; readlen++; } *p = '\0'; if (readlen) *token = pstrdup(tok); return NULL; } /* * return the next token if the current token matches the * user */ static char * userMatchesString(char *buf, char *user) { char *tbuf, *ttok; bool bslash = false; if (buf == NULL || user == NULL) return NULL; tbuf = buf; ttok = user; while (*tbuf != 0) { if (*tbuf == '\\' && !bslash) { tbuf++; bslash = true; } if (*tbuf == ':' && *ttok == 0 && !bslash) return tbuf + 1; bslash = false; if (*ttok == 0) return NULL; if (*tbuf == *ttok) { tbuf++; ttok++; } else return NULL; } return NULL; } /* * user:passwod[:user:password] */ PasswordMapping * pool_get_user_credentials(char *username) { PasswordMapping *pwdMapping = NULL; char buf[1024]; if (!username) ereport(ERROR, (errmsg("unable to get password, username is NULL"))); if (!passwd_fd) { ereport(WARNING, (errmsg("unable to get password, password file descriptor is NULL"))); return NULL; } rewind(passwd_fd); while (!feof(passwd_fd) && !ferror(passwd_fd)) { char *t = buf; char *tok; int len; if (fgets(buf, sizeof(buf), passwd_fd) == NULL) break; len = strlen(buf); if (len == 0) continue; /* Remove trailing newline */ if (buf[len - 1] == '\n') buf[len - 1] = 0; if ((t = userMatchesString(t, username)) == NULL) continue; /* Get the password */ t = getNextToken(t, &tok); if (tok) { pwdMapping = palloc0(sizeof(PasswordMapping)); pwdMapping->pgpoolUser.password = tok; pwdMapping->pgpoolUser.passwordType = get_password_type(pwdMapping->pgpoolUser.password); pwdMapping->pgpoolUser.userName = (char *) pstrdup(username); pwdMapping->mappedUser = false; } else continue; /* Get backend user */ t = getNextToken(t, &tok); if (tok) { /* check if we also have the password */ char *pwd; t = getNextToken(t, &pwd); if (pwd) { pwdMapping->backendUser.password = pwd; pwdMapping->backendUser.userName = tok; pwdMapping->backendUser.passwordType = get_password_type(pwdMapping->backendUser.password); pwdMapping->mappedUser = true; } else pfree(tok); } break; } return pwdMapping; } void delete_passwordMapping(PasswordMapping * pwdMapping) { if (!pwdMapping) return; if (pwdMapping->pgpoolUser.password) pfree(pwdMapping->pgpoolUser.password); if (pwdMapping->pgpoolUser.userName) pfree(pwdMapping->pgpoolUser.userName); if (pwdMapping->backendUser.password) pfree(pwdMapping->backendUser.password); if (pwdMapping->backendUser.userName) pfree(pwdMapping->backendUser.userName); pfree(pwdMapping); } /* * 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, pool_passwd_mode); } /* * function first uses the password in the argument, if the argument is empty * string or NULL, it looks for the password for uset in pool_passwd file. * The returned password is always in plain text or md5 hashed and palloc'd * (if not null) */ char * get_pgpool_config_user_password(char *username, char *password_in_config) { PasswordType passwordType = PASSWORD_TYPE_UNKNOWN; char *password = NULL; PasswordMapping *password_mapping = NULL; /* * if the password specified in config is empty strin or NULL look for the * password in pool_passwd file */ if (password_in_config == NULL || strlen(password_in_config) == 0) { password_mapping = pool_get_user_credentials(username); if (password_mapping == NULL) { return NULL; } passwordType = password_mapping->pgpoolUser.passwordType; password = password_mapping->pgpoolUser.password; } else { passwordType = get_password_type(password_in_config); password = password_in_config; } if (passwordType == PASSWORD_TYPE_AES) { /* * decrypt the stored AES password for comparing it */ password = get_decrypted_password(password); if (password == NULL) { ereport(WARNING, (errmsg("could not get the password for user:%s", username), errdetail("unable to decrypt password from pool_passwd"), errhint("verify the valid pool_key exists"))); } else { delete_passwordMapping(password_mapping); /* * the password returned by get_decrypted_password() is already * palloc'd */ return password; } } if (passwordType == PASSWORD_TYPE_TEXT_PREFIXED) { /* convert the TEXT prefixed password to plain text password */ passwordType = PASSWORD_TYPE_PLAINTEXT; if (password) password = (char*)(password + strlen(PASSWORD_TEXT_PREFIX)); } if (password && strlen(password) && (passwordType != PASSWORD_TYPE_PLAINTEXT && passwordType != PASSWORD_TYPE_MD5)) { /* * Could not find either plain text or md5 hashed password in * pool_passwd corresponding to the user. This is normal. Just use * empty password in pgpool.conf. */ ereport(DEBUG5, (errmsg("could not get the password for user:%s", username), errdetail("username \"%s\" has invalid password type: %d", username, passwordType))); password = NULL; } if (password) password = (char *) pstrdup(password); delete_passwordMapping(password_mapping); return password; } #ifndef POOL_PRIVATE char * get_decrypted_password(const char *shadow_pass) { if (get_password_type(shadow_pass) == PASSWORD_TYPE_AES) { unsigned char b64_dec[MAX_PGPASS_LEN * 2]; unsigned char plaintext[MAX_PGPASS_LEN]; int len; char *pwd; const char *enc_key = (const char *) get_pool_key(); if (enc_key == NULL) return NULL; pwd = (char *) shadow_pass + 3; if ((len = strlen(pwd)) == 0) return NULL; if ((len = pg_b64_decode((const char *) pwd, len, (char *) b64_dec)) == 0) { ereport(WARNING, (errmsg("base64 decoding failed"))); return NULL; } if ((len = aes_decrypt_with_password(b64_dec, len, enc_key, plaintext)) <= 0) { ereport(WARNING, (errmsg("decryption failed"))); return NULL; } plaintext[len] = 0; return pstrdup((const char *) plaintext); } return NULL; } #else char * get_decrypted_password(const char *shadow_pass) { ereport(ERROR, (errmsg("unable to decrypt password"))); return NULL; } #endif PasswordType get_password_type(const char *shadow_pass) { if (strncmp(shadow_pass, PASSWORD_MD5_PREFIX, strlen(PASSWORD_MD5_PREFIX)) == 0) { if (strlen(shadow_pass) == MD5_PASSWD_LEN + strlen(PASSWORD_MD5_PREFIX)) return PASSWORD_TYPE_MD5; return PASSWORD_TYPE_PLAINTEXT; } if (strncmp(shadow_pass, PASSWORD_AES_PREFIX, strlen(PASSWORD_AES_PREFIX)) == 0) return PASSWORD_TYPE_AES; if (strncmp(shadow_pass, PASSWORD_SCRAM_PREFIX, strlen(PASSWORD_SCRAM_PREFIX)) == 0) return PASSWORD_TYPE_SCRAM_SHA_256; if (strncmp(shadow_pass, PASSWORD_TEXT_PREFIX, strlen(PASSWORD_TEXT_PREFIX)) == 0) return PASSWORD_TYPE_TEXT_PREFIXED; return PASSWORD_TYPE_PLAINTEXT; } /* * Get a key from the pgpool key file. return the palloc'd. * value */ char * read_pool_key(char *key_file_path) { FILE *fp; struct stat stat_buf; char *key = NULL; #define LINELEN MAX_POOL_KEY_LEN char buf[LINELEN]; if (strlen(key_file_path) == 0) return NULL; /* If password file cannot be opened, ignore it. */ if (stat(key_file_path, &stat_buf) != 0) return NULL; if (!S_ISREG(stat_buf.st_mode)) { ereport(WARNING, (errmsg("pool key file \"%s\" is not a plain file\n", key_file_path))); return NULL; } /* If password file is insecure, alert the user. */ if (stat_buf.st_mode & (S_IRWXG | S_IRWXO)) { ereport(WARNING, (errmsg("pool key file \"%s\" has group or world access; permissions should be u=rw (0600) or less\n", key_file_path))); /* do we want to allow unsecure pool key file ? */ /* return NULL; */ } fp = fopen(key_file_path, "r"); if (fp == NULL) return NULL; while (!feof(fp) && !ferror(fp)) { int len; if (fgets(buf, sizeof(buf), fp) == NULL) break; len = strlen(buf); if (len == 0) continue; /* Remove trailing newline */ if (buf[len - 1] == '\n') buf[len - 1] = 0; key = pstrdup(buf); break; } fclose(fp); return key; #undef LINELEN } pgpool-II-4.1.4/src/auth/pool_hba.c0000664000175000017500000015752713730350127013743 00000000000000/* -*-pgsql-c-*- */ /* * * $Header$ * * pgpool: a language independent connection pool server for PostgreSQL * written by Tatsuo Ishii * * Portions Copyright (c) 2003-2018 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. * * pool_hba.c.: Routines to handle host based authentication. * */ #include #include #include #include #include #ifdef __FreeBSD__ #include #endif #include "pool.h" #include "auth/pool_hba.h" #include "utils/pool_path.h" #include "utils/pool_ip.h" #include "utils/pool_stream.h" #include "pool_config.h" #include "pool_type.h" #include "utils/palloc.h" #include "utils/memutils.h" #include "utils/elog.h" #include "parser/pg_list.h" #include "auth/pool_passwd.h" #define MULTI_VALUE_SEP "\001" /* delimiter for multi-valued column strings */ #define MAX_TOKEN 256 #define MAX_LINE 8192 static MemoryContext parsed_hba_context = NULL; static List *parsed_hba_lines = NIL; static char *HbaFileName; #define token_is_keyword(t, k) (!t->quoted && strcmp(t->string, k) == 0) #define token_matches(t, k) (strcmp(t->string, k) == 0) /* * TokenizedLine represents one line lexed from a config file. * Each item in the "fields" list is a sub-list of HbaTokens. * We don't emit a TokenizedLine for empty or all-comment lines, * so "fields" is never NIL (nor are any of its sub-lists). * Exception: if an error occurs during tokenization, we might * have fields == NIL, in which case err_msg != NULL. */ typedef struct TokenizedLine { List *fields; /* List of lists of HbaTokens */ int line_num; /* Line number */ char *raw_line; /* Raw line text */ char *err_msg; /* Error message if any */ } TokenizedLine; /* * A single string token lexed from a config file, together with whether * the token had been quoted. */ typedef struct HbaToken { char *string; bool quoted; } HbaToken; /* callback data for check_network_callback */ typedef struct check_network_data { IPCompareMethod method; /* test method */ SockAddr *raddr; /* client's actual address */ bool result; /* set to true if match */ } check_network_data; static HbaToken *copy_hba_token(HbaToken *in); static HbaToken *make_hba_token(const char *token, bool quoted); static bool parse_hba_auth_opt(char *name, char *val, HbaLine *hbaline, int elevel, char **err_msg); static MemoryContext tokenize_file(const char *filename, FILE *file, List **tok_lines, int elevel); static void sendAuthRequest(POOL_CONNECTION * frontend, AuthRequest areq); static void auth_failed(POOL_CONNECTION * frontend); static void close_all_backend_connections(void); static bool hba_getauthmethod(POOL_CONNECTION * frontend); static bool check_hba(POOL_CONNECTION * frontend); static bool check_user(char *user, List *tokens); static bool check_db(const char *dbname, const char *user, List *tokens); static List *tokenize_inc_file(List *tokens, const char *outer_filename, const char *inc_filename, int elevel, char **err_msg); static bool check_hostname(POOL_CONNECTION * frontend, const char *hostname); static bool check_ip(SockAddr *raddr, struct sockaddr *addr, struct sockaddr *mask); static bool check_same_host_or_net(SockAddr *raddr, IPCompareMethod method); static void check_network_callback(struct sockaddr *addr, struct sockaddr *netmask, void *cb_data); static HbaLine *parse_hba_line(TokenizedLine *tok_line, int elevel); static bool pg_isblank(const char c); static bool next_token(char **lineptr, char *buf, int bufsz, bool *initial_quote, bool *terminating_comma, int elevel, char **err_msg); static List *next_field_expand(const char *filename, char **lineptr, int elevel, char **err_msg); #ifdef NOT_USED static POOL_STATUS CheckUserExist(char *username); #endif #ifdef USE_PAM #ifdef HAVE_PAM_PAM_APPL_H #include #endif #ifdef HAVE_SECURITY_PAM_APPL_H #include #endif #define PGPOOL_PAM_SERVICE "pgpool" /* Service name passed to PAM */ static POOL_STATUS CheckPAMAuth(POOL_CONNECTION * frontend, char *user, char *password); static int pam_passwd_conv_proc(int num_msg, const struct pam_message **msg, struct pam_response **resp, void *appdata_ptr); /* * recv_password_packet is usually used with authentications that require a client * password. However, pgpool's hba function only uses it for PAM authentication, * so declare a prototype here in "#ifdef USE_PAM" to avoid compilation warning. */ static char *recv_password_packet(POOL_CONNECTION * frontend); static struct pam_conv pam_passw_conv = { &pam_passwd_conv_proc, NULL }; static char *pam_passwd = NULL; /* Workaround for Solaris 2.6 brokenness */ static POOL_CONNECTION * pam_frontend_kludge; /* Workaround for passing * POOL_CONNECTION *frontend * into pam_passwd_conv_proc */ #endif /* USE_PAM */ /* * Read the config file and create a List of HbaLine records for the contents. * * The configuration is read into a temporary list, and if any parse error * occurs the old list is kept in place and false is returned. Only if the * whole file parses OK is the list replaced, and the function returns true. * * On a false result, caller will take care of reporting a FATAL error in case * this is the initial startup. If it happens on reload, we just keep running * with the old data. */ bool load_hba(char *hbapath) { FILE *file; List *hba_lines = NIL; ListCell *line; List *new_parsed_lines = NIL; bool ok = true; MemoryContext linecxt; MemoryContext oldcxt; MemoryContext hbacxt; HbaFileName = pstrdup(hbapath); file = fopen(hbapath, "r"); if (file == NULL) { ereport(LOG, (errmsg("could not open configuration file \"%s\": %m", HbaFileName))); return false; } linecxt = tokenize_file(HbaFileName, file, &hba_lines, LOG); fclose(file); /* Now parse all the lines */ hbacxt = AllocSetContextCreate(TopMemoryContext, "hba parser context", ALLOCSET_SMALL_SIZES); oldcxt = MemoryContextSwitchTo(hbacxt); foreach(line, hba_lines) { TokenizedLine *tok_line = (TokenizedLine *) lfirst(line); HbaLine *newline; /* don't parse lines that already have errors */ if (tok_line->err_msg != NULL) { ok = false; continue; } if ((newline = parse_hba_line(tok_line, LOG)) == NULL) { /* Parse error; remember there's trouble */ ok = false; /* * Keep parsing the rest of the file so we can report errors on * more than the first line. Error has already been logged, no * need for more chatter here. */ continue; } new_parsed_lines = lappend(new_parsed_lines, newline); } /* * A valid HBA file must have at least one entry; else there's no way to * connect to the postmaster. But only complain about this if we didn't * already have parsing errors. */ if (ok && new_parsed_lines == NIL) { ereport(LOG, (errcode(ERRCODE_CONFIG_FILE_ERROR), errmsg("configuration file \"%s\" contains no entries", HbaFileName))); ok = false; } /* Free tokenizer memory */ MemoryContextDelete(linecxt); MemoryContextSwitchTo(oldcxt); if (!ok) { /* File contained one or more errors, so bail out */ MemoryContextDelete(hbacxt); return false; } /* Loaded new file successfully, replace the one we use */ if (parsed_hba_context != NULL) MemoryContextDelete(parsed_hba_context); parsed_hba_context = hbacxt; parsed_hba_lines = new_parsed_lines; return true; } static HbaLine * parse_hba_line(TokenizedLine *tok_line, int elevel) { int line_num = tok_line->line_num; char **err_msg = &tok_line->err_msg; char *str; struct addrinfo *gai_result; struct addrinfo hints; int ret; char *cidr_slash; ListCell *field; List *tokens; ListCell *tokencell; HbaToken *token; HbaLine *parsedline; parsedline = palloc0(sizeof(HbaLine)); parsedline->linenumber = line_num; parsedline->rawline = pstrdup(tok_line->raw_line); /* Check the record type. */ Assert(tok_line->fields != NIL); field = list_head(tok_line->fields); tokens = lfirst(field); if (tokens->length > 1) { ereport(elevel, (errcode(ERRCODE_CONFIG_FILE_ERROR), errmsg("multiple values specified for connection type"), errhint("Specify exactly one connection type per line."), errcontext("line %d of configuration file \"%s\"", line_num, HbaFileName))); *err_msg = "multiple values specified for connection type"; return NULL; } token = linitial(tokens); if (strcmp(token->string, "local") == 0) { parsedline->conntype = ctLocal; } else if (strcmp(token->string, "host") == 0 || strcmp(token->string, "hostssl") == 0 || strcmp(token->string, "hostnossl") == 0) { if (token->string[4] == 's') /* "hostssl" */ { parsedline->conntype = ctHostSSL; /* Log a warning if SSL support is not active */ #ifdef USE_SSL if (!pool_config->ssl) { ereport(elevel, (errcode(ERRCODE_CONFIG_FILE_ERROR), errmsg("hostssl record cannot match because SSL is disabled"), errhint("Set ssl = on in pgpool.conf"), errcontext("line %d of configuration file \"%s\"", line_num, HbaFileName))); *err_msg = "hostssl record cannot match because SSL is disabled"; } #else ereport(elevel, (errmsg("hostssl record cannot match because SSL is not supported by this build"), errhint("Compile with --with-openssl to use SSL connections."), errcontext("line %d of configuration file \"%s\"", line_num, HbaFileName))); *err_msg = "hostssl record cannot match because SSL is not supported by this build"; #endif } else if (token->string[4] == 'n') /* "hostnossl" */ { parsedline->conntype = ctHostNoSSL; } else { /* "host" */ parsedline->conntype = ctHost; } } /* record type */ else { ereport(elevel, (errcode(ERRCODE_CONFIG_FILE_ERROR), errmsg("invalid connection type \"%s\"", token->string), errcontext("line %d of configuration file \"%s\"", line_num, HbaFileName))); *err_msg = psprintf("invalid connection type \"%s\"", token->string); return NULL; } /* Get the databases. */ field = lnext(field); if (!field) { ereport(elevel, (errcode(ERRCODE_CONFIG_FILE_ERROR), errmsg("end-of-line before database specification"), errcontext("line %d of configuration file \"%s\"", line_num, HbaFileName))); *err_msg = "end-of-line before database specification"; return NULL; } parsedline->databases = NIL; tokens = lfirst(field); foreach(tokencell, tokens) { parsedline->databases = lappend(parsedline->databases, copy_hba_token(lfirst(tokencell))); } /* Get the users. */ field = lnext(field); if (!field) { ereport(elevel, (errcode(ERRCODE_CONFIG_FILE_ERROR), errmsg("end-of-line before role specification"), errcontext("line %d of configuration file \"%s\"", line_num, HbaFileName))); *err_msg = "end-of-line before role specification"; return NULL; } parsedline->users = NIL; tokens = lfirst(field); foreach(tokencell, tokens) { parsedline->users = lappend(parsedline->users, copy_hba_token(lfirst(tokencell))); } if (parsedline->conntype != ctLocal) { /* Read the IP address field. (with or without CIDR netmask) */ field = lnext(field); if (!field) { ereport(elevel, (errcode(ERRCODE_CONFIG_FILE_ERROR), errmsg("end-of-line before IP address specification"), errcontext("line %d of configuration file \"%s\"", line_num, HbaFileName))); *err_msg = "end-of-line before IP address specification"; return NULL; } tokens = lfirst(field); if (tokens->length > 1) { ereport(elevel, (errcode(ERRCODE_CONFIG_FILE_ERROR), errmsg("multiple values specified for host address"), errhint("Specify one address range per line."), errcontext("line %d of configuration file \"%s\"", line_num, HbaFileName))); *err_msg = "multiple values specified for host address"; return NULL; } token = linitial(tokens); if (token_is_keyword(token, "all")) { parsedline->ip_cmp_method = ipCmpAll; } else if (token_is_keyword(token, "samehost")) { /* Any IP on this host is allowed to connect */ parsedline->ip_cmp_method = ipCmpSameHost; } else if (token_is_keyword(token, "samenet")) { /* Any IP on the host's subnets is allowed to connect */ parsedline->ip_cmp_method = ipCmpSameNet; } else { /* IP and netmask are specified */ parsedline->ip_cmp_method = ipCmpMask; /* need a modifiable copy of token */ str = pstrdup(token->string); /* Check if it has a CIDR suffix and if so isolate it */ cidr_slash = strchr(str, '/'); if (cidr_slash) *cidr_slash = '\0'; /* Get the IP address either way */ hints.ai_flags = AI_NUMERICHOST; hints.ai_family = AF_UNSPEC; hints.ai_socktype = 0; hints.ai_protocol = 0; hints.ai_addrlen = 0; hints.ai_canonname = NULL; hints.ai_addr = NULL; hints.ai_next = NULL; ret = getaddrinfo_all(str, NULL, &hints, &gai_result); if (ret == 0 && gai_result) memcpy(&parsedline->addr, gai_result->ai_addr, gai_result->ai_addrlen); else if (ret == EAI_NONAME) parsedline->hostname = str; else { ereport(elevel, (errcode(ERRCODE_CONFIG_FILE_ERROR), errmsg("invalid IP address \"%s\": %s", str, gai_strerror(ret)), errcontext("line %d of configuration file \"%s\"", line_num, HbaFileName))); *err_msg = psprintf("invalid IP address \"%s\": %s", str, gai_strerror(ret)); if (gai_result) freeaddrinfo_all(hints.ai_family, gai_result); pfree(str); return NULL; } freeaddrinfo_all(hints.ai_family, gai_result); /* Get the netmask */ if (cidr_slash) { if (parsedline->hostname) { ereport(elevel, (errcode(ERRCODE_CONFIG_FILE_ERROR), errmsg("specifying both host name and CIDR mask is invalid: \"%s\"", token->string), errcontext("line %d of configuration file \"%s\"", line_num, HbaFileName))); *err_msg = psprintf("specifying both host name and CIDR mask is invalid: \"%s\"", token->string); pfree(str); return NULL; } if (SockAddr_cidr_mask(&parsedline->mask, cidr_slash + 1, parsedline->addr.ss_family) < 0) { ereport(elevel, (errcode(ERRCODE_CONFIG_FILE_ERROR), errmsg("invalid CIDR mask in address \"%s\"", token->string), errcontext("line %d of configuration file \"%s\"", line_num, HbaFileName))); *err_msg = psprintf("invalid CIDR mask in address \"%s\"", token->string); pfree(str); return NULL; } pfree(str); } else if (!parsedline->hostname) { /* Read the mask field. */ pfree(str); field = lnext(field); if (!field) { ereport(elevel, (errcode(ERRCODE_CONFIG_FILE_ERROR), errmsg("end-of-line before netmask specification"), errhint("Specify an address range in CIDR notation, or provide a separate netmask."), errcontext("line %d of configuration file \"%s\"", line_num, HbaFileName))); *err_msg = "end-of-line before netmask specification"; return NULL; } tokens = lfirst(field); if (tokens->length > 1) { ereport(elevel, (errcode(ERRCODE_CONFIG_FILE_ERROR), errmsg("multiple values specified for netmask"), errcontext("line %d of configuration file \"%s\"", line_num, HbaFileName))); *err_msg = "multiple values specified for netmask"; return NULL; } token = linitial(tokens); ret = getaddrinfo_all(token->string, NULL, &hints, &gai_result); if (ret || !gai_result) { ereport(elevel, (errcode(ERRCODE_CONFIG_FILE_ERROR), errmsg("invalid IP mask \"%s\": %s", token->string, gai_strerror(ret)), errcontext("line %d of configuration file \"%s\"", line_num, HbaFileName))); *err_msg = psprintf("invalid IP mask \"%s\": %s", token->string, gai_strerror(ret)); if (gai_result) freeaddrinfo_all(hints.ai_family, gai_result); return NULL; } memcpy(&parsedline->mask, gai_result->ai_addr, gai_result->ai_addrlen); freeaddrinfo_all(hints.ai_family, gai_result); if (parsedline->addr.ss_family != parsedline->mask.ss_family) { ereport(elevel, (errcode(ERRCODE_CONFIG_FILE_ERROR), errmsg("IP address and mask do not match"), errcontext("line %d of configuration file \"%s\"", line_num, HbaFileName))); *err_msg = "IP address and mask do not match"; return NULL; } } } } /* != ctLocal */ /* Get the authentication method */ field = lnext(field); if (!field) { ereport(elevel, (errcode(ERRCODE_CONFIG_FILE_ERROR), errmsg("end-of-line before authentication method"), errcontext("line %d of configuration file \"%s\"", line_num, HbaFileName))); *err_msg = "end-of-line before authentication method"; return NULL; } tokens = lfirst(field); if (tokens->length > 1) { ereport(elevel, (errcode(ERRCODE_CONFIG_FILE_ERROR), errmsg("multiple values specified for authentication type"), errhint("Specify exactly one authentication type per line."), errcontext("line %d of configuration file \"%s\"", line_num, HbaFileName))); *err_msg = "multiple values specified for authentication type"; return NULL; } token = linitial(tokens); if (strcmp(token->string, "trust") == 0) parsedline->auth_method = uaTrust; else if (strcmp(token->string, "reject") == 0) parsedline->auth_method = uaReject; else if (strcmp(token->string, "cert") == 0) parsedline->auth_method = uaCert; else if (strcmp(token->string, "password") == 0) parsedline->auth_method = uaPassword; else if (strcmp(token->string, "md5") == 0) parsedline->auth_method = uaMD5; else if (strcmp(token->string, "scram-sha-256") == 0) parsedline->auth_method = uaSCRAM; #ifdef USE_PAM else if (strcmp(token->string, "pam") == 0) parsedline->auth_method = uaPAM; #endif else { ereport(elevel, (errcode(ERRCODE_CONFIG_FILE_ERROR), errmsg("invalid authentication method \"%s\"", token->string), errcontext("line %d of configuration file \"%s\"", line_num, HbaFileName))); *err_msg = psprintf("invalid authentication method \"%s\"", token->string); return NULL; } /* Parse remaining arguments */ while ((field = lnext(field)) != NULL) { tokens = lfirst(field); foreach(tokencell, tokens) { char *val; token = lfirst(tokencell); str = pstrdup(token->string); val = strchr(str, '='); if (val == NULL) { /* * Got something that's not a name=value pair. */ ereport(elevel, (errcode(ERRCODE_CONFIG_FILE_ERROR), errmsg("authentication option not in name=value format: %s", token->string), errcontext("line %d of configuration file \"%s\"", line_num, HbaFileName))); *err_msg = psprintf("authentication option not in name=value format: %s", token->string); pfree(str); return NULL; } *val++ = '\0'; /* str now holds "name", val holds "value" */ if (!parse_hba_auth_opt(str, val, parsedline, elevel, err_msg)) { /* parse_hba_auth_opt already logged the error message */ pfree(str); return NULL; } pfree(str); } } return parsedline; } /* * Parse one name-value pair as an authentication option into the given * HbaLine. Return true if we successfully parse the option, false if we * encounter an error. In the event of an error, also log a message at * ereport level elevel, and store a message string into *err_msg. */ static bool parse_hba_auth_opt(char *name, char *val, HbaLine *hbaline, int elevel, char **err_msg) { int line_num = hbaline->linenumber; if (strcmp(name, "pamservice") == 0) { #ifdef USE_PAM if (hbaline->auth_method != uaPAM) { ereport(elevel, (errmsg("pamservice authentication option can only be configured for authentication method \"pam\""), errcontext("line %d of configuration file \"%s\"", line_num, HbaFileName))); *err_msg = "pamservice authentication option can only be configured for authentication method \"pam\""; } else hbaline->pamservice = pstrdup(val); #else ereport(elevel, (errmsg("pamservice authentication option can only be configured for authentication method \"pam\""), errhint("Compile with --with-pam to use PAM authentication."), errcontext("line %d of configuration file \"%s\"", line_num, HbaFileName))); *err_msg = "pamservice authentication option cannot be used because PAM is not supported by this build"; #endif } else if (strcmp(name, "pam_use_hostname") == 0) { #ifdef USE_PAM if (hbaline->auth_method != uaPAM) { ereport(elevel, (errmsg("pamservice authentication option can only be configured for authentication method \"pam\""), errcontext("line %d of configuration file \"%s\"", line_num, HbaFileName))); *err_msg = "pamservice authentication option can only be configured for authentication method \"pam\""; } else { if (strcmp(val, "1") == 0) hbaline->pam_use_hostname = true; else hbaline->pam_use_hostname = false; } #else ereport(elevel, (errmsg("pamservice authentication option can only be configured for authentication method \"pam\""), errhint("Compile with --with-pam to use PAM authentication."), errcontext("line %d of configuration file \"%s\"", line_num, HbaFileName))); *err_msg = "pamservice authentication option cannot be used because PAM is not supported by this build"; #endif } else { ereport(elevel, (errmsg("unrecognized authentication option name: \"%s\"", name), errcontext("line %d of configuration file \"%s\"", line_num, HbaFileName))); *err_msg = psprintf("unrecognized authentication option name: \"%s\"", name); return false; } return true; } /* * do frontend <-> pgpool authentication based on pool_hba.conf */ void ClientAuthentication(POOL_CONNECTION * frontend) { POOL_STATUS status = POOL_END; MemoryContext oldContext; PG_TRY(); { if (!hba_getauthmethod(frontend)) ereport(FATAL, (return_code(2), errmsg("client authentication failed"), errdetail("missing or erroneous pool_hba.conf file"), errhint("see pgpool log for details"))); /* * Get the password for the user if it is stored in the pool_password * file * authentication process is called in the temporary memory * context, but password mappings has to live till the life time * of frontend connection, so call the pool_get_user_credentials in * ProcessLoopContext memory context */ oldContext = MemoryContextSwitchTo(ProcessLoopContext); frontend->passwordMapping = pool_get_user_credentials(frontend->username); MemoryContextSwitchTo(oldContext); switch (frontend->pool_hba->auth_method) { case uaImplicitReject: case uaReject: { /* * This could have come from an explicit "reject" entry in * pool_hba.conf, but more likely it means there was no * matching entry. Take pity on the poor user and issue a * helpful error message. NOTE: this is not a security * breach, because all the info reported here is known at * the frontend and must be assumed known to bad guys. * We're merely helping out the less clueful good guys. */ char hostinfo[NI_MAXHOST]; getnameinfo_all(&frontend->raddr.addr, frontend->raddr.salen, hostinfo, sizeof(hostinfo), NULL, 0, NI_NUMERICHOST); #ifdef USE_SSL ereport(FATAL, (return_code(2), errmsg("client authentication failed"), errdetail("no pool_hba.conf entry for host \"%s\", user \"%s\", database \"%s\", %s", hostinfo, frontend->username, frontend->database, frontend->ssl ? "SSL on" : "SSL off"), errhint("see pgpool log for details"))); #else ereport(FATAL, (return_code(2), errmsg("client authentication failed"), errdetail("no pool_hba.conf entry for host \"%s\", user \"%s\", database \"%s\"", hostinfo, frontend->username, frontend->database), errhint("see pgpool log for details"))); #endif break; } /* * case uaKrb4: case uaKrb5: case uaIdent: case uaCrypt: */ case uaPassword: ereport(DEBUG1, (errmsg("password authentication required"))); status = POOL_CONTINUE; break; case uaCert: ereport(DEBUG1, (errmsg("SSL certificate authentication required"))); status = POOL_CONTINUE; break; case uaMD5: status = POOL_CONTINUE; if (NUM_BACKENDS <= 1) break; if (!frontend->passwordMapping) ereport(FATAL, (return_code(2), errmsg("md5 authentication failed"), errdetail("pool_passwd file does not contain an entry for \"%s\"", frontend->username))); if (frontend->passwordMapping->pgpoolUser.passwordType != PASSWORD_TYPE_PLAINTEXT && frontend->passwordMapping->pgpoolUser.passwordType != PASSWORD_TYPE_MD5 && frontend->passwordMapping->pgpoolUser.passwordType != PASSWORD_TYPE_TEXT_PREFIXED && frontend->passwordMapping->pgpoolUser.passwordType != PASSWORD_TYPE_AES) ereport(FATAL, (return_code(2), errmsg("md5 authentication failed"), errdetail("pool_passwd file does not contain valid md5 entry for \"%s\"", frontend->username))); break; case uaSCRAM: if (!frontend->passwordMapping) ereport(FATAL, (return_code(2), errmsg("SCRAM authentication failed"), errdetail("pool_passwd file does not contain an entry for \"%s\"", frontend->username))); if (frontend->passwordMapping->pgpoolUser.passwordType != PASSWORD_TYPE_PLAINTEXT && frontend->passwordMapping->pgpoolUser.passwordType != PASSWORD_TYPE_TEXT_PREFIXED && frontend->passwordMapping->pgpoolUser.passwordType != PASSWORD_TYPE_SCRAM_SHA_256 && frontend->passwordMapping->pgpoolUser.passwordType != PASSWORD_TYPE_AES) ereport(FATAL, (return_code(2), errmsg("SCRAM authentication failed"), errdetail("pool_passwd file does not contain valid SCRAM entry for \"%s\"", frontend->username))); status = POOL_CONTINUE; break; #ifdef USE_PAM case uaPAM: pam_frontend_kludge = frontend; status = CheckPAMAuth(frontend, frontend->username, ""); break; #endif /* USE_PAM */ case uaTrust: status = POOL_CONTINUE; break; } } PG_CATCH(); { close_all_backend_connections(); PG_RE_THROW(); } PG_END_TRY(); if (status == POOL_CONTINUE) { sendAuthRequest(frontend, AUTH_REQ_OK); authenticate_frontend(frontend); } else auth_failed(frontend); } static void sendAuthRequest(POOL_CONNECTION * frontend, AuthRequest areq) { int wsize; /* number of bytes to write */ int areq_nbo; /* areq in network byte order */ /* * If AUTH_REQ_OK, then frontend is OK to connect __with_pgpool__. Do not * send 'R' to the frontend, he still needs to authenticate himself with * the backend. */ if (areq == AUTH_REQ_OK) return; /* request a password */ pool_write(frontend, "R", 1); if (frontend->protoVersion == PROTO_MAJOR_V3) { /* if (areq == AUTH_REQ_MD5) */ /* wsize = htonl(sizeof(int)*2+4); */ /* else if (areq == AUTH_REQ_CRYPT) */ /* wsize = htonl(sizeof(int)*2+2); */ /* else */ wsize = htonl(sizeof(int) * 2); pool_write(frontend, &wsize, sizeof(int)); } areq_nbo = htonl(areq); pool_write(frontend, &areq_nbo, sizeof(int)); /* Add the salt for encrypted passwords. */ /* if (areq == AUTH_REQ_MD5) */ /* pq_sendbytes(&buf, port->md5Salt, 4); */ /* else if (areq == AUTH_REQ_CRYPT) */ /* pq_sendbytes(&buf, port->cryptSalt, 2); */ pool_flush(frontend); } #ifdef USE_PAM /* see the prototype comment */ /* * Collect password response packet from frontend. * * Returns NULL if couldn't get password, else palloc'd string. */ static char * recv_password_packet(POOL_CONNECTION * frontend) { int rsize; char *passwd; char *returnVal; if (frontend->protoVersion == PROTO_MAJOR_V3) { /* Expect 'p' message type */ char kind; if (pool_read(frontend, &kind, 1) < 0) return NULL; if (kind != 'p') { ereport(LOG, (errmsg("unexpected password response received. expected 'p' received '%c'", kind))); return NULL; /* bad message type */ } } /* pre-3.0 protocol does not send a message type */ if (pool_read(frontend, &rsize, sizeof(int)) < 0) return NULL; rsize = ntohl(rsize) - 4; passwd = pool_read2(frontend, rsize); /* retrieve password */ if (passwd == NULL) return NULL; /* Do not echo password to logs, for security. */ ereport(DEBUG1, (errmsg("received password packet from frontend for pgpool's HBA"))); /* * Return the received string. Note we do not attempt to do any * character-set conversion on it; since we don't yet know the client's * encoding, there wouldn't be much point. */ returnVal = pstrdup(passwd); return returnVal; } #endif /* USE_PAM */ /* * Tell the user the authentication failed. */ static void auth_failed(POOL_CONNECTION * frontend) { int messagelen; char *errmessage; messagelen = strlen(frontend->username) + 100; errmessage = (char *) palloc(messagelen + 1); switch (frontend->pool_hba->auth_method) { case uaImplicitReject: case uaReject: snprintf(errmessage, messagelen, "authentication with pgpool failed for user \"%s\": host rejected", frontend->username); break; /* case uaKrb4: */ /* snprintf(errmessage, messagelen, */ /* "Kerberos 4 authentication with pgpool failed for user \"%s\"", */ /* frontend->username); */ /* break; */ /* case uaKrb5: */ /* snprintf(errmessage, messagelen, */ /* "Kerberos 5 authentication with pgpool failed for user \"%s\"", */ /* frontend->username); */ /* break; */ case uaTrust: snprintf(errmessage, messagelen, "\"trust\" authentication with pgpool failed for user \"%s\"", frontend->username); break; /* case uaIdent: */ /* snprintf(errmessage, messagelen, */ /* "Ident authentication with pgpool failed for user \"%s\"", */ /* frontend->username); */ /* break; */ case uaMD5: snprintf(errmessage, messagelen, "\"MD5\" authentication with pgpool failed for user \"%s\"", frontend->username); break; case uaSCRAM: snprintf(errmessage, messagelen, "\"SCRAM\" authentication with pgpool failed for user \"%s\"", frontend->username); break; case uaCert: snprintf(errmessage, messagelen, "\"CERT\" authentication with pgpool failed for user \"%s\"", frontend->username); break; /* case uaCrypt: */ /* case uaPassword: */ /* snprintf(errmessage, messagelen, */ /* "password authentication with pgpool failed for user \"%s\"", */ /* frontend->username); */ /* break; */ #ifdef USE_PAM case uaPAM: snprintf(errmessage, messagelen, "PAM authentication with pgpool failed for user \"%s\"", frontend->username); break; #endif /* USE_PAM */ default: snprintf(errmessage, messagelen, "authentication with pgpool failed for user \"%s\": invalid authentication method", frontend->username); break; } close_all_backend_connections(); ereport(FATAL, (return_code(2), errmsg("client authentication failed"), errdetail("%s", errmessage), errhint("see pgpool log for details"))); } /* * Close all of the cached backend connections. * * This is exactly the same as send_frontend_exits() in child.c. */ static void close_all_backend_connections(void) { int i; POOL_CONNECTION_POOL *p = pool_connection_pool; pool_sigset_t oldmask; POOL_SETMASK2(&BlockSig, &oldmask); for (i = 0; i < pool_config->max_pool; i++, p++) { if (!MASTER_CONNECTION(p)) continue; if (MASTER_CONNECTION(p)->sp->user == NULL) continue; pool_send_frontend_exits(p); } POOL_SETMASK(&oldmask); } /* * Determine what authentication method should be used when accessing database * "database" from frontend "raddr", user "user". Return the method and * an optional argument (stored in fields of *frontend), and true for success. * * Note that false indicates a problem with the hba config file. * If the file is OK but does not contain any entry matching the request, * we return true and method = uaReject. */ static bool hba_getauthmethod(POOL_CONNECTION * frontend) { if (check_hba(frontend)) return true; else return false; } /* * Scan the pre-parsed hba file, looking for a match to the port's connection * request. */ static bool check_hba(POOL_CONNECTION * frontend) { ListCell *line; HbaLine *hba; MemoryContext oldcxt; if (parsed_hba_lines == NULL) return false; foreach(line, parsed_hba_lines) { hba = (HbaLine *) lfirst(line); /* Check connection type */ if (hba->conntype == ctLocal) { if (!IS_AF_UNIX(frontend->raddr.addr.ss_family)) continue; } else { if (IS_AF_UNIX(frontend->raddr.addr.ss_family)) continue; /* Check SSL state */ #ifdef USE_SSL if (frontend->ssl) { /* Connection is SSL, match both "host" and "hostssl" */ if (hba->conntype == ctHostNoSSL) continue; } else #endif { /* Connection is not SSL, match both "host" and "hostnossl" */ if (hba->conntype == ctHostSSL) continue; } /* Check IP address */ switch (hba->ip_cmp_method) { case ipCmpMask: if (hba->hostname) { if (!check_hostname(frontend, hba->hostname)) continue; } else { if (!check_ip(&frontend->raddr, (struct sockaddr *) &hba->addr, (struct sockaddr *) &hba->mask)) continue; } break; case ipCmpAll: break; case ipCmpSameHost: case ipCmpSameNet: if (!check_same_host_or_net(&frontend->raddr, hba->ip_cmp_method)) continue; break; default: /* shouldn't get here, but deem it no-match if so */ continue; } } /* Check database and role */ if (!check_db(frontend->database, frontend->username, hba->databases)) continue; if (!check_user(frontend->username, hba->users)) continue; /* Found a record that matched! */ frontend->pool_hba = hba; return true; } /* If no matching entry was found, then implicitly reject. */ oldcxt = MemoryContextSwitchTo(ProcessLoopContext); hba = palloc0(sizeof(HbaLine)); MemoryContextSwitchTo(oldcxt); hba->auth_method = uaImplicitReject; frontend->pool_hba = hba; return true; } static bool ipv4eq(struct sockaddr_in *a, struct sockaddr_in *b) { return (a->sin_addr.s_addr == b->sin_addr.s_addr); } static bool ipv6eq(struct sockaddr_in6 *a, struct sockaddr_in6 *b) { int i; for (i = 0; i < 16; i++) if (a->sin6_addr.s6_addr[i] != b->sin6_addr.s6_addr[i]) return false; return true; } /* * Check whether host name matches pattern. */ static bool hostname_match(const char *pattern, const char *actual_hostname) { if (pattern[0] == '.') /* suffix match */ { size_t plen = strlen(pattern); size_t hlen = strlen(actual_hostname); if (hlen < plen) return false; return (strcasecmp(pattern, actual_hostname + (hlen - plen)) == 0); } else return (strcasecmp(pattern, actual_hostname) == 0); } /* * Check to see if a connecting IP matches a given host name. */ static bool check_hostname(POOL_CONNECTION * frontend, const char *hostname) { struct addrinfo *gai_result, *gai; int ret; bool found; /* Quick out if remote host name already known bad */ if (frontend->remote_hostname_resolv < 0) return false; /* Lookup remote host name if not already done */ if (!frontend->remote_hostname) { char remote_hostname[NI_MAXHOST]; ret = getnameinfo_all(&frontend->raddr.addr, frontend->raddr.salen, remote_hostname, sizeof(remote_hostname), NULL, 0, NI_NAMEREQD); if (ret != 0) { /* remember failure; don't complain in the Pgpool-II log yet */ frontend->remote_hostname_resolv = -2; /* frontend->remote_hostname_errcode = ret; */ return false; } frontend->remote_hostname = pstrdup(remote_hostname); } /* Now see if remote host name matches this pg_hba line */ if (!hostname_match(hostname, frontend->remote_hostname)) return false; /* If we already verified the forward lookup, we're done */ if (frontend->remote_hostname_resolv == +1) return true; /* Lookup IP from host name and check against original IP */ ret = getaddrinfo(frontend->remote_hostname, NULL, NULL, &gai_result); if (ret != 0) { /* remember failure; don't complain in the postmaster log yet */ frontend->remote_hostname_resolv = -2; /* frontend->remote_hostname_errcode = ret; */ return false; } found = false; for (gai = gai_result; gai; gai = gai->ai_next) { if (gai->ai_addr->sa_family == frontend->raddr.addr.ss_family) { if (gai->ai_addr->sa_family == AF_INET) { if (ipv4eq((struct sockaddr_in *) gai->ai_addr, (struct sockaddr_in *) &frontend->raddr.addr)) { found = true; break; } } else if (gai->ai_addr->sa_family == AF_INET6) { if (ipv6eq((struct sockaddr_in6 *) gai->ai_addr, (struct sockaddr_in6 *) &frontend->raddr.addr)) { found = true; break; } } } } if (gai_result) freeaddrinfo(gai_result); if (!found) ereport(DEBUG2, (errmsg("pool_hba.conf host name \"%s\" rejected because address resolution did not return a match with IP address of client", hostname))); frontend->remote_hostname_resolv = found ? +1 : -1; return found; } /* * pg_foreach_ifaddr callback: does client addr match this machine interface? */ static void check_network_callback(struct sockaddr *addr, struct sockaddr *netmask, void *cb_data) { check_network_data *cn = (check_network_data *) cb_data; struct sockaddr_storage mask; /* Already found a match? */ if (cn->result) return; if (cn->method == ipCmpSameHost) { /* Make an all-ones netmask of appropriate length for family */ SockAddr_cidr_mask(&mask, NULL, addr->sa_family); cn->result = check_ip(cn->raddr, addr, (struct sockaddr *) &mask); } else { /* Use the netmask of the interface itself */ cn->result = check_ip(cn->raddr, addr, netmask); } } /* * Use pg_foreach_ifaddr to check a samehost or samenet match */ static bool check_same_host_or_net(SockAddr *raddr, IPCompareMethod method) { check_network_data cn; cn.method = method; cn.raddr = raddr; cn.result = false; errno = 0; if (pg_foreach_ifaddr(check_network_callback, &cn) < 0) { elog(LOG, "error enumerating network interfaces: %m"); return false; } return cn.result; } /* * Check to see if a connecting IP matches the given address and netmask. */ static bool check_ip(SockAddr *raddr, struct sockaddr *addr, struct sockaddr *mask) { if (raddr->addr.ss_family == addr->sa_family && rangeSockAddr(&raddr->addr, (struct sockaddr_storage *) addr, (struct sockaddr_storage *) mask)) return true; return false; } /* * Check comma user list for a specific user, handle group names. */ static bool check_user(char *user, List *tokens) { ListCell *cell; HbaToken *tok; foreach(cell, tokens) { tok = lfirst(cell); if (!tok->quoted && tok->string[0] == '+') { /* * pgpool cannot accept groups. commented lines below are the * original code. */ ereport(LOG, (errmsg("group token \"+\" is not supported by Pgpool-II"))); return false; } else if (token_matches(tok, user) || token_is_keyword(tok, "all")) return true; } return false; } /* * Check to see if db/user combination matches param string. */ static bool check_db(const char *dbname, const char *user, List *tokens) { ListCell *cell; HbaToken *tok; foreach(cell, tokens) { tok = lfirst(cell); if (token_is_keyword(tok, "all")) return true; else if (token_is_keyword(tok, "sameuser")) { if (strcmp(dbname, user) == 0) return true; } else if (token_is_keyword(tok, "samegroup") || token_is_keyword(tok, "samerole")) { ereport(LOG, (errmsg("group tokens \"samegroup\" and \"samerole\" are not supported by Pgpool-II"))); return false; } else if (token_matches(tok, dbname)) return true; } return false; } /* * tokenize_inc_file * Expand a file included from another file into an hba "field" * * Opens and tokenises a file included from another HBA config file with @, * and returns all values found therein as a flat list of HbaTokens. If a * @-token is found, recursively expand it. The newly read tokens are * appended to "tokens" (so that foo,bar,@baz does what you expect). * All new tokens are allocated in caller's memory context. * * In event of an error, log a message at ereport level elevel, and also * set *err_msg to a string describing the error. Note that the result * may be non-NIL anyway, so *err_msg must be tested to determine whether * there was an error. */ static List * tokenize_inc_file(List *tokens, const char *outer_filename, const char *inc_filename, int elevel, char **err_msg) { char *inc_fullname; FILE *inc_file; List *inc_lines; ListCell *inc_line; MemoryContext linecxt; if (is_absolute_path(inc_filename)) { /* absolute path is taken as-is */ inc_fullname = pstrdup(inc_filename); } else { /* relative path is relative to dir of calling file */ inc_fullname = (char *) palloc(strlen(outer_filename) + 1 + strlen(inc_filename) + 1); strcpy(inc_fullname, outer_filename); get_parent_directory(inc_fullname); join_path_components(inc_fullname, inc_fullname, inc_filename); canonicalize_path(inc_fullname); } inc_file = fopen(inc_fullname, "r"); if (inc_file == NULL) { int save_errno = errno; ereport(elevel, (errmsg("could not open secondary authentication file \"@%s\" as \"%s\": %m", inc_filename, inc_fullname))); *err_msg = psprintf("could not open secondary authentication file \"@%s\" as \"%s\": %s", inc_filename, inc_fullname, strerror(save_errno)); pfree(inc_fullname); return tokens; } /* There is possible recursion here if the file contains @ */ linecxt = tokenize_file(inc_fullname, inc_file, &inc_lines, elevel); fclose(inc_file); /* Copy all tokens found in the file and append to the tokens list */ foreach(inc_line, inc_lines) { TokenizedLine *tok_line = (TokenizedLine *) lfirst(inc_line); ListCell *inc_field; /* If any line has an error, propagate that up to caller */ if (tok_line->err_msg) { *err_msg = pstrdup(tok_line->err_msg); break; } foreach(inc_field, tok_line->fields) { List *inc_tokens = lfirst(inc_field); ListCell *inc_token; foreach(inc_token, inc_tokens) { HbaToken *token = lfirst(inc_token); tokens = lappend(tokens, copy_hba_token(token)); } } } MemoryContextDelete(linecxt); return tokens; } /* * isblank() exists in the ISO C99 spec, but it's not very portable yet, * so provide our own version. */ static bool pg_isblank(const char c) { return c == ' ' || c == '\t' || c == '\r'; } /* * Tokenize the given file. * * The output is a list of TokenizedLine structs; see struct definition above. * * filename: the absolute path to the target file * file: the already-opened target file * tok_lines: receives output list * elevel: message logging level * * Errors are reported by logging messages at ereport level elevel and by * adding TokenizedLine structs containing non-null err_msg fields to the * output list. * * Return value is a memory context which contains all memory allocated by * this function (it's a child of caller's context). */ static MemoryContext tokenize_file(const char *filename, FILE *file, List **tok_lines, int elevel) { int line_number = 1; MemoryContext linecxt; MemoryContext oldcxt; linecxt = AllocSetContextCreate(CurrentMemoryContext, "tokenize_file", ALLOCSET_SMALL_SIZES); oldcxt = MemoryContextSwitchTo(linecxt); *tok_lines = NIL; while (!feof(file) && !ferror(file)) { char rawline[MAX_LINE]; char *lineptr; List *current_line = NIL; char *err_msg = NULL; if (!fgets(rawline, sizeof(rawline), file)) { int save_errno = errno; if (!ferror(file)) break; /* normal EOF */ /* I/O error! */ ereport(elevel, (errmsg("could not read file \"%s\": %m", filename))); err_msg = psprintf("could not read file \"%s\": %s", filename, strerror(save_errno)); rawline[0] = '\0'; } if (strlen(rawline) == MAX_LINE - 1) { /* Line too long! */ ereport(elevel, (errcode(ERRCODE_CONFIG_FILE_ERROR), errmsg("authentication file line too long"), errcontext("line %d of configuration file \"%s\"", line_number, filename))); err_msg = "authentication file line too long"; } /* Strip trailing linebreak from rawline */ lineptr = rawline + strlen(rawline) - 1; while (lineptr >= rawline && (*lineptr == '\n' || *lineptr == '\r')) *lineptr-- = '\0'; /* Parse fields */ lineptr = rawline; while (*lineptr && err_msg == NULL) { List *current_field; current_field = next_field_expand(filename, &lineptr, elevel, &err_msg); /* add field to line, unless we are at EOL or comment start */ if (current_field != NIL) current_line = lappend(current_line, current_field); } /* Reached EOL; emit line to TokenizedLine list unless it's boring */ if (current_line != NIL || err_msg != NULL) { TokenizedLine *tok_line; tok_line = (TokenizedLine *) palloc(sizeof(TokenizedLine)); tok_line->fields = current_line; tok_line->line_num = line_number; tok_line->raw_line = pstrdup(rawline); tok_line->err_msg = err_msg; *tok_lines = lappend(*tok_lines, tok_line); } line_number++; } MemoryContextSwitchTo(oldcxt); return linecxt; } /* * Tokenize one HBA field from a line, handling file inclusion and comma lists. * * filename: current file's pathname (needed to resolve relative pathnames) * *lineptr: current line pointer, which will be advanced past field * * In event of an error, log a message at ereport level elevel, and also * set *err_msg to a string describing the error. Note that the result * may be non-NIL anyway, so *err_msg must be tested to determine whether * there was an error. * * The result is a List of HbaToken structs, one for each token in the field, * or NIL if we reached EOL. */ static List * next_field_expand(const char *filename, char **lineptr, int elevel, char **err_msg) { char buf[MAX_TOKEN]; bool trailing_comma; bool initial_quote; List *tokens = NIL; do { if (!next_token(lineptr, buf, sizeof(buf), &initial_quote, &trailing_comma, elevel, err_msg)) break; /* Is this referencing a file? */ if (!initial_quote && buf[0] == '@' && buf[1] != '\0') tokens = tokenize_inc_file(tokens, filename, buf + 1, elevel, err_msg); else tokens = lappend(tokens, make_hba_token(buf, initial_quote)); } while (trailing_comma && (*err_msg == NULL)); return tokens; } /* * Grab one token out of the string pointed to by *lineptr. * * Tokens are strings of non-blank * characters bounded by blank characters, commas, beginning of line, and * end of line. Blank means space or tab. Tokens can be delimited by * double quotes (this allows the inclusion of blanks, but not newlines). * Comments (started by an unquoted '#') are skipped. * * The token, if any, is returned at *buf (a buffer of size bufsz), and * *lineptr is advanced past the token. * * Also, we set *initial_quote to indicate whether there was quoting before * the first character. (We use that to prevent "@x" from being treated * as a file inclusion request. Note that @"x" should be so treated; * we want to allow that to support embedded spaces in file paths.) * * We set *terminating_comma to indicate whether the token is terminated by a * comma (which is not returned). * * In event of an error, log a message at ereport level elevel, and also * set *err_msg to a string describing the error. Currently the only * possible error is token too long for buf. * * If successful: store null-terminated token at *buf and return TRUE. * If no more tokens on line: set *buf = '\0' and return FALSE. * If error: fill buf with truncated or misformatted token and return FALSE. */ static bool next_token(char **lineptr, char *buf, int bufsz, bool *initial_quote, bool *terminating_comma, int elevel, char **err_msg) { int c; char *start_buf = buf; char *end_buf = buf + (bufsz - 1); bool in_quote = false; bool was_quote = false; bool saw_quote = false; Assert(end_buf > start_buf); *initial_quote = false; *terminating_comma = false; /* Move over any whitespace and commas preceding the next token */ while ((c = (*(*lineptr)++)) != '\0' && (pg_isblank(c) || c == ',')) ; /* * Build a token in buf of next characters up to EOL, unquoted comma, or * unquoted whitespace. */ while (c != '\0' && (!pg_isblank(c) || in_quote)) { /* skip comments to EOL */ if (c == '#' && !in_quote) { while ((c = (*(*lineptr)++)) != '\0') ; break; } if (buf >= end_buf) { *buf = '\0'; ereport(elevel, (errcode(ERRCODE_CONFIG_FILE_ERROR), errmsg("authentication file token too long, skipping: \"%s\"", start_buf))); *err_msg = "authentication file token too long"; /* Discard remainder of line */ while ((c = (*(*lineptr)++)) != '\0') ; /* Un-eat the '\0', in case we're called again */ (*lineptr)--; return false; } /* we do not pass back a terminating comma in the token */ if (c == ',' && !in_quote) { *terminating_comma = true; break; } if (c != '"' || was_quote) *buf++ = c; /* Literal double-quote is two double-quotes */ if (in_quote && c == '"') was_quote = !was_quote; else was_quote = false; if (c == '"') { in_quote = !in_quote; saw_quote = true; if (buf == start_buf) *initial_quote = true; } c = *(*lineptr)++; } /* * Un-eat the char right after the token (critical in case it is '\0', * else next call will read past end of string). */ (*lineptr)--; *buf = '\0'; return (saw_quote || buf > start_buf); } /* * Construct a palloc'd HbaToken struct, copying the given string. */ static HbaToken * make_hba_token(const char *token, bool quoted) { HbaToken *hbatoken; int toklen; toklen = strlen(token); /* we copy string into same palloc block as the struct */ hbatoken = (HbaToken *) palloc(sizeof(HbaToken) + toklen + 1); hbatoken->string = (char *) hbatoken + sizeof(HbaToken); hbatoken->quoted = quoted; memcpy(hbatoken->string, token, toklen + 1); return hbatoken; } /* * Copy a HbaToken struct into freshly palloc'd memory. */ static HbaToken * copy_hba_token(HbaToken *in) { HbaToken *out = make_hba_token(in->string, in->quoted); return out; } #ifdef USE_PAM /* * PAM conversation function */ static int pam_passwd_conv_proc(int num_msg, const struct pam_message **msg, struct pam_response **resp, void *appdata_ptr) { if (num_msg != 1 || msg[0]->msg_style != PAM_PROMPT_ECHO_OFF) { switch (msg[0]->msg_style) { case PAM_ERROR_MSG: ereport(LOG, (errmsg("PAM Error"), errdetail("error from underlying PAM layer: %s", msg[0]->msg))); return PAM_CONV_ERR; default: ereport(LOG, (errmsg("PAM Error"), errdetail("unsupported PAM conversation %d/%s", msg[0]->msg_style, msg[0]->msg))); return PAM_CONV_ERR; } } if (!appdata_ptr) { /* * Workaround for Solaris 2.6 where the PAM library is broken and does * not pass appdata_ptr to the conversation routine */ appdata_ptr = pam_passwd; } /* * Password wasn't passed to PAM the first time around - let's go ask the * client to send a password, which we then stuff into PAM. */ if (strlen(appdata_ptr) == 0) { char *passwd; sendAuthRequest(pam_frontend_kludge, AUTH_REQ_PASSWORD); passwd = recv_password_packet(pam_frontend_kludge); if (passwd == NULL) return PAM_CONV_ERR; /* client didn't want to send password */ if (strlen(passwd) == 0) { ereport(LOG, (errmsg("PAM Error"), errdetail("empty password returned by client"))); return PAM_CONV_ERR; } appdata_ptr = passwd; } /* * PAM will free this memory in * pam_end() Do not use Palloc and freinds * to allocate this memory, Since the PAM library will be freeing this * memory who knowns nothing about our MemoryManager */ *resp = calloc(num_msg, sizeof(struct pam_response)); (*resp)[0].resp = strdup((char *) appdata_ptr); (*resp)[0].resp_retcode = 0; return ((*resp)[0].resp ? PAM_SUCCESS : PAM_CONV_ERR); } /* * Check authentication against PAM. */ static POOL_STATUS CheckPAMAuth(POOL_CONNECTION * frontend, char *user, char *password) { int retval; pam_handle_t *pamh = NULL; /* * Apparently, Solaris 2.6 is broken, and needs ugly static variable * workaround */ pam_passwd = password; /* * Set the application data portion of the conversation struct This is * later used inside the PAM conversation to pass the password to the * authentication module. */ pam_passw_conv.appdata_ptr = (char *) password; /* from password above, * not allocated */ /* Optionally, one can set the service name in pool_hba.conf */ if (frontend->pool_hba->pamservice && frontend->pool_hba->pamservice[0] != '\0') retval = pam_start(frontend->pool_hba->pamservice, "pgpool@", &pam_passw_conv, &pamh); else retval = pam_start(PGPOOL_PAM_SERVICE, "pgpool@", &pam_passw_conv, &pamh); if (retval != PAM_SUCCESS) { pam_passwd = NULL; /* Unset pam_passwd */ ereport(FATAL, (return_code(2), errmsg("failed authentication against PAM"), errdetail("unable to create PAM authenticator: %s", pam_strerror(pamh, retval)))); } retval = pam_set_item(pamh, PAM_USER, user); if (retval != PAM_SUCCESS) { pam_passwd = NULL; /* Unset pam_passwd */ ereport(FATAL, (return_code(2), errmsg("failed authentication against PAM"), errdetail("pam_set_item(PAM_USER) failed: %s", pam_strerror(pamh, retval)))); } retval = pam_set_item(pamh, PAM_CONV, &pam_passw_conv); if (retval != PAM_SUCCESS) { pam_passwd = NULL; /* Unset pam_passwd */ ereport(FATAL, (return_code(2), errmsg("failed authentication against PAM"), errdetail("pam_set_item(PAM_CONV) failed: %s", pam_strerror(pamh, retval)))); } retval = pam_authenticate(pamh, 0); if (retval != PAM_SUCCESS) /* service name does not exist */ { pam_passwd = NULL; /* Unset pam_passwd */ ereport(FATAL, (return_code(2), errmsg("failed authentication against PAM"), errdetail("pam_authenticate failed: %s", pam_strerror(pamh, retval)))); } retval = pam_acct_mgmt(pamh, 0); if (retval != PAM_SUCCESS) { pam_passwd = NULL; /* Unset pam_passwd */ ereport(FATAL, (return_code(2), errmsg("failed authentication against PAM"), errdetail("system call pam_acct_mgmt failed : %s", pam_strerror(pamh, retval)))); } retval = pam_end(pamh, retval); if (retval != PAM_SUCCESS) { ereport(FATAL, (return_code(2), errmsg("failed authentication against PAM"), errdetail("unable to release PAM authenticator: %s", pam_strerror(pamh, retval)))); } pam_passwd = NULL; return POOL_CONTINUE; } #endif /* USE_PAM */ #ifdef NOT_USED static POOL_STATUS CheckUserExist(char *username) { char *passwd; /* Look for the entry in pool_passwd */ passwd = pool_get_passwd(username); if (passwd == NULL) return POOL_ERROR; /* * Ok for now. Actual authentication will be performed later. */ return POOL_CONTINUE; } #endif pgpool-II-4.1.4/src/auth/auth-scram.c0000664000175000017500000013361413730350127014213 00000000000000/* -*-pgsql-c-*- */ /* * $Header$ * * pgpool: a language independent connection pool server for PostgreSQL * written by Tatsuo Ishii * * Copyright (c) 2003-2018 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. * * auth_scram.c: SCRAM authentication stuff * borrowed from PostgreSQL source src/backend/libpq/auth-scram.c * */ /*------------------------------------------------------------------------- * * auth-scram.c * Server-side implementation of the SASL SCRAM-SHA-256 mechanism. * * See the following RFCs for more details: * - RFC 5802: https://tools.ietf.org/html/rfc5802 * - RFC 5803: https://tools.ietf.org/html/rfc5803 * - RFC 7677: https://tools.ietf.org/html/rfc7677 * * Here are some differences: * * - Username from the authentication exchange is not used. The client * should send an empty string as the username. * * - If the password isn't valid UTF-8, or contains characters prohibited * by the SASLprep profile, we skip the SASLprep pre-processing and use * the raw bytes in calculating the hash. * * - Channel binding is not supported yet. * * * The password stored in pg_authid consists of the iteration count, salt, * StoredKey and ServerKey. * * SASLprep usage * -------------- * * One notable difference to the SCRAM specification is that while the * specification dictates that the password is in UTF-8, and prohibits * certain characters, we are more lenient. If the password isn't a valid * UTF-8 string, or contains prohibited characters, the raw bytes are used * to calculate the hash instead, without SASLprep processing. This is * because PostgreSQL supports other encodings too, and the encoding being * used during authentication is undefined (client_encoding isn't set until * after authentication). In effect, we try to interpret the password as * UTF-8 and apply SASLprep processing, but if it looks invalid, we assume * that it's in some other encoding. * * In the worst case, we misinterpret a password that's in a different * encoding as being Unicode, because it happens to consists entirely of * valid UTF-8 bytes, and we apply Unicode normalization to it. As long * as we do that consistently, that will not lead to failed logins. * Fortunately, the UTF-8 byte sequences that are ignored by SASLprep * don't correspond to any commonly used characters in any of the other * supported encodings, so it should not lead to any significant loss in * entropy, even if the normalization is incorrectly applied to a * non-UTF-8 password. * * Error handling * -------------- * * Don't reveal user information to an unauthenticated client. We don't * want an attacker to be able to probe whether a particular username is * valid. In SCRAM, the server has to read the salt and iteration count * from the user's password verifier, and send it to the client. To avoid * revealing whether a user exists, when the client tries to authenticate * with a username that doesn't exist, or doesn't have a valid SCRAM * verifier in pg_authid, we create a fake salt and iteration count * on-the-fly, and proceed with the authentication with that. In the end, * we'll reject the attempt, as if an incorrect password was given. When * we are performing a "mock" authentication, the 'doomed' flag in * scram_state is set. * * In the error messages, avoid printing strings from the client, unless * you check that they are pure ASCII. We don't want an unauthenticated * attacker to be able to spam the logs with characters that are not valid * to the encoding being used, whatever that is. We cannot avoid that in * general, after logging in, but let's do what we can here. * * * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/backend/libpq/auth-scram.c * *------------------------------------------------------------------------- */ #include #include #include #include "pool.h" #include "auth/scram-common.h" #include "utils/sha2.h" #include "auth/pool_passwd.h" #include "auth/scram.h" #include "utils/base64.h" #include "utils/elog.h" #include "utils/palloc.h" #include "utils/memutils.h" #include "parser/stringinfo.h" #include "utils/palloc.h" #include "utils/elog.h" #include "utils/memutils.h" #define MOCK_AUTH_NONCE_LEN 32 typedef enum { FE_SCRAM_INIT, FE_SCRAM_NONCE_SENT, FE_SCRAM_PROOF_SENT, FE_SCRAM_FINISHED } fe_scram_state_enum; typedef struct { fe_scram_state_enum state; /* These are supplied by the user */ const char *username; char *password; /* We construct these */ uint8 SaltedPassword[SCRAM_KEY_LEN]; char *client_nonce; char *client_first_message_bare; char *client_final_message_without_proof; /* These come from the server-first message */ char *server_first_message; char *salt; int saltlen; int iterations; char *nonce; /* These come from the server-final message */ char *server_final_message; char ServerSignature[SCRAM_KEY_LEN]; } fe_scram_state; /* * Status data for a SCRAM authentication exchange. This should be kept * internal to this file. */ typedef enum { SCRAM_AUTH_INIT, SCRAM_AUTH_SALT_SENT, SCRAM_AUTH_FINISHED } scram_state_enum; typedef struct { scram_state_enum state; const char *username; /* username from startup packet */ char cbind_flag; int iterations; char *salt; /* base64-encoded */ uint8 StoredKey[SCRAM_KEY_LEN]; uint8 ServerKey[SCRAM_KEY_LEN]; /* Fields of the first message from client */ char *client_first_message_bare; char *client_username; char *client_nonce; /* Fields from the last message from client */ char *client_final_message_without_proof; char *client_final_nonce; char ClientProof[SCRAM_KEY_LEN]; /* Fields generated in the server */ char *server_first_message; char *server_nonce; /* * If something goes wrong during the authentication, or we are performing * a "mock" authentication (see comments at top of file), the 'doomed' * flag is set. A reason for the failure, for the server log, is put in * 'logdetail'. */ bool doomed; char *logdetail; } scram_state; static bool read_server_first_message(fe_scram_state *state, char *input); static bool read_server_final_message(fe_scram_state *state, char *input); static char *build_client_first_message(fe_scram_state *state); static char *build_client_final_message(fe_scram_state *state); static bool verify_server_signature(fe_scram_state *state); static void calculate_client_proof(fe_scram_state *state, const char *client_final_message_without_proof, uint8 *result); static void read_client_first_message(scram_state *state, char *input); static void read_client_final_message(scram_state *state, char *input); static char *build_server_first_message(scram_state *state); static char *build_server_final_message(scram_state *state); static bool verify_client_proof(scram_state *state); static bool verify_final_nonce(scram_state *state); static bool parse_scram_verifier(const char *verifier, int *iterations, char **salt, uint8 *stored_key, uint8 *server_key); static void mock_scram_verifier(const char *username, int *iterations, char **salt, uint8 *stored_key, uint8 *server_key); static bool is_scram_printable(char *p); static char *sanitize_char(char c); static char *GetMockAuthenticationNonce(void); static char *scram_mock_salt(const char *username); /* * pg_be_scram_init * * Initialize a new SCRAM authentication exchange status tracker. This * needs to be called before doing any exchange. It will be filled later * after the beginning of the exchange with verifier data. * * 'username' is the username provided by the client in the startup message. * 'shadow_pass' is the role's password verifier, from pg_authid.rolpassword. * If 'shadow_pass' is NULL, we still perform an authentication exchange, but * it will fail, as if an incorrect password was given. */ void * pg_be_scram_init(const char *username, const char *shadow_pass) { scram_state *state; bool got_verifier; state = (scram_state *) palloc0(sizeof(scram_state)); state->state = SCRAM_AUTH_INIT; state->username = username; /* * Parse the stored password verifier. */ if (shadow_pass) { int password_type = get_password_type(shadow_pass); if (password_type == PASSWORD_TYPE_SCRAM_SHA_256) { if (parse_scram_verifier(shadow_pass, &state->iterations, &state->salt, state->StoredKey, state->ServerKey)) got_verifier = true; else { /* * The password looked like a SCRAM verifier, but could not be * parsed. */ ereport(LOG, (errmsg("invalid SCRAM verifier for user \"%s\"", username))); got_verifier = false; } } else { /* * The user doesn't have SCRAM verifier. (You cannot do SCRAM * authentication with an MD5 hash.) */ state->logdetail = psprintf(_("User \"%s\" does not have a valid SCRAM verifier."), state->username); got_verifier = false; } } else { /* * The caller requested us to perform a dummy authentication. This is * considered normal, since the caller requested it, so don't set log * detail. */ got_verifier = false; } /* * If the user did not have a valid SCRAM verifier, we still go through * the motions with a mock one, and fail as if the client supplied an * incorrect password. This is to avoid revealing information to an * attacker. */ if (!got_verifier) { mock_scram_verifier(username, &state->iterations, &state->salt, state->StoredKey, state->ServerKey); state->doomed = true; } return state; } /* * Continue a SCRAM authentication exchange. * * 'input' is the SCRAM payload sent by the client. On the first call, * 'input' contains the "Initial Client Response" that the client sent as * part of the SASLInitialResponse message, or NULL if no Initial Client * Response was given. (The SASL specification distinguishes between an * empty response and non-existing one.) On subsequent calls, 'input' * cannot be NULL. For convenience in this function, the caller must * ensure that there is a null terminator at input[inputlen]. * * The next message to send to client is saved in 'output', for a length * of 'outputlen'. In the case of an error, optionally store a palloc'd * string at *logdetail that will be sent to the postmaster log (but not * the client). */ int pg_be_scram_exchange(void *opaq, char *input, int inputlen, char **output, int *outputlen, char **logdetail) { scram_state *state = (scram_state *) opaq; int result; *output = NULL; /* * If the client didn't include an "Initial Client Response" in the * SASLInitialResponse message, send an empty challenge, to which the * client will respond with the same data that usually comes in the * Initial Client Response. */ if (input == NULL) { Assert(state->state == SCRAM_AUTH_INIT); *output = pstrdup(""); *outputlen = 0; return SASL_EXCHANGE_CONTINUE; } /* * Check that the input length agrees with the string length of the input. * We can ignore inputlen after this. */ if (inputlen == 0) ereport(ERROR, (errcode(ERRCODE_PROTOCOL_VIOLATION), errmsg("malformed SCRAM message"), errdetail("The message is empty."))); if (inputlen != strlen(input)) ereport(ERROR, (errcode(ERRCODE_PROTOCOL_VIOLATION), errmsg("malformed SCRAM message"), errdetail("Message length does not match input length."))); switch (state->state) { case SCRAM_AUTH_INIT: /* * Initialization phase. Receive the first message from client * and be sure that it parsed correctly. Then send the challenge * to the client. */ read_client_first_message(state, input); /* prepare message to send challenge */ *output = build_server_first_message(state); state->state = SCRAM_AUTH_SALT_SENT; result = SASL_EXCHANGE_CONTINUE; break; case SCRAM_AUTH_SALT_SENT: /* * Final phase for the server. Receive the response to the * challenge previously sent, verify, and let the client know that * everything went well (or not). */ read_client_final_message(state, input); if (!verify_final_nonce(state)) ereport(ERROR, (errcode(ERRCODE_PROTOCOL_VIOLATION), errmsg("invalid SCRAM response"), errdetail("Nonce does not match."))); /* * Now check the final nonce and the client proof. * * If we performed a "mock" authentication that we knew would fail * from the get go, this is where we fail. * * The SCRAM specification includes an error code, * "invalid-proof", for authentication failure, but it also allows * erroring out in an application-specific way. We choose to do * the latter, so that the error message for invalid password is * the same for all authentication methods. The caller will call * ereport(), when we return SASL_EXCHANGE_FAILURE with no output. * * NB: the order of these checks is intentional. We calculate the * client proof even in a mock authentication, even though it's * bound to fail, to thwart timing attacks to determine if a role * with the given name exists or not. */ if (!verify_client_proof(state) || state->doomed) { result = SASL_EXCHANGE_FAILURE; break; } /* Build final message for client */ *output = build_server_final_message(state); /* Success! */ result = SASL_EXCHANGE_SUCCESS; state->state = SCRAM_AUTH_FINISHED; break; default: elog(ERROR, "invalid SCRAM exchange state"); result = SASL_EXCHANGE_FAILURE; } if (result == SASL_EXCHANGE_FAILURE && state->logdetail && logdetail) *logdetail = state->logdetail; if (*output) *outputlen = strlen(*output); return result; } /* * Construct a verifier string for SCRAM, stored in pg_authid.rolpassword. * * The result is palloc'd, so caller is responsible for freeing it. */ char * pg_be_scram_build_verifier(const char *password) { char saltbuf[SCRAM_DEFAULT_SALT_LEN]; char *result; /* Generate random salt */ pool_random(saltbuf, SCRAM_DEFAULT_SALT_LEN); result = scram_build_verifier(saltbuf, SCRAM_DEFAULT_SALT_LEN, SCRAM_DEFAULT_ITERATIONS, password); return result; } /* * Verify a plaintext password against a SCRAM verifier. This is used when * performing plaintext password authentication for a user that has a SCRAM * verifier stored in pg_authid. */ bool scram_verify_plain_password(const char *username, const char *password, const char *verifier) { char *encoded_salt; char *salt; int saltlen; int iterations; uint8 salted_password[SCRAM_KEY_LEN]; uint8 stored_key[SCRAM_KEY_LEN]; uint8 server_key[SCRAM_KEY_LEN]; uint8 computed_key[SCRAM_KEY_LEN]; if (!parse_scram_verifier(verifier, &iterations, &encoded_salt, stored_key, server_key)) { /* * The password looked like a SCRAM verifier, but could not be parsed. */ ereport(LOG, (errmsg("invalid SCRAM verifier for user \"%s\"", username))); return false; } salt = palloc(pg_b64_dec_len(strlen(encoded_salt))); saltlen = pg_b64_decode(encoded_salt, strlen(encoded_salt), salt); if (saltlen == -1) { ereport(LOG, (errmsg("invalid SCRAM verifier for user \"%s\"", username))); pfree(encoded_salt); pfree(salt); return false; } /* Compute Server Key based on the user-supplied plaintext password */ scram_SaltedPassword(password, salt, saltlen, iterations, salted_password); scram_ServerKey(salted_password, computed_key); /* * Compare the verifier's Server Key with the one computed from the * user-supplied password. */ pfree(encoded_salt); pfree(salt); return memcmp(computed_key, server_key, SCRAM_KEY_LEN) == 0; } /* * Parse and validate format of given SCRAM verifier. * * Returns true if the SCRAM verifier has been parsed, and false otherwise. */ static bool parse_scram_verifier(const char *verifier, int *iterations, char **salt, uint8 *stored_key, uint8 *server_key) { char *v; char *p; char *scheme_str; char *salt_str; char *iterations_str; char *storedkey_str; char *serverkey_str; int decoded_len; char *decoded_salt_buf; /* * The verifier is of form: * * SCRAM-SHA-256$:$: */ v = pstrdup(verifier); if ((scheme_str = strtok(v, "$")) == NULL) goto invalid_verifier; if ((iterations_str = strtok(NULL, ":")) == NULL) goto invalid_verifier; if ((salt_str = strtok(NULL, "$")) == NULL) goto invalid_verifier; if ((storedkey_str = strtok(NULL, ":")) == NULL) goto invalid_verifier; if ((serverkey_str = strtok(NULL, "")) == NULL) goto invalid_verifier; /* Parse the fields */ if (strcmp(scheme_str, "SCRAM-SHA-256") != 0) goto invalid_verifier; errno = 0; *iterations = strtol(iterations_str, &p, 10); if (*p || errno != 0) goto invalid_verifier; /* * Verify that the salt is in Base64-encoded format, by decoding it, * although we return the encoded version to the caller. */ decoded_salt_buf = palloc(pg_b64_dec_len(strlen(salt_str))); decoded_len = pg_b64_decode(salt_str, strlen(salt_str), decoded_salt_buf); pfree(decoded_salt_buf); if (decoded_len < 0) goto invalid_verifier; *salt = pstrdup(salt_str); /* * Decode StoredKey and ServerKey. */ if (pg_b64_dec_len(strlen(storedkey_str) != SCRAM_KEY_LEN)) goto invalid_verifier; decoded_len = pg_b64_decode(storedkey_str, strlen(storedkey_str), (char *) stored_key); if (decoded_len != SCRAM_KEY_LEN) goto invalid_verifier; if (pg_b64_dec_len(strlen(serverkey_str) != SCRAM_KEY_LEN)) goto invalid_verifier; decoded_len = pg_b64_decode(serverkey_str, strlen(serverkey_str), (char *) server_key); if (decoded_len != SCRAM_KEY_LEN) goto invalid_verifier; pfree(v); return true; invalid_verifier: pfree(v); *salt = NULL; return false; } static void mock_scram_verifier(const char *username, int *iterations, char **salt, uint8 *stored_key, uint8 *server_key) { char *raw_salt; char *encoded_salt; int encoded_len; /* Generate deterministic salt */ raw_salt = scram_mock_salt(username); encoded_salt = (char *) palloc(pg_b64_enc_len(SCRAM_DEFAULT_SALT_LEN) + 1); encoded_len = pg_b64_encode(raw_salt, SCRAM_DEFAULT_SALT_LEN, encoded_salt); encoded_salt[encoded_len] = '\0'; *salt = encoded_salt; *iterations = SCRAM_DEFAULT_ITERATIONS; /* StoredKey and ServerKey are not used in a doomed authentication */ memset(stored_key, 0, SCRAM_KEY_LEN); memset(server_key, 0, SCRAM_KEY_LEN); } /* * Read the value in a given SCRAM exchange message for given attribute. */ static char * read_attr_value(char **input, char attr) { char *begin = *input; char *end; if (*begin != attr) ereport(ERROR, (errcode(ERRCODE_PROTOCOL_VIOLATION), errmsg("malformed SCRAM message"), errdetail("Expected attribute \"%c\" but found \"%s\".", attr, sanitize_char(*begin)))); begin++; if (*begin != '=') ereport(ERROR, (errcode(ERRCODE_PROTOCOL_VIOLATION), errmsg("malformed SCRAM message"), errdetail("Expected character \"=\" for attribute \"%c\".", attr))); begin++; end = begin; while (*end && *end != ',') end++; if (*end) { *end = '\0'; *input = end + 1; } else *input = end; return begin; } static bool is_scram_printable(char *p) { /*------ * Printable characters, as defined by SCRAM spec: (RFC 5802) * * printable = %x21-2B / %x2D-7E * ;; Printable ASCII except ",". * ;; Note that any "printable" is also * ;; a valid "value". *------ */ for (; *p; p++) { if (*p < 0x21 || *p > 0x7E || *p == 0x2C /* comma */ ) return false; } return true; } /* * Convert an arbitrary byte to printable form. For error messages. * * If it's a printable ASCII character, print it as a single character. * otherwise, print it in hex. * * The returned pointer points to a static buffer. */ static char * sanitize_char(char c) { static char buf[5]; if (c >= 0x21 && c <= 0x7E) snprintf(buf, sizeof(buf), "'%c'", c); else snprintf(buf, sizeof(buf), "0x%02x", (unsigned char) c); return buf; } /* * Read the next attribute and value in a SCRAM exchange message. * * Returns NULL if there is attribute. */ static char * read_any_attr(char **input, char *attr_p) { char *begin = *input; char *end; char attr = *begin; /*------ * attr-val = ALPHA "=" value * ;; Generic syntax of any attribute sent * ;; by server or client *------ */ if (!((attr >= 'A' && attr <= 'Z') || (attr >= 'a' && attr <= 'z'))) ereport(ERROR, (errcode(ERRCODE_PROTOCOL_VIOLATION), errmsg("malformed SCRAM message"), errdetail("Attribute expected, but found invalid character \"%s\".", sanitize_char(attr)))); if (attr_p) *attr_p = attr; begin++; if (*begin != '=') ereport(ERROR, (errcode(ERRCODE_PROTOCOL_VIOLATION), errmsg("malformed SCRAM message"), errdetail("Expected character \"=\" for attribute \"%c\".", attr))); begin++; end = begin; while (*end && *end != ',') end++; if (*end) { *end = '\0'; *input = end + 1; } else *input = end; return begin; } /* * Read and parse the first message from client in the context of a SCRAM * authentication exchange message. * * At this stage, any errors will be reported directly with ereport(ERROR). */ static void read_client_first_message(scram_state *state, char *input) { input = pstrdup(input); /*------ * The syntax for the client-first-message is: (RFC 5802) * * saslname = 1*(value-safe-char / "=2C" / "=3D") * ;; Conforms to . * * authzid = "a=" saslname * ;; Protocol specific. * * cb-name = 1*(ALPHA / DIGIT / "." / "-") * ;; See RFC 5056, Section 7. * ;; E.g., "tls-server-end-point" or * ;; "tls-unique". * * gs2-cbind-flag = ("p=" cb-name) / "n" / "y" * ;; "n" -> client doesn't support channel binding. * ;; "y" -> client does support channel binding * ;; but thinks the server does not. * ;; "p" -> client requires channel binding. * ;; The selected channel binding follows "p=". * * gs2-header = gs2-cbind-flag "," [ authzid ] "," * ;; GS2 header for SCRAM * ;; (the actual GS2 header includes an optional * ;; flag to indicate that the GSS mechanism is not * ;; "standard", but since SCRAM is "standard", we * ;; don't include that flag). * * username = "n=" saslname * ;; Usernames are prepared using SASLprep. * * reserved-mext = "m=" 1*(value-char) * ;; Reserved for signaling mandatory extensions. * ;; The exact syntax will be defined in * ;; the future. * * nonce = "r=" c-nonce [s-nonce] * ;; Second part provided by server. * * c-nonce = printable * * client-first-message-bare = * [reserved-mext ","] * username "," nonce ["," extensions] * * client-first-message = * gs2-header client-first-message-bare * * For example: * n,,n=user,r=fyko+d2lbbFgONRv9qkxdawL * * The "n,," in the beginning means that the client doesn't support * channel binding, and no authzid is given. "n=user" is the username. * However, in PostgreSQL the username is sent in the startup packet, and * the username in the SCRAM exchange is ignored. libpq always sends it * as an empty string. The last part, "r=fyko+d2lbbFgONRv9qkxdawL" is * the client nonce. *------ */ /* read gs2-cbind-flag */ state->cbind_flag = *input; switch (*input) { case 'n': /* Client does not support channel binding */ input++; break; case 'y': /* Client supports channel binding, but we're not doing it today */ input++; break; case 'p': /* * Client requires channel binding. We don't support it. * * RFC 5802 specifies a particular error code, * e=server-does-support-channel-binding, for this. But it can * only be sent in the server-final message, and we don't want to * go through the motions of the authentication, knowing it will * fail, just to send that error message. */ ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), errmsg("client requires SCRAM channel binding, but it is not supported"))); default: ereport(ERROR, (errcode(ERRCODE_PROTOCOL_VIOLATION), errmsg("malformed SCRAM message"), errdetail("Unexpected channel-binding flag \"%s\".", sanitize_char(*input)))); } if (*input != ',') ereport(ERROR, (errcode(ERRCODE_PROTOCOL_VIOLATION), errmsg("malformed SCRAM message"), errdetail("Comma expected, but found character \"%s\".", sanitize_char(*input)))); input++; /* * Forbid optional authzid (authorization identity). We don't support it. */ if (*input == 'a') ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), errmsg("client uses authorization identity, but it is not supported"))); if (*input != ',') ereport(ERROR, (errcode(ERRCODE_PROTOCOL_VIOLATION), errmsg("malformed SCRAM message"), errdetail("Unexpected attribute \"%s\" in client-first-message.", sanitize_char(*input)))); input++; state->client_first_message_bare = pstrdup(input); /* * Any mandatory extensions would go here. We don't support any. * * RFC 5802 specifies error code "e=extensions-not-supported" for this, * but it can only be sent in the server-final message. We prefer to fail * immediately (which the RFC also allows). */ if (*input == 'm') ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), errmsg("client requires an unsupported SCRAM extension"))); /* * Read username. Note: this is ignored. We use the username from the * startup message instead, still it is kept around if provided as it * proves to be useful for debugging purposes. */ state->client_username = read_attr_value(&input, 'n'); /* read nonce and check that it is made of only printable characters */ state->client_nonce = read_attr_value(&input, 'r'); if (!is_scram_printable(state->client_nonce)) ereport(ERROR, (errcode(ERRCODE_PROTOCOL_VIOLATION), errmsg("non-printable characters in SCRAM nonce"))); /* * There can be any number of optional extensions after this. We don't * support any extensions, so ignore them. */ while (*input != '\0') read_any_attr(&input, NULL); /* success! */ } /* * Verify the final nonce contained in the last message received from * client in an exchange. */ static bool verify_final_nonce(scram_state *state) { int client_nonce_len = strlen(state->client_nonce); int server_nonce_len = strlen(state->server_nonce); int final_nonce_len = strlen(state->client_final_nonce); if (final_nonce_len != client_nonce_len + server_nonce_len) return false; if (memcmp(state->client_final_nonce, state->client_nonce, client_nonce_len) != 0) return false; if (memcmp(state->client_final_nonce + client_nonce_len, state->server_nonce, server_nonce_len) != 0) return false; return true; } /* * Verify the client proof contained in the last message received from * client in an exchange. */ static bool verify_client_proof(scram_state *state) { uint8 ClientSignature[SCRAM_KEY_LEN]; uint8 ClientKey[SCRAM_KEY_LEN]; uint8 client_StoredKey[SCRAM_KEY_LEN]; scram_HMAC_ctx ctx; int i; /* calculate ClientSignature */ scram_HMAC_init(&ctx, state->StoredKey, SCRAM_KEY_LEN); scram_HMAC_update(&ctx, state->client_first_message_bare, strlen(state->client_first_message_bare)); scram_HMAC_update(&ctx, ",", 1); scram_HMAC_update(&ctx, state->server_first_message, strlen(state->server_first_message)); scram_HMAC_update(&ctx, ",", 1); scram_HMAC_update(&ctx, state->client_final_message_without_proof, strlen(state->client_final_message_without_proof)); scram_HMAC_final(ClientSignature, &ctx); /* Extract the ClientKey that the client calculated from the proof */ for (i = 0; i < SCRAM_KEY_LEN; i++) ClientKey[i] = state->ClientProof[i] ^ ClientSignature[i]; /* Hash it one more time, and compare with StoredKey */ scram_H(ClientKey, SCRAM_KEY_LEN, client_StoredKey); if (memcmp(client_StoredKey, state->StoredKey, SCRAM_KEY_LEN) != 0) return false; return true; } /* * Build the first server-side message sent to the client in a SCRAM * communication exchange. */ static char * build_server_first_message(scram_state *state) { /*------ * The syntax for the server-first-message is: (RFC 5802) * * server-first-message = * [reserved-mext ","] nonce "," salt "," * iteration-count ["," extensions] * * nonce = "r=" c-nonce [s-nonce] * ;; Second part provided by server. * * c-nonce = printable * * s-nonce = printable * * salt = "s=" base64 * * iteration-count = "i=" posit-number * ;; A positive number. * * Example: * * r=fyko+d2lbbFgONRv9qkxdawL3rfcNHYJY1ZVvWVs7j,s=QSXCR+Q6sek8bf92,i=4096 *------ */ /* * Per the spec, the nonce may consist of any printable ASCII characters. * For convenience, however, we don't use the whole range available, * rather, we generate some random bytes, and base64 encode them. */ char raw_nonce[SCRAM_RAW_NONCE_LEN]; int encoded_len; pool_random(raw_nonce, SCRAM_RAW_NONCE_LEN); state->server_nonce = palloc(pg_b64_enc_len(SCRAM_RAW_NONCE_LEN) + 1); encoded_len = pg_b64_encode(raw_nonce, SCRAM_RAW_NONCE_LEN, state->server_nonce); state->server_nonce[encoded_len] = '\0'; state->server_first_message = psprintf("r=%s%s,s=%s,i=%u", state->client_nonce, state->server_nonce, state->salt, state->iterations); return pstrdup(state->server_first_message); } /* * Read and parse the final message received from client. */ static void read_client_final_message(scram_state *state, char *input) { char attr; char *channel_binding; char *value; char *begin, *proof; char *p; char *client_proof; begin = p = pstrdup(input); /*------ * The syntax for the server-first-message is: (RFC 5802) * * gs2-header = gs2-cbind-flag "," [ authzid ] "," * ;; GS2 header for SCRAM * ;; (the actual GS2 header includes an optional * ;; flag to indicate that the GSS mechanism is not * ;; "standard", but since SCRAM is "standard", we * ;; don't include that flag). * * cbind-input = gs2-header [ cbind-data ] * ;; cbind-data MUST be present for * ;; gs2-cbind-flag of "p" and MUST be absent * ;; for "y" or "n". * * channel-binding = "c=" base64 * ;; base64 encoding of cbind-input. * * proof = "p=" base64 * * client-final-message-without-proof = * channel-binding "," nonce ["," * extensions] * * client-final-message = * client-final-message-without-proof "," proof *------ */ /* * Read channel-binding. We don't support channel binding, so it's * expected to always be "biws", which is "n,,", base64-encoded, or * "eSws", which is "y,,". We also have to check whether the flag is the * same one that the client originally sent. */ channel_binding = read_attr_value(&p, 'c'); if (!(strcmp(channel_binding, "biws") == 0 && state->cbind_flag == 'n') && !(strcmp(channel_binding, "eSws") == 0 && state->cbind_flag == 'y')) ereport(ERROR, (errcode(ERRCODE_PROTOCOL_VIOLATION), (errmsg("unexpected SCRAM channel-binding attribute in client-final-message")))); state->client_final_nonce = read_attr_value(&p, 'r'); /* ignore optional extensions */ do { proof = p - 1; value = read_any_attr(&p, &attr); } while (attr != 'p'); client_proof = palloc(pg_b64_dec_len(strlen(value))); if (pg_b64_decode(value, strlen(value), client_proof) != SCRAM_KEY_LEN) ereport(ERROR, (errcode(ERRCODE_PROTOCOL_VIOLATION), errmsg("malformed SCRAM message"), errdetail("Malformed proof in client-final-message."))); memcpy(state->ClientProof, client_proof, SCRAM_KEY_LEN); pfree(client_proof); if (*p != '\0') ereport(ERROR, (errcode(ERRCODE_PROTOCOL_VIOLATION), errmsg("malformed SCRAM message"), errdetail("Garbage found at the end of client-final-message."))); state->client_final_message_without_proof = palloc(proof - begin + 1); memcpy(state->client_final_message_without_proof, input, proof - begin); state->client_final_message_without_proof[proof - begin] = '\0'; } /* * Build the final server-side message of an exchange. */ static char * build_server_final_message(scram_state *state) { uint8 ServerSignature[SCRAM_KEY_LEN]; char *server_signature_base64; int siglen; scram_HMAC_ctx ctx; char *res; /* calculate ServerSignature */ scram_HMAC_init(&ctx, state->ServerKey, SCRAM_KEY_LEN); scram_HMAC_update(&ctx, state->client_first_message_bare, strlen(state->client_first_message_bare)); scram_HMAC_update(&ctx, ",", 1); scram_HMAC_update(&ctx, state->server_first_message, strlen(state->server_first_message)); scram_HMAC_update(&ctx, ",", 1); scram_HMAC_update(&ctx, state->client_final_message_without_proof, strlen(state->client_final_message_without_proof)); scram_HMAC_final(ServerSignature, &ctx); server_signature_base64 = palloc(pg_b64_enc_len(SCRAM_KEY_LEN) + 1); siglen = pg_b64_encode((const char *) ServerSignature, SCRAM_KEY_LEN, server_signature_base64); server_signature_base64[siglen] = '\0'; /*------ * The syntax for the server-final-message is: (RFC 5802) * * verifier = "v=" base64 * ;; base-64 encoded ServerSignature. * * server-final-message = (server-error / verifier) * ["," extensions] * *------ */ res = psprintf("v=%s", server_signature_base64); pfree(server_signature_base64); return res; } /* * Determinisitcally generate salt for mock authentication, using a SHA256 * hash based on the username and a cluster-level secret key. Returns a * pointer to a static buffer of size SCRAM_DEFAULT_SALT_LEN. */ static char * GetMockAuthenticationNonce(void) { static char mockNonce[MOCK_AUTH_NONCE_LEN] = "pgpool-II random nonce string"; return mockNonce; } static char * scram_mock_salt(const char *username) { pg_sha256_ctx ctx; static uint8 sha_digest[PG_SHA256_DIGEST_LENGTH]; char *mock_auth_nonce = GetMockAuthenticationNonce(); /* * Generate salt using a SHA256 hash of the username and the cluster's * mock authentication nonce. (This works as long as the salt length is * not larger the SHA256 digest length. If the salt is smaller, the caller * will just ignore the extra data.) */ StaticAssertStmt(PG_SHA256_DIGEST_LENGTH >= SCRAM_DEFAULT_SALT_LEN, "salt length greater than SHA256 digest length"); pg_sha256_init(&ctx); pg_sha256_update(&ctx, (uint8 *) username, strlen(username)); pg_sha256_update(&ctx, (uint8 *) mock_auth_nonce, MOCK_AUTH_NONCE_LEN); pg_sha256_final(&ctx, sha_digest); return (char *) sha_digest; } /* scram client auth code */ /* * Initialize SCRAM exchange status. */ void * pg_fe_scram_init(const char *username, const char *password) { fe_scram_state *state; state = (fe_scram_state *) palloc(sizeof(fe_scram_state)); if (!state) return NULL; memset(state, 0, sizeof(fe_scram_state)); state->state = FE_SCRAM_INIT; state->username = username; state->password = pstrdup(password); return state; } /* * Free SCRAM exchange status */ void pg_fe_scram_free(void *opaq) { fe_scram_state *state = (fe_scram_state *) opaq; if (state->password) pfree(state->password); /* client messages */ if (state->client_nonce) pfree(state->client_nonce); if (state->client_first_message_bare) pfree(state->client_first_message_bare); if (state->client_final_message_without_proof) pfree(state->client_final_message_without_proof); /* first message from server */ if (state->server_first_message) pfree(state->server_first_message); if (state->salt) pfree(state->salt); if (state->nonce) pfree(state->nonce); /* final message from server */ if (state->server_final_message) pfree(state->server_final_message); pfree(state); } /* * Exchange a SCRAM message with backend. */ void pg_fe_scram_exchange(void *opaq, char *input, int inputlen, char **output, int *outputlen, bool *done, bool *success) { fe_scram_state *state = (fe_scram_state *) opaq; *done = false; *success = false; *output = NULL; *outputlen = 0; /* * Check that the input length agrees with the string length of the input. * We can ignore inputlen after this. */ if (state->state != FE_SCRAM_INIT) { if (inputlen == 0) { ereport(ERROR, (errmsg("malformed SCRAM message from server (empty message)"))); goto error; } if (inputlen != strlen(input)) { ereport(ERROR, (errmsg("malformed SCRAM message (length mismatch)"))); goto error; } } switch (state->state) { case FE_SCRAM_INIT: /* Begin the SCRAM handshake, by sending client nonce */ *output = build_client_first_message(state); if (*output == NULL) goto error; *outputlen = strlen(*output); *done = false; state->state = FE_SCRAM_NONCE_SENT; break; case FE_SCRAM_NONCE_SENT: /* Receive salt and server nonce, send response. */ if (!read_server_first_message(state, input)) goto error; *output = build_client_final_message(state); if (*output == NULL) goto error; *outputlen = strlen(*output); *done = false; state->state = FE_SCRAM_PROOF_SENT; break; case FE_SCRAM_PROOF_SENT: /* Receive server signature */ if (!read_server_final_message(state, input)) goto error; /* * Verify server signature, to make sure we're talking to the * genuine server. XXX: A fake server could simply not require * authentication, though. There is currently no option in libpq * to reject a connection, if SCRAM authentication did not happen. */ if (verify_server_signature(state)) *success = true; else { *success = false; ereport(ERROR, (errmsg("incorrect server signature"))); } *done = true; state->state = FE_SCRAM_FINISHED; break; default: /* shouldn't happen */ ereport(ERROR, (errmsg("invalid SCRAM exchange state"))); goto error; } return; error: *done = true; *success = false; return; } /* * Build the first exchange message sent by the client. */ static char * build_client_first_message(fe_scram_state *state) { char raw_nonce[SCRAM_RAW_NONCE_LEN + 1]; char *buf; char buflen; int encoded_len; /* * Generate a "raw" nonce. This is converted to ASCII-printable form by * base64-encoding it. */ pool_random(raw_nonce, SCRAM_RAW_NONCE_LEN); state->client_nonce = palloc(pg_b64_enc_len(SCRAM_RAW_NONCE_LEN) + 1); encoded_len = pg_b64_encode(raw_nonce, SCRAM_RAW_NONCE_LEN, state->client_nonce); state->client_nonce[encoded_len] = '\0'; /* * Generate message. The username is left empty as the backend uses the * value provided by the startup packet. Also, as this username is not * prepared with SASLprep, the message parsing would fail if it includes * '=' or ',' characters. */ buflen = 8 + strlen(state->client_nonce) + 1; buf = palloc(buflen); snprintf(buf, buflen, "n,,n=,r=%s", state->client_nonce); state->client_first_message_bare = pstrdup(buf + 3); return buf; } /* * Build the final exchange message sent from the client. */ static char * build_client_final_message(fe_scram_state *state) { StringInfoData buf; uint8 client_proof[SCRAM_KEY_LEN]; char *result; initStringInfo(&buf); /* * Construct client-final-message-without-proof. We need to remember it * for verifying the server proof in the final step of authentication. */ appendStringInfo(&buf, "c=biws,r=%s", state->nonce); state->client_final_message_without_proof = pstrdup(buf.data); /* Append proof to it, to form client-final-message. */ calculate_client_proof(state, state->client_final_message_without_proof, client_proof); /* /// */ appendStringInfoString(&buf, ",p="); /* * char *encoded_data = palloc(pg_b64_enc_len(SCRAM_KEY_LEN) + 1); int len * = encoded_data = pg_b64_encode((char *) client_proof, SCRAM_KEY_LEN, * encoded_data); encoded_data[len] = '\0'; appendStringInfoString(&buf, * encoded_data); */ enlargeStringInfo(&buf, pg_b64_enc_len(SCRAM_KEY_LEN)); buf.len += pg_b64_encode((char *) client_proof, SCRAM_KEY_LEN, buf.data + buf.len); buf.data[buf.len] = '\0'; result = pstrdup(buf.data); pfree(buf.data); return result; } /* * Read the first exchange message coming from the server. */ static bool read_server_first_message(fe_scram_state *state, char *input) { char *iterations_str; char *endptr; char *encoded_salt; char *nonce; state->server_first_message = pstrdup(input); /* parse the message */ nonce = read_attr_value(&input, 'r'); if (nonce == NULL) { /* read_attr_value() has generated an error string */ return false; } /* Verify immediately that the server used our part of the nonce */ if (strlen(nonce) < strlen(state->client_nonce) || memcmp(nonce, state->client_nonce, strlen(state->client_nonce)) != 0) { ereport(ERROR, (errmsg("invalid SCRAM response from server(nonce mismatch)"))); return false; } state->nonce = pstrdup(nonce); encoded_salt = read_attr_value(&input, 's'); if (encoded_salt == NULL) { /* read_attr_value() has generated an error string */ return false; } state->salt = palloc(pg_b64_dec_len(strlen(encoded_salt))); state->saltlen = pg_b64_decode(encoded_salt, strlen(encoded_salt), state->salt); iterations_str = read_attr_value(&input, 'i'); if (iterations_str == NULL) { /* read_attr_value() has generated an error string */ return false; } state->iterations = strtol(iterations_str, &endptr, 10); if (*endptr != '\0' || state->iterations < 1) { ereport(ERROR, (errmsg("malformed SCRAM message from server (invalid iteration count)"))); return false; } if (*input != '\0') ereport(WARNING, (errmsg("malformed SCRAM message from server (garbage at end of server-first-message)"))); return true; } /* * Read the final exchange message coming from the server. */ static bool read_server_final_message(fe_scram_state *state, char *input) { char *encoded_server_signature; int server_signature_len; state->server_final_message = pstrdup(input); /* Check for error result. */ if (*input == 'e') { char *err = read_attr_value(&input, 'e'); ereport(ERROR, (errmsg("error received from server in SCRAM exchange: %s", err))); return false; } /* Parse the message. */ encoded_server_signature = read_attr_value(&input, 'v'); if (encoded_server_signature == NULL) { /* read_attr_value() has generated an error message */ return false; } if (*input != '\0') ereport(WARNING, (errmsg("malformed SCRAM message (garbage at end of server-final-message)"))); server_signature_len = pg_b64_decode(encoded_server_signature, strlen(encoded_server_signature), state->ServerSignature); if (server_signature_len != SCRAM_KEY_LEN) { ereport(ERROR, (errmsg("malformed SCRAM message from server (invalid server signature)"))); return false; } return true; } /* * Calculate the client proof, part of the final exchange message sent * by the client. */ static void calculate_client_proof(fe_scram_state *state, const char *client_final_message_without_proof, uint8 *result) { uint8 StoredKey[SCRAM_KEY_LEN]; uint8 ClientKey[SCRAM_KEY_LEN]; uint8 ClientSignature[SCRAM_KEY_LEN]; int i; scram_HMAC_ctx ctx; /* * Calculate SaltedPassword, and store it in 'state' so that we can reuse * it later in verify_server_signature. */ scram_SaltedPassword(state->password, state->salt, state->saltlen, state->iterations, state->SaltedPassword); scram_ClientKey(state->SaltedPassword, ClientKey); scram_H(ClientKey, SCRAM_KEY_LEN, StoredKey); scram_HMAC_init(&ctx, StoredKey, SCRAM_KEY_LEN); scram_HMAC_update(&ctx, state->client_first_message_bare, strlen(state->client_first_message_bare)); scram_HMAC_update(&ctx, ",", 1); scram_HMAC_update(&ctx, state->server_first_message, strlen(state->server_first_message)); scram_HMAC_update(&ctx, ",", 1); scram_HMAC_update(&ctx, client_final_message_without_proof, strlen(client_final_message_without_proof)); scram_HMAC_final(ClientSignature, &ctx); for (i = 0; i < SCRAM_KEY_LEN; i++) result[i] = ClientKey[i] ^ ClientSignature[i]; } /* * Validate the server signature, received as part of the final exchange * message received from the server. */ static bool verify_server_signature(fe_scram_state *state) { uint8 expected_ServerSignature[SCRAM_KEY_LEN]; uint8 ServerKey[SCRAM_KEY_LEN]; scram_HMAC_ctx ctx; scram_ServerKey(state->SaltedPassword, ServerKey); /* calculate ServerSignature */ scram_HMAC_init(&ctx, ServerKey, SCRAM_KEY_LEN); scram_HMAC_update(&ctx, state->client_first_message_bare, strlen(state->client_first_message_bare)); scram_HMAC_update(&ctx, ",", 1); scram_HMAC_update(&ctx, state->server_first_message, strlen(state->server_first_message)); scram_HMAC_update(&ctx, ",", 1); scram_HMAC_update(&ctx, state->client_final_message_without_proof, strlen(state->client_final_message_without_proof)); scram_HMAC_final(expected_ServerSignature, &ctx); if (memcmp(expected_ServerSignature, state->ServerSignature, SCRAM_KEY_LEN) != 0) return false; return true; } /* * Build a new SCRAM verifier. */ char * pg_fe_scram_build_verifier(const char *password) { char saltbuf[SCRAM_DEFAULT_SALT_LEN]; char *result; /* Generate a random salt */ pool_random(saltbuf, SCRAM_DEFAULT_SALT_LEN); result = scram_build_verifier(saltbuf, SCRAM_DEFAULT_SALT_LEN, SCRAM_DEFAULT_ITERATIONS, password); return result; } pgpool-II-4.1.4/src/config/0000775000175000017500000000000013730350746012366 500000000000000pgpool-II-4.1.4/src/config/pool_config.c0000664000175000017500000016362113730350127014752 00000000000000 #line 3 "config/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 37 #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 #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 #ifndef YY_TYPEDEF_YY_SIZE_T #define YY_TYPEDEF_YY_SIZE_T typedef size_t yy_size_t; #endif extern yy_size_t 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_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. */ yy_size_t 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 yy_size_t yy_n_chars; /* number of characters read into yy_ch_buf */ yy_size_t 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,yy_size_t 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() 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-2016 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 #include "pool.h" #include "pool_config.h" #include "pool_config_variables.h" #include "utils/regex_array.h" #ifndef POOL_PRIVATE #include "utils/elog.h" #else #include "utils/fe_ports.h" #endif /* to shut off compiler warnings */ int yylex(void); POOL_CONFIG g_pool_config; /* configuration values */ POOL_CONFIG *pool_config = &g_pool_config; /* for lagacy reason pointer to the above struct */ static unsigned Lineno; 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 void FreeConfigVariable(ConfigVariable *item); static bool ParseConfigFile( const char *config_file, int elevel, ConfigVariable **head_p, ConfigVariable **tail_p); #define YY_NO_INPUT 1 #line 550 "config/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 ); yy_size_t 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 #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 = '*'; \ 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 733 "config/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 871 "config/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 { yy_size_t 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_LVALUE; int yy_c_buf_p_offset = (int) ((yy_c_buf_p) - b->yy_ch_buf); if ( b->yy_is_our_buffer ) { yy_size_t 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), 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 */ yy_size_t 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) { yy_size_t 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, yy_size_t _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. * */ yy_size_t 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) { memset(pool_config, 0, sizeof(POOL_CONFIG)); #ifndef POOL_PRIVATE g_pool_config.backend_desc = pool_shared_memory_create(sizeof(BackendDesc)); memset(g_pool_config.backend_desc, 0, sizeof(BackendDesc)); #else g_pool_config.backend_desc = palloc0(sizeof(BackendDesc)); #endif g_pool_config.health_check_params = palloc0(MAX_NUM_BACKENDS*sizeof(HealthCheckParams)); InitializeConfigOptions(); return 0; } /* * Add regex expression to patterns array * The supported type are: black_function_list and white_function_list * Return 0 on error, 1 on success */ int add_regex_pattern(const char *type, char *s) { int regex_flags = REG_NOSUB; RegPattern currItem; /* force case insensitive pattern matching */ regex_flags |= REG_ICASE; /* Add extended regex search */ regex_flags |= REG_EXTENDED; /* Fill the pattern type */ if (strcmp(type, "black_function_list") == 0 || strcmp(type, "black_query_pattern_list") == 0 || strcmp(type, "black_memqcache_table_list") == 0) { currItem.type = BLACKLIST; } else if (strcmp(type, "white_function_list") == 0 || strcmp(type, "white_memqcache_table_list") == 0) { currItem.type = WHITELIST; } else { ereport(WARNING, (errmsg("unable to add regex pattern, bad pattern type %s", type))); return 0; } /* Fill the pattern flag */ currItem.flag = regex_flags; /* Fill pattern array */ currItem.pattern = palloc(sizeof(char)*(strlen(s)+3)); /* Force exact matching of function name with ^ and $ on the regex if required to prevent partial matching. It also allow backward compatibility. */ if (strncmp(s, "^", 1) != 0) { strncpy(currItem.pattern, "^", 2); strncat(currItem.pattern, s, strlen(s) + 1); } else { strncpy(currItem.pattern, s, strlen(s) + 1); } if (s[strlen(s)-1] != '$') { strncat(currItem.pattern, "$", 2); } ereport(DEBUG1, (errmsg("initializing pool configuration"), errdetail("adding regex pattern for \"%s\" pattern: %s",type, currItem.pattern))); /* compile our regex */ if (regcomp(&currItem.regexv, currItem.pattern, currItem.flag) != 0) { ereport(WARNING, (errmsg("unable to add regex pattern for \"%s\", invalid pattern: \"%s\"", type,currItem.pattern))); } else if ((strcmp(type, "white_function_list") == 0 || strcmp(type, "black_function_list") == 0) && growFunctionPatternArray(currItem) < 0) { ereport(WARNING, (errmsg("unable to add regex pattern for \"%s\", unable to allocate new pattern", type))); return 0; } else if ((strcmp(type, "white_memqcache_table_list") == 0 || strcmp(type, "black_memqcache_table_list") == 0) && growMemqcacheTablePatternArray(currItem) < 0) { ereport(WARNING, (errmsg("unable to add regex pattern for \"%s\", unable to allocate new pattern", type))); return 0; } else if (strcmp(type, "black_query_pattern_list") == 0 && growQueryPatternArray(currItem) < 0) { ereport(WARNING, (errmsg("unable to add regex pattern for \"%s\", unable to allocate new pattern", type))); return 0; } return 1; } /* * Dynamically grow the regex pattern array * The array start with PATTERN_ARR_SIZE storage place, if required * it will grow of PATTERN_ARR_SIZE more each time. */ int growFunctionPatternArray(RegPattern item) { void *_tmp = NULL; if (pool_config->pattc == 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 growQueryPatternArray(RegPattern item) { void *_tmp = NULL; if (pool_config->query_pattc == pool_config->current_query_pattern_size) { pool_config->current_query_pattern_size += PATTERN_ARR_SIZE; _tmp = repalloc(pool_config->lists_query_patterns, (pool_config->current_query_pattern_size * sizeof(RegPattern))); if (!_tmp) { return(-1); } pool_config->lists_query_patterns = (RegPattern*)_tmp; } pool_config->lists_query_patterns[pool_config->query_pattc] = item; pool_config->query_pattc++; return(pool_config->query_pattc); } /* * Free a single ConfigVariable */ static void FreeConfigVariable(ConfigVariable *item) { if (item->name) pfree(item->name); if (item->value) pfree(item->value); pfree(item); } /* * Free a list of ConfigVariables, including the names and the values */ static void FreeConfigVariables(ConfigVariable *list) { ConfigVariable *item; item = list; while (item) { ConfigVariable *next = item->next; FreeConfigVariable(item); item = next; } } /* * Read and parse a single configuration file. * * Input parameters: * config_file: absolute or relative path name of the configuration file * elevel: error logging level to use * Input/Output parameters: * head_p, tail_p: head and tail of linked list of name/value pairs * * *head_p and *tail_p must be initialized, either to NULL or valid pointers * to a ConfigVariable list, before calling the outer recursion level. Any * name-value pairs read from the input file(s) will be appended to the list. * * Note: if elevel >= ERROR then an error will not return control to the * caller, so there is no need to check the return value in that case. * */ static bool ParseConfigFile(const char *config_file, int elevel, ConfigVariable **head_p, ConfigVariable **tail_p) { FILE *fd; int token; char *key; char *val; ConfigVariable *item; *head_p = NULL; /* open config file */ fd = fopen(config_file, "r"); if (!fd) { ereport(WARNING, (errmsg("could not open configuration file: \"%s\"",config_file), errdetail("using default configuration parameter values"))); return false; } yyin = fd; Lineno = 1; for(;;) { token = yylex(); if (token == 0) break; if (token == POOL_EOL) continue; if (token == POOL_PARSE_ERROR) goto parse_error; if (token != POOL_KEY) goto parse_error; key = pstrdup(yytext); token = yylex(); /* next we have an optional equal sign; discard if present */ if (token == POOL_EQUALS) token = yylex(); val = extract_string(yytext,token); ereport(DEBUG5, (errmsg("key: \"%s\" value: \"%s\" kind: %d",key, val, token))); /* Add this to the list */ item = palloc(sizeof(ConfigVariable)); item->name = key; item->value = val; item->sourceline = Lineno; item->next = NULL; if (*head_p == NULL) *head_p = item; else (*tail_p)->next = item; *tail_p = item; } fclose(fd); return true; parse_error: fclose(fd); FreeConfigVariables(*head_p); *head_p = NULL; *tail_p = NULL; ereport(elevel, (errmsg("syntex error in configuration file \"%s\"",config_file), errdetail("parse error at line %d '%s' token = %d", Lineno, yytext,token))); return false; } /* * Read the configuration file and load the values of all parameters */ bool pool_get_config(const char *config_file, ConfigContext context) { ConfigVariable *head_p = NULL; ConfigVariable *tail_p = NULL; bool res; int elevel = (context == CFGCXT_INIT)?FATAL:WARNING; res = ParseConfigFile(config_file, elevel, &head_p, &tail_p); if (res == false || head_p == NULL) return false; res = set_config_options(head_p, context, PGC_S_FILE, elevel); FreeConfigVariables(head_p); return res; } static char *extract_string(char *value, POOL_TOKEN token) { char *ret = NULL; if (token == POOL_STRING) { ret = pstrdup(value+1); ret[strlen(ret)-1] = '\0'; } else ret = pstrdup(value); 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(const char *str) { bool result; if (!parse_bool_with_len(str, strlen(str), &result)) return -1; return (result ? 1 : 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 /* * 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 */ *buf = '\0'; 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"); if (POOL_ALWAYS_MASTER & flag) { if (*buf == '\0') snprintf(buf, sizeof(buf), "ALWAYS_MASTER"); else snprintf(buf+strlen(buf), sizeof(buf), "|ALWAYS_MASTER"); } return buf; } /* * Translate the BACKEND_STATUS enum value to string. * the function returns the constant string so should not be freed */ char* backend_status_to_str(BackendInfo *bi) { char *statusName; switch (bi->backend_status) { case CON_UNUSED: statusName = BACKEND_STATUS_CON_UNUSED; break; case CON_CONNECT_WAIT: statusName = BACKEND_STATUS_CON_CONNECT_WAIT; break; case CON_UP: statusName = BACKEND_STATUS_CON_UP; break; case CON_DOWN: { if (bi->quarantine) statusName = BACKEND_STATUS_QUARANTINE; else statusName = BACKEND_STATUS_CON_DOWN; } break; default: statusName = "unknown"; break; } return statusName; } pgpool-II-4.1.4/src/config/pool_config.l0000664000175000017500000003443213730350127014760 00000000000000/* -*-pgsql-c-*- */ /* * * $Header$ * * pgpool: a language independent connection pool server for PostgreSQL * written by Tatsuo Ishii * * Copyright (c) 2003-2016 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 "pool_config_variables.h" #include "utils/regex_array.h" #ifndef POOL_PRIVATE #include "utils/elog.h" #else #include "utils/fe_ports.h" #endif /* to shut off compiler warnings */ int yylex(void); POOL_CONFIG g_pool_config; /* configuration values */ POOL_CONFIG *pool_config = &g_pool_config; /* for lagacy reason pointer to the above struct */ static unsigned Lineno; 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 void FreeConfigVariable(ConfigVariable *item); static bool ParseConfigFile( const char *config_file, int elevel, ConfigVariable **head_p, ConfigVariable **tail_p); %} %option 8bit %option never-interactive %option nounput %option noyywrap %option noinput 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) { memset(pool_config, 0, sizeof(POOL_CONFIG)); #ifndef POOL_PRIVATE g_pool_config.backend_desc = pool_shared_memory_create(sizeof(BackendDesc)); memset(g_pool_config.backend_desc, 0, sizeof(BackendDesc)); #else g_pool_config.backend_desc = palloc0(sizeof(BackendDesc)); #endif g_pool_config.health_check_params = palloc0(MAX_NUM_BACKENDS*sizeof(HealthCheckParams)); InitializeConfigOptions(); return 0; } /* * Add regex expression to patterns array * The supported type are: black_function_list and white_function_list * Return 0 on error, 1 on success */ int add_regex_pattern(const char *type, char *s) { int regex_flags = REG_NOSUB; RegPattern currItem; /* force case insensitive pattern matching */ regex_flags |= REG_ICASE; /* Add extended regex search */ regex_flags |= REG_EXTENDED; /* Fill the pattern type */ if (strcmp(type, "black_function_list") == 0 || strcmp(type, "black_query_pattern_list") == 0 || strcmp(type, "black_memqcache_table_list") == 0) { currItem.type = BLACKLIST; } else if (strcmp(type, "white_function_list") == 0 || strcmp(type, "white_memqcache_table_list") == 0) { currItem.type = WHITELIST; } else { ereport(WARNING, (errmsg("unable to add regex pattern, bad pattern type %s", type))); return 0; } /* Fill the pattern flag */ currItem.flag = regex_flags; /* Fill pattern array */ currItem.pattern = palloc(sizeof(char)*(strlen(s)+3)); /* Force exact matching of function name with ^ and $ on the regex if required to prevent partial matching. It also allow backward compatibility. */ if (strncmp(s, "^", 1) != 0) { strncpy(currItem.pattern, "^", 2); strncat(currItem.pattern, s, strlen(s) + 1); } else { strncpy(currItem.pattern, s, strlen(s) + 1); } if (s[strlen(s)-1] != '$') { strncat(currItem.pattern, "$", 2); } ereport(DEBUG1, (errmsg("initializing pool configuration"), errdetail("adding regex pattern for \"%s\" pattern: %s",type, currItem.pattern))); /* compile our regex */ if (regcomp(&currItem.regexv, currItem.pattern, currItem.flag) != 0) { ereport(WARNING, (errmsg("unable to add regex pattern for \"%s\", invalid pattern: \"%s\"", type,currItem.pattern))); } else if ((strcmp(type, "white_function_list") == 0 || strcmp(type, "black_function_list") == 0) && growFunctionPatternArray(currItem) < 0) { ereport(WARNING, (errmsg("unable to add regex pattern for \"%s\", unable to allocate new pattern", type))); return 0; } else if ((strcmp(type, "white_memqcache_table_list") == 0 || strcmp(type, "black_memqcache_table_list") == 0) && growMemqcacheTablePatternArray(currItem) < 0) { ereport(WARNING, (errmsg("unable to add regex pattern for \"%s\", unable to allocate new pattern", type))); return 0; } else if (strcmp(type, "black_query_pattern_list") == 0 && growQueryPatternArray(currItem) < 0) { ereport(WARNING, (errmsg("unable to add regex pattern for \"%s\", unable to allocate new pattern", type))); return 0; } return 1; } /* * Dynamically grow the regex pattern array * The array start with PATTERN_ARR_SIZE storage place, if required * it will grow of PATTERN_ARR_SIZE more each time. */ int growFunctionPatternArray(RegPattern item) { void *_tmp = NULL; if (pool_config->pattc == 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 growQueryPatternArray(RegPattern item) { void *_tmp = NULL; if (pool_config->query_pattc == pool_config->current_query_pattern_size) { pool_config->current_query_pattern_size += PATTERN_ARR_SIZE; _tmp = repalloc(pool_config->lists_query_patterns, (pool_config->current_query_pattern_size * sizeof(RegPattern))); if (!_tmp) { return(-1); } pool_config->lists_query_patterns = (RegPattern*)_tmp; } pool_config->lists_query_patterns[pool_config->query_pattc] = item; pool_config->query_pattc++; return(pool_config->query_pattc); } /* * Free a single ConfigVariable */ static void FreeConfigVariable(ConfigVariable *item) { if (item->name) pfree(item->name); if (item->value) pfree(item->value); pfree(item); } /* * Free a list of ConfigVariables, including the names and the values */ static void FreeConfigVariables(ConfigVariable *list) { ConfigVariable *item; item = list; while (item) { ConfigVariable *next = item->next; FreeConfigVariable(item); item = next; } } /* * Read and parse a single configuration file. * * Input parameters: * config_file: absolute or relative path name of the configuration file * elevel: error logging level to use * Input/Output parameters: * head_p, tail_p: head and tail of linked list of name/value pairs * * *head_p and *tail_p must be initialized, either to NULL or valid pointers * to a ConfigVariable list, before calling the outer recursion level. Any * name-value pairs read from the input file(s) will be appended to the list. * * Note: if elevel >= ERROR then an error will not return control to the * caller, so there is no need to check the return value in that case. * */ static bool ParseConfigFile(const char *config_file, int elevel, ConfigVariable **head_p, ConfigVariable **tail_p) { FILE *fd; int token; char *key; char *val; ConfigVariable *item; *head_p = NULL; /* open config file */ fd = fopen(config_file, "r"); if (!fd) { ereport(WARNING, (errmsg("could not open configuration file: \"%s\"",config_file), errdetail("using default configuration parameter values"))); return false; } yyin = fd; Lineno = 1; for(;;) { token = yylex(); if (token == 0) break; if (token == POOL_EOL) continue; if (token == POOL_PARSE_ERROR) goto parse_error; if (token != POOL_KEY) goto parse_error; key = pstrdup(yytext); token = yylex(); /* next we have an optional equal sign; discard if present */ if (token == POOL_EQUALS) token = yylex(); val = extract_string(yytext,token); ereport(DEBUG5, (errmsg("key: \"%s\" value: \"%s\" kind: %d",key, val, token))); /* Add this to the list */ item = palloc(sizeof(ConfigVariable)); item->name = key; item->value = val; item->sourceline = Lineno; item->next = NULL; if (*head_p == NULL) *head_p = item; else (*tail_p)->next = item; *tail_p = item; } fclose(fd); return true; parse_error: fclose(fd); FreeConfigVariables(*head_p); *head_p = NULL; *tail_p = NULL; ereport(elevel, (errmsg("syntex error in configuration file \"%s\"",config_file), errdetail("parse error at line %d '%s' token = %d", Lineno, yytext,token))); return false; } /* * Read the configuration file and load the values of all parameters */ bool pool_get_config(const char *config_file, ConfigContext context) { ConfigVariable *head_p = NULL; ConfigVariable *tail_p = NULL; bool res; int elevel = (context == CFGCXT_INIT)?FATAL:WARNING; res = ParseConfigFile(config_file, elevel, &head_p, &tail_p); if (res == false || head_p == NULL) return false; res = set_config_options(head_p, context, PGC_S_FILE, elevel); FreeConfigVariables(head_p); return res; } static char *extract_string(char *value, POOL_TOKEN token) { char *ret = NULL; if (token == POOL_STRING) { ret = pstrdup(value+1); ret[strlen(ret)-1] = '\0'; } else ret = pstrdup(value); 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(const char *str) { bool result; if (!parse_bool_with_len(str, strlen(str), &result)) return -1; return (result ? 1 : 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 /* * 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 */ *buf = '\0'; 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"); if (POOL_ALWAYS_MASTER & flag) { if (*buf == '\0') snprintf(buf, sizeof(buf), "ALWAYS_MASTER"); else snprintf(buf+strlen(buf), sizeof(buf), "|ALWAYS_MASTER"); } return buf; } /* * Translate the BACKEND_STATUS enum value to string. * the function returns the constant string so should not be freed */ char* backend_status_to_str(BackendInfo *bi) { char *statusName; switch (bi->backend_status) { case CON_UNUSED: statusName = BACKEND_STATUS_CON_UNUSED; break; case CON_CONNECT_WAIT: statusName = BACKEND_STATUS_CON_CONNECT_WAIT; break; case CON_UP: statusName = BACKEND_STATUS_CON_UP; break; case CON_DOWN: { if (bi->quarantine) statusName = BACKEND_STATUS_QUARANTINE; else statusName = BACKEND_STATUS_CON_DOWN; } break; default: statusName = "unknown"; break; } return statusName; } pgpool-II-4.1.4/src/config/pool_config_variables.c0000664000175000017500000040554013730350127017001 00000000000000/* -*-pgsql-c-*- */ /* * * pgpool: a language independent connection pool server for PostgreSQL * written by Tatsuo Ishii * * Copyright (c) 2003-2019 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_variables.c. * */ #include #include #include #include #include #include #include "pool.h" #include "pool_config.h" #include "pool_config_variables.h" #include "utils/regex_array.h" #ifndef POOL_PRIVATE #include "utils/elog.h" #include "parser/stringinfo.h" #include "utils/pool_process_reporting.h" #include "utils/pool_stream.h" #include "utils/palloc.h" #include "utils/memutils.h" #include "watchdog/wd_utils.h" #else #include "utils/fe_ports.h" #endif #define default_reset_query_list "ABORT;DISCARD ALL" #define default_black_function_list "nextval,setval" #define EMPTY_CONFIG_GENERIC {NULL, 0, 0, NULL, 0, false, 0, 0, 0, 0, NULL, NULL} #define EMPTY_CONFIG_BOOL {EMPTY_CONFIG_GENERIC, NULL, false, NULL, NULL, NULL, false} #define EMPTY_CONFIG_INT {EMPTY_CONFIG_GENERIC, NULL, 0, 0, 0, NULL, NULL, NULL, 0} #define EMPTY_CONFIG_DOUBLE {EMPTY_CONFIG_GENERIC, NULL, 0, 0, 0, NULL, NULL, NULL, 0} #define EMPTY_CONFIG_LONG {EMPTY_CONFIG_GENERIC, NULL, 0, 0, 0, NULL, NULL, NULL, 0} #define EMPTY_CONFIG_STRING {EMPTY_CONFIG_GENERIC, NULL, NULL, NULL, NULL, NULL, NULL, NULL} #define EMPTY_CONFIG_ENUM {EMPTY_CONFIG_GENERIC, NULL, 0, NULL, NULL, NULL, NULL, NULL, 0} #define EMPTY_CONFIG_INT_ARRAY {EMPTY_CONFIG_GENERIC, NULL, 0, 0, 0, EMPTY_CONFIG_INT, NULL, NULL, NULL, NULL, NULL} #define EMPTY_CONFIG_DOUBLE_ARRAY {EMPTY_CONFIG_GENERIC, NULL, 0, 0, 0, EMPTY_CONFIG_DOUBLE, NULL, NULL, NULL, NULL, NULL} #define EMPTY_CONFIG_STRING_ARRAY {EMPTY_CONFIG_GENERIC, NULL, NULL, EMPTY_CONFIG_STRING, NULL, NULL, NULL, NULL, NULL} #define EMPTY_CONFIG_STRING_LIST {EMPTY_CONFIG_GENERIC, NULL, NULL, NULL, NULL, false, NULL, NULL, NULL, NULL, NULL} #define EMPTY_CONFIG_GROUP_ARRAY {EMPTY_CONFIG_GENERIC, 0, NULL} extern POOL_CONFIG g_pool_config; struct config_generic **all_parameters = NULL; static int num_all_parameters = 0; static void initialize_variables_with_default(struct config_generic *gconf); static bool config_enum_lookup_by_name(struct config_enum *record, const char *value, int *retval); static void build_variable_groups(void); static void build_config_variables(void); static void initialize_config_gen(struct config_generic *gen); static struct config_generic *find_option(const char *name, int elevel); static bool config_post_processor(ConfigContext context, int elevel); static void sort_config_vars(void); static bool setConfigOptionArrayVarWithConfigDefault(struct config_generic *record, const char *name, const char *value, ConfigContext context, int elevel); static bool setConfigOption(const char *name, const char *value, ConfigContext context, GucSource source, int elevel); static bool setConfigOptionVar(struct config_generic *record, const char *name, int index_val, const char *value, ConfigContext context, GucSource source, int elevel); static bool get_index_in_var_name(struct config_generic *record, const char *name, int *index, int elevel); static bool MakeDBRedirectListRegex(char *newval, int elevel); static bool MakeAppRedirectListRegex(char *newval, int elevel); static bool check_redirect_node_spec(char *node_spec); static char **get_list_from_string(const char *str, const char *delimi, int *n); static char **get_list_from_string_regex_delim(const char *str, const char *delimi, int *n); /*show functions */ static const char *IntValueShowFunc(int value); static const char *HBDestinationPortShowFunc(int index); static const char *HBDestinationShowFunc(int index); static const char *HBDeviceShowFunc(int index); static const char *OtherWDPortShowFunc(int index); static const char *OtherPPPortShowFunc(int index); static const char *OtherPPHostShowFunc(int index); static const char *BackendFlagsShowFunc(int index); static const char *BackendDataDirShowFunc(int index); static const char *BackendHostShowFunc(int index); static const char *BackendPortShowFunc(int index); static const char *BackendWeightShowFunc(int index); static const char *BackendAppNameShowFunc(int index); static const char *HealthCheckPeriodShowFunc(int index); static const char *HealthCheckTimeOutShowFunc(int index); static const char *HealthCheckMaxRetriesShowFunc(int index); static const char *HealthCheckRetryDelayShowFunc(int index); static const char *HealthCheckConnectTimeOutShowFunc(int index); static const char *HealthCheckUserShowFunc(int index); static const char *HealthCheckPasswordShowFunc(int index); static const char *HealthCheckDatabaseShowFunc(int index); /* check empty slot functions */ static bool WdIFSlotEmptyCheckFunc(int index); static bool WdSlotEmptyCheckFunc(int index); static bool BackendSlotEmptyCheckFunc(int index); /*variable custom assign functions */ static bool FailOverOnBackendErrorAssignMessage(ConfigContext scontext, bool newval, int elevel); static bool BackendPortAssignFunc(ConfigContext context, int newval, int index, int elevel); static bool BackendHostAssignFunc(ConfigContext context, char *newval, int index, int elevel); static bool BackendDataDirAssignFunc(ConfigContext context, char *newval, int index, int elevel); static bool BackendFlagsAssignFunc(ConfigContext context, char *newval, int index, int elevel); static bool BackendWeightAssignFunc(ConfigContext context, double newval, int index, int elevel); static bool BackendAppNameAssignFunc(ConfigContext context, char *newval, int index, int elevel); static bool HBDestinationAssignFunc(ConfigContext context, char *newval, int index, int elevel); static bool HBDestinationPortAssignFunc(ConfigContext context, int newval, int index, int elevel); static bool HBDeviceAssignFunc(ConfigContext context, char *newval, int index, int elevel); static bool OtherWDPortAssignFunc(ConfigContext context, int newval, int index, int elevel); static bool OtherPPPortAssignFunc(ConfigContext context, int newval, int index, int elevel); static bool OtherPPHostAssignFunc(ConfigContext context, char *newval, int index, int elevel); static bool HealthCheckPeriodAssignFunc(ConfigContext context, int newval, int index, int elevel); static bool HealthCheckTimeOutAssignFunc(ConfigContext context, int newval, int index, int elevel); static bool HealthCheckMaxRetriesAssignFunc(ConfigContext context, int newval, int index, int elevel); static bool HealthCheckRetryDelayAssignFunc(ConfigContext context, int newval, int index, int elevel); static bool HealthCheckConnectTimeOutAssignFunc(ConfigContext context, int newval, int index, int elevel); static bool HealthCheckUserAssignFunc(ConfigContext context, char *newval, int index, int elevel); static bool HealthCheckPasswordAssignFunc(ConfigContext context, char *newval, int index, int elevel); static bool HealthCheckDatabaseAssignFunc(ConfigContext context, char *newval, int index, int elevel); static bool LogDestinationProcessFunc(char *newval, int elevel); static bool SyslogIdentProcessFunc(char *newval, int elevel); static bool SyslogFacilityProcessFunc(int newval, int elevel); static struct config_generic *get_index_free_record_if_any(struct config_generic *record); #ifndef POOL_PRIVATE /* These functions are used to provide Hints for enum type config parameters and * to output the values of the parameters. * These functuons are not available for tools since they use the stringInfo that is * not present for tools. */ static const char *config_enum_lookup_by_value(struct config_enum *record, int val); static char *ShowOption(struct config_generic *record, int index, int elevel); static char *config_enum_get_options(struct config_enum *record, const char *prefix, const char *suffix, const char *separator); static void send_row_description_for_detail_view(POOL_CONNECTION * frontend, POOL_CONNECTION_POOL * backend); static int send_grouped_type_variable_to_frontend(struct config_grouped_array_var *grouped_record, POOL_CONNECTION * frontend, POOL_CONNECTION_POOL * backend); static int send_array_type_variable_to_frontend(struct config_generic *record, POOL_CONNECTION * frontend, POOL_CONNECTION_POOL * backend); #endif static const struct config_enum_entry log_error_verbosity_options[] = { {"terse", PGERROR_TERSE, false}, {"default", PGERROR_DEFAULT, false}, {"verbose", PGERROR_VERBOSE, false}, {NULL, 0, false} }; static const struct config_enum_entry server_message_level_options[] = { {"debug", DEBUG2, true}, {"debug5", DEBUG5, false}, {"debug4", DEBUG4, false}, {"debug3", DEBUG3, false}, {"debug2", DEBUG2, false}, {"debug1", DEBUG1, false}, {"info", INFO, false}, {"notice", NOTICE, false}, {"warning", WARNING, false}, {"error", ERROR, false}, {"log", LOG, false}, {"fatal", FATAL, false}, {"panic", PANIC, false}, {NULL, 0, false} }; static const struct config_enum_entry master_slave_sub_mode_options[] = { {"slony", SLONY_MODE, false}, {"stream", STREAM_MODE, false}, {"logical", LOGICAL_MODE, false}, {NULL, 0, false} }; static const struct config_enum_entry log_standby_delay_options[] = { {"always", LSD_ALWAYS, false}, {"if_over_threshold", LSD_OVER_THRESHOLD, false}, {"none", LSD_NONE, false}, {NULL, 0, false} }; static const struct config_enum_entry memqcache_method_options[] = { {"shmem", SHMEM_CACHE, false}, {"memcached", MEMCACHED_CACHE, false}, {NULL, 0, false} }; static const struct config_enum_entry wd_lifecheck_method_options[] = { {"query", LIFECHECK_BY_QUERY, false}, {"heartbeat", LIFECHECK_BY_HB, false}, {"external", LIFECHECK_BY_EXTERNAL, false}, {NULL, 0, false} }; static const struct config_enum_entry syslog_facility_options[] = { {"LOCAL0", LOG_LOCAL0, false}, {"LOCAL1", LOG_LOCAL1, false}, {"LOCAL2", LOG_LOCAL2, false}, {"LOCAL3", LOG_LOCAL3, false}, {"LOCAL4", LOG_LOCAL4, false}, {"LOCAL5", LOG_LOCAL5, false}, {"LOCAL6", LOG_LOCAL6, false}, {"LOCAL7", LOG_LOCAL7, false}, {NULL, 0, false} }; static const struct config_enum_entry disable_load_balance_on_write_options[] = { {"off", DLBOW_OFF, false}, {"transaction", DLBOW_TRANSACTION, false}, {"trans_transaction", DLBOW_TRANS_TRANSACTION, false}, {"always", DLBOW_ALWAYS, false}, {NULL, 0, false} }; static const struct config_enum_entry relcache_query_target_options[] = { {"master", RELQTARGET_MASTER, false}, {"load_balance_node", RELQTARGET_LOAD_BALANCE_NODE, false}, {NULL, 0, false} }; static const struct config_enum_entry check_temp_table_options[] = { {"catalog", CHECK_TEMP_CATALOG, false}, /* search system catalogs */ {"trace", CHECK_TEMP_TRACE, false}, /* tracing temp tables */ {"none", CHECK_TEMP_NONE, false}, /* do not check temp tables */ {"on", CHECK_TEMP_ON, false}, /* same as CHECK_TEMP_CATALOG. Just for backward compatibilty. */ {"off", CHECK_TEMP_OFF, false}, /* same as CHECK_TEMP_NONE. Just for backward compatibilty. */ {NULL, 0, false} }; static struct config_bool ConfigureNamesBool[] = { { {"serialize_accept", CFGCXT_INIT, CONNECTION_CONFIG, "whether to serialize accept() call to avoid thundering herd problem", CONFIG_VAR_TYPE_BOOL, false, 0 }, &g_pool_config.serialize_accept, /* variable */ false, /* boot value */ NULL, /* assign func */ NULL, /* check func */ NULL /* show hook */ }, { {"failover_when_quorum_exists", CFGCXT_INIT, FAILOVER_CONFIG, "Do failover only when cluster has the quorum.", CONFIG_VAR_TYPE_BOOL, false, 0 }, &g_pool_config.failover_when_quorum_exists, false, NULL, NULL, NULL }, { {"failover_require_consensus", CFGCXT_INIT, FAILOVER_CONFIG, "Only do failover when majority aggrees.", CONFIG_VAR_TYPE_BOOL, false, 0 }, &g_pool_config.failover_require_consensus, false, NULL, NULL, NULL }, { {"allow_multiple_failover_requests_from_node", CFGCXT_INIT, FAILOVER_CONFIG, "A Pgpool-II node can send multiple failover requests to build consensus.", CONFIG_VAR_TYPE_BOOL, false, 0 }, &g_pool_config.allow_multiple_failover_requests_from_node, false, NULL, NULL, NULL }, { {"enable_consensus_with_half_votes", CFGCXT_INIT, FAILOVER_CONFIG, "apply majority rule for consensus and quorum computation at 50% of votes in a cluster with an even number of nodes.", CONFIG_VAR_TYPE_BOOL, false, 0 }, &g_pool_config.enable_consensus_with_half_votes, false, NULL, NULL, NULL }, { {"log_connections", CFGCXT_RELOAD, LOGING_CONFIG, "Logs each successful connection.", CONFIG_VAR_TYPE_BOOL, false, 0 }, &g_pool_config.log_connections, false, NULL, NULL, NULL }, { {"log_hostname", CFGCXT_RELOAD, LOGING_CONFIG, "Logs the host name in the connection logs.", CONFIG_VAR_TYPE_BOOL, false, 0 }, &g_pool_config.log_hostname, false, NULL, NULL, NULL }, { {"enable_pool_hba", CFGCXT_RELOAD, CONNECTION_CONFIG, "Use pool_hba.conf for client authentication.", CONFIG_VAR_TYPE_BOOL, false, 0 }, &g_pool_config.enable_pool_hba, false, NULL, NULL, NULL }, { {"replication_mode", CFGCXT_INIT, LOGING_CONFIG, "Enables replication mode.", CONFIG_VAR_TYPE_BOOL, false, 0 }, &g_pool_config.replication_mode, false, NULL, NULL, NULL }, { {"load_balance_mode", CFGCXT_INIT, LOAD_BALANCE_CONFIG, "Enables load balancing of queries.", CONFIG_VAR_TYPE_BOOL, false, 0 }, &g_pool_config.load_balance_mode, false, NULL, NULL, NULL }, { {"replication_stop_on_mismatch", CFGCXT_RELOAD, REPLICATION_CONFIG, "Starts degeneration and stops replication, If there's a data mismatch between master and secondary.", CONFIG_VAR_TYPE_BOOL, false, 0 }, &g_pool_config.replication_stop_on_mismatch, false, NULL, NULL, NULL }, { {"failover_if_affected_tuples_mismatch", CFGCXT_RELOAD, REPLICATION_CONFIG, "Starts degeneration, If there's a data mismatch between master and secondary.", CONFIG_VAR_TYPE_BOOL, false, 0 }, &g_pool_config.failover_if_affected_tuples_mismatch, false, NULL, NULL, NULL }, { {"replicate_select", CFGCXT_RELOAD, REPLICATION_CONFIG, "Replicate SELECT statements when load balancing is disabled.", CONFIG_VAR_TYPE_BOOL, false, 0 }, &g_pool_config.replicate_select, false, NULL, NULL, NULL }, { {"master_slave_mode", CFGCXT_INIT, MASTER_SLAVE_CONFIG, "Enables Master/Slave mode.", CONFIG_VAR_TYPE_BOOL, false, 0 }, &g_pool_config.master_slave_mode, false, NULL, NULL, NULL }, { {"connection_cache", CFGCXT_INIT, CONNECTION_POOL_CONFIG, "Caches connections to backends.", CONFIG_VAR_TYPE_BOOL, false, 0 }, &g_pool_config.connection_cache, true, NULL, NULL, NULL }, { {"fail_over_on_backend_error", CFGCXT_RELOAD, FAILOVER_CONFIG, "Old config parameter for failover_on_backend_error.", CONFIG_VAR_TYPE_BOOL, false, VAR_HIDDEN_IN_SHOW_ALL }, NULL, true, FailOverOnBackendErrorAssignMessage, NULL, NULL }, { {"failover_on_backend_error", CFGCXT_RELOAD, FAILOVER_CONFIG, "Triggers fail over when reading/writing to backend socket fails.", CONFIG_VAR_TYPE_BOOL, false, 0 }, &g_pool_config.failover_on_backend_error, true, NULL, NULL, NULL }, { {"detach_false_primary", CFGCXT_RELOAD, FAILOVER_CONFIG, "Automatically detaches false primary node.", CONFIG_VAR_TYPE_BOOL, false, 0 }, &g_pool_config.detach_false_primary, false, NULL, NULL, NULL }, { {"insert_lock", CFGCXT_RELOAD, REPLICATION_CONFIG, "Automatically locks table with INSERT to keep SERIAL data consistency", CONFIG_VAR_TYPE_BOOL, false, 0 }, &g_pool_config.insert_lock, true, NULL, NULL, NULL }, { {"ignore_leading_white_space", CFGCXT_RELOAD, LOAD_BALANCE_CONFIG, "Ignores leading white spaces of each query string.", CONFIG_VAR_TYPE_BOOL, false, 0 }, &g_pool_config.ignore_leading_white_space, true, NULL, NULL, NULL }, { {"log_statement", CFGCXT_SESSION, LOGING_CONFIG, "Logs all statements in the pgpool logs.", CONFIG_VAR_TYPE_BOOL, false, 0 }, &g_pool_config.log_statement, false, NULL, NULL, NULL }, { {"log_per_node_statement", CFGCXT_SESSION, LOGING_CONFIG, "Logs per node detailed SQL statements.", CONFIG_VAR_TYPE_BOOL, false, 0 }, &g_pool_config.log_per_node_statement, false, NULL, NULL, NULL }, { {"log_client_messages", CFGCXT_SESSION, LOGING_CONFIG, "Logs any client messages in the pgpool logs.", CONFIG_VAR_TYPE_BOOL, false, 0 }, &g_pool_config.log_client_messages, false, NULL, NULL, NULL }, { {"use_watchdog", CFGCXT_INIT, WATCHDOG_CONFIG, "Enables the pgpool-II watchdog.", CONFIG_VAR_TYPE_BOOL, false, 0 }, &g_pool_config.use_watchdog, false, NULL, NULL, NULL }, { {"clear_memqcache_on_escalation", CFGCXT_RELOAD, WATCHDOG_CONFIG, "Clears the query cache in the shared memory when pgpool-II escaltes to master watchdog node.", CONFIG_VAR_TYPE_BOOL, false, 0 }, &g_pool_config.clear_memqcache_on_escalation, false, NULL, NULL, NULL }, { {"ssl", CFGCXT_INIT, SSL_CONFIG, "Enables SSL support for frontend and backend connections", CONFIG_VAR_TYPE_BOOL, false, 0 }, &g_pool_config.ssl, false, NULL, NULL, NULL }, { {"ssl_prefer_server_ciphers", CFGCXT_INIT, SSL_CONFIG, "Use server's SSL cipher preferences, rather than the client's", CONFIG_VAR_TYPE_BOOL, false, 0 }, &g_pool_config.ssl_prefer_server_ciphers, false, NULL, NULL, NULL }, { {"check_unlogged_table", CFGCXT_SESSION, GENERAL_CONFIG, "Enables unlogged table check.", CONFIG_VAR_TYPE_BOOL, false, 0 }, &g_pool_config.check_unlogged_table, true, NULL, NULL, NULL }, { {"memory_cache_enabled", CFGCXT_INIT, CACHE_CONFIG, "Enables the memory cache functionality.", CONFIG_VAR_TYPE_BOOL, false, 0 }, &g_pool_config.memory_cache_enabled, false, NULL, NULL, NULL }, { {"enable_shared_relcache", CFGCXT_INIT, CACHE_CONFIG, "relation cache stored in memory cache.", CONFIG_VAR_TYPE_BOOL, false, 0 }, &g_pool_config.enable_shared_relcache, true, NULL, NULL, NULL }, { {"memqcache_auto_cache_invalidation", CFGCXT_RELOAD, CACHE_CONFIG, "Automatically deletes the cache related to the updated tables.", CONFIG_VAR_TYPE_BOOL, false, 0 }, &g_pool_config.memqcache_auto_cache_invalidation, true, NULL, NULL, NULL }, { {"allow_sql_comments", CFGCXT_SESSION, LOAD_BALANCE_CONFIG, "Ignore SQL comments, while judging if load balance or query cache is possible.", CONFIG_VAR_TYPE_BOOL, false, 0 }, &g_pool_config.allow_sql_comments, false, NULL, NULL, NULL }, { {"allow_clear_text_frontend_auth", CFGCXT_RELOAD, GENERAL_CONFIG, "allow to use clear text password authentication with clients, when pool_passwd does not contain the user password.", CONFIG_VAR_TYPE_BOOL, false, 0 }, &g_pool_config.allow_clear_text_frontend_auth, false, NULL, NULL, NULL }, { {"statement_level_load_balance", CFGCXT_RELOAD, LOAD_BALANCE_CONFIG, "Enables statement level load balancing", CONFIG_VAR_TYPE_BOOL, false, 0 }, &g_pool_config.statement_level_load_balance, false, NULL, NULL, NULL }, { {"auto_failback", CFGCXT_RELOAD, FAILOVER_CONFIG, "Enables nodes automatically reattach, when dettached node continue streaming replication.", CONFIG_VAR_TYPE_BOOL, false, 0 }, &g_pool_config.auto_failback, false, NULL, NULL, NULL }, /* End-of-list marker */ EMPTY_CONFIG_BOOL }; static struct config_string ConfigureNamesString[] = { { {"database_redirect_preference_list", CFGCXT_RELOAD, STREAMING_REPLICATION_CONFIG, "redirect by database name.", CONFIG_VAR_TYPE_STRING, false, 0 }, &g_pool_config.database_redirect_preference_list, /* variable */ NULL, /* boot value */ NULL, /* assign_func */ NULL, /* check_func */ MakeDBRedirectListRegex, /* process func */ NULL /* show hook */ }, { {"app_name_redirect_preference_list", CFGCXT_RELOAD, STREAMING_REPLICATION_CONFIG, "redirect by application name.", CONFIG_VAR_TYPE_STRING, false, 0 }, &g_pool_config.app_name_redirect_preference_list, NULL, NULL, NULL, MakeAppRedirectListRegex, NULL }, { {"listen_addresses", CFGCXT_INIT, CONNECTION_CONFIG, "hostname or IP address on which pgpool will listen on.", CONFIG_VAR_TYPE_STRING, false, 0 }, &g_pool_config.listen_addresses, "localhost", NULL, NULL, NULL, NULL }, { {"pcp_listen_addresses", CFGCXT_INIT, CONNECTION_CONFIG, "hostname(s) or IP address(es) on which pcp will listen on.", CONFIG_VAR_TYPE_STRING, false, 0 }, &g_pool_config.pcp_listen_addresses, "*", NULL, NULL, NULL, NULL }, { {"socket_dir", CFGCXT_INIT, CONNECTION_CONFIG, "The directory to create the UNIX domain socket for accepting pgpool-II client connections.", CONFIG_VAR_TYPE_STRING, false, 0 }, &g_pool_config.socket_dir, DEFAULT_SOCKET_DIR, NULL, NULL, NULL, NULL }, { {"pcp_socket_dir", CFGCXT_INIT, CONNECTION_CONFIG, "The directory to create the UNIX domain socket for accepting pgpool-II PCP connections.", CONFIG_VAR_TYPE_STRING, false, 0 }, &g_pool_config.pcp_socket_dir, DEFAULT_SOCKET_DIR, NULL, NULL, NULL, NULL }, { {"wd_ipc_socket_dir", CFGCXT_INIT, CONNECTION_CONFIG, "The directory to create the UNIX domain socket for accepting pgpool-II watchdog IPC connections.", CONFIG_VAR_TYPE_STRING, false, 0 }, &g_pool_config.wd_ipc_socket_dir, DEFAULT_SOCKET_DIR, NULL, NULL, NULL, NULL }, { {"log_destination", CFGCXT_RELOAD, LOGING_CONFIG, "destination of pgpool-II log", CONFIG_VAR_TYPE_STRING, false, 0 }, &g_pool_config.log_destination_str, "stderr", NULL, NULL, LogDestinationProcessFunc, NULL }, { {"syslog_ident", CFGCXT_RELOAD, LOGING_CONFIG, "syslog program ident string.", CONFIG_VAR_TYPE_STRING, false, 0 }, &g_pool_config.syslog_ident, "pgpool", NULL, NULL, SyslogIdentProcessFunc, NULL }, { {"pid_file_name", CFGCXT_INIT, FILE_LOCATION_CONFIG, "Path to store pgpool-II pid file.", CONFIG_VAR_TYPE_STRING, false, 0 }, &g_pool_config.pid_file_name, DEFAULT_PID_FILE_NAME, NULL, NULL, NULL, NULL }, { {"pool_passwd", CFGCXT_INIT, FILE_LOCATION_CONFIG, "File name of pool_passwd for md5 authentication.", CONFIG_VAR_TYPE_STRING, false, VAR_HIDDEN_VALUE }, &g_pool_config.pool_passwd, "pool_passwd", NULL, NULL, NULL, NULL }, { {"log_line_prefix", CFGCXT_RELOAD, LOGING_CONFIG, "printf-style string to output at beginning of each log line.", CONFIG_VAR_TYPE_STRING, false, 0 }, &g_pool_config.log_line_prefix, "%t: pid %p: ", NULL, NULL, NULL, NULL }, { {"sr_check_user", CFGCXT_RELOAD, STREAMING_REPLICATION_CONFIG, "The User name to perform streaming replication delay check.", CONFIG_VAR_TYPE_STRING, false, 0 }, &g_pool_config.sr_check_user, "nobody", NULL, NULL, NULL, NULL }, { {"sr_check_password", CFGCXT_RELOAD, STREAMING_REPLICATION_CONFIG, "The password for user to perform streaming replication delay check.", CONFIG_VAR_TYPE_STRING, false, VAR_HIDDEN_VALUE }, &g_pool_config.sr_check_password, "", NULL, NULL, NULL, NULL }, { {"sr_check_database", CFGCXT_RELOAD, STREAMING_REPLICATION_CONFIG, "The database name to perform streaming replication delay check.", CONFIG_VAR_TYPE_STRING, false, 0 }, &g_pool_config.sr_check_database, "postgres", NULL, NULL, NULL, NULL }, { {"failback_command", CFGCXT_RELOAD, FAILOVER_CONFIG, "Command to execute when backend node is attached.", CONFIG_VAR_TYPE_STRING, false, 0 }, &g_pool_config.failback_command, "", NULL, NULL, NULL, NULL }, { {"follow_master_command", CFGCXT_RELOAD, FAILOVER_CONFIG, "Command to execute in master/slave streaming replication mode after a master node failover.", CONFIG_VAR_TYPE_STRING, false, 0 }, &g_pool_config.follow_master_command, "", NULL, NULL, NULL, NULL }, { {"failover_command", CFGCXT_RELOAD, FAILOVER_CONFIG, "Command to execute when backend node is detached.", CONFIG_VAR_TYPE_STRING, false, 0 }, &g_pool_config.failover_command, "", NULL, NULL, NULL, NULL }, { {"recovery_user", CFGCXT_RELOAD, RECOVERY_CONFIG, "User name for online recovery.", CONFIG_VAR_TYPE_STRING, false, 0 }, &g_pool_config.recovery_user, "", NULL, NULL, NULL, NULL }, { {"recovery_password", CFGCXT_RELOAD, RECOVERY_CONFIG, "Password for online recovery.", CONFIG_VAR_TYPE_STRING, false, VAR_HIDDEN_VALUE }, &g_pool_config.recovery_password, "", NULL, NULL, NULL, NULL }, { {"recovery_1st_stage_command", CFGCXT_RELOAD, RECOVERY_CONFIG, "Command to execute in first stage recovery.", CONFIG_VAR_TYPE_STRING, false, 0 }, &g_pool_config.recovery_1st_stage_command, "", NULL, NULL, NULL, NULL }, { {"recovery_2nd_stage_command", CFGCXT_RELOAD, RECOVERY_CONFIG, "Command to execute in second stage recovery.", CONFIG_VAR_TYPE_STRING, false, 0 }, &g_pool_config.recovery_2nd_stage_command, "", NULL, NULL, NULL, NULL }, { {"lobj_lock_table", CFGCXT_RELOAD, REPLICATION_CONFIG, "Table name used for large object replication control.", CONFIG_VAR_TYPE_STRING, false, 0 }, &g_pool_config.lobj_lock_table, "", NULL, NULL, NULL, NULL }, { {"wd_escalation_command", CFGCXT_RELOAD, WATCHDOG_CONFIG, "Command to execute when watchdog node becomes cluster master/leader node.", CONFIG_VAR_TYPE_STRING, false, 0 }, &g_pool_config.wd_escalation_command, "", NULL, NULL, NULL, NULL }, { {"wd_de_escalation_command", CFGCXT_RELOAD, WATCHDOG_CONFIG, "Command to execute when watchdog node resigns from the cluster master/leader node.", CONFIG_VAR_TYPE_STRING, false, 0 }, &g_pool_config.wd_de_escalation_command, "", NULL, NULL, NULL, NULL }, { {"trusted_servers", CFGCXT_INIT, WATCHDOG_CONFIG, "List of servers to verify connectivity.", CONFIG_VAR_TYPE_STRING, false, 0 }, &g_pool_config.trusted_servers, "", NULL, NULL, NULL, NULL }, { {"delegate_IP", CFGCXT_INIT, WATCHDOG_CONFIG, "Delegate IP address to be used when pgpool node become a watchdog cluster master/leader.", CONFIG_VAR_TYPE_STRING, false, 0 }, &g_pool_config.delegate_IP, "", NULL, NULL, NULL, NULL }, { {"wd_hostname", CFGCXT_INIT, WATCHDOG_CONFIG, "Host name or IP address of this watchdog.", CONFIG_VAR_TYPE_STRING, false, 0 }, &g_pool_config.wd_hostname, "", NULL, NULL, NULL, NULL }, { {"ping_path", CFGCXT_INIT, WATCHDOG_CONFIG, "path to ping command.", CONFIG_VAR_TYPE_STRING, false, 0 }, &g_pool_config.ping_path, "/bin", NULL, NULL, NULL, NULL }, { {"if_cmd_path", CFGCXT_INIT, WATCHDOG_CONFIG, "Path to interface command.", CONFIG_VAR_TYPE_STRING, false, 0 }, &g_pool_config.if_cmd_path, "/sbin", NULL, NULL, NULL, NULL }, { {"if_up_cmd", CFGCXT_INIT, WATCHDOG_CONFIG, "Complete command to bring UP virtual interface.", CONFIG_VAR_TYPE_STRING, false, 0 }, &g_pool_config.if_up_cmd, "/usr/bin/sudo /sbin/ip addr add $_IP_$/24 dev eth0 label eth0:0", NULL, NULL, NULL, NULL }, { {"if_down_cmd", CFGCXT_INIT, WATCHDOG_CONFIG, "Complete command to bring down virtual interface.", CONFIG_VAR_TYPE_STRING, false, 0 }, &g_pool_config.if_down_cmd, "/usr/bin/sudo /sbin/ip addr del $_IP_$/24 dev eth0", NULL, NULL, NULL, NULL }, { {"arping_path", CFGCXT_INIT, WATCHDOG_CONFIG, "path to arping command.", CONFIG_VAR_TYPE_STRING, false, 0 }, &g_pool_config.arping_path, "/usr/sbin", NULL, NULL, NULL, NULL }, { {"arping_cmd", CFGCXT_INIT, WATCHDOG_CONFIG, "arping command.", CONFIG_VAR_TYPE_STRING, false, 0 }, &g_pool_config.arping_cmd, "/usr/bin/sudo /usr/sbin/arping -U $_IP_$ -w 1 -I eth0", NULL, NULL, NULL, NULL }, { {"wd_lifecheck_query", CFGCXT_INIT, WATCHDOG_CONFIG, "SQL query to be used by watchdog lifecheck.", CONFIG_VAR_TYPE_STRING, false, 0 }, &g_pool_config.wd_lifecheck_query, "SELECT 1", NULL, NULL, NULL, NULL }, { {"wd_lifecheck_dbname", CFGCXT_RELOAD, WATCHDOG_CONFIG, "Database name to be used for by watchdog lifecheck.", CONFIG_VAR_TYPE_STRING, false, 0 }, &g_pool_config.wd_lifecheck_dbname, "postgres", NULL, NULL, NULL, NULL }, { {"wd_lifecheck_user", CFGCXT_RELOAD, WATCHDOG_CONFIG, "User name to be used for by watchdog lifecheck.", CONFIG_VAR_TYPE_STRING, false, 0 }, &g_pool_config.wd_lifecheck_user, "nobody", NULL, NULL, NULL, NULL }, { {"wd_lifecheck_password", CFGCXT_RELOAD, WATCHDOG_CONFIG, "Password for watchdog user in lifecheck.", CONFIG_VAR_TYPE_STRING, false, VAR_HIDDEN_VALUE }, &g_pool_config.wd_lifecheck_password, "postgres", NULL, NULL, NULL, NULL }, { {"wd_authkey", CFGCXT_RELOAD, WATCHDOG_CONFIG, "Authentication key to be used in watchdog communication.", CONFIG_VAR_TYPE_STRING, false, 0 }, &g_pool_config.wd_authkey, "", NULL, NULL, NULL, NULL }, { {"ssl_cert", CFGCXT_INIT, SSL_CONFIG, "Path to the SSL public certificate file.", CONFIG_VAR_TYPE_STRING, false, 0 }, &g_pool_config.ssl_cert, "", NULL, NULL, NULL, NULL }, { {"ssl_key", CFGCXT_INIT, SSL_CONFIG, "Path to the SSL private key file.", CONFIG_VAR_TYPE_STRING, false, 0 }, &g_pool_config.ssl_key, "", NULL, NULL, NULL, NULL }, { {"ssl_ca_cert", CFGCXT_INIT, SSL_CONFIG, "Path to a single PEM format file.", CONFIG_VAR_TYPE_STRING, false, 0 }, &g_pool_config.ssl_ca_cert, "", NULL, NULL, NULL, NULL }, { {"ssl_ca_cert_dir", CFGCXT_INIT, SSL_CONFIG, "Directory containing CA root certificate(s).", CONFIG_VAR_TYPE_STRING, false, 0 }, &g_pool_config.ssl_ca_cert_dir, "", NULL, NULL, NULL, NULL }, { {"ssl_ciphers", CFGCXT_INIT, SSL_CONFIG, "Allowed SSL ciphers.", CONFIG_VAR_TYPE_STRING, false, 0 }, &g_pool_config.ssl_ciphers, "HIGH:MEDIUM:+3DES:!aNULL", NULL, NULL, NULL, NULL }, { {"ssl_ecdh_curve", CFGCXT_INIT, SSL_CONFIG, "The curve to use in ECDH key exchange.", CONFIG_VAR_TYPE_STRING, false, 0 }, &g_pool_config.ssl_ecdh_curve, "prime256v1", NULL, NULL, NULL, NULL }, { {"ssl_dh_params_file", CFGCXT_INIT, SSL_CONFIG, "Path to the Diffie-Hellman parameters contained file", CONFIG_VAR_TYPE_STRING, false, 0 }, &g_pool_config.ssl_dh_params_file, "", NULL, NULL, NULL, NULL }, { {"memqcache_oiddir", CFGCXT_INIT, CACHE_CONFIG, "Tempory directory to record table oids.", CONFIG_VAR_TYPE_STRING, false, 0 }, &g_pool_config.memqcache_oiddir, "/var/log/pgpool/oiddir", NULL, NULL, NULL, NULL }, { {"memqcache_memcached_host", CFGCXT_INIT, CACHE_CONFIG, "Hostname or IP address of memcached.", CONFIG_VAR_TYPE_STRING, false, 0 }, &g_pool_config.memqcache_memcached_host, "localhost", NULL, NULL, NULL, NULL }, { {"logdir", CFGCXT_INIT, LOGING_CONFIG, "PgPool status file logging directory.", CONFIG_VAR_TYPE_STRING, false, 0 }, &g_pool_config.logdir, DEFAULT_LOGDIR, NULL, NULL, NULL, NULL }, /* End-of-list marker */ EMPTY_CONFIG_STRING }; static struct config_string_list ConfigureNamesStringList[] = { { {"reset_query_list", CFGCXT_RELOAD, CONNECTION_POOL_CONFIG, "list of commands sent to reset the backend connection when user session exits.", CONFIG_VAR_TYPE_STRING_LIST, false, 0 }, &g_pool_config.reset_query_list, /* variable */ &g_pool_config.num_reset_queries, /* item count var */ (const char *) default_reset_query_list, /* boot value */ ";", /* token seperator */ false, /* compute_regex ? */ NULL, NULL, NULL /* assign, check, show funcs */ }, { {"white_function_list", CFGCXT_RELOAD, CONNECTION_POOL_CONFIG, "list of functions that does not writes to database.", CONFIG_VAR_TYPE_STRING_LIST, false, 0 }, &g_pool_config.white_function_list, &g_pool_config.num_white_function_list, NULL, ",", true, NULL, NULL, NULL }, { {"black_function_list", CFGCXT_RELOAD, CONNECTION_POOL_CONFIG, "list of functions that writes to database.", CONFIG_VAR_TYPE_STRING_LIST, false, 0 }, &g_pool_config.black_function_list, &g_pool_config.num_black_function_list, (const char *) default_black_function_list, ",", true, NULL, NULL, NULL }, { {"white_memqcache_table_list", CFGCXT_RELOAD, CACHE_CONFIG, "list of tables to be cached.", CONFIG_VAR_TYPE_STRING_LIST, false, 0 }, &g_pool_config.white_memqcache_table_list, &g_pool_config.num_white_memqcache_table_list, NULL, ",", true, NULL, NULL, NULL }, { {"black_memqcache_table_list", CFGCXT_RELOAD, CACHE_CONFIG, "list of tables should not be cached.", CONFIG_VAR_TYPE_STRING_LIST, false, 0 }, &g_pool_config.black_memqcache_table_list, &g_pool_config.num_black_memqcache_table_list, NULL, ",", true, NULL, NULL, NULL }, { {"black_query_pattern_list", CFGCXT_RELOAD, CONNECTION_POOL_CONFIG, "list of query patterns that should be sent to primary node.", CONFIG_VAR_TYPE_STRING_LIST, false, 0 }, &g_pool_config.black_query_pattern_list, &g_pool_config.num_black_query_pattern_list, NULL, ";", true, NULL, NULL, NULL }, { {"wd_monitoring_interfaces_list", CFGCXT_INIT, WATCHDOG_CONFIG, "List of network device names, to be monitored by the watchdog process for the network link state.", CONFIG_VAR_TYPE_STRING, false, 0 }, &g_pool_config.wd_monitoring_interfaces_list, &g_pool_config.num_wd_monitoring_interfaces_list, NULL, ",", false, NULL, NULL, NULL }, /* End-of-list marker */ EMPTY_CONFIG_STRING_LIST }; /* long configs*/ static struct config_long ConfigureNamesLong[] = { { {"delay_threshold", CFGCXT_RELOAD, STREAMING_REPLICATION_CONFIG, "standby delay threshold.", CONFIG_VAR_TYPE_LONG, false, 0 }, &g_pool_config.delay_threshold, 0, 0, LONG_MAX, NULL, NULL, NULL }, { {"relcache_expire", CFGCXT_INIT, CACHE_CONFIG, "Relation cache expiration time in seconds.", CONFIG_VAR_TYPE_LONG, false, 0 }, &g_pool_config.relcache_expire, 0, 0, LONG_MAX, NULL, NULL, NULL }, { {"memqcache_total_size", CFGCXT_INIT, CACHE_CONFIG, "Total memory size in bytes for storing memory cache.", CONFIG_VAR_TYPE_LONG, false, 0 }, &g_pool_config.memqcache_total_size, (int64) 67108864, 0, LONG_MAX, NULL, NULL, NULL }, /* End-of-list marker */ EMPTY_CONFIG_LONG }; static struct config_int_array ConfigureNamesIntArray[] = { { {"backend_port", CFGCXT_RELOAD, CONNECTION_CONFIG, "port number of PostgreSQL backend.", CONFIG_VAR_TYPE_INT_ARRAY, true, 0, MAX_NUM_BACKENDS }, NULL, 0, 1024, 65535, EMPTY_CONFIG_INT, BackendPortAssignFunc, NULL, BackendPortShowFunc, BackendSlotEmptyCheckFunc }, { {"heartbeat_destination_port", CFGCXT_RELOAD, WATCHDOG_LIFECHECK, "Destination port for sending heartbeat.", CONFIG_VAR_TYPE_INT_ARRAY, true, 0, WD_MAX_IF_NUM }, NULL, 0, 1024, 65535, EMPTY_CONFIG_INT, HBDestinationPortAssignFunc, NULL, HBDestinationPortShowFunc, WdIFSlotEmptyCheckFunc }, { {"other_wd_port", CFGCXT_RELOAD, WATCHDOG_CONFIG, "tcp/ip watchdog port number of other pgpool node for watchdog connection..", CONFIG_VAR_TYPE_INT_ARRAY, true, 0, MAX_WATCHDOG_NUM }, NULL, 0, 1024, 65535, EMPTY_CONFIG_INT, OtherWDPortAssignFunc, NULL, OtherWDPortShowFunc, WdSlotEmptyCheckFunc }, { {"other_pgpool_port", CFGCXT_RELOAD, WATCHDOG_CONFIG, "tcp/ip pgpool port number of other pgpool node for watchdog connection.", CONFIG_VAR_TYPE_INT_ARRAY, true, 0, MAX_WATCHDOG_NUM }, NULL, 0, 1024, 65535, EMPTY_CONFIG_INT, OtherPPPortAssignFunc, NULL, OtherPPPortShowFunc, WdSlotEmptyCheckFunc }, { {"health_check_timeout", CFGCXT_RELOAD, HEALTH_CHECK_CONFIG, "Backend node health check timeout value in seconds.", CONFIG_VAR_TYPE_INT_ARRAY, true, 0, MAX_NUM_BACKENDS }, NULL, 20, 0, INT_MAX, { {"health_check_timeout", CFGCXT_RELOAD, HEALTH_CHECK_CONFIG, "Default health check timeout value for node for which health_check_timeout[node-id] is not specified.", CONFIG_VAR_TYPE_INT, false, DEFAULT_FOR_NO_VALUE_ARRAY_VAR }, &g_pool_config.health_check_timeout, 20, 0, INT_MAX, NULL, NULL, NULL }, HealthCheckTimeOutAssignFunc, NULL, HealthCheckTimeOutShowFunc, BackendSlotEmptyCheckFunc }, { {"health_check_period", CFGCXT_RELOAD, HEALTH_CHECK_CONFIG, "Time interval in seconds between the health checks.", CONFIG_VAR_TYPE_INT_ARRAY, true, 0, MAX_NUM_BACKENDS }, NULL, 0, 0, INT_MAX, { {"health_check_period", CFGCXT_RELOAD, HEALTH_CHECK_CONFIG, "Default time interval between health checks for node for which health_check_period[node-id] is not specified.", CONFIG_VAR_TYPE_INT, false, DEFAULT_FOR_NO_VALUE_ARRAY_VAR }, &g_pool_config.health_check_period, 0, 0, INT_MAX, NULL, NULL, NULL }, HealthCheckPeriodAssignFunc, NULL, HealthCheckPeriodShowFunc, BackendSlotEmptyCheckFunc }, { {"health_check_max_retries", CFGCXT_RELOAD, HEALTH_CHECK_CONFIG, "The maximum number of times to retry a failed health check before giving up and initiating failover.", CONFIG_VAR_TYPE_INT_ARRAY, true, 0, MAX_NUM_BACKENDS }, NULL, 0, 0, INT_MAX, { {"health_check_max_retries", CFGCXT_RELOAD, HEALTH_CHECK_CONFIG, "Default maximum number of retries for node for which health_check_max_retries[node-id] is not specified.", CONFIG_VAR_TYPE_INT, false, DEFAULT_FOR_NO_VALUE_ARRAY_VAR }, &g_pool_config.health_check_max_retries, 0, 0, INT_MAX, NULL, NULL, NULL }, HealthCheckMaxRetriesAssignFunc, NULL, HealthCheckMaxRetriesShowFunc, BackendSlotEmptyCheckFunc }, { {"health_check_retry_delay", CFGCXT_RELOAD, HEALTH_CHECK_CONFIG, "The amount of time in seconds to wait between failed health check retries.", CONFIG_VAR_TYPE_INT_ARRAY, true, 0, MAX_NUM_BACKENDS }, NULL, 1, 0, INT_MAX, { {"health_check_retry_delay", CFGCXT_RELOAD, HEALTH_CHECK_CONFIG, "Default time between failed health check retries for node for which health_check_retry_delay[node-id] is not specified.", CONFIG_VAR_TYPE_INT, false, DEFAULT_FOR_NO_VALUE_ARRAY_VAR }, &g_pool_config.health_check_retry_delay, 1, 0, INT_MAX, NULL, NULL, NULL }, HealthCheckRetryDelayAssignFunc, NULL, HealthCheckRetryDelayShowFunc, BackendSlotEmptyCheckFunc }, { {"connect_timeout", CFGCXT_RELOAD, HEALTH_CHECK_CONFIG, "Timeout in milliseconds before giving up connecting to backend.", CONFIG_VAR_TYPE_INT_ARRAY, true, 0, MAX_NUM_BACKENDS }, NULL, 10000, 0, INT_MAX, { {"connect_timeout", CFGCXT_RELOAD, HEALTH_CHECK_CONFIG, "Default connect_timeout value for node for which connect_timeout[node-id] is not specified.", CONFIG_VAR_TYPE_INT, false, DEFAULT_FOR_NO_VALUE_ARRAY_VAR }, &g_pool_config.connect_timeout, 10000, 0, INT_MAX, NULL, NULL, NULL }, HealthCheckConnectTimeOutAssignFunc, NULL, HealthCheckConnectTimeOutShowFunc, BackendSlotEmptyCheckFunc }, /* End-of-list marker */ EMPTY_CONFIG_INT_ARRAY }; static struct config_double ConfigureNamesDouble[] = { /* End-of-list marker */ EMPTY_CONFIG_DOUBLE }; static struct config_double_array ConfigureNamesDoubleArray[] = { { {"backend_weight", CFGCXT_RELOAD, CONNECTION_CONFIG, "load balance weight of backend.", CONFIG_VAR_TYPE_DOUBLE_ARRAY, true, 0, MAX_NUM_BACKENDS }, NULL, 0, 0.0, 100000000.0, EMPTY_CONFIG_DOUBLE, BackendWeightAssignFunc, NULL, BackendWeightShowFunc, BackendSlotEmptyCheckFunc }, /* End-of-list marker */ EMPTY_CONFIG_DOUBLE_ARRAY }; static struct config_string_array ConfigureNamesStringArray[] = { { {"backend_hostname", CFGCXT_RELOAD, CONNECTION_CONFIG, "hostname or IP address of PostgreSQL backend.", CONFIG_VAR_TYPE_STRING_ARRAY, true, 0, MAX_NUM_BACKENDS }, NULL, "", EMPTY_CONFIG_STRING, BackendHostAssignFunc, NULL, BackendHostShowFunc, BackendSlotEmptyCheckFunc }, { {"backend_data_directory", CFGCXT_RELOAD, CONNECTION_CONFIG, "data directory of the backend.", CONFIG_VAR_TYPE_STRING_ARRAY, true, 0, MAX_NUM_BACKENDS }, NULL, "", EMPTY_CONFIG_STRING, BackendDataDirAssignFunc, NULL, BackendDataDirShowFunc, BackendSlotEmptyCheckFunc }, { {"backend_application_name", CFGCXT_RELOAD, CONNECTION_CONFIG, "applicaton_name of the backend.", CONFIG_VAR_TYPE_STRING_ARRAY, true, 0, MAX_NUM_BACKENDS }, NULL, "", EMPTY_CONFIG_STRING, BackendAppNameAssignFunc, NULL, BackendAppNameShowFunc, BackendSlotEmptyCheckFunc }, { {"backend_flag", CFGCXT_RELOAD, CONNECTION_CONFIG, "Controls various backend behavior.", CONFIG_VAR_TYPE_STRING_ARRAY, true, 0, MAX_NUM_BACKENDS }, NULL, "ALLOW_TO_FAILOVER", EMPTY_CONFIG_STRING, BackendFlagsAssignFunc, NULL, BackendFlagsShowFunc, BackendSlotEmptyCheckFunc }, { {"backend_flag", CFGCXT_RELOAD, CONNECTION_CONFIG, "Controls various backend behavior.", CONFIG_VAR_TYPE_STRING_ARRAY, true, 0, MAX_NUM_BACKENDS }, NULL, "ALWAYS_MASTER", EMPTY_CONFIG_STRING, BackendFlagsAssignFunc, NULL, BackendFlagsShowFunc, BackendSlotEmptyCheckFunc }, { {"heartbeat_destination", CFGCXT_RELOAD, WATCHDOG_LIFECHECK, "destination host for sending heartbeat signal.", CONFIG_VAR_TYPE_STRING_ARRAY, true, 0, WD_MAX_IF_NUM }, NULL, "", EMPTY_CONFIG_STRING, HBDestinationAssignFunc, NULL, HBDestinationShowFunc, WdIFSlotEmptyCheckFunc }, { {"heartbeat_device", CFGCXT_RELOAD, WATCHDOG_LIFECHECK, "Name of NIC device for sending hearbeat.", CONFIG_VAR_TYPE_STRING_ARRAY, true, 0, WD_MAX_IF_NUM }, NULL, "", EMPTY_CONFIG_STRING, HBDeviceAssignFunc, NULL, HBDeviceShowFunc, WdIFSlotEmptyCheckFunc }, { {"other_pgpool_hostname", CFGCXT_RELOAD, WATCHDOG_LIFECHECK, "Hostname of other pgpool node for watchdog connection.", CONFIG_VAR_TYPE_STRING_ARRAY, true, 0, MAX_WATCHDOG_NUM }, NULL, "localhost", EMPTY_CONFIG_STRING, OtherPPHostAssignFunc, NULL, OtherPPHostShowFunc, WdSlotEmptyCheckFunc }, { {"health_check_user", CFGCXT_RELOAD, HEALTH_CHECK_CONFIG, "User name for PostgreSQL backend health check.", CONFIG_VAR_TYPE_STRING_ARRAY, true, 0, MAX_NUM_BACKENDS }, NULL, "nobody", { {"health_check_user", CFGCXT_RELOAD, HEALTH_CHECK_CONFIG, "Default PostgreSQL user name to perform health check on node for which health_check_user[node-id] is not specified.", CONFIG_VAR_TYPE_STRING, false, DEFAULT_FOR_NO_VALUE_ARRAY_VAR }, &g_pool_config.health_check_user, "nobody", NULL, NULL, NULL, NULL }, HealthCheckUserAssignFunc, NULL, HealthCheckUserShowFunc, BackendSlotEmptyCheckFunc }, { {"health_check_password", CFGCXT_RELOAD, HEALTH_CHECK_CONFIG, "Password for PostgreSQL backend health check database user.", CONFIG_VAR_TYPE_STRING_ARRAY, true, VAR_HIDDEN_VALUE, MAX_NUM_BACKENDS }, NULL, "", { {"health_check_password", CFGCXT_RELOAD, HEALTH_CHECK_CONFIG, "Default PostgreSQL user password to perform health check on node for which health_check_password[node-id] is not specified.", CONFIG_VAR_TYPE_STRING, false, VAR_HIDDEN_VALUE | DEFAULT_FOR_NO_VALUE_ARRAY_VAR }, &g_pool_config.health_check_password, "", NULL, NULL, NULL, NULL }, HealthCheckPasswordAssignFunc, NULL, HealthCheckPasswordShowFunc, BackendSlotEmptyCheckFunc }, { {"health_check_database", CFGCXT_RELOAD, HEALTH_CHECK_CONFIG, "The database name to be used to perform PostgreSQL backend health check.", CONFIG_VAR_TYPE_STRING_ARRAY, true, 0, MAX_NUM_BACKENDS }, NULL, "postgres", { {"health_check_database", CFGCXT_RELOAD, HEALTH_CHECK_CONFIG, "Default PostgreSQL database name to perform health check on node for which health_check_database[node-id] is not specified.", CONFIG_VAR_TYPE_STRING, false, DEFAULT_FOR_NO_VALUE_ARRAY_VAR }, &g_pool_config.health_check_database, "postgres", NULL, NULL, NULL, NULL }, HealthCheckDatabaseAssignFunc, NULL, HealthCheckDatabaseShowFunc, BackendSlotEmptyCheckFunc }, /* End-of-list marker */ EMPTY_CONFIG_STRING_ARRAY }; /* int configs*/ static struct config_int ConfigureNamesInt[] = { { {"port", CFGCXT_INIT, CONNECTION_CONFIG, "tcp/IP port number on which pgpool will listen on.", CONFIG_VAR_TYPE_INT, false, 0 }, &g_pool_config.port, 9999, 1024, 65535, NULL, NULL, NULL }, { {"pcp_port", CFGCXT_INIT, CONNECTION_CONFIG, "tcp/IP port number on which pgpool PCP process will listen on.", CONFIG_VAR_TYPE_INT, false, 0 }, &g_pool_config.pcp_port, 9898, 1024, 65535, NULL, NULL, NULL }, { {"num_init_children", CFGCXT_INIT, CONNECTION_POOL_CONFIG, "Number of children pre-forked for client connections.", CONFIG_VAR_TYPE_INT, false, 0 }, &g_pool_config.num_init_children, 32, 1, INT_MAX, NULL, NULL, NULL }, { {"reserved_connections", CFGCXT_INIT, CONNECTION_POOL_CONFIG, "Number of reserved connections.", CONFIG_VAR_TYPE_INT, false, 0 }, &g_pool_config.reserved_connections, 0, 0, INT_MAX, NULL, NULL, NULL }, { {"listen_backlog_multiplier", CFGCXT_INIT, CONNECTION_CONFIG, "length of connection queue from frontend to pgpool-II", CONFIG_VAR_TYPE_INT, false, 0 }, &g_pool_config.listen_backlog_multiplier, 32, 1, INT_MAX, NULL, NULL, NULL }, { {"child_life_time", CFGCXT_INIT, CONNECTION_POOL_CONFIG, "pgpool-II child process life time in seconds.", CONFIG_VAR_TYPE_INT, false, 0 }, &g_pool_config.child_life_time, 300, 0, INT_MAX, NULL, NULL, NULL }, { {"client_idle_limit", CFGCXT_SESSION, CONNECTION_POOL_CONFIG, "idle time in seconds to disconnects a client.", CONFIG_VAR_TYPE_INT, false, 0 }, &g_pool_config.client_idle_limit, 0, 0, INT_MAX, NULL, NULL, NULL }, { {"connection_life_time", CFGCXT_INIT, CONNECTION_POOL_CONFIG, "Cached connections expiration time in seconds.", CONFIG_VAR_TYPE_INT, false, 0 }, &g_pool_config.connection_life_time, 0, 0, INT_MAX, NULL, NULL, NULL }, { {"child_max_connections", CFGCXT_INIT, CONNECTION_POOL_CONFIG, "A pgpool-II child process will be terminated after this many connections from clients.", CONFIG_VAR_TYPE_INT, false, 0 }, &g_pool_config.child_max_connections, 0, 0, INT_MAX, NULL, NULL, NULL }, { {"authentication_timeout", CFGCXT_INIT, CONNECTION_CONFIG, "Time out value in seconds for client authentication.", CONFIG_VAR_TYPE_INT, false, 0 }, &g_pool_config.authentication_timeout, 0, 0, INT_MAX, NULL, NULL, NULL }, { {"max_pool", CFGCXT_INIT, CONNECTION_POOL_CONFIG, "Maximum number of connection pools per child process.", CONFIG_VAR_TYPE_INT, false, 0 }, &g_pool_config.max_pool, 4, 0, INT_MAX, NULL, NULL, NULL }, { {"sr_check_period", CFGCXT_RELOAD, STREAMING_REPLICATION_CONFIG, "Time interval in seconds between the streaming replication delay checks.", CONFIG_VAR_TYPE_INT, false, 0 }, &g_pool_config.sr_check_period, 0, 0, INT_MAX, NULL, NULL, NULL }, { {"recovery_timeout", CFGCXT_RELOAD, RECOVERY_CONFIG, "Maximum time in seconds to wait for the recovering PostgreSQL node.", CONFIG_VAR_TYPE_INT, false, 0 }, &g_pool_config.recovery_timeout, 90, 0, INT_MAX, NULL, NULL, NULL }, { {"client_idle_limit_in_recovery", CFGCXT_SESSION, RECOVERY_CONFIG, "Time limit is seconds for the child connection, before it is terminated during the 2nd stage recovery.", CONFIG_VAR_TYPE_INT, false, 0 }, &g_pool_config.client_idle_limit_in_recovery, 0, -1, INT_MAX, NULL, NULL, NULL }, { {"search_primary_node_timeout", CFGCXT_RELOAD, FAILOVER_CONFIG, "Max time in seconds to search for primary node after failover.", CONFIG_VAR_TYPE_INT, false, 0 }, &g_pool_config.search_primary_node_timeout, 300, 0, INT_MAX, NULL, NULL, NULL }, { {"wd_port", CFGCXT_INIT, WATCHDOG_CONFIG, "tcp/IP port number on which watchdog of process of pgpool will listen on.", CONFIG_VAR_TYPE_INT, false, 0 }, &g_pool_config.wd_port, 9000, 1024, INT_MAX, NULL, NULL, NULL }, { {"wd_priority", CFGCXT_INIT, WATCHDOG_CONFIG, "Watchdog node priority for leader election.", CONFIG_VAR_TYPE_INT, false, 0 }, &g_pool_config.wd_priority, 1, 0, INT_MAX, NULL, NULL, NULL }, { {"wd_interval", CFGCXT_INIT, WATCHDOG_CONFIG, "Time interval in seconds between life check.", CONFIG_VAR_TYPE_INT, false, 0 }, &g_pool_config.wd_interval, 10, 0, INT_MAX, NULL, NULL, NULL }, { {"wd_life_point", CFGCXT_INIT, WATCHDOG_CONFIG, "Maximum number of retries before failing the life check.", CONFIG_VAR_TYPE_INT, false, 0 }, &g_pool_config.wd_life_point, 3, 0, INT_MAX, NULL, NULL, NULL }, { {"wd_heartbeat_port", CFGCXT_INIT, WATCHDOG_CONFIG, "Port number for receiving heartbeat signal.", CONFIG_VAR_TYPE_INT, false, 0 }, &g_pool_config.wd_heartbeat_port, 9694, 1024, 65535, NULL, NULL, NULL }, { {"wd_heartbeat_keepalive", CFGCXT_INIT, WATCHDOG_CONFIG, "Time interval in seconds between sending the heartbeat siganl.", CONFIG_VAR_TYPE_INT, false, 0 }, &g_pool_config.wd_heartbeat_keepalive, 2, 1, INT_MAX, NULL, NULL, NULL }, { {"wd_heartbeat_deadtime", CFGCXT_INIT, WATCHDOG_CONFIG, "Deadtime interval in seconds for heartbeat siganl.", CONFIG_VAR_TYPE_INT, false, 0 }, &g_pool_config.wd_heartbeat_deadtime, 30, 1, INT_MAX, NULL, NULL, NULL }, { {"relcache_size", CFGCXT_INIT, CACHE_CONFIG, "Number of relation cache entry.", CONFIG_VAR_TYPE_INT, false, 0 }, &g_pool_config.relcache_size, 256, 0, INT_MAX, NULL, NULL, NULL }, { {"memqcache_memcached_port", CFGCXT_INIT, CACHE_CONFIG, "Port number of Memcached server.", CONFIG_VAR_TYPE_INT, false, 0 }, &g_pool_config.memqcache_memcached_port, 11211, 0, INT_MAX, NULL, NULL, NULL }, { {"memqcache_max_num_cache", CFGCXT_INIT, CACHE_CONFIG, "Total number of cache entries.", CONFIG_VAR_TYPE_INT, false, 0 }, &g_pool_config.memqcache_max_num_cache, 1000000, 0, INT_MAX, NULL, NULL, NULL }, { {"memqcache_expire", CFGCXT_INIT, CACHE_CONFIG, "Memory cache entry life time specified in seconds.", CONFIG_VAR_TYPE_INT, false, 0 }, &g_pool_config.memqcache_expire, 0, 0, INT_MAX, NULL, NULL, NULL }, { {"memqcache_maxcache", CFGCXT_INIT, CACHE_CONFIG, "Maximum SELECT result size in bytes.", CONFIG_VAR_TYPE_INT, false, 0 }, &g_pool_config.memqcache_maxcache, 409600, 0, INT_MAX, NULL, NULL, NULL }, { {"memqcache_cache_block_size", CFGCXT_INIT, CACHE_CONFIG, "Cache block size in bytes.", CONFIG_VAR_TYPE_INT, false, 0 }, &g_pool_config.memqcache_cache_block_size, 1048576, 512, INT_MAX, NULL, NULL, NULL }, { {"auto_failback_interval", CFGCXT_RELOAD, FAILOVER_CONFIG, "min interval of executing auto_failback in seconds", CONFIG_VAR_TYPE_INT, false, 0 }, &g_pool_config.auto_failback_interval, 60, 0, INT_MAX, NULL, NULL, NULL }, /* End-of-list marker */ EMPTY_CONFIG_INT }; static struct config_enum ConfigureNamesEnum[] = { { {"syslog_facility", CFGCXT_RELOAD, LOGING_CONFIG, "syslog local faclity.", CONFIG_VAR_TYPE_ENUM, false, 0 }, &g_pool_config.syslog_facility, LOG_LOCAL0, syslog_facility_options, NULL, NULL, SyslogFacilityProcessFunc, NULL }, { {"log_error_verbosity", CFGCXT_SESSION, LOGING_CONFIG, "How much details about error should be emitted.", CONFIG_VAR_TYPE_ENUM, false, 0 }, &g_pool_config.log_error_verbosity, PGERROR_DEFAULT, log_error_verbosity_options, NULL, NULL, NULL, NULL }, { {"client_min_messages", CFGCXT_SESSION, LOGING_CONFIG, "Which messages should be sent to client.", CONFIG_VAR_TYPE_ENUM, false, 0 }, &g_pool_config.client_min_messages, NOTICE, server_message_level_options, NULL, NULL, NULL, NULL }, { {"log_min_messages", CFGCXT_SESSION, LOGING_CONFIG, "Which messages should be emitted to server log.", CONFIG_VAR_TYPE_ENUM, false, 0 }, &g_pool_config.log_min_messages, WARNING, server_message_level_options, NULL, NULL, NULL, NULL }, { {"master_slave_sub_mode", CFGCXT_INIT, MASTER_SLAVE_CONFIG, "master/slave sub mode.", CONFIG_VAR_TYPE_ENUM, false, 0 }, (int *) &g_pool_config.master_slave_sub_mode, STREAM_MODE, master_slave_sub_mode_options, NULL, NULL, NULL, NULL }, { {"log_standby_delay", CFGCXT_RELOAD, MASTER_SLAVE_CONFIG, "When to log standby delay.", CONFIG_VAR_TYPE_ENUM, false, 0 }, (int *) &g_pool_config.log_standby_delay, LSD_NONE, log_standby_delay_options, NULL, NULL, NULL, NULL }, { {"wd_lifecheck_method", CFGCXT_INIT, WATCHDOG_CONFIG, "method for watchdog lifecheck.", CONFIG_VAR_TYPE_ENUM, false, 0 }, (int *) &g_pool_config.wd_lifecheck_method, LIFECHECK_BY_HB, wd_lifecheck_method_options, NULL, NULL, NULL, NULL }, { {"memqcache_method", CFGCXT_INIT, CACHE_CONFIG, "Cache store method. either shmem(shared memory) or Memcached. shmem by default.", CONFIG_VAR_TYPE_ENUM, false, 0 }, (int *) &g_pool_config.memqcache_method, SHMEM_CACHE, memqcache_method_options, NULL, NULL, NULL, NULL }, { {"disable_load_balance_on_write", CFGCXT_RELOAD, LOAD_BALANCE_CONFIG, "Load balance behavior when write query is received.", CONFIG_VAR_TYPE_ENUM, false, 0 }, (int *) &g_pool_config.disable_load_balance_on_write, DLBOW_TRANSACTION, disable_load_balance_on_write_options, NULL, NULL, NULL, NULL }, { {"relcache_query_target", CFGCXT_RELOAD, LOAD_BALANCE_CONFIG, "Target node to send relache queries.", CONFIG_VAR_TYPE_ENUM, false, 0 }, (int *) &g_pool_config.relcache_query_target, RELQTARGET_MASTER, relcache_query_target_options, NULL, NULL, NULL, NULL }, { {"check_temp_table", CFGCXT_RELOAD, GENERAL_CONFIG, "Enables temporary table check.", CONFIG_VAR_TYPE_BOOL, false, 0 }, (int *) &g_pool_config.check_temp_table, CHECK_TEMP_CATALOG, check_temp_table_options, NULL, NULL, NULL, NULL }, /* End-of-list marker */ EMPTY_CONFIG_ENUM }; /* finally the groups */ static struct config_grouped_array_var ConfigureVarGroups[] = { { {"backend", CFGCXT_BOOT, CONNECTION_CONFIG, "backend configuration group.", CONFIG_VAR_TYPE_GROUP, false, 0 }, -1, /* until initialized */ NULL }, { {"other_pgpool", CFGCXT_BOOT, WATCHDOG_CONFIG, "watchdog nodes configuration group.", CONFIG_VAR_TYPE_GROUP, false, 0 }, -1, /* until initialized */ NULL }, { {"heartbeat", CFGCXT_BOOT, WATCHDOG_LIFECHECK, "heartbeat configuration group.", CONFIG_VAR_TYPE_GROUP, false, 0 }, -1, /* until initialized */ NULL }, { {"health_check", CFGCXT_BOOT, HEALTH_CHECK_CONFIG, "backend health check configuration group.", CONFIG_VAR_TYPE_GROUP, false, 0 }, -1, /* until initialized */ NULL }, /* End-of-list marker */ EMPTY_CONFIG_GROUP_ARRAY }; static void initialize_config_gen(struct config_generic *gen) { if (gen->dynamic_array_var == false) gen->max_elements = 1; gen->sources = palloc(sizeof(GucSource) * gen->max_elements); gen->reset_sources = palloc(sizeof(GucSource) * gen->max_elements); gen->scontexts = palloc(sizeof(ConfigContext) * gen->max_elements); } static void build_config_variables(void) { struct config_generic **all_vars; int i; int num_vars = 0; for (i = 0; ConfigureNamesBool[i].gen.name; i++) { struct config_bool *conf = &ConfigureNamesBool[i]; /* Rather than requiring vartype to be filled in by hand, do this: */ initialize_config_gen(&conf->gen); conf->gen.vartype = CONFIG_VAR_TYPE_BOOL; num_vars++; } for (i = 0; ConfigureNamesInt[i].gen.name; i++) { struct config_int *conf = &ConfigureNamesInt[i]; initialize_config_gen(&conf->gen); conf->gen.vartype = CONFIG_VAR_TYPE_INT; num_vars++; } for (i = 0; ConfigureNamesIntArray[i].gen.name; i++) { struct config_int_array *conf = &ConfigureNamesIntArray[i]; conf->gen.vartype = CONFIG_VAR_TYPE_INT_ARRAY; conf->gen.dynamic_array_var = true; initialize_config_gen(&conf->gen); /* Assign the memory for reset vals */ conf->reset_vals = palloc0(sizeof(int) * conf->gen.max_elements); if (conf->config_no_index.gen.name) { conf->config_no_index.gen.dynamic_array_var = false; initialize_config_gen(&conf->config_no_index.gen); conf->config_no_index.gen.context = conf->gen.context; conf->gen.flags |= ARRAY_VAR_ALLOW_NO_INDEX; } num_vars++; } for (i = 0; ConfigureNamesLong[i].gen.name; i++) { struct config_long *conf = &ConfigureNamesLong[i]; initialize_config_gen(&conf->gen); conf->gen.vartype = CONFIG_VAR_TYPE_LONG; num_vars++; } for (i = 0; ConfigureNamesDouble[i].gen.name; i++) { struct config_double *conf = &ConfigureNamesDouble[i]; initialize_config_gen(&conf->gen); conf->gen.vartype = CONFIG_VAR_TYPE_DOUBLE; num_vars++; } for (i = 0; ConfigureNamesString[i].gen.name; i++) { struct config_string *conf = &ConfigureNamesString[i]; initialize_config_gen(&conf->gen); conf->gen.vartype = CONFIG_VAR_TYPE_STRING; conf->reset_val = NULL; num_vars++; } for (i = 0; ConfigureNamesEnum[i].gen.name; i++) { struct config_enum *conf = &ConfigureNamesEnum[i]; initialize_config_gen(&conf->gen); conf->gen.vartype = CONFIG_VAR_TYPE_ENUM; num_vars++; } for (i = 0; ConfigureNamesStringList[i].gen.name; i++) { struct config_string_list *conf = &ConfigureNamesStringList[i]; initialize_config_gen(&conf->gen); conf->gen.vartype = CONFIG_VAR_TYPE_STRING_LIST; conf->reset_val = NULL; num_vars++; } for (i = 0; ConfigureNamesStringArray[i].gen.name; i++) { struct config_string_array *conf = &ConfigureNamesStringArray[i]; conf->gen.dynamic_array_var = true; initialize_config_gen(&conf->gen); conf->gen.vartype = CONFIG_VAR_TYPE_STRING_ARRAY; /* Assign the memory for reset vals */ conf->reset_vals = palloc0(sizeof(char *) * conf->gen.max_elements); if (conf->config_no_index.gen.name) { conf->config_no_index.gen.dynamic_array_var = false; initialize_config_gen(&conf->config_no_index.gen); conf->config_no_index.gen.context = conf->gen.context; conf->gen.flags |= ARRAY_VAR_ALLOW_NO_INDEX; } num_vars++; } for (i = 0; ConfigureNamesDoubleArray[i].gen.name; i++) { struct config_double_array *conf = &ConfigureNamesDoubleArray[i]; conf->gen.dynamic_array_var = true; initialize_config_gen(&conf->gen); conf->gen.vartype = CONFIG_VAR_TYPE_DOUBLE_ARRAY; /* Assign the memory for reset vals */ conf->reset_vals = palloc0(sizeof(double) * conf->gen.max_elements); if (conf->config_no_index.gen.name) { conf->config_no_index.gen.dynamic_array_var = false; initialize_config_gen(&conf->config_no_index.gen); conf->config_no_index.gen.context = conf->gen.context; conf->gen.flags |= ARRAY_VAR_ALLOW_NO_INDEX; } num_vars++; } /* For end marker */ num_vars++; all_vars = (struct config_generic **) palloc(num_vars * sizeof(struct config_generic *)); num_vars = 0; for (i = 0; ConfigureNamesBool[i].gen.name; i++) all_vars[num_vars++] = &ConfigureNamesBool[i].gen; for (i = 0; ConfigureNamesInt[i].gen.name; i++) all_vars[num_vars++] = &ConfigureNamesInt[i].gen; for (i = 0; ConfigureNamesLong[i].gen.name; i++) all_vars[num_vars++] = &ConfigureNamesLong[i].gen; for (i = 0; ConfigureNamesDouble[i].gen.name; i++) all_vars[num_vars++] = &ConfigureNamesDouble[i].gen; for (i = 0; ConfigureNamesString[i].gen.name; i++) all_vars[num_vars++] = &ConfigureNamesString[i].gen; for (i = 0; ConfigureNamesEnum[i].gen.name; i++) all_vars[num_vars++] = &ConfigureNamesEnum[i].gen; for (i = 0; ConfigureNamesStringList[i].gen.name; i++) all_vars[num_vars++] = &ConfigureNamesStringList[i].gen; for (i = 0; ConfigureNamesStringArray[i].gen.name; i++) all_vars[num_vars++] = &ConfigureNamesStringArray[i].gen; for (i = 0; ConfigureNamesIntArray[i].gen.name; i++) all_vars[num_vars++] = &ConfigureNamesIntArray[i].gen; for (i = 0; ConfigureNamesDoubleArray[i].gen.name; i++) all_vars[num_vars++] = &ConfigureNamesDoubleArray[i].gen; if (all_parameters) pfree(all_parameters); all_parameters = all_vars; num_all_parameters = num_vars; sort_config_vars(); build_variable_groups(); } static void build_variable_groups(void) { /* we build these by hand */ /* group 1. Backend config vars */ ConfigureVarGroups[0].var_count = 6; ConfigureVarGroups[0].var_list = palloc0(sizeof(struct config_generic *) * ConfigureVarGroups[0].var_count); ConfigureVarGroups[0].var_list[0] = find_option("backend_hostname", FATAL); ConfigureVarGroups[0].var_list[0]->flags |= VAR_PART_OF_GROUP; ConfigureVarGroups[0].var_list[1] = find_option("backend_port", FATAL); ConfigureVarGroups[0].var_list[1]->flags |= VAR_PART_OF_GROUP; ConfigureVarGroups[0].var_list[2] = find_option("backend_weight", FATAL); ConfigureVarGroups[0].var_list[2]->flags |= VAR_PART_OF_GROUP; ConfigureVarGroups[0].var_list[3] = find_option("backend_data_directory", FATAL); ConfigureVarGroups[0].var_list[3]->flags |= VAR_PART_OF_GROUP; ConfigureVarGroups[0].var_list[4] = find_option("backend_application_name", FATAL); ConfigureVarGroups[0].var_list[4]->flags |= VAR_PART_OF_GROUP; ConfigureVarGroups[0].var_list[5] = find_option("backend_flag", FATAL); ConfigureVarGroups[0].var_list[5]->flags |= VAR_PART_OF_GROUP; ConfigureVarGroups[0].gen.max_elements = ConfigureVarGroups[0].var_list[0]->max_elements; /* group 2. other_pgpool config vars */ ConfigureVarGroups[1].var_count = 3; ConfigureVarGroups[1].var_list = palloc0(sizeof(struct config_generic *) * ConfigureVarGroups[1].var_count); /* backend hostname */ ConfigureVarGroups[1].var_list[0] = find_option("other_pgpool_hostname", FATAL); ConfigureVarGroups[1].var_list[0]->flags |= VAR_PART_OF_GROUP; ConfigureVarGroups[1].var_list[1] = find_option("other_pgpool_port", FATAL); ConfigureVarGroups[1].var_list[1]->flags |= VAR_PART_OF_GROUP; ConfigureVarGroups[1].var_list[2] = find_option("other_wd_port", FATAL); ConfigureVarGroups[1].var_list[2]->flags |= VAR_PART_OF_GROUP; ConfigureVarGroups[1].gen.max_elements = ConfigureVarGroups[1].var_list[0]->max_elements; /* group 3. heartbeat config vars */ ConfigureVarGroups[2].var_count = 3; ConfigureVarGroups[2].var_list = palloc0(sizeof(struct config_generic *) * ConfigureVarGroups[2].var_count); /* backend hostname */ ConfigureVarGroups[2].var_list[0] = find_option("heartbeat_device", FATAL); ConfigureVarGroups[2].var_list[0]->flags |= VAR_PART_OF_GROUP; ConfigureVarGroups[2].var_list[1] = find_option("heartbeat_destination", FATAL); ConfigureVarGroups[2].var_list[1]->flags |= VAR_PART_OF_GROUP; ConfigureVarGroups[2].var_list[2] = find_option("heartbeat_destination_port", FATAL); ConfigureVarGroups[2].var_list[2]->flags |= VAR_PART_OF_GROUP; ConfigureVarGroups[2].gen.max_elements = ConfigureVarGroups[2].var_list[0]->max_elements; /* group 4. health_check config vars */ ConfigureVarGroups[3].var_count = 8; ConfigureVarGroups[3].var_list = palloc0(sizeof(struct config_generic *) * ConfigureVarGroups[3].var_count); ConfigureVarGroups[3].var_list[0] = find_option("health_check_period", FATAL); ConfigureVarGroups[3].var_list[0]->flags |= VAR_PART_OF_GROUP; ConfigureVarGroups[3].var_list[1] = find_option("health_check_timeout", FATAL); ConfigureVarGroups[3].var_list[1]->flags |= VAR_PART_OF_GROUP; ConfigureVarGroups[3].var_list[2] = find_option("health_check_user", FATAL); ConfigureVarGroups[3].var_list[2]->flags |= VAR_PART_OF_GROUP; ConfigureVarGroups[3].var_list[3] = find_option("health_check_password", FATAL); ConfigureVarGroups[3].var_list[3]->flags |= VAR_PART_OF_GROUP; ConfigureVarGroups[3].var_list[4] = find_option("health_check_database", FATAL); ConfigureVarGroups[3].var_list[4]->flags |= VAR_PART_OF_GROUP; ConfigureVarGroups[3].var_list[5] = find_option("health_check_max_retries", FATAL); ConfigureVarGroups[3].var_list[5]->flags |= VAR_PART_OF_GROUP; ConfigureVarGroups[3].var_list[6] = find_option("health_check_retry_delay", FATAL); ConfigureVarGroups[3].var_list[6]->flags |= VAR_PART_OF_GROUP; ConfigureVarGroups[3].var_list[7] = find_option("connect_timeout", FATAL); ConfigureVarGroups[3].var_list[7]->flags |= VAR_PART_OF_GROUP; ConfigureVarGroups[3].gen.max_elements = ConfigureVarGroups[3].var_list[0]->max_elements; } /* Sort the config variables on based of string length of * variable names. Since we want to compare long variable names to be compared * before the smaller ones. This ensure heartbeat_destination should not match * with heartbeat_destination_port, when we use strncmp to cater for the index at * the end of the variable names.*/ static void sort_config_vars(void) { int i, j; for (i = 0; i < num_all_parameters; ++i) { struct config_generic *gconfi = all_parameters[i]; int leni = strlen(gconfi->name); for (j = i + 1; j < num_all_parameters; ++j) { struct config_generic *gconfj = all_parameters[j]; int lenj = strlen(gconfj->name); if (leni < lenj) { all_parameters[i] = gconfj; all_parameters[j] = gconfi; gconfi = all_parameters[i]; leni = lenj; } } } } /* * Initialize all variables to its compiled-in default. */ static void initialize_variables_with_default(struct config_generic *gconf) { int i; for (i = 0; i < gconf->max_elements; i++) { gconf->sources[i] = PGC_S_DEFAULT; gconf->scontexts[i] = CFGCXT_BOOT; gconf->reset_sources[i] = gconf->sources[i]; } gconf->sourceline = 0; /* Also set the default value for index free record if any */ if (gconf->dynamic_array_var && gconf->flags & ARRAY_VAR_ALLOW_NO_INDEX) { struct config_generic *idx_free_record = get_index_free_record_if_any(gconf); if (idx_free_record) { ereport(DEBUG1, (errmsg("setting array element defaults for parameter \"%s\"", gconf->name))); initialize_variables_with_default(idx_free_record); } } switch (gconf->vartype) { case CONFIG_VAR_TYPE_GROUP: /* just to keep compiler quite */ break; case CONFIG_VAR_TYPE_BOOL: { struct config_bool *conf = (struct config_bool *) gconf; bool newval = conf->boot_val; if (conf->assign_func) { (*conf->assign_func) (CFGCXT_BOOT, newval, ERROR); } else { *conf->variable = conf->reset_val = newval; } break; } case CONFIG_VAR_TYPE_INT: { struct config_int *conf = (struct config_int *) gconf; int newval = conf->boot_val; if (conf->assign_func) { (*conf->assign_func) (CFGCXT_BOOT, newval, ERROR); } else { *conf->variable = newval; } conf->reset_val = newval; break; } case CONFIG_VAR_TYPE_DOUBLE: { struct config_double *conf = (struct config_double *) gconf; double newval = conf->boot_val; if (conf->assign_func) { (*conf->assign_func) (CFGCXT_BOOT, newval, ERROR); } else { *conf->variable = newval; } conf->reset_val = newval; break; } case CONFIG_VAR_TYPE_INT_ARRAY: { struct config_int_array *conf = (struct config_int_array *) gconf; int newval = conf->boot_val; int i; for (i = 0; i < gconf->max_elements; i++) { if (conf->assign_func) { (*conf->assign_func) (CFGCXT_BOOT, newval, i, ERROR); } else { *conf->variable[i] = newval; } conf->reset_vals[i] = newval; } break; } case CONFIG_VAR_TYPE_DOUBLE_ARRAY: { struct config_double_array *conf = (struct config_double_array *) gconf; double newval = conf->boot_val; int i; for (i = 0; i < gconf->max_elements; i++) { if (conf->assign_func) { (*conf->assign_func) (CFGCXT_BOOT, newval, i, ERROR); } else { *conf->variable[i] = newval; } conf->reset_vals[i] = newval; } break; } case CONFIG_VAR_TYPE_LONG: { struct config_long *conf = (struct config_long *) gconf; long newval = conf->boot_val; if (conf->assign_func) { (*conf->assign_func) (CFGCXT_BOOT, newval, ERROR); } else { *conf->variable = conf->reset_val = newval; } break; } case CONFIG_VAR_TYPE_STRING: { struct config_string *conf = (struct config_string *) gconf; char *newval = (char *) conf->boot_val; if (conf->assign_func) { (*conf->assign_func) (CFGCXT_BOOT, newval, ERROR); } else { *conf->variable = newval ? pstrdup(newval) : NULL; } conf->reset_val = newval ? pstrdup(newval) : NULL; if (conf->process_func) { (*conf->process_func) (newval, ERROR); } break; } case CONFIG_VAR_TYPE_STRING_ARRAY: { struct config_string_array *conf = (struct config_string_array *) gconf; char *newval = (char *) conf->boot_val; int i; for (i = 0; i < gconf->max_elements; i++) { if (conf->assign_func) { (*conf->assign_func) (CFGCXT_BOOT, newval, i, ERROR); } else { *conf->variable[i] = newval ? pstrdup(newval) : NULL; } if (newval) conf->reset_vals[i] = pstrdup(newval); } break; } case CONFIG_VAR_TYPE_ENUM: { struct config_enum *conf = (struct config_enum *) gconf; int newval = conf->boot_val; if (conf->assign_func) { (*conf->assign_func) (CFGCXT_BOOT, newval, ERROR); } else { *conf->variable = newval; } conf->reset_val = newval; if (conf->process_func) { (*conf->process_func) (newval, ERROR); } break; } case CONFIG_VAR_TYPE_STRING_LIST: { struct config_string_list *conf = (struct config_string_list *) gconf; char *newval = (char *) conf->boot_val; if (conf->assign_func) { (*conf->assign_func) (CFGCXT_BOOT, newval, ERROR); } else { if (strcmp(gconf->name, "black_query_pattern_list") == 0) { *conf->variable = get_list_from_string_regex_delim(newval, conf->seperator, conf->list_elements_count); } else { *conf->variable = get_list_from_string(newval, conf->seperator, conf->list_elements_count); } if (conf->compute_regex) { int i; for (i = 0; i < *conf->list_elements_count; i++) { add_regex_pattern((const char *) conf->gen.name, (*conf->variable)[i]); } } } /* save the string value */ conf->reset_val = newval ? pstrdup(newval) : NULL; if (conf->current_val) pfree(conf->current_val); conf->current_val = newval ? pstrdup(newval) : NULL; break; } } } /* * Extract tokens separated by delimi from str. Return value is an * array of pointers in pallocd strings. number of elements are set to * n. */ static char ** get_list_from_string(const char *str, const char *delimi, int *n) { char *token; char **tokens; char *temp_string; const int MAXTOKENS = 256; *n = 0; if (str == NULL || *str == '\0') return NULL; temp_string = pstrdup(str); tokens = palloc(MAXTOKENS * sizeof(char *)); ereport(DEBUG3, (errmsg("extracting string tokens from [%s] based on %s", temp_string, delimi))); for (token = strtok(temp_string, delimi); token != NULL; token = strtok(NULL, delimi)) { tokens[*n] = pstrdup(token); ereport(DEBUG3, (errmsg("initializing pool configuration"), errdetail("extracting string tokens [token[%d]: %s]", *n, tokens[*n]))); (*n)++; if (((*n) % MAXTOKENS) == 0) { tokens = repalloc(tokens, (MAXTOKENS * sizeof(char *) * (((*n) / MAXTOKENS) + 1))); } } /* how about reclaiming the unused space */ if (*n > 0) tokens = repalloc(tokens, (sizeof(char *) * (*n))); pfree(temp_string); return tokens; } /* * Extract tokens separated by delimiter from str. Allow to * use regex of delimiter. Return value is an array of * pointers in pallocd strings. number of elements are set * to n. */ static char ** get_list_from_string_regex_delim(const char *input, const char *delimi, int *n) { #ifndef POOL_PRIVATE int j = 0; char *str; char *buf, *str_temp; char **tokens; const int MAXTOKENS = 256; *n = 0; if (input == NULL || *input == '\0') return NULL; tokens = palloc(MAXTOKENS * sizeof(char *)); if (*(input + strlen(input) - 1) != *delimi || *(input + strlen(input) - 2) == '\\') { int len = strlen(input) + 2; str = palloc(len); snprintf(str, len, "%s;", input); } else { str = pstrdup(input); } buf = str; str_temp = str; while (*str_temp != '\0') { if (*str_temp == '\\') { j += 2; str_temp++; } else if (*str_temp == *delimi) { char *output = (char *) palloc(j + 1); StrNCpy(output, buf, j + 1); /* replace escape character of "'" */ tokens[*n] = string_replace(output, "\\'", "'"); pfree(output); ereport(DEBUG3, (errmsg("initializing pool configuration"), errdetail("extracting string tokens [token[%d]: %s]", *n, tokens[*n]))); (*n)++; buf = str_temp + 1; j = 0; if (((*n) % MAXTOKENS) == 0) tokens = repalloc(tokens, (MAXTOKENS * sizeof(char *) * (((*n) / MAXTOKENS) + 1))); } else { j++; } str_temp++; } if (*n > 0) tokens = repalloc(tokens, (sizeof(char *) * (*n))); pfree(str); return tokens; #else return NULL; #endif } /* * Memory of the array type variables must be initialized befor calling this function */ void InitializeConfigOptions(void) { int i; /* * Before we do anything set the log_min_messages to ERROR. Reason for * doing that is before the log_min_messages gets initialized with the * actual value the pgpool-II log should not get flooded by DEBUG messages */ g_pool_config.log_min_messages = ERROR; g_pool_config.syslog_facility = LOG_LOCAL0; build_config_variables(); /* * Load all variables with their compiled-in defaults, and initialize * status fields as needed. */ for (i = 0; i < num_all_parameters; i++) { initialize_variables_with_default(all_parameters[i]); } /* do the post processing */ config_post_processor(CFGCXT_BOOT, FATAL); } /* * returns the index value postfixed with the variable name * for example if the if name contains "backend_hostname11" and * the record name must be for the variable nameed "backend_hostname" * if the index is not present at end of the name the function * will return true and out parameter index will be assigned with -ve value */ static bool get_index_in_var_name(struct config_generic *record, const char *name, int *index, int elevel) { char *ptr; int index_start_index = strlen(record->name); if (strlen(name) <= index_start_index) { /* no index is provided */ *index = -1; return true; } ptr = (char *) (name + index_start_index); while (*ptr) { if (isdigit(*ptr) == 0) { ereport(elevel, (errmsg("invalid index value for parameter \"%s\" ", name), (errdetail("index part contains the invalid non digit character")))); return false; } ptr++; } *index = atoi(name + index_start_index); return true; } /* * Look up option NAME. If it exists, return a pointer to its record, * else return NULL. */ static struct config_generic * find_option(const char *name, int elevel) { int i; for (i = 0; i < num_all_parameters; i++) { struct config_generic *gconf = all_parameters[i]; if (gconf->dynamic_array_var) { int index_start_index = strlen(gconf->name); /* * For dynamic array type vars the key also have the index at the * end e.g. backend_hostname0 so we only comapare the key's name * part */ if (!strncmp(gconf->name, name, index_start_index)) return gconf; } else { if (!strcmp(gconf->name, name)) return gconf; } } /* Unknown name */ return NULL; } /* * Lookup the value for an enum option with the selected name * (case-insensitive). * If the enum option is found, sets the retval value and returns * true. If it's not found, return FALSE and retval is set to 0. */ static bool config_enum_lookup_by_name(struct config_enum *record, const char *value, int *retval) { const struct config_enum_entry *entry; for (entry = record->options; entry && entry->name; entry++) { if (strcasecmp(value, entry->name) == 0) { *retval = entry->val; return TRUE; } } *retval = 0; return FALSE; } bool set_config_options(ConfigVariable *head_p, ConfigContext context, GucSource source, int elevel) { ConfigVariable *item = head_p; while (item) { ConfigVariable *next = item->next; setConfigOption(item->name, item->value, context, source, elevel); item = next; } return config_post_processor(context, elevel); } bool set_one_config_option(const char *name, const char *value, ConfigContext context, GucSource source, int elevel) { if (setConfigOption(name, value, context, source, elevel) == true) return config_post_processor(context, elevel); return false; } static bool setConfigOption(const char *name, const char *value, ConfigContext context, GucSource source, int elevel) { struct config_generic *record; int index_val = -1; ereport(DEBUG2, (errmsg("set_config_option \"%s\" = \"%s\"", name, value))); record = find_option(name, elevel); if (record == NULL) { /* * we emit only INFO message when setting the option from * configuration file. As the conf file may still contain some * configuration parameters only exist in older version and does not * exist anymore */ ereport(source == PGC_S_FILE ? INFO : elevel, (errmsg("unrecognized configuration parameter \"%s\"", name))); return false; } if (record->dynamic_array_var) { if (get_index_in_var_name(record, name, &index_val, elevel) == false) return false; if (index_val < 0) { /* index is not provided */ if (record->flags & ARRAY_VAR_ALLOW_NO_INDEX) { ereport(DEBUG2, (errmsg("parameter \"%s\" is an array type variable and allows index-free value as well", name))); } else { ereport(elevel, (errmsg("parameter \"%s\" expects the index value", name))); return false; } } } return setConfigOptionVar(record, name, index_val, value, context, source, elevel); } static bool setConfigOptionArrayVarWithConfigDefault(struct config_generic *record, const char *name, const char *value, ConfigContext context, int elevel) { int index; if (record->dynamic_array_var == false) { ereport(elevel, (errmsg("parameter \"%s\" is not the array type configuration parameter", name))); return false; } if (!(record->flags & ARRAY_VAR_ALLOW_NO_INDEX)) { ereport(elevel, (errmsg("parameter \"%s\" does not allow value type default", name))); return false; } for (index = 0; index < record->max_elements; index++) { /* * only elements having the values from the default source can be * updated */ if (record->sources[index] != PGC_S_DEFAULT && record->sources[index] != PGC_S_VALUE_DEFAULT) continue; setConfigOptionVar(record, record->name, index, value, CFGCXT_INIT, PGC_S_VALUE_DEFAULT, elevel); } return true; } static bool setConfigOptionVar(struct config_generic *record, const char *name, int index_val, const char *value, ConfigContext context, GucSource source, int elevel) { bool reset = false; switch (record->context) { case CFGCXT_BOOT: if (context != CFGCXT_BOOT) { if (context == CFGCXT_RELOAD) { /* * Do not treat it as an error. Since the RELOAD context * is used by reload config mechanism of pgpool-II and the * configuration file always contain all the values, * including those that are not allowed to be changed in * reload context. So silently ignoring this for the time * being is the best way to go until we enhance the logic * around this */ ereport(DEBUG2, (errmsg("invalid Context, value for parameter \"%s\" cannot be changed", name))); return true; } ereport(elevel, (errmsg("invalid Context, value for parameter \"%s\" cannot be changed", name))); return false; } break; case CFGCXT_INIT: if (context != CFGCXT_INIT && context != CFGCXT_BOOT) { if (context == CFGCXT_RELOAD) { ereport(DEBUG2, (errmsg("invalid Context, value for parameter \"%s\" cannot be changed", name))); return true; } ereport(elevel, (errmsg("invalid Context, value for parameter \"%s\" cannot be changed", name))); return false; } break; case CFGCXT_RELOAD: if (context > CFGCXT_RELOAD) { ereport(elevel, (errmsg("invalid Context, value for parameter \"%s\" cannot be changed", name))); return false; } break; case CFGCXT_PCP: if (context > CFGCXT_PCP) { ereport(elevel, (errmsg("invalid Context, value for parameter \"%s\" cannot be changed", name))); return false; } break; case CFGCXT_SESSION: break; default: { ereport(elevel, (errmsg("invalid record context, value for parameter \"%s\" cannot be changed", name))); return false; } break; } if (record->dynamic_array_var) { if (index_val < 0) { ereport(DEBUG1, (errmsg("setting value no index value for parameter \"%s\" source = %d", name, source))); if (record->flags & ARRAY_VAR_ALLOW_NO_INDEX) { struct config_generic *idx_free_record = get_index_free_record_if_any(record); if (idx_free_record) { bool ret; ereport(DEBUG1, (errmsg("parameter \"%s\" is an array type variable and allows index-free value as well", name))); ret = setConfigOptionVar(idx_free_record, name, index_val, value, context, source, elevel); if (idx_free_record->flags & DEFAULT_FOR_NO_VALUE_ARRAY_VAR) { const char *newVal; /* we need to update the default values */ ereport(DEBUG2, (errmsg("modifying the array index values for parameter \"%s\" source = %d", name, source))); #ifndef POOL_PRIVATE if (value == NULL) { newVal = ShowOption(idx_free_record, -1, elevel); } else #endif newVal = value; setConfigOptionArrayVarWithConfigDefault(record, name, newVal, context, elevel); } return ret; } } /* index is not provided */ ereport(elevel, (errmsg("parameter \"%s\" expects the index postfix", name))); return false; } } /* * Evaluate value and set variable. */ switch (record->vartype) { case CONFIG_VAR_TYPE_GROUP: ereport(ERROR, (errmsg("invalid config variable type. operation not allowed"))); break; case CONFIG_VAR_TYPE_BOOL: { struct config_bool *conf = (struct config_bool *) record; bool newval = conf->boot_val; if (value != NULL) { newval = eval_logical(value); } else if (source == PGC_S_DEFAULT) { newval = conf->boot_val; } else { /* Reset */ newval = conf->reset_val; reset = true; } if (conf->assign_func) { if ((*conf->assign_func) (context, newval, elevel) == false) return false; } else *conf->variable = newval; if (context == CFGCXT_INIT) conf->reset_val = newval; } break; case CONFIG_VAR_TYPE_INT: { struct config_int *conf = (struct config_int *) record; int newval; if (value != NULL) { newval = atoi(value); } else if (source == PGC_S_DEFAULT) { newval = conf->boot_val; } else { /* Reset */ newval = conf->reset_val; reset = true; } if (newval < conf->min || newval > conf->max) { ereport(elevel, (errmsg("%d is outside the valid range for parameter \"%s\" (%d .. %d)", newval, name, conf->min, conf->max))); return false; } if (conf->assign_func) { if ((*conf->assign_func) (context, newval, elevel) == false) return false; } else { *conf->variable = newval; } if (context == CFGCXT_INIT) conf->reset_val = newval; } break; case CONFIG_VAR_TYPE_DOUBLE: { struct config_double *conf = (struct config_double *) record; double newval; if (value != NULL) { newval = atof(value); } else if (source == PGC_S_DEFAULT) { newval = conf->boot_val; } else { /* Reset */ newval = conf->reset_val; reset = true; } if (newval < conf->min || newval > conf->max) { ereport(elevel, (errmsg("%f is outside the valid range for parameter \"%s\" (%f .. %f)", newval, name, conf->min, conf->max))); return false; } if (conf->assign_func) { if ((*conf->assign_func) (context, newval, elevel) == false) return false; } else { *conf->variable = newval; } if (context == CFGCXT_INIT) conf->reset_val = newval; } break; case CONFIG_VAR_TYPE_INT_ARRAY: { struct config_int_array *conf = (struct config_int_array *) record; int newval; if (index_val < 0 || index_val > record->max_elements) { ereport(elevel, (errmsg("%d index outside the valid range for parameter \"%s\" (%d .. %d)", index_val, name, 0, record->max_elements))); return false; } if (value != NULL) { newval = atoi(value); } else if (source == PGC_S_DEFAULT) { newval = conf->boot_val; } else { /* Reset */ newval = conf->reset_vals[index_val]; reset = true; } if (newval < conf->min || newval > conf->max) { ereport(elevel, (errmsg("%d is outside the valid range for parameter \"%s\" (%d .. %d)", newval, name, conf->min, conf->max))); return false; } if (conf->assign_func) { if ((*conf->assign_func) (context, newval, index_val, elevel) == false) return false; } else { *conf->variable[index_val] = newval; } if (context == CFGCXT_INIT) conf->reset_vals[index_val] = newval; } break; case CONFIG_VAR_TYPE_DOUBLE_ARRAY: { struct config_double_array *conf = (struct config_double_array *) record; double newval; if (index_val < 0 || index_val > record->max_elements) { ereport(elevel, (errmsg("%d index outside the valid range for parameter \"%s\" (%d .. %d)", index_val, name, 0, record->max_elements))); return false; } if (value != NULL) { newval = atof(value); } else if (source == PGC_S_DEFAULT) { newval = conf->boot_val; } else { /* Reset */ newval = conf->reset_vals[index_val]; reset = true; } if (newval < conf->min || newval > conf->max) { ereport(elevel, (errmsg("%f is outside the valid range for parameter \"%s\" (%f .. %f)", newval, name, conf->min, conf->max))); return false; } if (conf->assign_func) { if ((*conf->assign_func) (context, newval, index_val, elevel) == false) return false; } else { *conf->variable[index_val] = newval; } if (context == CFGCXT_INIT) conf->reset_vals[index_val] = newval; } break; case CONFIG_VAR_TYPE_LONG: { struct config_long *conf = (struct config_long *) record; int64 newval; if (value != NULL) { newval = pool_atoi64(value); } else if (source == PGC_S_DEFAULT) { newval = conf->boot_val; } else { /* Reset */ newval = conf->reset_val; reset = true; } if (newval < conf->min || newval > conf->max) { ereport(elevel, (errmsg("%ld is outside the valid range for parameter \"%s\" (%ld .. %ld)", newval, name, conf->min, conf->max))); return false; } if (conf->assign_func) { if ((*conf->assign_func) (context, newval, elevel) == false) return false; } else { *conf->variable = newval; } if (context == CFGCXT_INIT) conf->reset_val = newval; } break; case CONFIG_VAR_TYPE_STRING: { struct config_string *conf = (struct config_string *) record; char *newval = NULL; if (value != NULL) { newval = (char *) value; } else if (source == PGC_S_DEFAULT) { newval = (char *) conf->boot_val; } else { /* Reset */ newval = conf->reset_val; reset = true; } if (conf->assign_func) { if ((*conf->assign_func) (context, newval, elevel) == false) return false; } else { if (*conf->variable) pfree(*conf->variable); *conf->variable = newval ? pstrdup(newval) : NULL; } if (context == CFGCXT_INIT) { if (conf->reset_val) pfree(conf->reset_val); conf->reset_val = newval ? pstrdup(newval) : NULL; } if (conf->process_func) { (*conf->process_func) (newval, elevel); } } break; case CONFIG_VAR_TYPE_STRING_ARRAY: { struct config_string_array *conf = (struct config_string_array *) record; char *newval = NULL; if (index_val < 0 || index_val > record->max_elements) { ereport(elevel, (errmsg("%d index outside the valid range for parameter \"%s\" (%d .. %d)", index_val, name, 0, record->max_elements))); return false; } if (value != NULL) { newval = (char *) value; } else if (source == PGC_S_DEFAULT) { newval = (char *) conf->boot_val; } else { /* Reset */ newval = conf->reset_vals[index_val]; reset = true; } if (conf->assign_func) { if ((*conf->assign_func) (context, newval, index_val, elevel) == false) return false; } else { if (*conf->variable[index_val]) pfree(*conf->variable[index_val]); *conf->variable[index_val] = newval ? pstrdup(newval) : NULL; } if (context == CFGCXT_INIT) { if (conf->reset_vals[index_val]) pfree(conf->reset_vals[index_val]); conf->reset_vals[index_val] = newval ? pstrdup(newval) : NULL; } } break; case CONFIG_VAR_TYPE_STRING_LIST: { struct config_string_list *conf = (struct config_string_list *) record; char *newval = NULL; if (value != NULL) { newval = (char *) value; } else if (source == PGC_S_DEFAULT) { newval = (char *) conf->boot_val; } else { /* Reset */ newval = conf->reset_val; reset = true; } if (conf->assign_func) { if ((*conf->assign_func) (context, newval, elevel) == false) { return false; } } else { if (*conf->variable) { int i; for (i = 0; i < *conf->list_elements_count; i++) { if ((*conf->variable)[i]) pfree((*conf->variable)[i]); (*conf->variable)[i] = NULL; } pfree(*conf->variable); } if (strcmp(name, "black_query_pattern_list") == 0) { *conf->variable = get_list_from_string_regex_delim(newval, conf->seperator, conf->list_elements_count); } else { *conf->variable = get_list_from_string(newval, conf->seperator, conf->list_elements_count); } if (conf->compute_regex) { /* TODO clear the old regex array please */ int i; for (i = 0; i < *conf->list_elements_count; i++) { add_regex_pattern(conf->gen.name, (*conf->variable)[i]); } } } if (context == CFGCXT_INIT) { if (conf->reset_val) pfree(conf->reset_val); conf->reset_val = newval ? pstrdup(newval) : NULL; } /* save the string value */ if (conf->current_val) pfree(conf->current_val); conf->current_val = newval ? pstrdup(newval) : NULL; } break; case CONFIG_VAR_TYPE_ENUM: { struct config_enum *conf = (struct config_enum *) record; int newval; if (value != NULL) { newval = atoi(value); } else if (source == PGC_S_DEFAULT) { newval = conf->boot_val; } else { /* Reset */ newval = conf->reset_val; reset = true; } if (value && !config_enum_lookup_by_name(conf, value, &newval)) { char *hintmsg = NULL; #ifndef POOL_PRIVATE hintmsg = config_enum_get_options(conf, "Available values: ", ".", ", "); #endif ereport(elevel, (errmsg("invalid value for parameter \"%s\": \"%s\"", name, value), hintmsg ? errhint("%s", hintmsg) : 0)); if (hintmsg) pfree(hintmsg); return false; } if (conf->assign_func) { if ((*conf->assign_func) (context, newval, elevel) == false) return false; } else { *conf->variable = newval; } if (context == CFGCXT_INIT) conf->reset_val = newval; if (conf->process_func) { (*conf->process_func) (newval, elevel); } break; } } if (record->dynamic_array_var) { if (index_val < 0 || index_val > record->max_elements) { ereport(elevel, (errmsg("%d index outside the valid range for parameter \"%s\" (%d .. %d)", index_val, name, 0, record->max_elements))); return false; } } else { index_val = 0; } record->scontexts[index_val] = context; if (reset) record->sources[index_val] = record->reset_sources[index_val]; else record->sources[index_val] = source; if (context == CFGCXT_INIT) record->reset_sources[index_val] = source; return true; } #ifndef POOL_PRIVATE /* * Return a list of all available options for an enum, excluding * hidden ones, separated by the given separator. * If prefix is non-NULL, it is added before the first enum value. * If suffix is non-NULL, it is added to the end of the string. */ static char * config_enum_get_options(struct config_enum *record, const char *prefix, const char *suffix, const char *separator) { const struct config_enum_entry *entry; StringInfoData retstr; int seplen; initStringInfo(&retstr); appendStringInfoString(&retstr, prefix); seplen = strlen(separator); for (entry = record->options; entry && entry->name; entry++) { if (!entry->hidden) { appendStringInfoString(&retstr, entry->name); appendBinaryStringInfo(&retstr, separator, seplen); } } /* * All the entries may have been hidden, leaving the string empty if no * prefix was given. This indicates a broken GUC setup, since there is no * use for an enum without any values, so we just check to make sure we * don't write to invalid memory instead of actually trying to do * something smart with it. */ if (retstr.len >= seplen) { /* Replace final separator */ retstr.data[retstr.len - seplen] = '\0'; retstr.len -= seplen; } appendStringInfoString(&retstr, suffix); return retstr.data; } #endif static bool BackendWeightAssignFunc(ConfigContext context, double newval, int index, int elevel) { double old_v = g_pool_config.backend_desc->backend_info[index].unnormalized_weight; g_pool_config.backend_desc->backend_info[index].unnormalized_weight = newval; /* * Log weight change event only when context is reloading of pgpool.conf * and weight is actually changed */ if (context == CFGCXT_RELOAD && old_v != newval) { ereport(LOG, (errmsg("initializing pool configuration: backend weight for backend:%d changed from %f to %f", index, old_v, newval), errdetail("This change will be effective from next client session"))); } return true; } static bool BackendPortAssignFunc(ConfigContext context, int newval, int index, int elevel) { BACKEND_STATUS backend_status = g_pool_config.backend_desc->backend_info[index].backend_status; if (context <= CFGCXT_INIT) { g_pool_config.backend_desc->backend_info[index].backend_port = newval; g_pool_config.backend_desc->backend_info[index].backend_status = CON_CONNECT_WAIT; } else if (backend_status == CON_UNUSED) { g_pool_config.backend_desc->backend_info[index].backend_port = newval; g_pool_config.backend_desc->backend_info[index].backend_status = CON_DOWN; } else { if (context != CFGCXT_RELOAD) ereport(WARNING, (errmsg("backend_port%d cannot be changed in context %d and backend status = %d", index, context, backend_status))); return false; } return true; } static bool BackendHostAssignFunc(ConfigContext context, char *newval, int index, int elevel) { BACKEND_STATUS backend_status = g_pool_config.backend_desc->backend_info[index].backend_status; if (context <= CFGCXT_INIT || backend_status == CON_UNUSED) { if (newval == NULL || strlen(newval) == 0) g_pool_config.backend_desc->backend_info[index].backend_hostname[0] = '\0'; else strlcpy(g_pool_config.backend_desc->backend_info[index].backend_hostname, newval, MAX_DB_HOST_NAMELEN - 1); return true; } /* silent the warning in reload contxt */ if (context != CFGCXT_RELOAD) ereport(WARNING, (errmsg("backend_hostname%d cannot be changed in context %d and backend status = %d", index, context, backend_status))); return false; } static bool BackendDataDirAssignFunc(ConfigContext context, char *newval, int index, int elevel) { BACKEND_STATUS backend_status = g_pool_config.backend_desc->backend_info[index].backend_status; if (context <= CFGCXT_INIT || backend_status == CON_UNUSED || backend_status == CON_DOWN) { if (newval == NULL || strlen(newval) == 0) g_pool_config.backend_desc->backend_info[index].backend_data_directory[0] = '\0'; else strlcpy(g_pool_config.backend_desc->backend_info[index].backend_data_directory, newval, MAX_PATH_LENGTH - 1); return true; } /* silent the warning in reload contxt */ if (context != CFGCXT_RELOAD) ereport(WARNING, (errmsg("backend_data_directory%d cannot be changed in context %d and backend status = %d", index, context, backend_status))); return false; } static bool BackendFlagsAssignFunc(ConfigContext context, char *newval, int index, int elevel) { unsigned short flag = 0; int i, n; bool allow_to_failover_is_specified = false; bool disallow_to_failover_is_specified = false; char **flags; flags = get_list_from_string(newval, "|", &n); if (!flags || n < 0) { if (flags) pfree(flags); ereport(elevel, (errmsg("invalid configuration for key \"backend_flag%d\"", index), errdetail("unable to get backend flags"))); return false; } for (i = 0; i < n; i++) { int k; if (!strcmp(flags[i], "ALLOW_TO_FAILOVER")) { if (disallow_to_failover_is_specified) { for (k = i; k < n; k++) pfree(flags[k]); pfree(flags); ereport(elevel, (errmsg("invalid configuration for key \"backend_flag%d\"", index), errdetail("cannot set ALLOW_TO_FAILOVER and DISALLOW_TO_FAILOVER at the same time"))); return false; } flag &= ~POOL_FAILOVER; allow_to_failover_is_specified = true; } else if (!strcmp(flags[i], "DISALLOW_TO_FAILOVER")) { if (allow_to_failover_is_specified) { for (k = i; k < n; k++) pfree(flags[k]); pfree(flags); ereport(elevel, (errmsg("invalid configuration for key \"backend_flag%d\"", index), errdetail("cannot set ALLOW_TO_FAILOVER and DISALLOW_TO_FAILOVER at the same time"))); return false; } flag |= POOL_FAILOVER; disallow_to_failover_is_specified = true; } else if ((!strcmp(flags[i], "ALWAYS_MASTER"))) { flag |= POOL_ALWAYS_MASTER; } else { ereport(elevel, (errmsg("invalid configuration for key \"backend_flag%d\"", index), errdetail("unknown backend flag:%s", flags[i]))); for (k = i; k < n; k++) pfree(flags[k]); pfree(flags); return false; } pfree(flags[i]); } g_pool_config.backend_desc->backend_info[index].flag = flag; ereport(DEBUG1, (errmsg("setting \"backend_flag%d\" flag: %04x ", index, flag))); pfree(flags); return true; } static bool BackendAppNameAssignFunc(ConfigContext context, char *newval, int index, int elevel) { BACKEND_STATUS backend_status = g_pool_config.backend_desc->backend_info[index].backend_status; if (context <= CFGCXT_INIT || backend_status == CON_UNUSED || backend_status == CON_DOWN) { if (newval == NULL || strlen(newval) == 0) g_pool_config.backend_desc->backend_info[index].backend_application_name[0] = '\0'; else strlcpy(g_pool_config.backend_desc->backend_info[index].backend_application_name, newval, NAMEDATALEN - 1); return true; } /* silent the warning in reload contxt */ if (context != CFGCXT_RELOAD) ereport(WARNING, (errmsg("backend_application_name%d cannot be changed in context %d and backend status = %d", index, context, backend_status))); return false; } static bool LogDestinationProcessFunc(char *newval, int elevel) { #ifndef POOL_PRIVATE char **destinations; int n, i; int log_destination = 0; destinations = get_list_from_string(newval, ",", &n); if (!destinations || n < 0) { if (destinations) pfree(destinations); ereport(elevel, (errmsg("invalid value \"%s\" for log_destination", newval))); return false; } for (i = 0; i < n; i++) { if (!strcmp(destinations[i], "syslog")) { log_destination |= LOG_DESTINATION_SYSLOG; } else if (!strcmp(destinations[i], "stderr")) { log_destination |= LOG_DESTINATION_STDERR; } else { int k; ereport(elevel, (errmsg("invalid configuration for \"log_destination\""), errdetail("unknown destination :%s", destinations[i]))); for (k = i; k < n; k++) pfree(destinations[k]); pfree(destinations); return false; } pfree(destinations[i]); } if (g_pool_config.log_destination & LOG_DESTINATION_SYSLOG) { if (!(log_destination & LOG_DESTINATION_SYSLOG)) closelog(); } g_pool_config.log_destination = log_destination; pfree(destinations); #endif return true; } static bool SyslogFacilityProcessFunc(int newval, int elevel) { #ifndef POOL_PRIVATE #ifdef HAVE_SYSLOG /* set syslog parameters */ set_syslog_parameters(g_pool_config.syslog_ident ? g_pool_config.syslog_ident : "pgpool", g_pool_config.syslog_facility); #endif #endif return true; } static bool SyslogIdentProcessFunc(char *newval, int elevel) { #ifndef POOL_PRIVATE #ifdef HAVE_SYSLOG /* set syslog parameters */ set_syslog_parameters(g_pool_config.syslog_ident ? g_pool_config.syslog_ident : "pgpool", g_pool_config.syslog_facility); #endif #endif return true; } static const char * IntValueShowFunc(int value) { static char buffer[10]; snprintf(buffer, sizeof(buffer), "%d", value); return buffer; } static const char * BackendWeightShowFunc(int index) { return IntValueShowFunc(g_pool_config.backend_desc->backend_info[index].unnormalized_weight); } static const char * BackendPortShowFunc(int index) { return IntValueShowFunc(g_pool_config.backend_desc->backend_info[index].backend_port); } static const char * BackendHostShowFunc(int index) { return g_pool_config.backend_desc->backend_info[index].backend_hostname; } static const char * BackendDataDirShowFunc(int index) { return g_pool_config.backend_desc->backend_info[index].backend_data_directory; } static const char * BackendFlagsShowFunc(int index) { static char buffer[1024]; unsigned short flag = g_pool_config.backend_desc->backend_info[index].flag; *buffer = '\0'; if (POOL_ALLOW_TO_FAILOVER(flag)) snprintf(buffer, sizeof(buffer), "ALLOW_TO_FAILOVER"); else if (POOL_DISALLOW_TO_FAILOVER(flag)) snprintf(buffer, sizeof(buffer), "DISALLOW_TO_FAILOVER"); if (POOL_ALWAYS_MASTER & flag) { if (*buffer == '\0') snprintf(buffer, sizeof(buffer), "ALWAYS_MASTER"); else snprintf(buffer+strlen(buffer), sizeof(buffer), "|ALWAYS_MASTER"); } return buffer; } static const char * BackendAppNameShowFunc(int index) { return g_pool_config.backend_desc->backend_info[index].backend_application_name; } static bool BackendSlotEmptyCheckFunc(int index) { return (g_pool_config.backend_desc->backend_info[index].backend_port == 0); } static bool WdSlotEmptyCheckFunc(int index) { return (g_pool_config.wd_remote_nodes.wd_remote_node_info[index].pgpool_port == 0); } static bool WdIFSlotEmptyCheckFunc(int index) { return (index >= g_pool_config.num_hb_if); } static const char * OtherPPHostShowFunc(int index) { return g_pool_config.wd_remote_nodes.wd_remote_node_info[index].hostname; } static const char * OtherPPPortShowFunc(int index) { return IntValueShowFunc(g_pool_config.wd_remote_nodes.wd_remote_node_info[index].pgpool_port); } static const char * OtherWDPortShowFunc(int index) { return IntValueShowFunc(g_pool_config.wd_remote_nodes.wd_remote_node_info[index].wd_port); } static const char * HBDeviceShowFunc(int index) { return g_pool_config.hb_if[index].if_name; } static const char * HBDestinationShowFunc(int index) { return g_pool_config.hb_if[index].addr; } static const char * HBDestinationPortShowFunc(int index) { return IntValueShowFunc(g_pool_config.hb_if[index].dest_port); } static const char * HealthCheckPeriodShowFunc(int index) { return IntValueShowFunc(g_pool_config.health_check_params[index].health_check_period); } static const char * HealthCheckTimeOutShowFunc(int index) { return IntValueShowFunc(g_pool_config.health_check_params[index].health_check_timeout); } static const char * HealthCheckMaxRetriesShowFunc(int index) { return IntValueShowFunc(g_pool_config.health_check_params[index].health_check_max_retries); } static const char * HealthCheckRetryDelayShowFunc(int index) { return IntValueShowFunc(g_pool_config.health_check_params[index].health_check_retry_delay); } static const char * HealthCheckConnectTimeOutShowFunc(int index) { return IntValueShowFunc(g_pool_config.health_check_params[index].connect_timeout); } static const char * HealthCheckUserShowFunc(int index) { return g_pool_config.health_check_params[index].health_check_user; } static const char * HealthCheckPasswordShowFunc(int index) { return g_pool_config.health_check_params[index].health_check_password; } static const char * HealthCheckDatabaseShowFunc(int index) { return g_pool_config.health_check_params[index].health_check_database; } /* Health check configuration assign functions */ /*health_check_period*/ static bool HealthCheckPeriodAssignFunc(ConfigContext context, int newval, int index, int elevel) { g_pool_config.health_check_params[index].health_check_period = newval; return true; } /*health_check_timeout*/ static bool HealthCheckTimeOutAssignFunc(ConfigContext context, int newval, int index, int elevel) { g_pool_config.health_check_params[index].health_check_timeout = newval; return true; } /*health_check_max_retries*/ static bool HealthCheckMaxRetriesAssignFunc(ConfigContext context, int newval, int index, int elevel) { g_pool_config.health_check_params[index].health_check_max_retries = newval; return true; } /*health_check_retry_delay*/ static bool HealthCheckRetryDelayAssignFunc(ConfigContext context, int newval, int index, int elevel) { g_pool_config.health_check_params[index].health_check_retry_delay = newval; return true; } /*connect_timeout*/ static bool HealthCheckConnectTimeOutAssignFunc(ConfigContext context, int newval, int index, int elevel) { g_pool_config.health_check_params[index].connect_timeout = newval; return true; } static bool HealthCheckUserAssignFunc(ConfigContext context, char *newval, int index, int elevel) { if (g_pool_config.health_check_params[index].health_check_user) pfree(g_pool_config.health_check_params[index].health_check_user); if (newval) g_pool_config.health_check_params[index].health_check_user = pstrdup(newval); else g_pool_config.health_check_params[index].health_check_user = NULL; return true; } static bool HealthCheckPasswordAssignFunc(ConfigContext context, char *newval, int index, int elevel) { if (g_pool_config.health_check_params[index].health_check_password) pfree(g_pool_config.health_check_params[index].health_check_password); if (newval) g_pool_config.health_check_params[index].health_check_password = pstrdup(newval); else g_pool_config.health_check_params[index].health_check_password = newval; return true; } static bool HealthCheckDatabaseAssignFunc(ConfigContext context, char *newval, int index, int elevel) { if (g_pool_config.health_check_params[index].health_check_database) pfree(g_pool_config.health_check_params[index].health_check_database); if (newval) g_pool_config.health_check_params[index].health_check_database = pstrdup(newval); else g_pool_config.health_check_params[index].health_check_database = newval; return true; } /* Watchdog Assign functions */ /*other_pgpool_hostname*/ static bool OtherPPHostAssignFunc(ConfigContext context, char *newval, int index, int elevel) { if (newval == NULL || strlen(newval) == 0) g_pool_config.wd_remote_nodes.wd_remote_node_info[index].hostname[0] = '\0'; else strlcpy(g_pool_config.wd_remote_nodes.wd_remote_node_info[index].hostname, newval, MAX_DB_HOST_NAMELEN - 1); return true; } /*other_pgpool_port*/ static bool OtherPPPortAssignFunc(ConfigContext context, int newval, int index, int elevel) { g_pool_config.wd_remote_nodes.wd_remote_node_info[index].pgpool_port = newval; return true; } /*other_wd_port*/ static bool OtherWDPortAssignFunc(ConfigContext context, int newval, int index, int elevel) { g_pool_config.wd_remote_nodes.wd_remote_node_info[index].wd_port = newval; return true; } /*heartbeat_device*/ static bool HBDeviceAssignFunc(ConfigContext context, char *newval, int index, int elevel) { if (newval == NULL || strlen(newval) == 0) g_pool_config.hb_if[index].if_name[0] = '\0'; else strlcpy(g_pool_config.hb_if[index].if_name, newval, WD_MAX_IF_NAME_LEN); return true; } /*heartbeat_destination*/ static bool HBDestinationAssignFunc(ConfigContext context, char *newval, int index, int elevel) { if (newval == NULL || strlen(newval) == 0) g_pool_config.hb_if[index].addr[0] = '\0'; else strlcpy(g_pool_config.hb_if[index].addr, newval, WD_MAX_HOST_NAMELEN - 1); return true; } /*heartbeat_destination_port*/ static bool HBDestinationPortAssignFunc(ConfigContext context, int newval, int index, int elevel) { g_pool_config.hb_if[index].dest_port = newval; return true; } /* * Throws warning for if someone uses the removed fail_over_on_backend * configuration parameter */ static bool FailOverOnBackendErrorAssignMessage(ConfigContext scontext, bool newval, int elevel) { if (scontext != CFGCXT_BOOT) ereport(WARNING, (errmsg("fail_over_on_backend_error is changed to failover_on_backend_error"), errdetail("setting failover_on_backend_error has no effect"), errhint("use failover_on_backend_error instead"))); return true; } /* * Check DB node spec. node spec should be either "primary", "standby" or * numeric DB node id. */ static bool check_redirect_node_spec(char *node_spec) { int len = strlen(node_spec); int i; int64 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 < len; i++) { if (!isdigit((int) node_spec[i])) return false; } val = pool_atoi64(node_spec); if (val >= 0 && val < MAX_NUM_BACKENDS) return true; return false; } static bool config_post_processor(ConfigContext context, int elevel) { double total_weight = 0.0; sig_atomic_t local_num_backends = 0; int i; if (context == CFGCXT_BOOT) { char localhostname[256]; int res = gethostname(localhostname, sizeof(localhostname)); if (res != 0) { ereport(WARNING, (errmsg("initializing pool configuration"), errdetail("failed to get the local hostname"))); return false; } g_pool_config.wd_hostname = pstrdup(localhostname); return true; } for (i = 0; i < MAX_CONNECTION_SLOTS; i++) { BackendInfo *backend_info = &g_pool_config.backend_desc->backend_info[i]; /* port number == 0 indicates that this server is out of use */ if (backend_info->backend_port == 0) { *backend_info->backend_hostname = '\0'; backend_info->backend_status = CON_UNUSED; backend_info->backend_weight = 0.0; } else { total_weight += backend_info->unnormalized_weight; local_num_backends = i + 1; /* initialize backend_hostname with a default socket path if empty */ if (*(backend_info->backend_hostname) == '\0') { ereport(LOG, (errmsg("initializing pool configuration"), errdetail("empty backend_hostname%d, use PostgreSQL's default unix socket path (%s)", i, DEFAULT_SOCKET_DIR))); strlcpy(backend_info->backend_hostname, DEFAULT_SOCKET_DIR, MAX_DB_HOST_NAMELEN); } } } if (local_num_backends != pool_config->backend_desc->num_backends) pool_config->backend_desc->num_backends = local_num_backends; 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; i < MAX_CONNECTION_SLOTS; i++) { BackendInfo *backend_info = &g_pool_config.backend_desc->backend_info[i]; if (backend_info->backend_port != 0) { backend_info->backend_weight = (RAND_MAX) * backend_info->unnormalized_weight / total_weight; ereport(DEBUG1, (errmsg("initializing pool configuration"), errdetail("backend %d weight: %f flag: %04x", i, backend_info->backend_weight, backend_info->flag))); } } /* Set the number of configured Watchdog nodes */ g_pool_config.wd_remote_nodes.num_wd = 0; for (i = 0; i < MAX_WATCHDOG_NUM; i++) { WdRemoteNodeInfo *wdNode = &g_pool_config.wd_remote_nodes.wd_remote_node_info[i]; if (wdNode->wd_port > 0) g_pool_config.wd_remote_nodes.num_wd = i + 1; } /* Set the number of configured heartbeat interfaces */ g_pool_config.num_hb_if = 0; for (i = 0; i < WD_MAX_IF_NUM; i++) { if (g_pool_config.hb_if[i].dest_port > 0) g_pool_config.num_hb_if = i + 1; } if (strcmp(pool_config->recovery_1st_stage_command, "") || strcmp(pool_config->recovery_2nd_stage_command, "")) { for (i = 0; i < MAX_CONNECTION_SLOTS; i++) { BackendInfo *backend_info = &g_pool_config.backend_desc->backend_info[i]; if (backend_info->backend_port != 0 && !strcmp(backend_info->backend_data_directory, "")) { ereport(elevel, (errmsg("invalid configuration, recovery_1st_stage_command and recovery_2nd_stage_command requires backend_data_directory to be set"))); return false; } } } /* * Quarantine state in native replication mode is dangerous and it can * potentially cause data inconsistency. * So as per the discussions, we agreed on disallowing setting * failover_when_quorum_exists in native replication mode */ if (pool_config->failover_when_quorum_exists && pool_config->replication_mode) { pool_config->failover_when_quorum_exists = false; ereport(elevel, (errmsg("invalid configuration, failover_when_quorum_exists is not allowed in native replication mode"))); return false; } return true; } static bool MakeAppRedirectListRegex(char *newval, int elevel) { /* TODO Deal with the memory */ int i; Left_right_tokens *lrtokens; if (newval == NULL) { pool_config->redirect_app_names = NULL; pool_config->app_name_redirect_tokens = NULL; return true; } lrtokens = create_lrtoken_array(); extract_string_tokens2(newval, ",", ':', lrtokens); pool_config->redirect_app_names = create_regex_array(); pool_config->app_name_redirect_tokens = lrtokens; for (i = 0; i < lrtokens->pos; i++) { if (!check_redirect_node_spec(lrtokens->token[i].right_token)) { ereport(elevel, (errmsg("invalid configuration for key \"app_name_redirect_preference_list\""), errdetail("wrong redirect db node spec: \"%s\"", lrtokens->token[i].right_token))); return false; } if (*(lrtokens->token[i].left_token) == '\0' || add_regex_array(pool_config->redirect_app_names, lrtokens->token[i].left_token)) { ereport(elevel, (errmsg("invalid configuration for key \"app_name_redirect_preference_list\""), errdetail("wrong redirect app name regular expression: \"%s\"", lrtokens->token[i].left_token))); return false; } } return true; } static bool MakeDBRedirectListRegex(char *newval, int elevel) { /* TODO Deal with the memory */ int i; Left_right_tokens *lrtokens; if (newval == NULL) { pool_config->redirect_dbnames = NULL; pool_config->db_redirect_tokens = NULL; return true; } lrtokens = create_lrtoken_array(); extract_string_tokens2(newval, ",", ':', lrtokens); pool_config->redirect_dbnames = create_regex_array(); pool_config->db_redirect_tokens = lrtokens; for (i = 0; i < lrtokens->pos; i++) { if (!check_redirect_node_spec(lrtokens->token[i].right_token)) { ereport(elevel, (errmsg("invalid configuration for key \"database_redirect_preference_list\""), errdetail("wrong redirect db node spec: \"%s\"", lrtokens->token[i].right_token))); return false; } if (*(lrtokens->token[i].left_token) == '\0' || add_regex_array(pool_config->redirect_dbnames, lrtokens->token[i].left_token)) { ereport(elevel, (errmsg("invalid configuration for key \"database_redirect_preference_list\""), errdetail("wrong redirect dbname regular expression: \"%s\"", lrtokens->token[i].left_token))); return false; } } return true; } static struct config_generic * get_index_free_record_if_any(struct config_generic *record) { struct config_generic *ret = NULL; switch (record->vartype) { case CONFIG_VAR_TYPE_INT_ARRAY: { struct config_int_array *conf = (struct config_int_array *) record; if (conf->config_no_index.gen.name) ret = (struct config_generic *) &conf->config_no_index; } break; case CONFIG_VAR_TYPE_DOUBLE_ARRAY: { struct config_double_array *conf = (struct config_double_array *) record; if (conf->config_no_index.gen.name) ret = (struct config_generic *) &conf->config_no_index; } break; case CONFIG_VAR_TYPE_STRING_ARRAY: { struct config_string_array *conf = (struct config_string_array *) record; if (conf->config_no_index.gen.name) ret = (struct config_generic *) &conf->config_no_index; } break; default: break; } return ret; } #ifndef POOL_PRIVATE /* * Lookup the name for an enum option with the selected value. * The returned string is a pointer to static data and not * allocated for modification. */ static const char * config_enum_lookup_by_value(struct config_enum *record, int val) { const struct config_enum_entry *entry; for (entry = record->options; entry && entry->name; entry++) { if (entry->val == val) return entry->name; } /* should never happen */ return NULL; } static char * ShowOption(struct config_generic *record, int index, int elevel) { char buffer[256]; const char *val; /* * if the value needs to be hidden no need to dig further */ if (record->flags & VAR_HIDDEN_VALUE) return pstrdup("*****"); switch (record->vartype) { case CONFIG_VAR_TYPE_BOOL: { struct config_bool *conf = (struct config_bool *) record; if (conf->show_hook) val = (*conf->show_hook) (); else val = *conf->variable ? "on" : "off"; } break; case CONFIG_VAR_TYPE_INT: { struct config_int *conf = (struct config_int *) record; if (conf->show_hook) val = (*conf->show_hook) (); else { int result = *conf->variable; snprintf(buffer, sizeof(buffer), "%d", result); val = buffer; } } break; case CONFIG_VAR_TYPE_LONG: { struct config_long *conf = (struct config_long *) record; if (conf->show_hook) val = (*conf->show_hook) (); else { int64 result = (int64) *conf->variable; snprintf(buffer, sizeof(buffer), INT64_FORMAT, result); val = buffer; } } break; case CONFIG_VAR_TYPE_DOUBLE: { struct config_double *conf = (struct config_double *) record; if (conf->show_hook) val = (*conf->show_hook) (); else { snprintf(buffer, sizeof(buffer), "%g", *conf->variable); val = buffer; } } break; case CONFIG_VAR_TYPE_STRING: { struct config_string *conf = (struct config_string *) record; if (conf->show_hook) val = (*conf->show_hook) (); else if (*conf->variable && **conf->variable) val = *conf->variable; else val = ""; } break; case CONFIG_VAR_TYPE_ENUM: { struct config_enum *conf = (struct config_enum *) record; if (conf->show_hook) val = (*conf->show_hook) (); else val = config_enum_lookup_by_value(conf, *conf->variable); } break; case CONFIG_VAR_TYPE_INT_ARRAY: { struct config_int_array *conf = (struct config_int_array *) record; if (index >= record->max_elements || index < 0) { ereport(elevel, (errmsg("invalid index %d for configuration parameter \"%s\"", index, conf->gen.name), errdetail("allowed index is between 0 and %d", record->max_elements - 1))); val = NULL; } else { if (conf->show_hook) val = (*conf->show_hook) (index); else { int result = *conf->variable[index]; snprintf(buffer, sizeof(buffer), "%d", result); val = buffer; } } } break; case CONFIG_VAR_TYPE_DOUBLE_ARRAY: { struct config_double_array *conf = (struct config_double_array *) record; if (index >= record->max_elements || index < 0) { ereport(elevel, (errmsg("invalid index %d for configuration parameter \"%s\"", index, conf->gen.name), errdetail("allowed index is between 0 and %d", record->max_elements - 1))); val = NULL; } else { if (conf->show_hook) val = (*conf->show_hook) (index); else { double result = *conf->variable[index]; snprintf(buffer, sizeof(buffer), "%g", result); val = buffer; } } } break; case CONFIG_VAR_TYPE_STRING_ARRAY: { struct config_string_array *conf = (struct config_string_array *) record; if (index >= record->max_elements || index < 0) { ereport(elevel, (errmsg("invalid index %d for configuration parameter \"%s\"", index, conf->gen.name), errdetail("allowed index is between 0 and %d", record->max_elements - 1))); val = NULL; } else { if (conf->show_hook) val = (*conf->show_hook) (index); else if ((*conf->variable)[index] && ***conf->variable) val = (*conf->variable)[index]; else val = ""; } } break; case CONFIG_VAR_TYPE_STRING_LIST: { struct config_string_list *conf = (struct config_string_list *) record; if (conf->show_hook) val = (*conf->show_hook) (); else if (conf->current_val) val = conf->current_val; else val = ""; } break; default: /* just to keep compiler quiet */ val = "???"; break; } if (val) return pstrdup(val); return NULL; } static bool value_slot_for_config_record_is_empty(struct config_generic *record, int index) { switch (record->vartype) { case CONFIG_VAR_TYPE_BOOL: case CONFIG_VAR_TYPE_INT: case CONFIG_VAR_TYPE_LONG: case CONFIG_VAR_TYPE_DOUBLE: case CONFIG_VAR_TYPE_STRING: case CONFIG_VAR_TYPE_ENUM: return false; break; case CONFIG_VAR_TYPE_INT_ARRAY: { struct config_int_array *conf = (struct config_int_array *) record; if (conf->empty_slot_check_func) return (*conf->empty_slot_check_func) (index); } break; case CONFIG_VAR_TYPE_DOUBLE_ARRAY: { struct config_double_array *conf = (struct config_double_array *) record; if (conf->empty_slot_check_func) return (*conf->empty_slot_check_func) (index); } break; case CONFIG_VAR_TYPE_STRING_ARRAY: { struct config_string_array *conf = (struct config_string_array *) record; if (conf->empty_slot_check_func) return (*conf->empty_slot_check_func) (index); } break; default: break; } return false; } bool set_config_option_for_session(POOL_CONNECTION * frontend, POOL_CONNECTION_POOL * backend, const char *name, const char *value) { bool ret; MemoryContext oldCxt = MemoryContextSwitchTo(TopMemoryContext); ret = set_one_config_option(name, value, CFGCXT_SESSION, PGC_S_SESSION, FRONTEND_ONLY_ERROR); if (ret == true) { send_complete_and_ready(frontend, backend, "SET", -1); } MemoryContextSwitchTo(oldCxt); return ret; } bool reset_all_variables(POOL_CONNECTION * frontend, POOL_CONNECTION_POOL * backend) { int i; int elevel = (frontend == NULL) ? FATAL : FRONTEND_ONLY_ERROR; MemoryContext oldCxt = MemoryContextSwitchTo(TopMemoryContext); ereport(DEBUG2, (errmsg("RESET ALL CONFIG VARIABLES"))); for (i = 0; i < num_all_parameters; ++i) { struct config_generic *record = all_parameters[i]; /* Don't reset if special exclusion from RESET ALL */ if (record->flags & VAR_NO_RESET_ALL) continue; if (record->dynamic_array_var) { int index; for (index = 0; index < record->max_elements; index++) { if (record->scontexts[index] != CFGCXT_SESSION) continue; if (value_slot_for_config_record_is_empty(record, index)) continue; setConfigOptionVar(record, record->name, index, NULL, CFGCXT_INIT, PGC_S_FILE, elevel); } /* Also set the default value for index free record if any */ if (record->flags & ARRAY_VAR_ALLOW_NO_INDEX) { struct config_generic *idx_free_record = get_index_free_record_if_any(record); if (idx_free_record && idx_free_record->scontexts[0] == CFGCXT_SESSION) { ereport(DEBUG1, (errmsg("reset index-free value of array type parameter \"%s\"", record->name))); setConfigOptionVar(idx_free_record, idx_free_record->name, -1, NULL, CFGCXT_INIT, PGC_S_FILE, elevel); } } } else { /* do nothing if variable is not changed in session */ if (record->scontexts[0] != CFGCXT_SESSION) continue; setConfigOptionVar(record, record->name, -1, NULL, CFGCXT_INIT, PGC_S_FILE, elevel); } } if (frontend) send_complete_and_ready(frontend, backend, "RESET", -1); MemoryContextSwitchTo(oldCxt); return true; } bool report_all_variables(POOL_CONNECTION * frontend, POOL_CONNECTION_POOL * backend) { int i; int num_rows = 0; const char *value; send_row_description_for_detail_view(frontend, backend); /* * grouped variables are not listed in all parameter array so start with * group variables. */ for (i = 0; ConfigureVarGroups[i].gen.name; i++) { int rows = send_grouped_type_variable_to_frontend(&ConfigureVarGroups[i], frontend, backend); if (rows < 0) return false; num_rows += rows; } for (i = 0; i < num_all_parameters; ++i) { struct config_generic *record = all_parameters[i]; if (record->flags & VAR_PART_OF_GROUP) continue; if (record->flags & VAR_HIDDEN_IN_SHOW_ALL) continue; if (record->dynamic_array_var) { int rows = send_array_type_variable_to_frontend(record, frontend, backend); if (rows < 0) return false; num_rows += rows; } else { value = ShowOption(record, 0, FRONTEND_ONLY_ERROR); if (value == NULL) return false; send_config_var_detail_row(frontend, backend, record->name, value, record->description); pfree((void *) value); num_rows++; } } send_complete_and_ready(frontend, backend, "SELECT", num_rows); return true; } bool report_config_variable(POOL_CONNECTION * frontend, POOL_CONNECTION_POOL * backend, const char *var_name) { int index = 0; char *value; int num_rows = 0; struct config_generic *record; if (strcmp(var_name, "all") == 0) return report_all_variables(frontend, backend); /* search the variable */ record = find_option(var_name, WARNING); if (record == NULL) { int i; /* check if the var name match the grouped var */ for (i = 0; ConfigureVarGroups[i].gen.name; i++) { if (strcmp(ConfigureVarGroups[i].gen.name, var_name) == 0) { send_row_description_for_detail_view(frontend, backend); num_rows = send_grouped_type_variable_to_frontend(&ConfigureVarGroups[i], frontend, backend); if (num_rows < 0) return false; send_complete_and_ready(frontend, backend, "SELECT", num_rows); return true; } } ereport(FRONTEND_ONLY_ERROR, (errmsg("config variable \"%s\" not found", var_name))); return false; } if (record->dynamic_array_var) { if (get_index_in_var_name(record, var_name, &index, FRONTEND_ONLY_ERROR) == false) return false; if (index < 0) { /* * Index is not included in parameter name. this is the multi * value config variable */ ereport(DEBUG3, (errmsg("show parameter \"%s\" with out index", var_name))); send_row_description_for_detail_view(frontend, backend); num_rows = send_array_type_variable_to_frontend(record, frontend, backend); if (num_rows < 0) return false; } } if (index >= 0) { /* single value only */ num_rows = 1; send_row_description(frontend, backend, 1, (char **) &var_name); value = ShowOption(record, index, FRONTEND_ONLY_ERROR); if (value == NULL) return false; send_config_var_value_only_row(frontend, backend, value); pfree((void *) value); } send_complete_and_ready(frontend, backend, "SELECT", num_rows); return true; } static int send_array_type_variable_to_frontend(struct config_generic *record, POOL_CONNECTION * frontend, POOL_CONNECTION_POOL * backend) { if (record->dynamic_array_var) { const int MAX_NAME_LEN = 255; char name[MAX_NAME_LEN + 1]; int index; int num_rows = 0; const char *value; struct config_generic *idx_free_record = get_index_free_record_if_any(record); /* Before printing the array, print the index free value if any */ if (idx_free_record) { value = ShowOption(idx_free_record, 0, FRONTEND_ONLY_ERROR); if (value) { send_config_var_detail_row(frontend, backend, (const char *) idx_free_record->name, value, record->description); pfree((void *) value); num_rows++; } } for (index = 0; index < record->max_elements; index++) { if (value_slot_for_config_record_is_empty(record, index)) continue; /* construct the name with index */ snprintf(name, MAX_NAME_LEN, "%s%d", record->name, index); value = ShowOption(record, index, FRONTEND_ONLY_ERROR); if (value == NULL) return -1; send_config_var_detail_row(frontend, backend, (const char *) name, value, record->description); pfree((void *) value); num_rows++; } return num_rows; } return -1; /* error */ } static int send_grouped_type_variable_to_frontend(struct config_grouped_array_var *grouped_record, POOL_CONNECTION * frontend, POOL_CONNECTION_POOL * backend) { int k, index; int max_elements = grouped_record->var_list[0]->max_elements; int num_rows = 0; const char *value; for (k = 0; k < grouped_record->var_count; k++) { struct config_generic *record = grouped_record->var_list[k]; struct config_generic *idx_free_record = get_index_free_record_if_any(record); if (idx_free_record) { value = ShowOption(idx_free_record, 0, FRONTEND_ONLY_ERROR); if (value) { send_config_var_detail_row(frontend, backend, (const char *) idx_free_record->name, value, record->description); pfree((void *) value); num_rows++; } } } for (index = 0; index < max_elements; index++) { for (k = 0; k < grouped_record->var_count; k++) { const int MAX_NAME_LEN = 255; char name[MAX_NAME_LEN + 1]; struct config_generic *record = grouped_record->var_list[k]; if (value_slot_for_config_record_is_empty(record, index)) break; /* construct the name with index */ snprintf(name, MAX_NAME_LEN, "%s%d", record->name, index); value = ShowOption(record, index, FRONTEND_ONLY_ERROR); if (value == NULL) return -1; send_config_var_detail_row(frontend, backend, (const char *) name, value, record->description); pfree((void *) value); num_rows++; } } return num_rows; } static void send_row_description_for_detail_view(POOL_CONNECTION * frontend, POOL_CONNECTION_POOL * backend) { static char *field_names[] = {"item", "value", "description"}; send_row_description(frontend, backend, 3, field_names); } #endif /* not defined POOL_FRONTEND */ pgpool-II-4.1.4/src/context/0000775000175000017500000000000013730350746012605 500000000000000pgpool-II-4.1.4/src/context/pool_session_context.c0000664000175000017500000013557313730350127017160 00000000000000/* -*-pgsql-c-*- */ /* * * pgpool: a language independent connection pool server for PostgreSQL * written by Tatsuo Ishii * * Copyright (c) 2003-2019 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" #include "protocol/pool_proto_modules.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); static POOL_PENDING_MESSAGE * copy_pending_message(POOL_PENDING_MESSAGE * messag); static void dump_sent_message(char *caller, POOL_SENT_MESSAGE * m); #ifdef PENDING_MESSAGE_DEBUG static int Elevel = LOG; #else static int Elevel = DEBUG2; #endif /* * Initialize per session context */ void pool_init_session_context(POOL_CONNECTION * frontend, POOL_CONNECTION_POOL * backend) { session_context = &session_context_d; ProcessInfo *process_info; int node_id; int i; /* Clear session context memory */ memset(&session_context_d, 0, sizeof(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(); process_info = pool_get_my_process_info(); if (!process_info) ereport(ERROR, (errmsg("failed to get process info for current process"))); /* Choose load balancing node if necessary */ if (pool_config->load_balance_mode) { node_id = select_load_balancing_node(); } else { node_id = SL_MODE ? PRIMARY_NODE_ID : MASTER_NODE_ID; } session_context->load_balance_node_id = node_id; for (i = 0; i < NUM_BACKENDS; i++) { pool_coninfo(session_context->process_context->proc_id, pool_pool_index(), i)->load_balancing_node = node_id; } ereport(DEBUG5, (errmsg("initializing session context"), errdetail("selected load balancing node: %d", node_id))); /* 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(); /* Unset suspend reading from frontend flag */ pool_unset_suspend_reading_from_frontend(); /* 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; } /* Initialize pending message list */ pool_pending_messages_init(); /* Initialize previous pending message */ pool_pending_message_reset_previous_message(); /* Initialize temp tables */ pool_temp_tables_init(); #ifdef NOT_USED /* Initialize preferred master node id */ pool_reset_preferred_master_node_id(); #endif } /* * 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(DEBUG5, (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_SESSION_CONTEXT *s = pool_get_session_context(false); ereport(DEBUG5, (errmsg("session context: unsetting query in progress. DONE"))); s->in_progress = false; /* Restore where_to_send map if necessary */ if (s->need_to_restore_where_to_send) { memcpy(s->query_context->where_to_send, s->where_to_send_save, sizeof(s->where_to_send_save)); } s->need_to_restore_where_to_send = 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(DEBUG5, (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(DEBUG5, (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(DEBUG5, (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(DEBUG5, (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(DEBUG5, (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(DEBUG5, (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; if (kind == 0 || name == NULL) return false; 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; dump_sent_message("pool_sent_message_destroy", message); 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); } } /* * Zap query context info in sent messages to indicate that the query context * has been already removed. */ void pool_zap_query_context_in_sent_messages(POOL_QUERY_CONTEXT *query_context) { int i; POOL_SENT_MESSAGE_LIST *msglist; msglist = &pool_get_session_context(false)->message_list; for (i = 0; i < msglist->size; i++) { elog(DEBUG5, "checking zapping sent message: %p query_context: %p", &msglist->sent_messages[i], msglist->sent_messages[i]->query_context); if (msglist->sent_messages[i]->query_context == query_context) { msglist->sent_messages[i]->query_context = NULL; elog(DEBUG5, "Zap sent message: %p", &msglist->sent_messages[i]); } } } static void dump_sent_message(char *caller, POOL_SENT_MESSAGE * m) { ereport(DEBUG5, (errmsg("called by %s: sent message: address: %p kind: %c name: =%s= state:%d", caller, m, m->kind, m->name, m->state))); } /* * Create a sent message. * kind: one of 'P':Parse, 'B':Bind or 'Q':Query(PREPARE) * len: message length in host 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->state = POOL_SENT_MESSAGE_CREATED; 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; dump_sent_message("pool_add_sent_message", message); if (!message) { ereport(DEBUG5, (errmsg("adding sent message to list"), errdetail("message is null"))); return; } old_msg = pool_get_sent_message(message->kind, message->name, POOL_SENT_MESSAGE_CREATED); if (old_msg == message) { /* * It is likely caller tries to add the exact same message previously * added. We should ignore this because pool_remove_sent_message() * will free memory allocated in the message. */ ereport(DEBUG5, (errmsg("adding sent message to list"), errdetail("adding exactly same message is prohibited"))); return; } msglist = &session_context->message_list; if (old_msg) { if (message->kind == 'B') ereport(DEBUG5, (errmsg("adding sent message to list"), errdetail("portal \"%s\" already exists", message->name))); else ereport(DEBUG5, (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; } /* * Find a sent message by kind and name. */ POOL_SENT_MESSAGE * pool_get_sent_message(char kind, const char *name, POOL_SENT_MESSAGE_STATE state) { int i; POOL_SENT_MESSAGE_LIST *msglist; msglist = &pool_get_session_context(false)->message_list; if (kind == 0 || name == NULL) return NULL; for (i = 0; i < msglist->size; i++) { if (msglist->sent_messages[i]->kind == kind && !strcmp(msglist->sent_messages[i]->name, name) && msglist->sent_messages[i]->state == state) return msglist->sent_messages[i]; } return NULL; } /* * Find a sent message by query context. */ POOL_SENT_MESSAGE * pool_get_sent_message_by_query_context(POOL_QUERY_CONTEXT * query_context) { int i; POOL_SENT_MESSAGE_LIST *msglist; msglist = &pool_get_session_context(false)->message_list; if (query_context == NULL) return NULL; for (i = 0; i < msglist->size; i++) { if (msglist->sent_messages[i]->query_context == query_context) return msglist->sent_messages[i]; } return NULL; } /* * Set message state to POOL_SENT_MESSAGE_STATE to POOL_SENT_MESSAGE_CLOSED. */ void pool_set_sent_message_state(POOL_SENT_MESSAGE * message) { ereport(DEBUG5, (errmsg("pool_set_sent_message_state: name:%s kind:%c previous state: %d", message->name, message->kind, message->state))); message->state = POOL_SENT_MESSAGE_CLOSED; } /* * We don't have a write query in this transaction yet. */ void pool_unset_writing_transaction(void) { /* * If disable_transaction_on_write is 'always', then never turn off * writing transaction flag. */ if (pool_config->disable_load_balance_on_write != DLBOW_ALWAYS) { pool_get_session_context(false)->writing_transaction = false; ereport(DEBUG5, (errmsg("session context: clearing writing transaction. DONE"))); } } /* * We have a write query in this transaction. */ void pool_set_writing_transaction(void) { /* * If disable_transaction_on_write is 'off', then never turn on writing * transaction flag. */ if (pool_config->disable_load_balance_on_write != DLBOW_OFF) { pool_get_session_context(false)->writing_transaction = true; ereport(DEBUG5, (errmsg("session context: setting writing transaction. DONE"))); } } /* * 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(DEBUG5, (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(DEBUG5, (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(DEBUG5, (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(DEBUG5, (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(DEBUG5, (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(DEBUG5, (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; i < POOL_MAX_PREPARED_STATEMENTS; i++) { if (*session_context->prep_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; i < POOL_MAX_PREPARED_STATEMENTS; i++) { if (!strcmp(session_context->prep_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; i < POOL_MAX_PREPARED_STATEMENTS; i++) { if (!strcmp(session_context->prep_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; ListCell *cell; ListCell *next; 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(DEBUG5, (errmsg("checking if query context can be safely destroyed"), errdetail("query context %p is still used %d times in sent message list. query:\"%s\"", qc, count, qc->original_query))); return false; } count = 0; for (cell = list_head(session_context->pending_messages); cell; cell = next) { POOL_PENDING_MESSAGE *message = (POOL_PENDING_MESSAGE *) lfirst(cell); if (message->query_context == qc) { count++; } next = lnext(cell); } if (count >= 1) { ereport(DEBUG5, (errmsg("checking if query context can be safely destroyed"), errdetail("query context %p is still used %d times in pending message list. query:%s", qc, count, qc->original_query))); return false; } return true; } /* * Initialize pending message list */ void pool_pending_messages_init(void) { if (!session_context) ereport(ERROR, (errmsg("pool_pending_message_init: session context is not initialized"))); session_context->pending_messages = NIL; } /* * Destroy pending message list */ void pool_pending_messages_destroy(void) { ListCell *cell; POOL_PENDING_MESSAGE *msg; if (!session_context) ereport(ERROR, (errmsg("pool_pending_message_destory: session context is not initialized"))); foreach(cell, session_context->pending_messages) { msg = (POOL_PENDING_MESSAGE *) lfirst(cell); pfree(msg->contents); } list_free(session_context->pending_messages); } /* * Create one message. */ POOL_PENDING_MESSAGE * pool_pending_message_create(char kind, int len, char *contents) { POOL_PENDING_MESSAGE *msg; MemoryContext old_context; if (!session_context) ereport(ERROR, (errmsg("pool_pending_message_create: session context is not initialized"))); old_context = MemoryContextSwitchTo(session_context->memory_context); msg = palloc(sizeof(POOL_PENDING_MESSAGE)); switch (kind) { case 'P': msg->type = POOL_PARSE; break; case 'B': msg->type = POOL_BIND; break; case 'E': msg->type = POOL_EXECUTE; break; case 'D': msg->type = POOL_DESCRIBE; break; case 'C': msg->type = POOL_CLOSE; break; case 'S': msg->type = POOL_SYNC; break; default: ereport(ERROR, (errmsg("pool_pending_message_create: unknow kind: %c", kind))); break; } if (len > 0) { msg->contents = palloc(len); memcpy(msg->contents, contents, len); } else msg->contents = NULL; msg->contents_len = len; msg->query[0] = '\0'; msg->statement[0] = '\0'; msg->portal[0] = '\0'; msg->is_rows_returned = false; msg->not_forward_to_frontend = false; memset(msg->node_ids, false, sizeof(msg->node_ids)); MemoryContextSwitchTo(old_context); return msg; } /* * Set node_ids field of message which indicates which backend nodes the * message was sent. */ void pool_pending_message_dest_set(POOL_PENDING_MESSAGE * message, POOL_QUERY_CONTEXT * query_context) { memcpy(message->node_ids, query_context->where_to_send, sizeof(message->node_ids)); message->query_context = query_context; if (is_select_query(query_context->parse_tree, query_context->original_query)) { message->is_rows_returned = true; } } /* * Set where_to_send field in query_context from node_ids field of message * which indicates which backend nodes the message was sent. */ void pool_pending_message_query_context_dest_set(POOL_PENDING_MESSAGE * message, POOL_QUERY_CONTEXT * query_context) { int i; POOL_SESSION_CONTEXT *s = pool_get_session_context(false); /* Save where_to_send map */ memcpy(s->where_to_send_save, query_context->where_to_send, sizeof(s->where_to_send_save)); s->need_to_restore_where_to_send = true; /* Rewrite where_to_send map */ memset(query_context->where_to_send, 0, sizeof(query_context->where_to_send)); for (i = 0; i < MAX_NUM_BACKENDS; i++) { if (message->node_ids[i]) { query_context->where_to_send[i] = 1; } } } /* * Set query field of message. */ void pool_pending_message_query_set(POOL_PENDING_MESSAGE * message, POOL_QUERY_CONTEXT * query_context) { StrNCpy(message->query, query_context->original_query, sizeof(message->query)); } /* * Add one message to the tail of the list */ void pool_pending_message_add(POOL_PENDING_MESSAGE * message) { POOL_PENDING_MESSAGE *msg; MemoryContext old_context; if (!session_context) ereport(ERROR, (errmsg("pool_pending_message_add: session context is not initialized"))); switch (message->type) { case POOL_PARSE: StrNCpy(message->statement, message->contents, sizeof(message->statement)); StrNCpy(message->query, message->contents + strlen(message->contents) + 1, sizeof(message->query)); break; case POOL_BIND: StrNCpy(message->portal, message->contents, sizeof(message->portal)); StrNCpy(message->statement, message->contents + strlen(message->contents) + 1, sizeof(message->statement)); break; case POOL_EXECUTE: StrNCpy(message->portal, message->contents, sizeof(message->portal)); break; case POOL_CLOSE: case POOL_DESCRIBE: if (*message->contents == 'S') StrNCpy(message->statement, message->contents + 1, sizeof(message->statement)); else StrNCpy(message->portal, message->contents + 1, sizeof(message->portal)); break; case POOL_SYNC: break; default: ereport(ERROR, (errmsg("pool_pending_message_add: unknown message type:%d", message->type))); return; break; } if (message->type != POOL_SYNC) ereport(Elevel, (errmsg("pool_pending_message_add: message type:%s message len:%d query:%s statement:%s portal:%s node_ids[0]:%d node_ids[1]:%d", pool_pending_message_type_to_string(message->type), message->contents_len, message->query, message->statement, message->portal, message->node_ids[0], message->node_ids[1]))); else ereport(Elevel, (errmsg("pool_pending_message_add: message type: sync"))); old_context = MemoryContextSwitchTo(session_context->memory_context); msg = copy_pending_message(message); session_context->pending_messages = lappend(session_context->pending_messages, msg); MemoryContextSwitchTo(old_context); } /* * Return the message from the head of the list. If the list is not empty, a * copy of the message is returned. If the list is empty, returns NULL. */ POOL_PENDING_MESSAGE * pool_pending_message_head_message(void) { ListCell *cell; POOL_PENDING_MESSAGE *message; POOL_PENDING_MESSAGE *m; MemoryContext old_context; if (!session_context) ereport(ERROR, (errmsg("pool_pending_message_head_message: session context is not initialized"))); if (list_length(session_context->pending_messages) == 0) { return NULL; } old_context = MemoryContextSwitchTo(session_context->memory_context); cell = list_head(session_context->pending_messages); m = (POOL_PENDING_MESSAGE *) lfirst(cell); message = copy_pending_message(m); ereport(Elevel, (errmsg("pool_pending_message_head_message: message type:%s message len:%d query:%s statement:%s portal:%s node_ids[0]:%d node_ids[1]:%d", pool_pending_message_type_to_string(message->type), message->contents_len, message->query, message->statement, message->portal, message->node_ids[0], message->node_ids[1]))); MemoryContextSwitchTo(old_context); return message; } /* * Remove one message from the head of the list. If the list is not empty, a * copy of the message is returned and the message is removed the message * list. If the list is empty, returns NULL. */ POOL_PENDING_MESSAGE * pool_pending_message_pull_out(void) { ListCell *cell; POOL_PENDING_MESSAGE *message; POOL_PENDING_MESSAGE *m; MemoryContext old_context; if (!session_context) ereport(ERROR, (errmsg("pool_pending_message_pull_out: session context is not initialized"))); if (list_length(session_context->pending_messages) == 0) { return NULL; } old_context = MemoryContextSwitchTo(session_context->memory_context); cell = list_head(session_context->pending_messages); m = (POOL_PENDING_MESSAGE *) lfirst(cell); message = copy_pending_message(m); ereport(Elevel, (errmsg("pool_pending_message_pull_out: message type:%s message len:%d query:%s statement:%s portal:%s node_ids[0]:%d node_ids[1]:%d", pool_pending_message_type_to_string(message->type), message->contents_len, message->query, message->statement, message->portal, message->node_ids[0], message->node_ids[1]))); pool_pending_message_free_pending_message(m); session_context->pending_messages = list_delete_cell(session_context->pending_messages, cell, NULL); MemoryContextSwitchTo(old_context); return message; } /* * Try to find the first message specified by the message type in the message * list. If found, a copy of the message is returned. If not, returns NULL. */ POOL_PENDING_MESSAGE * pool_pending_message_get(POOL_MESSAGE_TYPE type) { ListCell *cell; ListCell *next; POOL_PENDING_MESSAGE *msg; MemoryContext old_context; if (!session_context) ereport(ERROR, (errmsg("pool_pending_message_remove: session context is not initialized"))); old_context = MemoryContextSwitchTo(session_context->memory_context); msg = NULL; for (cell = list_head(session_context->pending_messages); cell; cell = next) { POOL_PENDING_MESSAGE *m = (POOL_PENDING_MESSAGE *) lfirst(cell); next = lnext(cell); if (m->type == type) { msg = copy_pending_message(m); break; } } MemoryContextSwitchTo(old_context); return msg; } /* * Get message specification (either statement ('S') or portal ('P')) from a * close message. */ char pool_get_close_message_spec(POOL_PENDING_MESSAGE * msg) { return *msg->contents; } /* * Get statement or portal name from close message. * The returned pointer is within "msg". */ char * pool_get_close_message_name(POOL_PENDING_MESSAGE * msg) { return (msg->contents) + 1; } /* * Perform deep copy of POOL_PENDING_MESSAGE object in the current memory * context except the query context. */ static POOL_PENDING_MESSAGE * copy_pending_message(POOL_PENDING_MESSAGE * message) { POOL_PENDING_MESSAGE *msg; msg = palloc(sizeof(POOL_PENDING_MESSAGE)); memcpy(msg, message, sizeof(POOL_PENDING_MESSAGE)); msg->contents = palloc(msg->contents_len); memcpy(msg->contents, message->contents, msg->contents_len); return msg; } /* * Free POOL_PENDING_MESSAGE object in the current memory * context except the query context. */ void pool_pending_message_free_pending_message(POOL_PENDING_MESSAGE * message) { if (message == NULL) return; if (message->contents) pfree(message->contents); pfree(message); } /* * Reset previous message. */ void pool_pending_message_reset_previous_message(void) { if (!session_context) { ereport(ERROR, (errmsg("pool_pending_message_reset_previous_message: session context is not initialized"))); return; } session_context->previous_message_exists = false; } /* * Set previous message. */ void pool_pending_message_set_previous_message(POOL_PENDING_MESSAGE * message) { if (!session_context) { ereport(ERROR, (errmsg("pool_pending_message_set_previous_message: session context is not initialized"))); return; } session_context->previous_message_exists = true; memcpy(&session_context->previous_message, message, sizeof(POOL_PENDING_MESSAGE)); } /* * Get previous message. This actually returns the address of memory. Do not * try to free using pool_pending_message_free_pending_message(). */ POOL_PENDING_MESSAGE * pool_pending_message_get_previous_message(void) { if (!session_context) { ereport(ERROR, (errmsg("pool_pending_message_get_previous_message: session context is not initialized"))); return NULL; } if (session_context->previous_message_exists == false) return NULL; return &session_context->previous_message; } /* * Return true if there's any pending message. */ bool pool_pending_message_exists(void) { return list_length(session_context->pending_messages) > 0; } /* * Convert enum pending message type to string. The returned string must not * be modified or freed. */ const char * pool_pending_message_type_to_string(POOL_MESSAGE_TYPE type) { static const char *pending_msg_string[] = {"Parse", "Bind", "Execute", "Descripbe", "Close", "Sync"}; if (type < 0 || type > POOL_SYNC) return "unknown type"; return pending_msg_string[type]; } /* * Check consistency the message type and backend message kind. * This function is intended to be used for debugging. */ void pool_check_pending_message_and_reply(POOL_MESSAGE_TYPE type, char kind) { /* * Backend response message sorted by POOL_MESSAGE_TYPE */ static char backend_response_kind[] = { '1', /* POOL_PARSE, parse complete */ '2', /* POOL_BIND, bind complete */ '*', /* POOL_EXECUTE, skip checking */ '*', /* POOL_DESCRIBE, skip checking */ '3', /* POOL_CLOSE, close complete */ 'Z' /* POOL_SYNC, ready for query */ }; if (type < POOL_PARSE || type > POOL_SYNC) { ereport(DEBUG5, (errmsg("pool_check_pending_message_and_reply: type out of range: %d", type))); return; } if (backend_response_kind[type] == '*') { return; } if (backend_response_kind[type] != kind) { ereport(DEBUG5, (errmsg("pool_check_pending_message_and_reply: type: %s but is kind: %c", pool_pending_message_type_to_string(type), kind))); } return; } /* * Find the latest pending message having specified query context. The * returned message is a pointer to the message list. So do not free it using * pool_pending_message_free_pending_message. */ POOL_PENDING_MESSAGE * pool_pending_message_find_lastest_by_query_context(POOL_QUERY_CONTEXT * qc) { List *msgs; POOL_PENDING_MESSAGE *msg; int len; ListCell *cell; if (!session_context) { ereport(ERROR, (errmsg("pool_pending_message_find_lastest_by_query_context: session context is not initialized"))); } if (!session_context->pending_messages) return NULL; msgs = session_context->pending_messages; len = list_length(msgs); if (len <= 0) return NULL; ereport(DEBUG5, (errmsg("pool_pending_message_find_lastest_by_query_context: num messages: %d", len))); while (len--) { cell = list_nth_cell(msgs, len); if (cell) { msg = (POOL_PENDING_MESSAGE *) lfirst(cell); if (msg->query_context == qc) { ereport(DEBUG5, (errmsg("pool_pending_message_find_lastest_by_query_context: msg found. type: %s", pool_pending_message_type_to_string(msg->type)))); return msg; } ereport(DEBUG5, (errmsg("pool_pending_message_find_lastest_by_query_context: type: %s", pool_pending_message_type_to_string(msg->type)))); } } return NULL; } /* * Get target backend id from pending message assuming that the destination for * the pending message is one of primary or standby node. */ int pool_pending_message_get_target_backend_id(POOL_PENDING_MESSAGE * msg) { int backend_id = -1; int i; for (i = 0; i < MAX_NUM_BACKENDS; i++) { if (msg->node_ids[i]) { backend_id = i; break; } } if (backend_id == -1) ereport(ERROR, (errmsg("pool_pending_message_get_target_backend_id: no target backend id found"))); return backend_id; } /* * Get number of pending message list entries of which target backend is same as specified one. */ int pool_pending_message_get_message_num_by_backend_id(int backend_id) { ListCell *cell; ListCell *next; int cnt = 0; int i; if (!session_context) { ereport(ERROR, (errmsg("pool_pending_message_get_message_num_by_backend_id: session context is not initialized"))); return 0; } for (cell = list_head(session_context->pending_messages); cell; cell = next) { POOL_PENDING_MESSAGE *msg = (POOL_PENDING_MESSAGE *) lfirst(cell); for (i = 0; i < MAX_NUM_BACKENDS; i++) { if (msg->node_ids[i] && i == backend_id) { cnt++; break; } } next = lnext(cell); } return cnt; } /* * Dump whole pending message list */ void dump_pending_message(void) { ListCell *cell; ListCell *next; if (!session_context) { ereport(ERROR, (errmsg("dump_pending_message: session context is not initialized"))); return; } ereport(DEBUG5, (errmsg("start dumping pending message list"))); for (cell = list_head(session_context->pending_messages); cell; cell = next) { POOL_PENDING_MESSAGE *message = (POOL_PENDING_MESSAGE *) lfirst(cell); ereport(DEBUG5, (errmsg("pool_pending_message_dump: message type:%d message len:%d query:%s statement:%s portal:%s node_ids[0]:%d node_ids[1]:%d", message->type, message->contents_len, message->query, message->statement, message->portal, message->node_ids[0], message->node_ids[1]))); next = lnext(cell); } ereport(DEBUG5, (errmsg("end dumping pending message list"))); } /* * Set protocol major version number */ void pool_set_major_version(int major) { if (session_context) { session_context->major = major; } } /* * Get protocol major version number */ int pool_get_major_version(void) { if (session_context) { return session_context->major; } return PROTO_MAJOR_V3; } /* * Set protocol minor version number */ void pool_set_minor_version(int minor) { if (session_context) { session_context->minor = minor; } } /* * Get protocol minor version number */ int pool_get_minor_version(void) { if (session_context) { return session_context->minor; } return 0; } /* * Is suspend_reading_from_frontend flag set? */ bool pool_is_suspend_reading_from_frontend(void) { return session_context->suspend_reading_from_frontend; } /* * Set suspend_reading_from_frontend flag. */ void pool_set_suspend_reading_from_frontend(void) { session_context->suspend_reading_from_frontend = true; } /* * Unset suspend_reading_from_frontend flag. */ void pool_unset_suspend_reading_from_frontend(void) { session_context->suspend_reading_from_frontend = false; } #ifdef NOT_USED /* * Set preferred "master" node id. * Only used for SimpleForwardToFrontend. */ void pool_set_preferred_master_node_id(int node_id) { session_context->preferred_master_node_id = node_id; } /* * Return preferred "master" node id. * Only used for SimpleForwardToFrontend. */ int pool_get_preferred_master_node_id(void) { return session_context->preferred_master_node_id; } /* * Reset preferred "master" node id. * Only used for SimpleForwardToFrontend. */ void pool_reset_preferred_master_node_id(void) { session_context->preferred_master_node_id = -1; } #endif /*----------------------------------------------------------------------- * Temporary table list management modules. *----------------------------------------------------------------------- */ /* * Initialize temp table list */ void pool_temp_tables_init(void) { if (!session_context) ereport(ERROR, (errmsg("pool_temp_tables_init: session context is not initialized"))); session_context->temp_tables = NIL; } /* * Destroy temp table list */ void pool_temp_tables_destroy(void) { if (!session_context) ereport(ERROR, (errmsg("pool_temp_tables_destory: session context is not initialized"))); list_free(session_context->temp_tables); } /* * Add a temp table to the tail of the list. * If the table already exists, just replace state. */ void pool_temp_tables_add(char * tablename, POOL_TEMP_TABLE_STATE state) { MemoryContext old_context; POOL_TEMP_TABLE * table; if (!session_context) ereport(ERROR, (errmsg("pool_temp_tables_add: session context is not initialized"))); old_context = MemoryContextSwitchTo(session_context->memory_context); table = pool_temp_tables_find(tablename); if (table) { /* Table already exists. Just replace state. */ table->state = state; } else { table = palloc(sizeof(POOL_TEMP_TABLE)); StrNCpy(table->tablename, tablename, sizeof(table->tablename)); table->state = state; session_context->temp_tables = lappend(session_context->temp_tables, table); } MemoryContextSwitchTo(old_context); } /* * Returns pointer to the table cell if specified tablename is in the temp table list. */ POOL_TEMP_TABLE * pool_temp_tables_find(char * tablename) { ListCell *cell; if (!session_context) ereport(ERROR, (errmsg("pool_temp_tables_find: session context is not initialized"))); foreach(cell, session_context->temp_tables) { POOL_TEMP_TABLE * table = (POOL_TEMP_TABLE *)lfirst(cell); if (strcmp(tablename, table->tablename) == 0) return table; } return NULL; } /* * If requested state or table state is TEMP_TABLE_DROP_COMMITTED, removes the * temp table entry from the list. Otherwise just set the requested state to * the table state. */ void pool_temp_tables_delete(char * tablename, POOL_TEMP_TABLE_STATE state) { POOL_TEMP_TABLE * table; MemoryContext old_context; if (!session_context) ereport(ERROR, (errmsg("pool_temp_tables_delete: session context is not initialized"))); ereport(LOG, (errmsg("pool_temp_tables_delete: table: %s state: %d", tablename, state))); old_context = MemoryContextSwitchTo(session_context->memory_context); table = pool_temp_tables_find(tablename); if (table) { if (table->state == TEMP_TABLE_DROP_COMMITTED) { ereport(DEBUG1, (errmsg("pool_temp_tables_delete: remove %s. previous state: %d requested state: %d", table->tablename, table->state, state))); session_context->temp_tables = list_delete_ptr(session_context->temp_tables, table); } else { ereport(DEBUG1, (errmsg("pool_temp_tables_delete: set state %s. previous state: %d requested state: %d", table->tablename, table->state, state))); table->state = state; } } MemoryContextSwitchTo(old_context); } /* * Commits creating entries. Also remove dropping entries. This is supposed to * be called when an explicit transaction commits. */ void pool_temp_tables_commit_pending(void) { ListCell *cell; MemoryContext old_context; if (!session_context) ereport(ERROR, (errmsg("pool_temp_tables_commit_pending: session context is not initialized"))); old_context = MemoryContextSwitchTo(session_context->memory_context); pool_temp_tables_dump(); Retry: foreach(cell, session_context->temp_tables) { POOL_TEMP_TABLE * table = (POOL_TEMP_TABLE *)lfirst(cell); if (table->state == TEMP_TABLE_CREATING) { ereport(DEBUG1, (errmsg("pool_temp_tables_commit_pending: commit: %s", table->tablename))); table->state = TEMP_TABLE_CREATE_COMMITTED; } else if (table->state == TEMP_TABLE_DROPPING) { ereport(DEBUG1, (errmsg("pool_temp_tables_commit_pending: remove: %s", table->tablename))); session_context->temp_tables = list_delete_ptr(session_context->temp_tables, table); pool_temp_tables_dump(); goto Retry; } } MemoryContextSwitchTo(old_context); } /* * Removes all ongoing creating or dropping entries. This is supposed to be * called when an explicit transaction aborts. */ void pool_temp_tables_remove_pending(void) { ListCell *cell; MemoryContext old_context; if (!session_context) ereport(ERROR, (errmsg("pool_temp_tables_remove_pending: session context is not initialized"))); old_context = MemoryContextSwitchTo(session_context->memory_context); pool_temp_tables_dump(); Retry: foreach(cell, session_context->temp_tables) { POOL_TEMP_TABLE * table = (POOL_TEMP_TABLE *)lfirst(cell); if (table->state == TEMP_TABLE_CREATING || table->state == TEMP_TABLE_DROPPING) { ereport(DEBUG1, (errmsg("pool_temp_tables_remove_pending: remove: %s", table->tablename))); session_context->temp_tables = list_delete_ptr(session_context->temp_tables, table); pool_temp_tables_dump(); goto Retry; } } MemoryContextSwitchTo(old_context); } void pool_temp_tables_dump(void) { #ifdef TEMP_TABLES_DEBUG ListCell *cell; if (!session_context) ereport(ERROR, (errmsg("pool_temp_tables_dump: session context is not initialized"))); foreach(cell, session_context->temp_tables) { POOL_TEMP_TABLE * table = (POOL_TEMP_TABLE *)lfirst(cell); ereport(DEBUG1, (errmsg("pool_temp_tables_dump: table %s state: %d", table->tablename, table->state))); } #endif } pgpool-II-4.1.4/src/context/pool_process_context.c0000664000175000017500000002067413730350127017146 00000000000000/* -*-pgsql-c-*- */ /* * * $Header$ * * pgpool: a language independent connection pool server for PostgreSQL * written by Tatsuo Ishii * * Copyright (c) 2003-2017 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 "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 */ process_context->last_alarm_handler = SIG_IGN; process_context->last_alarm_time = 0; process_context->last_alarm_second = 0; process_context->undo_alarm_second = 0; } /* * 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]; } /* * locate and return the shared memory ConnectionInfo having the * backend connection with the pid * if the connection is found the *backend_node_id contains the backend node id * of the backend node that has the connection */ ConnectionInfo * pool_coninfo_backend_pid(int backend_pid, int *backend_node_id) { int child; /* * look for the child process that has the backend with the pid */ ereport(DEBUG1, (errmsg("searching for the connection with backend pid:%d", backend_pid))); for (child = 0; child < pool_config->num_init_children; child++) { int pool; ProcessInfo *pi = pool_get_process_info(process_info[child].pid); for (pool = 0; pool < pool_config->max_pool; pool++) { int backend_id; for (backend_id = 0; backend_id < NUM_BACKENDS; backend_id++) { int poolBE = pool * MAX_NUM_BACKENDS + backend_id; if (ntohl(pi->connection_info[poolBE].pid) == backend_pid) { ereport(DEBUG1, (errmsg("found for the connection with backend pid:%d on backend node %d", backend_pid, backend_id))); *backend_node_id = backend_id; return &pi->connection_info[poolBE]; } } } } return NULL; } /* * sets the flag to mark that the connection will be terminated by the * backend and it should not be considered as a backend node failure. * This flag is used to handle pg_terminate_backend() */ void pool_set_connection_will_be_terminated(ConnectionInfo * connInfo) { connInfo->swallow_termination = 1; } void pool_unset_connection_will_be_terminated(ConnectionInfo * connInfo) { connInfo->swallow_termination = 0; } /* * Set frontend connected flag */ void pool_coninfo_set_frontend_connected(int proc_id, int pool_index) { ConnectionInfo *con; int i; for (i = 0; i < NUM_BACKENDS; i++) { if (!VALID_BACKEND(i)) continue; con = pool_coninfo(proc_id, pool_index, i); if (con == NULL) { elog(WARNING, "failed to get connection info while marking the frontend is connected for pool"); return; } con->connected = true; } } /* * Unset frontend connected flag */ void pool_coninfo_unset_frontend_connected(int proc_id, int pool_index) { ConnectionInfo *con; int i; for (i = 0; i < NUM_BACKENDS; i++) { if (!VALID_BACKEND(i)) continue; con = pool_coninfo(proc_id, pool_index, i); if (con == NULL) { elog(WARNING, "failed to get connection info while marking the frontend is not connected for pool"); return; } con->connected = false; } } /* * Set an alarm clock and a signal handler. * For pool_alarm_undo(), the alarm second and the old handler * are saved, and the remaining time is calculated. */ void pool_alarm(pool_sighandler_t handler, unsigned int second) { POOL_PROCESS_CONTEXT *p = pool_get_process_context(); time_t now = time(NULL); alarm(second); p->last_alarm_handler = pool_signal(SIGALRM, handler); if (p->last_alarm_second) { p->undo_alarm_second = p->last_alarm_second - (now - p->last_alarm_time); if (p->undo_alarm_second <= 0) p->undo_alarm_second = 1; } p->last_alarm_time = now; p->last_alarm_second = second; } /* * Undo the alarm signal handler using the remaining time. */ void pool_undo_alarm(void) { POOL_PROCESS_CONTEXT *p = pool_get_process_context(); if (p->undo_alarm_second) { alarm(p->undo_alarm_second); pool_signal(SIGALRM, p->last_alarm_handler); p->undo_alarm_second = 0; } else { alarm(0); pool_signal(SIGALRM, SIG_IGN); } } pgpool-II-4.1.4/src/context/pool_query_context.c0000664000175000017500000013765113730350127016641 00000000000000/* -*-pgsql-c-*- */ /* * * pgpool: a language independent connection pool server for PostgreSQL * written by Tatsuo Ishii * * Copyright (c) 2003-2018 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 "utils/pool_stream.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; ereport(DEBUG5, (errmsg("pool_query_context_destroy: query context:%p query: \"%s\"", query_context, query_context->original_query))); session_context = pool_get_session_context(false); pool_unset_query_in_progress(); if (!pool_is_command_success() && query_context->pg_terminate_backend_conn) { ereport(DEBUG1, (errmsg("clearing the connection flag for pg_terminate_backend"))); pool_unset_connection_will_be_terminated(query_context->pg_terminate_backend_conn); } query_context->pg_terminate_backend_conn = NULL; query_context->original_query = NULL; session_context->query_context = NULL; pfree(query_context); MemoryContextDelete(memory_context); } } /* * Perform shallow copy of given query context. Used in parse_before_bind. */ POOL_QUERY_CONTEXT * pool_query_context_shallow_copy(POOL_QUERY_CONTEXT * query_context) { POOL_QUERY_CONTEXT *qc; MemoryContext memory_context; qc = pool_init_query_context(); memory_context = qc->memory_context; memcpy(qc, query_context, sizeof(POOL_QUERY_CONTEXT)); qc->memory_context = memory_context; return qc; } /* * 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->load_balance_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(); query_context->skip_cache_commit = false; 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; i < NUM_BACKENDS; i++) { if (private_backend_status[i] == CON_UP || (private_backend_status[i] == CON_CONNECT_WAIT)) { /* * In streaming replication mode, if the node is not primary node * nor load balance node, there's no point to send query. */ if (SL_MODE && !pool_config->statement_level_load_balance && 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; i < NUM_BACKENDS; i++) { if (((BACKEND_INFO(i)).backend_status == CON_UP || BACKEND_INFO((i)).backend_status == CON_CONNECT_WAIT) && query_context->where_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; /* * Check whether failover is in progress. If so, just abort this session. */ if (Req_info->switching) { #ifdef NOT_USED POOL_SETMASK(&BlockSig); ereport(WARNING, (errmsg("failover/failback is in progress"), errdetail("executing failover or failback on backend"), errhint("In a moment you should be able to reconnect to the database"))); POOL_SETMASK(&UnBlockSig); #endif child_exit(POOL_EXIT_AND_RESTART); } sc = pool_get_session_context(true); if (!sc) { return REAL_MASTER_NODE_ID; } if (sc->in_progress && sc->query_context) { int node_id = sc->query_context->virtual_master_node_id; if (SL_MODE) { /* * Make sure that virtual_master_node_id is either primary node id * or load balance node id. If not, it is likely that * virtual_master_node_id is not set up yet. Let's use the primary * node id. except for the special case where we need to send the * query to the node which is not primary nor the load balance * node. Currently there is only one special such case that is * handling of pg_terminate_backend() function, which may refer to * the backend connection that is neither hosted by the primary or * load balance node for current child process, but the query must * be forwarded to that node. Since only that backend node can * handle that pg_terminate_backend query * */ ereport(DEBUG5, (errmsg("pool_virtual_master_db_node_id: virtual_master_node_id:%d load_balance_node_id:%d PRIMARY_NODE_ID:%d", node_id, sc->load_balance_node_id, PRIMARY_NODE_ID))); if (node_id != sc->query_context->load_balance_node_id && node_id != PRIMARY_NODE_ID) { /* * Only return the primary node id if we are not processing * the pg_terminate_backend query */ if (sc->query_context->pg_terminate_backend_conn == NULL) node_id = PRIMARY_NODE_ID; } } return 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; } /* * The function sets the destination for the current query to the specific backend node */ void pool_force_query_node_to_backend(POOL_QUERY_CONTEXT * query_context, int backend_id) { int i; CHECK_QUERY_CONTEXT_IS_VALID; ereport(DEBUG1, (errmsg("forcing query destination node to backend node:%d", backend_id))); pool_set_node_to_be_sent(query_context, backend_id); for (i = 0; i < NUM_BACKENDS; i++) { if (query_context->where_to_send[i]) { query_context->virtual_master_node_id = i; break; } } } /* * 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; i < NUM_BACKENDS; i++) { if (query_context->where_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. */ 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 query"), 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); } else if (pool_is_writing_transaction() && pool_config->disable_load_balance_on_write == DLBOW_ALWAYS) { pool_set_node_to_be_sent(query_context, PRIMARY_NODE_ID); } /* * 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. */ ereport(DEBUG1, (errmsg("checking load balance precondtions. TSTATE:%c wrting_trancation:%d failed_transaction:%d isolation:%d", TSTATE(backend, PRIMARY_NODE_ID), pool_is_writing_transaction(), pool_is_failed_transaction(), pool_get_transaction_isolation()), errdetail("destination = %d for query= \"%s\"", dest, query))); 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 (STREAM && pool_config->delay_threshold && bkinfo->standby_delay > pool_config->delay_threshold) { ereport(DEBUG1, (errmsg("could not load balance because of too much replication delay"), errdetail("destination = %d for query= \"%s\"", dest, query))); 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)) { ereport(DEBUG1, (errmsg("could not load balance because systems catalogs are used"), errdetail("destination = %d for query= \"%s\"", dest, query))); 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)) { ereport(DEBUG1, (errmsg("could not load balance because temporary tables are used"), errdetail("destination = %d for query= \"%s\"", dest, query))); 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)) { ereport(DEBUG1, (errmsg("could not load balance because unlogged tables are used"), errdetail("destination = %d for query= \"%s\"", dest, query))); pool_set_node_to_be_sent(query_context, PRIMARY_NODE_ID); } /* * When query match the query patterns in black_query_pattern_list, we * send only to master node. */ else if (pattern_compare(query, BLACKLIST, "black_query_pattern_list") == 1) { 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)) { ereport(DEBUG1, (errmsg("could not load balance because writing functions are used"), errdetail("destination = %d for query= \"%s\"", dest, query))); pool_set_node_to_be_sent(query_context, PRIMARY_NODE_ID); } else { if (pool_config->statement_level_load_balance) session_context->load_balance_node_id = select_load_balancing_node(); session_context->query_context->load_balance_node_id = session_context->load_balance_node_id; pool_set_node_to_be_sent(query_context, session_context->query_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) { 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 */ if (pool_config->statement_level_load_balance) session_context->load_balance_node_id = select_load_balancing_node(); session_context->query_context->load_balance_node_id = session_context->load_balance_node_id; pool_set_node_to_be_sent(query_context, session_context->query_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, POOL_SENT_MESSAGE_CREATED); if (!msg) msg = pool_get_sent_message('P', ((ExecuteStmt *) node)->name, POOL_SENT_MESSAGE_CREATED); 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; i < NUM_BACKENDS; i++) { if (query_context->where_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 < NUM_BACKENDS; i++) { if (!VALID_BACKEND(i)) continue; else if (send_type < 0 && i == node_id) continue; else if (send_type > 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); stat_count_up(i, query_context->parse_tree); send_simplequery_message(CONNECTION(backend, i), len, string, MAJOR(backend)); } /* Wait for response */ for (i = 0; i < NUM_BACKENDS; i++) { if (!VALID_BACKEND(i)) continue; else if (send_type < 0 && i == node_id) continue; else if (send_type > 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, bool nowait) { 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 < NUM_BACKENDS; i++) { if (!VALID_BACKEND(i)) continue; else if (send_type < 0 && i == node_id) continue; else if (send_type > 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); } /* if Execute message, count up stats count */ if (*kind == 'E') { stat_count_up(i, query_context->parse_tree); } send_extended_protocol_message(backend, i, kind, str_len, str); if ((*kind == 'P' || *kind == 'E' || *kind == 'C') && STREAM) { /* * Send flush message to backend to make sure that we get any * response from backend in Streaming replication mode. */ POOL_CONNECTION *cp = CONNECTION(backend, i); int len; pool_write(cp, "H", 1); len = htonl(sizeof(len)); pool_write_and_flush(cp, &len, sizeof(len)); ereport(DEBUG5, (errmsg("pool_send_and_wait: send flush message to %d", i))); } } if (!is_begin_read_write) { if (query_context->rewritten_query) str = query_context->rewritten_query; else str = query_context->original_query; } if (!nowait) { /* Wait for response */ for (i = 0; i < NUM_BACKENDS; i++) { if (!VALID_BACKEND(i)) continue; else if (send_type < 0 && i == node_id) continue; else if (send_type > 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.5 include/nodes/node.h ("TAGS FOR STATEMENT NODES" part) */ static NodeTag nodemap[] = { T_RawStmt, T_Query, T_PlannedStmt, T_InsertStmt, T_DeleteStmt, T_UpdateStmt, T_SelectStmt, T_AlterTableStmt, T_AlterTableCmd, T_AlterDomainStmt, T_SetOperationStmt, T_GrantStmt, T_GrantRoleStmt, T_AlterDefaultPrivilegesStmt, 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, 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_CreateTableAsStmt, 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_CreateRangeStmt, T_AlterEnumStmt, T_AlterTSDictionaryStmt, T_AlterTSConfigurationStmt, T_CreateFdwStmt, T_AlterFdwStmt, T_CreateForeignServerStmt, T_AlterForeignServerStmt, T_CreateUserMappingStmt, T_AlterUserMappingStmt, T_DropUserMappingStmt, T_AlterTableSpaceOptionsStmt, T_AlterTableMoveAllStmt, T_SecLabelStmt, T_CreateForeignTableStmt, T_ImportForeignSchemaStmt, T_CreateExtensionStmt, T_AlterExtensionStmt, T_AlterExtensionContentsStmt, T_CreateEventTrigStmt, T_AlterEventTrigStmt, T_RefreshMatViewStmt, T_ReplicaIdentityStmt, T_AlterSystemStmt, T_CreatePolicyStmt, T_AlterPolicyStmt, T_CreateTransformStmt, T_CreateAmStmt, T_CreatePublicationStmt, T_AlterPublicationStmt, T_CreateSubscriptionStmt, T_DropSubscriptionStmt, T_CreateStatsStmt, T_AlterCollationStmt, }; 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; /* non-SELECT query in WITH clause ? */ if (((SelectStmt *) node)->withClause) { List *ctes = ((SelectStmt *) node)->withClause->ctes; ListCell *cte_item; foreach(cte_item, ctes) { CommonTableExpr *cte = (CommonTableExpr *) lfirst(cte_item); if (!IsA(cte->ctequery, SelectStmt)) return POOL_PRIMARY; } } return POOL_EITHER; } /* * COPY */ else if (IsA(node, CopyStmt)) { if (((CopyStmt *) node)->is_from) return POOL_PRIMARY; else { if (((CopyStmt *) node)->query == NULL) return POOL_EITHER; else return (IsA(((CopyStmt *) node)->query, SelectStmt)) ? POOL_EITHER : POOL_PRIMARY; } } /* * 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; } /* * SHOW */ else if (IsA(node, VariableShowStmt)) { return POOL_EITHER; } /* * 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, POOL_SENT_MESSAGE_CREATED); if (!msg) msg = pool_get_sent_message('P', d->name, POOL_SENT_MESSAGE_CREATED); if (msg) { /* Inherit same map from PREPARE or PARSE */ pool_copy_prep_where(msg->query_context->where_to_send, query_context->where_to_send); /* copy load balance node id as well */ query_context->load_balance_node_id = msg->query_context->load_balance_node_id; } else /* 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; } /* * Returns true if the query is one of: * * 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") || !strcmp(((VariableSetStmt *) node)->name, "default_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; } } /* * Return true if one of followings is true * * SET transaction_read_only TO on * SET TRANSACTION READ ONLY * SET TRANSACTION CHARACTERISTICS AS TRANSACTION READ ONLY * * Note that if the node is not a variable statement, returns false. */ bool pool_is_transaction_read_only(Node *node) { ListCell *list_item; bool ret = false; if (!IsA(node, VariableSetStmt)) return ret; /* * SET transaction_read_only TO on */ 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, "on") || !strcasecmp(v->val.val.str, "t") || !strcasecmp(v->val.val.str, "true")) ret = true; break; case T_Integer: if (v->val.val.ival) ret = true; default: break; } } } /* * SET SESSION CHARACTERISTICS AS TRANSACTION READ ONLY SET TRANSACTION * READ ONLY */ 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) { ret = true; break; } } } } return ret; } pgpool-II-4.1.4/src/main/0000775000175000017500000000000013730350746012045 500000000000000pgpool-II-4.1.4/src/main/main.c0000664000175000017500000004351113730350127013052 00000000000000/* -*-pgsql-c-*- */ /* * $Header$ * * pgpool: a language independent connection pool server for PostgreSQL * written by Tatsuo Ishii * * Copyright (c) 2003-2018 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 #include #include #include #ifdef HAVE_GETOPT_H #include #else #include "utils/getopt_long.h" #endif #include #include #include #include "utils/elog.h" #include "utils/palloc.h" #include "utils/memutils.h" #include "utils/pool_path.h" #include "version.h" #include "auth/pool_passwd.h" #include "auth/pool_hba.h" #include "query_cache/pool_memqcache.h" #include "watchdog/wd_utils.h" #include "pool_config_variables.h" static bool get_pool_key_filename(char *poolKeyFile); static void daemonize(void); static char *get_pid_file_path(void); static int read_pid_file(void); static void write_pid_file(void); static void usage(void); static void show_version(void); static void stop_me(void); static void FileUnlink(int code, Datum path); char *pcp_conf_file = NULL; /* absolute path of the pcp.conf */ char *conf_file = NULL; /* absolute path of the pgpool.conf */ char *hba_file = NULL; /* absolute path of the hba.conf */ char *base_dir = NULL; /* The working dir from where pgpool was * invoked from */ static int not_detach = 0; /* non 0 if non detach option (-n) is given */ int stop_sig = SIGTERM; /* stopping signal default value */ int myargc; char **myargv; int assert_enabled = 0; char *pool_key = NULL; int main(int argc, char **argv) { int opt; int debug_level = 0; int optindex; bool discard_status = false; bool clear_memcache_oidmaps = false; char pcp_conf_file_path[POOLMAXPATHLEN + 1]; char conf_file_path[POOLMAXPATHLEN + 1]; char hba_file_path[POOLMAXPATHLEN + 1]; char pool_passwd_key_file_path[POOLMAXPATHLEN + 1 + sizeof(POOLKEYFILE) + 1]; static struct option long_options[] = { {"hba-file", required_argument, NULL, 'a'}, {"debug", no_argument, NULL, 'd'}, {"config-file", required_argument, NULL, 'f'}, {"key-file", required_argument, NULL, 'k'}, {"pcp-file", required_argument, NULL, 'F'}, {"help", no_argument, NULL, 'h'}, {"mode", required_argument, NULL, 'm'}, {"dont-detach", no_argument, NULL, 'n'}, {"discard-status", no_argument, NULL, 'D'}, {"clear-oidmaps", no_argument, NULL, 'C'}, {"debug-assertions", no_argument, NULL, 'x'}, {"version", no_argument, NULL, 'v'}, {NULL, 0, NULL, 0} }; myargc = argc; myargv = argv; snprintf(conf_file_path, sizeof(conf_file_path), "%s/%s", DEFAULT_CONFIGDIR, POOL_CONF_FILE_NAME); snprintf(pcp_conf_file_path, sizeof(pcp_conf_file_path), "%s/%s", DEFAULT_CONFIGDIR, PCP_PASSWD_FILE_NAME); snprintf(hba_file_path, sizeof(hba_file_path), "%s/%s", DEFAULT_CONFIGDIR, HBA_CONF_FILE_NAME); pool_passwd_key_file_path[0] = 0; while ((opt = getopt_long(argc, argv, "a:df:k:F:hm:nDCxv", long_options, &optindex)) != -1) { switch (opt) { case 'a': /* specify hba configuration file */ if (!optarg) { usage(); exit(1); } strlcpy(hba_file_path, optarg, sizeof(hba_file_path)); break; case 'x': /* enable cassert */ assert_enabled = 1; break; case 'd': /* debug option */ debug_level = 1; break; case 'f': /* specify configuration file */ if (!optarg) { usage(); exit(1); } strlcpy(conf_file_path, optarg, sizeof(conf_file_path)); break; case 'F': /* specify PCP password file */ if (!optarg) { usage(); exit(1); } strlcpy(pcp_conf_file_path, optarg, sizeof(pcp_conf_file_path)); break; case 'k': /* specify key file for decrypt pool_password * entries */ if (!optarg) { usage(); exit(1); } strlcpy(pool_passwd_key_file_path, optarg, sizeof(pool_passwd_key_file_path)); break; case 'h': usage(); exit(0); break; case 'm': /* stop mode */ if (!optarg) { usage(); exit(1); } if (*optarg == 's' || !strcmp("smart", optarg)) stop_sig = SIGTERM; /* smart shutdown */ else if (*optarg == 'f' || !strcmp("fast", optarg)) stop_sig = SIGINT; /* fast shutdown */ else if (*optarg == 'i' || !strcmp("immediate", optarg)) stop_sig = SIGQUIT; /* immediate shutdown */ else { usage(); exit(1); } break; case 'n': /* no detaching control ttys */ not_detach = 1; break; case 'D': /* discard pgpool_status */ discard_status = true; break; case 'C': /* discard caches in memcached */ clear_memcache_oidmaps = true; break; case 'v': show_version(); exit(0); default: usage(); exit(1); } } myargv = save_ps_display_args(myargc, myargv); /* create MemoryContexts */ MemoryContextInit(); /* load the CWD before it is changed */ base_dir = get_current_working_dir(); /* convert all the paths to absolute paths */ conf_file = make_absolute_path(conf_file_path, base_dir); pcp_conf_file = make_absolute_path(pcp_conf_file_path, base_dir); hba_file = make_absolute_path(hba_file_path, base_dir); mypid = getpid(); pool_init_config(); pool_get_config(conf_file, CFGCXT_INIT); /* * Override debug level if command line -d arg is given adjust the * log_min_message config variable */ if (debug_level > 0 && pool_config->log_min_messages > DEBUG1) set_one_config_option("log_min_messages", "DEBUG1", CFGCXT_INIT, PGC_S_ARGV, INFO); /* * If a non-switch argument remains, then it should be either "reload" or * "stop". */ if (optind == (argc - 1)) { if (!strcmp(argv[optind], "reload")) { pid_t pid; pid = read_pid_file(); if (pid < 0) { ereport(FATAL, (return_code(1), errmsg("could not read pid file"))); } if (kill(pid, SIGHUP) == -1) { ereport(FATAL, (return_code(1), errmsg("could not reload configuration file pid: %d. reason: %s", pid, strerror(errno)))); } exit(0); } if (!strcmp(argv[optind], "stop")) { stop_me(); exit(0); } else { usage(); exit(1); } } /* * else if no non-switch argument remains, then it should be a start * request */ else if (optind == argc) { int pid = read_pid_file(); if (pid > 0) { if (kill(pid, 0) == 0) { fprintf(stderr, "ERROR: pid file found. is another pgpool(%d) is running?\n", pid); exit(EXIT_FAILURE); } else fprintf(stderr, "NOTICE: pid file found but it seems bogus. Trying to start pgpool anyway...\n"); } } /* * otherwise an error... */ else { usage(); exit(1); } if (pool_config->enable_pool_hba) load_hba(hba_file); #ifdef USE_SSL /* * If ssl is enabled, initialize the SSL context */ if (pool_config->ssl) SSL_ServerSide_init(); #endif /* USE_SSL */ /* check effective user id for watchdog */ /* watchdog must be started under the privileged user */ wd_check_network_command_configurations(); /* set signal masks */ poolinitmask(); /* read the pool password key */ if (strlen(pool_passwd_key_file_path) == 0) { get_pool_key_filename(pool_passwd_key_file_path); } pool_key = read_pool_key(pool_passwd_key_file_path); if (not_detach) write_pid_file(); else daemonize(); /* * Locate pool_passwd The default file name "pool_passwd" can be changed * by setting pgpool.conf's "pool_passwd" directive. */ if (strcmp("", pool_config->pool_passwd)) { char pool_passwd[POOLMAXPATHLEN + 1]; char dirnamebuf[POOLMAXPATHLEN + 1]; char *dirp; if (pool_config->pool_passwd[0] != '/') { strlcpy(dirnamebuf, conf_file, sizeof(dirnamebuf)); dirp = dirname(dirnamebuf); snprintf(pool_passwd, sizeof(pool_passwd), "%s/%s", dirp, pool_config->pool_passwd); } else strlcpy(pool_passwd, pool_config->pool_passwd, sizeof(pool_passwd)); pool_init_pool_passwd(pool_passwd, POOL_PASSWD_R); } pool_semaphore_create(MAX_NUM_SEMAPHORES); PgpoolMain(discard_status, clear_memcache_oidmaps); /* this is an infinate * loop */ exit(0); } static void show_version(void) { fprintf(stderr, "%s version %s (%s)\n", PACKAGE, VERSION, PGPOOLVERSION); } static void usage(void) { char homedir[POOLMAXPATHLEN]; if (!get_home_directory(homedir, sizeof(homedir))) strncpy(homedir, "USER-HOME-DIR", POOLMAXPATHLEN); fprintf(stderr, "%s version %s (%s),\n", PACKAGE, VERSION, PGPOOLVERSION); fprintf(stderr, " A generic connection pool/replication/load balance server for PostgreSQL\n\n"); fprintf(stderr, "Usage:\n"); fprintf(stderr, " pgpool [ -c] [ -f CONFIG_FILE ] [ -F PCP_CONFIG_FILE ] [ -a HBA_CONFIG_FILE ]\n"); fprintf(stderr, " [ -n ] [ -D ] [ -d ]\n"); fprintf(stderr, " pgpool [ -f CONFIG_FILE ] [ -F PCP_CONFIG_FILE ] [ -a HBA_CONFIG_FILE ]\n"); fprintf(stderr, " [ -m SHUTDOWN-MODE ] stop\n"); fprintf(stderr, " pgpool [ -f CONFIG_FILE ] [ -F PCP_CONFIG_FILE ] [ -a HBA_CONFIG_FILE ] reload\n\n"); fprintf(stderr, "Common options:\n"); fprintf(stderr, " -a, --hba-file=HBA_CONFIG_FILE\n"); fprintf(stderr, " Set the path to the pool_hba.conf configuration file\n"); fprintf(stderr, " (default: %s/%s)\n", DEFAULT_CONFIGDIR, HBA_CONF_FILE_NAME); fprintf(stderr, " -f, --config-file=CONFIG_FILE\n"); fprintf(stderr, " Set the path to the pgpool.conf configuration file\n"); fprintf(stderr, " (default: %s/%s)\n", DEFAULT_CONFIGDIR, POOL_CONF_FILE_NAME); fprintf(stderr, " -k, --key-file=KEY_FILE\n"); fprintf(stderr, " Set the path to the pgpool key file\n"); fprintf(stderr, " (default: %s/%s)\n", homedir, POOLKEYFILE); fprintf(stderr, " can be over ridden by %s environment variable\n", POOLKEYFILEENV); fprintf(stderr, " -F, --pcp-file=PCP_CONFIG_FILE\n"); fprintf(stderr, " Set the path to the pcp.conf configuration file\n"); fprintf(stderr, " (default: %s/%s)\n", DEFAULT_CONFIGDIR, PCP_PASSWD_FILE_NAME); fprintf(stderr, " -h, --help Print this help\n\n"); fprintf(stderr, "Start options:\n"); fprintf(stderr, " -C, --clear-oidmaps Clear query cache oidmaps when memqcache_method is memcached\n"); fprintf(stderr, " (If shmem, discards whenever pgpool starts.)\n"); fprintf(stderr, " -n, --dont-detach Don't run in daemon mode, does not detach control tty\n"); fprintf(stderr, " -x, --debug-assertions Turns on various assertion checks, This is a debugging aid\n"); fprintf(stderr, " -D, --discard-status Discard pgpool_status file and do not restore previous status\n"); fprintf(stderr, " -d, --debug Debug mode\n\n"); fprintf(stderr, "Stop options:\n"); fprintf(stderr, " -m, --mode=SHUTDOWN-MODE\n"); fprintf(stderr, " Can be \"smart\", \"fast\", or \"immediate\"\n\n"); fprintf(stderr, "Shutdown modes are:\n"); fprintf(stderr, " smart quit after all clients have disconnected\n"); fprintf(stderr, " fast quit directly, with proper shutdown\n"); fprintf(stderr, " immediate the same mode as fast\n"); } static bool get_pool_key_filename(char *poolKeyFile) { char *passfile_env; if ((passfile_env = getenv(POOLKEYFILEENV)) != NULL) { /* use the literal path from the environment, if set */ strlcpy(poolKeyFile, passfile_env, POOLMAXPATHLEN); } else { char homedir[POOLMAXPATHLEN]; if (!get_home_directory(homedir, sizeof(homedir))) return false; snprintf(poolKeyFile, POOLMAXPATHLEN + sizeof(POOLKEYFILE) + 1, "%s/%s", homedir, POOLKEYFILE); } return true; } char * get_pool_key(void) { return pool_key; } /* * detach control ttys */ static void daemonize(void) { int i; pid_t pid; int fdlimit; pid = fork(); if (pid == (pid_t) -1) { ereport(FATAL, (errmsg("could not daemonize the pgpool-II"), errdetail("fork() system call failed with reason: \"%s\"", strerror(errno)))); } else if (pid > 0) { /* parent */ exit(0); } #ifdef HAVE_SETSID if (setsid() < 0) { ereport(FATAL, (errmsg("could not daemonize the pgpool-II"), errdetail("setsid() system call failed with reason: \"%s\"", strerror(errno)))); } #endif mypid = getpid(); write_pid_file(); if (chdir("/")) ereport(WARNING, (errmsg("change directory failed"), errdetail("chdir() system call failed with reason: \"%s\"", strerror(errno)))); /* redirect stdin, stdout and stderr to /dev/null */ i = open("/dev/null", O_RDWR); if (i < 0) { ereport(WARNING, (errmsg("failed to open \"/dev/null\", open() failed with error \"%s\"", strerror(errno)))); } else { dup2(i, 0); dup2(i, 1); dup2(i, 2); close(i); } /* close syslog connection for daemonizing */ if (pool_config->log_destination & LOG_DESTINATION_SYSLOG) { closelog(); } /* close other file descriptors */ fdlimit = sysconf(_SC_OPEN_MAX); for (i = 3; i < fdlimit; i++) close(i); } /* * stop myself */ static void stop_me(void) { pid_t pid; char *pid_file; pid = read_pid_file(); if (pid < 0) { ereport(FATAL, (errmsg("could not read pid file"))); } if (kill(pid, stop_sig) == -1) { ereport(FATAL, (errmsg("could not stop process with pid: %d", pid), errdetail("\"%s\"", strerror(errno)))); } ereport(LOG, (errmsg("stop request sent to pgpool. waiting for termination..."))); while (kill(pid, 0) == 0) { fprintf(stderr, "."); sleep(1); } fprintf(stderr, "done.\n"); pid_file = get_pid_file_path(); unlink(pid_file); pfree(pid_file); } /* * The function returns the palloc'd copy of pid_file_path, * caller must free it after use */ static char * get_pid_file_path(void) { char *new = NULL; if (!is_absolute_path(pool_config->pid_file_name)) { /* * some implementations of dirname() may modify the string argument * passed to it, so do not use the original conf_file as an argument */ char *conf_file_copy = pstrdup(conf_file); char *conf_dir = dirname(conf_file_copy); size_t path_size; if (conf_dir == NULL) { ereport(LOG, (errmsg("failed to get the dirname of pid file:\"%s\". reason: %s", pool_config->pid_file_name, strerror(errno)))); return NULL; } path_size = strlen(conf_dir) + strlen(pool_config->pid_file_name) + 1 + 1; new = palloc(path_size); snprintf(new, path_size, "%s/%s", conf_dir, pool_config->pid_file_name); ereport(DEBUG1, (errmsg("pid file location is \"%s\"", new))); pfree(conf_file_copy); } else { new = pstrdup(pool_config->pid_file_name); } return new; } /* * read the pid file */ static int read_pid_file(void) { int fd; int readlen; char pidbuf[128]; char *pid_file = get_pid_file_path(); if (pid_file == NULL) { ereport(FATAL, (errmsg("failed to read pid file"), errdetail("failed to get pid file path from \"%s\"", pool_config->pid_file_name))); } fd = open(pid_file, O_RDONLY); if (fd == -1) { pfree(pid_file); return -1; } if ((readlen = read(fd, pidbuf, sizeof(pidbuf))) == -1) { close(fd); pfree(pid_file); ereport(FATAL, (errmsg("could not read pid file as \"%s\". reason: %s", pool_config->pid_file_name, strerror(errno)))); } else if (readlen == 0) { close(fd); pfree(pid_file); ereport(FATAL, (errmsg("EOF detected while reading pid file \"%s\". reason: %s", pool_config->pid_file_name, strerror(errno)))); } pfree(pid_file); close(fd); return (atoi(pidbuf)); } /* * write the pid file */ static void write_pid_file(void) { int fd; char pidbuf[128]; char *pid_file = get_pid_file_path(); if (pid_file == NULL) { ereport(FATAL, (errmsg("failed to write pid file"), errdetail("failed to get pid file path from \"%s\"", pool_config->pid_file_name))); } fd = open(pid_file, O_CREAT | O_TRUNC | O_WRONLY, S_IRUSR | S_IWUSR); if (fd == -1) { ereport(FATAL, (errmsg("could not open pid file as %s. reason: %s", pool_config->pid_file_name, strerror(errno)))); } snprintf(pidbuf, sizeof(pidbuf), "%d", (int) getpid()); if (write(fd, pidbuf, strlen(pidbuf) + 1) == -1) { close(fd); pfree(pid_file); ereport(FATAL, (errmsg("could not write pid file as %s. reason: %s", pool_config->pid_file_name, strerror(errno)))); } if (fsync(fd) == -1) { close(fd); pfree(pid_file); ereport(FATAL, (errmsg("could not fsync pid file as %s. reason: %s", pool_config->pid_file_name, strerror(errno)))); } if (close(fd) == -1) { pfree(pid_file); ereport(FATAL, (errmsg("could not close pid file as %s. reason: %s", pool_config->pid_file_name, strerror(errno)))); } /* register the call back to delete the pid file at system exit */ on_proc_exit(FileUnlink, (Datum) pid_file); } /* * get_config_file_name: return full path of pgpool.conf. */ char * get_config_file_name(void) { return conf_file; } /* * get_hba_file_name: return full path of pool_hba.conf. */ char * get_hba_file_name(void) { return hba_file; } /* * Call back function to unlink the file */ static void FileUnlink(int code, Datum path) { char *filePath = (char *) path; if (unlink(filePath) == 0) return; /* * We are already exiting the system just produce a log entry to report an * error */ ereport(LOG, (errmsg("unlink failed for file at path \"%s\"", filePath), errdetail("\"%s\"", strerror(errno)))); } pgpool-II-4.1.4/src/main/pool_globals.c0000664000175000017500000000177113730350127014604 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" pid_t mypid; /* pgpool parent process id */ ProcessType processType; ProcessState processState; pgpool-II-4.1.4/src/main/pgpool_main.c0000664000175000017500000034205013730350127014432 00000000000000/* -*-pgpool_main-c-*- */ /* * $Header$ * * pgpool: a language independent connection pool server for PostgreSQL * written by Tatsuo Ishii * * Copyright (c) 2003-2020 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 #include #include #include #include #ifdef HAVE_SYS_SELECT_H #include #endif #include #include #include #include #include #include #include #include #include #include #include #include "utils/elog.h" #include "pool.h" #include "utils/palloc.h" #include "utils/memutils.h" #include "pool_config.h" #include "context/pool_process_context.h" #include "version.h" #include "parser/pool_string.h" #include "auth/pool_passwd.h" #include "auth/pool_hba.h" #include "query_cache/pool_memqcache.h" #include "watchdog/wd_ipc_commands.h" #include "watchdog/wd_lifecheck.h" #include "watchdog/watchdog.h" /* * Reasons for signalling a pgpool-II main process */ typedef enum { SIG_FAILOVER_INTERRUPT, /* signal main to start failover */ SIG_WATCHDOG_STATE_CHANGED, /* notify main about local watchdog node state * changed */ SIG_BACKEND_SYNC_REQUIRED, /* notify main about local backend state sync * required */ SIG_WATCHDOG_QUORUM_CHANGED, /* notify main about cluster quorum change * of watchdog cluster */ SIG_INFORM_QURANTINE_NODES, /* notify main about send degenerate requests * for all quarantine nodes */ MAX_INTERUPTS /* Must be last! */ } User1SignalReason; typedef struct User1SignalSlot { sig_atomic_t signalFlags[MAX_INTERUPTS]; } User1SignalSlot; /* * Process pending signal actions. */ #define CHECK_REQUEST \ do { \ if (wakeup_request) \ { \ wakeup_children(); \ wakeup_request = 0; \ } \ if (sigusr1_request) \ { \ sigusr1_interupt_processor(); \ sigusr1_request = 0; \ } \ if (sigchld_request) \ { \ reaper(); \ } \ if (reload_config_request) \ { \ reload_config(); \ reload_config_request = 0; \ } \ } while (0) #define PGPOOLMAXLITSENQUEUELENGTH 10000 static void signal_user1_to_parent_with_reason(User1SignalReason reason); static void FileUnlink(int code, Datum path); static pid_t pcp_fork_a_child(int unix_fd, int inet_fd, char *pcp_conf_file); static pid_t fork_a_child(int *fds, int id); static pid_t worker_fork_a_child(ProcessType type, void (*func) (), void *params); static int create_unix_domain_socket(struct sockaddr_un un_addr_tmp); static int create_inet_domain_socket(const char *hostname, const int port); static int *create_inet_domain_sockets(const char *hostname, const int port); static void failover(void); static bool check_all_backend_down(void); static void reaper(void); static void wakeup_children(void); static void reload_config(void); static int pool_pause(struct timeval *timeout); static void kill_all_children(int sig); static pid_t fork_follow_child(int old_master, int new_primary, int old_primary); static int read_status_file(bool discard_status); static RETSIGTYPE exit_handler(int sig); static RETSIGTYPE reap_handler(int sig); static RETSIGTYPE sigusr1_handler(int sig); static void sigusr1_interupt_processor(void); static RETSIGTYPE reload_config_handler(int sig); static RETSIGTYPE wakeup_handler(int sig); static void initialize_shared_mem_objects(bool clear_memcache_oidmaps); static int trigger_failover_command(int node, const char *command_line, int old_master, int new_master, int old_primary); static int find_primary_node(void); static int find_primary_node_repeatedly(void); static void terminate_all_childrens(); static void system_will_go_down(int code, Datum arg); static char *process_name_from_pid(pid_t pid); static void sync_backend_from_watchdog(void); static void update_backend_quarantine_status(void); static void degenerate_all_quarantine_nodes(void); static int get_server_version(POOL_CONNECTION_POOL_SLOT * *slots, int node_id); static void get_info_from_conninfo(char *conninfo, char *host, char *port); static struct sockaddr_un un_addr; /* unix domain socket path */ static struct sockaddr_un pcp_un_addr; /* unix domain socket path for PCP */ ProcessInfo *process_info = NULL; /* Per child info table on shmem */ volatile User1SignalSlot *user1SignalSlot = NULL; /* User 1 signal slot on * shmem */ struct timeval random_start_time; /* * To track health check process ids */ static pid_t health_check_pids[MAX_NUM_BACKENDS]; /* * Private copy of backend status */ BACKEND_STATUS private_backend_status[MAX_NUM_BACKENDS]; /* * shmem connection info table * this is a three dimension array. i.e.: * con_info[pool_config->num_init_children][pool_config->max_pool][MAX_NUM_BACKENDS] */ ConnectionInfo *con_info; static int *fds; /* listening file descriptors (UNIX socket, * inet domain sockets) */ static int pcp_unix_fd; /* unix domain socket fd for PCP (not used) */ static int pcp_inet_fd; /* inet domain socket fd for PCP */ extern char *pcp_conf_file; /* path for pcp.conf */ extern char *conf_file; extern char *hba_file; static int exiting = 0; /* non 0 if I'm exiting */ static int switching = 0; /* non 0 if I'm failing over or degenerating */ POOL_REQUEST_INFO *Req_info; /* request info area in shared memory */ volatile sig_atomic_t *InRecovery; /* non 0 if recovery is started */ volatile sig_atomic_t reload_config_request = 0; static volatile sig_atomic_t sigusr1_request = 0; static volatile sig_atomic_t sigchld_request = 0; static volatile sig_atomic_t wakeup_request = 0; static int pipe_fds[2]; /* for delivering signals */ int my_proc_id; static BackendStatusRecord backend_rec; /* Backend status record */ static pid_t worker_pid = 0; /* pid of worker process */ static pid_t follow_pid = 0; /* pid for child process handling follow * command */ static pid_t pcp_pid = 0; /* pid for child process handling PCP */ static pid_t watchdog_pid = 0; /* pid for watchdog child process */ static pid_t wd_lifecheck_pid = 0; /* pid for child process handling watchdog * lifecheck */ BACKEND_STATUS *my_backend_status[MAX_NUM_BACKENDS]; /* Backend status buffer */ int my_master_node_id; /* Master node id buffer */ /* * Dummy varibale to suppress compiler warnings by discarding return values * from write(2) in signal handlers */ static int dummy_status; /* * pgpool main program */ int PgpoolMain(bool discard_status, bool clear_memcache_oidmaps) { int i; sigjmp_buf local_sigjmp_buf; /* * to prevent the variable set on a register so that longjmp() does not * discard the content */ volatile bool first = true; /* For PostmasterRandom */ gettimeofday(&random_start_time, NULL); /* Set the process type variable */ processType = PT_MAIN; processState = INITIALIZING; /* * Restore previous backend status if possible */ read_status_file(discard_status); /* * install the call back for preparation of system exit */ on_system_exit(system_will_go_down, (Datum) NULL); /* set unix domain socket path for connections to pgpool */ snprintf(un_addr.sun_path, sizeof(un_addr.sun_path), "%s/.s.PGSQL.%d", pool_config->socket_dir, pool_config->port); /* set unix domain socket path for pgpool PCP communication */ snprintf(pcp_un_addr.sun_path, sizeof(pcp_un_addr.sun_path), "%s/.s.PGSQL.%d", pool_config->pcp_socket_dir, pool_config->pcp_port); /* set up signal handlers */ pool_signal(SIGPIPE, SIG_IGN); /* create unix domain socket */ fds = malloc(sizeof(int) * 2); if (fds == NULL) ereport(FATAL, (errmsg("failed to allocate memory in startup process"))); initialize_shared_mem_objects(clear_memcache_oidmaps); if (pool_config->use_watchdog) { sigset_t mask; wakeup_request = 0; /* * Watchdog process fires SIGUSR2 once in stable state, so install the * SIGUSR2 handler first up. In addition, when wathcodg fails to start * with FATAL, the process exits and SIGCHLD is fired, so SIGCHLD * handelr is also needed. Finally, we also need to set the SIGUSR1 * handler for the failover requests from other watchdog nodes. In * case a request arrives at the same time when the watchdog has just * been initialized. */ pool_signal(SIGUSR2, wakeup_handler); pool_signal(SIGCHLD, reap_handler); pool_signal(SIGUSR1, sigusr1_handler); /* * okay as we need to wait until watchdog is in stable state so only * wait for SIGUSR1, SIGCHLD, and signals those are necessary to make * sure we respond to user requests of shutdown if it arrives while we * are in waiting state. * * Note that SIGUSR1 does not need to be in the wait signal list, * although it's signal handler is already installed, but even if the * SIGUSR1 arrives while watchdog is initializing we will continue * with our normal initialization and will process the failover * request once our backend status will be synchronized across the * cluster */ sigfillset(&mask); sigdelset(&mask, SIGUSR1); sigdelset(&mask, SIGCHLD); sigdelset(&mask, SIGTERM); sigdelset(&mask, SIGINT); sigdelset(&mask, SIGQUIT); watchdog_pid = initialize_watchdog(); ereport(LOG, (errmsg("waiting for watchdog to initialize"))); while (sigusr1_request == 0 && sigchld_request == 0) { sigsuspend(&mask); } wakeup_request = 0; /* watchdog process fails to start */ if (sigchld_request) { reaper(); } ereport(LOG, (errmsg("watchdog process is initialized"), errdetail("watchdog messaging data version: %s",WD_MESSAGE_DATA_VERSION))); /* * initialize the lifecheck process */ wd_lifecheck_pid = initialize_watchdog_lifecheck(); if (sigusr1_request) { sigusr1_interupt_processor(); sigusr1_request = 0; } } fds[0] = create_unix_domain_socket(un_addr); fds[1] = -1; on_proc_exit(FileUnlink, (Datum) un_addr.sun_path); /* create inet domain socket if any */ if (pool_config->listen_addresses[0]) { int *inet_fds, *walk; int n = 1; inet_fds = create_inet_domain_sockets(pool_config->listen_addresses, pool_config->port); for (walk = inet_fds; *walk != -1; walk++) n++; fds = realloc(fds, sizeof(int) * (n + 1)); if (fds == NULL) ereport(FATAL, (errmsg("failed to allocate memory in startup process"))); n = 1; for (walk = inet_fds; *walk != -1; walk++) { fds[n] = inet_fds[n - 1]; n++; } fds[n] = -1; free(inet_fds); } /* * We need to block signal here. Otherwise child might send some signals, * for example SIGUSR1(fail over). Children will inherit signal blocking * but they do unblock signals at the very beginning of process. So this * is harmless. */ POOL_SETMASK(&BlockSig); /* fork the children */ for (i = 0; i < pool_config->num_init_children; i++) { process_info[i].pid = fork_a_child(fds, i); process_info[i].start_time = time(NULL); } /* set up signal handlers */ pool_signal(SIGTERM, exit_handler); pool_signal(SIGINT, exit_handler); pool_signal(SIGQUIT, exit_handler); pool_signal(SIGCHLD, reap_handler); pool_signal(SIGUSR1, sigusr1_handler); pool_signal(SIGUSR2, wakeup_handler); pool_signal(SIGHUP, reload_config_handler); /* create pipe for delivering event */ if (pipe(pipe_fds) < 0) { ereport(FATAL, (errmsg("failed to create pipe"))); } MemoryContextSwitchTo(TopMemoryContext); /* * if the primary node id is not loaded by watchdog, search for it */ if (Req_info->primary_node_id < 0) { /* Save primary node id */ Req_info->primary_node_id = find_primary_node_repeatedly(); } /* fork a child for PCP handling */ pcp_unix_fd = create_unix_domain_socket(pcp_un_addr); /* Add onproc exit to clean up the unix domain socket at exit */ on_proc_exit(FileUnlink, (Datum) pcp_un_addr.sun_path); if (pool_config->pcp_listen_addresses[0]) { pcp_inet_fd = create_inet_domain_socket(pool_config->pcp_listen_addresses, pool_config->pcp_port); } pcp_pid = pcp_fork_a_child(pcp_unix_fd, pcp_inet_fd, pcp_conf_file); /* Fork worker process */ worker_pid = worker_fork_a_child(PT_WORKER, do_worker_child, NULL); /* Fork health check process */ for (i = 0; i < NUM_BACKENDS; i++) { if (VALID_BACKEND(i)) health_check_pids[i] = worker_fork_a_child(PT_HEALTH_CHECK, do_health_check_child, &i); } if (sigsetjmp(local_sigjmp_buf, 1) != 0) { /* Since not using PG_TRY, must reset error stack by hand */ error_context_stack = NULL; EmitErrorReport(); MemoryContextSwitchTo(TopMemoryContext); FlushErrorState(); POOL_SETMASK(&BlockSig); } /* We can now handle ereport(ERROR) */ PG_exception_stack = &local_sigjmp_buf; /* Create or write status file */ (void) write_status_file(); /* This is the main loop */ for (;;) { CHECK_REQUEST; /* * check for child signals to ensure child startup before reporting * successfull start. */ if (first) { int i; int n; POOL_NODE_STATUS *node_status = pool_get_node_status(); ereport(LOG, (errmsg("%s successfully started. version %s (%s)", PACKAGE, VERSION, PGPOOLVERSION))); /* * Very early stage node checking. It is assumed that * find_primary_node got called. */ if (STREAM) { for (i = 0; i < NUM_BACKENDS; i++) { ereport(LOG, (errmsg("node status[%d]: %d", i, node_status[i]))); if (node_status[i] == POOL_NODE_STATUS_INVALID) { ereport(LOG, (errmsg("pgpool_main: invalid node found %d", i))); if (pool_config->detach_false_primary) { n = i; degenerate_backend_set(&n, 1, REQ_DETAIL_SWITCHOVER | REQ_DETAIL_CONFIRMED); } } } } } first = false; processState = SLEEPING; for (;;) { int r; struct timeval t = {3, 0}; POOL_SETMASK(&UnBlockSig); r = pool_pause(&t); POOL_SETMASK(&BlockSig); if (r > 0) break; } } } /* * register_node_operation_request() * * This function enqueues the failover/failback requests, and fires the failover() if the function * is not already executing */ bool register_node_operation_request(POOL_REQUEST_KIND kind, int *node_id_set, int count, unsigned char flags) { bool failover_in_progress; pool_sigset_t oldmask; int index; /* * if the queue is already full what to do? */ if ((Req_info->request_queue_tail - MAX_REQUEST_QUEUE_SIZE) == Req_info->request_queue_head) { return false; } POOL_SETMASK2(&BlockSig, &oldmask); pool_semaphore_lock(REQUEST_INFO_SEM); if ((Req_info->request_queue_tail - MAX_REQUEST_QUEUE_SIZE) == Req_info->request_queue_head) { pool_semaphore_unlock(REQUEST_INFO_SEM); POOL_SETMASK(&oldmask); return false; } Req_info->request_queue_tail++; index = Req_info->request_queue_tail % MAX_REQUEST_QUEUE_SIZE; Req_info->request[index].kind = kind; Req_info->request[index].request_details = flags; if (count > 0) memcpy(Req_info->request[index].node_id, node_id_set, (sizeof(int) * count)); Req_info->request[index].count = count; failover_in_progress = Req_info->switching; pool_semaphore_unlock(REQUEST_INFO_SEM); POOL_SETMASK(&oldmask); if (failover_in_progress == false) { if (processType == PT_MAIN) failover(); else signal_user1_to_parent_with_reason(SIG_FAILOVER_INTERRUPT); } return true; } void register_watchdog_quorum_change_interupt(void) { signal_user1_to_parent_with_reason(SIG_WATCHDOG_QUORUM_CHANGED); } void register_watchdog_state_change_interupt(void) { signal_user1_to_parent_with_reason(SIG_WATCHDOG_STATE_CHANGED); } void register_backend_state_sync_req_interupt(void) { signal_user1_to_parent_with_reason(SIG_BACKEND_SYNC_REQUIRED); } void register_inform_quarantine_nodes_req(void) { signal_user1_to_parent_with_reason(SIG_INFORM_QURANTINE_NODES); } static void signal_user1_to_parent_with_reason(User1SignalReason reason) { user1SignalSlot->signalFlags[reason] = true; pool_signal_parent(SIGUSR1); } /* * fork a child for PCP */ static pid_t pcp_fork_a_child(int unix_fd, int inet_fd, char *pcp_conf_file) { pid_t pid; pid = fork(); if (pid == 0) { on_exit_reset(); close(pipe_fds[0]); close(pipe_fds[1]); /* Set the process type variable */ processType = PT_PCP; /* call PCP child main */ POOL_SETMASK(&UnBlockSig); health_check_timer_expired = 0; reload_config_request = 0; pcp_main(unix_fd, inet_fd); } else if (pid == -1) { ereport(FATAL, (errmsg("fork() failed. reason: %s", strerror(errno)))); } return pid; } /* * fork a child */ static pid_t fork_a_child(int *fds, int id) { pid_t pid; pid = fork(); if (pid == 0) { on_exit_reset(); /* * Before we unconditionally closed pipe_fds[0] and pipe_fds[1] here, * which is apparently wrong since in the start up of pgpool, pipe(2) * is not called yet and it mistakenly closes fd 0. Now we check the * fd > 0 before close(), expecting pipe returns fds greater than 0. * Note that we cannot unconditionally remove close(2) calls since * fork_a_child() may be called *after* pgpool starting up. */ if (pipe_fds[0] > 0) { close(pipe_fds[0]); close(pipe_fds[1]); } /* Set the process type variable */ processType = PT_CHILD; /* call child main */ POOL_SETMASK(&UnBlockSig); health_check_timer_expired = 0; reload_config_request = 0; my_proc_id = id; do_child(fds); } else if (pid == -1) { ereport(FATAL, (errmsg("failed to fork a child"), errdetail("system call fork() failed with reason: %s", strerror(errno)))); } return pid; } /* * fork worker child process */ static pid_t worker_fork_a_child(ProcessType type, void (*func) (), void *params) { pid_t pid; pid = fork(); if (pid == 0) { on_exit_reset(); /* * Before we unconditionally closed pipe_fds[0] and pipe_fds[1] here, * which is apparently wrong since in the start up of pgpool, pipe(2) * is not called yet and it mistakenly closes fd 0. Now we check the * fd > 0 before close(), expecting pipe returns fds greater than 0. * Note that we cannot unconditionally remove close(2) calls since * fork_a_child() may be called *after* pgpool starting up. */ if (pipe_fds[0] > 0) { close(pipe_fds[0]); close(pipe_fds[1]); } /* Set the process type variable */ processType = type; /* call child main */ POOL_SETMASK(&UnBlockSig); health_check_timer_expired = 0; reload_config_request = 0; func(params); } else if (pid == -1) { ereport(FATAL, (errmsg("failed to fork a child"), errdetail("system call fork() failed with reason: %s", strerror(errno)))); } return pid; } static int * create_inet_domain_sockets(const char *hostname, const int port) { int ret; int fd; int one = 1; int status; int backlog; int n = 0; int *sockfds; char *portstr; struct addrinfo *walk; struct addrinfo *res; struct addrinfo hints; memset(&hints, 0, sizeof(struct addrinfo)); hints.ai_family = PF_UNSPEC; hints.ai_socktype = SOCK_STREAM; hints.ai_flags = AI_PASSIVE; /* * getaddrinfo() requires a string because it also accepts service names, * such as "http". */ if (asprintf(&portstr, "%d", port) == -1) { ereport(FATAL, (errmsg("failed to create INET domain socket"), errdetail("asprintf() failed: %s", strerror(errno)))); } if ((ret = getaddrinfo((!hostname || strcmp(hostname, "*") == 0) ? NULL : hostname, portstr, &hints, &res)) != 0) { ereport(FATAL, (errmsg("failed to create INET domain socket"), errdetail("getaddrinfo() failed: %s", gai_strerror(ret)))); } free(portstr); for (walk = res; walk != NULL; walk = walk->ai_next) n++; sockfds = malloc(sizeof(int) * (n + 1)); n = 0; for (walk = res; walk != NULL; walk = walk->ai_next) sockfds[n++] = -1; /* We always terminate the list of sockets with a -1 entry */ sockfds[n] = -1; n = 0; for (walk = res; walk != NULL; walk = walk->ai_next) { char buf[INET6_ADDRSTRLEN + 1]; memset(buf, 0, sizeof(buf)); if ((ret = getnameinfo((struct sockaddr *) walk->ai_addr, walk->ai_addrlen, buf, sizeof(buf), NULL, 0, NI_NUMERICHOST)) != 0) { ereport(FATAL, (errmsg("failed to create INET domain socket"), errdetail("getnameinfo() failed: \"%s\"", gai_strerror(ret)))); } ereport(LOG, (errmsg("Setting up socket for %s:%d", buf, port))); if ((fd = socket(walk->ai_family, walk->ai_socktype, walk->ai_protocol)) == -1) { /* * A single failure is not necessarily a problem (machines without * proper dual stack setups), but if we cannot create any socket * at all, we report a FATAL error. */ ereport(LOG, (errmsg("perhaps failed to create INET domain socket"), errdetail("socket(%s) failed: \"%s\"", buf, strerror(errno)))); continue; } if ((setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, (char *) &one, sizeof(one))) == -1) { ereport(FATAL, (errmsg("failed to create INET domain socket"), errdetail("socket error \"%s\"", strerror(errno)))); } if (walk->ai_family == AF_INET6) { /* * On some machines, depending on the default value in * /proc/sys/net/ipv6/bindv6only, sockets will listen on both IPv6 * and IPv4 at the same time. Since we are creating one socket per * address family, disable that option specifically to be sure it * is off. */ if ((setsockopt(fd, IPPROTO_IPV6, IPV6_V6ONLY, &one, sizeof(one))) == -1) { ereport(LOG, (errmsg("perhaps failed to create INET domain socket"), errdetail("setsockopt(%s, IPV6_V6ONLY) failed: \"%s\"", buf, strerror(errno)))); } } if (bind(fd, walk->ai_addr, walk->ai_addrlen) != 0) { ereport(FATAL, (errmsg("failed to create INET domain socket"), errdetail("bind on socket failed with error \"%s\"", strerror(errno)))); } backlog = pool_config->num_init_children * pool_config->listen_backlog_multiplier; if (backlog > PGPOOLMAXLITSENQUEUELENGTH) backlog = PGPOOLMAXLITSENQUEUELENGTH; status = listen(fd, backlog); if (status < 0) ereport(FATAL, (errmsg("failed to create INET domain socket"), errdetail("listen on socket failed with error \"%s\"", strerror(errno)))); sockfds[n++] = fd; } freeaddrinfo(res); if (n == 0) { ereport(FATAL, (errmsg("failed to create INET domain socket"), errdetail("Failed to create any sockets. See the earlier LOG messages."))); } return sockfds; } /* * create inet domain socket */ static int create_inet_domain_socket(const char *hostname, const int port) { struct sockaddr_in addr; int fd; int status; int one = 1; int len; int backlog; fd = socket(AF_INET, SOCK_STREAM, 0); if (fd == -1) { ereport(FATAL, (errmsg("failed to create INET domain socket"), errdetail("socket error \"%s\"", strerror(errno)))); } if ((setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, (char *) &one, sizeof(one))) == -1) { ereport(FATAL, (errmsg("failed to create INET domain socket"), errdetail("socket error \"%s\"", strerror(errno)))); } memset((char *) &addr, 0, sizeof(addr)); addr.sin_family = AF_INET; if (strcmp(hostname, "*") == 0) { addr.sin_addr.s_addr = htonl(INADDR_ANY); } else { struct hostent *hostinfo; hostinfo = gethostbyname(hostname); if (!hostinfo) { ereport(FATAL, (errmsg("failed to create INET domain socket"), errdetail("could not resolve hostname \"%s\": error \"%s\"", hostname, hstrerror(h_errno)))); } addr.sin_addr = *(struct in_addr *) hostinfo->h_addr; } addr.sin_port = htons(port); len = sizeof(struct sockaddr_in); status = bind(fd, (struct sockaddr *) &addr, len); if (status == -1) { int saved_errno = errno; char host[NI_MAXHOST], servname[NI_MAXSERV]; if ((status = getnameinfo((struct sockaddr *) &addr, len, host, sizeof(host), servname, sizeof(servname), 0))) { ereport(NOTICE, (errmsg("getnameinfo failed while creating INET domain socket"), errdetail("getnameinfo failed with reason: \"%s\"", gai_strerror(status)))); snprintf(servname, sizeof(servname), "%d", port); snprintf(host, sizeof(host), "%s", hostname); } ereport(FATAL, (errmsg("failed to create INET domain socket"), errdetail("bind on host:\"%s\" server:\"%s\" failed with error \"%s\"", host, servname, strerror(saved_errno)))); } backlog = pool_config->num_init_children * pool_config->listen_backlog_multiplier; if (backlog > PGPOOLMAXLITSENQUEUELENGTH) backlog = PGPOOLMAXLITSENQUEUELENGTH; status = listen(fd, backlog); if (status < 0) ereport(FATAL, (errmsg("failed to create INET domain socket"), errdetail("listen on socket failed with error \"%s\"", strerror(errno)))); return fd; } /* * create UNIX domain socket */ static int create_unix_domain_socket(struct sockaddr_un un_addr_tmp) { struct sockaddr_un addr; int fd; int status; int len; /* Delete any pre-existing socket file to avoid failure at bind() time */ unlink(un_addr_tmp.sun_path); fd = socket(AF_UNIX, SOCK_STREAM, 0); if (fd == -1) { ereport(FATAL, (errmsg("failed to create a socket"), errdetail("Failed to create UNIX domain socket. error: \"%s\"", strerror(errno)))); } memset((char *) &addr, 0, sizeof(addr)); addr.sun_family = AF_UNIX; snprintf(addr.sun_path, sizeof(addr.sun_path), "%s", un_addr_tmp.sun_path); len = sizeof(struct sockaddr_un); status = bind(fd, (struct sockaddr *) &addr, len); if (status == -1) { ereport(FATAL, (errmsg("failed to bind a socket: \"%s\"", un_addr_tmp.sun_path), errdetail("bind socket failed with error: \"%s\"", strerror(errno)))); } if (chmod(un_addr_tmp.sun_path, 0777) == -1) { ereport(FATAL, (errmsg("failed to bind a socket: \"%s\"", un_addr_tmp.sun_path), errdetail("system call chmod failed with error: \"%s\"", strerror(errno)))); } status = listen(fd, PGPOOLMAXLITSENQUEUELENGTH); if (status < 0) { ereport(FATAL, (errmsg("failed to bind a socket: \"%s\"", un_addr_tmp.sun_path), errdetail("system call listen() failed with error: \"%s\"", strerror(errno)))); } return fd; } /* * function called as shared memory exit call back to kill all childrens */ static void terminate_all_childrens() { pid_t wpid; int i; /* * This is supposed to be called from main process */ if (processType != PT_MAIN) return; POOL_SETMASK(&BlockSig); kill_all_children(SIGINT); if (pcp_pid != 0) kill(pcp_pid, SIGINT); pcp_pid = 0; if (worker_pid != 0) kill(worker_pid, SIGINT); worker_pid = 0; if (pool_config->use_watchdog) { if (pool_config->use_watchdog) { if (watchdog_pid) kill(watchdog_pid, SIGINT); watchdog_pid = 0; if (wd_lifecheck_pid) kill(wd_lifecheck_pid, SIGINT); wd_lifecheck_pid = 0; } } for (i = 0 ; i < MAX_NUM_BACKENDS; i++) { if (health_check_pids[i] != 0) { kill(health_check_pids[i], SIGINT); health_check_pids[i] = 0; } } /* wait for all children to exit */ do { int ret_pid; wpid = waitpid(-1, &ret_pid, 0); } while (wpid > 0 || (wpid == -1 && errno == EINTR)); if (wpid == -1 && errno != ECHILD) ereport(LOG, (errmsg("wait() failed. reason:%s", strerror(errno)))); POOL_SETMASK(&UnBlockSig); } /* * Reuest failover. If "switch_over" is false, request all existing sessions * restarting. */ void notice_backend_error(int node_id, unsigned char flags) { int n = node_id; if (getpid() == mypid) { ereport(LOG, (errmsg("notice_backend_error: called from pgpool main. ignored."))); } else { degenerate_backend_set(&n, 1, flags); } } /* * degenerate_backend_set_ex: * * The function registers/verifies the node down operation request. * The request is then processed by failover function. * * node_id_set: array of node ids to be registered for NODE DOWN operation * count: number of elements in node_id_set array * error: if set error is thrown as soon as any node id is found in * node_id_set on which operation could not be performed. * test_only: When set, function only checks if NODE DOWN operation can be * executed on provided node ids and never registers the operation * request. * For test_only case function returs false or throws an error as * soon as first non complient node in node_id_set is found * switch_over: if set, the request is originated by switch over, not errors. * * wd_failover_id: The watchdog internal ID for this failover */ bool degenerate_backend_set_ex(int *node_id_set, int count, unsigned char flags, bool error, bool test_only) { int i; int node_id[MAX_NUM_BACKENDS]; int node_count = 0; int elevel = LOG; if (error) elevel = ERROR; for (i = 0; i < count; i++) { if (node_id_set[i] < 0 || node_id_set[i] >= MAX_NUM_BACKENDS || (!VALID_BACKEND(node_id_set[i]) && BACKEND_INFO(node_id_set[i]).quarantine == false)) { if (node_id_set[i] < 0 || node_id_set[i] >= MAX_NUM_BACKENDS) ereport(elevel, (errmsg("invalid degenerate backend request, node id: %d is out of range. node id must be between [0 and %d]" ,node_id_set[i], MAX_NUM_BACKENDS))); else ereport(elevel, (errmsg("invalid degenerate backend request, node id : %d status: [%d] is not valid for failover" ,node_id_set[i], BACKEND_INFO(node_id_set[i]).backend_status))); if (test_only) return false; continue; } if (POOL_DISALLOW_TO_FAILOVER(BACKEND_INFO(node_id_set[i]).flag)) { ereport(elevel, (errmsg("degenerate backend request for node_id: %d from pid [%d] is canceled because failover is disallowed on the node", node_id_set[i], getpid()))); if (test_only) return false; } else { if (!test_only) /* do not produce this log if we are in * testing mode */ ereport(LOG, (errmsg("received degenerate backend request for node_id: %d from pid [%d]", node_id_set[i], getpid()))); node_id[node_count++] = node_id_set[i]; } } if (node_count) { WDFailoverCMDResults res = FAILOVER_RES_PROCEED; /* If this was only a test. Inform the caller without doing anything */ if (test_only) return true; if (!(flags & REQ_DETAIL_WATCHDOG)) { int x; for (x = 0; x < MAX_SEC_WAIT_FOR_CLUSTER_TRANSATION; x++) { res = wd_degenerate_backend_set(node_id_set, count, flags); if (res != FAILOVER_RES_TRANSITION) break; sleep(1); } } if (res == FAILOVER_RES_TRANSITION) { /* * What to do when cluster is still not stable Is proceeding to * failover is the right choice ??? */ ereport(NOTICE, (errmsg("received degenerate backend request for %d node(s) from pid [%d], But cluster is not in stable state" ,node_count, getpid()))); } if (res == FAILOVER_RES_PROCEED) { register_node_operation_request(NODE_DOWN_REQUEST, node_id, node_count, flags); } else if (res == FAILOVER_RES_NO_QUORUM) { ereport(LOG, (errmsg("degenerate backend request for %d node(s) from pid [%d], is changed to quarantine node request by watchdog" ,node_count, getpid()), errdetail("watchdog does not holds the quorum"))); register_node_operation_request(NODE_QUARANTINE_REQUEST, node_id, node_count, flags); } else if (res == FAILOVER_RES_CONSENSUS_MAY_FAIL) { ereport(LOG, (errmsg("degenerate backend request for %d node(s) from pid [%d], is changed to quarantine node request by watchdog" ,node_count, getpid()), errdetail("watchdog is taking time to build consensus"))); register_node_operation_request(NODE_QUARANTINE_REQUEST, node_id, node_count, flags); } else if (res == FAILOVER_RES_BUILDING_CONSENSUS) { ereport(LOG, (errmsg("degenerate backend request for node_id: %d from pid [%d], will be handled by watchdog, which is building consensus for request" ,*node_id, getpid()))); } else if (res == FAILOVER_RES_WILL_BE_DONE) { /* we will receive a sync request from master watchdog node */ ereport(LOG, (errmsg("degenerate backend request for %d node(s) from pid [%d], will be handled by watchdog" ,node_count, getpid()))); } else { ereport(elevel, (errmsg("degenerate backend request for %d node(s) from pid [%d] is canceled by other pgpool" ,node_count, getpid()))); return false; } } return true; } /* * wrapper over degenerate_backend_set_ex function to register * NODE down operation request */ bool degenerate_backend_set(int *node_id_set, int count, unsigned char flags) { return degenerate_backend_set_ex(node_id_set, count, flags, false, false); } /* send promote node request using SIGUSR1 */ bool promote_backend(int node_id, unsigned char flags) { WDFailoverCMDResults res = FAILOVER_RES_PROCEED; bool ret = false; if (!SL_MODE) { return false; } if (node_id < 0 || node_id >= MAX_NUM_BACKENDS || !VALID_BACKEND(node_id)) { if (node_id < 0 || node_id >= MAX_NUM_BACKENDS) ereport(LOG, (errmsg("invalid promote backend request, node id: %d is out of range. node id must be between [0 and %d]" ,node_id, MAX_NUM_BACKENDS))); else ereport(LOG, (errmsg("invalid promote backend request, node id : %d status: [%d] not valid" ,node_id, BACKEND_INFO(node_id).backend_status))); return false; } ereport(LOG, (errmsg("received promote backend request for node_id: %d from pid [%d]", node_id, getpid()))); /* If this was only a test. Inform the caller without doing anything */ if (!(flags & REQ_DETAIL_WATCHDOG)) { int x; for (x = 0; x < MAX_SEC_WAIT_FOR_CLUSTER_TRANSATION; x++) { res = wd_promote_backend(node_id, flags); if (res != FAILOVER_RES_TRANSITION) break; sleep(1); } } if (res == FAILOVER_RES_TRANSITION) { /* * What to do when cluster is still not stable Is proceeding to * failover is the right choice ??? */ ereport(NOTICE, (errmsg("promote backend request for node_id: %d from pid [%d], But cluster is not in stable state" ,node_id, getpid()))); } if (res == FAILOVER_RES_PROCEED) { ret = register_node_operation_request(PROMOTE_NODE_REQUEST, &node_id, 1, flags); } else if (res == FAILOVER_RES_WILL_BE_DONE) { ereport(LOG, (errmsg("promote backend request for node_id: %d from pid [%d], will be handled by watchdog" ,node_id, getpid()))); } else if (res == FAILOVER_RES_NO_QUORUM) { ereport(LOG, (errmsg("promote backend request for node_id: %d from pid [%d], is canceled because watchdog does not hold quorum" ,node_id, getpid()))); } else if (res == FAILOVER_RES_BUILDING_CONSENSUS) { ereport(LOG, (errmsg("promote backend request for node_id: %d from pid [%d], will be handled by watchdog, which is building consensus for request" ,node_id, getpid()))); } else { ereport(LOG, (errmsg("promote backend request for node_id: %d from pid [%d] is canceled by other pgpool" ,node_id, getpid()))); } return ret; } /* send failback request using SIGUSR1 */ bool send_failback_request(int node_id, bool throw_error, unsigned char flags) { WDFailoverCMDResults res = FAILOVER_RES_PROCEED; bool ret = false; if (node_id < 0 || node_id >= MAX_NUM_BACKENDS || (RAW_MODE && BACKEND_INFO(node_id).backend_status != CON_DOWN && VALID_BACKEND(node_id))) { if (node_id < 0 || node_id >= MAX_NUM_BACKENDS) ereport(throw_error ? ERROR : LOG, (errmsg("invalid failback request, node id: %d is out of range. node id must be between [0 and %d]" ,node_id, MAX_NUM_BACKENDS))); else ereport(throw_error ? ERROR : LOG, (errmsg("invalid failback request, node id : %d status: [%d] not valid for failback" ,node_id, BACKEND_INFO(node_id).backend_status))); return false; } ereport(LOG, (errmsg("received failback request for node_id: %d from pid [%d]", node_id, getpid()))); /* check we are trying to failback the quarantine node */ if (BACKEND_INFO(node_id).quarantine) { /* set the update flags */ ereport(LOG, (errmsg("failback request from pid [%d] is changed to update status request because node_id: %d was quarantined", getpid(), node_id))); flags |= REQ_DETAIL_UPDATE; } else { /* * no need to go to watchdog if it's an update or already initiated * from watchdog */ if (!(flags & REQ_DETAIL_WATCHDOG)) { int x; for (x = 0; x < MAX_SEC_WAIT_FOR_CLUSTER_TRANSATION; x++) { res = wd_send_failback_request(node_id, flags); if (res != FAILOVER_RES_TRANSITION) break; sleep(1); } } } if (res == FAILOVER_RES_TRANSITION) { /* * What to do when cluster is still not stable Is proceeding to * failover is the right choice ??? */ ereport(NOTICE, (errmsg("failback request for node_id: %d from pid [%d], But cluster is not in stable state" ,node_id, getpid()))); } if (res == FAILOVER_RES_PROCEED) { ret = register_node_operation_request(NODE_UP_REQUEST, &node_id, 1, flags); } else if (res == FAILOVER_RES_WILL_BE_DONE) { ereport(LOG, (errmsg("failback request for node_id: %d from pid [%d], will be handled by watchdog" ,node_id, getpid()))); } else { ereport(throw_error ? ERROR : LOG, (errmsg("failback request for node_id: %d from pid [%d] is canceled by other pgpool" ,node_id, getpid()))); } return ret; } static RETSIGTYPE exit_handler(int sig) { int i; pid_t wpid; int *walk; int save_errno = errno; POOL_SETMASK(&AuthBlockSig); /* * this could happen in a child process if a signal has been sent before * resetting signal handler */ if (getpid() != mypid) { POOL_SETMASK(&UnBlockSig); proc_exit(0); } if (sig != SIGTERM && sig != SIGINT && sig != SIGQUIT) { POOL_SETMASK(&UnBlockSig); errno = save_errno; return; } exiting = 1; processState = EXITING; /* Close listen socket */ for (walk = fds; *walk != -1; walk++) close(*walk); for (i = 0; i < pool_config->num_init_children; i++) { pid_t pid = process_info[i].pid; if (pid != 0) { kill(pid, sig); process_info[i].pid = 0; } } for (i = 0; i < MAX_NUM_BACKENDS; i++) { if (health_check_pids[i] != 0) { kill(health_check_pids[i], sig); health_check_pids[i] = 0; } } if (pcp_pid != 0) kill(pcp_pid, sig); pcp_pid = 0; if (worker_pid != 0) kill(worker_pid, sig); worker_pid = 0; if (pool_config->use_watchdog) { if (watchdog_pid != 0) kill(watchdog_pid, sig); watchdog_pid = 0; if (wd_lifecheck_pid != 0) kill(wd_lifecheck_pid, sig); wd_lifecheck_pid = 0; } POOL_SETMASK(&UnBlockSig); do { int ret_pid; wpid = waitpid(-1, &ret_pid, 0); } while (wpid > 0 || (wpid == -1 && errno == EINTR)); process_info = NULL; exit(0); } /* * Calculate next valid master node id. * If no valid node found, returns -1. */ int get_next_master_node(void) { int i; for (i = 0; i < pool_config->backend_desc->num_backends; i++) { /* * Do not use VALID_BACKEND macro in raw mode. VALID_BACKEND return * true only if the argument is master node id. In other words, * standby nodes are false. So need to check backend status with * VALID_BACKEND_RAW. */ if (RAW_MODE) { if (VALID_BACKEND_RAW(i)) break; } else { if (VALID_BACKEND(i)) break; } } if (i == pool_config->backend_desc->num_backends) i = -1; return i; } /* * handle SIGUSR1 * */ static RETSIGTYPE sigusr1_handler(int sig) { int save_errno = errno; POOL_SETMASK(&BlockSig); sigusr1_request = 1; dummy_status = write(pipe_fds[1], "\0", 1); #ifdef NOT_USED if (write(pipe_fds[1], "\0", 1) < 0) ereport(WARNING, (errmsg("SIGUSR1 handler: write to pipe failed with error \"%s\"", strerror(errno)))); #endif POOL_SETMASK(&UnBlockSig); errno = save_errno; } static void sigusr1_interupt_processor(void) { ereport(DEBUG1, (errmsg("Pgpool-II parent process received SIGUSR1"))); if (user1SignalSlot->signalFlags[SIG_WATCHDOG_QUORUM_CHANGED]) { ereport(LOG, (errmsg("Pgpool-II parent process received watchdog quorum change signal from watchdog"))); user1SignalSlot->signalFlags[SIG_WATCHDOG_QUORUM_CHANGED] = false; if (get_watchdog_quorum_state() >= 0) { ereport(LOG, (errmsg("watchdog cluster now holds the quorum"), errdetail("updating the state of quarantine backend nodes"))); update_backend_quarantine_status(); } } if (user1SignalSlot->signalFlags[SIG_INFORM_QURANTINE_NODES]) { ereport(LOG, (errmsg("Pgpool-II parent process received inform quarantine nodes signal from watchdog"))); user1SignalSlot->signalFlags[SIG_INFORM_QURANTINE_NODES] = false; degenerate_all_quarantine_nodes(); } if (user1SignalSlot->signalFlags[SIG_BACKEND_SYNC_REQUIRED]) { ereport(LOG, (errmsg("Pgpool-II parent process received sync backend signal from watchdog"))); user1SignalSlot->signalFlags[SIG_BACKEND_SYNC_REQUIRED] = false; if (get_watchdog_local_node_state() == WD_STANDBY) { ereport(LOG, (errmsg("master watchdog has performed failover"), errdetail("syncing the backend states from the MASTER watchdog node"))); sync_backend_from_watchdog(); } } if (user1SignalSlot->signalFlags[SIG_WATCHDOG_STATE_CHANGED]) { ereport(DEBUG1, (errmsg("Pgpool-II parent process received watchdog state change signal from watchdog"))); user1SignalSlot->signalFlags[SIG_WATCHDOG_STATE_CHANGED] = false; if (get_watchdog_local_node_state() == WD_STANDBY) { ereport(LOG, (errmsg("we have joined the watchdog cluster as STANDBY node"), errdetail("syncing the backend states from the MASTER watchdog node"))); sync_backend_from_watchdog(); } } if (user1SignalSlot->signalFlags[SIG_FAILOVER_INTERRUPT]) { ereport(LOG, (errmsg("Pgpool-II parent process has received failover request"))); user1SignalSlot->signalFlags[SIG_FAILOVER_INTERRUPT] = false; if (processState == INITIALIZING) { ereport(LOG, (errmsg("ignoring the failover request, since we are still starting up"))); } else { failover(); } } } /* returns true if all backends are down */ static bool check_all_backend_down(void) { int i; /* Check to see if all backends are down */ for (i = 0; i < NUM_BACKENDS; i++) { if (BACKEND_INFO(i).backend_status != CON_DOWN && BACKEND_INFO(i).backend_status != CON_UNUSED) { ereport(LOG, (errmsg("Node %d is not down (status: %d)", i, BACKEND_INFO(i).backend_status))); return false; } } return true; } /* * backend connection error, failover/failback request, if possible * failover() must be called under protecting signals. */ static void failover(void) { int i, j, k; int node_id; int new_master; int new_primary = -1; int nodes[MAX_NUM_BACKENDS]; bool need_to_restart_children = true; bool partial_restart = false; int status; int sts; bool need_to_restart_pcp = false; bool all_backend_down = true; bool sync_required = false; ereport(DEBUG1, (errmsg("failover handler called"))); memset(nodes, 0, sizeof(int) * MAX_NUM_BACKENDS); /* * this could happen in a child process if a signal has been sent before * resetting signal handler */ if (getpid() != mypid) { ereport(DEBUG1, (errmsg("failover handler called"), errdetail("I am not parent"))); kill(pcp_pid, SIGUSR2); return; } /* * processing SIGTERM, SIGINT or SIGQUIT */ if (exiting) { ereport(DEBUG1, (errmsg("failover handler called while exiting"))); kill(pcp_pid, SIGUSR2); return; } /* * processing fail over or switch over */ if (switching) { ereport(DEBUG1, (errmsg("failover handler called while switching"))); kill(pcp_pid, SIGUSR2); return; } Req_info->switching = true; switching = 1; for (;;) { POOL_REQUEST_KIND reqkind; int queue_index; int node_id_set[MAX_NUM_BACKENDS]; int node_count; unsigned char request_details; bool search_primary = true; pool_semaphore_lock(REQUEST_INFO_SEM); if (Req_info->request_queue_tail == Req_info->request_queue_head) /* request queue is * empty */ { switching = 0; Req_info->switching = false; pool_semaphore_unlock(REQUEST_INFO_SEM); break; } /* make a local copy of request */ Req_info->request_queue_head++; queue_index = Req_info->request_queue_head % MAX_REQUEST_QUEUE_SIZE; memcpy(node_id_set, Req_info->request[queue_index].node_id, (sizeof(int) * Req_info->request[queue_index].count)); reqkind = Req_info->request[queue_index].kind; request_details = Req_info->request[queue_index].request_details; node_count = Req_info->request[queue_index].count; pool_semaphore_unlock(REQUEST_INFO_SEM); ereport(DEBUG1, (errmsg("failover handler"), errdetail("kind: %d flags: %x node_count: %d index:%d", reqkind, request_details, node_count, queue_index))); if (reqkind == CLOSE_IDLE_REQUEST) { kill_all_children(SIGUSR1); continue; } /* inform all remote watchdog nodes that we are starting the failover */ wd_failover_start(); /* * if not in replication mode/master slave mode, we treat this a * restart request. otherwise we need to check if we have already * failovered. */ ereport(DEBUG1, (errmsg("failover handler"), errdetail("starting to select new master node"))); node_id = node_id_set[0]; /* failback request? */ if (reqkind == NODE_UP_REQUEST) { if (node_id < 0 || node_id >= MAX_NUM_BACKENDS || (reqkind == NODE_UP_REQUEST && !(RAW_MODE && BACKEND_INFO(node_id).backend_status == CON_DOWN) && VALID_BACKEND(node_id)) || (reqkind == NODE_DOWN_REQUEST && !VALID_BACKEND(node_id))) { if (node_id < 0 || node_id >= MAX_NUM_BACKENDS) ereport(LOG, (errmsg("invalid failback request, node id: %d is invalid. node id must be between [0 and %d]", node_id, MAX_NUM_BACKENDS))); else ereport(LOG, (errmsg("invalid failback request, status: [%d] of node id : %d is invalid for failback", BACKEND_INFO(node_id).backend_status, node_id))); continue; } ereport(LOG, (errmsg("starting fail back. reconnect host %s(%d)", BACKEND_INFO(node_id).backend_hostname, BACKEND_INFO(node_id).backend_port))); /* Check to see if all backends are down */ all_backend_down = check_all_backend_down(); BACKEND_INFO(node_id).backend_status = CON_CONNECT_WAIT; /* unset down status */ pool_set_backend_status_changed_time(node_id); if ((request_details & REQ_DETAIL_UPDATE)) { /* remove the quarantine flag */ BACKEND_INFO(node_id).quarantine = false; /* * do not search for primary node when handling the quarantine * nodes */ search_primary = false; /* * recalculate the master node id after setting the backend * status of quarantined node, this will bring us to the old * master_node_id that was beofre the quarantine state */ Req_info->master_node_id = get_next_master_node(); if (Req_info->primary_node_id == -1 && BACKEND_INFO(node_id).role == ROLE_PRIMARY) { /* * if the failback request is for the quarantined node and * that node had a primary role before it was quarantined, * restore the primary node status for that node. this is * important for the failover script to get the proper * value of old primary */ ereport(LOG, (errmsg("failover: failing back the quarantine node that was primary before it was quarantined"), errdetail("all children needs a restart"))); Req_info->primary_node_id = node_id; /* * since we changed the primary node so restart of all * children is required */ need_to_restart_children = true; partial_restart = false; } else if (all_backend_down == false) { ereport(LOG, (errmsg("Do not restart children because we are failing back node id %d host: %s port: %d and we are in streaming replication mode and not all backends were down", node_id, BACKEND_INFO(node_id).backend_hostname, BACKEND_INFO(node_id).backend_port))); need_to_restart_children = false; partial_restart = false; } else { need_to_restart_children = true; partial_restart = false; } } else { /* * The request is a proper failbak request and not because of * the update status of quarantined node */ (void) write_status_file(); trigger_failover_command(node_id, pool_config->failback_command, MASTER_NODE_ID, get_next_master_node(), PRIMARY_NODE_ID); } sync_required = true; } else if (reqkind == PROMOTE_NODE_REQUEST) { if (node_id != -1 && VALID_BACKEND(node_id)) { ereport(LOG, (errmsg("starting promotion. promote host %s(%d)", BACKEND_INFO(node_id).backend_hostname, BACKEND_INFO(node_id).backend_port))); } else { ereport(LOG, (errmsg("failover: no backends are promoted"))); continue; } } else /* NODE_DOWN_REQUEST && * NODE_QUARANTINE_REQUEST */ { int cnt = 0; for (i = 0; i < node_count; i++) { if (node_id_set[i] != -1 && (BACKEND_INFO(node_id_set[i]).quarantine == true || ((RAW_MODE && VALID_BACKEND_RAW(node_id_set[i])) || VALID_BACKEND(node_id_set[i])))) { ereport(LOG, (errmsg("starting %s. shutdown host %s(%d)", (reqkind == NODE_QUARANTINE_REQUEST) ? "quarantine" : "degeneration", BACKEND_INFO(node_id_set[i]).backend_hostname, BACKEND_INFO(node_id_set[i]).backend_port))); BACKEND_INFO(node_id_set[i]).backend_status = CON_DOWN; /* set down status */ pool_set_backend_status_changed_time(node_id_set[i]); if (reqkind == NODE_QUARANTINE_REQUEST) { BACKEND_INFO(node_id_set[i]).quarantine = true; } else { /* * if the degeneration request is for the quarantined * node and that node had a primary role before it was * quarantined, Restore the primary node status for * that node before degenerating it. This is important * for the failover script to get the proper valueo of * old primary */ if (Req_info->primary_node_id == -1 && BACKEND_INFO(node_id_set[i]).quarantine == true && BACKEND_INFO(node_id_set[i]).role == ROLE_PRIMARY) { ereport(DEBUG2, (errmsg("failover: degenerating the node that was primary node before it was quarantined"))); Req_info->primary_node_id = node_id_set[i]; search_primary = false; } BACKEND_INFO(node_id_set[i]).quarantine = false; (void) write_status_file(); } /* save down node */ nodes[node_id_set[i]] = 1; cnt++; } } if (cnt == 0) { ereport(LOG, (errmsg("failover: no backends are degenerated"))); continue; } } new_master = get_next_master_node(); if (new_master < 0) { ereport(LOG, (errmsg("failover: no valid backend node found"))); } ereport(DEBUG1, (errmsg("failover/failback request details: STREAM: %d reqkind: %d detail: %x node_id: %d", STREAM, reqkind, request_details & REQ_DETAIL_SWITCHOVER, node_id))); /* * On 2011/5/2 Tatsuo Ishii says: if mode is streaming replication and * request is NODE_UP_REQUEST (failback case) we don't need to restart * all children. Existing session will not use newly attached node, * but load balanced node is not changed until this session ends, so * it's harmless anyway. */ /* * On 2015/9/21 Tatsuo Ishii says: this judgment is not sufficient if * all backends were down. Child process has local status in which all * backends are down. In this case even if new connection arrives from * frontend, the child will not accept it because the local status * shows all backends are down. For this purpose we refer to * "all_backend_down" variable, which was set before updating backend * status. * * See bug 248 for more details. */ if (STREAM && reqkind == NODE_UP_REQUEST && all_backend_down == false) { /* * The decision to restart/no-restart children for update status * request has already been made */ if (!(request_details & REQ_DETAIL_UPDATE)) { ereport(LOG, (errmsg("Do not restart children because we are failing back node id %d host: %s port: %d and we are in streaming replication mode and not all backends were down", node_id, BACKEND_INFO(node_id).backend_hostname, BACKEND_INFO(node_id).backend_port))); need_to_restart_children = false; partial_restart = false; } } /* * If the mode is streaming replication and the request is * NODE_DOWN_REQUEST and it's actually a switch over request, we don't * need to restart all children, except the node is primary. */ else if (STREAM && (reqkind == NODE_DOWN_REQUEST || reqkind == NODE_QUARANTINE_REQUEST) && request_details & REQ_DETAIL_SWITCHOVER && node_id != PRIMARY_NODE_ID) { ereport(LOG, (errmsg("Do not restart children because we are switching over node id %d host: %s port: %d and we are in streaming replication mode", node_id, BACKEND_INFO(node_id).backend_hostname, BACKEND_INFO(node_id).backend_port))); need_to_restart_children = true; partial_restart = true; for (i = 0; i < pool_config->num_init_children; i++) { bool restart = false; for (j = 0; j < pool_config->max_pool; j++) { for (k = 0; k < NUM_BACKENDS; k++) { ConnectionInfo *con = pool_coninfo(i, j, k); if (con->connected && con->load_balancing_node == node_id) { ereport(LOG, (errmsg("child pid %d needs to restart because pool %d uses backend %d", process_info[i].pid, j, node_id))); restart = true; break; } } } if (restart) { pid_t pid = process_info[i].pid; if (pid) { kill(pid, SIGQUIT); ereport(DEBUG1, (errmsg("failover handler"), errdetail("kill process with PID:%d", pid))); } } } } else { ereport(LOG, (errmsg("Restart all children"))); /* kill all children */ for (i = 0; i < pool_config->num_init_children; i++) { pid_t pid = process_info[i].pid; if (pid) { kill(pid, SIGQUIT); ereport(DEBUG1, (errmsg("failover handler"), errdetail("kill process with PID:%d", pid))); } } need_to_restart_children = true; partial_restart = false; } /* * Exec failover_command if needed We do not execute failover when * request is quarantine type */ if (reqkind == NODE_DOWN_REQUEST) { for (i = 0; i < pool_config->backend_desc->num_backends; i++) { if (nodes[i]) { trigger_failover_command(i, pool_config->failover_command, MASTER_NODE_ID, new_master, REAL_PRIMARY_NODE_ID); sync_required = true; } } } if (reqkind == PROMOTE_NODE_REQUEST && VALID_BACKEND(node_id)) { new_primary = node_id; } else if (reqkind == NODE_QUARANTINE_REQUEST) { /* * if the quarantine node was the primary node set the newprimary * to -1 (invalid) */ if (Req_info->primary_node_id == node_id) { /* * set the role of the node, This will help us restore the * primary node id when the node will come out from quarantine * state */ BACKEND_INFO(node_id).role = ROLE_PRIMARY; new_primary = -1; } else if (SL_MODE) { new_primary = Req_info->primary_node_id; } } /* * If the down node was a standby node in streaming replication mode, * we can avoid calling find_primary_node_repeatedly() and recognize * the former primary as the new primary node, which will reduce the * time to process standby down. */ else if (SL_MODE && reqkind == NODE_DOWN_REQUEST) { if (Req_info->primary_node_id != node_id) { new_primary = Req_info->primary_node_id; } else { if (Req_info->primary_node_id >= 0) BACKEND_INFO(Req_info->primary_node_id).role = ROLE_STANDBY; new_primary = find_primary_node_repeatedly(); } } else if (search_primary == false) { ereport(DEBUG1, (errmsg("faliover was called on quarantined node. No need to search for primary node"))); new_primary = Req_info->primary_node_id; } else { new_primary = find_primary_node_repeatedly(); } /* * If follow_master_command is provided and in master/slave streaming * replication mode, we start degenerating all backends as they are * not replicated anymore. */ int follow_cnt = 0; if (STREAM) { if (*pool_config->follow_master_command != '\0' || reqkind == PROMOTE_NODE_REQUEST) { /* only if the failover is against the current primary */ if (((reqkind == NODE_DOWN_REQUEST) && Req_info->primary_node_id >= 0 && (nodes[Req_info->primary_node_id])) || (node_id >= 0 && (reqkind == PROMOTE_NODE_REQUEST) && (VALID_BACKEND(node_id)))) { for (i = 0; i < pool_config->backend_desc->num_backends; i++) { /* do not degenerate the new primary */ if ((new_primary >= 0) && (i != new_primary)) { BackendInfo *bkinfo; bkinfo = pool_get_node_info(i); ereport(LOG, (errmsg("starting follow degeneration. shutdown host %s(%d)", bkinfo->backend_hostname, bkinfo->backend_port))); bkinfo->backend_status = CON_DOWN; /* set down status */ pool_set_backend_status_changed_time(i); (void) write_status_file(); follow_cnt++; } } if (follow_cnt == 0) { ereport(LOG, (errmsg("failover: no follow backends are degenerated"))); } else { /* update new master node */ new_master = get_next_master_node(); ereport(LOG, (errmsg("failover: %d follow backends have been degenerated", follow_cnt))); } } } } if ((follow_cnt > 0) && (*pool_config->follow_master_command != '\0')) { follow_pid = fork_follow_child(Req_info->master_node_id, new_primary, Req_info->primary_node_id); } /* Save primary node id */ if (Req_info->primary_node_id != new_primary) { if (Req_info->primary_node_id >= 0) { pool_set_backend_status_changed_time(Req_info->primary_node_id); } if (new_primary >= 0) { BACKEND_INFO(new_primary).role = ROLE_PRIMARY; pool_set_backend_status_changed_time(new_primary); } } Req_info->primary_node_id = new_primary; ereport(LOG, (errmsg("failover: set new primary node: %d", Req_info->primary_node_id))); if (new_master >= 0) { Req_info->master_node_id = new_master; sync_required = true; ereport(LOG, (errmsg("failover: set new master node: %d", Req_info->master_node_id))); } /* Kill children and restart them if needed */ if (need_to_restart_children) { for (i = 0; i < pool_config->num_init_children; i++) { /* * Try to kill pgpool child because previous kill signal may * not be received by pgpool child. This could happen if * multiple PostgreSQL are going down (or even starting * pgpool, without starting PostgreSQL can trigger this). * Child calls degenerate_backend() and it tries to aquire * semaphore to write a failover request. In this case the * signal mask is set as well, thus signals are never * received. */ bool restart = false; if (partial_restart) { for (j = 0; j < pool_config->max_pool; j++) { for (k = 0; k < NUM_BACKENDS; k++) { ConnectionInfo *con = pool_coninfo(i, j, k); if (con->connected && con->load_balancing_node == node_id) { ereport(LOG, (errmsg("child pid %d needs to restart because pool %d uses backend %d", process_info[i].pid, j, node_id))); restart = true; break; } } } } else restart = true; if (restart) { if (process_info[i].pid) { kill(process_info[i].pid, SIGQUIT); process_info[i].pid = fork_a_child(fds, i); process_info[i].start_time = time(NULL); } } else process_info[i].need_to_restart = 1; } } else { /* * Set restart request to each child. Children will exit(1) * whenever they are convenient. */ for (i = 0; i < pool_config->num_init_children; i++) { process_info[i].need_to_restart = 1; } } /* * Send restart request to worker child. */ kill(worker_pid, SIGUSR1); if (sync_required) wd_failover_end(); if (reqkind == NODE_UP_REQUEST) { ereport(LOG, (errmsg("failback done. reconnect host %s(%d)", BACKEND_INFO(node_id).backend_hostname, BACKEND_INFO(node_id).backend_port))); /* Fork health check process if needed */ for (i = 0; i < NUM_BACKENDS; i++) { if (health_check_pids[i] == 0) { ereport(LOG, (errmsg("start health check process for host %s(%d)", BACKEND_INFO(node_id).backend_hostname, BACKEND_INFO(node_id).backend_port))); health_check_pids[i] = worker_fork_a_child(PT_HEALTH_CHECK, do_health_check_child, &i); } } } else if (reqkind == PROMOTE_NODE_REQUEST) { ereport(LOG, (errmsg("promotion done. promoted host %s(%d)", BACKEND_INFO(node_id).backend_hostname, BACKEND_INFO(node_id).backend_port))); } else { /* * Temporary black magic. Without this regression 055 does not * finish */ fprintf(stderr, "%s done. shutdown host %s(%d)", (reqkind == NODE_DOWN_REQUEST) ? "failover" : "quarantine", BACKEND_INFO(node_id).backend_hostname, BACKEND_INFO(node_id).backend_port); ereport(LOG, (errmsg("%s done. shutdown host %s(%d)", (reqkind == NODE_DOWN_REQUEST) ? "failover" : "quarantine", BACKEND_INFO(node_id).backend_hostname, BACKEND_INFO(node_id).backend_port))); } need_to_restart_pcp = true; } switching = 0; Req_info->switching = false; /* * kick wakeup_handler in pcp_child to notice that failover/failback done */ kill(pcp_pid, SIGUSR2); if (need_to_restart_pcp) { sleep(1); /* * Send restart request to pcp child. */ kill(pcp_pid, SIGUSR1); for (;;) { sts = waitpid(pcp_pid, &status, 0); if (sts != -1) break; if (errno == EINTR) continue; else { ereport(WARNING, (errmsg("failover: waitpid failed. reason: %s", strerror(errno)))); continue; } } if (WIFSIGNALED(status)) ereport(LOG, (errmsg("PCP child %d exits with status %d by signal %d in failover()", pcp_pid, status, WTERMSIG(status)))); else ereport(LOG, (errmsg("PCP child %d exits with status %d in failover()", pcp_pid, status))); pcp_pid = pcp_fork_a_child(pcp_unix_fd, pcp_inet_fd, pcp_conf_file); ereport(LOG, (errmsg("fork a new PCP child pid %d in failover()", pcp_pid))); } } #ifdef NOT_USED /* * health check timer handler */ static RETSIGTYPE health_check_timer_handler(int sig) { int save_errno = errno; POOL_SETMASK(&BlockSig); health_check_timer_expired = 1; POOL_SETMASK(&UnBlockSig); errno = save_errno; } /* * do_health_check() performs the health check on all backend nodes. * The inout parameter health_check_node_id is the starting backend * node number for health check and when the function returns or * exits with an error health_check_node_id contains the value * of last backend node number on which health check was performed. * * Function returns false if all backend nodes are down and true if all * backend nodes are in healthy state */ static bool do_health_check(bool use_template_db, volatile int *health_check_node_id) { POOL_CONNECTION_POOL_SLOT *slot; BackendInfo *bkinfo; static char *dbname; int i; bool all_nodes_healthy = false; char *password = get_pgpool_config_user_password(pool_config->health_check_user, pool_config->health_check_password); /* Do not execute health check during recovery */ if (*InRecovery) return false; if (!strcmp(pool_config->health_check_database, "")) dbname = use_template_db ? "template1" : "postgres"; else dbname = pool_config->health_check_database; ereport(DEBUG1, (errmsg("doing health check against database:%s user:%s", dbname, pool_config->health_check_user))); /* * Start checking the backed nodes starting from the previously failed * node */ for (i = *health_check_node_id; i < pool_config->backend_desc->num_backends; i++) { *health_check_node_id = i; /* * Make sure that health check timer has not been expired. Before * called health_check(), health_check_timer_expired is set to 0. * However it is possible that while processing DB nodes health check * timer expired. */ if (health_check_timer_expired) { ereport(ERROR, (errmsg("health check timer has been already expired before attempting to connect backend node %d", i))); } bkinfo = pool_get_node_info(i); ereport(DEBUG1, (errmsg("Backend DB node %d status is %d", i, bkinfo->backend_status))); if (bkinfo->backend_status == CON_UNUSED || bkinfo->backend_status == CON_DOWN) continue; all_nodes_healthy = true; ereport(DEBUG1, (errmsg("Trying to make persistent DB connection to backend node %d having status %d", i, bkinfo->backend_status))); slot = make_persistent_db_connection(i, bkinfo->backend_hostname, bkinfo->backend_port, dbname, pool_config->health_check_user, password ? password : "", false); ereport(DEBUG1, (errmsg("persistent DB connection to backend node %d having status %d is successful", i, bkinfo->backend_status))); discard_persistent_db_connection(slot); } if (password) pfree(password); return all_nodes_healthy; } #endif /* * handle SIGCHLD */ static RETSIGTYPE reap_handler(int sig) { int save_errno = errno; POOL_SETMASK(&BlockSig); sigchld_request = 1; if (pipe_fds[1]) { dummy_status = write(pipe_fds[1], "\0", 1); } #ifdef NOT_USED if (pipe_fds[1] && write(pipe_fds[1], "\0", 1) < 0) ereport(WARNING, (errmsg("reap_handler: write to pipe failed with error \"%s\"", strerror(errno)))); #endif POOL_SETMASK(&UnBlockSig); errno = save_errno; } /* * pool_waitpid: * nothing more than a wrapper function over NOHANG mode waitpid() or wait3() * depending on the existance of waitpid in the system */ pid_t pool_waitpid(int *status) { #ifdef HAVE_WAITPID return waitpid(-1, status, WNOHANG); #else return wait3(status, WNOHANG, NULL); #endif } /* * process_name_from_pid() * helper function for reaper() to report the terminating child process type name */ static char * process_name_from_pid(pid_t pid) { if (pid == pcp_pid) return "PCP child"; if (pid == worker_pid) return "worker child"; if (pool_config->use_watchdog) { if (pid == watchdog_pid) return "watchdog child"; else if (pid == wd_lifecheck_pid) return "watchdog lifecheck"; } return "child"; } /* * Attach zombie processes and restart child processes. * reaper() must be called protected from signals. * Note: * In pgpool child can exit in two ways, either by some signal or by * calling exit() system function. * For the case of child terminating due to a signal the reaper() function * always forks a new respective type of child process. But for the case when * child got terminated by exit() system call than the function checks the exit * code and if the child was exited by POOL_EXIT_FATAL than we do not restarts the * terminating child but shutdowns the pgpool-II. This allow * the child process to inform parent process of fatal failures which needs * to be rectified (e.g startup failure) by user for smooth running of system. * Also the child exits with success status POOL_EXIT_NO_RESTART does not gets * restarted. */ static void reaper(void) { pid_t pid; int status; int i; ereport(DEBUG1, (errmsg("reaper handler"))); if (exiting) { ereport(DEBUG1, (errmsg("reaper handler: exited because already in exiting mode"))); return; } if (switching) { ereport(DEBUG1, (errmsg("reaper handler: exited due to switching"))); return; } /* clear SIGCHLD request */ sigchld_request = 0; while ((pid = pool_waitpid(&status)) > 0) { pid_t new_pid = 0; bool shutdown_system = false; bool restart_child = true; bool found = false; char *exiting_process_name = process_name_from_pid(pid); /* * Check if the terminating child wants pgpool main to go down with it */ if (WIFEXITED(status)) { if (WEXITSTATUS(status) == POOL_EXIT_FATAL) { ereport(DEBUG1, (errmsg("%s process with pid: %d exit with FATAL ERROR. pgpool-II will be shutdown", exiting_process_name, pid))); shutdown_system = true; } else if (WEXITSTATUS(status) == POOL_EXIT_NO_RESTART) { ereport(DEBUG1, (errmsg("%s process with pid: %d exit with SUCCESS. child will not be restarted", exiting_process_name, pid))); restart_child = false; } } if (WIFSIGNALED(status)) { /* Child terminated by segmentation fault. Report it */ if (WTERMSIG(status) == SIGSEGV) ereport(WARNING, (errmsg("%s process with pid: %d was terminated by segmentation fault", exiting_process_name, pid))); else ereport(LOG, (errmsg("%s process with pid: %d exits with status %d by signal %d", exiting_process_name, pid, status, WTERMSIG(status)))); /* * If the watchdog process was terminated abonormally. we need to * set the cleanup flag so that the new watchdog process can start * without problems */ if (pool_config->use_watchdog && pid == watchdog_pid) { set_watchdog_process_needs_cleanup(); } } else ereport(LOG, (errmsg("%s process with pid: %d exits with status %d", exiting_process_name, pid, status))); /* if exiting child process was PCP handler */ if (pid == pcp_pid) { found = true; if (restart_child) { pcp_pid = pcp_fork_a_child(pcp_unix_fd, pcp_inet_fd, pcp_conf_file); new_pid = pcp_pid; } else pcp_pid = 0; } /* exiting process was worker process */ else if (pid == worker_pid) { found = true; if (restart_child) { worker_pid = worker_fork_a_child(PT_WORKER, do_worker_child, NULL); new_pid = worker_pid; } else worker_pid = 0; } /* exiting process was watchdog process */ else if (pool_config->use_watchdog) { if (watchdog_pid == pid) { found = true; if (restart_child) { watchdog_pid = initialize_watchdog(); new_pid = watchdog_pid; } else watchdog_pid = 0; } else if (wd_lifecheck_pid == pid) { found = true; if (restart_child) { wd_lifecheck_pid = initialize_watchdog_lifecheck(); new_pid = wd_lifecheck_pid; } else wd_lifecheck_pid = 0; } } /* * we are not able to identify the exiting process yet. check if the * exiting process was child process (handling PG clients) */ if (found == false) { /* look for exiting child's pid */ for (i = 0; i < pool_config->num_init_children; i++) { if (pid == process_info[i].pid) { found = true; /* if found, fork a new child */ if (!switching && !exiting && restart_child) { process_info[i].pid = fork_a_child(fds, i); process_info[i].start_time = time(NULL); new_pid = process_info[i].pid; } else process_info[i].pid = 0; break; } } } /* Check health check process */ if (found == false) { for (i = 0; i < NUM_BACKENDS; i++) { if (pid == health_check_pids[i]) { found = true; /* Fork new health check worker */ if (!switching && !exiting && VALID_BACKEND(i)) { health_check_pids[i] = worker_fork_a_child(PT_HEALTH_CHECK, do_health_check_child, &i); } else health_check_pids[i] = 0; } } } if (shutdown_system) ereport(FATAL, (errmsg("%s process exit with fatal error. exiting pgpool-II", exiting_process_name))); else if (restart_child && new_pid) { /* Report if the child was restarted */ ereport(LOG, (errmsg("fork a new %s process with pid: %d", exiting_process_name, new_pid))); } else { /* And the child was not restarted */ ereport(LOG, (errmsg("%s process with pid: %d exited with success and will not be restarted", exiting_process_name, pid))); } } ereport(DEBUG1, (errmsg("reaper handler: exiting normally"))); } /* * get node information specified by node_number */ BackendInfo * pool_get_node_info(int node_number) { if (node_number < 0 || node_number >= NUM_BACKENDS) return NULL; return &BACKEND_INFO(node_number); } /* * get number of nodes */ int pool_get_node_count(void) { return NUM_BACKENDS; } /* * get process ids */ int * pool_get_process_list(int *array_size) { int *array; int i; *array_size = pool_config->num_init_children; array = palloc0(*array_size * sizeof(int)); for (i = 0; i < *array_size; i++) array[i] = process_info[i].pid; return array; } /* * get process information specified by pid */ ProcessInfo * pool_get_process_info(pid_t pid) { int i; for (i = 0; i < pool_config->num_init_children; i++) if (process_info[i].pid == pid) return &process_info[i]; return NULL; } /* * handle SIGUSR2 * Wakeup all processes */ static void wakeup_children(void) { kill_all_children(SIGUSR2); } static RETSIGTYPE wakeup_handler(int sig) { int save_errno = errno; wakeup_request = 1; if (processState != INITIALIZING) { POOL_SETMASK(&BlockSig); dummy_status = write(pipe_fds[1], "\0", 1); #ifdef NOT_USED if (write(pipe_fds[1], "\0", 1) < 0) ereport(WARNING, (errmsg("wakeup_handler: write to pipe failed with error \"%s\"", strerror(errno)))); #endif POOL_SETMASK(&UnBlockSig); } errno = save_errno; } /* * handle SIGHUP * */ static RETSIGTYPE reload_config_handler(int sig) { int save_errno = errno; POOL_SETMASK(&BlockSig); reload_config_request = 1; dummy_status = write(pipe_fds[1], "\0", 1); #ifdef NOT_USED if (write(pipe_fds[1], "\0", 1) < 0) ereport(WARNING, (errmsg("reload_config_handler: write to pipe failed with error \"%s\"", strerror(errno)))); #endif POOL_SETMASK(&UnBlockSig); errno = save_errno; } static void kill_all_children(int sig) { int i; if (process_info) { /* kill all children */ for (i = 0; i < pool_config->num_init_children; i++) { pid_t pid = process_info[i].pid; if (pid) { kill(pid, sig); } } } /* make PCP process reload as well */ if (sig == SIGHUP && pcp_pid > 0) kill(pcp_pid, sig); /* make health check process reload as well */ if (sig == SIGHUP) { for (i = 0; i < NUM_BACKENDS; i++) { if (health_check_pids[i] > 0) kill(health_check_pids[i], sig); } } } /* * pause in a period specified by timeout. If any data is coming * through pipe_fds[0], that means one of: failover request(SIGUSR1), * SIGCHLD received, children wake up request(SIGUSR2 used in on line * recovery processing) or config file reload request(SIGHUP) has been * occurred. In this case this function returns 1. * otherwise 0: (no signal event occurred), -1: (error) * XXX: is it OK that select(2) error is ignored here? */ static int pool_pause(struct timeval *timeout) { fd_set rfds; int n; char dummy; FD_ZERO(&rfds); FD_SET(pipe_fds[0], &rfds); n = select(pipe_fds[0] + 1, &rfds, NULL, NULL, timeout); if (n == 1) { if (read(pipe_fds[0], &dummy, 1) < 0) ereport(WARNING, (errmsg("pool_pause: read on pipe failed with error \"%s\"", strerror(errno)))); } return n; } /* * sleep for seconds specified by "second". Unlike pool_pause(), this * function guarantees that it will sleep for specified seconds. This * function uses pool_pause() internally. If it informs that there is * a pending signal event, they are processed using CHECK_REQUEST * macro. Note that most of these processes are done while all signals * are blocked. */ void pool_sleep(unsigned int second) { struct timeval current_time, sleep_time; gettimeofday(¤t_time, NULL); sleep_time.tv_sec = second + current_time.tv_sec; sleep_time.tv_usec = current_time.tv_usec; POOL_SETMASK(&UnBlockSig); while (sleep_time.tv_sec > current_time.tv_sec) { struct timeval timeout; int r; timeout.tv_sec = sleep_time.tv_sec - current_time.tv_sec; timeout.tv_usec = sleep_time.tv_usec - current_time.tv_usec; if (timeout.tv_usec < 0) { timeout.tv_sec--; timeout.tv_usec += 1000000; } r = pool_pause(&timeout); POOL_SETMASK(&BlockSig); if (r > 0) CHECK_REQUEST; POOL_SETMASK(&UnBlockSig); gettimeofday(¤t_time, NULL); } POOL_SETMASK(&BlockSig); } /* * trigger_failover_command: execute specified command at failover. * command_line is null-terminated string. */ static int trigger_failover_command(int node, const char *command_line, int old_master, int new_master, int old_primary) { int r = 0; String *exec_cmd; char port_buf[6]; char buf[2]; BackendInfo *info; BackendInfo *newmaster; BackendInfo *oldprimary; if (command_line == NULL || (strlen(command_line) == 0)) return 0; /* check failed nodeID */ if (node < 0 || node >= NUM_BACKENDS) return -1; info = pool_get_node_info(node); if (!info) return -1; buf[1] = '\0'; exec_cmd = init_string(""); while (*command_line) { if (*command_line == '%') { if (*(command_line + 1)) { char val = *(command_line + 1); switch (val) { case 'p': /* failed node port */ snprintf(port_buf, sizeof(port_buf), "%d", info->backend_port); string_append_char(exec_cmd, port_buf); break; case 'D': /* failed node database directory */ string_append_char(exec_cmd, info->backend_data_directory); break; case 'd': /* failed node id */ snprintf(port_buf, sizeof(port_buf), "%d", node); string_append_char(exec_cmd, port_buf); break; case 'h': /* failed host name */ string_append_char(exec_cmd, info->backend_hostname); break; case 'H': /* new master host name */ newmaster = pool_get_node_info(new_master); if (newmaster) string_append_char(exec_cmd, newmaster->backend_hostname); else /* no valid new master */ string_append_char(exec_cmd, "\"\""); break; case 'm': /* new master node id */ snprintf(port_buf, sizeof(port_buf), "%d", new_master); string_append_char(exec_cmd, port_buf); break; case 'r': /* new master port */ newmaster = pool_get_node_info(get_next_master_node()); if (newmaster) { snprintf(port_buf, sizeof(port_buf), "%d", newmaster->backend_port); string_append_char(exec_cmd, port_buf); } else /* no valid new master */ string_append_char(exec_cmd, "\"\""); break; case 'R': /* new master database directory */ newmaster = pool_get_node_info(get_next_master_node()); if (newmaster) string_append_char(exec_cmd, newmaster->backend_data_directory); else /* no valid new master */ string_append_char(exec_cmd, "\"\""); break; case 'M': /* old master node id */ snprintf(port_buf, sizeof(port_buf), "%d", old_master); string_append_char(exec_cmd, port_buf); break; case 'P': /* old primary node id */ snprintf(port_buf, sizeof(port_buf), "%d", old_primary); string_append_char(exec_cmd, port_buf); break; case 'N': /* old primary host name */ oldprimary = pool_get_node_info(old_primary); string_append_char(exec_cmd, oldprimary->backend_hostname); break; case 'S': /* old primary port */ oldprimary = pool_get_node_info(old_primary); snprintf(port_buf, sizeof(port_buf), "%d", oldprimary->backend_port); string_append_char(exec_cmd, port_buf); break; case '%': /* escape */ string_append_char(exec_cmd, "%"); break; default: /* ignore */ break; } command_line++; } } else { buf[0] = *command_line; string_append_char(exec_cmd, buf); } command_line++; } if (strlen(exec_cmd->data) != 0) { ereport(LOG, (errmsg("execute command: %s", exec_cmd->data))); r = system(exec_cmd->data); } free_string(exec_cmd); return r; } /* * This function is used by find_primary_node(). Find primary node/standby * node and returns static array of status for each backend node. This * function must not throw ERROR or FATAL. */ static POOL_NODE_STATUS pool_node_status[MAX_NUM_BACKENDS]; POOL_NODE_STATUS * verify_backend_node_status(POOL_CONNECTION_POOL_SLOT * *slots) { POOL_SELECT_RESULT *res; int num_primaries = 0; int num_standbys = 0; int i, j; BackendInfo *backend_info; for (i = 0; i < NUM_BACKENDS; i++) { pool_node_status[i] = POOL_NODE_STATUS_UNUSED; if (!VALID_BACKEND(i)) continue; if (!slots[i]) continue; if (get_query_result(slots, i, "SELECT pg_is_in_recovery()", &res)) { continue; } get_server_version(slots, i); if (res->data[0] && !strcmp(res->data[0], "t")) { /* Possibly standby */ pool_node_status[i] = POOL_NODE_STATUS_STANDBY; num_standbys++; } else if (res->data[0] && !strcmp(res->data[0], "f")) { /* Possibly primary */ pool_node_status[i] = POOL_NODE_STATUS_PRIMARY; num_primaries++; } free_select_result(res); } /* * If there's no primary node, there's no point to run additional * testings. */ if (num_primaries == 0) { ereport(DEBUG1, (errmsg("verify_backend_node_status: there's no primary node"))); return pool_node_status; } /* * There's no standby node. */ if (num_standbys == 0) { if (num_primaries == 1) { /* * If there's only one primary node and there's no standby, * there's no point to run additional testings. */ ereport(DEBUG1, (errmsg("verify_backend_node_status: there's no standby node"))); return pool_node_status; } else { /* * There are multiple primaries and there's no standby node. * There's no way to decide which one is correct. We just leave * the youngest primary node and detach rests if allowed. */ for (i = 0; i < NUM_BACKENDS; i++) { if (pool_node_status[i] == POOL_NODE_STATUS_PRIMARY) { ereport(DEBUG1, (errmsg("verify_backend_node_status: decided node %d is the true primary", i))); i++; for (; i < NUM_BACKENDS; i++) { if (pool_node_status[i] == POOL_NODE_STATUS_PRIMARY) { if (pool_config->detach_false_primary) { ereport(DEBUG1, (errmsg("verify_backend_node_status: node %d is a false primary", i))); pool_node_status[i] = POOL_NODE_STATUS_INVALID; } else pool_node_status[i] = POOL_NODE_STATUS_UNUSED; } } } } } return pool_node_status; } /* * There are multiple standbys */ else { bool check_connectivity = false; int wal_receiver_status = 0; int wal_receiver_conninfo = 1; char host[1024]; char port[1024]; int primary[MAX_NUM_BACKENDS]; int true_primary = -1; ereport(DEBUG1, (errmsg("verify_backend_node_status: multiple standbys: %d", num_standbys))); if (!pool_config->detach_false_primary) { ereport(DEBUG1, (errmsg("verify_backend_node_status: detach_false_primary is off and no additional checking is performed"))); return pool_node_status; } /* * Check connectivity between primary and standby by using * pg_stat_wal_receiver (only >= 9.6.0) if there's more than or equal * to 1 primary. */ for (i = 0; i < NUM_BACKENDS; i++) { if (!VALID_BACKEND(i)) continue; if (get_server_version(slots, i) >= 90600) { check_connectivity = true; break; } } if (!check_connectivity) { ereport(DEBUG1, (errmsg("verify_backend_node_status: server verion is lower than 9.6.0. Skipping connectivity checks"))); return pool_node_status; } ereport(DEBUG1, (errmsg("verify_backend_node_status: checking connectivity"))); for (i = 0; i < NUM_BACKENDS; i++) { primary[i] = 0; if (!VALID_BACKEND(i)) continue; if (pool_node_status[i] == POOL_NODE_STATUS_PRIMARY) { ereport(DEBUG1, (errmsg("verify_backend_node_status: %d is primary", i))); for (j = 0; j < NUM_BACKENDS; j++) { if (pool_node_status[j] == POOL_NODE_STATUS_STANDBY) { ereport(DEBUG1, (errmsg("verify_backend_node_status: %d is standby", j))); if (get_query_result(slots, j, "SELECT status, conninfo FROM pg_stat_wal_receiver", &res)) { ereport(DEBUG1, (errmsg("verify_backend_node_status: call pg_stat_wal_receiver to standby %d failed", j))); continue; } if (res->numrows <= 0) { ereport(DEBUG1, (errmsg("verify_backend_node_status: pg_stat_wal_receiver returned no row. standby %d", j))); free_select_result(res); continue; } if (res->nullflags[wal_receiver_status] == -1) { ereport(DEBUG1, (errmsg("verify_backend_node_status: pg_stat_wal_receiver status for standby %d is NULL", j))); free_select_result(res); continue; } if (strcmp(res->data[wal_receiver_status], "streaming")) { ereport(DEBUG1, (errmsg("verify_backend_node_status: pg_stat_wal_receiver status is not \"streaming\" for standby %d (%s)", j, res->data[wal_receiver_status]))); free_select_result(res); continue; } if (res->nullflags[wal_receiver_conninfo] == -1) { ereport(DEBUG1, (errmsg("verify_backend_node_status: pg_stat_wal_receiver conninfo for standby %d is NULL", j))); continue; } get_info_from_conninfo(res->data[wal_receiver_conninfo], host, port); ereport(DEBUG1, (errmsg("verify_backend_node_status: conninfo for standby %d is === %s ===. host:%s port:%s", j, res->data[wal_receiver_conninfo], host, port))); free_select_result(res); /* get primary backend info */ backend_info = pool_get_node_info(i); /* verify host and port */ if (((*backend_info->backend_hostname == '/' && *host == '\0') || !strcmp(backend_info->backend_hostname, host)) && backend_info->backend_port == atoi(port)) { /* the standby connects to the primary */ primary[i]++; if (primary[i] == num_standbys) true_primary = i; } else { /* the standby does not connect to the primary */ ereport(LOG, (errmsg("verify_backend_node_status: primary %d does not connect to standby %d", i, j))); } } } } } /* * Check if each primary connected standbys. If all standbys connect * to one of primaries, then the primary is good. Other primaries are * false. If none of primaries does not own all connected standbys, * we cannot judge which primary is good. */ for (i = 0; i < NUM_BACKENDS; i++) { ereport(DEBUG1, (errmsg("verify_backend_node_status: primary %d owns %d standbys out of %d", i, primary[i], num_standbys))); ereport(DEBUG1, (errmsg("verify_backend_node_status: true_primary %d", true_primary))); if (pool_node_status[i] == POOL_NODE_STATUS_PRIMARY && primary[i] >= 0) { if (primary[i] < num_standbys) { ereport(LOG, (errmsg("verify_backend_node_status: primary %d owns only %d standbys out of %d", i, primary[i], num_standbys))); /* * If the good primary exists and detach_false_primary is * true, then ask to detach the false primary */ if (true_primary >= 0 && pool_config->detach_false_primary) pool_node_status[i] = POOL_NODE_STATUS_INVALID; } } } } return pool_node_status; } POOL_NODE_STATUS * pool_get_node_status(void) { return pool_node_status; } /* * Find the primary node (i.e. not standby node) and returns its node * id. If no primary node is found, returns -1. */ static int find_primary_node(void) { BackendInfo *bkinfo; POOL_CONNECTION_POOL_SLOT *slots[MAX_NUM_BACKENDS]; int i; POOL_NODE_STATUS *status; int primary = -1; char *password = NULL; /* Streaming replication mode? */ if (!SL_MODE) { /* * No point to look for primary node if not in streaming replication * mode. */ ereport(DEBUG1, (errmsg("find_primary_node: not in streaming replication mode"))); return -1; } /* * First check for "ALWAYS_MASTER" flags exists. If so, do not perform * actual primary node check and just returns the node id. */ for (i = 0; i < NUM_BACKENDS; i++) { if (POOL_ALWAYS_MASTER & BACKEND_INFO(i).flag) { ereport(DEBUG1, (errmsg("find_primary_node: ALWAYS_MASTER flag found. Returns node id: %d", i))); return i; } } password = get_pgpool_config_user_password(pool_config->sr_check_user, pool_config->sr_check_password); /* * Establish connections to backend */ for (i = 0; i < NUM_BACKENDS; i++) { slots[i] = NULL; if (!VALID_BACKEND(i)) continue; bkinfo = pool_get_node_info(i); slots[i] = make_persistent_db_connection_noerror(i, bkinfo->backend_hostname, bkinfo->backend_port, pool_config->sr_check_database, pool_config->sr_check_user, password ? password : "", true); if (!slots[i]) { ereport(LOG, (errmsg("find_primary_node: make_persistent_db_connection_noerror failed on node %d", i))); } } if (password) pfree(password); /* Verify backend status */ status = verify_backend_node_status(slots); for (i = 0; i < NUM_BACKENDS; i++) { if (status[i] == POOL_NODE_STATUS_PRIMARY) { /* This is the primary */ ereport(LOG, (errmsg("find_primary_node: primary node is %d", i))); primary = i; } else if (status[i] == POOL_NODE_STATUS_STANDBY) { ereport(LOG, (errmsg("find_primary_node: standby node is %d", i))); } else if (status[i] == POOL_NODE_STATUS_INVALID) { /* Split brain or invalid node */ ereport(LOG, (errmsg("find_primary_node: invalid node %d", i))); } } for (i = 0; i < NUM_BACKENDS; i++) { if (slots[i]) discard_persistent_db_connection(slots[i]); } return primary; } static int find_primary_node_repeatedly(void) { int sec; int node_id = -1; int i; /* Streaming replication mode? */ if (!SL_MODE) { /* * No point to look for primary node if not in streaming replication * mode. */ ereport(DEBUG1, (errmsg("find_primary_node_repeatedly: not in streaming replication mode"))); return -1; } /* * If all of the backends are down, there's no point to keep on searching * primary node. */ for (i = 0; i < NUM_BACKENDS; i++) { if (VALID_BACKEND(i)) break; } if (i == NUM_BACKENDS) { ereport(LOG, (errmsg("find_primary_node_repeatedly: all of the backends are down. Giving up finding primary node"))); return -1; } /* * Try to find the new primary node and keep trying for * search_primary_node_timeout seconds. search_primary_node_timeout = 0 * means never timeout and keep searching indefinitely */ ereport(LOG, (errmsg("find_primary_node_repeatedly: waiting for finding a primary node"))); for (sec = 0; (pool_config->search_primary_node_timeout == 0 || sec < pool_config->search_primary_node_timeout); sec++) { node_id = find_primary_node(); if (node_id != -1) break; pool_sleep(1); } return node_id; } /* * fork a follow child */ pid_t fork_follow_child(int old_master, int new_primary, int old_primary) { pid_t pid; int i; pid = fork(); if (pid == 0) { on_exit_reset(); processType = PT_FOLLOWCHILD; ereport(LOG, (errmsg("start triggering follow command."))); for (i = 0; i < pool_config->backend_desc->num_backends; i++) { BackendInfo *bkinfo; bkinfo = pool_get_node_info(i); if (bkinfo->backend_status == CON_DOWN) trigger_failover_command(i, pool_config->follow_master_command, old_master, new_primary, old_primary); } exit(0); } else if (pid == -1) { ereport(WARNING, (errmsg("follow fork() failed with reason: \"%s\"", strerror(errno)))); exit(1); } return pid; } static void initialize_shared_mem_objects(bool clear_memcache_oidmaps) { int size, i; /* * con_info is a 3 dimension array: i corresponds to pgpool child process, * j corresponds to connection pool in each process and k corresponds to * backends in each connection pool. * * XXX: Before 2010/4/12 this was a 2 dimension array: i corresponds to * pgpool child process, j corresponds to connection pool in each process. * Of course this was wrong. */ size = pool_coninfo_size(); con_info = pool_shared_memory_create(size); memset(con_info, 0, size); size = pool_config->num_init_children * (sizeof(ProcessInfo)); ereport(DEBUG1, (errmsg("ProcessInfo: num_init_children (%d) * sizeof(ProcessInfo) (%zu) = %d bytes requested for shared memory", pool_config->num_init_children, sizeof(ProcessInfo), size))); process_info = pool_shared_memory_create(size); memset(process_info, 0, size); for (i = 0; i < pool_config->num_init_children; i++) { process_info[i].connection_info = pool_coninfo(i, 0, 0); } user1SignalSlot = pool_shared_memory_create(sizeof(User1SignalSlot)); /* create fail over/switch over event area */ Req_info = pool_shared_memory_create(sizeof(POOL_REQUEST_INFO)); ereport(DEBUG1, (errmsg("Request info are: sizeof(POOL_REQUEST_INFO) %zu bytes requested for shared memory", sizeof(POOL_REQUEST_INFO)))); /* * Initialize backend status area. From now on, VALID_BACKEND macro can be * used. (get_next_master_node() uses VALID_BACKEND) */ for (i = 0; i < MAX_NUM_BACKENDS; i++) { my_backend_status[i] = &(BACKEND_INFO(i).backend_status); } /* initialize Req_info */ Req_info->master_node_id = get_next_master_node(); Req_info->conn_counter = 0; Req_info->switching = false; Req_info->request_queue_head = Req_info->request_queue_tail = -1; Req_info->primary_node_id = -2; InRecovery = pool_shared_memory_create(sizeof(int)); *InRecovery = RECOVERY_INIT; ereport(DEBUG1, (errmsg("Recovery management area: sizeof(int) %zu bytes requested for shared memory", sizeof(int)))); /* * Initialize shared memory cache */ if (pool_config->memory_cache_enabled || pool_config->enable_shared_relcache) { if (pool_is_shmem_cache()) { size_t size; size = pool_shared_memory_cache_size(); pool_init_memory_cache(size); size = pool_shared_memory_fsmm_size(); if (size == 0) ereport(FATAL, (errmsg("invalid shared memory size"), errdetail("pool_shared_memory_fsmm_size error"))); pool_init_fsmm(size); pool_allocate_fsmm_clock_hand(); pool_discard_oid_maps(); ereport(LOG, (errmsg("pool_discard_oid_maps: discarded memqcache oid maps"))); pool_hash_init(pool_config->memqcache_max_num_cache); } #ifdef USE_MEMCACHED else { if (clear_memcache_oidmaps) { pool_discard_oid_maps(); ereport(LOG, (errmsg("discarded memqcache oid maps"))); } else { ereport(DEBUG1, (errmsg("skipped discarding memqcache oid maps"))); } } #endif pool_init_memqcache_stats(); } /* Initialize statistics area */ stat_set_stat_area(pool_shared_memory_create(stat_shared_memory_size())); stat_init_stat_area(); /* initialize watchdog IPC unix domain socket address */ if (pool_config->use_watchdog) { wd_ipc_initialize_data(); } } /* * Read the status file */ static int read_status_file(bool discard_status) { FILE *fd; char fnamebuf[POOLMAXPATHLEN]; int i; bool someone_wakeup = false; bool is_old_format; /* * Set backend status changed timestamp so that it is set even if there's * no status file or discard status option is specified. */ for (i = 0; i < MAX_NUM_BACKENDS; i++) { pool_set_backend_status_changed_time(i); } snprintf(fnamebuf, sizeof(fnamebuf), "%s/%s", pool_config->logdir, STATUS_FILE_NAME); fd = fopen(fnamebuf, "r"); if (!fd) { ereport(LOG, (errmsg("Backend status file %s does not exist", fnamebuf))); return -1; } /* * If discard_status is true, unlink pgpool_status and do not restore * previous status. */ if (discard_status) { fclose(fd); if (unlink(fnamebuf) == 0) ereport(LOG, (errmsg("Backend status file %s discarded", fnamebuf))); else ereport(WARNING, (errmsg("failed to discard backend status file: \"%s\" with reason: \"%s\"", fnamebuf, strerror(errno)))); return 0; } /* * Frist try out with old format file. */ is_old_format = true; if (fread(&backend_rec, 1, sizeof(backend_rec), fd) == sizeof(backend_rec)) { /* It's likely old binary format status file */ for (i = 0; i < pool_config->backend_desc->num_backends; i++) { if (backend_rec.status[i] == CON_DOWN) { BACKEND_INFO(i).backend_status = CON_DOWN; pool_set_backend_status_changed_time(i); (void) write_status_file(); ereport(LOG, (errmsg("read_status_file: %d th backend is set to down status", i))); } else if (backend_rec.status[i] == CON_CONNECT_WAIT || backend_rec.status[i] == CON_UP) { BACKEND_INFO(i).backend_status = CON_CONNECT_WAIT; pool_set_backend_status_changed_time(i); (void) write_status_file(); someone_wakeup = true; } else { /* It seems it's not an old binary format status file */ is_old_format = false; break; } } } else is_old_format = false; fclose(fd); if (!is_old_format) { /* * Fall back to new ascii format file. the format looks like(case is * ignored): * * up|down|unused UP|down|unused : : */ #define MAXLINE 10 char readbuf[MAXLINE]; fd = fopen(fnamebuf, "r"); if (!fd) { ereport(LOG, (errmsg("Backend status file %s does not exist", fnamebuf))); return -1; } for (i = 0; i < MAX_NUM_BACKENDS; i++) { BACKEND_INFO(i).backend_status = CON_UNUSED; pool_set_backend_status_changed_time(i); } for (i = 0;; i++) { readbuf[MAXLINE - 1] = '\0'; if (fgets(readbuf, MAXLINE - 1, fd) == 0) break; if (!strncasecmp("up", readbuf, 2)) { BACKEND_INFO(i).backend_status = CON_UP; someone_wakeup = true; } else if (!strncasecmp("down", readbuf, 4)) { BACKEND_INFO(i).backend_status = CON_DOWN; pool_set_backend_status_changed_time(i); ereport(LOG, (errmsg("reading status file: %d th backend is set to down status", i))); } else if (!strncasecmp("unused", readbuf, 6)) { BACKEND_INFO(i).backend_status = CON_UNUSED; pool_set_backend_status_changed_time(i); } else { ereport(WARNING, (errmsg("invalid data in status file, ignoring..."), errdetail("backend:%d status is invalid: \"%s\"", i, readbuf))); } } fclose(fd); } /* * If no one woke up, we regard the status file bogus */ if (someone_wakeup == false) { for (i = 0; i < pool_config->backend_desc->num_backends; i++) { BACKEND_INFO(i).backend_status = CON_CONNECT_WAIT; pool_set_backend_status_changed_time(i); } (void) write_status_file(); } return 0; } /* * Write the status file */ int write_status_file(void) { FILE *fd; int fdnum; char fnamebuf[POOLMAXPATHLEN]; char buf[10]; int i; if (!pool_config) { ereport(WARNING, (errmsg("pool_config is not set"))); return 0; } /* * Check to see if all nodes are down status. If so, skip writing status * file. So pgpool_status will always reflect the last set of nodes to * which any data was written. Upon restart, if the up-to-date (previously * "up") node is in fact down (regardless of whether the stale ("down") * node is back up), pgpool will detect this in its health check and will * fail; if the up-to-date (previously "up") node is back up, then pgpool * will commence using it. * * See [pgpool-general: 4721] for more discussion. */ for (i = 0; i < pool_config->backend_desc->num_backends; i++) { if (BACKEND_INFO(i).backend_status != CON_DOWN) break; } if (i && i == pool_config->backend_desc->num_backends) { ereport(WARNING, (errmsg("All the DB nodes are in down status and skip writing status file."))); return 0; } snprintf(fnamebuf, sizeof(fnamebuf), "%s/%s", pool_config->logdir, STATUS_FILE_NAME); fd = fopen(fnamebuf, "w"); if (!fd) { ereport(WARNING, (errmsg("failed to open status file at: \"%s\"", fnamebuf), errdetail("\"%s\"", strerror(errno)))); return -1; } for (i = 0; i < pool_config->backend_desc->num_backends; i++) { char *status; if (BACKEND_INFO(i).backend_status == CON_UP || BACKEND_INFO(i).backend_status == CON_CONNECT_WAIT) status = "up"; else if (BACKEND_INFO(i).backend_status == CON_DOWN) status = "down"; else status = "unused"; sprintf(buf, "%s\n", status); if (fwrite(buf, 1, strlen(buf), fd) != strlen(buf)) { ereport(WARNING, (errmsg("failed to write status file at: \"%s\"", fnamebuf), errdetail("\"%s\"", strerror(errno)))); fclose(fd); return -1; } } if (fflush(fd) != 0) { ereport(WARNING, (errmsg("failed to write status file at: \"%s\"", fnamebuf), errdetail("\"%s\"", strerror(errno)))); fclose(fd); return -1; } fdnum = fileno(fd); if (fdnum < 0) { ereport(WARNING, (errmsg("failed to get file number. fsync() will not be performed: \"%s\"", fnamebuf), errdetail("\"%s\"", strerror(errno)))); fclose(fd); return -1; } if (fsync(fdnum) != 0) { ereport(WARNING, (errmsg("failed to fsync(): \"%s\"", fnamebuf), errdetail("\"%s\"", strerror(errno)))); fclose(fd); return -1; } fclose(fd); return 0; } static void reload_config(void) { ereport(LOG, (errmsg("reload config files."))); MemoryContext oldContext = MemoryContextSwitchTo(TopMemoryContext); pool_get_config(conf_file, CFGCXT_RELOAD); /* Realoading config file could change backend status */ (void) write_status_file(); MemoryContextSwitchTo(oldContext); if (pool_config->enable_pool_hba) load_hba(hba_file); kill_all_children(SIGHUP); if (worker_pid) kill(worker_pid, SIGHUP); } /* Call back function to unlink the file */ static void FileUnlink(int code, Datum path) { char *filePath = (char *) path; if (unlink(filePath) == 0) return; /* * We are already exiting the system just produce a log entry to report an * error */ ereport(LOG, (errmsg("unlink failed for file at path \"%s\"", filePath), errdetail("%s", strerror(errno)))); } static void system_will_go_down(int code, Datum arg) { if (mypid != getpid()) { /* should never happen */ ereport(LOG, (errmsg("system_will_go_down called from invalid process"))); return; } POOL_SETMASK(&AuthBlockSig); /* Write status file */ (void) write_status_file(); /* * Terminate all childrens. But we may already have killed all the * childrens if we come to this function because of shutdown signal. */ if (processState != EXITING) terminate_all_childrens(); processState = EXITING; POOL_SETMASK(&UnBlockSig); } int pool_send_to_frontend(char *data, int len, bool flush) { if (processType == PT_PCP_WORKER) return send_to_pcp_frontend(data, len, flush); else if (processType == PT_CHILD) return send_to_pg_frontend(data, len, flush); return -1; } int pool_frontend_exists(void) { if (processType == PT_PCP_WORKER) return pcp_frontend_exists(); else if (processType == PT_CHILD) return pg_frontend_exists(); return -1; } static void degenerate_all_quarantine_nodes(void) { int i; for (i = 0; i < NUM_BACKENDS; i++) { if (BACKEND_INFO(i).quarantine && BACKEND_INFO(i).backend_status == CON_DOWN) { /* just send the request to watchdog */ if (wd_degenerate_backend_set(&i, 1, REQ_DETAIL_UPDATE) == FAILOVER_RES_PROCEED) register_node_operation_request(NODE_DOWN_REQUEST, &i, 1, REQ_DETAIL_WATCHDOG | REQ_DETAIL_SWITCHOVER); } } } static void update_backend_quarantine_status(void) { /* * Reset the quarantine flag from each backend and set it to con_wait */ int i; WD_STATES wd_state = get_watchdog_local_node_state(); for (i = 0; i < NUM_BACKENDS; i++) { if (BACKEND_INFO(i).quarantine && BACKEND_INFO(i).backend_status == CON_DOWN) { /* * Send the failback request for the node we also set the watchdog * flag, so that the failover should only be executed locally * because, we will eventually send the sync backend message to * all standby nodes */ if (wd_state == WD_COORDINATOR) send_failback_request(i, false, REQ_DETAIL_UPDATE | REQ_DETAIL_WATCHDOG); } } } /* * The function fetch the current status of all configured backend * nodes from the MASTER/COORDINATOR watchdog Pgpool-II and synchronize the * local backend states with the cluster wide status of each node. * * Latter in the funcrtion after syncing the backend node status the function * do a partial or full restart of Pgpool-II children depending upon the * Pgpool-II mode and type of node status change * */ static void sync_backend_from_watchdog(void) { bool primary_changed = false; bool node_status_was_changed_to_down = false; bool node_status_was_changed_to_up = false; bool need_to_restart_children = false; bool partial_restart = false; bool reload_maste_node_id = false; int down_node_ids[MAX_NUM_BACKENDS]; int down_node_ids_index = 0; int i; /* * Ask the watchdog to get all the backend states from the * Master/Coordinator Pgpool-II node */ WDPGBackendStatus *backendStatus = get_pg_backend_status_from_master_wd_node(); if (!backendStatus) { ereport(WARNING, (errmsg("failed to get the backend status from the master watchdog node"), errdetail("using the local backend node status"))); return; } if (backendStatus->node_count <= 0) { /* * -ve node count is returned by watchdog when the node itself is a * master and in that case we need to use the loacl backend node * status */ ereport(LOG, (errmsg("I am the master watchdog node"), errdetail("using the local backend node status"))); pfree(backendStatus); return; } ereport(LOG, (errmsg("master watchdog node \"%s\" returned status for %d backend nodes", backendStatus->nodeName, backendStatus->node_count))); ereport(DEBUG1, (errmsg("primary node on master watchdog node \"%s\" is %d", backendStatus->nodeName, backendStatus->primary_node_id))); /* * update the local backend status Also remove quarantine flags */ for (i = 0; i < backendStatus->node_count; i++) { BACKEND_INFO(i).quarantine = false; if (backendStatus->backend_status[i] == CON_DOWN) { if (BACKEND_INFO(i).backend_status != CON_DOWN) { BACKEND_INFO(i).backend_status = CON_DOWN; pool_set_backend_status_changed_time(i); my_backend_status[i] = &(BACKEND_INFO(i).backend_status); reload_maste_node_id = true; node_status_was_changed_to_down = true; ereport(LOG, (errmsg("backend:%d is set to down status", i), errdetail("backend:%d is DOWN on cluster master \"%s\"", i, backendStatus->nodeName))); down_node_ids[down_node_ids_index++] = i; } } else if (backendStatus->backend_status[i] == CON_CONNECT_WAIT || backendStatus->backend_status[i] == CON_UP) { if (BACKEND_INFO(i).backend_status != CON_CONNECT_WAIT) { if (BACKEND_INFO(i).backend_status == CON_DOWN) node_status_was_changed_to_up = true; BACKEND_INFO(i).backend_status = CON_CONNECT_WAIT; pool_set_backend_status_changed_time(i); my_backend_status[i] = &(BACKEND_INFO(i).backend_status); reload_maste_node_id = true; ereport(LOG, (errmsg("backend:%d is set to UP status", i), errdetail("backend:%d is UP on cluster master \"%s\"", i, backendStatus->nodeName))); } } } /* * Update primary node id info on the shared memory area if it's different * from the one on master watchdog node. This should be done only in streaming * or logical replication mode. */ if (SL_MODE && Req_info->primary_node_id != backendStatus->primary_node_id) { /* Do not produce this log message if we are starting up the Pgpool-II */ if (processState != INITIALIZING) ereport(LOG, (errmsg("primary node:%d on master watchdog node \"%s\" is different from local primary node:%d", backendStatus->primary_node_id, backendStatus->nodeName, Req_info->primary_node_id))); /* * master node returns primary_node_id = -1 when the primary node is * in quarantine state on the master. So we will not update our * primary node id when the status of current primary node is not * CON_DOWN while primary_node_id sent by master watchdong node is -1 * * Note that Req_info->primary_node_id could be -2, which is the * initial value. So we need to avoid crash by checking the value is * not lower than 0. Otherwise we will get crash while looking up * BACKEND_INFO array. See Mantis bug id 614 for more details. */ if (Req_info->primary_node_id >= 0 && backendStatus->primary_node_id == -1 && BACKEND_INFO(Req_info->primary_node_id).backend_status != CON_DOWN) { ereport(LOG, (errmsg("primary node:%d on master watchdog node \"%s\" seems to be quarantined", Req_info->primary_node_id, backendStatus->nodeName), errdetail("keeping the current primary"))); } else { Req_info->primary_node_id = backendStatus->primary_node_id; primary_changed = true; } } pfree(backendStatus); if (reload_maste_node_id) { Req_info->master_node_id = get_next_master_node(); } /* We don't need to do anything else if the Pgpool-II is starting up */ if (processState == INITIALIZING) return; /* * Decide if All or subset of the Pgpool-II children needs immidiate * restart or we can do that after finishing the current session * * Check if there was no change at all */ if (node_status_was_changed_to_up == false && node_status_was_changed_to_down == false && primary_changed == false) { ereport(LOG, (errmsg("backend nodes status remains same after the sync from \"%s\"", backendStatus->nodeName))); return; } if (!STREAM) { /* * If we are not in streaming replication mode restart all child * processes */ ereport(LOG, (errmsg("node status was chenged after the sync from \"%s\"", backendStatus->nodeName), errdetail("all children needs to be restarted as we are not in streaming replication mode"))); need_to_restart_children = true; partial_restart = false; } else if (primary_changed) { /* * if Primary node was changed, We should restart all children */ need_to_restart_children = true; partial_restart = false; ereport(LOG, (errmsg("primary node was chenged after the sync from \"%s\"", backendStatus->nodeName), errdetail("all children needs to be restarted"))); } else { if (node_status_was_changed_to_down == false) { /* * no node was detached, So no need to restart any child process */ need_to_restart_children = false; partial_restart = false; ereport(LOG, (errmsg("No backend node was detached because of backend status sync from \"%s\"", backendStatus->nodeName), errdetail("no need to restart children"))); } else { ereport(LOG, (errmsg("%d backend node(s) were detached because of backend status sync from \"%s\"", down_node_ids_index, backendStatus->nodeName), errdetail("restarting the children processes"))); need_to_restart_children = true; partial_restart = !check_all_backend_down(); } } /* Kill children and restart them if needed */ if (need_to_restart_children) { for (i = 0; i < pool_config->num_init_children; i++) { bool restart = false; if (partial_restart) { int j, k; for (j = 0; j < pool_config->max_pool; j++) { for (k = 0; k < NUM_BACKENDS; k++) { int idx; ConnectionInfo *con = pool_coninfo(i, j, k); for (idx = 0; idx < down_node_ids_index; idx++) { int node_id = down_node_ids[idx]; if (con->connected && con->load_balancing_node == node_id) { ereport(LOG, (errmsg("child process with PID:%d needs restart, because pool %d uses backend %d", process_info[i].pid, j, node_id))); restart = true; break; } if (restart) break; } } } } else { restart = true; } if (restart) { if (process_info[i].pid) { kill(process_info[i].pid, SIGQUIT); process_info[i].pid = fork_a_child(fds, i); process_info[i].start_time = time(NULL); } } else process_info[i].need_to_restart = 1; } } else { /* * Set restart request to each child. Children will exit(1) whenever * they are convenient. */ for (i = 0; i < pool_config->num_init_children; i++) { process_info[i].need_to_restart = 1; } } /* * Send restart request to worker child. */ kill(worker_pid, SIGUSR1); } /* * Obtain backend server version number and cache it. Note that returned * version number is in the static memory area. */ static int get_server_version(POOL_CONNECTION_POOL_SLOT * *slots, int node_id) { static int server_versions[MAX_NUM_BACKENDS]; char *query; POOL_SELECT_RESULT *res; if (server_versions[node_id] == 0) { query = "SELECT current_setting('server_version_num')"; /* Get backend server version. If the query fails, keep previous info. */ if (get_query_result(slots, node_id, query, &res) == 0) { server_versions[node_id] = atoi(res->data[0]); ereport(DEBUG1, (errmsg("get_server_version: backend %d server version: %d", node_id, server_versions[node_id]))); free_select_result(res); } } return server_versions[node_id]; } /* * Get info from conninfo string. */ static void get_info_from_conninfo(char *conninfo, char *host, char *port) { char *p; *host = '\0'; *port = '\0'; p = strstr(conninfo, "host"); if (p) { /* skip "host=" */ while (*p && *p++ != '=') ; while (*p && *p != ' ') *host++ = *p++; *host = '\0'; } p = strstr(conninfo, "port"); if (p) { /* skip "port=" */ while (*p && *p++ != '=') ; while (*p && *p != ' ') *port++ = *p++; *port = '\0'; } } /* * Set backend status changed time for specified backend id. */ void pool_set_backend_status_changed_time(int backend_id) { time_t tval; tval = time(NULL); BACKEND_INFO(backend_id).status_changed_time = tval; } pgpool-II-4.1.4/src/main/health_check.c0000664000175000017500000003374213730350127014535 00000000000000/* -*-pgsql-c-*- */ /* * $Header$ * * pgpool: a language independent connection pool server for PostgreSQL * written by Tatsuo Ishii * * Copyright (c) 2003-2020 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. * * health_check.c: health check related functions. * */ #include "config.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_CRYPT_H #include #endif #include "pool.h" #include "utils/palloc.h" #include "utils/memutils.h" #include "utils/elog.h" #include "context/pool_process_context.h" #include "context/pool_session_context.h" #include "pool_config.h" #include "utils/pool_ip.h" #include "auth/md5.h" #include "auth/pool_hba.h" #include "utils/pool_stream.h" static POOL_CONNECTION_POOL_SLOT * slot; static volatile sig_atomic_t reload_config_request = 0; static volatile sig_atomic_t restart_request = 0; static bool establish_persistent_connection(int node); static void discard_persistent_connection(int node); static RETSIGTYPE my_signal_handler(int sig); static RETSIGTYPE reload_config_handler(int sig); static void reload_config(void); static RETSIGTYPE health_check_timer_handler(int sig); #ifdef HEALTHCHECK_OPTS #if HEALTHCHECK_OPTS > 0 #define HEALTHCHECK_DEBUG #endif #endif #ifdef HEALTHCHECK_DEBUG static bool check_backend_down_request(int node, bool done_requests); #endif #undef CHECK_REQUEST #define CHECK_REQUEST \ do { \ if (reload_config_request) \ { \ reload_config(); \ reload_config_request = 0; \ } else if (restart_request) \ { \ ereport(LOG,(errmsg("health check process received restart request"))); \ exit(1); \ } \ } while (0) #undef CLEAR_ALARM #define CLEAR_ALARM \ do { \ ereport(DEBUG1,(errmsg("health check: clearing alarm"))); \ } while (alarm(0) > 0) /* * health check child main loop */ void do_health_check_child(int *node_id) { sigjmp_buf local_sigjmp_buf; MemoryContext HealthCheckMemoryContext; char psbuffer[NI_MAXHOST]; ereport(DEBUG1, (errmsg("I am health check process pid:%d DB node id:%d", getpid(), *node_id))); /* Identify myself via ps */ init_ps_display("", "", "", ""); snprintf(psbuffer, sizeof(psbuffer), "health check process(%d)", *node_id); set_ps_display(psbuffer, false); /* set up signal handlers */ signal(SIGALRM, SIG_DFL); signal(SIGTERM, my_signal_handler); signal(SIGINT, my_signal_handler); signal(SIGHUP, reload_config_handler); signal(SIGQUIT, my_signal_handler); signal(SIGCHLD, SIG_IGN); signal(SIGUSR1, my_signal_handler); signal(SIGUSR2, SIG_IGN); signal(SIGPIPE, SIG_IGN); /* Create per loop iteration memory context */ HealthCheckMemoryContext = AllocSetContextCreate(TopMemoryContext, "health_check_main_loop", ALLOCSET_DEFAULT_MINSIZE, ALLOCSET_DEFAULT_INITSIZE, ALLOCSET_DEFAULT_MAXSIZE); MemoryContextSwitchTo(TopMemoryContext); /* Initialize my backend status */ pool_initialize_private_backend_status(); /* Initialize per process context */ pool_init_process_context(); if (sigsetjmp(local_sigjmp_buf, 1) != 0) { pool_signal(SIGALRM, SIG_IGN); error_context_stack = NULL; EmitErrorReport(); MemoryContextSwitchTo(TopMemoryContext); FlushErrorState(); } /* We can now handle ereport(ERROR) */ PG_exception_stack = &local_sigjmp_buf; for (;;) { MemoryContextSwitchTo(HealthCheckMemoryContext); MemoryContextResetAndDeleteChildren(HealthCheckMemoryContext); CHECK_REQUEST; if (pool_config->health_check_params[*node_id].health_check_period <= 0) { sleep(30); } /* * If health checking is enabled and the node is not in down status, * do health check. */ else if (pool_config->health_check_params[*node_id].health_check_period > 0) { bool result; BackendInfo *bkinfo = pool_get_node_info(*node_id); result = establish_persistent_connection(*node_id); if (result && slot == NULL) { if (POOL_DISALLOW_TO_FAILOVER(BACKEND_INFO(*node_id).flag)) { ereport(LOG, (errmsg("health check failed on node %d but failover is disallowed for the node", *node_id))); } else { bool partial; ereport(LOG, (errmsg("health check failed on node %d (timeout:%d)", *node_id, health_check_timer_expired))); if (bkinfo->backend_status == CON_DOWN && bkinfo->quarantine == true) { ereport(LOG, (errmsg("health check failed on quarantine node %d (timeout:%d)", *node_id, health_check_timer_expired), errdetail("ignoring.."))); } else { /* trigger failover */ partial = health_check_timer_expired ? false : true; degenerate_backend_set(node_id, 1, partial ? REQ_DETAIL_SWITCHOVER : 0); } } } else if (slot && bkinfo->backend_status == CON_DOWN && bkinfo->quarantine == true) { /* The node has become reachable again. Reset * the quarantine state */ send_failback_request(*node_id, false, REQ_DETAIL_UPDATE | REQ_DETAIL_WATCHDOG); } /* Discard persistent connections */ discard_persistent_connection(*node_id); sleep(pool_config->health_check_params[*node_id].health_check_period); } } exit(0); } /* * Establish persistent connection to backend. * Return true if connection test is done. */ static bool establish_persistent_connection(int node) { BackendInfo *bkinfo; int retry_cnt; static time_t auto_failback_interval = 0; /* resume time of auto_failback */ bool check_failback = false; time_t now; char *dbname; bkinfo = pool_get_node_info(node); /* * If the node is already in down status or unused, do nothing. * except when the node state is down because of quarantine operation * since we want to detect when the node cames back to life again to * remove it from the quarantine state */ if (bkinfo->backend_status == CON_UNUSED || (bkinfo->backend_status == CON_DOWN && bkinfo->quarantine == false)) { /* get current time to use auto_faliback_interval */ now = time(NULL); if (pool_config->auto_failback && auto_failback_interval < now && STREAM && !strcmp(bkinfo->replication_state, "streaming") && !Req_info->switching) { ereport(DEBUG1, (errmsg("health check DB node: %d (status:%d) for auto_failback", node, bkinfo->backend_status))); check_failback = true; } else return false; } /* * If database is not specified, "postgres" database is assumed. */ if (*pool_config->health_check_params[node].health_check_database == '\0') dbname = "postgres"; else dbname = pool_config->health_check_params[node].health_check_database; /* * Try to connect to the database. */ if (slot == NULL) { retry_cnt = pool_config->health_check_params[node].health_check_max_retries; char *password = get_pgpool_config_user_password(pool_config->health_check_params[node].health_check_user, pool_config->health_check_params[node].health_check_password); do { /* * Set health checker timeout. we want to detect communication * path failure much earlier before TCP/IP stack detects it. */ if (pool_config->health_check_params[node].health_check_timeout > 0) { CLEAR_ALARM; pool_signal(SIGALRM, health_check_timer_handler); alarm(pool_config->health_check_params[node].health_check_timeout); errno = 0; health_check_timer_expired = 0; } slot = make_persistent_db_connection_noerror(node, bkinfo->backend_hostname, bkinfo->backend_port, dbname, pool_config->health_check_params[node].health_check_user, password ? password : "", false); if (pool_config->health_check_params[node].health_check_timeout > 0) { /* cancel health check timer */ pool_signal(SIGALRM, SIG_IGN); CLEAR_ALARM; } #ifdef HEALTHCHECK_DEBUG if (slot && check_backend_down_request(node, false) == true) { discard_persistent_connection(node); } #endif if (slot) { if (retry_cnt != pool_config->health_check_params[node].health_check_max_retries) { ereport(LOG, (errmsg("health check retrying on DB node: %d succeeded", node))); } break; /* Success */ } retry_cnt--; if (retry_cnt >= 0) { ereport(LOG, (errmsg("health check retrying on DB node: %d (round:%d)", node, pool_config->health_check_params[node].health_check_max_retries - retry_cnt))); sleep(pool_config->health_check_params[node].health_check_retry_delay); } } while (retry_cnt >= 0); if (password) pfree(password); if (check_failback && !Req_info->switching && slot) { ereport(LOG, (errmsg("request auto failback, node id:%d", node))); /* get current time to use auto_faliback_interval */ now = time(NULL); auto_failback_interval = now + pool_config->auto_failback_interval; send_failback_request(node, true, REQ_DETAIL_CONFIRMED); } } /* if check_failback is true, backend_status is DOWN or UNUSED. */ if (check_failback) { return false; } return true; } /* * Discard persistent connection to backend */ static void discard_persistent_connection(int node) { if (slot) { discard_persistent_db_connection(slot); slot = NULL; } } static RETSIGTYPE my_signal_handler(int sig) { int save_errno = errno; POOL_SETMASK(&BlockSig); switch (sig) { case SIGTERM: case SIGINT: case SIGQUIT: exit(0); break; /* Failback or new node added */ case SIGUSR1: restart_request = 1; break; default: exit(1); break; } POOL_SETMASK(&UnBlockSig); errno = save_errno; } static RETSIGTYPE reload_config_handler(int sig) { int save_errno = errno; POOL_SETMASK(&BlockSig); reload_config_request = 1; POOL_SETMASK(&UnBlockSig); errno = save_errno; } static void reload_config(void) { ereport(LOG, (errmsg("reloading config file"))); MemoryContext oldContext = MemoryContextSwitchTo(TopMemoryContext); pool_get_config(get_config_file_name(), CFGCXT_RELOAD); MemoryContextSwitchTo(oldContext); if (pool_config->enable_pool_hba) load_hba(get_hba_file_name()); reload_config_request = 0; } /* * health check timer handler */ static RETSIGTYPE health_check_timer_handler(int sig) { int save_errno = errno; POOL_SETMASK(&BlockSig); health_check_timer_expired = 1; POOL_SETMASK(&UnBlockSig); errno = save_errno; } #ifdef HEALTHCHECK_DEBUG /* * Node down request file. In the file, each line consists of "backend node * id", tab and "down". If such a line found, check_backend_down_request() * will return true. */ #define BACKEND_DOWN_REQUEST_FILE "backend_down_request" /* * Check backend down request file with specified backend node id. If it's * down ("down"), returns true and set the status to "already_down" to * prevent repeatable * failover. If it's other than "down", returns false. * * When done_requests is true (second arg to function) the function returns * true if the node has already_done status in the file. */ static bool check_backend_down_request(int node, bool done_requests) { static char backend_down_request_file[POOLMAXPATHLEN]; FILE *fd; int i; #define MAXLINE 128 char linebuf[MAXLINE]; char readbuf[MAXLINE]; char buf[MAXLINE]; char *writebuf; char *p; bool found = false; int node_id; char status[MAXLINE]; if (backend_down_request_file[0] == '\0') { snprintf(backend_down_request_file, sizeof(backend_down_request_file), "%s/%s", pool_config->logdir, BACKEND_DOWN_REQUEST_FILE); } fd = fopen(backend_down_request_file, "r"); if (!fd) { ereport(WARNING, (errmsg("check_backend_down_request: failed to open file %s", backend_down_request_file), errdetail("\"%s\"", strerror(errno)))); return false; } writebuf = NULL; for (i = 0;; i++) { readbuf[MAXLINE - 1] = '\0'; if (fgets(readbuf, MAXLINE - 1, fd) == 0) break; strncpy(buf, readbuf, sizeof(buf)); if (strlen(readbuf) > 0 && readbuf[strlen(readbuf) - 1] == '\n') buf[strlen(readbuf) - 1] = '\0'; sscanf(buf, "%d\t%s", &node_id, status); if (done_requests) { if (node_id == node && !strcmp(status, "already_down")) { fclose(fd); return true; } continue; } p = readbuf; if (found == false) { if (node_id == node && !strcmp(status, "down")) { snprintf(linebuf, sizeof(linebuf), "%d\t%s\n", node_id, "already_down"); found = true; p = linebuf; } } if (writebuf == NULL) { writebuf = malloc(strlen(p) + 1); memset(writebuf, 0, strlen(p) + 1); } else writebuf = realloc(writebuf, strlen(p) + strlen(writebuf) + 1); if (!writebuf) { fclose(fd); return false; } strcat(writebuf, p); } fclose(fd); if (!found) return false; #ifdef NOT_USED fd = fopen(backend_down_request_file, "w"); if (!fd) { ereport(WARNING, (errmsg("check_backend_down_request: failed to open file for writing %s", backend_down_request_file), errdetail("\"%s\"", strerror(errno)))); return false; } if (fwrite(writebuf, 1, strlen(writebuf), fd) != strlen(writebuf)) { ereport(WARNING, (errmsg("check_backend_down_request: failed to write %s", backend_down_request_file), errdetail("\"%s\"", strerror(errno)))); fclose(fd); return false; } fclose(fd); #endif return true; } #endif pgpool-II-4.1.4/src/pcp_con/0000775000175000017500000000000013730350746012542 500000000000000pgpool-II-4.1.4/src/pcp_con/pcp_child.c0000664000175000017500000002603013730350127014545 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. * * 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 #include #include #ifdef HAVE_NETINET_TCP_H #include #endif #ifdef HAVE_SYS_SELECT_H #include #endif #include #include #include #include #include #include #ifdef HAVE_FCNTL_H #include #endif #include "pool.h" #include "pool_config.h" #include "utils/elog.h" #include "parser/pg_list.h" static int pcp_unix_fd, pcp_inet_fd; volatile bool *pcp_recovery_in_progress; static volatile sig_atomic_t pcp_got_sighup = 0; static volatile sig_atomic_t pcp_restart_request = 0; List *pcp_worker_children = NULL; static volatile sig_atomic_t sigchld_request = 0; static RETSIGTYPE pcp_exit_handler(int sig); static RETSIGTYPE wakeup_handler_parent(int sig); static RETSIGTYPE reload_config_handler(int sig); static RETSIGTYPE restart_handler(int sig); static RETSIGTYPE reap_handler(int sig); static int pcp_do_accept(int unix_fd, int inet_fd); static void start_pcp_command_processor_process(int port); static void pcp_child_will_die(int code, Datum arg); static void pcp_kill_all_children(int sig); static void reaper(void); #define CHECK_RESTART_REQUEST \ do { \ if (sigchld_request) \ { \ reaper(); \ } \ if (pcp_restart_request) \ { \ ereport(LOG,(errmsg("restart request received in pcp child process"))); \ pcp_exit_handler(SIGTERM); \ } \ } while (0) /* * main entry point for pcp child process */ void pcp_main(int unix_fd, int inet_fd) { sigjmp_buf local_sigjmp_buf; struct timeval uptime; /* Identify myself via ps */ init_ps_display("", "", "", ""); gettimeofday(&uptime, NULL); pcp_unix_fd = unix_fd; pcp_inet_fd = inet_fd; pcp_recovery_in_progress = pool_shared_memory_create(sizeof(bool)); *pcp_recovery_in_progress = false; /* * install the call back for preparation of exit */ on_system_exit(pcp_child_will_die, (Datum) NULL); /* set up signal handlers */ pool_signal(SIGTERM, pcp_exit_handler); pool_signal(SIGINT, pcp_exit_handler); pool_signal(SIGQUIT, pcp_exit_handler); pool_signal(SIGHUP, reload_config_handler); pool_signal(SIGCHLD, reap_handler); pool_signal(SIGUSR1, restart_handler); pool_signal(SIGUSR2, wakeup_handler_parent); pool_signal(SIGPIPE, SIG_IGN); pool_signal(SIGALRM, SIG_IGN); MemoryContextSwitchTo(TopMemoryContext); if (sigsetjmp(local_sigjmp_buf, 1) != 0) { error_context_stack = NULL; EmitErrorReport(); pool_signal(SIGALRM, SIG_IGN); MemoryContextSwitchTo(TopMemoryContext); FlushErrorState(); } /* We can now handle ereport(ERROR) */ PG_exception_stack = &local_sigjmp_buf; ereport(DEBUG1, (errmsg("I am PCP child with pid:%d", getpid()))); ereport(LOG, (errmsg("PCP process: %d started", getpid()))); for (;;) { int port; errno = 0; CHECK_RESTART_REQUEST; port = pcp_do_accept(unix_fd, inet_fd); if (port > 0) { start_pcp_command_processor_process(port); } } } static int pcp_do_accept(int unix_fd, int inet_fd) { 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 -1; 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(), CFGCXT_RELOAD); 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)))); } } return afd; } /* * forks a new pcp worker child */ static void start_pcp_command_processor_process(int port) { pid_t pid = fork(); if (pid == 0) /* child */ { /* Set the process type variable */ processType = PT_PCP_WORKER; on_exit_reset(); /* Close the listen sockets sockets */ close(pcp_unix_fd); close(pcp_inet_fd); /* call PCP child main */ if (pcp_worker_children) list_free(pcp_worker_children); pcp_worker_children = NULL; POOL_SETMASK(&UnBlockSig); pcp_worker_main(port); /* Never returns */ } else if (pid == -1) { ereport(FATAL, (errmsg("fork() failed. reason: %s", strerror(errno)))); } else /* parent */ { ereport(LOG, (errmsg("forked new pcp worker, pid=%d socket=%d", (int) pid, (int) port))); /* close the port in parent process. It is only consumed by child */ close(port); /* Add it to the list */ pcp_worker_children = lappend_int(pcp_worker_children, (int) pid); } } /* * sends the signal to all children of pcp child process */ static void pcp_kill_all_children(int sig) { /* forward wakeup requests to children */ ListCell *lc; foreach(lc, pcp_worker_children) { pid_t pid = (pid_t) lfirst_int(lc); kill(pid, sig); } } /* * handle SIGCHLD */ static RETSIGTYPE reap_handler(int sig) { POOL_SETMASK(&BlockSig); sigchld_request = 1; POOL_SETMASK(&UnBlockSig); } static void reaper(void) { pid_t pid; int status; ereport(DEBUG1, (errmsg("PCP child reaper handler"))); /* clear SIGCHLD request */ sigchld_request = 0; while ((pid = pool_waitpid(&status)) > 0) { if (WIFEXITED(status)) { if (WEXITSTATUS(status) == POOL_EXIT_FATAL) ereport(LOG, (errmsg("PCP worker process with pid: %d exit with FATAL ERROR.", pid))); else ereport(LOG, (errmsg("PCP process with pid: %d exit with SUCCESS.", pid))); } if (WIFSIGNALED(status)) { /* Child terminated by segmentation fault. Report it */ if (WTERMSIG(status) == SIGSEGV) ereport(WARNING, (errmsg("PCP process with pid: %d was terminated by segmentation fault", pid))); else ereport(LOG, (errmsg("PCP process with pid: %d exits with status %d by signal %d", pid, status, WTERMSIG(status)))); } else ereport(LOG, (errmsg("PCP process with pid: %d exits with status %d", pid, status))); ereport(DEBUG2, (errmsg("going to remove pid: %d from pid list having %d elements", pid, list_length(pcp_worker_children)))); /* remove the pid of process from the list */ pcp_worker_children = list_delete_int(pcp_worker_children, pid); ereport(DEBUG2, (errmsg("new list have %d elements", list_length(pcp_worker_children)))); } } static RETSIGTYPE pcp_exit_handler(int sig) { pid_t wpid; POOL_SETMASK(&AuthBlockSig); pcp_kill_all_children(sig); if (sig == SIGTERM) /* smart shutdown */ { /* close the listening sockets */ close(pcp_unix_fd); close(pcp_inet_fd); } POOL_SETMASK(&UnBlockSig); if (list_length(pcp_worker_children) > 0) { do { wpid = wait(NULL); } while (wpid > 0 || (wpid == -1 && errno == EINTR)); list_free(pcp_worker_children); } pcp_worker_children = NULL; exit(0); } /* Wakeup signal handler for pcp parent process */ static RETSIGTYPE wakeup_handler_parent(int sig) { /* forward wakeup signal to all children */ pcp_kill_all_children(SIGUSR2); } static RETSIGTYPE restart_handler(int sig) { pcp_restart_request = 1; } /* SIGHUP handler */ static RETSIGTYPE reload_config_handler(int sig) { pcp_got_sighup = 1; } static void pcp_child_will_die(int code, Datum arg) { pid_t wpid; /* * This is supposed to be called from main process */ if (processType != PT_PCP) return; if (list_length(pcp_worker_children) <= 0) return; pcp_kill_all_children(SIGINT); /* wait for all children to exit */ do { wpid = wait(NULL); } while (wpid > 0 || (wpid == -1 && errno == EINTR)); if (wpid == -1 && errno != ECHILD) ereport(WARNING, (errmsg("wait() on pcp worker children failed. reason:%s", strerror(errno)))); POOL_SETMASK(&UnBlockSig); } /* * sets the shared memory flag to indicate pcp recovery command * is in progress. If the flag is already set the function returns * false. */ bool pcp_mark_recovery_in_progress(void) { bool command_already_inprogress; pool_sigset_t oldmask; /* * only pcp worker is allowd to make this call */ if (processType != PT_PCP_WORKER) return false; POOL_SETMASK2(&BlockSig, &oldmask); pool_semaphore_lock(PCP_REQUEST_SEM); command_already_inprogress = *pcp_recovery_in_progress; *pcp_recovery_in_progress = true; pool_semaphore_unlock(PCP_REQUEST_SEM); POOL_SETMASK(&oldmask); return (command_already_inprogress == false); } /* * unsets the shared memory flag to indicate pcp recovery command * is finsihed. */ void pcp_mark_recovery_finished(void) { pool_sigset_t oldmask; /* * only pcp worker is allowd to make this call */ if (processType != PT_PCP_WORKER) return; POOL_SETMASK2(&BlockSig, &oldmask); pool_semaphore_lock(PCP_REQUEST_SEM); *pcp_recovery_in_progress = false; pool_semaphore_unlock(PCP_REQUEST_SEM); POOL_SETMASK(&oldmask); } pgpool-II-4.1.4/src/pcp_con/pcp_worker.c0000664000175000017500000010717213730350127015002 00000000000000/* -*-pcp_worker.c-*- */ /* * * pgpool: a language independent connection pool server for PostgreSQL * written by Tatsuo Ishii * * Copyright (c) 2003-2019 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_worker.c: PCP worker child process main * */ #include "config.h" #include "pool.h" #include "utils/palloc.h" #include "utils/memutils.h" #include #include #include #include #include #include #include #include #ifdef HAVE_FCNTL_H #include #endif #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_json_data.h" #include "watchdog/wd_ipc_commands.h" #include "utils/elog.h" #define MAX_FILE_LINE_LEN 512 extern char *pcp_conf_file; /* global variable defined in main.c holds the * path for pcp.conf */ volatile sig_atomic_t pcp_worker_wakeup_request = 0; PCP_CONNECTION *volatile pcp_frontend = NULL; static RETSIGTYPE die(int sig); static RETSIGTYPE wakeup_handler_child(int sig); static void unset_nonblock(int fd); static int user_authenticate(char *buf, char *passwd_file, char *salt, int salt_len); static void process_authentication(PCP_CONNECTION * frontend, char *buf, char *salt, int *random_salt); static void send_md5salt(PCP_CONNECTION * frontend, char *salt); static void pcp_process_command(char tos, char *buf, int buf_len); static int pool_detach_node(int node_id, bool gracefully); static int pool_promote_node(int node_id, bool gracefully); static void inform_process_count(PCP_CONNECTION * frontend); static void inform_process_info(PCP_CONNECTION * frontend, char *buf); 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(PCP_CONNECTION * frontend, char mode); static void process_set_configration_parameter(PCP_CONNECTION * frontend, char *buf, int len); static void pcp_worker_will_go_down(int code, Datum arg); static void do_pcp_flush(PCP_CONNECTION * frontend); static void do_pcp_read(PCP_CONNECTION * pc, void *buf, int len); /* * main entry pont of pcp worker child process */ void pcp_worker_main(int port) { sigjmp_buf local_sigjmp_buf; MemoryContext PCPMemoryContext; volatile int authenticated = 0; char salt[4]; int random_salt = 0; struct timeval uptime; char tos; int rsize; ereport(DEBUG1, (errmsg("I am PCP worker child with pid:%d", getpid()))); /* Identify myself via ps */ init_ps_display("", "", "", ""); gettimeofday(&uptime, NULL); srandom((unsigned int) (getpid() ^ uptime.tv_usec)); /* set up signal handlers */ signal(SIGTERM, die); signal(SIGINT, die); signal(SIGQUIT, die); signal(SIGCHLD, SIG_DFL); signal(SIGUSR2, wakeup_handler_child); signal(SIGUSR1, SIG_IGN); signal(SIGHUP, SIG_IGN); signal(SIGPIPE, SIG_IGN); signal(SIGALRM, SIG_IGN); /* Create per loop iteration memory context */ PCPMemoryContext = AllocSetContextCreate(TopMemoryContext, "PCP_worker_main_loop", ALLOCSET_DEFAULT_MINSIZE, ALLOCSET_DEFAULT_INITSIZE, ALLOCSET_DEFAULT_MAXSIZE); MemoryContextSwitchTo(TopMemoryContext); /* * install the call back for preparation of pcp worker child exit */ on_system_exit(pcp_worker_will_go_down, (Datum) NULL); /* Initialize my backend status */ pool_initialize_private_backend_status(); /* Initialize process context */ pool_init_process_context(); pcp_frontend = pcp_open(port); unset_nonblock(pcp_frontend->fd); if (sigsetjmp(local_sigjmp_buf, 1) != 0) { error_context_stack = NULL; EmitErrorReport(); MemoryContextSwitchTo(TopMemoryContext); FlushErrorState(); } /* We can now handle ereport(ERROR) */ PG_exception_stack = &local_sigjmp_buf; for (;;) { char *buf = NULL; MemoryContextSwitchTo(PCPMemoryContext); MemoryContextResetAndDeleteChildren(PCPMemoryContext); errno = 0; /* read a PCP packet */ do_pcp_read(pcp_frontend, &tos, 1); do_pcp_read(pcp_frontend, &rsize, sizeof(int)); rsize = ntohl(rsize); if (rsize <= 0 || rsize >= MAX_PCP_PACKET_LENGTH) ereport(FATAL, (errmsg("invalid PCP packet"), errdetail("incorrect packet length (%d)", rsize))); if ((rsize - sizeof(int)) > 0) { buf = (char *) palloc(rsize - sizeof(int)); do_pcp_read(pcp_frontend, buf, rsize - sizeof(int)); } ereport(DEBUG1, (errmsg("received PCP packet"), errdetail("PCP packet type of service '%c'", tos))); if (tos == 'R') /* authentication */ { set_ps_display("PCP: processing authentication", false); process_authentication(pcp_frontend, buf, salt, &random_salt); authenticated = 1; continue; } if (tos == 'M') /* md5 salt */ { set_ps_display("PCP: processing authentication", false); send_md5salt(pcp_frontend, salt); random_salt = 1; continue; } /* is this connection authenticated? if not disconnect immediately */ if (!authenticated) ereport(FATAL, (errmsg("authentication failed for new PCP connection"), errdetail("connection not authorized"))); /* process a request */ pcp_process_command(tos, buf, rsize); } exit(0); } /* pcp command processor */ static void pcp_process_command(char tos, char *buf, int buf_len) { if (tos == 'O' || tos == 'T') { if (Req_info->switching) { 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) ereport(ERROR, (errmsg("failed to process PCP request at the moment"), errdetail("failback is in progress"))); else if (reqkind == NODE_DOWN_REQUEST) ereport(ERROR, (errmsg("failed to process PCP request at the moment"), errdetail("failover is in progress"))); else if (reqkind == PROMOTE_NODE_REQUEST) ereport(ERROR, (errmsg("failed to process PCP request at the moment"), errdetail("promote node operation is in progress"))); ereport(ERROR, (errmsg("failed to process PCP request at the moment"), errdetail("operation is in progress"))); } } } switch (tos) { case 'A': /* set configuration parameter */ set_ps_display("PCP: processing set configration parameter request", false); process_set_configration_parameter(pcp_frontend, buf, buf_len); break; case 'L': /* node count */ set_ps_display("PCP: processing node count request", false); inform_node_count(pcp_frontend); break; case 'I': /* node info */ set_ps_display("PCP: processing node info request", false); inform_node_info(pcp_frontend, buf); break; case 'N': /* process count */ set_ps_display("PCP: processing process count request", false); inform_process_count(pcp_frontend); break; case 'P': /* process info */ set_ps_display("PCP: processing process info request", false); inform_process_info(pcp_frontend, buf); break; case 'W': /* watchdog info */ set_ps_display("PCP: processing watchdog info request", false); inform_watchdog_info(pcp_frontend, buf); break; case 'D': /* detach node */ case 'd': /* detach node gracefully */ set_ps_display("PCP: processing detach node request", false); process_detach_node(pcp_frontend, buf, tos); break; case 'C': /* attach node */ set_ps_display("PCP: processing attach node request", false); process_attach_node(pcp_frontend, buf); break; case 'T': set_ps_display("PCP: processing shutdown request", false); process_shutown_request(pcp_frontend, buf[0]); break; case 'O': /* recovery request */ set_ps_display("PCP: processing recovery request", false); process_recovery_request(pcp_frontend, buf); break; case 'B': /* status request */ set_ps_display("PCP: processing status request request", false); process_status_request(pcp_frontend); break; case 'J': /* promote node */ case 'j': /* promote node gracefully */ set_ps_display("PCP: processing promote node request", false); process_promote_node(pcp_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, and exiting child"))); pcp_close(pcp_frontend); pcp_frontend = NULL; /* This child has done its part. Rest in peace now */ exit(0); break; default: ereport(FATAL, (errmsg("PCP processing request"), errdetail("unknown PCP packet type \"%c\"", tos))); } } static RETSIGTYPE die(int sig) { ereport(DEBUG1, (errmsg("PCP worker child receives shutdown request signal %d", sig))); if (sig == SIGTERM) { ereport(DEBUG1, (errmsg("PCP worker child receives smart shutdown request."), errdetail("waiting for the child to die its natural death"))); } else if (sig == SIGINT) { ereport(DEBUG1, (errmsg("PCP worker child receives fast shutdown request."))); exit(0); } else if (sig == SIGQUIT) { ereport(DEBUG1, (errmsg("PCP worker child receives immediate shutdown request."))); exit(0); } else exit(1); } static RETSIGTYPE wakeup_handler_child(int sig) { pcp_worker_wakeup_request = 1; } /* * 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(FATAL, (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(FATAL, (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' || line[0] == '#') continue; while (line[i] != ':') { len++; if (++i > MAX_USER_PASSWD_LEN) { fclose(fp); ereport(FATAL, (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(FATAL, (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); ereport(FATAL, (errmsg("authentication failed for user \"%s\"", packet_username), errdetail("username and/or password does not match"))); return 0; } /* Detach a node */ static int pool_detach_node(int node_id, bool gracefully) { if (!gracefully) { degenerate_backend_set_ex(&node_id, 1, REQ_DETAIL_SWITCHOVER | REQ_DETAIL_CONFIRMED, true, false); return 0; } /* * Check if the NODE DOWN can be executed on the given node id. */ degenerate_backend_set_ex(&node_id, 1, REQ_DETAIL_SWITCHOVER | REQ_DETAIL_CONFIRMED, true, true); /* * 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; } pcp_worker_wakeup_request = 0; /* * Now all frontends have gone. Let's do failover. */ degenerate_backend_set_ex(&node_id, 1, REQ_DETAIL_SWITCHOVER | REQ_DETAIL_CONFIRMED, false, false); /* * Wait for failover completed. */ while (!pcp_worker_wakeup_request) { struct timeval t = {1, 0}; select(0, NULL, NULL, NULL, &t); } pcp_worker_wakeup_request = 0; /* * Start to accept incoming connections and send SIGUSR2 to pgpool parent * to distribute SIGUSR2 all pgpool children. */ finish_recovery(); return 0; } /* Promote a node */ static int pool_promote_node(int node_id, bool gracefully) { if (!gracefully) { promote_backend(node_id, REQ_DETAIL_CONFIRMED); /* 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, REQ_DETAIL_CONFIRMED); /* send promote request */ /* * Wait for failover completed. */ pcp_worker_wakeup_request = 0; while (!pcp_worker_wakeup_request) { struct timeval t = {1, 0}; select(0, NULL, NULL, NULL, &t); } pcp_worker_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(7 * process_count); /* PID is at most 6 characters * long */ snprintf(process_count_str, sizeof(process_count_str), "%d", process_count); for (i = 0; i < process_count; i++) { char process_id[7]; snprintf(process_id, sizeof(process_id), "%d", process_list[i]); snprintf(mesg + total_port_len, strlen(process_id) + 1, "%s", process_id); total_port_len += strlen(process_id) + 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)) { ereport(ERROR, (errmsg("informing process info failed"), errdetail("invalid process ID : %s", buf))); } 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; i < num_proc; i++) { char code[] = "ProcessInfo"; char proc_pid[16]; char proc_start_time[20]; char proc_create_time[20]; char majorversion[5]; char minorversion[5]; char pool_counter[16]; char backend_id[16]; char backend_pid[16]; char connected[2]; if (proc_id != 0 && proc_id != pools[i].pool_pid) continue; snprintf(proc_pid, sizeof(proc_pid), "%d", pools[i].pool_pid); snprintf(proc_start_time, sizeof(proc_start_time), "%ld", pools[i].start_time); snprintf(proc_create_time, sizeof(proc_create_time), "%ld", pools[i].create_time); snprintf(majorversion, sizeof(majorversion), "%d", pools[i].pool_majorversion); snprintf(minorversion, sizeof(minorversion), "%d", pools[i].pool_minorversion); snprintf(pool_counter, sizeof(pool_counter), "%d", pools[i].pool_counter); snprintf(backend_id, sizeof(backend_pid), "%d", pools[i].backend_id); snprintf(backend_pid, sizeof(backend_pid), "%d", pools[i].pool_backendpid); snprintf(connected, sizeof(connected), "%d", pools[i].pool_connected); pcp_write(frontend, "p", 1); wsize = htonl(sizeof(code) + strlen(proc_pid) + 1 + strlen(pools[i].database) + 1 + strlen(pools[i].username) + 1 + strlen(proc_start_time) + 1 + strlen(proc_create_time) + 1 + strlen(majorversion) + 1 + strlen(minorversion) + 1 + strlen(pool_counter) + 1 + strlen(backend_id) + 1 + strlen(backend_pid) + 1 + strlen(connected) + 1 + sizeof(int)); pcp_write(frontend, &wsize, sizeof(int)); pcp_write(frontend, code, sizeof(code)); pcp_write(frontend, proc_pid, strlen(proc_pid) + 1); pcp_write(frontend, pools[i].database, strlen(pools[i].database) + 1); pcp_write(frontend, pools[i].username, strlen(pools[i].username) + 1); pcp_write(frontend, proc_start_time, strlen(proc_start_time) + 1); pcp_write(frontend, proc_create_time, strlen(proc_create_time) + 1); pcp_write(frontend, majorversion, strlen(majorversion) + 1); pcp_write(frontend, minorversion, strlen(minorversion) + 1); pcp_write(frontend, pool_counter, strlen(pool_counter) + 1); pcp_write(frontend, backend_id, strlen(backend_id) + 1); pcp_write(frontend, backend_pid, strlen(backend_pid) + 1); pcp_write(frontend, connected, strlen(connected) + 1); do_pcp_flush(frontend); } pcp_write(frontend, "p", 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 process info"), errdetail("retrieved process information from shared memory"))); pfree(pools); } } static void inform_watchdog_info(PCP_CONNECTION * frontend, char *buf) { int wd_index; int json_data_len; int wsize; char code[] = "CommandComplete"; char *json_data; if (!pool_config->use_watchdog) ereport(ERROR, (errmsg("PCP: informing watchdog info failed"), errdetail("watcdhog is not enabled"))); wd_index = atoi(buf); json_data = wd_get_watchdog_nodes(wd_index); if (json_data == NULL) ereport(ERROR, (errmsg("PCP: informing watchdog info failed"), errdetail("invalid watchdog index"))); ereport(DEBUG2, (errmsg("PCP: informing watchdog info"), errdetail("retrieved node information from IPC socket"))); /* * This is the voilation of PCP protocol but I think in future we should * shift to more adaptable protocol for data transmition. */ json_data_len = strlen(json_data); wsize = htonl(sizeof(code) + json_data_len + 1 + sizeof(int)); pcp_write(frontend, "w", 1); pcp_write(frontend, &wsize, sizeof(int)); pcp_write(frontend, code, sizeof(code)); pcp_write(frontend, json_data, json_data_len + 1); do_pcp_flush(frontend); pfree(json_data); } static void inform_node_info(PCP_CONNECTION * frontend, char *buf) { int node_id; int wsize; char port_str[6]; char status[2]; char weight_str[20]; char role_str[10]; char standby_delay_str[20]; char status_changed_time_str[20]; char code[] = "CommandComplete"; BackendInfo *bi = NULL; SERVER_ROLE role; node_id = atoi(buf); bi = pool_get_node_info(node_id); if (bi == NULL) ereport(ERROR, (errmsg("informing node info failed"), errdetail("invalid node ID"))); ereport(DEBUG2, (errmsg("PCP: informing node info"), errdetail("retrieved node information from shared memory"))); 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); if (STREAM) { if (Req_info->primary_node_id == node_id) role = ROLE_PRIMARY; else role = ROLE_STANDBY; } else { if (Req_info->master_node_id == node_id) role = ROLE_MASTER; else role = ROLE_SLAVE; } snprintf(role_str, sizeof(role_str), "%d", role); snprintf(standby_delay_str, sizeof(standby_delay_str), UINT64_FORMAT, bi->standby_delay); snprintf(status_changed_time_str, sizeof(status_changed_time_str), UINT64_FORMAT, bi->status_changed_time); 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 + strlen(role_str) + 1 + strlen(standby_delay_str) + 1 + strlen(bi->replication_state) + 1 + strlen(bi->replication_sync_state) + 1 + strlen(status_changed_time_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); pcp_write(frontend, role_str, strlen(role_str) + 1); pcp_write(frontend, standby_delay_str, strlen(standby_delay_str) + 1); pcp_write(frontend, bi->replication_state, strlen(bi->replication_state) + 1); pcp_write(frontend, bi->replication_sync_state, strlen(bi->replication_sync_state) + 1); pcp_write(frontend, status_changed_time_str, strlen(status_changed_time_str) + 1); do_pcp_flush(frontend); } static void inform_node_count(PCP_CONNECTION * frontend) { int wsize; char mesg[16]; char code[] = "CommandComplete"; int node_count = pool_get_node_count(); 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[] = "CommandComplete"; 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))); pool_detach_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_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, true, REQ_DETAIL_CONFIRMED); 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 wsize; char code[] = "CommandComplete"; int node_id = atoi(buf); if ((node_id < 0) || (node_id >= pool_config->backend_desc->num_backends)) ereport(ERROR, (errmsg("process recovery request failed"), errdetail("node id %d is not valid", node_id))); if ((!REPLICATION && !(MASTER_SLAVE && pool_config->master_slave_sub_mode == STREAM_MODE)) || (MASTER_SLAVE && pool_config->master_slave_sub_mode == STREAM_MODE && node_id == PRIMARY_NODE_ID)) { if (MASTER_SLAVE && pool_config->master_slave_sub_mode == STREAM_MODE) ereport(ERROR, (errmsg("process recovery request failed"), errdetail("primary server cannot be recovered by online recovery."))); else ereport(ERROR, (errmsg("process recovery request failed"), errdetail("recovery request is only allowed in replication and streaming replication modes."))); } else { if (pcp_mark_recovery_in_progress() == false) ereport(FATAL, (errmsg("process recovery request failed"), errdetail("pgpool-II is already processing another recovery request."))); 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); pcp_mark_recovery_finished(); } PG_CATCH(); { finish_recovery(); pcp_mark_recovery_finished(); 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)) ereport(ERROR, (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 || pool_config->master_slave_sub_mode != STREAM_MODE) { ereport(FATAL, (errmsg("invalid pgpool mode for process recovery request"), errdetail("not in streaming replication mode, can't promote node id %d", node_id))); } if (node_id == REAL_PRIMARY_NODE_ID) { ereport(FATAL, (errmsg("invalid pgpool mode for process recovery request"), 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 *salt, int *random_salt) { int wsize; int authenticated; if (*random_salt) { authenticated = user_authenticate(buf, pcp_conf_file, salt, 4); } if (!*random_salt || !authenticated) { ereport(FATAL, (errmsg("authentication failed"), errdetail("username and/or password does not match"))); *random_salt = 0; } 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; ereport(DEBUG1, (errmsg("PCP: sending md5 salt to client"))); pool_random_salt(salt); 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); } static void process_shutown_request(PCP_CONNECTION * frontend, char mode) { char code[] = "CommandComplete"; pid_t ppid = getppid(); int sig, len; if (mode == 's') { ereport(DEBUG1, (errmsg("PCP: processing shutdown request"), errdetail("sending SIGTERM to the parent process with PID:%d", ppid))); sig = SIGTERM; } else if (mode == 'f') { ereport(DEBUG1, (errmsg("PCP: processing shutdown request"), errdetail("sending SIGINT to the parent process with PID:%d", ppid))); sig = SIGINT; } else if (mode == 'i') { ereport(DEBUG1, (errmsg("PCP: processing shutdown request"), errdetail("sending SIGQUIT to the parent process with PID:%d", ppid))); sig = SIGQUIT; } else { ereport(ERROR, (errmsg("PCP: error while processing shutdown request"), errdetail("invalid shutdown mode \"%c\"", mode))); } pcp_write(frontend, "t", 1); len = htonl(sizeof(code) + sizeof(int)); pcp_write(frontend, &len, sizeof(int)); pcp_write(frontend, code, sizeof(code)); do_pcp_flush(frontend); pool_signal_parent(sig); } static void process_set_configration_parameter(PCP_CONNECTION * frontend, char *buf, int len) { char *param_name; char *param_value; int wsize; char code[] = "CommandComplete"; param_name = buf; if (param_name == NULL) ereport(ERROR, (errmsg("PCP: set configuration parameter failed"), errdetail("invalid pcp packet received from client"))); param_value = (char *) memchr(buf, '\0', len); if (param_value == NULL) ereport(ERROR, (errmsg("set configuration parameter failed"), errdetail("invalid pcp packet received from client"))); param_value += 1; ereport(LOG, (errmsg("set configuration parameter, \"%s TO %s\"", param_name, param_value))); if (strcasecmp(param_name, "client_min_messages") == 0) { const char *ordered_valid_values[] = {"debug5", "debug4", "debug3", "debug2", "debug1", "log", "commerror", "info", "notice", "warning", "error", NULL}; bool found = false; int i; for (i = 0;; i++) { char *valid_val = (char *) ordered_valid_values[i]; if (!valid_val) break; if (!strcasecmp(param_value, valid_val)) { found = true; pool_config->client_min_messages = i + 10; ereport(DEBUG1, (errmsg("PCP setting parameter \"%s\" to \"%s\"", param_name, param_value))); break; } } if (!found) ereport(ERROR, (errmsg("PCP: set configuration parameter failed"), errdetail("invalid value \"%s\" for parameter \"%s\"", param_value, param_name))); } else ereport(ERROR, (errmsg("PCP: set configuration parameter failed"), errdetail("invalid parameter \"%s\"", param_name))); pcp_write(frontend, "a", 1); wsize = htonl(sizeof(code) + sizeof(int)); pcp_write(frontend, &wsize, sizeof(int)); pcp_write(frontend, code, sizeof(code)); do_pcp_flush(frontend); } /* * 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)))); } /* * Wrapper around pcp_read which throws FATAL error when read fails */ static void do_pcp_read(PCP_CONNECTION * pc, void *buf, int len) { if (pcp_read(pc, buf, len)) ereport(FATAL, (errmsg("unable to read from client"), errdetail("pcp_read failed with error : \"%s\"", strerror(errno)))); } int send_to_pcp_frontend(char *data, int len, bool flush) { int ret; if (processType != PT_PCP_WORKER || pcp_frontend == NULL) return -1; ret = pcp_write(pcp_frontend, data, len); if (flush && !ret) ret = pcp_flush(pcp_frontend); return ret; } int pcp_frontend_exists(void) { if (processType != PT_PCP_WORKER || pcp_frontend == NULL) return -1; return 0; } static void pcp_worker_will_go_down(int code, Datum arg) { if (processType != PT_PCP_WORKER) { /* should never happen */ ereport(WARNING, (errmsg("pcp_worker_will_go_down called from invalid process"))); return; } if (pcp_frontend) pcp_close(pcp_frontend); processState = EXITING; POOL_SETMASK(&UnBlockSig); } pgpool-II-4.1.4/src/pcp_con/recovery.c0000664000175000017500000003225513730350127014464 00000000000000/* -*-pgsql-c-*- */ /* * $Header$ * * pgpool: a language independent connection pool server for PostgreSQL * written by Tatsuo Ishii * * Copyright (c) 2003-2018 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/wd_ipc_commands.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, int recovery_node); 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_worker_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 (*(my_backend_status[(recovery_node)]) == CON_UNUSED) ereport(ERROR, (errmsg("node recovery failed, node id: %d is unused", 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, recovery_node); 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 (COMMAND_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, recovery_node); } 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_worker_wakeup_request = 0; /* send failback request to pgpool parent */ send_failback_request(recovery_node, false, REQ_DETAIL_CONFIRMED); /* wait for failback */ failback_wait_count = 0; while (!pcp_worker_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_worker_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, int recovery_node) { 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', %d, '%d')", script, hostname, recovery_backend->backend_data_directory, master_backend->backend_port, recovery_node, recovery_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; char *password = get_pgpool_config_user_password(pool_config->recovery_user, pool_config->recovery_password); 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, password ? password : NULL); r = PQstatus(conn); PQfinish(conn); if (r == CONNECTION_OK) { if (password) pfree(password); 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, password ? password : NULL); r = PQstatus(conn); PQfinish(conn); if (r == CONNECTION_OK) { if (password) pfree(password); 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); if (password) pfree(password); 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; char *password = get_pgpool_config_user_password(pool_config->recovery_user, pool_config->recovery_password); snprintf(port_str, sizeof(port_str), "%d", backend->backend_port); conn = PQsetdbLogin(backend->backend_hostname, port_str, NULL, NULL, "template1", pool_config->recovery_user, password ? password : ""); if (password) pfree(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 ensure_conn_counter_validity(); } int ensure_conn_counter_validity(void) { /* * recovery_timeout was expired. Before returning with failure status, * let's check if this is caused by the malformed conn_counter. If a child * process abnormally exits (killed by SIGKILL or SEGFAULT, for example), * then conn_counter is not decremented at process exit, thus it will * never be returning to 0. This could be detected by checking if * client_idle_limit_in_recovery is enabled and less value than * recovery_timeout because all clients must be kicked out by the time * when client_idle_limit_in_recovery is expired. If so, we should reset * conn_counter to 0 also. * * See bug 431 for more info. */ if (pool_config->client_idle_limit_in_recovery == -1 || (pool_config->client_idle_limit_in_recovery > 0 && pool_config->recovery_timeout >= pool_config->client_idle_limit_in_recovery)) { ereport(LOG, (errmsg("wait_connection_closed: mulformed conn_counter (%d) detected. reset it to 0", Req_info->conn_counter))); Req_info->conn_counter = 0; return 0; } return 1; } pgpool-II-4.1.4/src/protocol/0000775000175000017500000000000013730350746012762 500000000000000pgpool-II-4.1.4/src/protocol/pool_proto2.c0000664000175000017500000004262413730350075015327 00000000000000/* -*-pgsql-c-*- */ /* * $Header$ * * pgpool: a language independent connection pool server for PostgreSQL * written by Tatsuo Ishii * * Copyright (c) 2003-2019 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_proto2.c: modules corresponding to protocol 2.0. * used by pool_process_query() *--------------------------------------------------------------------- */ #include #include #include #include "pool.h" #include "pool_config.h" #include "protocol/pool_proto_modules.h" #include "utils/pool_stream.h" #include "utils/elog.h" POOL_STATUS AsciiRow(POOL_CONNECTION * frontend, POOL_CONNECTION_POOL * backend, short num_fields) { static char nullmap[8192], nullmap1[8192]; int nbytes; int i, j; unsigned char mask; int size, size1 = 0; char *buf = NULL, *sendbuf = NULL; char msgbuf[1024]; pool_write(frontend, "D", 1); nbytes = (num_fields + 7) / 8; if (nbytes <= 0) return POOL_CONTINUE; /* NULL map */ pool_read(MASTER(backend), nullmap, nbytes); memcpy(nullmap1, nullmap, nbytes); for (i = 0; i < NUM_BACKENDS; i++) { if (VALID_BACKEND(i) && !IS_MASTER_NODE_ID(i)) { pool_read(CONNECTION(backend, i), nullmap, nbytes); if (memcmp(nullmap, nullmap1, nbytes)) { /* * XXX: NULLMAP maybe different among backends. If we were a * paranoid, we have to treat this as a fatal error. However * in the real world we'd better to adapt this situation. Just * throw a log... */ ereport(DEBUG1, (errmsg("processing ASCII row"), errdetail("NULLMAP is different between master and backend no %d", i))); } } } if (pool_write(frontend, nullmap1, nbytes) < 0) return POOL_END; mask = 0; for (i = 0; i < num_fields; i++) { if (mask == 0) mask = 0x80; /* NOT NULL? */ if (mask & nullmap[i / 8]) { /* field size */ if (pool_read(MASTER(backend), &size, sizeof(int)) < 0) return POOL_END; size1 = ntohl(size) - 4; /* read and send actual data only when size > 0 */ if (size1 > 0) { sendbuf = pool_read2(MASTER(backend), size1); if (sendbuf == NULL) return POOL_END; } /* forward to frontend */ pool_write(frontend, &size, sizeof(int)); if (size1 > 0) pool_write(frontend, sendbuf, size1); snprintf(msgbuf, Min(sizeof(msgbuf), size1 + 1), "%s", sendbuf); ereport(DEBUG1, (errmsg("processing ASCII row"), errdetail("len: %d data: %s", size1, msgbuf))); for (j = 0; j < NUM_BACKENDS; j++) { if (VALID_BACKEND(j) && !IS_MASTER_NODE_ID(j)) { /* field size */ if (pool_read(CONNECTION(backend, j), &size, sizeof(int)) < 0) return POOL_END; buf = NULL; size = ntohl(size) - 4; /* * XXX: field size maybe different among backends. If we * were a paranoid, we have to treat this as a fatal * error. However in the real world we'd better to adapt * this situation. Just throw a log... */ if (size != size1) ereport(DEBUG1, (errmsg("processing ASCII row"), errdetail("size of field no %d does not match between master [size:%d] and backend no %d [size:%d]", i, ntohl(size), j, ntohl(size1)))); /* read and send actual data only when size > 0 */ if (size > 0) { buf = pool_read2(CONNECTION(backend, j), size); if (buf == NULL) return POOL_END; } } } } mask >>= 1; } if (pool_flush(frontend)) return POOL_END; return POOL_CONTINUE; } POOL_STATUS BinaryRow(POOL_CONNECTION * frontend, POOL_CONNECTION_POOL * backend, short num_fields) { static char nullmap[8192], nullmap1[8192]; int nbytes; int i, j; unsigned char mask; int size, size1 = 0; char *buf = NULL; pool_write(frontend, "B", 1); nbytes = (num_fields + 7) / 8; if (nbytes <= 0) return POOL_CONTINUE; /* NULL map */ pool_read(MASTER(backend), nullmap, nbytes); if (pool_write(frontend, nullmap, nbytes) < 0) return POOL_END; memcpy(nullmap1, nullmap, nbytes); for (i = 0; i < NUM_BACKENDS; i++) { if (VALID_BACKEND(i) && !IS_MASTER_NODE_ID(i)) { pool_read(CONNECTION(backend, i), nullmap, nbytes); if (memcmp(nullmap, nullmap1, nbytes)) { /* * XXX: NULLMAP maybe different among backends. If we were a * paranoid, we have to treat this as a fatal error. However * in the real world we'd better to adapt this situation. Just * throw a log... */ ereport(DEBUG1, (errmsg("processing binary row"), errdetail("NULLMAP is different between master and backend no %d", i))); } } } mask = 0; for (i = 0; i < num_fields; i++) { if (mask == 0) mask = 0x80; /* NOT NULL? */ if (mask & nullmap[i / 8]) { /* field size */ if (pool_read(MASTER(backend), &size, sizeof(int)) < 0) return POOL_END; for (j = 0; j < NUM_BACKENDS; j++) { if (VALID_BACKEND(j) && !IS_MASTER_NODE_ID(j)) { /* field size */ if (pool_read(CONNECTION(backend, i), &size, sizeof(int)) < 0) return POOL_END; /* * XXX: field size maybe different among backends. If we * were a paranoid, we have to treat this as a fatal * error. However in the real world we'd better to adapt * this situation. Just throw a log... */ if (size != size1) ereport(DEBUG1, (errmsg("processing binary row"), errdetail("size of field no %d does not match between master [size:%d] and backend no %d [size:%d]", i, ntohl(size), j, ntohl(size1)))); } buf = NULL; /* forward to frontend */ if (IS_MASTER_NODE_ID(j)) pool_write(frontend, &size, sizeof(int)); size = ntohl(size) - 4; /* read and send actual data only when size > 0 */ if (size > 0) { buf = pool_read2(CONNECTION(backend, j), size); if (buf == NULL) return POOL_END; if (IS_MASTER_NODE_ID(j)) { pool_write(frontend, buf, size); } } } mask >>= 1; } } if (pool_flush(frontend)) return POOL_END; return POOL_CONTINUE; } POOL_STATUS CompletedResponse(POOL_CONNECTION * frontend, POOL_CONNECTION_POOL * backend) { int i; char *string = NULL; char *string1 = NULL; int len, len1 = 0; /* read command tag */ string = pool_read_string(MASTER(backend), &len, 0); if (string == NULL) return POOL_END; else if (!strncmp(string, "BEGIN", 5)) TSTATE(backend, MASTER_NODE_ID) = 'T'; else if (!strncmp(string, "COMMIT", 6) || !strncmp(string, "ROLLBACK", 8)) TSTATE(backend, MASTER_NODE_ID) = 'I'; len1 = len; string1 = pstrdup(string); for (i = 0; i < NUM_BACKENDS; i++) { if (!VALID_BACKEND(i) || IS_MASTER_NODE_ID(i)) continue; /* read command tag */ string = pool_read_string(CONNECTION(backend, i), &len, 0); if (string == NULL) ereport(FATAL, (return_code(2), errmsg("unable to process completed response"), errdetail("read from backend node %d failed", i))); else if (!strncmp(string, "BEGIN", 5)) TSTATE(backend, i) = 'T'; else if (!strncmp(string, "COMMIT", 6) || !strncmp(string, "ROLLBACK", 8)) TSTATE(backend, i) = 'I'; if (len != len1) { ereport(DEBUG1, (errmsg("processing completed response"), errdetail("message length does not match between master(%d \"%s\",) and %d th server (%d \"%s\",)", len, string, i, len1, string1))); /* we except INSERT, because INSERT response has OID */ if (strncmp(string1, "INSERT", 6)) { pfree(string1); return POOL_END; } } } /* forward to the frontend */ pool_write(frontend, "C", 1); ereport(DEBUG2, (errmsg("processing completed response"), errdetail("string: \"%s\"", string1))); pool_write(frontend, string1, len1); pfree(string1); return pool_flush(frontend); } POOL_STATUS CursorResponse(POOL_CONNECTION * frontend, POOL_CONNECTION_POOL * backend) { char *string = NULL; char *string1 = NULL; int len, len1 = 0; int i; /* read cursor name */ string = pool_read_string(MASTER(backend), &len, 0); if (string == NULL) return POOL_END; len1 = len; string1 = pstrdup(string); for (i = 0; i < NUM_BACKENDS; i++) { if (VALID_BACKEND(i) && !IS_MASTER_NODE_ID(i)) { /* read cursor name */ string = pool_read_string(CONNECTION(backend, i), &len, 0); if (string == NULL) ereport(FATAL, (return_code(2), errmsg("unable to process cursor response"), errdetail("read failed on backend node %d", i))); if (len != len1) { ereport(FATAL, (return_code(2), errmsg("unable to process cursor response"), errdetail("length does not match between master(%d) and %d th backend(%d)", len, i, len1), errhint("master(%s) %d th backend(%s)", string1, i, string))); } } } /* forward to the frontend */ pool_write(frontend, "P", 1); pool_write(frontend, string1, len1); pool_flush(frontend); pfree(string1); return POOL_CONTINUE; } void EmptyQueryResponse(POOL_CONNECTION * frontend, POOL_CONNECTION_POOL * backend) { char c; int i; for (i = 0; i < NUM_BACKENDS; i++) { if (VALID_BACKEND(i)) { pool_read(CONNECTION(backend, i), &c, sizeof(c)); } } pool_write(frontend, "I", 1); pool_write_and_flush(frontend, "", 1); } POOL_STATUS ErrorResponse(POOL_CONNECTION * frontend, POOL_CONNECTION_POOL * backend) { char *string = ""; int len = 0; int i; for (i = 0; i < NUM_BACKENDS; i++) { if (VALID_BACKEND(i)) { /* read error message */ string = pool_read_string(CONNECTION(backend, i), &len, 0); if (string == NULL) return POOL_END; } } /* forward to the frontend */ pool_write(frontend, "E", 1); pool_write_and_flush(frontend, string, len); /* * check session context, because this function is called by pool_do_auth * too. */ if (pool_get_session_context(true)) raise_intentional_error_if_need(backend); /* change transaction state */ for (i = 0; i < NUM_BACKENDS; i++) { if (VALID_BACKEND(i)) { if (TSTATE(backend, i) == 'T') TSTATE(backend, i) = 'E'; } } return POOL_CONTINUE; } POOL_STATUS FunctionResultResponse(POOL_CONNECTION * frontend, POOL_CONNECTION_POOL * backend) { char dummy; int len; char *result = NULL; int i; pool_write(frontend, "V", 1); for (i = 0; i < NUM_BACKENDS; i++) { if (VALID_BACKEND(i)) { pool_read(CONNECTION(backend, i), &dummy, 1); } } pool_write(frontend, &dummy, 1); /* non empty result? */ if (dummy == 'G') { for (i = 0; i < NUM_BACKENDS; i++) { if (VALID_BACKEND(i)) { /* length of result in bytes */ pool_read(CONNECTION(backend, i), &len, sizeof(len)); } } pool_write(frontend, &len, sizeof(len)); len = ntohl(len); for (i = 0; i < NUM_BACKENDS; i++) { if (VALID_BACKEND(i)) { /* result value itself */ if ((result = pool_read2(MASTER(backend), len)) == NULL) ereport(FATAL, (return_code(2), errmsg("unable to process function result response"), errdetail("reading from backend node %d failed", i))); } } if (result) pool_write(frontend, result, len); else ereport(FATAL, (return_code(2), errmsg("unable to process function result response"), errdetail("reading from backend node failed"))); } for (i = 0; i < NUM_BACKENDS; i++) { if (VALID_BACKEND(i)) { /* unused ('0') */ pool_read(MASTER(backend), &dummy, 1); } } pool_write(frontend, "0", 1); return pool_flush(frontend); } void NoticeResponse(POOL_CONNECTION * frontend, POOL_CONNECTION_POOL * backend) { char *string = NULL; int len = 0; int i; for (i = 0; i < NUM_BACKENDS; i++) { if (VALID_BACKEND(i)) { /* read notice message */ string = pool_read_string(CONNECTION(backend, i), &len, 0); if (string == NULL) ereport(FATAL, (return_code(2), errmsg("unable to process Notice response"), errdetail("reading from backend node %d failed", i))); } } /* forward to the frontend */ pool_write(frontend, "N", 1); if (string == NULL) ereport(FATAL, (return_code(2), errmsg("unable to process Notice response"), errdetail("reading from backend node failed"))); else pool_write_and_flush(frontend, string, len); } POOL_STATUS NotificationResponse(POOL_CONNECTION * frontend, POOL_CONNECTION_POOL * backend) { int pid, pid1; char *condition, *condition1 = NULL; int len, len1 = 0; int i; pool_write(frontend, "A", 1); for (i = 0; i < NUM_BACKENDS; i++) { if (VALID_BACKEND(i)) { pool_read(CONNECTION(backend, i), &pid, sizeof(pid)); condition = pool_read_string(CONNECTION(backend, i), &len, 0); if (condition == NULL) ereport(FATAL, (return_code(2), errmsg("unable to process Notification response"), errdetail("reading from backend node %d failed", i))); if (IS_MASTER_NODE_ID(i)) { pid1 = pid; len1 = len; if (condition1) pfree(condition1); condition1 = pstrdup(condition); } } } pool_write(frontend, &pid1, sizeof(pid1)); pool_write_and_flush(frontend, condition1, len1); pfree(condition1); return POOL_CONTINUE; } int RowDescription(POOL_CONNECTION * frontend, POOL_CONNECTION_POOL * backend, short *result) { short num_fields, num_fields1 = 0; int oid, mod; int oid1, mod1; short size, size1; char *string; int len, len1; int i; pool_read(MASTER(backend), &num_fields, sizeof(short)); num_fields1 = num_fields; for (i = 0; i < NUM_BACKENDS; i++) { if (VALID_BACKEND(i) && !IS_MASTER_NODE_ID(i)) { /* # of fields (could be 0) */ pool_read(CONNECTION(backend, i), &num_fields, sizeof(short)); if (num_fields != num_fields1) { ereport(FATAL, (return_code(2), errmsg("unable to process row description"), errdetail("num_fields does not match between backends master(%d) and %d th backend(%d)", num_fields, i, num_fields1))); } } } /* forward it to the frontend */ pool_write(frontend, "T", 1); pool_write(frontend, &num_fields, sizeof(short)); num_fields = ntohs(num_fields); for (i = 0; i < num_fields; i++) { int j; /* field name */ string = pool_read_string(MASTER(backend), &len, 0); if (string == NULL) return POOL_END; len1 = len; pool_write(frontend, string, len); for (j = 0; j < NUM_BACKENDS; j++) { if (VALID_BACKEND(j) && !IS_MASTER_NODE_ID(j)) { string = pool_read_string(CONNECTION(backend, j), &len, 0); if (string == NULL) ereport(FATAL, (return_code(2), errmsg("unable to process row description"), errdetail("read failed on backend node %d", j))); if (len != len1) { ereport(FATAL, (return_code(2), errmsg("unable to process row description"), errdetail("field length does not match between backends master(%d) and %d th backend(%d)", ntohl(len), j, ntohl(len1)))); } } } /* type oid */ pool_read(MASTER(backend), &oid, sizeof(int)); oid1 = oid; ereport(DEBUG1, (errmsg("processing ROW DESCRIPTION"), errdetail("type oid: %d", ntohl(oid)))); for (j = 0; j < NUM_BACKENDS; j++) { if (VALID_BACKEND(j) && !IS_MASTER_NODE_ID(j)) { pool_read(CONNECTION(backend, j), &oid, sizeof(int)); /* we do not regard oid mismatch as fatal */ if (oid != oid1) { ereport(DEBUG1, (errmsg("processing ROW DESCRIPTION"), errdetail("field oid does not match between backends master(%d) and %d th backend(%d)", ntohl(oid), j, ntohl(oid1)))); } } } pool_write(frontend, &oid1, sizeof(int)); /* size */ pool_read(MASTER(backend), &size, sizeof(short)); size1 = size; for (j = 0; j < NUM_BACKENDS; j++) { if (VALID_BACKEND(j) && !IS_MASTER_NODE_ID(j)) { pool_read(CONNECTION(backend, j), &size, sizeof(short)); if (size1 != size) { ereport(FATAL, (errmsg("data among backends are different"), errdetail("field size does not match between backends master(%d) and %d th backend(%d", ntohs(size), j, ntohs(size1)))); } } } ereport(DEBUG1, (errmsg("processing ROW DESCRIPTION"), errdetail("field size: %d", ntohs(size)))); pool_write(frontend, &size1, sizeof(short)); /* modifier */ pool_read(MASTER(backend), &mod, sizeof(int)); ereport(DEBUG1, (errmsg("processing ROW DESCRIPTION"), errdetail("modifier: %d", ntohs(mod)))); mod1 = mod; for (j = 0; j < NUM_BACKENDS; j++) { if (VALID_BACKEND(j) && !IS_MASTER_NODE_ID(j)) { pool_read(CONNECTION(backend, j), &mod, sizeof(int)); if (mod != mod1) { ereport(DEBUG1, (errmsg("processing ROW DESCRIPTION"), errdetail("modifier does not match between backends master(%d) and %d th backend(%d)", ntohl(mod), j, ntohl(mod1)))); } } } pool_write(frontend, &mod1, sizeof(int)); } *result = num_fields; return pool_flush(frontend); } pgpool-II-4.1.4/src/protocol/child.c0000664000175000017500000017706013730350127014135 00000000000000/* -*-pgsql-c-*- */ /* * $Header$ * * pgpool: a language independent connection pool server for PostgreSQL * written by Tatsuo Ishii * * Copyright (c) 2003-2019 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. * * child.c: child process main * */ #include "config.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 #include "pool.h" #include "utils/palloc.h" #include "utils/memutils.h" #include "context/pool_process_context.h" #include "context/pool_session_context.h" #include "pool_config.h" #include "pool_config_variables.h" #include "utils/pool_ip.h" #include "utils/pool_stream.h" #include "utils/elog.h" #include "auth/md5.h" #include "auth/pool_passwd.h" #include "auth/pool_hba.h" #include "utils/pool_relcache.h" static StartupPacket *read_startup_packet(POOL_CONNECTION * cp); static POOL_CONNECTION_POOL * connect_backend(StartupPacket *sp, POOL_CONNECTION * frontend); static RETSIGTYPE die(int sig); static RETSIGTYPE close_idle_connection(int sig); static RETSIGTYPE wakeup_handler(int sig); static RETSIGTYPE reload_config_handler(int sig); static RETSIGTYPE authentication_timeout(int sig); static void send_params(POOL_CONNECTION * frontend, POOL_CONNECTION_POOL * backend); static void send_frontend_exits(void); static int connection_count_up(void); static void connection_count_down(void); static bool connect_using_existing_connection(POOL_CONNECTION * frontend, POOL_CONNECTION_POOL * backend, StartupPacket *sp); static void check_restart_request(void); static void enable_authentication_timeout(void); static void disable_authentication_timeout(void); static int wait_for_new_connections(int *fds, struct timeval *timeout, SockAddr *saddr); static void check_config_reload(void); static void get_backends_status(unsigned int *valid_backends, unsigned int *down_backends); static void validate_backend_connectivity(int front_end_fd); static POOL_CONNECTION * get_connection(int front_end_fd, SockAddr *saddr); static POOL_CONNECTION_POOL * get_backend_connection(POOL_CONNECTION * frontend); static StartupPacket *StartupPacketCopy(StartupPacket *sp); static void print_process_status(char *remote_host, char *remote_port); static bool backend_cleanup(POOL_CONNECTION * volatile *frontend, POOL_CONNECTION_POOL * volatile backend, bool frontend_invalid); static void free_persisten_db_connection_memory(POOL_CONNECTION_POOL_SLOT * cp); static int choose_db_node_id(char *str); static void child_will_go_down(int code, Datum arg); static int opt_sort(const void *a, const void *b); /* * Non 0 means SIGTERM (smart shutdown) or SIGINT (fast shutdown) has arrived */ volatile sig_atomic_t exit_request = 0; static volatile sig_atomic_t alarm_enabled = false; /* * Ignore SIGUSR1 if requested. Used when DROP DATABASE is requested. */ volatile sig_atomic_t ignore_sigusr1 = 0; static int idle; /* non 0 means this child is in idle state */ static int accepted = 0; fd_set readmask; int nsocks; static int child_inet_fd = 0; static int child_unix_fd = 0; extern int myargc; extern char **myargv; char remote_ps_data[NI_MAXHOST + NI_MAXSERV + 2]; /* used for set_ps_display */ volatile sig_atomic_t got_sighup = 0; char remote_host[NI_MAXHOST]; /* client host */ char remote_port[NI_MAXSERV]; /* client port */ POOL_CONNECTION *volatile child_frontend = NULL; #ifdef DEBUG bool stop_now = false; #endif /* * child main loop */ void do_child(int *fds) { sigjmp_buf local_sigjmp_buf; POOL_CONNECTION_POOL *volatile backend = NULL; struct timeval now; struct timezone tz; struct timeval timeout; static int connected = 0; /* non 0 if has been accepted connections from * frontend */ int connections_count = 0; /* used if child_max_connections > 0 */ char psbuf[NI_MAXHOST + 128]; ereport(DEBUG2, (errmsg("I am Pgpool Child process with pid: %d", getpid()))); /* Identify myself via ps */ init_ps_display("", "", "", ""); /* set up signal handlers */ signal(SIGALRM, SIG_DFL); signal(SIGCHLD, SIG_DFL); signal(SIGTERM, die); signal(SIGINT, die); signal(SIGQUIT, die); signal(SIGHUP, reload_config_handler); signal(SIGUSR1, close_idle_connection); signal(SIGUSR2, wakeup_handler); signal(SIGPIPE, SIG_IGN); on_system_exit(child_will_go_down, (Datum) NULL); int *walk; #ifdef NONE_BLOCK /* set listen fds to none-blocking */ for (walk = fds; *walk != -1; walk++) pool_set_nonblock(*walk); #endif for (walk = fds; *walk != -1; walk++) { if (*walk > nsocks) nsocks = *walk; } nsocks++; FD_ZERO(&readmask); for (walk = fds; *walk != -1; walk++) FD_SET(*walk, &readmask); /* Create per loop iteration memory context */ ProcessLoopContext = AllocSetContextCreate(TopMemoryContext, "pgpool_child_main_loop", ALLOCSET_DEFAULT_MINSIZE, ALLOCSET_DEFAULT_INITSIZE, ALLOCSET_DEFAULT_MAXSIZE); MemoryContextSwitchTo(TopMemoryContext); /* Initialize my backend status */ pool_initialize_private_backend_status(); /* Initialize per process context */ pool_init_process_context(); /* initialize random seed */ gettimeofday(&now, &tz); #if defined(sun) || defined(__sun) srand((unsigned int) now.tv_usec); #else srandom((unsigned int) now.tv_usec); #endif /* initialize connection pool */ if (pool_init_cp()) { child_exit(POOL_EXIT_AND_RESTART); } /* * Open pool_passwd in child process. This is necessary to avoid the file * descriptor race condition reported in [pgpool-general: 1141]. */ if (strcmp("", pool_config->pool_passwd)) { pool_reopen_passwd_file(); } if (sigsetjmp(local_sigjmp_buf, 1) != 0) { POOL_PROCESS_CONTEXT *session; bool frontend_invalid = getfrontendinvalid(); disable_authentication_timeout(); /* Since not using PG_TRY, must reset error stack by hand */ error_context_stack = NULL; /* * Do not emit an error when EOF was encountered on frontend * connection before the session was initialized. This is the normal * behavior of psql to close and reconnect the connection when some * authentication method is used */ if (pool_get_session_context(true) || !child_frontend || child_frontend->socket_state != POOL_SOCKET_EOF) EmitErrorReport(); /* * process the cleanup in ProcessLoopContext which will get reset * during the next loop iteration */ MemoryContextSwitchTo(ProcessLoopContext); if (accepted) { accepted = 0; connection_count_down(); } backend_cleanup(&child_frontend, backend, frontend_invalid); session = pool_get_process_context(); if (session) { /* Destroy session context */ pool_session_context_destroy(); /* Mark this connection pool is not connected from frontend */ pool_coninfo_unset_frontend_connected(pool_get_process_context()->proc_id, pool_pool_index()); /* increment queries counter if necessary */ if (pool_config->child_max_connections > 0) connections_count++; /* check if maximum connections count for this child reached */ if ((pool_config->child_max_connections > 0) && (connections_count >= pool_config->child_max_connections)) { ereport(LOG, (errmsg("child exiting, %d connections reached", pool_config->child_max_connections))); child_exit(POOL_EXIT_AND_RESTART); } } if (child_frontend) { pool_close(child_frontend); child_frontend = NULL; } MemoryContextSwitchTo(TopMemoryContext); FlushErrorState(); } /* We can now handle ereport(ERROR) */ PG_exception_stack = &local_sigjmp_buf; timeout.tv_sec = pool_config->child_life_time; timeout.tv_usec = 0; for (;;) { StartupPacket *sp; int front_end_fd; SockAddr saddr; int con_count; /* reset per iteration memory context */ MemoryContextSwitchTo(ProcessLoopContext); MemoryContextResetAndDeleteChildren(ProcessLoopContext); backend = NULL; idle = 1; /* pgpool stop request already sent? */ check_stop_request(); check_restart_request(); accepted = 0; /* Destroy session context for just in case... */ pool_session_context_destroy(); front_end_fd = wait_for_new_connections(fds, &timeout, &saddr); if (front_end_fd == OPERATION_TIMEOUT) { if (pool_config->child_life_time > 0 && connected) { ereport(DEBUG1, (errmsg("child life %d seconds expired", pool_config->child_life_time))); child_exit(POOL_EXIT_AND_RESTART); } continue; } if (front_end_fd == RETRY) continue; /* * Check if max connections from clients execeeded. */ con_count = connection_count_up(); if (con_count > (pool_config->num_init_children - pool_config->reserved_connections)) { POOL_CONNECTION * cp; cp = pool_open(front_end_fd, false); if (cp == NULL) { connection_count_down(); continue; } connection_count_down(); pool_send_fatal_message(cp, 3, "53300", "Sorry, too many clients already", "", "", __FILE__, __LINE__); ereport(ERROR, (errcode(ERRCODE_TOO_MANY_CONNECTIONS), errmsg("Sorry, too many clients already"))); pool_close(cp); continue; } accepted = 1; check_config_reload(); validate_backend_connectivity(front_end_fd); child_frontend = get_connection(front_end_fd, &saddr); /* set frontend fd to blocking */ pool_unset_nonblock(child_frontend->fd); /* reset busy flag */ idle = 0; /* check backend timer is expired */ if (backend_timer_expired) { pool_backend_timer(); backend_timer_expired = 0; } backend = get_backend_connection(child_frontend); if (!backend) { pool_close(child_frontend); child_frontend = NULL; continue; } connected = 1; /* * show ps status */ sp = MASTER_CONNECTION(backend)->sp; snprintf(psbuf, sizeof(psbuf), "%s %s %s idle", sp->user, sp->database, remote_ps_data); set_ps_display(psbuf, false); /* * Initialize per session context */ pool_init_session_context(child_frontend, backend); /* * Set protocol versions */ pool_set_major_version(sp->major); pool_set_minor_version(sp->minor); /* * Mark this connection pool is connected from frontend */ pool_coninfo_set_frontend_connected(pool_get_process_context()->proc_id, pool_pool_index()); /* create memory context for query processing */ QueryContext = AllocSetContextCreate(ProcessLoopContext, "child_query_process", ALLOCSET_DEFAULT_MINSIZE, ALLOCSET_DEFAULT_INITSIZE, ALLOCSET_DEFAULT_MAXSIZE); /* query process loop */ for (;;) { POOL_STATUS status; /* Reset the query process memory context */ MemoryContextSwitchTo(QueryContext); MemoryContextResetAndDeleteChildren(QueryContext); status = pool_process_query(child_frontend, backend, 0); if (status != POOL_CONTINUE) { backend_cleanup(&child_frontend, backend, false); break; } } /* Destroy session context */ pool_session_context_destroy(); /* Mark this connection pool is not connected from frontend */ pool_coninfo_unset_frontend_connected(pool_get_process_context()->proc_id, pool_pool_index()); accepted = 0; connection_count_down(); timeout.tv_sec = pool_config->child_life_time; timeout.tv_usec = 0; /* increment queries counter if necessary */ if (pool_config->child_max_connections > 0) connections_count++; /* check if maximum connections count for this child reached */ if ((pool_config->child_max_connections > 0) && (connections_count >= pool_config->child_max_connections)) { ereport(LOG, (errmsg("child exiting, %d connections reached", pool_config->child_max_connections))); child_exit(POOL_EXIT_AND_RESTART); } } child_exit(POOL_EXIT_NO_RESTART); } /* ------------------------------------------------------------------- * private functions * ------------------------------------------------------------------- */ /* * function cleans up the backend connection, when process query returns with an error * return true if backend connection is cached */ static bool backend_cleanup(POOL_CONNECTION * volatile *frontend, POOL_CONNECTION_POOL * volatile backend, bool frontend_invalid) { StartupPacket *sp; bool cache_connection = false; if (backend == NULL) return false; sp = MASTER_CONNECTION(backend)->sp; /* * cach connection if connection cache configuration parameter is enabled * and frontend connection is not invalid */ if (sp && pool_config->connection_cache != 0 && frontend_invalid == false) { if (*frontend) { MemoryContext oldContext = CurrentMemoryContext; PG_TRY(); { if (pool_process_query(*frontend, backend, 1) == POOL_CONTINUE) { pool_connection_pool_timer(backend); cache_connection = true; } } PG_CATCH(); { /* ignore the error message */ MemoryContextSwitchTo(oldContext); FlushErrorState(); } PG_END_TRY(); } } if (cache_connection) { /* * For those special databases, and when frontend client exits * abnormally, we don't cache connection to backend. */ if ((sp && (!strcmp(sp->database, "template0") || !strcmp(sp->database, "template1") || !strcmp(sp->database, "postgres") || !strcmp(sp->database, "regression"))) || (*frontend != NULL && ((*frontend)->socket_state == POOL_SOCKET_EOF || (*frontend)->socket_state == POOL_SOCKET_ERROR))) cache_connection = false; } /* * Close frontend connection */ reset_connection(); pool_close(*frontend); *frontend = NULL; if (cache_connection == false) { pool_send_frontend_exits(backend); if (sp) pool_discard_cp(sp->user, sp->database, sp->major); } /* reset the config parameters */ reset_all_variables(NULL, NULL); return cache_connection; } /* * Read startup packet * * Read the startup packet and parse the contents. */ static StartupPacket * read_startup_packet(POOL_CONNECTION * cp) { StartupPacket *sp; StartupPacket_v2 *sp2; int protov; int len; char *p; char **guc_options; int opt_num = 0; char *sp_sort; char *tmpopt; int i; sp = (StartupPacket *) palloc0(sizeof(*sp)); enable_authentication_timeout(); /* read startup packet length */ pool_read_with_error(cp, &len, sizeof(len), "startup packet length"); len = ntohl(len); len -= sizeof(len); if (len <= 0 || len >= MAX_STARTUP_PACKET_LENGTH) ereport(ERROR, (errmsg("failed while reading startup packet"), errdetail("incorrect packet length (%d)", len))); sp->startup_packet = palloc0(len); /* read startup packet */ pool_read_with_error(cp, sp->startup_packet, len, "startup packet"); sp->len = len; memcpy(&protov, sp->startup_packet, sizeof(protov)); sp->major = ntohl(protov) >> 16; sp->minor = ntohl(protov) & 0x0000ffff; cp->protoVersion = sp->major; switch (sp->major) { case PROTO_MAJOR_V2: /* V2 */ sp2 = (StartupPacket_v2 *) (sp->startup_packet); sp->database = palloc0(SM_DATABASE + 1); strncpy(sp->database, sp2->database, SM_DATABASE); sp->user = palloc0(SM_USER + 1); strncpy(sp->user, sp2->user, SM_USER); break; case PROTO_MAJOR_V3: /* V3 */ /* copy startup_packet */ sp_sort = palloc0(len); memcpy(sp_sort,sp->startup_packet,len); p = sp_sort; p += sizeof(int); /* skip protocol version info */ /* count the number of options */ while (*p) { p += (strlen(p) + 1); /* skip option name */ p += (strlen(p) + 1); /* skip option value */ opt_num ++; } guc_options = (char **)palloc0(opt_num * sizeof(char *)); /* get guc_option name list */ p = sp_sort + sizeof(int); for (i = 0; i < opt_num; i++) { guc_options[i] = p; p += (strlen(p) + 1); /* skip option name */ p += (strlen(p) + 1); /* skip option value */ } /* sort option name using quick sort */ qsort( (void *)guc_options, opt_num, sizeof(char *), opt_sort ); p = sp->startup_packet + sizeof(int); /* skip protocol version info */ for (i = 0; i < opt_num; i++) { tmpopt = guc_options[i]; memcpy(p, tmpopt ,strlen(tmpopt) + 1); /* memcpy option name */ p += (strlen(tmpopt) + 1); tmpopt += (strlen(tmpopt) + 1); memcpy(p, tmpopt ,strlen(tmpopt) + 1); /* memcpy option value */ p += (strlen(tmpopt) + 1); } pfree(guc_options); pfree(sp_sort); p = sp->startup_packet; p += sizeof(int); /* skip protocol version info */ while (*p) { if (!strcmp("user", p)) { p += (strlen(p) + 1); sp->user = pstrdup(p); } else if (!strcmp("database", p)) { p += (strlen(p) + 1); sp->database = pstrdup(p); } /* * From 9.0, the start up packet may include application name. * After receiving such that packet, backend sends parameter * status of application_name. Upon reusing connection to * backend, we need to emulate this behavior of backend. So we * remember this and send parameter status packet to frontend * instead of backend in connect_using_existing_connection(). */ else if (!strcmp("application_name", p)) { p += (strlen(p) + 1); sp->application_name = p; ereport(DEBUG1, (errmsg("reading startup packet"), errdetail("application_name: %s", p))); } else { p += (strlen(p) + 1); } p += (strlen(p) + 1); } break; case 1234: /* cancel or SSL request */ /* set dummy database, user info */ sp->database = palloc0(1); sp->user = palloc(1); break; default: ereport(ERROR, (errmsg("failed while reading startup packet"), errdetail("invalid major no: %d in startup packet", sp->major))); } /* Check a user name was given. */ if (sp->major != 1234 && (sp->user == NULL || sp->user[0] == '\0')) { pool_send_fatal_message(cp, sp->major, "28000", "no PostgreSQL user name specified in startup packet", "", "", __FILE__, __LINE__); ereport(FATAL, (errmsg("failed while reading startup packet"), errdetail("no PostgreSQL user name specified in startup packet"))); } /* The database defaults to ther user name. */ if (sp->database == NULL || sp->database[0] == '\0') { sp->database = pstrdup(sp->user); } ereport(DEBUG1, (errmsg("reading startup packet"), errdetail("Protocol Major: %d Minor: %d database: %s user: %s", sp->major, sp->minor, sp->database, sp->user))); disable_authentication_timeout(); return sp; } /* * send startup packet */ void send_startup_packet(POOL_CONNECTION_POOL_SLOT * cp) { int len; len = htonl(cp->sp->len + sizeof(len)); pool_write(cp->con, &len, sizeof(len)); pool_write_and_flush(cp->con, cp->sp->startup_packet, cp->sp->len); } /* * Reuse existing connection */ static bool connect_using_existing_connection(POOL_CONNECTION * frontend, POOL_CONNECTION_POOL * backend, StartupPacket *sp) { int i, freed = 0; StartupPacket *topmem_sp = NULL; MemoryContext oldContext; MemoryContext frontend_auth_cxt; /* * Save startup packet info */ for (i = 0; i < NUM_BACKENDS; i++) { if (VALID_BACKEND(i)) { if (!freed) { oldContext = MemoryContextSwitchTo(TopMemoryContext); topmem_sp = StartupPacketCopy(sp); MemoryContextSwitchTo(oldContext); pool_free_startup_packet(backend->slots[i]->sp); backend->slots[i]->sp = NULL; freed = 1; } backend->slots[i]->sp = topmem_sp; } } /* Reuse existing connection to backend */ frontend_auth_cxt = AllocSetContextCreate(CurrentMemoryContext, "frontend_auth", ALLOCSET_DEFAULT_SIZES); oldContext = MemoryContextSwitchTo(frontend_auth_cxt); pool_do_reauth(frontend, backend); MemoryContextSwitchTo(oldContext); MemoryContextDelete(frontend_auth_cxt); if (MAJOR(backend) == 3) { char command_buf[1024]; /* * If we have received application_name in the start up packet, we * send SET command to backend. Also we add or replace existing * application_name data. */ if (sp->application_name) { snprintf(command_buf, sizeof(command_buf), "SET application_name TO '%s'", sp->application_name); for (i = 0; i < NUM_BACKENDS; i++) { if (VALID_BACKEND(i)) if (do_command(frontend, CONNECTION(backend, i), command_buf, MAJOR(backend), MASTER_CONNECTION(backend)->pid, MASTER_CONNECTION(backend)->key, 0) != POOL_CONTINUE) { ereport(ERROR, (errmsg("unable to process command for backend connection"), errdetail("do_command returned DEADLOCK status"))); } } pool_add_param(&MASTER(backend)->params, "application_name", sp->application_name); } send_params(frontend, backend); } /* Send ReadyForQuery to frontend */ pool_write(frontend, "Z", 1); if (MAJOR(backend) == 3) { int len; char tstate; len = htonl(5); pool_write(frontend, &len, sizeof(len)); tstate = TSTATE(backend, MASTER_NODE_ID); pool_write(frontend, &tstate, 1); } pool_flush(frontend); return true; } /* * process cancel request */ void cancel_request(CancelPacket * sp) { int len; int fd; POOL_CONNECTION *con; int i, j, k; ConnectionInfo *c = NULL; CancelPacket cp; bool found = false; if (pool_config->log_client_messages) ereport(LOG, (errmsg("Cancel message from frontend."), errdetail("process id: %d", ntohl(sp->pid)))); ereport(DEBUG1, (errmsg("Cancel request received"))); /* look for cancel key from shmem info */ for (i = 0; i < pool_config->num_init_children; i++) { for (j = 0; j < pool_config->max_pool; j++) { for (k = 0; k < NUM_BACKENDS; k++) { c = pool_coninfo(i, j, k); ereport(DEBUG2, (errmsg("processing cancel request"), errdetail("connection info: address:%p database:%s user:%s pid:%d key:%d i:%d", c, c->database, c->user, ntohl(c->pid), ntohl(c->key), i))); if (c->pid == sp->pid && c->key == sp->key) { ereport(DEBUG1, (errmsg("processing cancel request"), errdetail("found pid:%d key:%d i:%d", ntohl(c->pid), ntohl(c->key), i))); c = pool_coninfo(i, j, 0); found = true; goto found; } } } } found: if (!found) { ereport(LOG, (errmsg("invalid cancel key: pid:%d key:%d", ntohl(sp->pid), ntohl(sp->key)))); return; /* invalid key */ } for (i = 0; i < NUM_BACKENDS; i++, c++) { if (!VALID_BACKEND(i)) continue; if (*(BACKEND_INFO(i).backend_hostname) == '/') fd = connect_unix_domain_socket(i, TRUE); else fd = connect_inet_domain_socket(i, TRUE); if (fd < 0) { ereport(LOG, (errmsg("Could not create socket for sending cancel request for backend %d", i))); return; } con = pool_open(fd, true); if (con == NULL) return; pool_set_db_node_id(con, i); len = htonl(sizeof(len) + sizeof(CancelPacket)); pool_write(con, &len, sizeof(len)); cp.protoVersion = sp->protoVersion; cp.pid = c->pid; cp.key = c->key; ereport(LOG, (errmsg("forwarding cancel request to backend"), errdetail("canceling backend pid:%d key: %d", ntohl(cp.pid), ntohl(cp.key)))); if (pool_write_and_flush_noerror(con, &cp, sizeof(CancelPacket)) < 0) ereport(WARNING, (errmsg("failed to send cancel request to backend %d", i))); pool_close(con); /* * this is needed to ensure that the next DB node executes the query * supposed to be canceled. */ sleep(1); } } static StartupPacket * StartupPacketCopy(StartupPacket *sp) { StartupPacket *new_sp; /* verify the length first */ if (sp->len <= 0 || sp->len >= MAX_STARTUP_PACKET_LENGTH) ereport(ERROR, (errmsg("incorrect packet length (%d)", sp->len))); new_sp = (StartupPacket *) palloc0(sizeof(*sp)); new_sp->startup_packet = palloc0(sp->len); memcpy(new_sp->startup_packet, sp->startup_packet, sp->len); new_sp->len = sp->len; new_sp->major = sp->major; new_sp->minor = sp->minor; new_sp->database = pstrdup(sp->database); new_sp->user = pstrdup(sp->user); if (new_sp->major == PROTO_MAJOR_V3 && sp->application_name) { /* adjust the application name pointer in new packet */ new_sp->application_name = new_sp->startup_packet + (sp->application_name - sp->startup_packet); } return new_sp; } static POOL_CONNECTION_POOL * connect_backend(StartupPacket *sp, POOL_CONNECTION * frontend) { POOL_CONNECTION_POOL *backend; StartupPacket *volatile topmem_sp = NULL; volatile bool topmem_sp_set = false; int i; /* connect to the backend */ backend = pool_create_cp(); if (backend == NULL) { pool_send_error_message(frontend, sp->major, "XX000", "all backend nodes are down, pgpool requires at least one valid node", "", "repair the backend nodes and restart pgpool", __FILE__, __LINE__); ereport(ERROR, (errmsg("unable to connect to backend"), errdetail("all backend nodes are down, pgpool requires at least one valid node"), errhint("repair the backend nodes and restart pgpool"))); } PG_TRY(); { MemoryContext frontend_auth_cxt; MemoryContext oldContext = MemoryContextSwitchTo(TopMemoryContext); topmem_sp = StartupPacketCopy(sp); MemoryContextSwitchTo(oldContext); for (i = 0; i < NUM_BACKENDS; i++) { if (VALID_BACKEND(i)) { /* set DB node id */ pool_set_db_node_id(CONNECTION(backend, i), i); /* mark this is a backend connection */ CONNECTION(backend, i)->isbackend = 1; pool_ssl_negotiate_clientserver(CONNECTION(backend, i)); /* * save startup packet info */ CONNECTION_SLOT(backend, i)->sp = topmem_sp; topmem_sp_set = true; /* send startup packet */ send_startup_packet(CONNECTION_SLOT(backend, i)); } } /* * do authentication stuff */ frontend_auth_cxt = AllocSetContextCreate(CurrentMemoryContext, "frontend_auth", ALLOCSET_DEFAULT_SIZES); oldContext = MemoryContextSwitchTo(frontend_auth_cxt); pool_do_auth(frontend, backend); MemoryContextSwitchTo(oldContext); MemoryContextDelete(frontend_auth_cxt); } PG_CATCH(); { pool_discard_cp(sp->user, sp->database, sp->major); topmem_sp = NULL; PG_RE_THROW(); } PG_END_TRY(); /* At this point, we need to free previously allocated memory for the * startup packet if no backend is up. */ if (!topmem_sp_set && topmem_sp != NULL) pfree(topmem_sp); return backend; } /* * signal handler for SIGTERM, SIGINT and SIGQUUT */ static RETSIGTYPE die(int sig) { int save_errno; POOL_SETMASK(&BlockSig); save_errno = errno; #ifdef NOT_USED ereport(LOG, (errmsg("child process received shutdown request signal %d", sig))); #endif exit_request = sig; switch (sig) { case SIGTERM: /* smart shutdown */ /* Refuse further requests by closing listen socket */ if (child_inet_fd) { #ifdef NOT_USED ereport(LOG, (errmsg("closing listen socket"))); #endif close(child_inet_fd); } close(child_unix_fd); if (idle == 0) { #ifdef NOT_USED ereport(DEBUG1, (errmsg("smart shutdown request received, but child is not in idle state"))); #endif } break; case SIGINT: /* fast shutdown */ case SIGQUIT: /* immediate shutdown */ POOL_SETMASK(&UnBlockSig); child_exit(POOL_EXIT_NO_RESTART); break; default: #ifdef NOT_USED ereport(LOG, (errmsg("child process received unknown signal: %d", sig), errdetail("ignoring..."))); #endif break; } errno = save_errno; POOL_SETMASK(&UnBlockSig); } /* * signal handler for SIGUSR1 * close all idle connections */ static RETSIGTYPE close_idle_connection(int sig) { int i, j; POOL_CONNECTION_POOL *p = pool_connection_pool; ConnectionInfo *info; int save_errno = errno; /* * DROP DATABSE is ongoing. */ if (ignore_sigusr1) return; #ifdef NOT_USED ereport(DEBUG1, (errmsg("close connection request received"))); #endif for (j = 0; j < pool_config->max_pool; j++, p++) { if (!MASTER_CONNECTION(p)) continue; if (!MASTER_CONNECTION(p)->sp) continue; if (MASTER_CONNECTION(p)->sp->user == NULL) continue; if (MASTER_CONNECTION(p)->closetime > 0) /* idle connection? */ { #ifdef NOT_USED ereport(DEBUG1, (errmsg("closing idle connection"), errdetail("user: %s database: %s", MASTER_CONNECTION(p)->sp->user, MASTER_CONNECTION(p)->sp->database))); #endif pool_send_frontend_exits(p); for (i = 0; i < NUM_BACKENDS; i++) { if (!VALID_BACKEND(i)) continue; if (i == 0) { /* * only first backend allocated the memory for the start * up packet */ pool_free_startup_packet(CONNECTION_SLOT(p, i)->sp); CONNECTION_SLOT(p, i)->sp = NULL; } pool_close(CONNECTION(p, i)); } info = p->info; memset(p, 0, sizeof(POOL_CONNECTION_POOL)); p->info = info; memset(p->info, 0, sizeof(ConnectionInfo)); } } errno = save_errno; } /* * signal handler for SIGALRM * */ static RETSIGTYPE authentication_timeout(int sig) { alarm_enabled = false; ereport(LOG, (errmsg("authentication timeout"))); child_exit(POOL_EXIT_AND_RESTART); } static void enable_authentication_timeout(void) { if (pool_config->authentication_timeout <= 0) return; pool_alarm(authentication_timeout, pool_config->authentication_timeout); alarm_enabled = true; } static void disable_authentication_timeout(void) { if (alarm_enabled) { pool_undo_alarm(); alarm_enabled = false; } } /* * send frontend exiting messages to all connections. this is called * in any case when child process exits, for example failover, child * life time expires or child max connections expires. */ static void send_frontend_exits(void) { int i; POOL_CONNECTION_POOL *p = pool_connection_pool; pool_sigset_t oldmask; POOL_SETMASK2(&BlockSig, &oldmask); for (i = 0; i < pool_config->max_pool; i++, p++) { if (!MASTER_CONNECTION(p)) continue; if (!MASTER_CONNECTION(p)->sp) continue; if (MASTER_CONNECTION(p)->sp->user == NULL) continue; pool_send_frontend_exits(p); } POOL_SETMASK(&oldmask); } static void send_params(POOL_CONNECTION * frontend, POOL_CONNECTION_POOL * backend) { int index; char *name, *value; int len, sendlen; index = 0; while (pool_get_param(&MASTER(backend)->params, index++, &name, &value) == 0) { pool_write(frontend, "S", 1); len = sizeof(sendlen) + strlen(name) + 1 + strlen(value) + 1; sendlen = htonl(len); pool_write(frontend, &sendlen, sizeof(sendlen)); pool_write(frontend, name, strlen(name) + 1); pool_write(frontend, value, strlen(value) + 1); } if (pool_flush(frontend)) { ereport(ERROR, (errmsg("unable to send params to frontend"), errdetail("pool_flush failed"))); } } void pool_free_startup_packet(StartupPacket *sp) { if (sp) { if (sp->startup_packet) pfree(sp->startup_packet); if (sp->database) pfree(sp->database); if (sp->user) pfree(sp->user); pfree(sp); } sp = NULL; } /* * Do house keeping works when pgpool child process exits */ static void child_will_go_down(int code, Datum arg) { if (processType != PT_CHILD) { /* should never happen */ ereport(WARNING, (errmsg("child_exit: called from invalid process. ignored."))); return; } /* count down global connection counter */ if (accepted) connection_count_down(); if ((pool_config->memory_cache_enabled || pool_config->enable_shared_relcache) && !pool_is_shmem_cache()) { memcached_disconnect(); } /* let backend know now we are exiting */ if (pool_connection_pool) send_frontend_exits(); } void child_exit(int code) { if (processType != PT_CHILD) { /* should never happen */ /* * Remove call to ereport because child_exit() is called inside a * signal handler. */ #ifdef NOT_USED ereport(WARNING, (errmsg("child_exit: called from invalid process. ignored."))); #endif return; } exit(code); } /* * create a persistent connection */ POOL_CONNECTION_POOL_SLOT * make_persistent_db_connection( int db_node_id, char *hostname, int port, char *dbname, char *user, char *password, bool retry) { POOL_CONNECTION_POOL_SLOT *cp; int fd; #define MAX_USER_AND_DATABASE 1024 /* V3 startup packet */ typedef struct { int protoVersion; char data[MAX_USER_AND_DATABASE]; } StartupPacket_v3; static StartupPacket_v3 * startup_packet; int len, len1; cp = palloc0(sizeof(POOL_CONNECTION_POOL_SLOT)); startup_packet = palloc0(sizeof(*startup_packet)); startup_packet->protoVersion = htonl(0x00030000); /* set V3 proto * major/minor */ /* * create socket */ if (*hostname == '/') { fd = connect_unix_domain_socket_by_port(port, hostname, retry); } else { fd = connect_inet_domain_socket_by_port(hostname, port, retry); } if (fd < 0) { free_persisten_db_connection_memory(cp); pfree(startup_packet); ereport(ERROR, (errmsg("failed to make persistent db connection"), errdetail("connection to host:\"%s:%d\" failed", hostname, port))); } cp->con = pool_open(fd, true); cp->closetime = 0; cp->con->isbackend = 1; pool_set_db_node_id(cp->con, db_node_id); pool_ssl_negotiate_clientserver(cp->con); /* * build V3 startup packet */ len = snprintf(startup_packet->data, sizeof(startup_packet->data), "user") + 1; len1 = snprintf(&startup_packet->data[len], sizeof(startup_packet->data) - len, "%s", user) + 1; if (len1 >= (sizeof(startup_packet->data) - len)) { pool_close(cp->con); free_persisten_db_connection_memory(cp); pfree(startup_packet); ereport(ERROR, (errmsg("failed to make persistent db connection"), errdetail("user name is too long"))); } len += len1; len1 = snprintf(&startup_packet->data[len], sizeof(startup_packet->data) - len, "database") + 1; if (len1 >= (sizeof(startup_packet->data) - len)) { pool_close(cp->con); free_persisten_db_connection_memory(cp); pfree(startup_packet); ereport(ERROR, (errmsg("failed to make persistent db connection"), errdetail("user name is too long"))); } len += len1; len1 = snprintf(&startup_packet->data[len], sizeof(startup_packet->data) - len, "%s", dbname) + 1; if (len1 >= (sizeof(startup_packet->data) - len)) { pool_close(cp->con); free_persisten_db_connection_memory(cp); pfree(startup_packet); ereport(ERROR, (errmsg("failed to make persistent db connection"), errdetail("database name is too long"))); } len += len1; startup_packet->data[len++] = '\0'; cp->sp = palloc(sizeof(StartupPacket)); cp->sp->startup_packet = (char *) startup_packet; cp->sp->len = len + 4; cp->sp->major = 3; cp->sp->minor = 0; cp->sp->database = pstrdup(dbname); cp->sp->user = pstrdup(user); /* * send startup packet */ PG_TRY(); { send_startup_packet(cp); connection_do_auth(cp, password); } PG_CATCH(); { pool_close(cp->con); free_persisten_db_connection_memory(cp); PG_RE_THROW(); } PG_END_TRY(); return cp; } /* * make_persistent_db_connection_noerror() is a wrapper over * make_persistent_db_connection() which does not ereports in case of an error */ POOL_CONNECTION_POOL_SLOT * make_persistent_db_connection_noerror( int db_node_id, char *hostname, int port, char *dbname, char *user, char *password, bool retry) { POOL_CONNECTION_POOL_SLOT *slot = NULL; MemoryContext oldContext = CurrentMemoryContext; PG_TRY(); { slot = make_persistent_db_connection(db_node_id, hostname, port, dbname, user, password, retry); } PG_CATCH(); { EmitErrorReport(); MemoryContextSwitchTo(oldContext); FlushErrorState(); slot = NULL; } PG_END_TRY(); return slot; } /* * Free memory of POOL_CONNECTION_POOL_SLOT. Should only be used in * make_persistent_db_connection and discard_persistent_db_connection. */ void free_persisten_db_connection_memory(POOL_CONNECTION_POOL_SLOT * cp) { if (!cp) return; if (!cp->sp) { pfree(cp); return; } if (cp->sp->startup_packet) pfree(cp->sp->startup_packet); if (cp->sp->database) pfree(cp->sp->database); if (cp->sp->user) pfree(cp->sp->user); pfree(cp->sp); pfree(cp); } /* * Discard connection and memory allocated by * make_persistent_db_connection(). */ void discard_persistent_db_connection(POOL_CONNECTION_POOL_SLOT * cp) { int len; if (cp == NULL) return; pool_write(cp->con, "X", 1); len = htonl(4); pool_write(cp->con, &len, sizeof(len)); /* * XXX we cannot call pool_flush() here since backend may already close * the socket and pool_flush() automatically invokes fail over handler. * This could happen in copy command (remember the famous "lost * synchronization with server, resetting connection" message) */ pool_set_nonblock(cp->con->fd); pool_flush_it(cp->con); pool_unset_nonblock(cp->con->fd); pool_close(cp->con); free_persisten_db_connection_memory(cp); } /* * Count up connection counter (from frontend to pgpool) in shared memory and * returns current counter value. Please note that the returned value may not * be up to date since locking has been already released. */ static int connection_count_up(void) { pool_sigset_t oldmask; POOL_SETMASK2(&BlockSig, &oldmask); pool_semaphore_lock(CONN_COUNTER_SEM); Req_info->conn_counter++; elog(DEBUG5, "connection_count_up: number of connected children: %d", Req_info->conn_counter); pool_semaphore_unlock(CONN_COUNTER_SEM); POOL_SETMASK(&oldmask); return Req_info->conn_counter; } /* * Count down connection counter (from frontend to pgpool) * in shared memory */ static void connection_count_down(void) { pool_sigset_t oldmask; POOL_SETMASK2(&BlockSig, &oldmask); pool_semaphore_lock(CONN_COUNTER_SEM); /* * Make sure that we do not decrement too much. If failed to read a start * up packet, or receive cancel request etc., connection_count_down() is * called and goes back to the connection accept loop. Problem is, at the * very beginning of the connection accept loop, if we have received a * signal, we call child_exit() which calls connection_count_down() again. */ if (Req_info->conn_counter > 0) Req_info->conn_counter--; elog(DEBUG5, "connection_count_down: number of connected children: %d", Req_info->conn_counter); pool_semaphore_unlock(CONN_COUNTER_SEM); POOL_SETMASK(&oldmask); } /* * handle SIGUSR2 * Wakeup all process */ static RETSIGTYPE wakeup_handler(int sig) { } /* * Select load balancing node. This function is called when: * 1) client connects * 2) the node previously selected for the load balance node is down */ int select_load_balancing_node(void) { int selected_slot; double total_weight, r; int i; int index_db = -1, index_app = -1; POOL_SESSION_CONTEXT *ses = pool_get_session_context(false); int tmp; int no_load_balance_node_id = -2; /* * -2 indicates there's no database_redirect_preference_list. -1 indicates * database_redirect_preference_list exists and any of standby nodes * specified. */ int suggested_node_id = -2; #if defined(sun) || defined(__sun) r = (((double) rand()) / RAND_MAX); #else r = (((double) random()) / RAND_MAX); #endif /* * Check database_redirect_preference_list */ if (SL_MODE && pool_config->redirect_dbnames) { char *database = MASTER_CONNECTION(ses->backend)->sp->database; /* * Check to see if the database matches any of * database_redirect_preference_list */ index_db = regex_array_match(pool_config->redirect_dbnames, database); if (index_db >= 0) { /* Matches */ ereport(DEBUG1, (errmsg("selecting load balance node db matched"), errdetail("dbname: %s index is %d dbnode is %s weight is %f", database, index_db, pool_config->db_redirect_tokens->token[index_db].right_token, pool_config->db_redirect_tokens->token[index_db].weight_token))); tmp = choose_db_node_id(pool_config->db_redirect_tokens->token[index_db].right_token); if (tmp == -1 || (tmp >= 0 && VALID_BACKEND(tmp))) suggested_node_id = tmp; } } /* * Check app_name_redirect_preference_list */ if (SL_MODE && pool_config->redirect_app_names) { char *app_name = MASTER_CONNECTION(ses->backend)->sp->application_name; /* * Check only if application name is set. Old applications may not * have application name. */ if (app_name && strlen(app_name) > 0) { /* * Check to see if the aplication name matches any of * app_name_redirect_preference_list. */ index_app = regex_array_match(pool_config->redirect_app_names, app_name); if (index_app >= 0) { /* * if the aplication name matches any of * app_name_redirect_preference_list, * database_redirect_preference_list will be ignored. */ index_db = -1; /* Matches */ ereport(DEBUG1, (errmsg("selecting load balance node db matched"), errdetail("app_name: %s index is %d dbnode is %s weight is %f", app_name, index_app, pool_config->app_name_redirect_tokens->token[index_app].right_token, pool_config->app_name_redirect_tokens->token[index_app].weight_token))); tmp = choose_db_node_id(pool_config->app_name_redirect_tokens->token[index_app].right_token); if (tmp == -1 || (tmp >= 0 && VALID_BACKEND(tmp))) suggested_node_id = tmp; } } } if (suggested_node_id >= 0) { /* * If the weight is bigger than random rate then send to * suggested_node_id. If the weight is less than random rate then * choose load balance node from other nodes. */ if ((index_db >= 0 && r <= pool_config->db_redirect_tokens->token[index_db].weight_token) || (index_app >= 0 && r <= pool_config->app_name_redirect_tokens->token[index_app].weight_token)) { ereport(DEBUG1, (errmsg("selecting load balance node"), errdetail("selected backend id is %d", suggested_node_id))); return suggested_node_id; } else no_load_balance_node_id = suggested_node_id; } /* In case of sending to standby */ if (suggested_node_id == -1) { /* If the weight is less than random rate then send to primary. */ if ((index_db >= 0 && r > pool_config->db_redirect_tokens->token[index_db].weight_token) || (index_app >= 0 && r > pool_config->app_name_redirect_tokens->token[index_app].weight_token)) { ereport(DEBUG1, (errmsg("selecting load balance node"), errdetail("selected backend id is %d", PRIMARY_NODE_ID))); return PRIMARY_NODE_ID; } } /* Choose a backend in random manner with weight */ selected_slot = MASTER_NODE_ID; total_weight = 0.0; for (i = 0; i < NUM_BACKENDS; i++) { if (VALID_BACKEND_RAW(i)) { if (i == no_load_balance_node_id) continue; if (suggested_node_id == -1) { if (i != PRIMARY_NODE_ID) total_weight += BACKEND_INFO(i).backend_weight; } else total_weight += BACKEND_INFO(i).backend_weight; } } #if defined(sun) || defined(__sun) r = (((double) rand()) / RAND_MAX) * total_weight; #else r = (((double) random()) / RAND_MAX) * total_weight; #endif total_weight = 0.0; for (i = 0; i < NUM_BACKENDS; i++) { if ((suggested_node_id == -1 && i == PRIMARY_NODE_ID) || i == no_load_balance_node_id) continue; if (VALID_BACKEND_RAW(i) && BACKEND_INFO(i).backend_weight > 0.0) { if (r >= total_weight) selected_slot = i; else break; total_weight += BACKEND_INFO(i).backend_weight; } } ereport(DEBUG1, (errmsg("selecting load balance node"), errdetail("selected backend id is %d", selected_slot))); return selected_slot; } /* SIGHUP handler */ static RETSIGTYPE reload_config_handler(int sig) { got_sighup = 1; } /* * Exit myself if SIGTERM, SIGINT or SIGQUIT has been sent */ void check_stop_request(void) { /* * If smart shutdown was requested but we are not in idle state, do not * exit */ if (exit_request == SIGTERM && idle == 0) return; if (exit_request) { reset_variables(); child_exit(POOL_EXIT_NO_RESTART); } } /* * Initialize my backend status and master node id. * We copy the backend status to private area so that * they are not changed while I am alive. */ void pool_initialize_private_backend_status(void) { int i; ereport(DEBUG1, (errmsg("initializing backend status"))); for (i = 0; i < MAX_NUM_BACKENDS; i++) { private_backend_status[i] = BACKEND_INFO(i).backend_status; /* my_backend_status is referred to by VALID_BACKEND macro. */ my_backend_status[i] = &private_backend_status[i]; } my_master_node_id = REAL_MASTER_NODE_ID; } static void check_restart_request(void) { /* * Check if restart request is set because of failback event happend. If * so, exit myself with exit code 1 to be restarted by pgpool parent. */ if (pool_get_my_process_info()->need_to_restart) { ereport(LOG, (errmsg("failover or failback event detected"), errdetail("restarting myself"))); pool_get_my_process_info()->need_to_restart = 0; child_exit(POOL_EXIT_AND_RESTART); } } /* * wait_for_new_connections() * functions calls select on sockets and wait for new client * to connect, on successfull connection returns the socket descriptor * and returns -1 if timeout has occured */ static int wait_for_new_connections(int *fds, struct timeval *timeout, SockAddr *saddr) { fd_set rmask; int numfds; int save_errno; int fd = 0; int afd; int *walk; int on; #ifdef ACCEPT_PERFORMANCE struct timeval now1, now2; static long atime; static int cnt; #endif struct timeval *timeoutval; struct timeval tv1, tv2, tmback = {0, 0}; for (walk = fds; *walk != -1; walk++) pool_set_nonblock(*walk); if (SERIALIZE_ACCEPT) set_ps_display("wait for accept lock", false); else set_ps_display("wait for connection request", false); memcpy((char *) &rmask, (char *) &readmask, sizeof(fd_set)); if (timeout->tv_sec == 0 && timeout->tv_usec == 0) timeoutval = NULL; else { timeoutval = timeout; tmback.tv_sec = timeout->tv_sec; tmback.tv_usec = timeout->tv_usec; gettimeofday(&tv1, NULL); #ifdef DEBUG ereport(DEBUG3, (errmsg("before select = {%d, %d}", timeoutval->tv_sec, timeoutval->tv_usec))); ereport(DEBUG3, (errmsg("g:before select = {%d, %d}", tv1.tv_sec, tv1.tv_usec))); #endif } /* * If child life time is disabled and serialize_accept is on, we serialize * select() and accept() to avoid the "Thundering herd" problem. */ if (SERIALIZE_ACCEPT) { if (pool_config->connection_life_time == 0) { pool_semaphore_lock(ACCEPT_FD_SEM); } else { int sts; for (;;) { sts = pool_semaphore_lock_allow_interrupt(ACCEPT_FD_SEM); /* Interrupted by alarm */ if (sts == -2) { /* * Check if there are expired connection_life_time. */ if (backend_timer_expired) { /* * We add 10 seconds to connection_life_time so that there's * enough margin. */ int seconds = pool_config->connection_life_time + 10; while (seconds-- > 0) { /* check backend timer is expired */ if (backend_timer_expired) { pool_backend_timer(); backend_timer_expired = 0; break; } sleep(1); } } } else /* success or other error */ break; } } set_ps_display("wait for connection request", false); ereport(DEBUG1, (errmsg("LOCKING select()"))); } numfds = select(nsocks, &rmask, NULL, NULL, timeoutval); save_errno = errno; if (SERIALIZE_ACCEPT) { pool_semaphore_unlock(ACCEPT_FD_SEM); ereport(DEBUG1, (errmsg("UNLOCKING select()"))); } /* check backend timer is expired */ if (backend_timer_expired) { pool_backend_timer(); backend_timer_expired = 0; } /* * following code fragment computes remaining timeout val in a portable * way. Linux does this automatically but other platforms do not. */ if (timeoutval) { gettimeofday(&tv2, NULL); tmback.tv_usec -= tv2.tv_usec - tv1.tv_usec; tmback.tv_sec -= tv2.tv_sec - tv1.tv_sec; if (tmback.tv_usec < 0) { tmback.tv_sec--; if (tmback.tv_sec < 0) { timeout->tv_sec = 0; timeout->tv_usec = 0; } else { tmback.tv_usec += 1000000; timeout->tv_sec = tmback.tv_sec; timeout->tv_usec = tmback.tv_usec; } } #ifdef DEBUG ereport(DEBUG3, (errmsg("g:after select = {%d, %d}", tv2.tv_sec, tv2.tv_usec))); ereport(DEBUG3, (errmsg("after select = {%d, %d}", timeout->tv_sec, timeout->tv_usec))); #endif } errno = save_errno; if (numfds == -1) { if (errno == EAGAIN || errno == EINTR) return RETRY; ereport(ERROR, (errmsg("failed to accept user connection"), errdetail("select on socket failed with error : \"%s\"", strerror(errno)))); } /* timeout */ if (numfds == 0) { return OPERATION_TIMEOUT; } for (walk = fds; *walk != -1; walk++) { if (FD_ISSET(*walk, &rmask)) { fd = *walk; break; } } /* * Note that some SysV systems do not work here. For those systems, we * need some locking mechanism for the fd. */ memset(saddr, 0, sizeof(*saddr)); saddr->salen = sizeof(saddr->addr); #ifdef ACCEPT_PERFORMANCE gettimeofday(&now1, 0); #endif retry_accept: /* wait if recovery is started */ while (*InRecovery == 1) { pause(); } afd = accept(fd, (struct sockaddr *) &saddr->addr, &saddr->salen); save_errno = errno; /* check backend timer is expired */ if (backend_timer_expired) { pool_backend_timer(); backend_timer_expired = 0; } errno = save_errno; if (afd < 0) { if (errno == EINTR && *InRecovery) goto retry_accept; /* * "Resource temporarily unavailable" (EAGAIN or EWOULDBLOCK) can be * silently ignored. And EINTR can be ignored. */ if (errno != EAGAIN && errno != EWOULDBLOCK && errno != EINTR) ereport(ERROR, (errmsg("failed to accept user connection"), errdetail("accept on socket failed with error : \"%s\"", strerror(errno)))); return RETRY; } /* * Set no delay if AF_INET socket. Not sure if this is really necessary * but PostgreSQL does this. */ if (!FD_ISSET(fds[0], &rmask)) /* fds[0] is UNIX domain socket */ { on = 1; if (setsockopt(afd, IPPROTO_TCP, TCP_NODELAY, (char *) &on, sizeof(on)) < 0) { ereport(WARNING, (errmsg("wait_for_new_connections: setsockopt failed with error \"%s\"", strerror(errno)))); close(afd); return -1; } } /* * Make sure that the socket is non blocking. */ pool_unset_nonblock(afd); #ifdef ACCEPT_PERFORMANCE gettimeofday(&now2, 0); atime += (now2.tv_sec - now1.tv_sec) * 1000000 + (now2.tv_usec - now1.tv_usec); cnt++; if (cnt % 100 == 0) { ereport(LOG, (errmsg("cnt: %d atime: %ld", cnt, atime))); } #endif return afd; } static void check_config_reload(void) { /* reload config file */ if (got_sighup) { MemoryContext oldContext = MemoryContextSwitchTo(TopMemoryContext); pool_get_config(get_config_file_name(), CFGCXT_RELOAD); MemoryContextSwitchTo(oldContext); if (pool_config->enable_pool_hba) { load_hba(get_hba_file_name()); if (strcmp("", pool_config->pool_passwd)) pool_reopen_passwd_file(); } got_sighup = 0; } } static void get_backends_status(unsigned int *valid_backends, unsigned int *down_backends) { int i; *down_backends = 0; *valid_backends = 0; for (i = 0; i < NUM_BACKENDS; i++) { if (BACKEND_INFO(i).backend_status == CON_DOWN) (*down_backends)++; if (VALID_BACKEND(i)) (*valid_backends)++; } } static void validate_backend_connectivity(int front_end_fd) { unsigned int valid_backends; unsigned int down_backends; bool fatal_error = false; char *error_msg = NULL; char *error_detail = NULL; char *error_hint = NULL; get_backends_status(&valid_backends, &down_backends); if (valid_backends == 0) { fatal_error = true; error_msg = "pgpool is not accepting any new connections"; error_detail = "all backend nodes are down, pgpool requires at least one valid node"; error_hint = "repair the backend nodes and restart pgpool"; } if (fatal_error) { /* * check if we can inform the connecting client about the current * situation before throwing the error */ if (front_end_fd > 0) { POOL_CONNECTION *cp; StartupPacket *volatile sp = NULL; /* * we do not want to report socket error, as above errors will be * more informative */ PG_TRY(); { if ((cp = pool_open(front_end_fd, false)) == NULL) { close(front_end_fd); child_exit(POOL_EXIT_AND_RESTART); } sp = read_startup_packet(cp); ereport(DEBUG1, (errmsg("forwarding error message to frontend"))); pool_send_error_message(cp, sp->major, (sp->major == PROTO_MAJOR_V3) ? "08S01" : NULL, error_msg, error_detail, error_hint, __FILE__, __LINE__); } PG_CATCH(); { pool_free_startup_packet(sp); FlushErrorState(); ereport(FATAL, (errmsg("%s", error_msg), errdetail("%s", error_detail), errhint("%s", error_hint))); } PG_END_TRY(); pool_free_startup_packet(sp); } ereport(FATAL, (errmsg("%s", error_msg), errdetail("%s", error_detail), errhint("%s", error_hint))); } /* Every thing is good if we have reached this point */ } /* * returns the POOL_CONNECTION object from socket descriptor * the socket must be already accepted */ static POOL_CONNECTION * get_connection(int front_end_fd, SockAddr *saddr) { POOL_CONNECTION *cp; ereport(DEBUG1, (errmsg("I am %d accept fd %d", getpid(), front_end_fd))); pool_getnameinfo_all(saddr, remote_host, remote_port); print_process_status(remote_host, remote_port); set_ps_display("accept connection", false); /* log who is connecting */ if (pool_config->log_connections) { ereport(LOG, (errmsg("new connection received"), errdetail("connecting host=%s%s%s", remote_host, remote_port[0] ? " port=" : "", remote_port))); } /* set NODELAY and KEEPALIVE options if INET connection */ if (saddr->addr.ss_family == AF_INET || saddr->addr.ss_family == AF_INET6) { int on = 1; if (setsockopt(front_end_fd, IPPROTO_TCP, TCP_NODELAY, (char *) &on, sizeof(on)) < 0) ereport(ERROR, (errmsg("failed to accept user connection"), errdetail("setsockopt on socket failed with error : \"%s\"", strerror(errno)))); if (setsockopt(front_end_fd, SOL_SOCKET, SO_KEEPALIVE, (char *) &on, sizeof(on)) < 0) ereport(FATAL, (errmsg("failed to accept user connection"), errdetail("setsockopt on socket failed with error : \"%s\"", strerror(errno)))); } if ((cp = pool_open(front_end_fd, false)) == NULL) { close(front_end_fd); ereport(ERROR, (errmsg("failed to accept user connection"), errdetail("unable to open connection with remote end : \"%s\"", strerror(errno)))); } /* save ip address for hba */ memcpy(&cp->raddr, saddr, sizeof(SockAddr)); if (cp->raddr.addr.ss_family == 0) cp->raddr.addr.ss_family = AF_UNIX; return cp; } static POOL_CONNECTION_POOL * get_backend_connection(POOL_CONNECTION * frontend) { int found = 0; StartupPacket *sp; POOL_CONNECTION_POOL *backend; /* read the startup packet */ retry_startup: sp = read_startup_packet(frontend); /* cancel request? */ if (sp->major == 1234 && sp->minor == 5678) { cancel_request((CancelPacket *) sp->startup_packet); pool_free_startup_packet(sp); return NULL; } /* SSL? */ if (sp->major == 1234 && sp->minor == 5679 && !frontend->ssl_active) { ereport(DEBUG1, (errmsg("selecting backend connection"), errdetail("SSLRequest from client"))); pool_ssl_negotiate_serverclient(frontend); pool_free_startup_packet(sp); goto retry_startup; } frontend->protoVersion = sp->major; frontend->database = pstrdup(sp->database); frontend->username = pstrdup(sp->user); if (pool_config->enable_pool_hba) { /* * do client authentication. Note that ClientAuthentication does not * return if frontend was rejected; it simply terminates this process. */ MemoryContext frontend_auth_cxt = AllocSetContextCreate(CurrentMemoryContext, "frontend_auth", ALLOCSET_DEFAULT_SIZES); MemoryContext oldContext = MemoryContextSwitchTo(frontend_auth_cxt); ClientAuthentication(frontend); MemoryContextSwitchTo(oldContext); MemoryContextDelete(frontend_auth_cxt); } /* * Ok, negotiation with frontend has been done. Let's go to the next step. * Connect to backend if there's no existing connection which can be * reused by this frontend. Authentication is also done in this step. */ /* * Check if restart request is set because of failback event happened. If * so, close idle connections to backend and make a new copy of backend * status. */ if (pool_get_my_process_info()->need_to_restart) { ereport(LOG, (errmsg("selecting backend connection"), errdetail("failover or failback event detected, discarding existing connections"))); pool_get_my_process_info()->need_to_restart = 0; close_idle_connection(0); pool_initialize_private_backend_status(); } /* * if there's no connection associated with user and database, we need to * connect to the backend and send the startup packet. */ /* look for an existing connection */ found = 0; backend = pool_get_cp(sp->user, sp->database, sp->major, 1); if (backend != NULL) { found = 1; /* * existing connection associated with same user/database/major found. * however we should make sure that the startup packet contents are * identical. OPTION data and others might be different. */ if (sp->len != MASTER_CONNECTION(backend)->sp->len) { ereport(DEBUG1, (errmsg("selecting backend connection"), errdetail("connection exists but startup packet length is not identical"))); found = 0; } else if (memcmp(sp->startup_packet, MASTER_CONNECTION(backend)->sp->startup_packet, sp->len) != 0) { ereport(DEBUG1, (errmsg("selecting backend connection"), errdetail("connection exists but startup packet contents is not identical"))); found = 0; } if (found == 0) { /* * we need to discard existing connection since startup packet is * different */ pool_discard_cp(sp->user, sp->database, sp->major); backend = NULL; } } if (backend == NULL) { /* create a new connection to backend */ backend = connect_backend(sp, frontend); } else { /* reuse existing connection */ if (!connect_using_existing_connection(frontend, backend, sp)) return NULL; } pool_free_startup_packet(sp); return backend; } static void print_process_status(char *remote_host, char *remote_port) { if (remote_port[0] == '\0') snprintf(remote_ps_data, sizeof(remote_ps_data), "%s", remote_port); else snprintf(remote_ps_data, sizeof(remote_ps_data), "%s(%s)", remote_host, remote_port); } bool is_session_connected() { if (processType == PT_CHILD) return (pool_get_session_context(true) != NULL); return false; } /* * Given db node specified in pgpool.conf, returns appropriate physical * DB node id. * Acceptable db node specifications are: * * primary: primary node * standby: any of standby node * numeric: physical node id * * If specified node does exist, returns MASTER_NODE_ID. If "standby" is * specified, returns -1. Caller should choose one of standby nodes * appropriately. */ static int choose_db_node_id(char *str) { int node_id = MASTER_NODE_ID; if (!strcmp("primary", str) && PRIMARY_NODE_ID >= 0) { node_id = PRIMARY_NODE_ID; } else if (!strcmp("standby", str)) { node_id = -1; } else { int tmp = atoi(str); if (tmp >= 0 && tmp < NUM_BACKENDS) node_id = tmp; } return node_id; } int send_to_pg_frontend(char *data, int len, bool flush) { int ret; if (processType != PT_CHILD || child_frontend == NULL) return -1; if (child_frontend->socket_state != POOL_SOCKET_VALID) return -1; ret = pool_write_noerror(child_frontend, data, len); if (flush && !ret) ret = pool_flush_it(child_frontend); return ret; } int set_pg_frontend_blocking(bool blocking) { if (processType != PT_CHILD || child_frontend == NULL) return -1; if (child_frontend->socket_state != POOL_SOCKET_VALID) return -1; if (blocking) pool_unset_nonblock(child_frontend->fd); else pool_set_nonblock(child_frontend->fd); return 0; } int get_frontend_protocol_version(void) { if (processType != PT_CHILD || child_frontend == NULL) return -1; return child_frontend->protoVersion; } int pg_frontend_exists(void) { if (processType != PT_CHILD || child_frontend == NULL) return -1; return 0; } static int opt_sort(const void *a, const void *b) { return strcmp( *(char **)a, *(char **)b); } /* * Returns PostgreSQL version. * The returned PgVersion struct is in static memory. * Caller must not modify it. * * Note: * Must be called while query context already exists. * If there's something goes wrong, this raises FATAL. So never returns to caller. * */ PGVersion * Pgversion(POOL_CONNECTION_POOL * backend) { #define VERSION_BUF_SIZE 10 static PGVersion pgversion; static POOL_RELCACHE *relcache; char *result; char *p; char buf[VERSION_BUF_SIZE]; int i; int major; int minor; /* * First, check local cache. If cache is set, just return it. */ if (pgversion.major != 0) { ereport(DEBUG5, (errmsg("Pgversion: local cache returned"))); return &pgversion; } if (!relcache) { /* * Create relcache. */ relcache = pool_create_relcache(pool_config->relcache_size, "SELECT version()", string_register_func, string_unregister_func, false); if (relcache == NULL) { ereport(FATAL, (errmsg("Pgversion: unable to create relcache while getting PostgreSQL version."))); return NULL; } } /* * Search relcache. */ result = (char *)pool_search_relcache(relcache, backend, "version"); if (result == 0) { ereport(FATAL, (errmsg("Pgversion: unable to search relcache while getting PostgreSQL version."))); return NULL; } ereport(DEBUG5, (errmsg("Pgversion: version string: %s", result))); /* * Extract major version number. We create major version as "version" * * 10. For example, for V10, the major version number will be 100, for * V9.6 it will be 96, and so on. For alpha or beta version, the version * string could be something like "12beta1". In this case we assume that * atoi(3) is smart enough to stop at the first character which is not a * valid digit (in our case 'b')). So "12beta1" should be converted to 12. */ p = strchr(result, ' '); if (p == NULL) { ereport(FATAL, (errmsg("Pgversion: unable to find the first space in the version string: %s", result))); return NULL; } p++; i = 0; while (i < VERSION_BUF_SIZE - 1 && p && *p != '.') { buf[i++] = *p++; } buf[i] = '\0'; major = atoi(buf); ereport(DEBUG5, (errmsg("Pgversion: major version: %d", major))); /* Assuming PostgreSQL V100 is the final release:-) */ if (major < 6 || major > 100) { ereport(FATAL, (errmsg("Pgversion: wrong major version: %d", major))); return NULL; } /* * If major version is 10 or above, we are done to extract major. * Otherwise extract below decimal point part. */ if (major >= 10) { major *= 10; } else { p++; i = 0; while (i < VERSION_BUF_SIZE -1 && p && *p != '.' && *p != ' ') { buf[i++] = *p++; } buf[i] = '\0'; major = major * 10 + atoi(buf); ereport(DEBUG5, (errmsg("Pgversion: major version: %d", major))); pgversion.major = major; } /* * Extract minor version. */ p++; i = 0; while (i < VERSION_BUF_SIZE -1 && p && *p != '.' && *p != ' ') { buf[i++] = *p++; } buf[i] = '\0'; minor = atoi(buf); ereport(DEBUG5, (errmsg("Pgversion: minor version: %d", minor))); if (minor < 0 || minor > 100) { ereport(FATAL, (errmsg("Pgversion: wrong minor version: %d", minor))); return NULL; } /* * Ok, everything looks good. Set the local cache. */ pgversion.major = major; pgversion.minor = minor; strncpy(pgversion.version_string, result, sizeof(pgversion.version_string) - 1); return &pgversion; } pgpool-II-4.1.4/src/protocol/pool_process_query.c0000664000175000017500000040071413730350127017001 00000000000000/* -*-pgsql-c-*- */ /* * pgpool: a language independent connection pool server for PostgreSQL * written by Tatsuo Ishii * * Copyright (c) 2003-2020 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_process_query.c: query processing stuff * */ #include "config.h" #include #ifdef HAVE_SYS_TYPES_H #include #endif #ifdef HAVE_SYS_TIME_H #include #endif #ifdef HAVE_SYS_SELECT_H #include #endif #include #include #include #include #include #include #include "pool.h" #include "pool_config.h" #include "rewrite/pool_timestamp.h" #include "protocol/pool_proto_modules.h" #include "protocol/protocol_defs.h" #include "utils/palloc.h" #include "utils/memutils.h" #include "utils/elog.h" #include "auth/pool_hba.h" #include "utils/pool_relcache.h" #include "utils/pool_stream.h" #include "context/pool_session_context.h" #include "context/pool_query_context.h" #include "utils/pool_select_walker.h" #include "query_cache/pool_memqcache.h" #include "utils/pool_signal.h" #include "parser/pool_string.h" #ifndef FD_SETSIZE #define FD_SETSIZE 512 #endif #define ACTIVE_SQL_TRANSACTION_ERROR_CODE "25001" /* SET TRANSACTION * ISOLATION LEVEL must be * called before any query */ #define DEADLOCK_ERROR_CODE "40P01" #define SERIALIZATION_FAIL_ERROR_CODE "40001" #define QUERY_CANCEL_ERROR_CODE "57014" #define ADMIN_SHUTDOWN_ERROR_CODE "57P01" #define CRASH_SHUTDOWN_ERROR_CODE "57P02" #define IDLE_IN_TRANSACTION_SESSION_TIMEOUT_ERROR_CODE "25P03" static int reset_backend(POOL_CONNECTION_POOL * backend, int qcnt); static char *get_insert_command_table_name(InsertStmt *node); static bool is_cache_empty(POOL_CONNECTION * frontend, POOL_CONNECTION_POOL * backend); static bool is_panic_or_fatal_error(const char *message, int major); static int extract_message(POOL_CONNECTION * master, char *error_code, int major, char class, bool unread); static int detect_postmaster_down_error(POOL_CONNECTION * master, int major); static bool is_internal_transaction_needed(Node *node); static bool pool_has_insert_lock(void); static POOL_STATUS add_lock_target(POOL_CONNECTION * frontend, POOL_CONNECTION_POOL * backend, char *table); static bool has_lock_target(POOL_CONNECTION * frontend, POOL_CONNECTION_POOL * backend, char *table, bool for_update); static POOL_STATUS insert_oid_into_insert_lock(POOL_CONNECTION * frontend, POOL_CONNECTION_POOL * backend, char *table); static POOL_STATUS read_packets_and_process(POOL_CONNECTION * frontend, POOL_CONNECTION_POOL * backend, int reset_request, int *state, short *num_fields, bool *cont); static bool is_all_slaves_command_complete(unsigned char *kind_list, int num_backends, int master); static bool pool_process_notice_message_from_one_backend(POOL_CONNECTION * frontend, POOL_CONNECTION_POOL * backend, int backend_idx, char kind); /* * Main module for query processing * reset_request: if non 0, call reset_backend to execute reset queries */ POOL_STATUS pool_process_query(POOL_CONNECTION * frontend, POOL_CONNECTION_POOL * backend, int reset_request) { short num_fields = 0; /* the number of fields in a row (V2 protocol) */ POOL_STATUS status; int qcnt; int i; MemoryContext ProcessQueryContext = AllocSetContextCreate(QueryContext, "pool_process_query", ALLOCSET_DEFAULT_MINSIZE, ALLOCSET_DEFAULT_INITSIZE, ALLOCSET_DEFAULT_MAXSIZE); /* * This variable is used while processing reset_request (i.e.: * reset_request == 1). If state is 0, then we call reset_backend. And we * set state to 1 so that we wait for ready for query message from * badckends. */ int state; frontend->no_forward = reset_request; qcnt = 0; state = 0; /* Try to connect memcached */ if ((pool_config->memory_cache_enabled || pool_config->enable_shared_relcache) && !pool_is_shmem_cache()) { memcached_connect(); } for (;;) { MemoryContextSwitchTo(ProcessQueryContext); MemoryContextResetAndDeleteChildren(ProcessQueryContext); /* Are we requested to send reset queries? */ if (state == 0 && reset_request) { int st; /* * send query for resetting connection such as "ROLLBACK" "RESET * ALL"... */ st = reset_backend(backend, qcnt); if (st < 0) /* error? */ { /* * probably we don't need this, since caller will close the * connection to frontend after returning with POOL_END. But I * guess I would like to be a paranoid... */ frontend->no_forward = 0; ereport(ERROR, (errmsg("unable to reset backend status"))); } else if (st == 0) /* no query issued? */ { qcnt++; continue; } else if (st == 1) /* more query remains */ { state = 1; qcnt++; continue; } else /* no more query(st == 2) */ { for (i = 0; i < NUM_BACKENDS; i++) { if (VALID_BACKEND(i)) TSTATE(backend, i) = 'I'; } frontend->no_forward = 0; return POOL_CONTINUE; } } check_stop_request(); /* * If we are in recovery and client_idle_limit_in_recovery is -1, then * exit immediately. */ if (*InRecovery > RECOVERY_INIT && pool_config->client_idle_limit_in_recovery == -1) { ereport(ERROR, (pool_error_code("57000"), errmsg("connection terminated due to online recovery"), errdetail("child connection forced to terminate due to client_idle_limit_in_recovery = -1"))); } /* * If we are not processing a query, now is the time to extract * pending data from buffer stack if any. */ if (!pool_is_query_in_progress()) { for (i = 0; i < NUM_BACKENDS; i++) { int plen; if (VALID_BACKEND(i) && pool_stacklen(CONNECTION(backend, i)) > 0) pool_pop(CONNECTION(backend, i), &plen); } } /* * If we are processing query, process it. Even if we are not * processing query, process backend response if there's pending data * in backend cache. */ if (pool_is_query_in_progress() || !is_backend_cache_empty(backend)) { status = ProcessBackendResponse(frontend, backend, &state, &num_fields); if (status != POOL_CONTINUE) return status; } /* * If frontend and all backends do not have any pending data in the * receiving data cache, then issue select(2) to wait for new data * arrival */ else if (is_cache_empty(frontend, backend)) { bool cont = true; status = read_packets_and_process(frontend, backend, reset_request, &state, &num_fields, &cont); if (status != POOL_CONTINUE) return status; else if (!cont) /* Detected admin shutdown */ return status; } else { if ((pool_ssl_pending(frontend) || !pool_read_buffer_is_empty(frontend)) && !pool_is_query_in_progress()) { /* * We do not read anything from frontend after receiving X * packet. Just emit log message. This will guard us from * buggy frontend. */ if (reset_request) { elog(LOG, "garbage data from frontend after receiving terminate message ignored"); pool_discard_read_buffer(frontend); } else { status = ProcessFrontendResponse(frontend, backend); if (status != POOL_CONTINUE) return status; } } /* * ProcessFrontendResponse() may start query processing. We need * to re-check pool_is_query_in_progress() here. */ if (pool_is_query_in_progress()) { status = ProcessBackendResponse(frontend, backend, &state, &num_fields); if (status != POOL_CONTINUE) return status; } else { /* * Ok, query is not in progress. ProcessFrontendResponse() may * consume all pending data. Check if we have any pending * data. If not, call read_packets_and_process() and wait for * data arrival. */ if (is_cache_empty(frontend, backend)) { bool cont = true; status = read_packets_and_process(frontend, backend, reset_request, &state, &num_fields, &cont); if (status != POOL_CONTINUE) return status; else if (!cont) /* Detected admin shutdown */ return status; } else { /* * If we have pending data in master, we need to process * it */ if (pool_ssl_pending(MASTER(backend)) || !pool_read_buffer_is_empty(MASTER(backend))) { status = ProcessBackendResponse(frontend, backend, &state, &num_fields); if (status != POOL_CONTINUE) return status; } else { for (i = 0; i < NUM_BACKENDS; i++) { if (!VALID_BACKEND(i)) continue; if (pool_ssl_pending(CONNECTION(backend, i)) || !pool_read_buffer_is_empty(CONNECTION(backend, i))) { /* * If we have pending data in master, we need * to process it */ if (IS_MASTER_NODE_ID(i)) { status = ProcessBackendResponse(frontend, backend, &state, &num_fields); if (status != POOL_CONTINUE) return status; break; } else { char kind; int len; char *string; /* * If master does not have pending data, * we discard one packet from other * backend */ pool_read_with_error(CONNECTION(backend, i), &kind, sizeof(kind), "reading message kind from backend"); if (kind == 'A') { if (MASTER_SLAVE) { int sendlen; /* * In master slave mode we may * send the query to the standby * node and the NOTIFY comes back * only from primary node. But * since we have sent the query to * the standby, so the current * MASTER_NODE_ID will be pointing * to the standby node. And we * will get stuck if we keep * waiting for the current master * node (standby) in this case to * send us the NOTIFY message. see * "0000116: LISTEN Notifications * Not Reliably Delivered Using * JDBC4 Demonstrator" for the * scenario */ pool_read_with_error(CONNECTION(backend, i), &len, sizeof(len), "reading message length from backend"); len = ntohl(len) - 4; string = pool_read2(CONNECTION(backend, i), len); if (string == NULL) ereport(ERROR, (errmsg("unable to forward NOTIFY message to frontend"), errdetail("read from backend failed"))); pool_write(frontend, &kind, 1); sendlen = htonl(len + 4); pool_write(frontend, &sendlen, sizeof(sendlen)); pool_write_and_flush(frontend, string, len); } else { /* * In replication mode, NOTIFY is * sent to all backends. However * the order of arrival of * 'Notification response' is not * necessarily the master first * and then slaves. So if it * arrives slave first, we should * try to read from master, rather * than just discard it. */ pool_unread(CONNECTION(backend, i), &kind, sizeof(kind)); ereport(LOG, (errmsg("pool process query"), errdetail("received %c packet from backend %d. Don't dicard and read %c packet from master", kind, i, kind))); pool_read_with_error(CONNECTION(backend, MASTER_NODE_ID), &kind, sizeof(kind), "reading message kind from backend"); pool_unread(CONNECTION(backend, MASTER_NODE_ID), &kind, sizeof(kind)); } } else if (SL_MODE) { pool_unread(CONNECTION(backend, i), &kind, sizeof(kind)); } else if (!SL_MODE) { ereport(LOG, (errmsg("pool process query"), errdetail("discard %c packet from backend %d", kind, i))); if (MAJOR(backend) == PROTO_MAJOR_V3) { pool_read_with_error(CONNECTION(backend, i), &len, sizeof(len), "reading message length from backend"); len = ntohl(len) - 4; string = pool_read2(CONNECTION(backend, i), len); if (string == NULL) ereport(FATAL, (return_code(2), errmsg("unable to process query"), errdetail("error while reading rest of message from backend %d", i))); } else { string = pool_read_string(CONNECTION(backend, i), &len, 0); if (string == NULL) ereport(FATAL, (return_code(2), errmsg("unable to process query"), errdetail("error while reading rest of message from backend %d", i))); } } } } } } } } } /* reload config file */ if (got_sighup) { MemoryContext oldContext = MemoryContextSwitchTo(TopMemoryContext); pool_get_config(get_config_file_name(), CFGCXT_RELOAD); MemoryContextSwitchTo(oldContext); if (pool_config->enable_pool_hba) load_hba(get_hba_file_name()); got_sighup = 0; } } } /* * send simple query message to a node. */ void send_simplequery_message(POOL_CONNECTION * backend, int len, char *string, int major) { /* forward the query to the backend */ pool_write(backend, "Q", 1); if (major == PROTO_MAJOR_V3) { int sendlen = htonl(len + 4); pool_write(backend, &sendlen, sizeof(sendlen)); } pool_write_and_flush(backend, string, len); } /* * wait_for_query_response_with_trans_cleanup(): this function is the wrapper * over the wait_for_query_response() function and performs and additional * step of canceling the transaction in case of an error from * wait_for_query_response() if operated in native replication mode to keep * database consistency. */ void wait_for_query_response_with_trans_cleanup(POOL_CONNECTION * frontend, POOL_CONNECTION * backend, int protoVersion, int pid, int key) { PG_TRY(); { wait_for_query_response(frontend, backend, protoVersion); } PG_CATCH(); { if (REPLICATION) { /* Cancel current transaction */ CancelPacket cancel_packet; cancel_packet.protoVersion = htonl(PROTO_CANCEL); cancel_packet.pid = pid; cancel_packet.key = key; cancel_request(&cancel_packet); } PG_RE_THROW(); } PG_END_TRY(); } /* * Wait for query response from single node. If frontend is not NULL, * also check frontend connection by writing dummy parameter status * packet every 30 seccond, and if the connection broke, returns error * since there's no point in that waiting until backend returns * response. */ POOL_STATUS wait_for_query_response(POOL_CONNECTION * frontend, POOL_CONNECTION * backend, int protoVersion) { #define DUMMY_PARAMETER "pgpool_dummy_param" #define DUMMY_VALUE "pgpool_dummy_value" int status; int plen; ereport(DEBUG1, (errmsg("waiting for query response"), errdetail("waiting for backend:%d to complete the query", backend->db_node_id))); for (;;) { /* Check to see if data from backend is ready */ pool_set_timeout(30); status = pool_check_fd(backend); pool_set_timeout(-1); if (status < 0) /* error ? */ { ereport(ERROR, (errmsg("backend error occured while waiting for backend response"))); } else if (frontend != NULL && status > 0) { /* * If data from backend is not ready, check frontend connection by * sending dummy parameter status packet. */ if (protoVersion == PROTO_MAJOR_V3) { /* * Write dummy parameter staus packet to check if the socket * to frontend is ok */ pool_write(frontend, "S", 1); plen = sizeof(DUMMY_PARAMETER) + sizeof(DUMMY_VALUE) + sizeof(plen); plen = htonl(plen); pool_write(frontend, &plen, sizeof(plen)); pool_write(frontend, DUMMY_PARAMETER, sizeof(DUMMY_PARAMETER)); pool_write(frontend, DUMMY_VALUE, sizeof(DUMMY_VALUE)); if (pool_flush_it(frontend) < 0) { ereport(FRONTEND_ERROR, (errmsg("unable to to flush data to frontend"), errdetail("frontend error occured while waiting for backend reply"))); } } else /* Protocol version 2 */ { /* * If you want to monitor client connection even if you are using V2 protocol, * define following */ #undef SEND_NOTICE_ON_PROTO2 #ifdef SEND_NOTICE_ON_PROTO2 static char *notice_message = {"keep alive checking from pgpool-II"}; /* * Write notice message packet to check if the socket to * frontend is ok */ pool_write(frontend, "N", 1); pool_write(frontend, notice_message, strlen(notice_message) + 1); if (pool_flush_it(frontend) < 0) { ereport(FRONTEND_ERROR, (errmsg("unable to to flush data to frontend"), errdetail("frontend error occured while waiting for backend reply"))); } #endif } } else break; } return POOL_CONTINUE; } /* * Extended query protocol has to send Flush message. */ POOL_STATUS send_extended_protocol_message(POOL_CONNECTION_POOL * backend, int node_id, char *kind, int len, char *string) { POOL_CONNECTION *cp = CONNECTION(backend, node_id); int sendlen; /* forward the query to the backend */ pool_write(cp, kind, 1); sendlen = htonl(len + 4); pool_write(cp, &sendlen, sizeof(sendlen)); pool_write(cp, string, len); if (!SL_MODE) { /* * send "Flush" message so that backend notices us the completion of * the command */ pool_write(cp, "H", 1); sendlen = htonl(4); pool_write_and_flush(cp, &sendlen, sizeof(sendlen)); } else pool_flush(cp); return POOL_CONTINUE; } /* * wait until read data is ready */ int synchronize(POOL_CONNECTION * cp) { return pool_check_fd(cp); } /* * send "terminate"(X) message to all backends, indicating that * backend should prepare to close connection to frontend (actually * pgpool). Note that caller must be proteceted from a signal * interruption while calling this function. Otherwise the number of * valid backends might be changed by failover/failback. */ void pool_send_frontend_exits(POOL_CONNECTION_POOL * backend) { int len; int i; for (i = 0; i < NUM_BACKENDS; i++) { /* * send a terminate message to backend if there's an existing * connection */ if (VALID_BACKEND(i) && CONNECTION_SLOT(backend, i)) { pool_write_noerror(CONNECTION(backend, i), "X", 1); if (MAJOR(backend) == PROTO_MAJOR_V3) { len = htonl(4); pool_write_noerror(CONNECTION(backend, i), &len, sizeof(len)); } /* * XXX we cannot call pool_flush() here since backend may already * close the socket and pool_flush() automatically invokes fail * over handler. This could happen in copy command (remember the * famous "lost synchronization with server, resetting connection" * message) */ pool_set_nonblock(CONNECTION(backend, i)->fd); pool_flush_it(CONNECTION(backend, i)); pool_unset_nonblock(CONNECTION(backend, i)->fd); } } } /* * ------------------------------------------------------- * V3 functions * ------------------------------------------------------- */ POOL_STATUS SimpleForwardToFrontend(char kind, POOL_CONNECTION * frontend, POOL_CONNECTION_POOL * backend) { int len, len1 = 0; char *p = NULL; char *p1 = NULL; int sendlen; int i; pool_read(MASTER(backend), &len, sizeof(len)); len = ntohl(len); len -= 4; len1 = len; p = pool_read2(MASTER(backend), len); if (p == NULL) ereport(ERROR, (errmsg("unable to forward message to frontend"), errdetail("read from backend failed"))); p1 = palloc(len); memcpy(p1, p, len); /* * If we received a notification message in master/slave mode, other * backends will not receive the message. So we should skip other nodes * otherwise we will hang in pool_read. */ if (!MASTER_SLAVE || kind != 'A') { for (i = 0; i < NUM_BACKENDS; i++) { #ifdef NOT_USED if (use_sync_map == POOL_SYNC_MAP_EMPTY) continue; #endif if (VALID_BACKEND(i) && !IS_MASTER_NODE_ID(i)) { #ifdef NOT_USED if (use_sync_map == POOL_SYNC_MAP_IS_VALID && !pool_is_set_sync_map(i)) { continue; } #endif pool_read(CONNECTION(backend, i), &len, sizeof(len)); len = ntohl(len); len -= 4; p = pool_read2(CONNECTION(backend, i), len); if (p == NULL) ereport(ERROR, (errmsg("unable to forward message to frontend"), errdetail("read on backend node failed"))); if (len != len1) { ereport(DEBUG1, (errmsg("SimpleForwardToFrontend: length does not match between backends master(%d) %d th backend(%d) kind:(%c)", len, i, len1, kind))); } } } } pool_write(frontend, &kind, 1); sendlen = htonl(len1 + 4); pool_write(frontend, &sendlen, sizeof(sendlen)); /* * Optimization for other than "Command Complete", "Ready For query", * "Error response" ,"Notice message" and "Notification response" * messages. Especially, since it is too often to receive and forward * "Data Row" message, we do not flush the message to frontend now. We * expect that "Command Complete" message (or "Error response" or "Notice * response" message) follows the stream of data row message anyway, so * flushing will be done at that time. * * Same thing can be said to CopyData message. Tremendous number of * CopyData messages are sent to frontend (typical use case is pg_dump). * So eliminating per CopyData flush significantly enhances performance. */ if (kind == 'C' || kind == 'Z' || kind == 'E' || kind == 'N' || kind == 'A') { pool_write_and_flush(frontend, p1, len1); } else { pool_write(frontend, p1, len1); } ereport(DEBUG5, (errmsg("SimpleForwardToFrontend: packet:%c length:%d", kind, len1))); /* save the received result to buffer for each kind */ if (pool_config->memory_cache_enabled) { if (pool_is_cache_safe() && !pool_is_cache_exceeded()) { memqcache_register(kind, frontend, p1, len1); ereport(DEBUG5, (errmsg("SimpleForwardToFrontend: add to memqcache buffer:%c length:%d", kind, len1))); } } /* error response? */ if (kind == 'E') { /* * check if the error was PANIC or FATAL. If so, we just flush the * message and exit since the backend will close the channel * immediately. */ if (is_panic_or_fatal_error(p1, MAJOR(backend))) ereport(ERROR, (errmsg("unable to forward message to frontend"), errdetail("FATAL error occured on backend"))); } pfree(p1); return POOL_CONTINUE; } POOL_STATUS SimpleForwardToBackend(char kind, POOL_CONNECTION * frontend, POOL_CONNECTION_POOL * backend, int len, char *contents) { int sendlen; int i; sendlen = htonl(len + 4); #ifdef DEBUG char msgbuf[256]; #endif if (len == 0) { /* * We assume that we can always forward to every node regardless * running mode. Am I correct? */ for (i = 0; i < NUM_BACKENDS; i++) { if (VALID_BACKEND(i)) { #ifdef DEBUG snprintf(msgbuf, sizeof(msgbuf), "%c message", kind); per_node_statement_log(backend, i, msgbuf); #endif pool_write(CONNECTION(backend, i), &kind, 1); pool_write_and_flush(CONNECTION(backend, i), &sendlen, sizeof(sendlen)); } } return POOL_CONTINUE; } else if (len < 0) ereport(ERROR, (errmsg("unable to forward message to backend"), errdetail("invalid message length:%d for message:%c", len, kind))); for (i = 0; i < NUM_BACKENDS; i++) { if (VALID_BACKEND(i)) { #ifdef DEBUG snprintf(msgbuf, sizeof(msgbuf), "%c message", kind); per_node_statement_log(backend, i, msgbuf); #endif pool_write(CONNECTION(backend, i), &kind, 1); pool_write(CONNECTION(backend, i), &sendlen, sizeof(sendlen)); pool_write_and_flush(CONNECTION(backend, i), contents, len); } } return POOL_CONTINUE; } POOL_STATUS ParameterStatus(POOL_CONNECTION * frontend, POOL_CONNECTION_POOL * backend) { int len, len1 = 0; int *len_array; int sendlen; char *p; char *name; char *value; POOL_STATUS status; char parambuf[1024]; /* parameter + value string buffer. XXX is * this enough? */ int i; pool_write(frontend, "S", 1); len_array = pool_read_message_length2(backend); if (len_array == NULL) ereport(ERROR, (errmsg("unable to process parameter status"), errdetail("read on backend failed"))); len = len_array[MASTER_NODE_ID]; sendlen = htonl(len); pool_write(frontend, &sendlen, sizeof(sendlen)); for (i = 0; i < NUM_BACKENDS; i++) { if (VALID_BACKEND(i)) { len = len_array[i]; len -= 4; p = pool_read2(CONNECTION(backend, i), len); if (p == NULL) ereport(ERROR, (errmsg("unable to process parameter status"), errdetail("could not read from backend"))); name = p; value = p + strlen(name) + 1; ereport(DEBUG1, (errmsg("process parameter status"), errdetail("backend:%d name:\"%s\" value:\"%s\"", i, name, value))); if (IS_MASTER_NODE_ID(i)) { len1 = len; memcpy(parambuf, p, len); pool_add_param(&CONNECTION(backend, i)->params, name, value); } #ifdef DEBUG pool_param_debug_print(&MASTER(backend)->params); #endif } } status = pool_write(frontend, parambuf, len1); return status; } /* * Reset all state variables */ void reset_variables(void) { if (pool_get_session_context(true)) pool_unset_query_in_progress(); } /* * if connection_cache == 0, we don't need reset_query. * but we need reset prepared list. */ void reset_connection(void) { reset_variables(); pool_clear_sent_message_list(); } /* * Reset backend status. return values are: * 0: no query was issued 1: a query was issued 2: no more queries remain -1: error */ static int reset_backend(POOL_CONNECTION_POOL * backend, int qcnt) { char *query; int qn; int i; bool need_to_abort; POOL_SESSION_CONTEXT *session_context; POOL_TEMP_QUERY_CACHE *cache; /* Get session context */ session_context = pool_get_session_context(false); /* Set reset context */ session_context->reset_context = true; /* * Make sure that we are not doing extended protocol. */ pool_unset_doing_extended_query_message(); /* * Reset all state variables */ reset_variables(); qn = pool_config->num_reset_queries; /* * After execution of all SQL commands in the reset_query_list, we are * done. */ if (qcnt >= qn) { return 2; } query = pool_config->reset_query_list[qcnt]; if (!strcmp("ABORT", query)) { /* If transaction state are all idle, we don't need to issue ABORT */ need_to_abort = false; for (i = 0; i < NUM_BACKENDS; i++) { if (VALID_BACKEND(i) && TSTATE(backend, i) != 'I') need_to_abort = true; } if (!need_to_abort) return 0; } pool_set_timeout(10); if ((session_context = pool_get_session_context(false))) { pool_unset_query_in_progress(); } if (SimpleQuery(NULL, backend, strlen(query) + 1, query) != POOL_CONTINUE) { pool_set_timeout(-1); return -1; } pool_set_timeout(-1); cache = pool_get_current_cache(); if (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; } return 1; } /* * Returns true if the SQL statement is regarded as read SELECT from syntax's * point of view. However callers need to do aditional checking such as if the * SELECT does not have write functions or not to make sure that the SELECT is * sematically read SELECT. * * For followings this function returns true: * - SELECT/WITH without FOR UPDATE/SHARE * - COPY TO STDOUT * - EXPLAIN * - EXPLAIN ANALYZE and query is SELECT not including writing functions * - SHOW * * Note that for SELECT this function returns false. */ bool is_select_query(Node *node, char *sql) { if (node == NULL) return false; /* * 2009/5/1 Tatsuo says: This test is not bogus. As of 2.2, pgpool sets * Portal->sql_string to NULL for SQL command PREPARE. Usually this is ok, * since in most cases SQL command EXECUTE follows anyway. Problem is, * some applications mix PREPARE with extended protocol command "EXECUTE" * and so on. Execute() seems to think this never happens but it is not * real. Someday we should extract actual query string from * PrepareStmt->query and set it to Portal->sql_string. */ if (sql == NULL) return false; if (!pool_config->allow_sql_comments && pool_config->ignore_leading_white_space) { /* ignore leading white spaces */ while (*sql && isspace(*sql)) sql++; } if (IsA(node, SelectStmt)) { SelectStmt *select_stmt; select_stmt = (SelectStmt *) node; if (select_stmt->intoClause || select_stmt->lockingClause) return false; /* non-SELECT query in WITH clause ? */ if (select_stmt->withClause) { List *ctes = select_stmt->withClause->ctes; ListCell *cte_item; foreach(cte_item, ctes) { CommonTableExpr *cte = (CommonTableExpr *) lfirst(cte_item); if (!IsA(cte->ctequery, SelectStmt)) return false; } } if (!pool_config->allow_sql_comments) /* '\0' and ';' signify empty query */ return (*sql == 's' || *sql == 'S' || *sql == '(' || *sql == 'w' || *sql == 'W' || *sql == 't' || *sql == 'T' || *sql == '\0' || *sql == ';'); else return true; } else if (IsA(node, CopyStmt)) { CopyStmt *copy_stmt = (CopyStmt *) node; if (copy_stmt->is_from) return false; else if (copy_stmt->filename == NULL) { if (copy_stmt->query == NULL) return true; else if (copy_stmt->query && IsA(copy_stmt->query, SelectStmt)) return true; else return false; } else return false; } else if (IsA(node, ExplainStmt)) { ExplainStmt *explain_stmt = (ExplainStmt *) node; Node *query = explain_stmt->query; ListCell *lc; bool analyze = false; /* Check to see if this is EXPLAIN ANALYZE */ foreach(lc, explain_stmt->options) { DefElem *opt = (DefElem *) lfirst(lc); if (strcmp(opt->defname, "analyze") == 0) { analyze = true; break; } } if (IsA(query, SelectStmt)) { /* * If query is SELECT and there's no ANALYZE option, we can always * load balance. */ if (!analyze) return true; /* * If ANALYZE, we need to check function calls. */ if (pool_has_function_call(query)) return false; return true; } else { /* * Other than SELECT can be load balance only if ANALYZE is not * specified. */ if (!analyze) return true; } } else if (IsA(node, VariableShowStmt)) /* SHOW command */ return true; return false; } /* * Returns true if SQL is transaction commit or rollback command (COMMIT, * END TRANSACTION, ROLLBACK or ABORT) */ bool is_commit_or_rollback_query(Node *node) { return is_commit_query(node) || is_rollback_query(node); } /* * Returns true if SQL is transaction commit command (COMMIT or END * TRANSACTION) */ bool is_commit_query(Node *node) { TransactionStmt *stmt; if (node == NULL || !IsA(node, TransactionStmt)) return false; stmt = (TransactionStmt *) node; return stmt->kind == TRANS_STMT_COMMIT; } /* * Returns true if SQL is transaction rollback command (ROLLBACK or * ABORT) */ bool is_rollback_query(Node *node) { TransactionStmt *stmt; if (node == NULL || !IsA(node, TransactionStmt)) return false; stmt = (TransactionStmt *) node; return stmt->kind == TRANS_STMT_ROLLBACK; } /* * send error message to frontend */ void pool_send_error_message(POOL_CONNECTION * frontend, int protoMajor, char *code, char *message, char *detail, char *hint, char *file, int line) { pool_send_severity_message(frontend, protoMajor, code, message, detail, hint, file, "ERROR", line); } /* * send fatal message to frontend */ void pool_send_fatal_message(POOL_CONNECTION * frontend, int protoMajor, char *code, char *message, char *detail, char *hint, char *file, int line) { pool_send_severity_message(frontend, protoMajor, code, message, detail, hint, file, "FATAL", line); } /* * send severity message to frontend */ void pool_send_severity_message(POOL_CONNECTION * frontend, int protoMajor, char *code, char *message, char *detail, char *hint, char *file, char *severity, int line) { /* * Buffer length for each message part */ #define MAXMSGBUF 256 /* * Buffer length for result message buffer. * Since msg is consisted of 7 parts, msg buffer should be large * enough to hold those message parts */ #define MAXDATA (MAXMSGBUF+1)*7+1 pool_set_nonblock(frontend->fd); if (protoMajor == PROTO_MAJOR_V2) { pool_write(frontend, "E", 1); pool_write_and_flush(frontend, message, strlen(message) + 1); } else if (protoMajor == PROTO_MAJOR_V3) { char data[MAXDATA]; char msgbuf[MAXMSGBUF + 1]; int len; int thislen; int sendlen; len = 0; memset(data, 0, MAXDATA); pool_write(frontend, "E", 1); /* error level */ thislen = snprintf(msgbuf, MAXMSGBUF, "S%s", severity); thislen = Min(thislen, MAXMSGBUF); memcpy(data + len, msgbuf, thislen + 1); len += thislen + 1; /* code */ thislen = snprintf(msgbuf, MAXMSGBUF, "C%s", code); thislen = Min(thislen, MAXMSGBUF); memcpy(data + len, msgbuf, thislen + 1); len += thislen + 1; /* message */ thislen = snprintf(msgbuf, MAXMSGBUF, "M%s", message); thislen = Min(thislen, MAXMSGBUF); memcpy(data + len, msgbuf, thislen + 1); len += thislen + 1; /* detail */ if (detail && *detail != '\0') { thislen = snprintf(msgbuf, MAXMSGBUF, "D%s", detail); thislen = Min(thislen, MAXMSGBUF); memcpy(data + len, msgbuf, thislen + 1); len += thislen + 1; } /* hint */ if (hint && *hint != '\0') { thislen = snprintf(msgbuf, MAXMSGBUF, "H%s", hint); thislen = Min(thislen, MAXMSGBUF); memcpy(data + len, msgbuf, thislen + 1); len += thislen + 1; } /* file */ thislen = snprintf(msgbuf, MAXMSGBUF, "F%s", file); thislen = Min(thislen, MAXMSGBUF); memcpy(data + len, msgbuf, thislen + 1); len += thislen + 1; /* line */ thislen = snprintf(msgbuf, MAXMSGBUF, "L%d", line); thislen = Min(thislen, MAXMSGBUF); memcpy(data + len, msgbuf, thislen + 1); len += thislen + 1; /* stop null */ len++; *(data + len - 1) = '\0'; sendlen = len; len = htonl(len + 4); pool_write(frontend, &len, sizeof(len)); pool_write_and_flush(frontend, data, sendlen); } else ereport(ERROR, (errmsg("send_error_message: unknown protocol major %d", protoMajor))); pool_unset_nonblock(frontend->fd); } void pool_send_readyforquery(POOL_CONNECTION * frontend) { int len; pool_write(frontend, "Z", 1); len = 5; len = htonl(len); pool_write(frontend, &len, sizeof(len)); pool_write(frontend, "I", 1); pool_flush(frontend); } /* * Send a query to a backend in sync manner. * This function sends a query and waits for CommandComplete/ReadyForQuery. * If an error occured, it returns with POOL_ERROR. * This function does NOT handle SELECT/SHOW queries. * If no_ready_for_query is non 0, returns without reading the packet * length for ReadyForQuery. This mode is necessary when called from ReadyForQuery(). */ POOL_STATUS do_command(POOL_CONNECTION * frontend, POOL_CONNECTION * backend, char *query, int protoMajor, int pid, int key, int no_ready_for_query) { int len; char kind; char *string; int deadlock_detected = 0; ereport(DEBUG1, (errmsg("do_command: Query:\"%s\"", query))); /* send the query to the backend */ send_simplequery_message(backend, strlen(query) + 1, query, protoMajor); /* * Wait for response from badckend while polling frontend connection is * ok. If not, cancel the transaction. */ wait_for_query_response_with_trans_cleanup(frontend, backend, protoMajor, pid, key); /* * We must check deadlock error here. If a deadlock error is detected by a * backend, other backend might not be noticed the error. In this case * caller should send an error query to the backend to abort the * transaction. Otherwise the transaction state might vary among backends * (idle in transaction vs. abort). */ deadlock_detected = detect_deadlock_error(backend, protoMajor); /* * Continue to read packets until we get ReadForQuery (Z). Until that we * may recieve one of: * * N: Notice response E: Error response C: Comand complete * * XXX: we ignore Notice and Error here. Even notice/error messages are * not sent to the frontend. May be it's ok since the error was caused by * our internal use of SQL command (otherwise users will be confused). */ for (;;) { pool_read(backend, &kind, sizeof(kind)); ereport(DEBUG1, (errmsg("do_command: kind: '%c'", kind))); if (kind == 'Z') /* Ready for Query? */ break; /* get out the loop without reading message * lenghth */ if (protoMajor == PROTO_MAJOR_V3) { pool_read(backend, &len, sizeof(len)); len = ntohl(len) - 4; if (kind != 'N' && kind != 'E' && kind != 'S' && kind != 'C' && kind != 'A') { ereport(ERROR, (errmsg("do command failed"), errdetail("kind is not N, E, S, C or A(%02x)", kind))); } string = pool_read2(backend, len); if (string == NULL) { ereport(ERROR, (errmsg("do command failed"), errdetail("unable to read message from backend"))); } /* * It is possible that we receive a notification response ('A') * from one of backends prior to "ready for query" response if * LISTEN and NOTIFY are issued in a same connection. So we need * to save notification response to stack buffer so that we could * retrieve it later on. */ if (kind == 'A') { int nlen = htonl(len + 4); pool_push(backend, &kind, sizeof(kind)); pool_push(backend, &nlen, sizeof(nlen)); pool_push(backend, string, len); } } else { string = pool_read_string(backend, &len, 0); if (string == NULL) { ereport(ERROR, (errmsg("do command failed"), errdetail("unable to read reset message from backend"))); } if (kind == 'C') { if (!strncmp(string, "BEGIN", 5)) backend->tstate = 'T'; if (!strncmp(string, "COMMIT", 6) || !strncmp(string, "ROLLBACK", 8)) backend->tstate = 'I'; } } if (kind == 'E') { if (is_panic_or_fatal_error(string, protoMajor)) { ereport(ERROR, (errmsg("do command failed"), errdetail("backend error: \"%s\"", string))); } } } /* * until 2008/11/12 we believed that we never had packets other than * 'Z' after receiving 'C'. However a counter example was presented by * a poor customer. So we replaced the whole thing with codes * above. In a side effect we were be able to get ride of nasty * "goto". Congratulations. */ #ifdef NOT_USED /* * Expecting CompleteCommand */ retry_read_packet: pool_read(backend, &kind, sizeof(kind)); if (kind == 'E') { ereport(LOG, (errmsg("do command failed"), errdetail("backend does not successfully complete command %s status %c", query, kind))); } /* * read command tag of CommandComplete response */ if (protoMajor == PROTO_MAJOR_V3) { pool_read(backend, &len, sizeof(len)); len = ntohl(len) - 4; string = pool_read2(backend, len); if (string == NULL) ereport(ERROR, (errmsg("do command failed"), errdetail("read from backend failed"))); ereport(DEBUG2, (errmsg("do command: command tag: %s", string))); } else { string = pool_read_string(backend, &len, 0); if (string == NULL) ereport(ERROR, (errmsg("do command failed"), errdetail("read from backend failed"))); } if (kind == 'N') /* warning? */ goto retry_read_packet; /* * Expecting ReadyForQuery */ pool_read(backend, &kind, sizeof(kind)); if (kind != 'Z') { ereport(ERROR, (errmsg("do command failed"), errdetail("backend returns %c while expecting ReadyForQuery", kind))); } #endif if (no_ready_for_query) return POOL_CONTINUE; if (protoMajor == PROTO_MAJOR_V3) { /* read packet lenghth for ready for query */ pool_read(backend, &len, sizeof(len)); /* read transaction state */ pool_read(backend, &kind, sizeof(kind)); /* set transaction state */ backend->tstate = kind; ereport(DEBUG2, (errmsg("do_command: transaction state: %c", kind))); } return deadlock_detected ? POOL_DEADLOCK : POOL_CONTINUE; } /* * Send a syntax error query to abort transaction and receive response * from backend and discard it until we get Error response. * * We need to sync transaction status in transaction block. * SELECT query is sent to master only. * If SELECT is error, we must abort transaction on other nodes. */ void do_error_command(POOL_CONNECTION * backend, int major) { char *error_query = POOL_ERROR_QUERY; int len; char kind; char *string; send_simplequery_message(backend, strlen(error_query) + 1, error_query, major); /* * Continue to read packets until we get Error response (E). Until that we * may recieve one of: * * N: Notice response C: Comand complete * * XXX: we ignore Notice here. Even notice messages are not sent to the * frontend. May be it's ok since the error was caused by our internal use * of SQL command (otherwise users will be confused). */ do { pool_read(backend, &kind, sizeof(kind)); ereport(DEBUG2, (errmsg("do_error_command: kind: %c", kind))); if (major == PROTO_MAJOR_V3) { pool_read(backend, &len, sizeof(len)); len = ntohl(len) - 4; string = pool_read2(backend, len); if (string == NULL) ereport(ERROR, (errmsg("do error command failed"), errdetail("read from backend failed"))); } else { string = pool_read_string(backend, &len, 0); if (string == NULL) ereport(ERROR, (errmsg("do error command failed"), errdetail("read from backend failed"))); } } while (kind != 'E'); } /* * Send invalid portal execution to specified DB node to abort current * transaction. Pgpool-II sends a SELECT query to master node only in * load balance mode. Problem is, if the query failed, master node * goes to abort status while other nodes remain normal status. To * sync transaction status in each node, we send error query to other * than master node to ket them go into abort status. */ void do_error_execute_command(POOL_CONNECTION_POOL * backend, int node_id, int major) { char kind; char *string; char msg[1024] = "pgpool_error_portal"; /* large enough */ int len = strlen(msg); char buf[8192]; /* memory space is large enough */ char *p; int readlen = 0; p = buf; memset(msg + len, 0, sizeof(int)); send_extended_protocol_message(backend, node_id, "E", len + 5, msg); /* * Discard responses from backend until ErrorResponse received. Note that * we need to preserve non-error responses (i.e. ReadyForQuery) and put * back them using pool_unread(). Otherwise, ReadyForQuery response of * DEALLOCATE. This could happen if PHP PDO used. (2010/04/21) */ do { pool_read(CONNECTION(backend, node_id), &kind, sizeof(kind)); /* * read command tag of CommandComplete response */ if (kind != 'E') { readlen += sizeof(kind); memcpy(p, &kind, sizeof(kind)); p += sizeof(kind); } if (major == PROTO_MAJOR_V3) { pool_read(CONNECTION(backend, node_id), &len, sizeof(len)); if (kind != 'E') { readlen += sizeof(len); memcpy(p, &len, sizeof(len)); p += sizeof(len); } len = ntohl(len) - 4; string = pool_read2(CONNECTION(backend, node_id), len); if (string == NULL) ereport(ERROR, (errmsg("do error execute command failed"), errdetail("read from backend failed"))); if (kind != 'E') { readlen += len; if (readlen >= sizeof(buf)) { ereport(ERROR, (errmsg("do error execute command failed"), errdetail("not enough space in buffer"))); } memcpy(p, string, len); p += sizeof(len); } } else { string = pool_read_string(CONNECTION(backend, node_id), &len, 0); if (string == NULL) ereport(ERROR, (errmsg("do error execute command failed"), errdetail("read from backend failed"))); if (kind != 'E') { readlen += len; if (readlen >= sizeof(buf)) { ereport(ERROR, (errmsg("do error execute command failed"), errdetail("not enough space in buffer"))); } memcpy(p, string, len); p += sizeof(len); } } } while (kind != 'E'); if (readlen > 0) { /* put messages back to read buffer */ pool_unread(CONNECTION(backend, node_id), buf, readlen); } } /* * Free POOL_SELECT_RESULT object */ void free_select_result(POOL_SELECT_RESULT * result) { int i, j; int index; if (result == NULL) return; if (result->nullflags) pfree(result->nullflags); if (result->data) { index = 0; for (i = 0; i < result->numrows; i++) { for (j = 0; j < result->rowdesc->num_attrs; j++) { if (result->data[index]) pfree(result->data[index]); index++; } } pfree(result->data); } if (result->rowdesc) { if (result->rowdesc->attrinfo) { for (i = 0; i < result->rowdesc->num_attrs; i++) { if (result->rowdesc->attrinfo[i].attrname) pfree(result->rowdesc->attrinfo[i].attrname); } pfree(result->rowdesc->attrinfo); } pfree(result->rowdesc); } pfree(result); } /* * Send a query to one DB node and wait for it's completion. The quey * can be SELECT or any other type of query. However at this moment, * the only client calls this function other than SELECT is * insert_lock(), and the qury is either LOCK or SELECT for UPDATE. * Note: After the introduction of elog API the return type of do_query is changed * to void. and now ereport is thrown in case of error occured within the function */ void do_query(POOL_CONNECTION * backend, char *query, POOL_SELECT_RESULT * *result, int major) { #define DO_QUERY_ALLOC_NUM 1024 /* memory allocation unit for * POOL_SELECT_RESULT */ /* * State transition control bits. We expect all following events have * been occur before finish do_query() in extended protocol mode. * Note that "Close Compplete" should occur twice, because two close * requests(one for prepared statement and the other for portal) have * been sent. */ #define PARSE_COMPLETE_RECEIVED (1 << 0) #define BIND_COMPLETE_RECEIVED (1 << 1) #define CLOSE_COMPLETE_RECEIVED (1 << 2) #define COMMAND_COMPLETE_RECEIVED (1 << 3) #define ROW_DESCRIPTION_RECEIVED (1 << 4) #define DATA_ROW_RECEIVED (1 << 5) #define STATE_COMPLETED (PARSE_COMPLETE_RECEIVED | BIND_COMPLETE_RECEIVED |\ CLOSE_COMPLETE_RECEIVED | COMMAND_COMPLETE_RECEIVED | \ ROW_DESCRIPTION_RECEIVED | DATA_ROW_RECEIVED) int i; int len; char kind; char *packet = NULL; char *p = NULL; short num_fields = 0; int num_data; int intval; short shortval; POOL_SELECT_RESULT *res; RowDesc *rowdesc; AttrInfo *attrinfo; int nbytes; static char nullmap[8192]; unsigned char mask = 0; bool doing_extended; int num_close_complete; int state; bool data_pushed; data_pushed = false; doing_extended = pool_get_session_context(true) && pool_is_doing_extended_query_message(); ereport(DEBUG1, (errmsg("do_query: extended:%d query:\"%s\"", doing_extended, query))); *result = NULL; res = palloc0(sizeof(*res)); rowdesc = palloc0(sizeof(*rowdesc)); *result = res; res->rowdesc = rowdesc; num_data = 0; res->nullflags = palloc(DO_QUERY_ALLOC_NUM * sizeof(int)); res->data = palloc0(DO_QUERY_ALLOC_NUM * sizeof(char *)); /* * Send a query to the backend. We use extended query proctocol with named * statement/portal if we are processing exetended query since simple * query breaks unnamed statements/portals. The name of named * statment/unamed statement are "pgpool_PID" where PID is the process id * of itself. */ if (pool_get_session_context(true) && pool_is_doing_extended_query_message()) { static char prepared_name[256]; static int pname_len; int qlen; /* * In streaming replication mode, send flush message before going any * further to retrieve and save any pending response packet from * backend. The saved packets will be poped up before returning to * caller. This preserves the user's expectation of packet sequence. */ if (SL_MODE && pool_pending_message_exists()) { data_pushed = pool_push_pending_data(backend); /* * ignore_till_sync flag may have been set in * pool_push_pending_data(). So check it. */ if (pool_is_ignore_till_sync()) { if (data_pushed) { int poplen; pool_pop(backend, &poplen); ereport(DEBUG5, (errmsg("do_query: popped data len:%d because ignore till sync was set", poplen))); } ereport(DEBUG5, (errmsg("do_query: no query issued because ignore till sync was set"))); return; } } if (pname_len == 0) { snprintf(prepared_name, sizeof(prepared_name), "pgpool%d", getpid()); pname_len = strlen(prepared_name) + 1; } qlen = strlen(query) + 1; /* * Send parse message */ pool_write(backend, "P", 1); len = 4 + pname_len + qlen + sizeof(int16); len = htonl(len); pool_write(backend, &len, sizeof(len)); pool_write(backend, prepared_name, pname_len); /* statement */ pool_write(backend, query, qlen); /* query */ shortval = 0; pool_write(backend, &shortval, sizeof(shortval)); /* num parameters */ /* * Send bind message */ pool_write(backend, "B", 1); len = 4 + pname_len + pname_len + sizeof(int16) + sizeof(int16) + sizeof(int16) + sizeof(int16); len = htonl(len); pool_write(backend, &len, sizeof(len)); pool_write(backend, prepared_name, pname_len); /* portal */ pool_write(backend, prepared_name, pname_len); /* statement */ shortval = 0; pool_write(backend, &shortval, sizeof(shortval)); /* num parameter format * code */ pool_write(backend, &shortval, sizeof(shortval)); /* num parameter values */ shortval = htons(1); pool_write(backend, &shortval, sizeof(shortval)); /* num result format */ shortval = 0; pool_write(backend, &shortval, sizeof(shortval)); /* result format (text) */ /* * Send close statement message */ pool_write(backend, "C", 1); len = 4 + 1 + pname_len; len = htonl(len); pool_write(backend, &len, sizeof(len)); pool_write(backend, "S", 1); pool_write(backend, prepared_name, pname_len); /* * Send descrive message if the query is SELECT. */ if (!strncasecmp(query, "SELECT", strlen("SELECT"))) { /* * Send descrive message */ pool_write(backend, "D", 1); len = 4 + 1 + pname_len; len = htonl(len); pool_write(backend, &len, sizeof(len)); pool_write(backend, "P", 1); pool_write(backend, prepared_name, pname_len); } /* * Send execute message */ pool_write(backend, "E", 1); len = 4 + pname_len + 4; len = htonl(len); pool_write(backend, &len, sizeof(len)); pool_write(backend, prepared_name, pname_len); len = htonl(0); pool_write(backend, &len, sizeof(len)); /* * Send close portal message */ pool_write(backend, "C", 1); len = 4 + 1 + pname_len; len = htonl(len); pool_write(backend, &len, sizeof(len)); pool_write(backend, "P", 1); pool_write(backend, prepared_name, pname_len); /* * Send sync or flush message. If we are in an explicit transaction, * sending "sync" is safe because it will not break unnamed portal. * Also this is desirable because if no user queries are sent after * do_query(), COMMIT command could cause statement time out, because * flush message does not clear the alarm for statement time out which * has been set when do_query() issues query. */ if (backend->tstate == 'T') pool_write(backend, "S", 1); /* send "sync" message */ else pool_write(backend, "H", 1); /* send "flush" message */ len = htonl(sizeof(len)); pool_write_and_flush(backend, &len, sizeof(len)); } else { send_simplequery_message(backend, strlen(query) + 1, query, major); } /* * Continue to read packets until we get Ready for command('Z') * * XXX: we ignore other than Z here. Even notice messages are not sent to * the frontend. May be it's ok since the error was caused by our internal * use of SQL command (otherwise users will be confused). */ num_close_complete = 0; state = 0; for (;;) { pool_read(backend, &kind, sizeof(kind)); ereport(DEBUG5, (errmsg("do_query: kind: '%c'", kind))); if (kind == 'E') { char *message = NULL; if (pool_extract_error_message(false, backend, major, true, &message) == 1) { /* * This is fatal. Because: If we operate extended query, * backend would not accept subsequent commands until "sync" * message issued. However, if sync message is issued, unnamed * statement/unnamed portal will disappear and will cause lots * of problems. If we do not operate extended query, ongoing * transaction is aborted, and subsequent query would not * accepted. In summary there's no transparent way for * frontend to handle error case. The only way is closing this * session. */ if (processType == PT_WORKER) { /* * sleep appropreate time to avoid pool_worker_child * exit/fork storm. */ sleep(pool_config->sr_check_period); } ereport(FATAL, (return_code(1), errmsg("Backend throw an error message"), errdetail("Exiting current session because of an error from backend"), errhint("BACKEND Error: \"%s\"", message ? message : ""))); if (message) pfree(message); } } if (major == PROTO_MAJOR_V3) { pool_read(backend, &len, sizeof(len)); len = ntohl(len) - 4; if (len > 0) { packet = pool_read2(backend, len); if (packet == NULL) ereport(ERROR, (errmsg("do query failed"), errdetail("error while reading rest of message"))); } } else { mask = 0; if (kind == 'C' || kind == 'E' || kind == 'N' || kind == 'P') { if (pool_read_string(backend, &len, 0) == NULL) { ereport(ERROR, (errmsg("do query failed"), errdetail("error while reading string of message type %c", kind))); } } } switch (kind) { case 'Z': /* Ready for query */ ereport(DEBUG5, (errmsg("do_query: received READY FOR QUERY ('%c')", kind))); if (!doing_extended) return; /* If "sync" message was issued, 'Z' is expected. */ if (doing_extended && backend->tstate == 'T') state |= COMMAND_COMPLETE_RECEIVED; break; case 'C': /* Command Complete */ ereport(DEBUG5, (errmsg("do_query: received COMMAND COMPLETE ('%c')", kind))); /* * If "sync" message was issued, 'Z' is expected, else we are * done with 'C'. */ if (!doing_extended || backend->tstate != 'T') state |= COMMAND_COMPLETE_RECEIVED; /* * "Comand Complete" implies data row received status if the * query was SELECT. If there's no row returned, "command * complete" comes without row data. */ state |= DATA_ROW_RECEIVED; /* * For other than SELECT, ROW_DESCRIPTION_RECEIVED should be * set because we didn't issue DESCRIBE message. */ state |= ROW_DESCRIPTION_RECEIVED; break; case '1': /* Parse complete */ ereport(DEBUG5, (errmsg("do_query: received PARSE COMPLETE ('%c')", kind))); state |= PARSE_COMPLETE_RECEIVED; break; case '2': /* Bind complete */ ereport(DEBUG5, (errmsg("do_query: received BIND COMPLETE ('%c')", kind))); state |= BIND_COMPLETE_RECEIVED; break; case '3': /* Close complete */ ereport(DEBUG5, (errmsg("do_query: received CLOSE COMPLETE ('%c')", kind))); if (state == 0) { /* * Close complete message received prior to parse complete * message. It is likely that a close message was not * pushed in pool_push_pending_data(). Push the message * now. */ pool_push(backend, "3", 1); len = htonl(4); pool_push(backend, &len, sizeof(len)); data_pushed = true; } else { num_close_complete++; if (num_close_complete >= 2) state |= CLOSE_COMPLETE_RECEIVED; } break; case 'T': /* Row Description */ state |= ROW_DESCRIPTION_RECEIVED; ereport(DEBUG5, (errmsg("do_query: received ROW DESCRIPTION ('%c')", kind))); if (major == PROTO_MAJOR_V3) { if (packet) { p = packet; memcpy(&shortval, p, sizeof(short)); p += sizeof(num_fields); } else { ereport(ERROR, (errmsg("do query failed, no data received for ROW DESCRIPTION ('%c') packet", kind))); } } else { pool_read(backend, &shortval, sizeof(short)); } num_fields = ntohs(shortval); /* number of fields */ ereport(DEBUG5, (errmsg("do_query: row description: num_fileds: %d", num_fields))); if (num_fields > 0) { rowdesc->num_attrs = num_fields; attrinfo = palloc(sizeof(*attrinfo) * num_fields); rowdesc->attrinfo = attrinfo; /* extract attribute info */ for (i = 0; i < num_fields; i++) { if (major == PROTO_MAJOR_V3) { len = strlen(p) + 1; attrinfo->attrname = palloc(len); memcpy(attrinfo->attrname, p, len); p += len; memcpy(&intval, p, sizeof(int)); attrinfo->oid = htonl(intval); p += sizeof(int); memcpy(&shortval, p, sizeof(short)); attrinfo->attrnumber = htons(shortval); p += sizeof(short); memcpy(&intval, p, sizeof(int)); attrinfo->typeoid = htonl(intval); p += sizeof(int); memcpy(&shortval, p, sizeof(short)); attrinfo->size = htons(shortval); p += sizeof(short); memcpy(&intval, p, sizeof(int)); attrinfo->mod = htonl(intval); p += sizeof(int); p += sizeof(short); /* skip format code since we * use "text" anyway */ } else { p = pool_read_string(backend, &len, 0); attrinfo->attrname = palloc(len); memcpy(attrinfo->attrname, p, len); pool_read(backend, &intval, sizeof(int)); attrinfo->typeoid = ntohl(intval); pool_read(backend, &shortval, sizeof(short)); attrinfo->size = ntohs(shortval); pool_read(backend, &intval, sizeof(int)); attrinfo->mod = ntohl(intval); } attrinfo++; } } break; case 'D': /* data row */ state |= DATA_ROW_RECEIVED; ereport(DEBUG5, (errmsg("do_query: received DATA ROW ('%c')", kind))); if (major == PROTO_MAJOR_V3) { p = packet; if (p) { memcpy(&shortval, p, sizeof(short)); num_fields = htons(shortval); p += sizeof(short); } else ereport(ERROR, (errmsg("do query failed"), errdetail("error while reading data"))); } if (num_fields > 0) { if (major == PROTO_MAJOR_V2) { nbytes = (num_fields + 7) / 8; if (nbytes <= 0) ereport(ERROR, (errmsg("do query failed"), errdetail("error while reading null bitmap"))); pool_read(backend, nullmap, nbytes); } res->numrows++; for (i = 0; i < num_fields; i++) { if (major == PROTO_MAJOR_V3) { memcpy(&intval, p, sizeof(int)); len = htonl(intval); p += sizeof(int); res->nullflags[num_data] = len; if (len >= 0) /* NOT NULL? */ { res->data[num_data] = palloc(len + 1); memcpy(res->data[num_data], p, len); *(res->data[num_data] + len) = '\0'; p += len; } } else { if (mask == 0) mask = 0x80; /* NOT NULL? */ if (mask & nullmap[i / 8]) { /* field size */ pool_read(backend, &len, sizeof(int)); len = ntohl(len) - 4; res->nullflags[num_data] = len; if (len >= 0) { p = pool_read2(backend, len); res->data[num_data] = palloc(len + 1); memcpy(res->data[num_data], p, len); *(res->data[num_data] + len) = '\0'; if (res->data[num_data] == NULL) ereport(ERROR, (errmsg("do query failed"), errdetail("error while reading field data"))); } } else { res->nullflags[num_data] = -1; } mask >>= 1; } num_data++; if (num_data % DO_QUERY_ALLOC_NUM == 0) { res->nullflags = repalloc(res->nullflags, (num_data / DO_QUERY_ALLOC_NUM + 1) * DO_QUERY_ALLOC_NUM * sizeof(int)); res->data = repalloc(res->data, (num_data / DO_QUERY_ALLOC_NUM + 1) * DO_QUERY_ALLOC_NUM * sizeof(char *)); } } } break; default: break; } if (doing_extended && (state & STATE_COMPLETED) == STATE_COMPLETED) { ereport(DEBUG5, (errmsg("do_query: all state completed. returning"))); break; } } if (data_pushed) { int poplen; pool_pop(backend, &poplen); ereport(DEBUG5, (errmsg("do_query: popped data len:%d", poplen))); } } /* * Judge if we need to lock the table * to keep SERIAL consistency among servers * Return values are: * 0: lock is not neccessary * 1: table lock is required * 2: row lock against sequence table is required * 3: row lock against insert_lock table is required */ int need_insert_lock(POOL_CONNECTION_POOL * backend, char *query, Node *node) { /* * Query to know if the target table has SERIAL column or not. * This query is valid through PostgreSQL 7.3 or higher. */ #define NEXTVALQUERY (Pgversion(backend)->major >= 73 ? \ "SELECT count(*) FROM pg_catalog.pg_attrdef AS d, pg_catalog.pg_class AS c WHERE d.adrelid = c.oid AND pg_get_expr(d.adbin, d.adrelid) ~ 'nextval' AND c.relname = '%s'" : \ "SELECT count(*) FROM pg_catalog.pg_attrdef AS d, pg_catalog.pg_class AS c WHERE d.adrelid = c.oid AND d.adsrc ~ 'nextval' AND c.relname = '%s'") #define NEXTVALQUERY2 (Pgversion(backend)->major >= 73 ? \ "SELECT count(*) FROM pg_catalog.pg_attrdef AS d, pg_catalog.pg_class AS c WHERE d.adrelid = c.oid AND pg_get_expr(d.adbin, d.adrelid) ~ 'nextval' AND c.oid = pgpool_regclass('%s')" : \ "SELECT count(*) FROM pg_catalog.pg_attrdef AS d, pg_catalog.pg_class AS c WHERE d.adrelid = c.oid AND d.adsrc ~ 'nextval' AND c.oid = pgpool_regclass('%s')") #define NEXTVALQUERY3 (Pgversion(backend)->major >= 73 ? \ "SELECT count(*) FROM pg_catalog.pg_attrdef AS d, pg_catalog.pg_class AS c WHERE d.adrelid = c.oid AND pg_get_expr(d.adbin, d.adrelid) ~ 'nextval' AND c.oid = pg_catalog.to_regclass('%s')" : \ "SELECT count(*) FROM pg_catalog.pg_attrdef AS d, pg_catalog.pg_class AS c WHERE d.adrelid = c.oid AND d.adsrc ~ 'nextval' AND c.oid = pg_catalog.to_regclass('%s')") char *table; int result; static POOL_RELCACHE * relcache; /* INSERT statement? */ if (!IsA(node, InsertStmt)) return 0; /* need to ignore leading white spaces? */ if (pool_config->ignore_leading_white_space) { /* ignore leading white spaces */ while (*query && isspace(*query)) query++; } /* is there "NO_LOCK" comment? */ if (strncasecmp(query, NO_LOCK_COMMENT, NO_LOCK_COMMENT_SZ) == 0) return 0; /* is there "LOCK" comment? */ if (strncasecmp(query, LOCK_COMMENT, LOCK_COMMENT_SZ) == 0) return 1; if (pool_config->insert_lock == 0) /* insert_lock is specified? */ return 0; /* * if insert_lock is true, then check if the table actually uses SERIAL * data type */ /* obtain table name */ table = get_insert_command_table_name((InsertStmt *) node); if (table == NULL) { ereport(LOG, (errmsg("unable to get table name from insert statement while checking if table locking is required"))); return 0; } if (!pool_has_to_regclass() && !pool_has_pgpool_regclass()) table = remove_quotes_and_schema_from_relname(table); /* * If relcache does not exist, create it. */ if (!relcache) { char *query; /* PostgreSQL 9.4 or later has to_regclass() */ if (pool_has_to_regclass()) { query = NEXTVALQUERY3; } else if (pool_has_pgpool_regclass()) { query = NEXTVALQUERY2; } else { query = NEXTVALQUERY; } relcache = pool_create_relcache(pool_config->relcache_size, query, int_register_func, int_unregister_func, false); if (relcache == NULL) { ereport(LOG, (errmsg("unable to create relcache while checking if table locking is required"))); return 0; } } /* * Search relcache. */ #ifdef USE_TABLE_LOCK result = pool_search_relcache(relcache, backend, table) == 0 ? 0 : 1; #elif USE_SEQUENCE_LOCK result = pool_search_relcache(relcache, backend, table) == 0 ? 0 : 2; #else result = pool_search_relcache(relcache, backend, table) == 0 ? 0 : 3; #endif return result; } /* * insert lock to synchronize sequence number * lock_kind are: * 1: Issue LOCK TABLE IN SHARE ROW EXCLUSIVE MODE * 2: Issue row lock against sequence table * 3: Issue row lock against pgpool_catalog.insert_lock table * "lock_kind == 2" is deprecated because PostgreSQL disallows * SELECT FOR UPDATE/SHARE on sequence tables since 2011/06/03. * See following threads for more details: * [HACKERS] pgpool versus sequences * [ADMIN] 'SGT DETAIL: Could not open file "pg_clog/05DC": ... */ POOL_STATUS insert_lock(POOL_CONNECTION * frontend, POOL_CONNECTION_POOL * backend, char *query, InsertStmt *node, int lock_kind) { char *table; int len = 0; char qbuf[1024]; int i, deadlock_detected = 0; char *adsrc; char seq_rel_name[MAX_NAME_LEN + 1]; regex_t preg; size_t nmatch = 2; regmatch_t pmatch[nmatch]; static POOL_RELCACHE * relcache; POOL_SELECT_RESULT *result; POOL_STATUS status = POOL_CONTINUE; /* insert_lock can be used in V3 only */ if (MAJOR(backend) != PROTO_MAJOR_V3) return POOL_CONTINUE; /* get table name */ table = get_insert_command_table_name(node); /* could not get table name. probably wrong SQL command */ if (table == NULL) { return POOL_CONTINUE; } /* table lock for insert target table? */ if (lock_kind == 1) { /* Issue lock table command */ snprintf(qbuf, sizeof(qbuf), "LOCK TABLE %s IN SHARE ROW EXCLUSIVE MODE", table); } /* row lock for sequence table? */ else if (lock_kind == 2) { /* * If relcache does not exist, create it. */ if (!relcache) { char *query; /* PostgreSQL 9.4 or later has to_regclass() */ if (pool_has_to_regclass()) { query = SEQUENCETABLEQUERY3; } else if (pool_has_pgpool_regclass()) { query = SEQUENCETABLEQUERY2; } else { query = SEQUENCETABLEQUERY; } relcache = pool_create_relcache(pool_config->relcache_size, query, string_register_func, string_unregister_func, false); if (relcache == NULL) { ereport(FATAL, (return_code(2), errmsg("unable to get insert lock on table"), errdetail("error while creating relcache"))); } } if (!pool_has_to_regclass() && !pool_has_pgpool_regclass()) table = remove_quotes_and_schema_from_relname(table); /* * Search relcache. */ adsrc = pool_search_relcache(relcache, backend, table); if (adsrc == NULL) { /* could not get adsrc */ return POOL_CONTINUE; } ereport(DEBUG1, (errmsg("getting insert lock on table"), errdetail("adsrc: \"%s\"", adsrc))); if (regcomp(&preg, "nextval\\(+'(.+)'", REG_EXTENDED | REG_NEWLINE) != 0) ereport(FATAL, (return_code(2), errmsg("unable to get insert lock on table"), errdetail("regex compile failed"))); if (regexec(&preg, adsrc, nmatch, pmatch, 0) == 0) { /* pmatch[0] is "nextval('...'", pmatch[1] is sequence name */ if (pmatch[1].rm_so >= 0 && pmatch[1].rm_eo >= 0) { len = pmatch[1].rm_eo - pmatch[1].rm_so; strncpy(seq_rel_name, adsrc + pmatch[1].rm_so, len); *(seq_rel_name + len) = '\0'; } } regfree(&preg); if (len == 0) ereport(FATAL, (return_code(2), errmsg("unable to get insert lock on table"), errdetail("regex no match: pg_attrdef is %s", adsrc))); ereport(DEBUG1, (errmsg("getting insert lock on table"), errdetail("seq rel name: %s", seq_rel_name))); snprintf(qbuf, sizeof(qbuf), "SELECT 1 FROM %s FOR UPDATE", seq_rel_name); } /* row lock for insert_lock table? */ else { if (pool_has_insert_lock()) { if (pool_has_to_regclass()) snprintf(qbuf, sizeof(qbuf), ROWLOCKQUERY3, table); else if (pool_has_pgpool_regclass()) snprintf(qbuf, sizeof(qbuf), ROWLOCKQUERY2, table); else { table = remove_quotes_and_schema_from_relname(table); snprintf(qbuf, sizeof(qbuf), ROWLOCKQUERY, table); } } else { /* issue lock table command if insert_lock table does not exist */ lock_kind = 1; snprintf(qbuf, sizeof(qbuf), "LOCK TABLE %s IN SHARE ROW EXCLUSIVE MODE", table); } } per_node_statement_log(backend, MASTER_NODE_ID, qbuf); if (lock_kind == 1) { if (pool_get_session_context(true) && pool_is_doing_extended_query_message()) { do_query(MASTER(backend), qbuf, &result, MAJOR(backend)); } else { status = do_command(frontend, MASTER(backend), qbuf, MAJOR(backend), MASTER_CONNECTION(backend)->pid, MASTER_CONNECTION(backend)->key, 0); } } else if (lock_kind == 2) { do_query(MASTER(backend), qbuf, &result, MAJOR(backend)); } else { POOL_SELECT_RESULT *result; /* issue row lock command */ do_query(MASTER(backend), qbuf, &result, MAJOR(backend)); if (status == POOL_CONTINUE) { /* does oid exist in insert_lock table? */ if (result && result->numrows == 0) { free_select_result(result); result = NULL; /* insert a lock target row into insert_lock table */ status = add_lock_target(frontend, backend, table); if (status == POOL_CONTINUE) { per_node_statement_log(backend, MASTER_NODE_ID, qbuf); /* issue row lock command */ do_query(MASTER(backend), qbuf, &result, MAJOR(backend)); if (!(result && result->data[0] && !strcmp(result->data[0], "1"))) ereport(FATAL, (return_code(2), errmsg("failed to get insert lock"), errdetail("unexpected data from backend"))); } } } if (result) free_select_result(result); if (status != POOL_CONTINUE) { /* try to lock table finally, if row lock failed */ lock_kind = 1; snprintf(qbuf, sizeof(qbuf), "LOCK TABLE %s IN SHARE ROW EXCLUSIVE MODE", table); per_node_statement_log(backend, MASTER_NODE_ID, qbuf); if (pool_get_session_context(true) && pool_is_doing_extended_query_message()) { do_query(MASTER(backend), qbuf, &result, MAJOR(backend)); if (result) free_select_result(result); } else { status = do_command(frontend, MASTER(backend), qbuf, MAJOR(backend), MASTER_CONNECTION(backend)->pid, MASTER_CONNECTION(backend)->key, 0); } } } if (status == POOL_END) { return POOL_END; } else if (status == POOL_DEADLOCK) deadlock_detected = 1; for (i = 0; i < NUM_BACKENDS; i++) { if (VALID_BACKEND(i) && !IS_MASTER_NODE_ID(i)) { if (deadlock_detected) status = do_command(frontend, CONNECTION(backend, i), POOL_ERROR_QUERY, PROTO_MAJOR_V3, MASTER_CONNECTION(backend)->pid, MASTER_CONNECTION(backend)->key, 0); else { if (lock_kind == 1) { per_node_statement_log(backend, i, qbuf); if (pool_get_session_context(true) && pool_is_doing_extended_query_message()) { do_query(MASTER(backend), qbuf, &result, MAJOR(backend)); if (result) free_select_result(result); } else { status = do_command(frontend, CONNECTION(backend, i), qbuf, PROTO_MAJOR_V3, MASTER_CONNECTION(backend)->pid, MASTER_CONNECTION(backend)->key, 0); } } else if (lock_kind == 2) { per_node_statement_log(backend, i, qbuf); do_query(CONNECTION(backend, i), qbuf, &result, MAJOR(backend)); if (result) free_select_result(result); } } if (status != POOL_CONTINUE) { return POOL_END; } } } return POOL_CONTINUE; } /* * Judge if we have insert_lock table or not. */ static bool pool_has_insert_lock(void) { /* * Query to know if insert_lock table exists. */ bool result; static POOL_RELCACHE * relcache; POOL_CONNECTION_POOL *backend; backend = pool_get_session_context(false)->backend; if (!relcache) { relcache = pool_create_relcache(pool_config->relcache_size, HASINSERT_LOCKQUERY, int_register_func, int_unregister_func, false); if (relcache == NULL) ereport(FATAL, (return_code(2), errmsg("unable to get insert lock status"), errdetail("error while creating relcache"))); } result = pool_search_relcache(relcache, backend, "insert_lock") == 0 ? 0 : 1; return result; } /* * Insert a lock target row into insert_lock table. * This function is called after the transaction has been started. * Protocol is V3 only. * Return POOL_CONTINUE if the row is inserted successfully * or the row already exists, the others return POOL_ERROR. */ static POOL_STATUS add_lock_target(POOL_CONNECTION * frontend, POOL_CONNECTION_POOL * backend, char *table) { /* * lock the row where reloid is 0 to avoid "duplicate key violates..." * error when insert new oid */ if (!has_lock_target(frontend, backend, NULL, true)) { ereport(LOG, (errmsg("add lock target: not lock the row where reloid is 0"))); per_node_statement_log(backend, MASTER_NODE_ID, "LOCK TABLE pgpool_catalog.insert_lock IN SHARE ROW EXCLUSIVE MODE"); if (do_command(frontend, MASTER(backend), "LOCK TABLE pgpool_catalog.insert_lock IN SHARE ROW EXCLUSIVE MODE", PROTO_MAJOR_V3, MASTER_CONNECTION(backend)->pid, MASTER_CONNECTION(backend)->key, 0) != POOL_CONTINUE) ereport(ERROR, (errmsg("unable to add lock target"), errdetail("do_command returned DEADLOCK status"))); if (has_lock_target(frontend, backend, NULL, false)) { ereport(DEBUG1, (errmsg("add lock target: reloid 0 already exists in insert_lock table"))); } else { if (insert_oid_into_insert_lock(frontend, backend, NULL) != POOL_CONTINUE) { ereport(ERROR, (errmsg("unable to start the internal transaction"), errdetail("failed to insert 0 into insert_lock table"))); } } } /* does insert_lock table contain the oid of the table? */ if (has_lock_target(frontend, backend, table, false)) { ereport(DEBUG1, (errmsg("add_lock_target: \"%s\" oid already exists in insert_lock table", table))); return POOL_CONTINUE; } /* insert the oid of the table into insert_lock table */ if (insert_oid_into_insert_lock(frontend, backend, table) != POOL_CONTINUE) ereport(ERROR, (errmsg("unable to start the internal transaction"), errdetail("could not insert \"%s\" oid into insert_lock table", table))); return POOL_CONTINUE; } /* * Judge if insert_lock table contains the oid of the specified table or not. * If the table name is NULL, this function checks whether oid 0 exists. * If lock is true, this function locks the row of the table oid. */ static bool has_lock_target(POOL_CONNECTION * frontend, POOL_CONNECTION_POOL * backend, char *table, bool lock) { char *suffix; char qbuf[QUERY_STRING_BUFFER_LEN]; POOL_SELECT_RESULT *result; suffix = lock ? " FOR UPDATE" : ""; if (table) { if (pool_has_to_regclass()) snprintf(qbuf, sizeof(qbuf), "SELECT 1 FROM pgpool_catalog.insert_lock WHERE reloid = pg_catalog.to_regclass('%s')%s", table, suffix); else if (pool_has_pgpool_regclass()) snprintf(qbuf, sizeof(qbuf), "SELECT 1 FROM pgpool_catalog.insert_lock WHERE reloid = pgpool_regclass('%s')%s", table, suffix); else snprintf(qbuf, sizeof(qbuf), "SELECT 1 FROM pgpool_catalog.insert_lock WHERE reloid = (SELECT oid FROM pg_catalog.pg_class WHERE relname = '%s' ORDER BY oid LIMIT 1)%s", table, suffix); } else { snprintf(qbuf, sizeof(qbuf), "SELECT 1 FROM pgpool_catalog.insert_lock WHERE reloid = 0%s", suffix); } per_node_statement_log(backend, MASTER_NODE_ID, qbuf); do_query(MASTER(backend), qbuf, &result, MAJOR(backend)); if (result && result->data[0] && !strcmp(result->data[0], "1")) { free_select_result(result); return true; } if (result) free_select_result(result); return false; } /* * Insert the oid of the specified table into insert_lock table. */ static POOL_STATUS insert_oid_into_insert_lock(POOL_CONNECTION * frontend, POOL_CONNECTION_POOL * backend, char *table) { char qbuf[QUERY_STRING_BUFFER_LEN]; POOL_STATUS status; if (table) { if (pool_has_to_regclass()) snprintf(qbuf, sizeof(qbuf), "INSERT INTO pgpool_catalog.insert_lock VALUES (pg_catalog.to_regclass('%s'))", table); else if (pool_has_pgpool_regclass()) snprintf(qbuf, sizeof(qbuf), "INSERT INTO pgpool_catalog.insert_lock VALUES (pgpool_regclass('%s'))", table); else snprintf(qbuf, sizeof(qbuf), "INSERT INTO pgpool_catalog.insert_lock SELECT oid FROM pg_catalog.pg_class WHERE relname = '%s' ORDER BY oid LIMIT 1", table); } else { snprintf(qbuf, sizeof(qbuf), "INSERT INTO pgpool_catalog.insert_lock VALUES (0)"); } per_node_statement_log(backend, MASTER_NODE_ID, qbuf); status = do_command(frontend, MASTER(backend), qbuf, PROTO_MAJOR_V3, MASTER_CONNECTION(backend)->pid, MASTER_CONNECTION(backend)->key, 0); return status; } /* * Obtain table name in INSERT statement. * The table name is stored in the static buffer of this function. * So subsequent call to this function will destroy previous result. */ static char * get_insert_command_table_name(InsertStmt *node) { POOL_SESSION_CONTEXT *session_context; static char table[MAX_NAME_LEN + 1]; char *p; session_context = pool_get_session_context(true); if (!session_context) return NULL; p = make_table_name_from_rangevar(node->relation); if (p == NULL) { ereport(DEBUG1, (errmsg("unable to get table name from insert command"))); return NULL; } strlcpy(table, p, sizeof(table)); ereport(DEBUG2, (errmsg("table name in insert command is \"%s\"", table))); return table; } /* judge if this is a DROP DATABASE command */ int is_drop_database(Node *node) { return (node && IsA(node, DropdbStmt)) ? 1 : 0; } /* * check if any pending data remains in backend. */ bool is_backend_cache_empty(POOL_CONNECTION_POOL * backend) { int i; for (i = 0; i < NUM_BACKENDS; i++) { if (!VALID_BACKEND(i)) continue; /* * If SSL is enabled, we need to check SSL internal buffer is empty or * not first. */ if (pool_ssl_pending(CONNECTION(backend, i))) return false; if (!pool_read_buffer_is_empty(CONNECTION(backend, i))) return false; } return true; } /* * check if any pending data remains. */ static bool is_cache_empty(POOL_CONNECTION * frontend, POOL_CONNECTION_POOL * backend) { /* Are we suspending reading from frontend? */ if (!pool_is_suspend_reading_from_frontend()) { /* * If SSL is enabled, we need to check SSL internal buffer is empty or not * first. */ if (pool_ssl_pending(frontend)) return false; if (!pool_read_buffer_is_empty(frontend)) return false; } return is_backend_cache_empty(backend); } /* * check if query is needed to wait completion */ bool is_strict_query(Node *node) { switch (node->type) { case T_SelectStmt: { SelectStmt *stmt = (SelectStmt *) node; return stmt->intoClause != NULL || stmt->lockingClause != NIL; } case T_UpdateStmt: case T_InsertStmt: case T_DeleteStmt: case T_LockStmt: return true; default: return false; } return false; } int check_copy_from_stdin(Node *node) { if (copy_schema) pfree(copy_schema); if (copy_table) pfree(copy_table); if (copy_null) pfree(copy_null); copy_schema = copy_table = copy_null = NULL; if (IsA(node, CopyStmt)) { CopyStmt *stmt = (CopyStmt *) node; if (stmt->is_from == TRUE && stmt->filename == NULL) { RangeVar *relation = (RangeVar *) stmt->relation; ListCell *lc; /* query is COPY FROM STDIN */ if (relation->schemaname) copy_schema = MemoryContextStrdup(TopMemoryContext, relation->schemaname); else copy_schema = MemoryContextStrdup(TopMemoryContext, "public"); copy_table = MemoryContextStrdup(TopMemoryContext, relation->relname); copy_delimiter = '\t'; /* default delimiter */ copy_null = MemoryContextStrdup(TopMemoryContext, "\\N"); /* default null string */ /* look up delimiter and null string. */ foreach(lc, stmt->options) { DefElem *elem = lfirst(lc); Value *v; if (strcmp(elem->defname, "delimiter") == 0) { v = (Value *) elem->arg; copy_delimiter = v->val.str[0]; } else if (strcmp(elem->defname, "null") == 0) { if (copy_null) pfree(copy_null); v = (Value *) elem->arg; copy_null = MemoryContextStrdup(TopMemoryContext, v->val.str); } } } return 1; } return 0; } /* * read kind from one backend */ void read_kind_from_one_backend(POOL_CONNECTION * frontend, POOL_CONNECTION_POOL * backend, char *kind, int node) { if (VALID_BACKEND(node)) { char k; pool_read(CONNECTION(backend, node), &k, 1); *kind = k; } else { pool_dump_valid_backend(node); ereport(ERROR, (errmsg("unable to read message kind from backend"), errdetail("%d th backend is not valid", node))); } } /* * returns true if all slaves status are 'C' (Command Complete) */ static bool is_all_slaves_command_complete(unsigned char *kind_list, int num_backends, int master) { int i; int ok = true; for (i = 0; i < num_backends; i++) { if (i == master || kind_list[i] == 0) continue; if (kind_list[i] != 'C') { ok = false; break; } } return ok; } /* * read_kind_from_backend: read kind from backends. * the "frontend" parameter is used to send "kind mismatch" error message to the frontend. * the out parameter "decided_kind" is the packet kind decided by this function. * this function uses "decide by majority" method if kinds from all backends do not agree. */ void read_kind_from_backend(POOL_CONNECTION * frontend, POOL_CONNECTION_POOL * backend, char *decided_kind) { int i; unsigned char kind_list[MAX_NUM_BACKENDS]; /* records each backend's kind */ unsigned char kind_map[256]; /* records which kind gets majority. 256 * is the number of distinct values * expressed by unsigned char */ unsigned char kind; int trust_kind = 0; /* decided kind */ int max_kind = 0; double max_count = 0; int degenerate_node_num = 0; /* number of backends degeneration * requested */ int degenerate_node[MAX_NUM_BACKENDS]; /* degeneration requested * backend list */ POOL_SESSION_CONTEXT *session_context = pool_get_session_context(false); POOL_QUERY_CONTEXT *query_context = session_context->query_context; POOL_PENDING_MESSAGE *msg = NULL; POOL_PENDING_MESSAGE *previous_message; int num_executed_nodes = 0; int first_node = -1; memset(kind_map, 0, sizeof(kind_map)); if (SL_MODE && pool_get_session_context(true) && pool_is_doing_extended_query_message()) { msg = pool_pending_message_head_message(); previous_message = pool_pending_message_get_previous_message(); if (!msg) { ereport(DEBUG5, (errmsg("read_kind_from_backend: no pending message"))); /* * There is no pending message in the queue. This could mean we * are receiving data rows. If so, previous_msg must exist and * the query must be SELECT. */ if (previous_message == NULL) { /* no previous message. let's unset query in progress flag. */ ereport(DEBUG5, (errmsg("read_kind_from_backend: no previous message"))); pool_unset_query_in_progress(); } else { /* * Previous message exists. Let's see if it could return rows. * If not, we cannot predict what kind of message will arrive, * so just unset query in progress. */ if (previous_message->is_rows_returned) { ereport(DEBUG5, (errmsg("read_kind_from_backend: no pending message, previous message exists, rows returning"))); session_context->query_context = previous_message->query_context; pool_set_query_in_progress(); } else pool_unset_query_in_progress(); } } else { if (msg->type == POOL_SYNC) { ereport(DEBUG5, (errmsg("read_kind_from_backend: sync pending message exists"))); session_context->query_context = NULL; pool_unset_ignore_till_sync(); pool_unset_query_in_progress(); } else { ereport(DEBUG5, (errmsg("read_kind_from_backend: pending message exists. query context: %p", msg->query_context))); pool_pending_message_set_previous_message(msg); pool_pending_message_query_context_dest_set(msg, msg->query_context); session_context->query_context = msg->query_context; ereport(DEBUG5, (errmsg("read_kind_from_backend: where_to_send[0]:%d [1]:%d", msg->query_context->where_to_send[0], msg->query_context->where_to_send[1]))); pool_set_query_in_progress(); } } } if (MASTER_SLAVE) { ereport(DEBUG5, (errmsg("reading backend data packet kind"), errdetail("master node id: %d", MASTER_NODE_ID))); read_kind_from_one_backend(frontend, backend, (char *) &kind, MASTER_NODE_ID); /* * If we received a notification message in master/slave mode, other * backends will not receive the message. So we should skip other * nodes otherwise we will hang in pool_read. */ if (kind == 'A') { *decided_kind = 'A'; ereport(DEBUG5, (errmsg("reading backend data packet kind"), errdetail("received notification message for master node %d", MASTER_NODE_ID))); if (msg) pool_pending_message_free_pending_message(msg); return; } pool_unread(CONNECTION(backend, MASTER_NODE_ID), &kind, sizeof(kind)); } for (i = 0; i < NUM_BACKENDS; i++) { /* initialize degenerate record */ degenerate_node[i] = 0; kind_list[i] = 0; if (VALID_BACKEND(i)) { num_executed_nodes++; if (first_node < 0) first_node = i; do { char *p, *value; int len; kind = 0; if (pool_read(CONNECTION(backend, i), &kind, 1)) { ereport(FATAL, (return_code(2), errmsg("failed to read kind from backend %d", i), errdetail("pool_read retruns error"))); } if (kind == 0) { ereport(FATAL, (return_code(2), errmsg("failed to read kind from backend %d", i), errdetail("kind == 0"))); } ereport(DEBUG5, (errmsg("reading backend data packet kind"), errdetail("backend:%d kind:'%c'", i, kind))); /* * Read and discard parameter status and notice messages */ if (kind == 'N') { ereport(DEBUG5, (errmsg("received log message from backend %d while reading packet kind", i))); pool_process_notice_message_from_one_backend(frontend, backend, i, kind); } else if (kind == 'S') { pool_read(CONNECTION(backend, i), &len, sizeof(len)); len = htonl(len) - 4; p = pool_read2(CONNECTION(backend, i), len); if (p) { value = p + strlen(p) + 1; ereport(DEBUG5, (errmsg("reading backend data packet kind"), errdetail("parameter name: %s value: \"%s\"", p, value))); if (IS_MASTER_NODE_ID(i)) pool_add_param(&CONNECTION(backend, i)->params, p, value); } else { ereport(WARNING, (errmsg("failed to read parameter status packet from backend %d", i), errdetail("read from backend failed"))); } } } while (kind == 'S' || kind == 'N'); #ifdef DEALLOCATE_ERROR_TEST if (i == 1 && kind == 'C' && pending_function && pending_prepared_portal && IsA(pending_prepared_portal->stmt, DeallocateStmt)) kind = 'E'; #endif kind_list[i] = kind; ereport(DEBUG5, (errmsg("reading backend data packet kind"), errdetail("backend:%d of %d kind = '%c'", i, NUM_BACKENDS, kind_list[i]))); kind_map[kind]++; if (kind_map[kind] > max_count) { max_kind = kind_list[i]; max_count = kind_map[kind]; } } else kind_list[i] = 0; } ereport(DEBUG5, (errmsg("read_kind_from_backend max_count:%f num_executed_nodes:%d", max_count, num_executed_nodes))); if (max_count != num_executed_nodes) { /* * not all backends agree with kind. We need to do "decide by * majority" */ /* * If we are in streaming replication mode and kind = 'Z' (ready for * query) on master and kind on standby is not 'Z', it is likely that * following scenario happened. * * FE=>Parse("BEGIN") FE=>Bind FE=>Execute("BEGIN"); * * At this point, Parse, Bind and Execute message are sent to both * primary and standby node (if load balancing node is not primary). * Then, the frontend sends next parse message which is supposed to be * executed on primary only, for example UPDATE. * * FE=>Parse("UPDATE ...") FE=>Bind FE=>Execute("Update..."); FE=>Sync * * Here, Sync message is sent to only primary, since the query context * said so. Thus responses for Parse, Bind, and Execute for "BEGIN" * are still penidng on the standby node. * * The the frontend sends closes the transaction. * * FE=>Parse("COMMIT"); FE=>Bind FE=>Execute FE=>Sync * * Here, sync message is sent to both primary and standby. So both * nodes happily send back responses. Those will be: * * On the primary side: parse complete, bind complete, command * complete and ready for query[1]. These are all responses for * COMMIT. * * On the standby side: parse complete, bind complete and command * complete. These are all responses for *BEGIN*. Then parse * complete[2], bind complete, command complete and ready for query * (responses for COMMIT). * * As a result, [1] and [2] are different and kind mismatch error * occurs. * * There seem to be no general solution for this at least for me. What * we can do is, discard the standby response until it matches the * response of the primary server. Although this could happen in * various scenario, probably we should employ this strategy for 'Z' * (ready for response) case only, since it's a good candidate to * re-sync primary and standby. * * 2017/7/16 Tatsuo Ishii wrote: The issue above has been solved since * the pending message mechanism was introduced. However, in error * cases it is possible that similar issue could happen since returned * messages do not follow the sequence recorded in the pending * messages because the backend ignores requests till sync message is * received. In this case we need to re-sync either master or standby. * So we check not only the standby but master node. */ if (session_context->load_balance_node_id != MASTER_NODE_ID && (kind_list[MASTER_NODE_ID] == 'Z' || kind_list[session_context->load_balance_node_id] == 'Z') && SL_MODE) { POOL_CONNECTION *s; char *buf; int len; if (kind_list[MASTER_NODE_ID] == 'Z') s = CONNECTION(backend, session_context->load_balance_node_id); else s = CONNECTION(backend, MASTER_NODE_ID); /* skip len and contents corresponding standby data */ pool_read(s, &len, sizeof(len)); len = ntohl(len); if ((len - sizeof(len)) > 0) { len -= sizeof(len); buf = palloc(len); pool_read(s, buf, len); pfree(buf); } ereport(DEBUG5, (errmsg("read_kind_from_backend: skipped first standy packet"))); for (;;) { pool_read(s, &kind, 1); ereport(DEBUG5, (errmsg("read_kind_from_backend: checking kind: '%c'", kind))); if (kind == 'Z') { /* succeeded in re-sync */ ereport(DEBUG5, (errmsg("read_kind_from_backend: succeeded in re-sync"))); *decided_kind = kind; if (SL_MODE && pool_get_session_context(true) && pool_is_doing_extended_query_message() && msg && msg->type == POOL_SYNC) { POOL_PENDING_MESSAGE *pending_message; pending_message = pool_pending_message_pull_out(); if (pending_message) pool_pending_message_free_pending_message(pending_message); } pool_pending_message_free_pending_message(msg); return; } ereport(DEBUG5, (errmsg("read_kind_from_backend: reading len"))); pool_read(s, &len, sizeof(len)); ereport(DEBUG5, (errmsg("read_kind_from_backend: finished reading len:%d", ntohl(len)))); len = ntohl(len); if ((len - sizeof(len)) > 0) { len -= sizeof(len); ereport(DEBUG5, (errmsg("read_kind_from_backend: reading message len:%d", len))); buf = palloc(len); pool_read(s, buf, len); pfree(buf); } } } /* * In master slave mode, if master gets an error at commit, while * other slaves are normal at commit, we don't need to degenerate any * backend because it is likely that the error was caused by a * deferred trigger. */ else if (MASTER_SLAVE && query_context->parse_tree && is_commit_query(query_context->parse_tree) && kind_list[MASTER_NODE_ID] == 'E' && is_all_slaves_command_complete(kind_list, NUM_BACKENDS, MASTER_NODE_ID)) { *decided_kind = kind_list[MASTER_NODE_ID]; ereport(LOG, (errmsg("reading backend data packet kind. Error on master while all slaves are normal"), errdetail("do not degenerate because it is likely caused by a delayed commit"))); if (SL_MODE && pool_is_doing_extended_query_message() && msg) pool_pending_message_free_pending_message(msg); return; } else if (max_count <= NUM_BACKENDS / 2.0) { /* no one gets majority. We trust master node's kind */ trust_kind = kind_list[MASTER_NODE_ID]; } else /* max_count > NUM_BACKENDS / 2.0 */ { /* trust majority's kind */ trust_kind = max_kind; } for (i = 0; i < NUM_BACKENDS; i++) { if (session_context->in_progress && !pool_is_node_to_be_sent(query_context, i)) continue; if (kind_list[i] != 0 && trust_kind != kind_list[i]) { /* degenerate */ ereport(WARNING, (errmsg("packet kind of backend %d ['%c'] does not match with master/majority nodes packet kind ['%c']", i, kind_list[i], trust_kind))); degenerate_node[degenerate_node_num++] = i; } } } else if (first_node == -1) { ereport(FATAL, (return_code(2), errmsg("failed to read kind from backend"), errdetail("couldn't find first node. All backend down?"))); } else trust_kind = kind_list[first_node]; *decided_kind = trust_kind; if (degenerate_node_num) { int retcode = 2; String *msg = init_string("kind mismatch among backends. "); string_append_char(msg, "Possible last query was: \""); string_append_char(msg, query_string_buffer); string_append_char(msg, "\" kind details are:"); for (i = 0; i < NUM_BACKENDS; i++) { char buf[32]; if (kind_list[i]) { if (kind_list[i] == 'E' || kind_list[i] == 'N') { char *m; snprintf(buf, sizeof(buf), " %d[%c: ", i, kind_list[i]); string_append_char(msg, buf); if (pool_extract_error_message(false, CONNECTION(backend, i), MAJOR(backend), true, &m) == 1) { string_append_char(msg, m); string_append_char(msg, "]"); pfree(m); } else { string_append_char(msg, "unknown message]"); } /* * If the error was caused by DEALLOCATE then print * original query */ if (kind_list[i] == 'E') { List *parse_tree_list; Node *node; bool error; parse_tree_list = raw_parser(query_string_buffer, strlen(query_string_buffer), &error, !REPLICATION); if (parse_tree_list != NIL) { node = raw_parser2(parse_tree_list); if (IsA(node, DeallocateStmt)) { POOL_SENT_MESSAGE *sent_msg; DeallocateStmt *d = (DeallocateStmt *) node; sent_msg = pool_get_sent_message('Q', d->name, POOL_SENT_MESSAGE_CREATED); if (!sent_msg) sent_msg = pool_get_sent_message('P', d->name, POOL_SENT_MESSAGE_CREATED); if (sent_msg) { if (sent_msg->query_context->original_query) { string_append_char(msg, "["); string_append_char(msg, sent_msg->query_context->original_query); string_append_char(msg, "]"); } } } } /* free_parser(); */ } } else { snprintf(buf, sizeof(buf), " %d[%c]", i, kind_list[i]); string_append_char(msg, buf); } } } if (pool_config->replication_stop_on_mismatch) { degenerate_backend_set(degenerate_node, degenerate_node_num, REQ_DETAIL_CONFIRMED); retcode = 1; } ereport(FATAL, (return_code(retcode), errmsg("failed to read kind from backend"), errdetail("%s", msg->data), errhint("check data consistency among db nodes"))); } /* * If we are in in streaming replication mode and we doing an extended * query, check the kind we just read. If it's one of 'D' (data row), 'E' * (error), or 'N' (notice), and the head of the pending message queue was * 'execute', the message must not be pulled out so that next Command * Complete message from backend matches the execute message. * * Also if it's 't' (parameter description) and the pulled message was * 'describe', the message must not be pulled out so that the row * description message from backend matches the describe message. */ if (SL_MODE && pool_is_doing_extended_query_message() && msg) { if ((msg->type == POOL_EXECUTE && (*decided_kind == 'D' || *decided_kind == 'E' || *decided_kind == 'N')) || (msg->type == POOL_DESCRIBE && *decided_kind == 't')) { ereport(DEBUG5, (errmsg("read_kind_from_backend: pending message was left"))); } else { POOL_PENDING_MESSAGE *pending_message = NULL; if (msg->type == POOL_CLOSE) { /* Pending message will be pulled out in CloseComplete() */ ereport(DEBUG5, (errmsg("read_kind_from_backend: pending message was not pulled out because message type is CloseComplete"))); } else { ereport(DEBUG5, (errmsg("read_kind_from_backend: pending message was pulled out"))); pending_message = pool_pending_message_pull_out(); pool_check_pending_message_and_reply(msg->type, *decided_kind); } if (pending_message) pool_pending_message_free_pending_message(pending_message); } pool_pending_message_free_pending_message(msg); } return; } /* * parse_copy_data() * Parses CopyDataRow string. * Returns divide key value. If cannot parse data, returns NULL. */ char * parse_copy_data(char *buf, int len, char delimiter, int col_id) { int i, j, field = 0; char *str, *p = NULL; str = palloc(len + 1); /* buf is terminated by '\n'. */ /* skip '\n' in for loop. */ for (i = 0, j = 0; i < len - 1; i++) { if (buf[i] == '\\' && i != len - 2) /* escape */ { if (buf[i + 1] == delimiter) i++; str[j++] = buf[i]; } else if (buf[i] == delimiter) /* delimiter */ { if (field == col_id) { break; } else { field++; j = 0; } } else { str[j++] = buf[i]; } } if (field == col_id) { str[j] = '\0'; p = palloc(j + 1); strcpy(p, str); p[j] = '\0'; ereport(DEBUG1, (errmsg("parsing copy data"), errdetail("divide key value is %s", p))); } pfree(str); return p; } void query_ps_status(char *query, POOL_CONNECTION_POOL * backend) { StartupPacket *sp; char psbuf[1024]; int i = 0; if (*query == '\0') return; sp = MASTER_CONNECTION(backend)->sp; if (sp) i = snprintf(psbuf, sizeof(psbuf) - 1, "%s %s %s ", sp->user, sp->database, remote_ps_data); /* skip spaces */ while (*query && isspace(*query)) query++; for (; i < sizeof(psbuf) - 1; i++) { if (!*query || isspace(*query)) break; psbuf[i] = toupper(*query++); } psbuf[i] = '\0'; set_ps_display(psbuf, false); } /* compare function for bsearch() */ int compare(const void *p1, const void *p2) { int v1, v2; v1 = *(NodeTag *) p1; v2 = *(NodeTag *) p2; return (v1 > v2) ? 1 : ((v1 == v2) ? 0 : -1); } /* return true if needed to start a transaction for the nodetag */ static bool is_internal_transaction_needed(Node *node) { static NodeTag nodemap[] = { T_PlannedStmt, T_InsertStmt, T_DeleteStmt, T_UpdateStmt, T_SelectStmt, T_AlterTableStmt, T_AlterDomainStmt, T_GrantStmt, T_GrantRoleStmt, /* * T_AlterDefaultPrivilegesStmt, Our parser does not support yet */ T_ClosePortalStmt, T_ClusterStmt, T_CopyStmt, T_CreateStmt, /* CREAE 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_ViewStmt, /* CREATE VIEW */ T_LoadStmt, T_CreateDomainStmt, /* * T_CreatedbStmt, CREATE DATABASE/DROP DATABASE cannot execute inside * a transaction block T_DropdbStmt, T_VacuumStmt, T_ExplainStmt, */ T_CreateSeqStmt, T_AlterSeqStmt, T_VariableSetStmt, /* SET */ T_CreateTrigStmt, T_CreatePLangStmt, T_CreateRoleStmt, T_AlterRoleStmt, T_DropRoleStmt, T_LockStmt, T_ConstraintsSetStmt, T_ReindexStmt, T_CreateSchemaStmt, T_AlterDatabaseStmt, T_AlterDatabaseSetStmt, T_AlterRoleSetStmt, T_CreateConversionStmt, T_CreateCastStmt, T_CreateOpClassStmt, T_CreateOpFamilyStmt, T_AlterOpFamilyStmt, T_PrepareStmt, T_ExecuteStmt, T_DeallocateStmt, T_DeclareCursorStmt, /* T_CreateTableSpaceStmt, CREATE/DROP TABLE SPACE cannot execute inside a transaction block 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) { /* * Check CREATE INDEX CONCURRENTLY. If so, do not start transaction */ if (IsA(node, IndexStmt)) { if (((IndexStmt *) node)->concurrent) return false; } /* * Check CLUSTER with no option. If so, do not start transaction */ else if (IsA(node, ClusterStmt)) { if (((ClusterStmt *) node)->relation == NULL) return false; } /* * REINDEX DATABASE or SYSTEM cannot be executed in a transaction * block */ else if (IsA(node, ReindexStmt)) { if (((ReindexStmt *) node)->kind == REINDEX_OBJECT_SYSTEM || ((ReindexStmt *) node)->kind == REINDEX_OBJECT_DATABASE) return false; } return true; } return false; } /* * Start an internal transaction if necessary. */ POOL_STATUS start_internal_transaction(POOL_CONNECTION * frontend, POOL_CONNECTION_POOL * backend, Node *node) { int i; /* * If we are not in a transaction block, start a new transaction */ if (is_internal_transaction_needed(node)) { for (i = 0; i < NUM_BACKENDS; i++) { if (VALID_BACKEND(i) && !INTERNAL_TRANSACTION_STARTED(backend, i) && TSTATE(backend, i) == 'I') { per_node_statement_log(backend, i, "BEGIN"); if (do_command(frontend, CONNECTION(backend, i), "BEGIN", MAJOR(backend), MASTER_CONNECTION(backend)->pid, MASTER_CONNECTION(backend)->key, 0) != POOL_CONTINUE) ereport(ERROR, (errmsg("unable to start the internal transaction"), errdetail("do_command returned DEADLOCK status"))); /* Mark that we started new transaction */ INTERNAL_TRANSACTION_STARTED(backend, i) = true; pool_unset_writing_transaction(); } } } return POOL_CONTINUE; } /* * End internal transaction. */ POOL_STATUS end_internal_transaction(POOL_CONNECTION * frontend, POOL_CONNECTION_POOL * backend) { int i; int len; char tstate; pool_sigset_t oldmask; /* * We must block all signals. If pgpool SIGTERM, SIGINT or SIGQUIT is * delivered, it could cause data inconsistency. */ POOL_SETMASK2(&BlockSig, &oldmask); PG_TRY(); { /* We need to commit from secondary to master. */ for (i = 0; i < NUM_BACKENDS; i++) { if (VALID_BACKEND(i) && !IS_MASTER_NODE_ID(i) && TSTATE(backend, i) != 'I' && INTERNAL_TRANSACTION_STARTED(backend, i)) { if (MAJOR(backend) == PROTO_MAJOR_V3) { /* * Skip rest of Ready for Query packet */ pool_read(CONNECTION(backend, i), &len, sizeof(len)); pool_read(CONNECTION(backend, i), &tstate, sizeof(tstate)); } per_node_statement_log(backend, i, "COMMIT"); PG_TRY(); { if (do_command(frontend, CONNECTION(backend, i), "COMMIT", MAJOR(backend), MASTER_CONNECTION(backend)->pid, MASTER_CONNECTION(backend)->key, 1) != POOL_CONTINUE) { ereport(ERROR, (errmsg("unable to COMMIT the transaction"), errdetail("do_command returned DEADLOCK status"))); } } PG_CATCH(); { INTERNAL_TRANSACTION_STARTED(backend, i) = false; PG_RE_THROW(); } PG_END_TRY(); INTERNAL_TRANSACTION_STARTED(backend, i) = false; } } /* Commit on master */ if (TSTATE(backend, MASTER_NODE_ID) != 'I' && INTERNAL_TRANSACTION_STARTED(backend, MASTER_NODE_ID)) { if (MAJOR(backend) == PROTO_MAJOR_V3) { /* * Skip rest of Ready for Query packet */ pool_read(CONNECTION(backend, MASTER_NODE_ID), &len, sizeof(len)); pool_read(CONNECTION(backend, MASTER_NODE_ID), &tstate, sizeof(tstate)); } per_node_statement_log(backend, MASTER_NODE_ID, "COMMIT"); PG_TRY(); { if (do_command(frontend, MASTER(backend), "COMMIT", MAJOR(backend), MASTER_CONNECTION(backend)->pid, MASTER_CONNECTION(backend)->key, 1) != POOL_CONTINUE) { ereport(ERROR, (errmsg("unable to COMMIT the transaction"), errdetail("do_command returned DEADLOCK status"))); } } PG_CATCH(); { INTERNAL_TRANSACTION_STARTED(backend, MASTER_NODE_ID) = false; PG_RE_THROW(); } PG_END_TRY(); INTERNAL_TRANSACTION_STARTED(backend, MASTER_NODE_ID) = false; } } PG_CATCH(); { POOL_SETMASK(&oldmask); PG_RE_THROW(); } PG_END_TRY(); POOL_SETMASK(&oldmask); return POOL_CONTINUE; } /* * Returns true if error message contains PANIC or FATAL. */ static bool is_panic_or_fatal_error(const char *message, int major) { if (major == PROTO_MAJOR_V3) { for (;;) { char id; id = *message++; if (id == '\0') break; /* V is never localized. Only available 9.6 or later. */ if (id == 'V' && (strcasecmp("PANIC", message) == 0 || strcasecmp("FATAL", message) == 0)) return true; if (id == 'S' && (strcasecmp("PANIC", message) == 0 || strcasecmp("FATAL", message) == 0)) return true; else { while (*message++) ; continue; } } } else { if (strncmp(message, "PANIC", 5) == 0 || strncmp(message, "FATAL", 5) == 0) return true; } return false; } static int detect_postmaster_down_error(POOL_CONNECTION * backend, int major) { int r = extract_message(backend, ADMIN_SHUTDOWN_ERROR_CODE, major, 'E', false); if (r < 0) { ereport(DEBUG1, (errmsg("detecting postmaster down error"))); return r; } #undef DISABLE_POSTMASTER_DOWN #ifdef DISABLE_POSTMASTER_DOWN return 0; #endif if (r == SPECIFIED_ERROR) { ereport(DEBUG1, (errmsg("detecting postmaster down error"), errdetail("receive admin shutdown error from a node"))); return r; } r = extract_message(backend, CRASH_SHUTDOWN_ERROR_CODE, major, 'N', false); if (r < 0) { ereport(LOG, (errmsg("detect_postmaster_down_error: detect_error error"))); return r; } if (r == SPECIFIED_ERROR) { ereport(DEBUG1, (errmsg("detect_postmaster_down_error: receive crash shutdown error from a node."))); } return r; } int detect_active_sql_transaction_error(POOL_CONNECTION * backend, int major) { int r = extract_message(backend, ACTIVE_SQL_TRANSACTION_ERROR_CODE, major, 'E', true); if (r == SPECIFIED_ERROR) { ereport(DEBUG1, (errmsg("detecting active sql transaction error"), errdetail("receive SET TRANSACTION ISOLATION LEVEL must be called before any query error from a node"))); } return r; } int detect_deadlock_error(POOL_CONNECTION * backend, int major) { int r = extract_message(backend, DEADLOCK_ERROR_CODE, major, 'E', true); if (r == SPECIFIED_ERROR) ereport(DEBUG1, (errmsg("detecting deadlock error"), errdetail("received deadlock error message from backend"))); return r; } int detect_serialization_error(POOL_CONNECTION * backend, int major, bool unread) { int r = extract_message(backend, SERIALIZATION_FAIL_ERROR_CODE, major, 'E', unread); if (r == SPECIFIED_ERROR) ereport(DEBUG1, (errmsg("detecting serialization error"), errdetail("received serialization failure message from backend"))); return r; } int detect_query_cancel_error(POOL_CONNECTION * backend, int major) { int r = extract_message(backend, QUERY_CANCEL_ERROR_CODE, major, 'E', true); if (r == SPECIFIED_ERROR) ereport(DEBUG1, (errmsg("detecting query cancel error"), errdetail("received query cancel error message from backend"))); return r; } int detect_idle_in_transaction_sesion_timeout_error(POOL_CONNECTION * backend, int major) { int r = extract_message(backend, IDLE_IN_TRANSACTION_SESSION_TIMEOUT_ERROR_CODE, major, 'E', true); if (r == SPECIFIED_ERROR) ereport(DEBUG1, (errmsg("detecting idle in transaction session timeout error"), errdetail("idle in transaction session timeout error message from backend"))); return r; } /* * extract_message: extract specified error by an error code. * returns 0 in case of success or 1 in case of specified error. * throw an ereport for all other errors. */ static int extract_message(POOL_CONNECTION * backend, char *error_code, int major, char class, bool unread) { int is_error = 0; char kind; int len; int nlen = 0; char *str = NULL; if (pool_read(backend, &kind, sizeof(kind))) return -1; ereport(DEBUG5, (errmsg("extract_message: kind: %c", kind))); /* Specified class? */ if (kind == class) { /* read actual message */ if (major == PROTO_MAJOR_V3) { char *e; if (pool_read(backend, &nlen, sizeof(nlen)) < 0) return -1; len = ntohl(nlen) - 4; str = palloc(len); pool_read(backend, str, len); /* * Check error code which is formatted 'Cxxxxxx' (xxxxxx is the * error code). */ e = str; while (*e) { if (*e == 'C') { /* specified error? */ is_error = (strcmp(e + 1, error_code) == 0) ? SPECIFIED_ERROR : 0; break; } else e = e + strlen(e) + 1; } } else { str = pool_read_string(backend, &len, 0); } } if (unread || !is_error) { /* put back message to read buffer */ if (str) { pool_unread(backend, str, len); } if (nlen != 0) pool_unread(backend, &nlen, sizeof(nlen)); pool_unread(backend, &kind, sizeof(kind)); } if (major == PROTO_MAJOR_V3 && str) pfree(str); return is_error; } /* * The function forwards the NOTICE mesaage received from one backend * to the frontend and also puts the human readable message to the * pgpool log */ static bool pool_process_notice_message_from_one_backend(POOL_CONNECTION * frontend, POOL_CONNECTION_POOL * backend, int backend_idx, char kind) { int major = MAJOR(backend); POOL_CONNECTION *backend_conn = CONNECTION(backend, backend_idx); if (kind != 'N') return false; /* read actual message */ if (major == PROTO_MAJOR_V3) { char *e; int len, datalen; char *buff; char *errorSev = NULL; char *errorMsg = NULL; pool_read(backend_conn, &datalen, sizeof(datalen)); len = ntohl(datalen) - 4; if (len <= 0) return false; buff = palloc(len); pool_read(backend_conn, buff, len); e = buff; while (*e) { char tok = *e; e++; if (*e == 0) break; if (tok == 'M') errorMsg = e; else if (tok == 'S') errorSev = e; else e += strlen(e) + 1; if (errorSev && errorMsg) /* we have all what we need */ break; } /* produce a pgpool log entry */ ereport(LOG, (errmsg("backend [%d]: %s: %s", backend_idx, errorSev, errorMsg))); /* forward it to the frontend */ pool_write(frontend, &kind, 1); pool_write(frontend, &datalen, sizeof(datalen)); pool_write_and_flush(frontend, buff, len); pfree(buff); } else /* Old Protocol */ { int len = 0; char *str = pool_read_string(backend_conn, &len, 0); if (str == NULL || len <= 0) return false; /* produce a pgpool log entry */ ereport(LOG, (errmsg("backend [%d]: %s", backend_idx, str))); /* forward it to the frontend */ pool_write(frontend, &kind, 1); pool_write_and_flush(frontend, str, len); } return true; } /* * pool_extract_error_message: Extract human readable message from * ERROR/NOTICE reponse packet and return it. If "read_kind" is true, * kind will be read in this function. If "read_kind" is false, kind * should have been already read and it should be either 'E' or * 'N'. The returned string is in palloc'd buffer. Callers must pfree * it if it becomes unnecessary. * * If "unread" is true, the packet will be returned to the stream. * * Return values are: * 0: not error or notice message * 1: succeeded to extract error message * -1: error */ int pool_extract_error_message(bool read_kind, POOL_CONNECTION * backend, int major, bool unread, char **message) { char kind; int ret = 1; int readlen = 0, len; StringInfo str_buf; /* unread buffer */ StringInfo str_message_buf; /* message buffer */ MemoryContext oldContext = CurrentMemoryContext; char *str; str_buf = makeStringInfo(); str_message_buf = makeStringInfo(); PG_TRY(); { if (read_kind) { len = sizeof(kind); pool_read(backend, &kind, len); readlen += len; appendStringInfoChar(str_buf, kind); if (kind != 'E' && kind != 'N') { pool_unread(backend, str_buf->data, readlen); pfree(str_message_buf->data); pfree(str_message_buf); pfree(str_buf->data); pfree(str_buf); ereport(ERROR, (errmsg("unable to extract error message"), errdetail("invalid message kind \"%c\"", kind))); } } /* read actual message */ if (major == PROTO_MAJOR_V3) { char *e; pool_read(backend, &len, sizeof(len)); readlen += sizeof(len); appendBinaryStringInfo(str_buf, (const char *) &len, sizeof(len)); len = ntohl(len) - 4; str = palloc(len); pool_read(backend, str, len); readlen += len; appendBinaryStringInfo(str_buf, str, len); /* * Checks error code which is formatted 'Mxxxxxx' (xxxxxx is error * message). */ e = str; while (*e) { if (*e == 'M') { e++; appendStringInfoString(str_message_buf, e); break; } else e = e + strlen(e) + 1; } pfree(str); } else { str = pool_read_string(backend, &len, 0); readlen += len; appendBinaryStringInfo(str_message_buf, str, len); appendBinaryStringInfo(str_buf, str, len); } if (unread) { /* Put the message to read buffer */ pool_unread(backend, str_buf->data, readlen); } *message = str_message_buf->data; pfree(str_message_buf); pfree(str_buf->data); pfree(str_buf); } PG_CATCH(); { MemoryContextSwitchTo(oldContext); FlushErrorState(); ret = -1; } PG_END_TRY(); return ret; } /* * read message kind and rest of the packet then discard it */ POOL_STATUS pool_discard_packet(POOL_CONNECTION_POOL * cp) { int i; char kind; POOL_CONNECTION *backend; for (i = 0; i < NUM_BACKENDS; i++) { if (!VALID_BACKEND(i)) { continue; } backend = CONNECTION(cp, i); pool_read(backend, &kind, sizeof(kind)); ereport(DEBUG2, (errmsg("pool_discard_packet: kind: %c", kind))); } return pool_discard_packet_contents(cp); } /* * read message length and rest of the packet then discard it */ POOL_STATUS pool_discard_packet_contents(POOL_CONNECTION_POOL * cp) { int len, i; char *string; POOL_CONNECTION *backend; for (i = 0; i < NUM_BACKENDS; i++) { if (!VALID_BACKEND(i)) { continue; } backend = CONNECTION(cp, i); if (MAJOR(cp) == PROTO_MAJOR_V3) { pool_read(backend, &len, sizeof(len)); len = ntohl(len) - 4; string = pool_read2(backend, len); if (string == NULL) ereport(ERROR, (errmsg("pool discard packet contents failed"), errdetail("error while reading rest of message"))); } else { string = pool_read_string(backend, &len, 0); if (string == NULL) ereport(ERROR, (errmsg("pool discard packet contents failed"), errdetail("error while reading rest of message"))); } } return POOL_CONTINUE; } /* * Read packet from either frontend or backend and process it. */ static POOL_STATUS read_packets_and_process(POOL_CONNECTION * frontend, POOL_CONNECTION_POOL * backend, int reset_request, int *state, short *num_fields, bool *cont) { fd_set readmask; fd_set writemask; fd_set exceptmask; int fds; struct timeval timeoutdata; struct timeval *timeout; int num_fds, was_error = 0; POOL_STATUS status; int i; /* * frontend idle counters. depends on the following select(2) call's time * out is 1 second. */ int idle_count = 0; /* for other than in recovery */ int idle_count_in_recovery = 0; /* for in recovery */ SELECT_RETRY: FD_ZERO(&readmask); FD_ZERO(&writemask); FD_ZERO(&exceptmask); num_fds = 0; if (!reset_request) { FD_SET(frontend->fd, &readmask); FD_SET(frontend->fd, &exceptmask); num_fds = Max(frontend->fd + 1, num_fds); } /* * If we are in load balance mode and the selected node is down, we need * to re-select load_balancing_node. Note that we cannnot use * VALID_BACKEND macro here. If in_load_balance == 1, VALID_BACKEND macro * may return 0. */ if (pool_config->load_balance_mode && BACKEND_INFO(backend->info->load_balancing_node).backend_status == CON_DOWN) { /* select load balancing node */ POOL_SESSION_CONTEXT *session_context; int node_id; session_context = pool_get_session_context(false); node_id = select_load_balancing_node(); for (i = 0; i < NUM_BACKENDS; i++) { pool_coninfo(session_context->process_context->proc_id, pool_pool_index(), i)->load_balancing_node = node_id; } } for (i = 0; i < NUM_BACKENDS; i++) { if (VALID_BACKEND(i)) { num_fds = Max(CONNECTION(backend, i)->fd + 1, num_fds); FD_SET(CONNECTION(backend, i)->fd, &readmask); FD_SET(CONNECTION(backend, i)->fd, &exceptmask); } } /* * wait for data arriving from frontend and backend */ if (pool_config->client_idle_limit > 0 || pool_config->client_idle_limit_in_recovery > 0 || pool_config->client_idle_limit_in_recovery == -1) { timeoutdata.tv_sec = 1; timeoutdata.tv_usec = 0; timeout = &timeoutdata; } else timeout = NULL; fds = select(num_fds, &readmask, &writemask, &exceptmask, timeout); if (fds == -1) { if (errno == EINTR) goto SELECT_RETRY; ereport(FATAL, (errmsg("unable to read data"), errdetail("select() system call failed with reason \"%s\"", strerror(errno)))); } /* select timeout */ if (fds == 0) { if (*InRecovery == RECOVERY_INIT && pool_config->client_idle_limit > 0) { idle_count++; if (idle_count > pool_config->client_idle_limit) { ereport(FRONTEND_ERROR, (pool_error_code("57000"), errmsg("unable to read data"), errdetail("child connection forced to terminate due to client_idle_limit:%d is reached", pool_config->client_idle_limit))); } } else if (*InRecovery > RECOVERY_INIT && pool_config->client_idle_limit_in_recovery > 0) { idle_count_in_recovery++; if (idle_count_in_recovery > pool_config->client_idle_limit_in_recovery) { ereport(FRONTEND_ERROR, (pool_error_code("57000"), errmsg("unable to read data"), errdetail("child connection forced to terminate due to client_idle_limit_in_recovery:%d is reached", pool_config->client_idle_limit_in_recovery))); } } else if (*InRecovery > RECOVERY_INIT && pool_config->client_idle_limit_in_recovery == -1) { /* * If we are in recovery and client_idle_limit_in_recovery is -1, * then exit immediately. */ ereport(FRONTEND_ERROR, (pool_error_code("57000"), errmsg("connection terminated due to online recovery"), errdetail("child connection forced to terminate due to client_idle_limitis:-1"))); } goto SELECT_RETRY; } for (i = 0; i < NUM_BACKENDS; i++) { if (VALID_BACKEND(i)) { /* * make sure that connection slot exists */ if (CONNECTION_SLOT(backend, i) == 0) { ereport(LOG, (errmsg("error occured while reading and processing packets"), errdetail("FATAL ERROR: VALID_BACKEND returns non 0 but connection slot is empty. backend id:%d RAW_MODE:%d LOAD_BALANCE_STATUS:%d status:%d", i, RAW_MODE, LOAD_BALANCE_STATUS(i), BACKEND_INFO(i).backend_status))); was_error = 1; break; } if (FD_ISSET(CONNECTION(backend, i)->fd, &readmask)) { int r; /* * connection was terminated due to confilct with recovery */ r = detect_serialization_error(CONNECTION(backend, i), MAJOR(backend), false); if (r == SPECIFIED_ERROR) { ereport(FATAL, (pool_error_code(SERIALIZATION_FAIL_ERROR_CODE), errmsg("connection was terminated due to conflict with recovery"), errdetail("User was holding a relation lock for too long."), errhint("In a moment you should be able to reconnect to the database and repeat your command."))); } /* * connection was terminated due to idle_in_transaction_sesion_timeout expired */ r = detect_idle_in_transaction_sesion_timeout_error(CONNECTION(backend, i), MAJOR(backend)); if (r == SPECIFIED_ERROR) { ereport(FATAL, (pool_error_code(IDLE_IN_TRANSACTION_SESSION_TIMEOUT_ERROR_CODE), errmsg("terminating connection due to idle-in-transaction timeout"))); } /* * admin shutdown postmaster or postmaster goes down */ r = detect_postmaster_down_error(CONNECTION(backend, i), MAJOR(backend)); if (r == SPECIFIED_ERROR) { ereport(LOG, (errmsg("reading and processing packets"), errdetail("postmaster on DB node %d was shutdown by administrative command", i))); /* * If shutdown node is not primary nor load balance node, * we do not need to trigger failover. */ if (SL_MODE && (i == PRIMARY_NODE_ID || i == backend->info->load_balancing_node)) { /* detach backend node. */ was_error = 1; if (!VALID_BACKEND(i)) break; /* * check if the pg_terminate_backend was issued on * this connection */ if (CONNECTION(backend, i)->con_info->swallow_termination == 1) { ereport(FATAL, (errmsg("connection to postmaster on DB node %d was lost due to pg_terminate_backend", i), errdetail("pg_terminate_backend was called on the backend"))); } else { notice_backend_error(i, REQ_DETAIL_SWITCHOVER); sleep(5); } break; } /* * In native replication mode, we need to trigger failover * to avoid data inconsistency. */ else if (REPLICATION) { was_error = 1; if (!VALID_BACKEND(i)) break; if (CONNECTION(backend, i)->con_info->swallow_termination == 1) { ereport(FATAL, (errmsg("connection to postmaster on DB node %d was lost due to pg_terminate_backend", i), errdetail("pg_terminate_backend was called on the backend"))); } else { notice_backend_error(i, REQ_DETAIL_SWITCHOVER); sleep(5); } } /* * Just set local status to down. */ else { *(my_backend_status[i]) = CON_DOWN; } } else if (r < 0) { /* * This could happen after detecting backend errors and * before actually detaching the backend. In this case * reading from backend socket will return EOF and it's * better to close this session. So returns POOL_END. */ ereport(LOG, (errmsg("unable to read and process data"), errdetail("detect_postmaster_down_error returns error on backend %d. Going to close this session.", i))); return POOL_END; } } } } if (was_error) { *cont = false; return POOL_CONTINUE; } if (!reset_request) { if (FD_ISSET(frontend->fd, &exceptmask)) ereport(ERROR, (errmsg("unable to read from frontend socket"), errdetail("exception occured on frontend socket"))); else if (FD_ISSET(frontend->fd, &readmask)) { status = ProcessFrontendResponse(frontend, backend); if (status != POOL_CONTINUE) return status; } } if (FD_ISSET(MASTER(backend)->fd, &exceptmask)) ereport(FATAL, (errmsg("unable to read from backend socket"), errdetail("exception occured on backend socket"))); else if (FD_ISSET(MASTER(backend)->fd, &readmask)) { status = ProcessBackendResponse(frontend, backend, state, num_fields); if (status != POOL_CONTINUE) return status; } return POOL_CONTINUE; } /* * Debugging aid for VALID_BACKEND macro. */ void pool_dump_valid_backend(int backend_id) { ereport(LOG, (errmsg("RAW_MODE:%d REAL_MASTER_NODE_ID:%d pool_is_node_to_be_sent_in_current_query:%d my_backend_status:%d", RAW_MODE, REAL_MASTER_NODE_ID, pool_is_node_to_be_sent_in_current_query(backend_id), *my_backend_status[backend_id]))); } /* * Read pending data from backend and push them into pending statck if any. * Should be used for streaming replication mode and extended query. * Returns true if data was actually pushed. */ bool pool_push_pending_data(POOL_CONNECTION * backend) { POOL_SESSION_CONTEXT *session_context; int len; bool data_pushed = false; bool pending_data_existed = false; static char random_statement[] = "pgpool_non_existent"; int num_pending_messages; int num_pushed_messages; if (!pool_get_session_context(true) || !pool_is_doing_extended_query_message()) return false; /* * If data is ready in the backend buffer, we are sure that at least one * pending message exists. */ if (pool_ssl_pending(backend) || !pool_read_buffer_is_empty(backend)) { pending_data_existed = true; } /* * In streaming replication mode, send a Close message for none existing * prepared statement and flush message before going any further to * retrieve and save any pending response packet from backend. This * ensures that at least "close complete" message is retured from backend. * * The saved packets will be poped up before returning to caller. This * preserves the user's expectation of packet sequence. */ pool_write(backend, "C", 1); len = htonl(sizeof(len) + 1 + sizeof(random_statement)); pool_write(backend, &len, sizeof(len)); pool_write(backend, "S", 1); pool_write(backend, random_statement, sizeof(random_statement)); pool_write(backend, "H", 1); len = htonl(sizeof(len)); pool_write_and_flush(backend, &len, sizeof(len)); ereport(DEBUG1, (errmsg("pool_push_pending_data: send flush message to %d", backend->db_node_id))); /* * If we have not send the flush message to load balance node yet, send a * flush message to the load balance node. Otherwise only the non load * balance node (usually the master node) produces response if we do not * send sync message to it yet. */ session_context = pool_get_session_context(false); if (backend->db_node_id != session_context->load_balance_node_id) { POOL_CONNECTION *con; con = session_context->backend->slots[session_context->load_balance_node_id]->con; pool_write(con, "H", 1); len = htonl(sizeof(len)); pool_write_and_flush(con, &len, sizeof(len)); ereport(DEBUG1, (errmsg("pool_push_pending_data: send flush message to %d", con->db_node_id))); } num_pending_messages = pool_pending_message_get_message_num_by_backend_id(backend->db_node_id); num_pushed_messages = 0; for (;;) { int len; int len_save; char *buf; char kind; pool_set_timeout(-1); pool_read(backend, &kind, 1); ereport(DEBUG1, (errmsg("pool_push_pending_data: kind: %c", kind))); pool_read(backend, &len, sizeof(len)); len_save = len; len = ntohl(len); buf = NULL; if ((len - sizeof(len)) > 0) { len -= sizeof(len); buf = palloc(len); pool_read(backend, buf, len); } if (!pool_ssl_pending(backend) && pool_read_buffer_is_empty(backend) && kind != 'E') { if (kind != '3' || pending_data_existed || num_pushed_messages < num_pending_messages) pool_set_timeout(-1); else pool_set_timeout(0); if (pool_check_fd(backend) != 0) { ereport(DEBUG1, (errmsg("pool_push_pending_data: no pending data"))); pool_set_timeout(-1); if (buf) pfree(buf); break; } pending_data_existed = false; } pool_push(backend, &kind, 1); pool_push(backend, &len_save, sizeof(len_save)); len = ntohl(len_save); len -= sizeof(len); if (len > 0 && buf) { pool_push(backend, buf, len); pfree(buf); } data_pushed = true; if (kind == 'E') { /* Found error response */ ereport(DEBUG1, (errmsg("pool_push_pending_data: ERROR response found"))); pool_set_ignore_till_sync(); break; } num_pushed_messages++; } return data_pushed; } pgpool-II-4.1.4/src/protocol/pool_connection_pool.c0000664000175000017500000006133713730350127017272 00000000000000/* -*-pgsql-c-*- */ /* * $Header$ * * pgpool: a language independent connection pool server for PostgreSQL * written by Tatsuo Ishii * * Copyright (c) 2003-2019 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_connection_pool.c: connection pool stuff */ #include "config.h" #include #include #include #include #include #ifdef HAVE_SYS_SELECT_H #include #endif #ifdef HAVE_NETINET_TCP_H #include #endif #include #include #include #include #include #include #include #include "pool.h" #include "utils/pool_stream.h" #include "utils/palloc.h" #include "pool_config.h" #include "utils/elog.h" #include "utils/memutils.h" #include "context/pool_process_context.h" static int pool_index; /* Active pool index */ POOL_CONNECTION_POOL *pool_connection_pool; /* connection pool */ volatile sig_atomic_t backend_timer_expired = 0; /* flag for connection * closed timer is expired */ volatile sig_atomic_t health_check_timer_expired; /* non 0 if health check * timer expired */ static POOL_CONNECTION_POOL_SLOT * create_cp(POOL_CONNECTION_POOL_SLOT * cp, int slot); static POOL_CONNECTION_POOL * new_connection(POOL_CONNECTION_POOL * p); static int check_socket_status(int fd); static bool connect_with_timeout(int fd, struct addrinfo *walk, char *host, int port, bool retry); /* * initialize connection pools. this should be called once at the startup. */ int pool_init_cp(void) { int i; MemoryContext oldContext = MemoryContextSwitchTo(TopMemoryContext); pool_connection_pool = (POOL_CONNECTION_POOL *) palloc(sizeof(POOL_CONNECTION_POOL) * pool_config->max_pool); memset(pool_connection_pool, 0, sizeof(POOL_CONNECTION_POOL) * pool_config->max_pool); for (i = 0; i < pool_config->max_pool; i++) { pool_connection_pool[i].info = pool_coninfo(pool_get_process_context()->proc_id, i, 0); memset(pool_connection_pool[i].info, 0, sizeof(ConnectionInfo) * MAX_NUM_BACKENDS); } MemoryContextSwitchTo(oldContext); return 0; } /* * find connection by user and database */ POOL_CONNECTION_POOL * pool_get_cp(char *user, char *database, int protoMajor, int check_socket) { pool_sigset_t oldmask; int i, freed = 0; ConnectionInfo *info; POOL_CONNECTION_POOL *connection_pool = pool_connection_pool; if (connection_pool == NULL) { /* if no connection pool exists we have no reason to live */ ereport(ERROR, (return_code(2), errmsg("unable to get connection"), errdetail("connection pool is not initialized"))); } POOL_SETMASK2(&BlockSig, &oldmask); for (i = 0; i < pool_config->max_pool; i++) { if (MASTER_CONNECTION(connection_pool) && MASTER_CONNECTION(connection_pool)->sp && MASTER_CONNECTION(connection_pool)->sp->major == protoMajor && MASTER_CONNECTION(connection_pool)->sp->user != NULL && strcmp(MASTER_CONNECTION(connection_pool)->sp->user, user) == 0 && strcmp(MASTER_CONNECTION(connection_pool)->sp->database, database) == 0) { int sock_broken = 0; int j; /* mark this connection is under use */ MASTER_CONNECTION(connection_pool)->closetime = 0; for (j = 0; j < NUM_BACKENDS; j++) { connection_pool->info[j].counter++; } POOL_SETMASK(&oldmask); if (check_socket) { for (j = 0; j < NUM_BACKENDS; j++) { if (!VALID_BACKEND(j)) continue; if (CONNECTION_SLOT(connection_pool, j)) { sock_broken = check_socket_status(CONNECTION(connection_pool, j)->fd); if (sock_broken < 0) break; } else { sock_broken = -1; break; } } if (sock_broken < 0) { ereport(LOG, (errmsg("connection closed."), errdetail("retry to create new connection pool"))); for (j = 0; j < NUM_BACKENDS; j++) { if (!VALID_BACKEND(j) || (CONNECTION_SLOT(connection_pool, j) == NULL)) continue; if (!freed) { pool_free_startup_packet(CONNECTION_SLOT(connection_pool, j)->sp); CONNECTION_SLOT(connection_pool, j)->sp = NULL; freed = 1; } pool_close(CONNECTION(connection_pool, j)); pfree(CONNECTION_SLOT(connection_pool, j)); } info = connection_pool->info; memset(connection_pool, 0, sizeof(POOL_CONNECTION_POOL)); connection_pool->info = info; info->swallow_termination = 0; memset(connection_pool->info, 0, sizeof(ConnectionInfo) * MAX_NUM_BACKENDS); POOL_SETMASK(&oldmask); return NULL; } } POOL_SETMASK(&oldmask); pool_index = i; return connection_pool; } connection_pool++; } POOL_SETMASK(&oldmask); return NULL; } /* * disconnect and release a connection to the database */ void pool_discard_cp(char *user, char *database, int protoMajor) { POOL_CONNECTION_POOL *p = pool_get_cp(user, database, protoMajor, 0); ConnectionInfo *info; int i, freed = 0; if (p == NULL) { ereport(LOG, (errmsg("cannot get connection pool for user: \"%s\" database: \"%s\", while discarding connection pool", user, database))); return; } for (i = 0; i < NUM_BACKENDS; i++) { if (!VALID_BACKEND(i)) continue; if (!freed) { pool_free_startup_packet(CONNECTION_SLOT(p, i)->sp); freed = 1; } CONNECTION_SLOT(p, i)->sp = NULL; pool_close(CONNECTION(p, i)); pfree(CONNECTION_SLOT(p, i)); } info = p->info; memset(p, 0, sizeof(POOL_CONNECTION_POOL)); p->info = info; memset(p->info, 0, sizeof(ConnectionInfo) * MAX_NUM_BACKENDS); } /* * create a connection pool by user and database */ POOL_CONNECTION_POOL * pool_create_cp(void) { int i, freed = 0; time_t closetime; POOL_CONNECTION_POOL *oldestp; POOL_CONNECTION_POOL *ret; ConnectionInfo *info; POOL_CONNECTION_POOL *p = pool_connection_pool; /* if no connection pool exists we have no reason to live */ if (p == NULL) ereport(ERROR, (return_code(2), errmsg("unable to create connection"), errdetail("connection pool is not initialized"))); for (i = 0; i < pool_config->max_pool; i++) { if (MASTER_CONNECTION(p) == NULL) { ret = new_connection(p); if (ret) pool_index = i; return ret; } p++; } ereport(DEBUG1, (errmsg("creating connection pool"), errdetail("no empty connection slot was found"))); /* * no empty connection slot was found. look for the oldest connection and * discard it. */ oldestp = p = pool_connection_pool; closetime = MASTER_CONNECTION(p)->closetime; pool_index = 0; for (i = 0; i < pool_config->max_pool; i++) { ereport(DEBUG1, (errmsg("creating connection pool"), errdetail("user: %s database: %s closetime: %ld", MASTER_CONNECTION(p)->sp->user, MASTER_CONNECTION(p)->sp->database, MASTER_CONNECTION(p)->closetime))); if (MASTER_CONNECTION(p)->closetime < closetime) { closetime = MASTER_CONNECTION(p)->closetime; oldestp = p; pool_index = i; } p++; } p = oldestp; pool_send_frontend_exits(p); ereport(DEBUG1, (errmsg("creating connection pool"), errdetail("discarding old %zd th connection. user: %s database: %s", oldestp - pool_connection_pool, MASTER_CONNECTION(p)->sp->user, MASTER_CONNECTION(p)->sp->database))); for (i = 0; i < NUM_BACKENDS; i++) { if (!VALID_BACKEND(i)) continue; if (!freed) { pool_free_startup_packet(CONNECTION_SLOT(p, i)->sp); CONNECTION_SLOT(p, i)->sp = NULL; freed = 1; } pool_close(CONNECTION(p, i)); pfree(CONNECTION_SLOT(p, i)); } info = p->info; memset(p, 0, sizeof(POOL_CONNECTION_POOL)); p->info = info; memset(p->info, 0, sizeof(ConnectionInfo) * MAX_NUM_BACKENDS); ret = new_connection(p); return ret; } /* * set backend connection close timer */ void pool_connection_pool_timer(POOL_CONNECTION_POOL * backend) { POOL_CONNECTION_POOL *p = pool_connection_pool; int i; ereport(DEBUG1, (errmsg("setting backend connection close timer"), errdetail("close time %ld", time(NULL)))); /* Set connection close time */ for (i = 0; i < NUM_BACKENDS; i++) { if (CONNECTION_SLOT(backend, i)) CONNECTION_SLOT(backend, i)->closetime = time(NULL); } if (pool_config->connection_life_time == 0) return; /* look for any other timeout */ for (i = 0; i < pool_config->max_pool; i++, p++) { if (!MASTER_CONNECTION(p)) continue; if (!MASTER_CONNECTION(p)->sp) continue; if (MASTER_CONNECTION(p)->sp->user == NULL) continue; if (p != backend && MASTER_CONNECTION(p)->closetime) return; } /* no other timer found. set my timer */ ereport(DEBUG1, (errmsg("setting backend connection close timer"), errdetail("setting alarm after %d seconds", pool_config->connection_life_time))); pool_alarm(pool_backend_timer_handler, pool_config->connection_life_time); } /* * backend connection close timer handler */ RETSIGTYPE pool_backend_timer_handler(int sig) { backend_timer_expired = 1; } void pool_backend_timer(void) { #define TMINTMAX 0x7fffffff POOL_CONNECTION_POOL *p = pool_connection_pool; int i, j; time_t now; time_t nearest = TMINTMAX; ConnectionInfo *info; POOL_SETMASK(&BlockSig); now = time(NULL); ereport(DEBUG1, (errmsg("backend timer handler called at %ld", now))); for (i = 0; i < pool_config->max_pool; i++, p++) { if (!MASTER_CONNECTION(p)) continue; if (!MASTER_CONNECTION(p)->sp) continue; if (MASTER_CONNECTION(p)->sp->user == NULL) continue; /* timer expire? */ if (MASTER_CONNECTION(p)->closetime) { int freed = 0; ereport(DEBUG1, (errmsg("backend timer handler called"), errdetail("expire time: %ld", MASTER_CONNECTION(p)->closetime + pool_config->connection_life_time))); if (now >= (MASTER_CONNECTION(p)->closetime + pool_config->connection_life_time)) { /* discard expired connection */ ereport(DEBUG1, (errmsg("backend timer handler called"), errdetail("expired user: \"%s\" database: \"%s\"", MASTER_CONNECTION(p)->sp->user, MASTER_CONNECTION(p)->sp->database))); pool_send_frontend_exits(p); for (j = 0; j < NUM_BACKENDS; j++) { if (!VALID_BACKEND(j)) continue; if (!freed) { pool_free_startup_packet(CONNECTION_SLOT(p, j)->sp); freed = 1; } CONNECTION_SLOT(p, j)->sp = NULL; pool_close(CONNECTION(p, j)); pfree(CONNECTION_SLOT(p, j)); } info = p->info; memset(p, 0, sizeof(POOL_CONNECTION_POOL)); p->info = info; memset(p->info, 0, sizeof(ConnectionInfo) * MAX_NUM_BACKENDS); } else { /* look for nearest timer */ if (MASTER_CONNECTION(p)->closetime < nearest) nearest = MASTER_CONNECTION(p)->closetime; } } } /* any remaining timer */ if (nearest != TMINTMAX) { nearest = pool_config->connection_life_time - (now - nearest); if (nearest <= 0) nearest = 1; pool_alarm(pool_backend_timer_handler, nearest); } POOL_SETMASK(&UnBlockSig); } /* * connect to postmaster through INET domain socket */ int connect_inet_domain_socket(int slot, bool retry) { char *host; int port; host = pool_config->backend_desc->backend_info[slot].backend_hostname; port = pool_config->backend_desc->backend_info[slot].backend_port; return connect_inet_domain_socket_by_port(host, port, retry); } /* * connect to postmaster through UNIX domain socket */ int connect_unix_domain_socket(int slot, bool retry) { int port; char *socket_dir; port = pool_config->backend_desc->backend_info[slot].backend_port; socket_dir = pool_config->backend_desc->backend_info[slot].backend_hostname; return connect_unix_domain_socket_by_port(port, socket_dir, retry); } /* * Connect to PostgreSQL server by using UNIX domain socket. * If retry is true, retry to call connect() upon receiving EINTR error. */ int connect_unix_domain_socket_by_port(int port, char *socket_dir, bool retry) { struct sockaddr_un addr; int fd; int len; fd = socket(AF_UNIX, SOCK_STREAM, 0); if (fd == -1) { ereport(LOG, (errmsg("failed to connect to PostgreSQL server by unix domain socket"), errdetail("create socket failed with error \"%s\"", strerror(errno)))); return -1; } memset((char *) &addr, 0, sizeof(addr)); addr.sun_family = AF_UNIX; snprintf(addr.sun_path, sizeof(addr.sun_path), "%s/.s.PGSQL.%d", socket_dir, port); len = sizeof(struct sockaddr_un); for (;;) { if (exit_request) /* exit request already sent */ { ereport(LOG, (errmsg("failed to connect to PostgreSQL server by unix domain socket"), errdetail("exit request has been sent"))); close(fd); return -1; } if (connect(fd, (struct sockaddr *) &addr, len) < 0) { if ((errno == EINTR && retry) || errno == EAGAIN) continue; close(fd); ereport(LOG, (errmsg("failed to connect to PostgreSQL server by unix domain socket"), errdetail("connect to \"%s\" failed with error \"%s\"", addr.sun_path, strerror(errno)))); return -1; } break; } return fd; } /* * Connet to backend using pool_config->connect_timeout. * * fd: the socket * walk: backend address to connect * host and port: backend hostname and port number. Only for error message * purpose. * retry: true if need to retry */ static bool connect_with_timeout(int fd, struct addrinfo *walk, char *host, int port, bool retry) { struct timeval *tm; struct timeval timeout; fd_set rset, wset; int sts; int error; socklen_t socklen; pool_set_nonblock(fd); for (;;) { if (exit_request) /* exit request already sent */ { ereport(LOG, (errmsg("failed to connect to PostgreSQL server on \"%s:%d\" using INET socket", host, port), errdetail("exit request has been sent"))); close(fd); return false; } if (health_check_timer_expired) /* has health check timer expired */ { ereport(LOG, (errmsg("failed to connect to PostgreSQL server on \"%s:%d\" using INET socket", host, port), errdetail("health check timer expired"))); close(fd); return false; } if (connect(fd, walk->ai_addr, walk->ai_addrlen) < 0) { if (errno == EISCONN) { /* Socket is already connected */ break; } if ((errno == EINTR && retry) || errno == EAGAIN) continue; /* * If error was "connect(2) is in progress", then wait for * completion. Otherwise error out. */ if (errno != EINPROGRESS && errno != EALREADY) { ereport(LOG, (errmsg("failed to connect to PostgreSQL server on \"%s:%d\" with error \"%s\"", host, port, strerror(errno)))); return false; } if (pool_config->connect_timeout == 0) tm = NULL; else { tm = &timeout; timeout.tv_sec = pool_config->connect_timeout / 1000; if (timeout.tv_sec == 0) { timeout.tv_usec = pool_config->connect_timeout * 1000; } else { timeout.tv_usec = (pool_config->connect_timeout - timeout.tv_sec * 1000) * 1000; } } FD_ZERO(&rset); FD_SET(fd, &rset); FD_ZERO(&wset); FD_SET(fd, &wset); sts = select(fd + 1, &rset, &wset, NULL, tm); if (sts == 0) { /* select timeout */ if (retry) { ereport(LOG, (errmsg("trying connecting to PostgreSQL server on \"%s:%d\" by INET socket", host, port), errdetail("timed out. retrying..."))); continue; } else { ereport(LOG, (errmsg("failed to connect to PostgreSQL server on \"%s:%d\", timed out", host, port))); return false; } } else if (sts > 0) { /* * If read data or write data was set, either connect * succeeded or error. We need to figure it out. This is the * hardest part in using non blocking connect(2). See W. * Richar Stevens's "UNIX Network Programming: Volume 1, * Second Edition" section 15.4. */ if (FD_ISSET(fd, &rset) || FD_ISSET(fd, &wset)) { error = 0; socklen = sizeof(error); if (getsockopt(fd, SOL_SOCKET, SO_ERROR, &error, &socklen) < 0) { /* Solaris returns error in this case */ ereport(LOG, (errmsg("failed to connect to PostgreSQL server on \"%s:%d\", getsockopt() failed with error \"%s\"", host, port, strerror(errno)))); return false; } /* Non Solaris case */ if (error != 0) { ereport(LOG, (errmsg("failed to connect to PostgreSQL server on \"%s:%d\", getsockopt() detected error \"%s\"", host, port, strerror(error)))); return false; } } else { ereport(LOG, (errmsg("failed to connect to PostgreSQL server on \"%s:%d\", both read data and write data was not set", host, port))); return false; } } else /* select returns error */ { if ((errno == EINTR && retry) || errno == EAGAIN) { ereport(LOG, (errmsg("trying to connect to PostgreSQL server on \"%s:%d\" using INET socket", host, port), errdetail("select() interrupted. retrying..."))); continue; } /* * select(2) was interrupted by certain signal and we guess it * was not SIGALRM because health_check_timer_expired was not * set (if the variable was set, we can assume that SIGALRM * handler was called). Surely this is not a health check time * out. We can assume that this is a transient case. So we * will retry again... */ if (health_check_timer_expired == 0 && errno == EINTR) { ereport(LOG, (errmsg("connect_inet_domain_socket: select() interrupted by certain signal. retrying..."))); continue; } else if (health_check_timer_expired && errno == EINTR) { ereport(LOG, (errmsg("failed to connect to PostgreSQL server on \"%s:%d\" using INET socket", host, port), errdetail("health check timer expired"))); } else { ereport(LOG, (errmsg("failed to connect to PostgreSQL server on \"%s:%d\" using INET socket", host, port), errdetail("select() system call failed with an error \"%s\"", strerror(errno)))); } close(fd); return false; } } break; } pool_unset_nonblock(fd); return true; } /* * Connect to PostgreSQL server by using INET domain socket. * If retry is true, retry to call connect() upon receiving EINTR error. */ int connect_inet_domain_socket_by_port(char *host, int port, bool retry) { int fd = -1; int on = 1; char *portstr; int ret; struct addrinfo *res; struct addrinfo *walk; struct addrinfo hints; /* * getaddrinfo() requires a string because it also accepts service names, * such as "http". */ if (asprintf(&portstr, "%d", port) == -1) { ereport(WARNING, (errmsg("failed to connect to PostgreSQL server, asprintf() failed with error \"%s\"", strerror(errno)))); return -1; } memset(&hints, 0, sizeof(struct addrinfo)); hints.ai_family = PF_UNSPEC; hints.ai_socktype = SOCK_STREAM; if ((ret = getaddrinfo(host, portstr, &hints, &res)) != 0) { ereport(WARNING, (errmsg("failed to connect to PostgreSQL server, getaddrinfo() failed with error \"%s\"", gai_strerror(ret)))); free(portstr); return -1; } free(portstr); for (walk = res; walk != NULL; walk = walk->ai_next) { fd = socket(walk->ai_family, walk->ai_socktype, walk->ai_protocol); if (fd < 0) { ereport(WARNING, (errmsg("failed to connect to PostgreSQL server, socket() failed with error \"%s\"", strerror(errno)))); continue; } /* set nodelay */ if (setsockopt(fd, IPPROTO_TCP, TCP_NODELAY, (char *) &on, sizeof(on)) < 0) { ereport(WARNING, (errmsg("failed to connect to PostgreSQL server, setsockopt() failed with error \"%s\"", strerror(errno)))); close(fd); freeaddrinfo(res); return -1; } if (!connect_with_timeout(fd, walk, host, port, retry)) { close(fd); continue; } freeaddrinfo(res); return fd; } freeaddrinfo(res); return -1; } /* * create connection pool */ static POOL_CONNECTION_POOL_SLOT * create_cp(POOL_CONNECTION_POOL_SLOT * cp, int slot) { BackendInfo *b = &pool_config->backend_desc->backend_info[slot]; int fd; if (*b->backend_hostname == '/') { fd = connect_unix_domain_socket(slot, TRUE); } else { fd = connect_inet_domain_socket(slot, TRUE); } if (fd < 0) return NULL; cp->sp = NULL; cp->con = pool_open(fd, true); cp->closetime = 0; return cp; } /* * Create actual connections to backends. * New connection resides in TopMemoryContext. */ static POOL_CONNECTION_POOL * new_connection(POOL_CONNECTION_POOL * p) { POOL_CONNECTION_POOL_SLOT *s; int active_backend_count = 0; int i; bool status_changed = false; MemoryContext oldContext = MemoryContextSwitchTo(TopMemoryContext); for (i = 0; i < NUM_BACKENDS; i++) { ereport(DEBUG1, (errmsg("creating new connection to backend"), errdetail("connecting %d backend", i))); if (!VALID_BACKEND(i)) { ereport(DEBUG1, (errmsg("creating new connection to backend"), errdetail("skipping backend slot %d because backend_status = %d", i, BACKEND_INFO(i).backend_status))); continue; } /* * Make sure that the global backend status in the shared memory * agrees the local status checked by VALID_BACKEND. It is possible * that the local status is up, while the global status has been * changed to down by failover. */ if (BACKEND_INFO(i).backend_status != CON_UP && BACKEND_INFO(i).backend_status != CON_CONNECT_WAIT) { ereport(DEBUG1, (errmsg("creating new connection to backend"), errdetail("skipping backend slot %d because global backend_status = %d", i, BACKEND_INFO(i).backend_status))); /* sync local status with global status */ *(my_backend_status[i]) = BACKEND_INFO(i).backend_status; continue; } s = palloc(sizeof(POOL_CONNECTION_POOL_SLOT)); if (create_cp(s, i) == NULL) { pfree(s); /* * If failover_on_backend_error is true, do failover. Otherwise, * just exit this session or skip next health node. */ if (pool_config->failover_on_backend_error) { notice_backend_error(i, REQ_DETAIL_SWITCHOVER); ereport(FATAL, (errmsg("failed to create a backend connection"), errdetail("executing failover on backend"))); } else { /* * If we are in streaming replication mode and the node is a * standby node, then we skip this node to avoid fail over. */ if (SL_MODE && !IS_PRIMARY_NODE_ID(i)) { ereport(LOG, (errmsg("failed to create a backend %d connection", i), errdetail("skip this backend because because failover_on_backend_error is off and we are in streaming replication mode and node is standby node"))); /* set down status to local status area */ *(my_backend_status[i]) = CON_DOWN; /* if master_node_id is not updated, then update it */ if (Req_info->master_node_id == i) { int old_master = Req_info->master_node_id; Req_info->master_node_id = get_next_master_node(); ereport(LOG, (errmsg("master node %d is down. Update master node to %d", old_master, Req_info->master_node_id))); } /* * make sure that we need to restart the process after * finishing this session */ pool_get_my_process_info()->need_to_restart = 1; continue; } else { ereport(FATAL, (errmsg("failed to create a backend %d connection", i), errdetail("not executing failover because failover_on_backend_error is off"))); } } child_exit(POOL_EXIT_AND_RESTART); } else { p->info[i].create_time = time(NULL); p->slots[i] = s; pool_init_params(&s->con->params); if (BACKEND_INFO(i).backend_status != CON_UP) { BACKEND_INFO(i).backend_status = CON_UP; pool_set_backend_status_changed_time(i); status_changed = true; } active_backend_count++; } } if (status_changed) (void) write_status_file(); MemoryContextSwitchTo(oldContext); if (active_backend_count > 0) { return p; } return NULL; } /* check_socket_status() * RETURN: 0 => OK * -1 => broken socket. */ static int check_socket_status(int fd) { fd_set rfds; int result; struct timeval t; for (;;) { FD_ZERO(&rfds); FD_SET(fd, &rfds); t.tv_sec = t.tv_usec = 0; result = select(fd + 1, &rfds, NULL, NULL, &t); if (result < 0 && errno == EINTR) { continue; } else { return (result == 0 ? 0 : -1); } } return -1; } /* * Return current used index (i.e. frontend connected) */ int pool_pool_index(void) { return pool_index; } pgpool-II-4.1.4/src/protocol/pool_proto_modules.c0000664000175000017500000032410113730350127016764 00000000000000/* -*-pgsql-c-*- */ /* * pgpool: a language independent connection pool server for PostgreSQL * written by Tatsuo Ishii * * Copyright (c) 2003-2019 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_proto_modules.c: modules corresponding to message protocols. * used by pool_process_query() *--------------------------------------------------------------------- */ #include "config.h" #include #ifdef HAVE_SYS_TYPES_H #include #endif #ifdef HAVE_SYS_TIME_H #include #endif #ifdef HAVE_SYS_SELECT_H #include #endif #include #include #include #include #include #include "pool.h" #include "rewrite/pool_timestamp.h" #include "rewrite/pool_lobj.h" #include "protocol/pool_proto_modules.h" #include "pool_config.h" #include "parser/pool_string.h" #include "context/pool_session_context.h" #include "context/pool_query_context.h" #include "utils/elog.h" #include "utils/pool_select_walker.h" #include "utils/pool_relcache.h" #include "utils/pool_stream.h" #include "query_cache/pool_memqcache.h" #include "utils/pool_signal.h" #include "utils/palloc.h" #include "utils/memutils.h" #include "pool_config_variables.h" char *copy_table = NULL; /* copy table name */ char *copy_schema = NULL; /* copy table name */ char copy_delimiter; /* copy delimiter char */ char *copy_null = NULL; /* copy null string */ /* * Non 0 if allow to close internal transaction. This variable was * introduced on 2008/4/3 not to close an internal transaction when * Sync message is received after receiving Parse message. This hack * is for PHP-PDO. */ static int allow_close_transaction = 1; int is_select_pgcatalog = 0; int is_select_for_update = 0; /* 1 if SELECT INTO or SELECT FOR * UPDATE */ /* * last query string sent to simpleQuery() */ char query_string_buffer[QUERY_STRING_BUFFER_LEN]; static int check_errors(POOL_CONNECTION_POOL * backend, int backend_id); static void generate_error_message(char *prefix, int specific_error, char *query); static POOL_STATUS parse_before_bind(POOL_CONNECTION * frontend, POOL_CONNECTION_POOL * backend, POOL_SENT_MESSAGE * message, POOL_SENT_MESSAGE * bind_message); static int *find_victim_nodes(int *ntuples, int nmembers, int master_node, int *number_of_nodes); static POOL_STATUS close_standby_transactions(POOL_CONNECTION * frontend, POOL_CONNECTION_POOL * backend); static char *flatten_set_variable_args(const char *name, List *args); static bool process_pg_terminate_backend_func(POOL_QUERY_CONTEXT * query_context); static void pool_discard_except_sync_and_ready_for_query(POOL_CONNECTION * frontend, POOL_CONNECTION_POOL * backend); /* * This is the workhorse of processing the pg_terminate_backend function to * make sure that the use of function should not trigger the backend node failover. * * The function searches for the pg_terminate_backend() function call in the * query parse tree and if the search comes out to be successful, * the next step is to locate the pgpool-II child process and a backend node * of that connection whose PID is specified in pg_terminate_backend argument. * * Once the connection is identified, we set the swallow_termination flag of * that connection (in shared memory) and also sets the query destination to * the same backend that hosts the connection. * * The function returns true on success, i.e. when the query contains the * pg_terminate_backend call and that call refers to the backend * connection that belongs to pgpool-II. * * Note: Since upon successful return this function has already * set the destination backend node for the current query, * so for that case pool_where_to_send() should not be called. * */ static bool process_pg_terminate_backend_func(POOL_QUERY_CONTEXT * query_context) { /* * locate pg_terminate_backend and get the pid argument, if * pg_terminate_backend is present in the query */ int backend_pid = pool_get_terminate_backend_pid(query_context->parse_tree); if (backend_pid > 0) { int backend_node = 0; ConnectionInfo *conn = pool_coninfo_backend_pid(backend_pid, &backend_node); if (conn == NULL) { ereport(LOG, (errmsg("found the pg_terminate_backend request for backend pid:%d, but the backend connection does not belong to pgpool-II", backend_pid))); /* * we are not able to find the backend connection with the pid so * there is not much left for us to do here */ return false; } ereport(LOG, (errmsg("found the pg_terminate_backend request for backend pid:%d on backend node:%d", backend_pid, backend_node), errdetail("setting the connection flag"))); pool_set_connection_will_be_terminated(conn); /* * It was the pg_terminate_backend call so send the query to * appropriate backend */ query_context->pg_terminate_backend_conn = conn; pool_force_query_node_to_backend(query_context, backend_node); return true; } return false; } /* * Process Query('Q') message * Query messages include an SQL string. */ POOL_STATUS SimpleQuery(POOL_CONNECTION * frontend, POOL_CONNECTION_POOL * backend, int len, char *contents) { static char *sq_config = "pool_status"; static char *sq_pools = "pool_pools"; static char *sq_processes = "pool_processes"; static char *sq_nodes = "pool_nodes"; static char *sq_version = "pool_version"; static char *sq_cache = "pool_cache"; int commit; List *parse_tree_list; Node *node = NULL; POOL_STATUS status; int lock_kind; bool is_likely_select = false; int specific_error = 0; POOL_SESSION_CONTEXT *session_context; POOL_QUERY_CONTEXT *query_context; bool error; /* Get session context */ session_context = pool_get_session_context(false); /* save last query string for logging purpose */ strlcpy(query_string_buffer, contents, sizeof(query_string_buffer)); /* show ps status */ query_ps_status(contents, backend); /* log query to log file if necessary */ if (pool_config->log_statement) ereport(LOG, (errmsg("statement: %s", contents))); /* * Fetch memory cache if possible */ if (pool_config->memory_cache_enabled) is_likely_select = pool_is_likely_select(contents); /* * If memory query cache enabled and the query seems to be a SELECT use * query cache if possible. However if we are in an explicit transaction * and we had writing query before, we should not use query cache. This * means that even the writing query is not anything related to the table * which is used the SELECT, we do not use cache. Of course we could * analyze the SELECT to see if it uses the table modified in the * transaction, but it will need parsing query and accessing to system * catalog, which will add significant overhead. Moreover if we are in * aborted transaction, commands should be ignored, so we should not use * query cache. */ if (pool_config->memory_cache_enabled && is_likely_select && !pool_is_writing_transaction() && TSTATE(backend, MASTER_SLAVE ? PRIMARY_NODE_ID : REAL_MASTER_NODE_ID) != 'E') { bool foundp; /* * If the query is SELECT from table to cache, try to fetch cached * result. */ status = pool_fetch_from_memory_cache(frontend, backend, contents, &foundp); if (status != POOL_CONTINUE) return status; if (foundp) { pool_ps_idle_display(backend); pool_set_skip_reading_from_backends(); pool_stats_count_up_num_cache_hits(); return POOL_CONTINUE; } } /* Create query context */ query_context = pool_init_query_context(); MemoryContext old_context = MemoryContextSwitchTo(query_context->memory_context); /* parse SQL string */ parse_tree_list = raw_parser(contents, len, &error, !REPLICATION); if (parse_tree_list == NIL) { /* is the query empty? */ if (*contents == '\0' || *contents == ';' || error == false) { /* * JBoss sends empty queries for checking connections. We replace * the empty query with SELECT command not to affect load balance. * [Pgpool-general] Confused about JDBC and load balancing */ parse_tree_list = get_dummy_read_query_tree(); } else { /* * Unable to parse the query. Probably syntax error or the query * is too new and our parser cannot understand. Treat as if it * were an DELETE command. Note that the DELETE command does not * execute, instead the original query will be sent to backends, * which may or may not cause an actual syntax errors. The command * will be sent to all backends in replication mode or * master/primary in master/slave mode. */ if (!strcmp(remote_host, "[local]")) { ereport(LOG, (errmsg("Unable to parse the query: \"%s\" from local client", contents))); } else { ereport(LOG, (errmsg("Unable to parse the query: \"%s\" from client %s(%s)", contents, remote_host, remote_port))); } parse_tree_list = get_dummy_write_query_tree(); query_context->is_parse_error = true; } } MemoryContextSwitchTo(old_context); if (parse_tree_list != NIL) { node = raw_parser2(parse_tree_list); /* * Start query context */ pool_start_query(query_context, contents, len, node); /* * Create PostgreSQL version cache. Since the provided query might * cause a syntax error, we want to issue "SELECT version()" which is * called inside Pgversion() here. */ Pgversion(backend); /* * If the query is DROP DATABASE, after executing it, cache files * directory must be discarded. So we have to get the DB's oid before * it will be DROPped. */ if (pool_config->memory_cache_enabled && is_drop_database(node)) { DropdbStmt *stmt = (DropdbStmt *) node; query_context->dboid = pool_get_database_oid_from_dbname(stmt->dbname); if (query_context->dboid != 0) { ereport(DEBUG1, (errmsg("DB's oid to discard its cache directory: dboid = %d", query_context->dboid))); } } /* * Check if multi statement query */ if (parse_tree_list && list_length(parse_tree_list) > 1) { query_context->is_multi_statement = true; } else { query_context->is_multi_statement = false; } /* * check COPY FROM STDIN if true, set copy_* variable */ check_copy_from_stdin(node); if (IsA(node, PgpoolVariableShowStmt)) { VariableShowStmt *vnode = (VariableShowStmt *) node; report_config_variable(frontend, backend, vnode->name); pool_ps_idle_display(backend); pool_query_context_destroy(query_context); pool_set_skip_reading_from_backends(); return POOL_CONTINUE; } if (IsA(node, PgpoolVariableSetStmt)) { VariableSetStmt *vnode = (VariableSetStmt *) node; const char *value = NULL; if (vnode->kind == VAR_SET_VALUE) { value = flatten_set_variable_args("name", vnode->args); } if (vnode->kind == VAR_RESET_ALL) { reset_all_variables(frontend, backend); } else { set_config_option_for_session(frontend, backend, vnode->name, value); } pool_ps_idle_display(backend); pool_query_context_destroy(query_context); pool_set_skip_reading_from_backends(); return POOL_CONTINUE; } /* status reporting? */ if (IsA(node, VariableShowStmt)) { bool is_valid_show_command = false; VariableShowStmt *vnode = (VariableShowStmt *) node; if (!strcmp(sq_config, vnode->name)) { is_valid_show_command = true; ereport(DEBUG1, (errmsg("SimpleQuery"), errdetail("config reporting"))); config_reporting(frontend, backend); } else if (!strcmp(sq_pools, vnode->name)) { is_valid_show_command = true; ereport(DEBUG1, (errmsg("SimpleQuery"), errdetail("pools reporting"))); pools_reporting(frontend, backend); } else if (!strcmp(sq_processes, vnode->name)) { is_valid_show_command = true; ereport(DEBUG1, (errmsg("SimpleQuery"), errdetail("processes reporting"))); processes_reporting(frontend, backend); } else if (!strcmp(sq_nodes, vnode->name)) { is_valid_show_command = true; ereport(DEBUG1, (errmsg("SimpleQuery"), errdetail("nodes reporting"))); nodes_reporting(frontend, backend); } else if (!strcmp(sq_version, vnode->name)) { is_valid_show_command = true; ereport(DEBUG1, (errmsg("SimpleQuery"), errdetail("version reporting"))); version_reporting(frontend, backend); } else if (!strcmp(sq_cache, vnode->name)) { is_valid_show_command = true; ereport(DEBUG1, (errmsg("SimpleQuery"), errdetail("cache reporting"))); cache_reporting(frontend, backend); } if (is_valid_show_command) { pool_ps_idle_display(backend); pool_query_context_destroy(query_context); pool_set_skip_reading_from_backends(); return POOL_CONTINUE; } } /* * If the table is to be cached, set is_cache_safe TRUE and register * table oids. */ if (pool_config->memory_cache_enabled && query_context->is_multi_statement == false) { bool is_select_query = false; int num_oids; int *oids; int i; /* Check if the query is actually SELECT */ if (is_likely_select && IsA(node, SelectStmt)) { is_select_query = true; } /* Switch the flag of is_cache_safe in session_context */ if (is_select_query && !query_context->is_parse_error && pool_is_allow_to_cache(query_context->parse_tree, query_context->original_query)) { pool_set_cache_safe(); } else { pool_unset_cache_safe(); } /* * If table is to be cached and the query is DML, save the table * oid */ if (!query_context->is_parse_error) { num_oids = pool_extract_table_oids(node, &oids); if (num_oids > 0) { /* Save to oid buffer */ for (i = 0; i < num_oids; i++) { pool_add_dml_table_oid(oids[i]); } } } } /* * pg_terminate function needs special handling, process it if the * query contains one, otherwise use pool_where_to_send() to decide * destination backend node for the query */ if (process_pg_terminate_backend_func(query_context) == false) { /* * Decide where to send query */ pool_where_to_send(query_context, query_context->original_query, query_context->parse_tree); } /* * if this is DROP DATABASE command, send USR1 signal to parent and * ask it to close all idle connections. XXX This is overkill. It * would be better to close the idle connection for the database which * DROP DATABASE command tries to drop. This is impossible at this * point, since we have no way to pass such info to other processes. */ if (is_drop_database(node)) { struct timeval stime; stime.tv_usec = 0; stime.tv_sec = 5; /* XXX give arbitrary time to allow * closing idle connections */ ereport(DEBUG1, (errmsg("Query: sending SIGUSR1 signal to parent"))); ignore_sigusr1 = 1; /* disable SIGUSR1 handler */ register_node_operation_request(CLOSE_IDLE_REQUEST, NULL, 0, 0); /* * We need to loop over here since we might get some signals while * sleeping */ for (;;) { int sts; errno = 0; sts = select(0, NULL, NULL, NULL, &stime); if (stime.tv_usec == 0 && stime.tv_sec == 0) break; if (sts != 0 && errno != EINTR) { elog(DEBUG1, "select(2) returns error: %s", strerror(errno)); break; } } ignore_sigusr1 = 0; } /*--------------------------------------------------------------------------- * determine if we need to lock the table * to keep SERIAL data consistency among servers * conditions: * - replication is enabled * - protocol is V3 * - statement is INSERT * - either "INSERT LOCK" comment exists or insert_lock directive specified *--------------------------------------------------------------------------- */ if (!RAW_MODE && !SL_MODE) { /* * If there's only one node to send the command, there's no point * to start a transaction. */ if (pool_multi_node_to_be_sent(query_context)) { /* start a transaction if needed */ start_internal_transaction(frontend, backend, (Node *) node); /* check if need lock */ lock_kind = need_insert_lock(backend, contents, node); if (lock_kind) { /* if so, issue lock command */ status = insert_lock(frontend, backend, contents, (InsertStmt *) node, lock_kind); if (status != POOL_CONTINUE) { pool_query_context_destroy(query_context); return status; } } } } } if (MAJOR(backend) == PROTO_MAJOR_V2 && is_start_transaction_query(node)) { int i; for (i = 0; i < NUM_BACKENDS; i++) { if (VALID_BACKEND(i)) TSTATE(backend, i) = 'T'; } } if (node) { POOL_SENT_MESSAGE *msg = NULL; if (IsA(node, PrepareStmt)) { msg = pool_create_sent_message('Q', len, contents, 0, ((PrepareStmt *) node)->name, query_context); session_context->uncompleted_message = msg; } else session_context->uncompleted_message = NULL; } if (!RAW_MODE) { /* check if query is "COMMIT" or "ROLLBACK" */ commit = is_commit_or_rollback_query(node); /* * Query is not commit/rollback */ if (!commit) { char *rewrite_query = NULL; if (node) { POOL_SENT_MESSAGE *msg = NULL; if (IsA(node, PrepareStmt)) { msg = session_context->uncompleted_message; } else if (IsA(node, ExecuteStmt)) { msg = pool_get_sent_message('Q', ((ExecuteStmt *) node)->name, POOL_SENT_MESSAGE_CREATED); if (!msg) msg = pool_get_sent_message('P', ((ExecuteStmt *) node)->name, POOL_SENT_MESSAGE_CREATED); } /* rewrite `now()' to timestamp literal */ if (!is_select_query(node, query_context->original_query) || pool_has_function_call(node) || pool_config->replicate_select) rewrite_query = rewrite_timestamp(backend, query_context->parse_tree, false, msg); /* * 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)) { rewrite_query = pstrdup("BEGIN"); } if (rewrite_query != NULL) { query_context->rewritten_query = rewrite_query; query_context->rewritten_length = strlen(rewrite_query) + 1; } } /* * Optimization effort: If there's only one session, we do not * need to wait for the master node's response, and could execute * the query concurrently. */ if (pool_config->num_init_children == 1) { /* Send query to all DB nodes at once */ status = pool_send_and_wait(query_context, 0, 0); /* free_parser(); */ return status; } /* Send the query to master node */ pool_send_and_wait(query_context, 1, MASTER_NODE_ID); /* Check specific errors */ specific_error = check_errors(backend, MASTER_NODE_ID); if (specific_error) { /* log error message */ generate_error_message("SimpleQuery: ", specific_error, contents); } } if (specific_error) { char msg[1024] = POOL_ERROR_QUERY; /* large enough */ int len = strlen(msg); memset(msg + len, 0, sizeof(int)); /* send query to other nodes */ query_context->rewritten_query = msg; query_context->rewritten_length = len; pool_send_and_wait(query_context, -1, MASTER_NODE_ID); } else { /* * Send the query to other than master node. */ pool_send_and_wait(query_context, -1, MASTER_NODE_ID); } /* * Send "COMMIT" or "ROLLBACK" to only master node if query is * "COMMIT" or "ROLLBACK" */ if (commit) pool_send_and_wait(query_context, 1, MASTER_NODE_ID); } else { pool_send_and_wait(query_context, 1, MASTER_NODE_ID); } return POOL_CONTINUE; } /* * process EXECUTE (V3 only) */ POOL_STATUS Execute(POOL_CONNECTION * frontend, POOL_CONNECTION_POOL * backend, int len, char *contents) { int commit = 0; char *query = NULL; Node *node; int specific_error = 0; POOL_SESSION_CONTEXT *session_context; POOL_QUERY_CONTEXT *query_context; POOL_SENT_MESSAGE *bind_msg; bool foundp = false; /* Get session context */ session_context = pool_get_session_context(false); if (pool_config->log_client_messages) ereport(LOG, (errmsg("Execute message from frontend."), errdetail("portal: \"%s\"", contents))); ereport(DEBUG2, (errmsg("Execute: portal name <%s>", contents))); bind_msg = pool_get_sent_message('B', contents, POOL_SENT_MESSAGE_CREATED); if (!bind_msg) ereport(FATAL, (return_code(2), errmsg("unable to Execute"), errdetail("unable to get bind message"))); if (!bind_msg->query_context) ereport(FATAL, (return_code(2), errmsg("unable to Execute"), errdetail("unable to get query context"))); if (!bind_msg->query_context->original_query) ereport(FATAL, (return_code(2), errmsg("unable to Execute"), errdetail("unable to get original query"))); if (!bind_msg->query_context->parse_tree) ereport(FATAL, (return_code(2), errmsg("unable to Execute"), errdetail("unable to get parse tree"))); query_context = bind_msg->query_context; node = bind_msg->query_context->parse_tree; query = bind_msg->query_context->original_query; strlcpy(query_string_buffer, query, sizeof(query_string_buffer)); ereport(DEBUG2, (errmsg("Execute: query string = <%s>", query))); ereport(DEBUG1, (errmsg("Execute: pool_is_writing_transaction: %d TSTATE: %c", pool_is_writing_transaction(), TSTATE(backend, MASTER_SLAVE ? PRIMARY_NODE_ID : REAL_MASTER_NODE_ID)))); /* * Fetch memory cache if possible */ if (pool_config->memory_cache_enabled && !pool_is_writing_transaction() && (TSTATE(backend, MASTER_SLAVE ? PRIMARY_NODE_ID : REAL_MASTER_NODE_ID) != 'E') && pool_is_likely_select(query)) { POOL_STATUS status; char *search_query = NULL; int len; #define STR_ALLOC_SIZE 1024 ereport(DEBUG1, (errmsg("Execute: pool_is_likely_select: true pool_is_writing_transaction: %d TSTATE: %c", pool_is_writing_transaction(), TSTATE(backend, MASTER_SLAVE ? PRIMARY_NODE_ID : REAL_MASTER_NODE_ID)))); len = strlen(query) + 1; search_query = MemoryContextStrdup(query_context->memory_context, query); ereport(DEBUG1, (errmsg("Execute: checkig cache fetch condition"))); /* * Add bind message's info to query to search. */ if (query_context->is_cache_safe && bind_msg->param_offset && bind_msg->contents) { /* Extract binary contents from bind message */ char *query_in_bind_msg = bind_msg->contents + bind_msg->param_offset; char hex_str[4]; /* 02X chars + white space + null end */ int i; int alloc_len; alloc_len = (len / STR_ALLOC_SIZE + 1) * STR_ALLOC_SIZE; search_query = repalloc(search_query, alloc_len); for (i = 0; i < bind_msg->len - bind_msg->param_offset; i++) { int hexlen; snprintf(hex_str, sizeof(hex_str), (i == 0) ? " %02X" : "%02X", 0xff & query_in_bind_msg[i]); hexlen = strlen(hex_str); if ((len + hexlen) >= alloc_len) { alloc_len += STR_ALLOC_SIZE; search_query = repalloc(search_query, alloc_len); } strcat(search_query, hex_str); len += hexlen; } /* * If bind message is sent again to an existing prepared statement, * it is possible that query_w_hex remains. Before setting newly * allocated query_w_hex's pointer to the query context, free the * previously allocated memory. */ if (query_context->query_w_hex) { pfree(query_context->query_w_hex); } query_context->query_w_hex = search_query; /* * When a transaction is committed, * query_context->temp_cache->query is used to create md5 hash to * search for query cache. So overwrite the query text in temp * cache to the one with the hex of bind message. If not, md5 hash * will be created by the query text without bind message, and it * will happen to find cache never or to get a wrong result. * * However, It is possible that temp_cache does not exist. * Consider following scenario: - In the previous execute cache is * overflowed, and temp_cache discarded. - In the subsequent * bind/execute uses the same portal */ if (query_context->temp_cache) { pfree(query_context->temp_cache->query); query_context->temp_cache->query = MemoryContextStrdup(session_context->memory_context, search_query); } } /* * If the query is SELECT from table to cache, try to fetch cached * result. */ status = pool_fetch_from_memory_cache(frontend, backend, search_query, &foundp); if (status != POOL_CONTINUE) return status; if (foundp) { #ifdef DEBUG extern bool stop_now; #endif pool_ps_idle_display(backend); pool_stats_count_up_num_cache_hits(); query_context->skip_cache_commit = true; #ifdef DEBUG stop_now = true; #endif if (!SL_MODE || !pool_is_doing_extended_query_message()) { pool_set_skip_reading_from_backends(); pool_stats_count_up_num_cache_hits(); pool_unset_query_in_progress(); return POOL_CONTINUE; } } else query_context->skip_cache_commit = false; } session_context->query_context = query_context; /* * Calling pool_where_to_send here is dangerous because the node * parse/bind has been sent could be change by pool_where_to_send() and it * leads to "portal not found" etc. errors. */ /* check if query is "COMMIT" or "ROLLBACK" */ commit = is_commit_or_rollback_query(node); if (!SL_MODE) { /* * Query is not commit/rollback */ if (!commit) { /* Send the query to master node */ pool_extended_send_and_wait(query_context, "E", len, contents, 1, MASTER_NODE_ID, false); /* Check specific errors */ specific_error = check_errors(backend, MASTER_NODE_ID); if (specific_error) { /* log error message */ generate_error_message("Execute: ", specific_error, contents); } } if (specific_error) { char msg[1024] = "pgpool_error_portal"; /* large enough */ int len = strlen(msg); memset(msg + len, 0, sizeof(int)); /* send query to other nodes */ pool_extended_send_and_wait(query_context, "E", len, msg, -1, MASTER_NODE_ID, false); } else { pool_extended_send_and_wait(query_context, "E", len, contents, -1, MASTER_NODE_ID, false); } /* * send "COMMIT" or "ROLLBACK" to only master node if query is * "COMMIT" or "ROLLBACK" */ if (commit) { pool_extended_send_and_wait(query_context, "E", len, contents, 1, MASTER_NODE_ID, false); } } else /* streaming replication mode */ { POOL_PENDING_MESSAGE *pmsg; if (!foundp) { pool_extended_send_and_wait(query_context, "E", len, contents, 1, MASTER_NODE_ID, true); pool_extended_send_and_wait(query_context, "E", len, contents, -1, MASTER_NODE_ID, true); } /* Add pending message */ pmsg = pool_pending_message_create('E', len, contents); pool_pending_message_dest_set(pmsg, query_context); pool_pending_message_query_set(pmsg, query_context); pool_pending_message_add(pmsg); pool_pending_message_free_pending_message(pmsg); /* Various take care at the transaction start */ handle_query_context(backend); /* * Take care of "writing transaction" flag. */ if ((!is_select_query(node, query) || pool_has_function_call(node)) && !is_start_transaction_query(node) && !is_commit_or_rollback_query(node)) { ereport(DEBUG1, (errmsg("Execute: TSTATE:%c", TSTATE(backend, MASTER_SLAVE ? PRIMARY_NODE_ID : REAL_MASTER_NODE_ID)))); /* * If the query was not READ SELECT, and we are in an explicit * transaction, remember that we had a write query in this * transaction. */ if (TSTATE(backend, MASTER_SLAVE ? PRIMARY_NODE_ID : REAL_MASTER_NODE_ID) == 'T' || pool_config->disable_load_balance_on_write == DLBOW_ALWAYS) { /* * However, if the query is "SET TRANSACTION READ ONLY" or its * variant, don't set it. */ if (!pool_is_transaction_read_only(node)) { pool_set_writing_transaction(); } } } pool_unset_query_in_progress(); } return POOL_CONTINUE; } /* * process Parse (V3 only) */ POOL_STATUS Parse(POOL_CONNECTION * frontend, POOL_CONNECTION_POOL * backend, int len, char *contents) { int deadlock_detected = 0; int insert_stmt_with_lock = 0; char *name; char *stmt; List *parse_tree_list; Node *node = NULL; POOL_SENT_MESSAGE *msg; POOL_STATUS status; POOL_SESSION_CONTEXT *session_context; POOL_QUERY_CONTEXT *query_context; bool error; /* Get session context */ session_context = pool_get_session_context(false); /* Create query context */ query_context = pool_init_query_context(); ereport(DEBUG1, (errmsg("Parse: statement name <%s>", contents))); name = contents; stmt = contents + strlen(contents) + 1; if (pool_config->log_client_messages) ereport(LOG, (errmsg("Parse message from frontend."), errdetail("statement: \"%s\", query: \"%s\"", name, stmt))); /* parse SQL string */ MemoryContext old_context = MemoryContextSwitchTo(query_context->memory_context); parse_tree_list = raw_parser(stmt, strlen(stmt),&error,!REPLICATION); if (parse_tree_list == NIL) { /* is the query empty? */ if (*stmt == '\0' || *stmt == ';' || error == false) { /* * JBoss sends empty queries for checking connections. We replace * the empty query with SELECT command not to affect load balance. * [Pgpool-general] Confused about JDBC and load balancing */ parse_tree_list = get_dummy_read_query_tree(); } else { /* * Unable to parse the query. Probably syntax error or the query * is too new and our parser cannot understand. Treat as if it * were an DELETE command. Note that the DELETE command does not * execute, instead the original query will be sent to backends, * which may or may not cause an actual syntax errors. The command * will be sent to all backends in replication mode or * master/primary in master/slave mode. */ if (!strcmp(remote_host, "[local]")) { ereport(LOG, (errmsg("Unable to parse the query: \"%s\" from local client", stmt))); } else { ereport(LOG, (errmsg("Unable to parse the query: \"%s\" from client %s(%s)", stmt, remote_host, remote_port))); } parse_tree_list = get_dummy_write_query_tree(); query_context->is_parse_error = true; } } MemoryContextSwitchTo(old_context); if (parse_tree_list != NIL) { /* Save last query string for logging purpose */ snprintf(query_string_buffer, sizeof(query_string_buffer), "Parse: %s", stmt); node = raw_parser2(parse_tree_list); /* * If replication mode, check to see what kind of insert lock is * neccessary. */ if (REPLICATION) insert_stmt_with_lock = need_insert_lock(backend, stmt, node); /* * Start query context */ pool_start_query(query_context, stmt, strlen(stmt) + 1, node); /* * Create PostgreSQL version cache. Since the provided query might * cause a syntax error, we want to issue "SELECT version()" which is * called inside Pgversion() here. */ Pgversion(backend); msg = pool_create_sent_message('P', len, contents, 0, name, query_context); session_context->uncompleted_message = msg; /* * If the table is to be cached, set is_cache_safe TRUE and register * table oids. */ if (pool_config->memory_cache_enabled) { bool is_likely_select = false; bool is_select_query = false; int num_oids; int *oids; int i; /* Check if the query is actually SELECT */ is_likely_select = pool_is_likely_select(query_context->original_query); if (is_likely_select && IsA(node, SelectStmt)) { is_select_query = true; } /* Switch the flag of is_cache_safe in session_context */ if (is_select_query && !query_context->is_parse_error && pool_is_allow_to_cache(query_context->parse_tree, query_context->original_query)) { pool_set_cache_safe(); } else { pool_unset_cache_safe(); } /* * If table is to be cached and the query is DML, save the table * oid */ if (!is_select_query && !query_context->is_parse_error) { num_oids = pool_extract_table_oids(node, &oids); if (num_oids > 0) { /* Save to oid buffer */ for (i = 0; i < num_oids; i++) { pool_add_dml_table_oid(oids[i]); } } } } /* * Decide where to send query */ pool_where_to_send(query_context, query_context->original_query, query_context->parse_tree); if (REPLICATION) { char *rewrite_query; bool rewrite_to_params = true; /* * rewrite `now()'. if stmt is unnamed, we rewrite `now()' to * timestamp constant. else we rewrite `now()' to params and * expand that at Bind message. */ if (*name == '\0') rewrite_to_params = false; msg->num_tsparams = 0; rewrite_query = rewrite_timestamp(backend, node, rewrite_to_params, msg); if (rewrite_query != NULL) { int alloc_len = len - strlen(stmt) + strlen(rewrite_query); /* switch memory context */ MemoryContext oldcxt = MemoryContextSwitchTo(session_context->memory_context); contents = repalloc(msg->contents, alloc_len); MemoryContextSwitchTo(oldcxt); strcpy(contents, name); strcpy(contents + strlen(name) + 1, rewrite_query); memcpy(contents + strlen(name) + strlen(rewrite_query) + 2, stmt + strlen(stmt) + 1, len - (strlen(name) + strlen(stmt) + 2)); len = alloc_len; name = contents; stmt = contents + strlen(name) + 1; ereport(DEBUG1, (errmsg("Parse: rewrite query name:\"%s\" statement:\"%s\" len=%d", name, stmt, len))); msg->len = len; msg->contents = contents; query_context->rewritten_query = rewrite_query; } } /* * If the query is BEGIN READ WRITE in master/slave mode, we send * BEGIN instead of it to slaves/standbys. original_query which is * BEGIN READ WRITE is sent to primary. rewritten_query which is BEGIN * is sent to standbys. */ if (is_start_transaction_query(query_context->parse_tree) && is_read_write((TransactionStmt *) query_context->parse_tree) && MASTER_SLAVE) { query_context->rewritten_query = pstrdup("BEGIN"); } } /* * If in replication mode, send "SYNC" message if not in a transaction. */ if (REPLICATION) { char kind; if (TSTATE(backend, MASTER_NODE_ID) != 'T') { int i; /* synchronize transaction state */ for (i = 0; i < NUM_BACKENDS; i++) { if (!VALID_BACKEND(i)) continue; /* send sync message */ send_extended_protocol_message(backend, i, "S", 0, ""); } kind = pool_read_kind(backend); if (kind != 'Z') ereport(ERROR, (errmsg("unable to parse the query"), errdetail("invalid read kind"))); /* * SYNC message returns "Ready for Query" message. */ if (ReadyForQuery(frontend, backend, 0, false) != POOL_CONTINUE) { pool_query_context_destroy(query_context); return POOL_END; } /* * set in_progress flag, because ReadyForQuery unset it. * in_progress flag influences VALID_BACKEND. */ if (!pool_is_query_in_progress()) pool_set_query_in_progress(); } if (is_strict_query(query_context->parse_tree)) { start_internal_transaction(frontend, backend, query_context->parse_tree); allow_close_transaction = 1; } if (insert_stmt_with_lock) { /* start a transaction if needed and lock the table */ status = insert_lock(frontend, backend, stmt, (InsertStmt *) query_context->parse_tree, insert_stmt_with_lock); if (status != POOL_CONTINUE) ereport(ERROR, (errmsg("unable to parse the query"), errdetail("unable to get insert lock"))); } } if (REPLICATION || SLONY) { /* * We must synchronize because Parse message acquires table locks. */ ereport(DEBUG1, (errmsg("Parse: waiting for master completing the query"))); pool_extended_send_and_wait(query_context, "P", len, contents, 1, MASTER_NODE_ID, false); /* * We must check deadlock error because a aborted transaction by * detecting deadlock isn't same on all nodes. If a transaction is * aborted on master node, pgpool send a error query to another nodes. */ deadlock_detected = detect_deadlock_error(MASTER(backend), MAJOR(backend)); /* * Check if other than deadlock 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, MASTER_NODE_ID, stmt, "Parse: Error or notice message from backend: ", true); if (deadlock_detected) { POOL_QUERY_CONTEXT *error_qc; error_qc = pool_init_query_context(); pool_start_query(error_qc, POOL_ERROR_QUERY, strlen(POOL_ERROR_QUERY) + 1, node); pool_copy_prep_where(query_context->where_to_send, error_qc->where_to_send); ereport(LOG, (errmsg("Parse: received deadlock error message from master node"))); pool_send_and_wait(error_qc, -1, MASTER_NODE_ID); pool_query_context_destroy(error_qc); pool_set_query_in_progress(); session_context->query_context = query_context; } else { pool_extended_send_and_wait(query_context, "P", len, contents, -1, MASTER_NODE_ID, false); } } else if (SL_MODE) { POOL_PENDING_MESSAGE *pmsg; /* * XXX fix me:even with streaming replication mode, couldn't we have a * deadlock */ pool_set_query_in_progress(); #ifdef NOT_USED pool_clear_sync_map(); #endif pool_extended_send_and_wait(query_context, "P", len, contents, 1, MASTER_NODE_ID, true); pool_extended_send_and_wait(query_context, "P", len, contents, -1, MASTER_NODE_ID, true); pool_add_sent_message(session_context->uncompleted_message); /* Add pending message */ pmsg = pool_pending_message_create('P', len, contents); pool_pending_message_dest_set(pmsg, query_context); pool_pending_message_add(pmsg); pool_pending_message_free_pending_message(pmsg); pool_unset_query_in_progress(); } else { pool_extended_send_and_wait(query_context, "P", len, contents, 1, MASTER_NODE_ID, false); } return POOL_CONTINUE; } POOL_STATUS Bind(POOL_CONNECTION * frontend, POOL_CONNECTION_POOL * backend, int len, char *contents) { char *pstmt_name; char *portal_name; char *rewrite_msg = NULL; POOL_SENT_MESSAGE *parse_msg; POOL_SENT_MESSAGE *bind_msg; POOL_SESSION_CONTEXT *session_context; POOL_QUERY_CONTEXT *query_context; int insert_stmt_with_lock = 0; bool nowait; /* Get session context */ session_context = pool_get_session_context(false); /* * Rewrite message */ portal_name = contents; pstmt_name = contents + strlen(portal_name) + 1; if (pool_config->log_client_messages) ereport(LOG, (errmsg("Bind message from frontend."), errdetail("portal: \"%s\", statement: \"%s\"", portal_name, pstmt_name))); parse_msg = pool_get_sent_message('Q', pstmt_name, POOL_SENT_MESSAGE_CREATED); if (!parse_msg) parse_msg = pool_get_sent_message('P', pstmt_name, POOL_SENT_MESSAGE_CREATED); if (!parse_msg) { ereport(FATAL, (errmsg("unable to bind"), errdetail("cannot get parse message \"%s\"", pstmt_name))); } bind_msg = pool_create_sent_message('B', len, contents, parse_msg->num_tsparams, portal_name, parse_msg->query_context); query_context = parse_msg->query_context; if (!query_context) { ereport(FATAL, (errmsg("unable to bind"), errdetail("cannot get the query context"))); } /* * If the query can be cached, save its offset of query text in bind * message's content. */ if (query_context->is_cache_safe) { bind_msg->param_offset = sizeof(char) * (strlen(portal_name) + strlen(pstmt_name) + 2); } session_context->uncompleted_message = bind_msg; /* rewrite bind message */ if (REPLICATION && bind_msg->num_tsparams > 0) { rewrite_msg = bind_rewrite_timestamp(backend, bind_msg, contents, &len); if (rewrite_msg != NULL) contents = rewrite_msg; } session_context->query_context = query_context; /* * Take care the case when the previous parse message has been sent to * other than primary node. In this case, we send a parse message to the * primary node. */ if (pool_config->load_balance_mode && pool_is_writing_transaction() && TSTATE(backend, MASTER_SLAVE ? PRIMARY_NODE_ID : REAL_MASTER_NODE_ID) == 'T' && pool_config->disable_load_balance_on_write != DLBOW_OFF) { if (!SL_MODE) { pool_where_to_send(query_context, query_context->original_query, query_context->parse_tree); } if (parse_before_bind(frontend, backend, parse_msg, bind_msg) != POOL_CONTINUE) return POOL_END; } /* * Start a transaction if necessary in replication mode */ if (REPLICATION) { ereport(DEBUG1, (errmsg("Bind: checking strict query"))); if (is_strict_query(query_context->parse_tree)) { ereport(DEBUG1, (errmsg("Bind: strict query"))); start_internal_transaction(frontend, backend, query_context->parse_tree); allow_close_transaction = 1; } ereport(DEBUG1, (errmsg("Bind: checking insert lock"))); insert_stmt_with_lock = need_insert_lock(backend, query_context->original_query, query_context->parse_tree); if (insert_stmt_with_lock) { ereport(DEBUG1, (errmsg("Bind: issuing insert lock"))); /* issue a LOCK command to keep consistency */ if (insert_lock(frontend, backend, query_context->original_query, (InsertStmt *) query_context->parse_tree, insert_stmt_with_lock) != POOL_CONTINUE) { pool_query_context_destroy(query_context); return POOL_END; } } } ereport(DEBUG1, (errmsg("Bind: waiting for master completing the query"))); pool_set_query_in_progress(); if (SL_MODE) { nowait = true; session_context->query_context = query_context = bind_msg->query_context; } else nowait = false; pool_extended_send_and_wait(query_context, "B", len, contents, 1, MASTER_NODE_ID, nowait); pool_extended_send_and_wait(query_context, "B", len, contents, -1, MASTER_NODE_ID, nowait); if (SL_MODE) { POOL_PENDING_MESSAGE *pmsg; pool_unset_query_in_progress(); pool_add_sent_message(session_context->uncompleted_message); /* Add pending message */ pmsg = pool_pending_message_create('B', len, contents); pool_pending_message_dest_set(pmsg, query_context); pool_pending_message_query_set(pmsg, query_context); pool_pending_message_add(pmsg); pool_pending_message_free_pending_message(pmsg); } if (rewrite_msg) pfree(rewrite_msg); return POOL_CONTINUE; } POOL_STATUS Describe(POOL_CONNECTION * frontend, POOL_CONNECTION_POOL * backend, int len, char *contents) { POOL_SENT_MESSAGE *msg; POOL_SESSION_CONTEXT *session_context; POOL_QUERY_CONTEXT *query_context; bool nowait; /* Get session context */ session_context = pool_get_session_context(false); /* Prepared Statement */ if (*contents == 'S') { if (pool_config->log_client_messages) ereport(LOG, (errmsg("Describe message from frontend."), errdetail("statement: \"%s\"", contents + 1))); msg = pool_get_sent_message('Q', contents + 1, POOL_SENT_MESSAGE_CREATED); if (!msg) msg = pool_get_sent_message('P', contents + 1, POOL_SENT_MESSAGE_CREATED); if (!msg) ereport(FATAL, (return_code(2), errmsg("unable to execute Describe"), errdetail("unable to get the parse message"))); } /* Portal */ else { if (pool_config->log_client_messages) ereport(LOG, (errmsg("Describe message from frontend."), errdetail("portal: \"%s\"", contents + 1))); msg = pool_get_sent_message('B', contents + 1, POOL_SENT_MESSAGE_CREATED); if (!msg) ereport(FATAL, (return_code(2), errmsg("unable to execute Describe"), errdetail("unable to get the bind message"))); } query_context = msg->query_context; if (query_context == NULL) ereport(FATAL, (return_code(2), errmsg("unable to execute Describe"), errdetail("unable to get the query context"))); session_context->query_context = query_context; /* * Calling pool_where_to_send here is dangerous because the node * parse/bind has been sent could be change by pool_where_to_send() and it * leads to "portal not found" etc. errors. */ ereport(DEBUG1, (errmsg("Describe: waiting for master completing the query"))); nowait = (SL_MODE ? true : false); pool_set_query_in_progress(); pool_extended_send_and_wait(query_context, "D", len, contents, 1, MASTER_NODE_ID, nowait); pool_extended_send_and_wait(query_context, "D", len, contents, -1, MASTER_NODE_ID, nowait); if (SL_MODE) { POOL_PENDING_MESSAGE *pmsg; /* Add pending message */ pmsg = pool_pending_message_create('D', len, contents); pool_pending_message_dest_set(pmsg, query_context); pool_pending_message_query_set(pmsg, query_context); pool_pending_message_add(pmsg); pool_pending_message_free_pending_message(pmsg); pool_unset_query_in_progress(); } return POOL_CONTINUE; } POOL_STATUS Close(POOL_CONNECTION * frontend, POOL_CONNECTION_POOL * backend, int len, char *contents) { POOL_SENT_MESSAGE *msg; POOL_SESSION_CONTEXT *session_context; POOL_QUERY_CONTEXT *query_context; /* Get session context */ session_context = pool_get_session_context(false); /* Prepared Statement */ if (*contents == 'S') { msg = pool_get_sent_message('Q', contents + 1, POOL_SENT_MESSAGE_CREATED); if (pool_config->log_client_messages) ereport(LOG, (errmsg("Close message from frontend."), errdetail("statement: \"%s\"", contents + 1))); if (!msg) msg = pool_get_sent_message('P', contents + 1, POOL_SENT_MESSAGE_CREATED); } /* Portal */ else if (*contents == 'P') { if (pool_config->log_client_messages) ereport(LOG, (errmsg("Close message from frontend."), errdetail("portal: \"%s\"", contents + 1))); msg = pool_get_sent_message('B', contents + 1, POOL_SENT_MESSAGE_CREATED); } else ereport(FATAL, (return_code(2), errmsg("unable to execute close, invalid message"))); /* * As per the postgresql, calling close on non existing portals or * statements is not an error. So on the same footings we will ignore all * such calls and return the close complete message to clients with out * going to backend */ if (!msg) { int len = htonl(4); pool_set_command_success(); pool_unset_query_in_progress(); pool_write(frontend, "3", 1); pool_write_and_flush(frontend, &len, sizeof(len)); return POOL_CONTINUE; } session_context->uncompleted_message = msg; query_context = msg->query_context; if (!query_context) ereport(FATAL, (return_code(2), errmsg("unable to execute close"), errdetail("unable to get the query context"))); session_context->query_context = query_context; /* * pool_where_to_send(query_context, query_context->original_query, * query_context->parse_tree); */ ereport(DEBUG1, (errmsg("Close: waiting for master completing the query"))); pool_set_query_in_progress(); if (!SL_MODE) { pool_extended_send_and_wait(query_context, "C", len, contents, 1, MASTER_NODE_ID, false); pool_extended_send_and_wait(query_context, "C", len, contents, -1, MASTER_NODE_ID, false); } else { POOL_PENDING_MESSAGE *pmsg; bool where_to_send_save[MAX_NUM_BACKENDS]; /* * Parse_before_bind() may have sent a bind message to the primary * node id. So send the close message to the primary node as well. * Even if not, sending a close message for non existing * statement/portal is harmless. No error will happen. */ if (session_context->load_balance_node_id != PRIMARY_NODE_ID) { /* save where_to_send map */ memcpy(where_to_send_save, query_context->where_to_send, sizeof(where_to_send_save)); query_context->where_to_send[PRIMARY_NODE_ID] = true; query_context->where_to_send[session_context->load_balance_node_id] = true; } pool_extended_send_and_wait(query_context, "C", len, contents, 1, MASTER_NODE_ID, true); pool_extended_send_and_wait(query_context, "C", len, contents, -1, MASTER_NODE_ID, true); /* Add pending message */ pmsg = pool_pending_message_create('C', len, contents); pool_pending_message_dest_set(pmsg, query_context); pool_pending_message_query_set(pmsg, query_context); pool_pending_message_add(pmsg); pool_pending_message_free_pending_message(pmsg); if (session_context->load_balance_node_id != PRIMARY_NODE_ID) { /* Restore where_to_send map */ memcpy(query_context->where_to_send, where_to_send_save, sizeof(where_to_send_save)); } #ifdef NOT_USED dump_pending_message(); #endif pool_unset_query_in_progress(); /* * Remove sent message */ ereport(DEBUG1, (errmsg("Close: removing sent message %c %s", *contents, contents + 1))); pool_set_sent_message_state(msg); } return POOL_CONTINUE; } POOL_STATUS FunctionCall3(POOL_CONNECTION * frontend, POOL_CONNECTION_POOL * backend, int len, char *contents) { /* * If Function call message for lo_creat, rewrite it */ char *rewrite_lo; int rewrite_len; rewrite_lo = pool_rewrite_lo_creat('F', contents, len, frontend, backend, &rewrite_len); if (rewrite_lo != NULL) { contents = rewrite_lo; len = rewrite_len; } return SimpleForwardToBackend('F', frontend, backend, len, contents); } /* * Process ReadyForQuery('Z') message. * If send_ready is true, send 'Z' message to frontend. * If cache_commit is true, commit or discard query cache according to * transaction state. * * - if the error status "mismatch_ntuples" is set, send an error query * to all DB nodes to abort transaction or do failover. * - internal transaction is closed */ POOL_STATUS ReadyForQuery(POOL_CONNECTION * frontend, POOL_CONNECTION_POOL * backend, bool send_ready, bool cache_commit) { int i; int len; signed char kind; signed char state = 0; POOL_SESSION_CONTEXT *session_context; Node *node = NULL; char *query = NULL; bool got_estate = false; /* * It is possible that the "ignore until sync is received" flag was set if * we send sync to backend and the backend returns error. Let's reset the * flag unconditionally because we apparently have received a "ready for * query" message from backend. */ pool_unset_ignore_till_sync(); /* Reset previous message */ pool_pending_message_reset_previous_message(); /* Get session context */ session_context = pool_get_session_context(false); /* * If the numbers of update tuples are differ and * failover_if_affected_tuples_mismatch is false, we abort transactions by * using do_error_command. If failover_if_affected_tuples_mismatch is * true, trigger failover. This only works with PROTO_MAJOR_V3. */ if (session_context->mismatch_ntuples && MAJOR(backend) == PROTO_MAJOR_V3) { int i; char kind; /* * If failover_if_affected_tuples_mismatch, is true, then decide * victim nodes by using find_victim_nodes and degenerate them. */ if (pool_config->failover_if_affected_tuples_mismatch) { int *victim_nodes; int number_of_nodes; char msgbuf[128]; victim_nodes = find_victim_nodes(session_context->ntuples, NUM_BACKENDS, MASTER_NODE_ID, &number_of_nodes); if (victim_nodes) { int i; String *msg; msg = init_string("ReadyForQuery: Degenerate backends:"); for (i = 0; i < number_of_nodes; i++) { snprintf(msgbuf, sizeof(msgbuf), " %d", victim_nodes[i]); string_append_char(msg, msgbuf); } ereport(LOG, (errmsg("processing ready for query message"), errdetail("%s", msg->data))); free_string(msg); msg = init_string("ReadyForQuery: Number of affected tuples are:"); for (i = 0; i < NUM_BACKENDS; i++) { snprintf(msgbuf, sizeof(msgbuf), " %d", session_context->ntuples[i]); string_append_char(msg, msgbuf); } ereport(LOG, (errmsg("processing ready for query message"), errdetail("%s", msg->data))); free_string(msg); degenerate_backend_set(victim_nodes, number_of_nodes, REQ_DETAIL_CONFIRMED | REQ_DETAIL_SWITCHOVER); child_exit(POOL_EXIT_AND_RESTART); } else { ereport(LOG, (errmsg("processing ready for query message"), errdetail("find_victim_nodes returned no victim node"))); } } /* * XXX: discard rest of ReadyForQuery packet */ if (pool_read_message_length(backend) < 0) return POOL_END; state = pool_read_kind(backend); if (state < 0) return POOL_END; for (i = 0; i < NUM_BACKENDS; i++) { if (VALID_BACKEND(i)) { /* abort transaction on all nodes. */ do_error_command(CONNECTION(backend, i), PROTO_MAJOR_V3); } } /* loop through until we get ReadyForQuery */ for (;;) { kind = pool_read_kind(backend); if (kind < 0) return POOL_END; if (kind == 'Z') break; /* put the message back to read buffer */ for (i = 0; i < NUM_BACKENDS; i++) { if (VALID_BACKEND(i)) { pool_unread(CONNECTION(backend, i), &kind, 1); } } /* discard rest of the packet */ if (pool_discard_packet(backend) != POOL_CONTINUE) return POOL_END; } session_context->mismatch_ntuples = false; } /* * if a transaction is started for insert lock, we need to close the * transaction. */ /* if (pool_is_query_in_progress() && allow_close_transaction) */ if (allow_close_transaction) { if (end_internal_transaction(frontend, backend) != POOL_CONTINUE) return POOL_END; } if (MAJOR(backend) == PROTO_MAJOR_V3) { if ((len = pool_read_message_length(backend)) < 0) return POOL_END; /* * Set transaction state for each node */ state = TSTATE(backend, MASTER_SLAVE ? PRIMARY_NODE_ID : REAL_MASTER_NODE_ID); for (i = 0; i < NUM_BACKENDS; i++) { if (!VALID_BACKEND(i)) continue; if (pool_read(CONNECTION(backend, i), &kind, sizeof(kind))) return POOL_END; TSTATE(backend, i) = kind; ereport(DEBUG5, (errmsg("processing ReadyForQuery"), errdetail("transaction state '%c'(%02x)", state, state))); /* * The transaction state to be returned to frontend is master's. */ if (i == (MASTER_SLAVE ? PRIMARY_NODE_ID : REAL_MASTER_NODE_ID)) { state = kind; } /* * However, if the state is 'E', then frontend should had been * already reported an ERROR. So, to match with that, let be the * state to be returned to frontend. */ if (kind == 'E') got_estate = true; } } /* * Make sure that no message remains in the backend buffer. If something * remains, it could be an "out of band" ERROR or FATAL error, or a NOTICE * message, which was generated by backend itself for some reasons like * recovery conflict or SIGTERM received. If so, let's consume it and emit * a log message so that next read_kind_from_backend() will not hang in * trying to read from backend which may have not produced such a message. */ if (pool_is_query_in_progress()) { for (i = 0; i < NUM_BACKENDS; i++) { if (!VALID_BACKEND(i)) continue; if (!pool_read_buffer_is_empty(CONNECTION(backend, i))) per_node_error_log(backend, i, "(out of band message)", "ReadyForQuery: Error or notice message from backend: ", false); } } if (send_ready) { pool_write(frontend, "Z", 1); if (MAJOR(backend) == PROTO_MAJOR_V3) { len = htonl(len); pool_write(frontend, &len, sizeof(len)); if (got_estate) state = 'E'; pool_write(frontend, &state, 1); } pool_flush(frontend); } if (pool_is_query_in_progress()) { node = pool_get_parse_tree(); query = pool_get_query_string(); if (pool_is_command_success()) { if (node) pool_at_command_success(frontend, backend); /* Memory cache enabled? */ if (cache_commit && pool_config->memory_cache_enabled) { /* * If we are doing extended query and the state is after * EXECUTE, then we can commit cache. We check latter * condition by looking at query_context->query_w_hex. This * check is necessary for certain frame work such as PHP PDO. * It sends Sync message right after PARSE and it produces * "Ready for query" message from backend. */ if (pool_is_doing_extended_query_message()) { if (session_context->query_context && session_context->query_context->query_state[MASTER_NODE_ID] == POOL_EXECUTE_COMPLETE) { pool_handle_query_cache(backend, session_context->query_context->query_w_hex, node, state); if (session_context->query_context->query_w_hex) pfree(session_context->query_context->query_w_hex); session_context->query_context->query_w_hex = NULL; } } else { if (MAJOR(backend) != PROTO_MAJOR_V3) { state = 'I'; /* XXX I don't think query cache works * with PROTO2 protocol */ } pool_handle_query_cache(backend, query, node, state); } } } /* * If PREPARE or extended query protocol commands caused error, remove * the temporary saved message. (except when ReadyForQuery() is called * during Parse() of extended queries) */ else { if ((pool_is_doing_extended_query_message() && session_context->query_context && session_context->query_context->query_state[MASTER_NODE_ID] != POOL_UNPARSED && session_context->uncompleted_message) || (!pool_is_doing_extended_query_message() && session_context->uncompleted_message && session_context->uncompleted_message->kind != 0)) { pool_add_sent_message(session_context->uncompleted_message); pool_remove_sent_message(session_context->uncompleted_message->kind, session_context->uncompleted_message->name); session_context->uncompleted_message = NULL; } } pool_unset_query_in_progress(); } if (!pool_is_doing_extended_query_message()) { if (!(node && IsA(node, PrepareStmt))) { pool_query_context_destroy(pool_get_session_context(false)->query_context); } } /* * Show ps idle status */ pool_ps_idle_display(backend); return POOL_CONTINUE; } /* * Close running transactions on standbys. */ static POOL_STATUS close_standby_transactions(POOL_CONNECTION * frontend, POOL_CONNECTION_POOL * backend) { int i; for (i = 0; i < NUM_BACKENDS; i++) { if (CONNECTION_SLOT(backend, i) && TSTATE(backend, i) == 'T' && BACKEND_INFO(i).backend_status == CON_UP && (MASTER_SLAVE ? PRIMARY_NODE_ID : REAL_MASTER_NODE_ID) != i) { per_node_statement_log(backend, i, "COMMIT"); if (do_command(frontend, CONNECTION(backend, i), "COMMIT", MAJOR(backend), MASTER_CONNECTION(backend)->pid, MASTER_CONNECTION(backend)->key, 0) != POOL_CONTINUE) ereport(ERROR, (errmsg("unable to close standby transactions"), errdetail("do_command returned DEADLOCK status"))); } } return POOL_CONTINUE; } POOL_STATUS ParseComplete(POOL_CONNECTION * frontend, POOL_CONNECTION_POOL * backend) { POOL_SESSION_CONTEXT *session_context; /* Get session context */ session_context = pool_get_session_context(false); if (!SL_MODE && session_context->uncompleted_message) { POOL_QUERY_CONTEXT *qc; pool_add_sent_message(session_context->uncompleted_message); qc = session_context->uncompleted_message->query_context; if (qc) pool_set_query_state(qc, POOL_PARSE_COMPLETE); session_context->uncompleted_message = NULL; } return SimpleForwardToFrontend('1', frontend, backend); } POOL_STATUS BindComplete(POOL_CONNECTION * frontend, POOL_CONNECTION_POOL * backend) { POOL_SESSION_CONTEXT *session_context; /* Get session context */ session_context = pool_get_session_context(false); if (!SL_MODE && session_context->uncompleted_message) { POOL_QUERY_CONTEXT *qc; pool_add_sent_message(session_context->uncompleted_message); qc = session_context->uncompleted_message->query_context; if (qc) pool_set_query_state(qc, POOL_BIND_COMPLETE); session_context->uncompleted_message = NULL; } return SimpleForwardToFrontend('2', frontend, backend); } POOL_STATUS CloseComplete(POOL_CONNECTION * frontend, POOL_CONNECTION_POOL * backend) { POOL_SESSION_CONTEXT *session_context; POOL_STATUS status; char kind = ' '; char *name = ""; /* Get session context */ session_context = pool_get_session_context(false); /* Send CloseComplete(3) to frontend before removing the target message */ status = SimpleForwardToFrontend('3', frontend, backend); /* Remove the target message */ if (SL_MODE) { POOL_PENDING_MESSAGE *pmsg; pmsg = pool_pending_message_pull_out(); if (pmsg) { /* Sanity check */ if (pmsg->type != POOL_CLOSE) { ereport(LOG, (errmsg("CloseComplete: pending messge was not Close request: %s", pool_pending_message_type_to_string(pmsg->type)))); } else { kind = pool_get_close_message_spec(pmsg); name = pool_get_close_message_name(pmsg); kind = kind == 'S' ? 'P' : 'B'; } pool_pending_message_free_pending_message(pmsg); } } else { if (session_context->uncompleted_message) { kind = session_context->uncompleted_message->kind; name = session_context->uncompleted_message->name; session_context->uncompleted_message = NULL; } else { ereport(ERROR, (errmsg("processing CloseComplete, uncompleted message not found"))); } } if (kind != ' ') { pool_remove_sent_message(kind, name); ereport(DEBUG1, (errmsg("CloseComplete: remove sent message. kind:%c, name:%s", kind, name))); if (pool_config->memory_cache_enabled) { pool_discard_temp_query_cache(pool_get_current_cache()); } } return status; } POOL_STATUS ParameterDescription(POOL_CONNECTION * frontend, POOL_CONNECTION_POOL * backend) { int len, len1 = 0; char *p = NULL; char *p1 = NULL; int sendlen; int i; POOL_SESSION_CONTEXT *session_context; int num_params, send_num_params, num_dmy; char kind = 't'; session_context = pool_get_session_context(false); /* only in replication mode and rewritten query */ if (!REPLICATION || !session_context->query_context->rewritten_query) return SimpleForwardToFrontend('t', frontend, backend); /* get number of parameters in original query */ num_params = session_context->query_context->num_original_params; pool_read(MASTER(backend), &len, sizeof(len)); len = ntohl(len); len -= sizeof(int32); len1 = len; /* number of parameters in rewritten query is just discarded */ pool_read(MASTER(backend), &num_dmy, sizeof(int16)); len -= sizeof(int16); p = pool_read2(MASTER(backend), len); if (p == NULL) ereport(ERROR, (errmsg("ParameterDescription. connection error"), errdetail("read from backend failed"))); p1 = palloc(len); memcpy(p1, p, len); for (i = 0; i < NUM_BACKENDS; i++) { if (VALID_BACKEND(i) && !IS_MASTER_NODE_ID(i)) { pool_read(CONNECTION(backend, i), &len, sizeof(len)); len = ntohl(len); len -= sizeof(int32); p = pool_read2(CONNECTION(backend, i), len); if (p == NULL) ereport(ERROR, (errmsg("ParameterDescription. connection error"), errdetail("read from backend no %d failed", i))); if (len != len1) ereport(DEBUG1, (errmsg("ParameterDescription. backends does not match"), errdetail("length does not match between backends master(%d) %d th backend(%d) kind:(%c)", len, i, len1, kind))); } } pool_write(frontend, &kind, 1); /* send back OIDs of parameters in original query and left are discarded */ len = sizeof(int16) + num_params * sizeof(int32); sendlen = htonl(len + sizeof(int32)); pool_write(frontend, &sendlen, sizeof(int32)); send_num_params = htons(num_params); pool_write(frontend, &send_num_params, sizeof(int16)); pool_write_and_flush(frontend, p1, num_params * sizeof(int32)); pfree(p1); return POOL_CONTINUE; } POOL_STATUS ErrorResponse3(POOL_CONNECTION * frontend, POOL_CONNECTION_POOL * backend) { POOL_STATUS ret; ret = SimpleForwardToFrontend('E', frontend, backend); if (ret != POOL_CONTINUE) return ret; if (!SL_MODE) raise_intentional_error_if_need(backend); return POOL_CONTINUE; } POOL_STATUS FunctionCall(POOL_CONNECTION * frontend, POOL_CONNECTION_POOL * backend) { char dummy[2]; int oid; int argn; int i; for (i = 0; i < NUM_BACKENDS; i++) { if (VALID_BACKEND(i)) { pool_write(CONNECTION(backend, i), "F", 1); } } /* dummy */ pool_read(frontend, dummy, sizeof(dummy)); for (i = 0; i < NUM_BACKENDS; i++) { if (VALID_BACKEND(i)) { pool_write(CONNECTION(backend, i), dummy, sizeof(dummy)); } } /* function object id */ pool_read(frontend, &oid, sizeof(oid)); for (i = 0; i < NUM_BACKENDS; i++) { if (VALID_BACKEND(i)) { pool_write(CONNECTION(backend, i), &oid, sizeof(oid)); } } /* number of arguments */ pool_read(frontend, &argn, sizeof(argn)); for (i = 0; i < NUM_BACKENDS; i++) { if (VALID_BACKEND(i)) { pool_write(CONNECTION(backend, i), &argn, sizeof(argn)); } } argn = ntohl(argn); for (i = 0; i < argn; i++) { int len; char *arg; /* length of each argument in bytes */ pool_read(frontend, &len, sizeof(len)); for (i = 0; i < NUM_BACKENDS; i++) { if (VALID_BACKEND(i)) { pool_write(CONNECTION(backend, i), &len, sizeof(len)); } } len = ntohl(len); /* argument value itself */ if ((arg = pool_read2(frontend, len)) == NULL) ereport(FATAL, (return_code(2), errmsg("failed to process function call"), errdetail("read from frontend failed"))); for (i = 0; i < NUM_BACKENDS; i++) { if (VALID_BACKEND(i)) { pool_write(CONNECTION(backend, i), arg, len); } } } for (i = 0; i < NUM_BACKENDS; i++) { if (VALID_BACKEND(i)) { pool_flush(CONNECTION(backend, i)); } } return POOL_CONTINUE; } POOL_STATUS ProcessFrontendResponse(POOL_CONNECTION * frontend, POOL_CONNECTION_POOL * backend) { char fkind; char *bufp = NULL; char *contents; POOL_STATUS status; int len = 0; /* Get session context */ pool_get_session_context(false); if (pool_read_buffer_is_empty(frontend) && frontend->no_forward != 0) return POOL_CONTINUE; /* Are we suspending reading from frontend? */ if (pool_is_suspend_reading_from_frontend()) return POOL_CONTINUE; pool_read(frontend, &fkind, 1); ereport(DEBUG5, (errmsg("processing frontend response"), errdetail("received kind '%c'(%02x) from frontend", fkind, fkind))); if (MAJOR(backend) == PROTO_MAJOR_V3) { if (pool_read(frontend, &len, sizeof(len)) < 0) ereport(ERROR, (errmsg("unable to process frontend response"), errdetail("failed to read message length from frontend. frontend abnormally exited"))); len = ntohl(len) - 4; if (len > 0) bufp = pool_read2(frontend, len); else if (len < 0) ereport(ERROR, (errmsg("frontend message length is less than 4 (kind: %c)", fkind))); } else { if (fkind != 'F') bufp = pool_read_string(frontend, &len, 0); } if (len > 0 && bufp == NULL) ereport(ERROR, (errmsg("unable to process frontend response"), errdetail("failed to read message from frontend. frontend abnormally exited"))); if (fkind != 'S' && pool_is_ignore_till_sync()) { /* * Flag setting for calling ProcessBackendResponse() in * pool_process_query(). */ if (!pool_is_query_in_progress()) pool_set_query_in_progress(); return POOL_CONTINUE; } pool_unset_doing_extended_query_message(); /* * Allocate buffer and copy the packet contents. Because inside these * protocol modules, pool_read2 maybe called and modify its buffer * contents. */ if (len > 0) { contents = palloc(len); memcpy(contents, bufp, len); } else { /* * Set dummy content if len <= 0. this happens only when protocol * version is 2. */ contents = palloc(1); memcpy(contents, "", 1); } switch (fkind) { POOL_QUERY_CONTEXT *query_context; char *query; Node *node; case 'X': /* Terminate */ if (contents) pfree(contents); if (pool_config->log_client_messages) ereport(LOG, (errmsg("Terminate message from frontend."))); ereport(DEBUG5, (errmsg("Frontend terminated"), errdetail("received message kind 'X' from frontend"))); return POOL_END; case 'Q': /* Query */ allow_close_transaction = 1; if (pool_config->log_client_messages) ereport(LOG, (errmsg("Query message from frontend."), errdetail("query: \"%s\"", contents))); status = SimpleQuery(frontend, backend, len, contents); break; case 'E': /* Execute */ allow_close_transaction = 1; pool_set_doing_extended_query_message(); if (!pool_is_query_in_progress() && !pool_is_ignore_till_sync()) pool_set_query_in_progress(); status = Execute(frontend, backend, len, contents); break; case 'P': /* Parse */ allow_close_transaction = 0; pool_set_doing_extended_query_message(); status = Parse(frontend, backend, len, contents); break; case 'B': /* Bind */ pool_set_doing_extended_query_message(); status = Bind(frontend, backend, len, contents); break; case 'C': /* Close */ pool_set_doing_extended_query_message(); if (!pool_is_query_in_progress() && !pool_is_ignore_till_sync()) pool_set_query_in_progress(); status = Close(frontend, backend, len, contents); break; case 'D': /* Describe */ pool_set_doing_extended_query_message(); status = Describe(frontend, backend, len, contents); break; case 'S': /* Sync */ if (pool_config->log_client_messages) ereport(LOG, (errmsg("Sync message from frontend."))); pool_set_doing_extended_query_message(); if (pool_is_ignore_till_sync()) pool_unset_ignore_till_sync(); if (SL_MODE) { POOL_PENDING_MESSAGE *msg; pool_unset_query_in_progress(); msg = pool_pending_message_create('S', 0, NULL); pool_pending_message_add(msg); pool_pending_message_free_pending_message(msg); } else if (!pool_is_query_in_progress()) pool_set_query_in_progress(); status = SimpleForwardToBackend(fkind, frontend, backend, len, contents); if (SL_MODE) { /* * From now on suspend to read from frontend until we receive * ready for query message from backend. */ pool_set_suspend_reading_from_frontend(); } break; case 'F': /* FunctionCall */ if (pool_config->log_client_messages) { int oid; memcpy(&oid, contents, sizeof(int)); ereport(LOG, (errmsg("FunctionCall message from frontend."), errdetail("oid: \"%d\"", ntohl(oid)))); } /* * Create dummy query context as if it were an INSERT. */ query_context = pool_init_query_context(); query = "INSERT INTO foo VALUES(1)"; MemoryContext old_context = MemoryContextSwitchTo(query_context->memory_context); node = get_dummy_insert_query_node(); pool_start_query(query_context, query, strlen(query) + 1, node); MemoryContextSwitchTo(old_context); pool_where_to_send(query_context, query_context->original_query, query_context->parse_tree); if (MAJOR(backend) == PROTO_MAJOR_V3) status = FunctionCall3(frontend, backend, len, contents); else status = FunctionCall(frontend, backend); break; case 'c': /* CopyDone */ case 'd': /* CopyData */ case 'f': /* CopyFail */ case 'H': /* Flush */ if (fkind == 'H' && pool_config->log_client_messages) ereport(LOG, (errmsg("Flush message from frontend."))); if (MAJOR(backend) == PROTO_MAJOR_V3) { if (fkind == 'H') { pool_set_doing_extended_query_message(); } status = SimpleForwardToBackend(fkind, frontend, backend, len, contents); /* * After flush message received, extended query mode should be * continued. */ if (fkind != 'H' && pool_is_doing_extended_query_message()) { pool_unset_doing_extended_query_message(); } break; } default: ereport(FATAL, (return_code(2), errmsg("unable to process frontend response"), errdetail("unknown message type %c(%02x)", fkind, fkind))); } if (contents) pfree(contents); if (status != POOL_CONTINUE) ereport(FATAL, (return_code(2), errmsg("unable to process frontend response"))); return status; } POOL_STATUS ProcessBackendResponse(POOL_CONNECTION * frontend, POOL_CONNECTION_POOL * backend, int *state, short *num_fields) { int status = POOL_CONTINUE; char kind; /* Get session context */ pool_get_session_context(false); if (pool_is_ignore_till_sync()) { if (pool_is_query_in_progress()) pool_unset_query_in_progress(); /* * Check if we have pending data in backend connection cache. If we * do, it is likely that a sync message has been sent to backend and * the backend replied back to us. So we need to process it. */ if (is_backend_cache_empty(backend)) { return POOL_CONTINUE; } } if (pool_is_skip_reading_from_backends()) { pool_unset_skip_reading_from_backends(); return POOL_CONTINUE; } read_kind_from_backend(frontend, backend, &kind); /* * Sanity check */ if (kind == 0) { ereport(FATAL, (return_code(2), errmsg("unable to process backend response"), errdetail("invalid message kind sent by backend connection"))); } ereport(DEBUG5, (errmsg("processing backend response"), errdetail("received kind '%c'(%02x) from backend", kind, kind))); if (MAJOR(backend) == PROTO_MAJOR_V3) { switch (kind) { case 'G': /* CopyInResponse */ status = CopyInResponse(frontend, backend); break; case 'S': /* ParameterStatus */ status = ParameterStatus(frontend, backend); break; case 'Z': /* ReadyForQuery */ ereport(DEBUG5, (errmsg("processing backend response"), errdetail("Ready For Query received"))); pool_unset_suspend_reading_from_frontend(); status = ReadyForQuery(frontend, backend, true, true); #ifdef DEBUG extern bool stop_now; if (stop_now) exit(0); #endif break; case '1': /* ParseComplete */ if (SL_MODE) { POOL_PENDING_MESSAGE *pmsg; pmsg = pool_pending_message_get_previous_message(); if (pmsg && pmsg->not_forward_to_frontend) { /* * parse_before_bind() was called. Do not foward the * parse complete message to frontend. */ ereport(DEBUG5, (errmsg("processing backend response"), errdetail("do not forward parse complete message to frontend"))); pool_discard_packet_contents(backend); pool_unset_query_in_progress(); pool_set_command_success(); status = POOL_CONTINUE; break; } } status = ParseComplete(frontend, backend); pool_set_command_success(); pool_unset_query_in_progress(); break; case '2': /* BindComplete */ status = BindComplete(frontend, backend); pool_set_command_success(); pool_unset_query_in_progress(); break; case '3': /* CloseComplete */ if (SL_MODE) { POOL_PENDING_MESSAGE *pmsg; pmsg = pool_pending_message_get_previous_message(); if (pmsg && pmsg->not_forward_to_frontend) { /* * parse_before_bind() was called. Do not foward the * close complete message to frontend. */ ereport(DEBUG5, (errmsg("processing backend response"), errdetail("do not forward close complete message to frontend"))); pool_discard_packet_contents(backend); /* * Remove pending message here because * read_kind_from_backend() did not do it. */ pmsg = pool_pending_message_pull_out(); pool_pending_message_free_pending_message(pmsg); if (pool_is_doing_extended_query_message()) pool_unset_query_in_progress(); pool_set_command_success(); status = POOL_CONTINUE; break; } } status = CloseComplete(frontend, backend); pool_set_command_success(); if (pool_is_doing_extended_query_message()) pool_unset_query_in_progress(); break; case 'E': /* ErrorResponse */ status = ErrorResponse3(frontend, backend); pool_unset_command_success(); if (TSTATE(backend, MASTER_SLAVE ? PRIMARY_NODE_ID : REAL_MASTER_NODE_ID) != 'I') { pool_set_failed_transaction(); /* Remove ongoing CRETAE/DROP temp tables */ pool_temp_tables_remove_pending(); } if (pool_is_doing_extended_query_message()) { pool_set_ignore_till_sync(); pool_unset_query_in_progress(); pool_unset_suspend_reading_from_frontend(); if (SL_MODE) pool_discard_except_sync_and_ready_for_query(frontend, backend); } break; case 'C': /* CommandComplete */ status = CommandComplete(frontend, backend, true); pool_set_command_success(); if (pool_is_doing_extended_query_message()) pool_unset_query_in_progress(); break; case 't': /* ParameterDescription */ status = ParameterDescription(frontend, backend); break; case 'I': /* EmptyQueryResponse */ status = CommandComplete(frontend, backend, false); /* * Empty query response message should be treated same as * Command complete message. When we receive the Command * complete message, we unset the query in progress flag if * operated in streaming replication mode. So we unset the * flag as well. See bug 190 for more details. */ if (pool_is_doing_extended_query_message()) pool_unset_query_in_progress(); break; case 'T': /* RowDescription */ status = SimpleForwardToFrontend(kind, frontend, backend); if (pool_is_doing_extended_query_message()) pool_unset_query_in_progress(); break; case 'n': /* NoData */ status = SimpleForwardToFrontend(kind, frontend, backend); if (pool_is_doing_extended_query_message()) pool_unset_query_in_progress(); break; case 's': /* PortalSuspended */ status = SimpleForwardToFrontend(kind, frontend, backend); if (pool_is_doing_extended_query_message()) pool_unset_query_in_progress(); break; default: status = SimpleForwardToFrontend(kind, frontend, backend); break; } } else { switch (kind) { case 'A': /* NotificationResponse */ status = NotificationResponse(frontend, backend); break; case 'B': /* BinaryRow */ status = BinaryRow(frontend, backend, *num_fields); break; case 'C': /* CompletedResponse */ status = CompletedResponse(frontend, backend); break; case 'D': /* AsciiRow */ status = AsciiRow(frontend, backend, *num_fields); break; case 'E': /* ErrorResponse */ status = ErrorResponse(frontend, backend); if (TSTATE(backend, MASTER_SLAVE ? PRIMARY_NODE_ID : REAL_MASTER_NODE_ID) != 'I') pool_set_failed_transaction(); break; case 'G': /* CopyInResponse */ status = CopyInResponse(frontend, backend); break; case 'H': /* CopyOutResponse */ status = CopyOutResponse(frontend, backend); break; case 'I': /* EmptyQueryResponse */ EmptyQueryResponse(frontend, backend); break; case 'N': /* NoticeResponse */ NoticeResponse(frontend, backend); break; case 'P': /* CursorResponse */ status = CursorResponse(frontend, backend); break; case 'T': /* RowDescription */ status = RowDescription(frontend, backend, num_fields); break; case 'V': /* FunctionResultResponse and * FunctionVoidResponse */ status = FunctionResultResponse(frontend, backend); break; case 'Z': /* ReadyForQuery */ status = ReadyForQuery(frontend, backend, true, true); break; default: ereport(FATAL, (return_code(1), errmsg("Unknown message type %c(%02x)", kind, kind))); } } /* * Do we receive ready for query while processing reset request? */ if (kind == 'Z' && frontend->no_forward && *state == 1) { *state = 0; } if (status != POOL_CONTINUE) ereport(FATAL, (return_code(2), errmsg("unable to process backend response for message kind '%c'", kind))); return status; } POOL_STATUS CopyInResponse(POOL_CONNECTION * frontend, POOL_CONNECTION_POOL * backend) { POOL_STATUS status; /* forward to the frontend */ if (MAJOR(backend) == PROTO_MAJOR_V3) { SimpleForwardToFrontend('G', frontend, backend); pool_flush(frontend); } else pool_write_and_flush(frontend, "G", 1); status = CopyDataRows(frontend, backend, 1); return status; } POOL_STATUS CopyOutResponse(POOL_CONNECTION * frontend, POOL_CONNECTION_POOL * backend) { POOL_STATUS status; /* forward to the frontend */ if (MAJOR(backend) == PROTO_MAJOR_V3) { SimpleForwardToFrontend('H', frontend, backend); pool_flush(frontend); } else pool_write_and_flush(frontend, "H", 1); status = CopyDataRows(frontend, backend, 0); return status; } POOL_STATUS CopyDataRows(POOL_CONNECTION * frontend, POOL_CONNECTION_POOL * backend, int copyin) { char *string = NULL; int len; int i; int copy_count; #ifdef DEBUG int j = 0; char buf[1024]; #endif copy_count = 0; for (;;) { if (copyin) { if (MAJOR(backend) == PROTO_MAJOR_V3) { char kind; char *contents = NULL; pool_read(frontend, &kind, 1); ereport(DEBUG5, (errmsg("copy data rows"), errdetail("read kind from frontend %c(%02x)", kind, kind))); pool_read(frontend, &len, sizeof(len)); len = ntohl(len) - 4; if (len > 0) contents = pool_read2(frontend, len); SimpleForwardToBackend(kind, frontend, backend, len, contents); /* CopyData? */ if (kind == 'd') { copy_count++; continue; } else { if (pool_config->log_client_messages && copy_count != 0) ereport(LOG, (errmsg("CopyData message from frontend."), errdetail("count: %d", copy_count))); if (kind == 'c' && pool_config->log_client_messages) ereport(LOG, (errmsg("CopyDone message from frontend."))); if (kind == 'f' && pool_config->log_client_messages) ereport(LOG, (errmsg("CopyFail message from frontend."))); ereport(DEBUG1, (errmsg("copy data rows"), errdetail("invalid copyin kind. expected 'd' got '%c'", kind))); break; } } else string = pool_read_string(frontend, &len, 1); } else { /* CopyOut */ if (MAJOR(backend) == PROTO_MAJOR_V3) { signed char kind; kind = pool_read_kind(backend); SimpleForwardToFrontend(kind, frontend, backend); /* CopyData? */ if (kind == 'd') continue; else break; } else { for (i = 0; i < NUM_BACKENDS; i++) { if (VALID_BACKEND(i)) { string = pool_read_string(CONNECTION(backend, i), &len, 1); } } } } if (string == NULL) ereport(FATAL, (errmsg("unable to copy data rows"), errdetail("cannot read string message from backend"))); #ifdef DEBUG strlcpy(buf, string, sizeof(buf)); ereport(DEBUG1, (errmsg("copy data rows"), errdetail("copy line %d %d bytes :%s:", j++, len, buf))); #endif if (copyin) { for (i = 0; i < NUM_BACKENDS; i++) { if (VALID_BACKEND(i)) { pool_write(CONNECTION(backend, i), string, len); } } } else pool_write(frontend, string, len); if (len == PROTO_MAJOR_V3) { /* end of copy? */ if (string[0] == '\\' && string[1] == '.' && string[2] == '\n') { break; } } } if (copyin) { for (i = 0; i < NUM_BACKENDS; i++) { if (VALID_BACKEND(i)) { pool_flush(CONNECTION(backend, i)); if (synchronize(CONNECTION(backend, i))) ereport(FATAL, (return_code(2), errmsg("unable to copy data rows"), errdetail("failed to synchronize"))); } } } else pool_flush(frontend); return POOL_CONTINUE; } /* * This function raises intentional error to make backends the same * transaction state. */ void raise_intentional_error_if_need(POOL_CONNECTION_POOL * backend) { int i; POOL_SESSION_CONTEXT *session_context; POOL_QUERY_CONTEXT *query_context; /* Get session context */ session_context = pool_get_session_context(false); query_context = session_context->query_context; if (MASTER_SLAVE && TSTATE(backend, PRIMARY_NODE_ID) == 'T' && PRIMARY_NODE_ID != MASTER_NODE_ID && query_context && is_select_query(query_context->parse_tree, query_context->original_query)) { pool_set_node_to_be_sent(query_context, PRIMARY_NODE_ID); if (pool_is_doing_extended_query_message()) { do_error_execute_command(backend, PRIMARY_NODE_ID, PROTO_MAJOR_V3); } else { do_error_command(CONNECTION(backend, PRIMARY_NODE_ID), MAJOR(backend)); } ereport(DEBUG1, (errmsg("raising intentional error"), errdetail("generating intentional error to sync backends transaction states"))); } if (REPLICATION && TSTATE(backend, REAL_MASTER_NODE_ID) == 'T' && !pool_config->replicate_select && query_context && is_select_query(query_context->parse_tree, query_context->original_query)) { for (i = 0; i < NUM_BACKENDS; i++) { /* * Send a syntax error query to all backends except the node which * the original query was sent. */ if (pool_is_node_to_be_sent(query_context, i)) continue; else pool_set_node_to_be_sent(query_context, i); if (VALID_BACKEND(i)) { /* * We must abort transaction to sync transaction state. If the * error was caused by an Execute message, we must send * invalid Execute message to abort transaction. * * Because extended query protocol ignores all messages before * receiving Sync message inside error state. */ if (pool_is_doing_extended_query_message()) { do_error_execute_command(backend, i, PROTO_MAJOR_V3); } else { do_error_command(CONNECTION(backend, i), MAJOR(backend)); } } } } } /*--------------------------------------------------- * Check various errors from backend. return values: * 0: no error * 1: deadlock detected * 2: serialization error detected * 3: query cancel * detected: 4 *--------------------------------------------------- */ static int check_errors(POOL_CONNECTION_POOL * backend, int backend_id) { /* * Check dead lock error on the master node and abort transactions on all * nodes if so. */ if (detect_deadlock_error(CONNECTION(backend, backend_id), MAJOR(backend)) == SPECIFIED_ERROR) return 1; /*----------------------------------------------------------------------------------- * Check serialization failure error and abort * transactions on all nodes if so. Otherwise we allow * data inconsistency among DB nodes. See following * scenario: (M:master, S:slave) * * M:S1:BEGIN; * M:S2:BEGIN; * S:S1:BEGIN; * S:S2:BEGIN; * M:S1:SET TRANSACTION ISOLATION LEVEL SERIALIZABLE; * M:S2:SET TRANSACTION ISOLATION LEVEL SERIALIZABLE; * S:S1:SET TRANSACTION ISOLATION LEVEL SERIALIZABLE; * S:S2:SET TRANSACTION ISOLATION LEVEL SERIALIZABLE; * M:S1:UPDATE t1 SET i = i + 1; * S:S1:UPDATE t1 SET i = i + 1; * M:S2:UPDATE t1 SET i = i + 1; <-- blocked * S:S1:COMMIT; * M:S1:COMMIT; * M:S2:ERROR: could not serialize access due to concurrent update * S:S2:UPDATE t1 SET i = i + 1; <-- success in UPDATE and data becomes inconsistent! *----------------------------------------------------------------------------------- */ if (detect_serialization_error(CONNECTION(backend, backend_id), MAJOR(backend), true) == SPECIFIED_ERROR) return 2; /*------------------------------------------------------------------------------- * check "SET TRANSACTION ISOLATION LEVEL must be called before any query" error. * This happens in following scenario: * * M:S1:BEGIN; * S:S1:BEGIN; * M:S1:SELECT 1; <-- only sent to MASTER * M:S1:SET TRANSACTION ISOLATION LEVEL SERIALIZABLE; * S:S1:SET TRANSACTION ISOLATION LEVEL SERIALIZABLE; * M: <-- error * S: <-- ok since no previous SELECT is sent. kind mismatch error occurs! *------------------------------------------------------------------------------- */ if (detect_active_sql_transaction_error(CONNECTION(backend, backend_id), MAJOR(backend)) == SPECIFIED_ERROR) return 3; /* check query cancel error */ if (detect_query_cancel_error(CONNECTION(backend, backend_id), MAJOR(backend)) == SPECIFIED_ERROR) return 4; return 0; } static void generate_error_message(char *prefix, int specific_error, char *query) { POOL_SESSION_CONTEXT *session_context; session_context = pool_get_session_context(true); if (!session_context) return; static char *error_messages[] = { "received deadlock error message from master node. query: %s", "received serialization failure error message from master node. query: %s", "received SET TRANSACTION ISOLATION LEVEL must be called before any query error. query: %s", "received query cancel error message from master node. query: %s" }; String *msg; if (specific_error < 1 || specific_error > sizeof(error_messages) / sizeof(char *)) { ereport(LOG, (errmsg("generate_error_message: invalid specific_error: %d", specific_error))); return; } specific_error--; msg = init_string(prefix); string_append_char(msg, error_messages[specific_error]); ereport(LOG, (errmsg(msg->data, query))); free_string(msg); } /* * Make per DB node statement log */ void per_node_statement_log(POOL_CONNECTION_POOL * backend, int node_id, char *query) { POOL_CONNECTION_POOL_SLOT *slot = backend->slots[node_id]; if (pool_config->log_per_node_statement) ereport(LOG, (errmsg("DB node id: %d backend pid: %d statement: %s", node_id, ntohl(slot->pid), query))); } /* * Check kind and produce error message * All data read in this function is returned to stream. */ void per_node_error_log(POOL_CONNECTION_POOL * backend, int node_id, char *query, char *prefix, bool unread) { POOL_CONNECTION_POOL_SLOT *slot = backend->slots[node_id]; char *message; char kind; pool_read(CONNECTION(backend, node_id), &kind, sizeof(kind)); pool_unread(CONNECTION(backend, node_id), &kind, sizeof(kind)); if (kind != 'E' && kind != 'N') { return; } if (pool_extract_error_message(true, CONNECTION(backend, node_id), MAJOR(backend), unread, &message) == 1) { ereport(LOG, (errmsg("%s: DB node id: %d backend pid: %d statement: \"%s\" message: \"%s\"", prefix, node_id, ntohl(slot->pid), query, message))); pfree(message); } } /* * Send parse message to primary/master node and wait for reply if particular * message is not yet parsed on the primary/master node but parsed on other * node. Caller must provide the parse message data as "message". */ static POOL_STATUS parse_before_bind(POOL_CONNECTION * frontend, POOL_CONNECTION_POOL * backend, POOL_SENT_MESSAGE * message, POOL_SENT_MESSAGE * bind_message) { int i; int len = message->len; char kind = '\0'; char *contents = message->contents; bool parse_was_sent = false; bool backup[MAX_NUM_BACKENDS]; POOL_QUERY_CONTEXT *qc = message->query_context; memcpy(backup, qc->where_to_send, sizeof(qc->where_to_send)); if (SL_MODE) { if (message->kind == 'P' && qc->where_to_send[PRIMARY_NODE_ID] == 0) { POOL_PENDING_MESSAGE *pmsg; POOL_QUERY_CONTEXT *new_qc; char message_body[1024]; int offset; int message_len; /* * we are in streaming replication mode and the parse message has * not been sent to primary yet */ /* Prepare modified query context */ new_qc = pool_query_context_shallow_copy(qc); memset(new_qc->where_to_send, 0, sizeof(new_qc->where_to_send)); new_qc->where_to_send[PRIMARY_NODE_ID] = 1; new_qc->virtual_master_node_id = PRIMARY_NODE_ID; new_qc->load_balance_node_id = PRIMARY_NODE_ID; /* * Before sending the parse message to the primary, we need to * close the named statement. Otherwise we will get an error from * backend if the named statement already exists. This could * happend if parse_before_bind is called with a bind message * using same named statement. If the named statement does not * exist, it's fine. PostgreSQL just ignores a request trying to * close a non-existing statement. If the statement is unnamed * one, we do not need it because unnamed statement can be * overwritten anytime. */ message_body[0] = 'S'; offset = strlen(bind_message->contents) + 1; ereport(DEBUG1, (errmsg("parse before bind"), errdetail("close statement: %s", bind_message->contents + offset))); if (bind_message->contents[offset] != '\0') { message_len = 1 + strlen(bind_message->contents + offset) + 1; StrNCpy(message_body + 1, bind_message->contents + offset, sizeof(message_body) - 1); pool_extended_send_and_wait(qc, "C", message_len, message_body, 1, PRIMARY_NODE_ID, false); /* Add pending message */ pmsg = pool_pending_message_create('C', message_len, message_body); pmsg->not_forward_to_frontend = true; pool_pending_message_dest_set(pmsg, new_qc); pool_pending_message_add(pmsg); pool_pending_message_free_pending_message(pmsg); } /* Send parse message to primary node */ ereport(DEBUG1, (errmsg("parse before bind"), errdetail("waiting for primary completing parse"))); pool_extended_send_and_wait(qc, "P", len, contents, 1, PRIMARY_NODE_ID, false); /* Add pending message */ pmsg = pool_pending_message_create('P', len, contents); pmsg->not_forward_to_frontend = true; pool_pending_message_dest_set(pmsg, new_qc); pool_pending_message_add(pmsg); pool_pending_message_free_pending_message(pmsg); /* Replace the query context of bind message */ bind_message->query_context = new_qc; #ifdef NOT_USED /* * XXX pool_remove_sent_message() will pfree memory allocated by "contents". */ /* Remove old sent message */ pool_remove_sent_message('P', contents); /* Create and add sent message of this parse message */ msg = pool_create_sent_message('P', len, contents, 0, contents, new_qc); pool_add_sent_message(msg); #endif /* Replace the query context of parse message */ message->query_context = new_qc; return POOL_CONTINUE; } else { ereport(DEBUG1, (errmsg("parse before bind"), errdetail("no need to re-send parse"))); return POOL_CONTINUE; } } else { /* expect to send to master node only */ for (i = 0; i < NUM_BACKENDS; i++) { if (qc->where_to_send[i] && statecmp(qc->query_state[i], POOL_PARSE_COMPLETE) < 0) { ereport(DEBUG1, (errmsg("parse before bind"), errdetail("waiting for backend %d completing parse", i))); pool_extended_send_and_wait(qc, "P", len, contents, 1, i, false); } else { qc->where_to_send[i] = 0; } } } for (i = 0; i < NUM_BACKENDS; i++) { if (qc->where_to_send[i]) { parse_was_sent = true; break; } } if (!SL_MODE && parse_was_sent) { pool_set_query_in_progress(); while (kind != '1') { PG_TRY(); { read_kind_from_backend(frontend, backend, &kind); pool_discard_packet_contents(backend); } PG_CATCH(); { memcpy(qc->where_to_send, backup, sizeof(backup)); PG_RE_THROW(); } PG_END_TRY(); } } memcpy(qc->where_to_send, backup, sizeof(backup)); return POOL_CONTINUE; } /* * Find victim nodes by "decide by majority" rule and returns array * of victim node ids. If no victim is found, return NULL. * * Arguments: * ntuples: Array of number of affected tuples. -1 represents down node. * nmembers: Number of elements in ntuples. * master_node: The master node id. Less than 0 means ignore this parameter. * number_of_nodes: Number of elements in victim nodes array. * * Note: If no one wins and master_node >= 0, winner would be the * master and other nodes who has same number of tuples as the master. * * Caution: Returned victim node array is allocated in static memory * of this function. Subsequent calls to this function will overwrite * the memory. */ static int * find_victim_nodes(int *ntuples, int nmembers, int master_node, int *number_of_nodes) { static int victim_nodes[MAX_NUM_BACKENDS]; static int votes[MAX_NUM_BACKENDS]; int maxvotes; int majority_ntuples; int me; int cnt; int healthy_nodes; int i, j; healthy_nodes = 0; *number_of_nodes = 0; maxvotes = 0; majority_ntuples = 0; for (i = 0; i < nmembers; i++) { me = ntuples[i]; /* Health node? */ if (me < 0) { votes[i] = -1; continue; } healthy_nodes++; votes[i] = 1; for (j = 0; j < nmembers; j++) { if (i != j && me == ntuples[j]) { votes[i]++; if (votes[i] > maxvotes) { maxvotes = votes[i]; majority_ntuples = me; } } } } /* Everyone is different */ if (maxvotes == 1) { /* Master node is specified? */ if (master_node < 0) return NULL; /* * If master node is specified, let it and others who has same ntuples * win. */ majority_ntuples = ntuples[master_node]; } else { /* Find number of majority */ cnt = 0; for (i = 0; i < nmembers; i++) { if (votes[i] == maxvotes) { cnt++; } } if (cnt <= healthy_nodes / 2.0) { /* No one wins */ /* Master node is specified? */ if (master_node < 0) return NULL; /* * If master node is specified, let it and others who has same * ntuples win. */ majority_ntuples = ntuples[master_node]; } } /* Make victim nodes list */ for (i = 0; i < nmembers; i++) { if (ntuples[i] >= 0 && ntuples[i] != majority_ntuples) { victim_nodes[(*number_of_nodes)++] = i; } } return victim_nodes; } /* * flatten_set_variable_args * Given a parsenode List as emitted by the grammar for SET, * convert to the flat string representation used by GUC. * * We need to be told the name of the variable the args are for, because * the flattening rules vary (ugh). * * The result is NULL if args is NIL (ie, SET ... TO DEFAULT), otherwise * a palloc'd string. */ static char * flatten_set_variable_args(const char *name, List *args) { StringInfoData buf; ListCell *l; /* Fast path if just DEFAULT */ if (args == NIL) return NULL; initStringInfo(&buf); /* * Each list member may be a plain A_Const node, or an A_Const within a * TypeCast; the latter case is supported only for ConstInterval arguments * (for SET TIME ZONE). */ foreach(l, args) { Node *arg = (Node *) lfirst(l); char *val; A_Const *con; if (l != list_head(args)) appendStringInfoString(&buf, ", "); if (IsA(arg, TypeCast)) { TypeCast *tc = (TypeCast *) arg; arg = tc->arg; } if (!IsA(arg, A_Const)) elog(ERROR, "unrecognized node type: %d", (int) nodeTag(arg)); con = (A_Const *) arg; switch (nodeTag(&con->val)) { case T_Integer: appendStringInfo(&buf, "%d", intVal(&con->val)); break; case T_Float: /* represented as a string, so just copy it */ appendStringInfoString(&buf, strVal(&con->val)); break; case T_String: val = strVal(&con->val); appendStringInfoString(&buf, val); break; default: ereport(ERROR, (errmsg("unrecognized node type: %d", (int) nodeTag(&con->val)))); break; } } return buf.data; } #ifdef NOT_USED /* Called when sync message is received. * Wait till ready for query received. */ static void pool_wait_till_ready_for_query(POOL_CONNECTION_POOL * backend) { char kind; int len; int poplen; char *buf; int i; for (i = 0; i < NUM_BACKENDS; i++) { if (VALID_BACKEND(i)) { for (;;) { pool_read(CONNECTION(backend, i), &kind, sizeof(kind)); ereport(DEBUG5, (errmsg("pool_wait_till_ready_for_query: kind: %c", kind))); pool_push(CONNECTION(backend, i), &kind, sizeof(kind)); pool_read(CONNECTION(backend, i), &len, sizeof(len)); pool_push(CONNECTION(backend, i), &len, sizeof(len)); if ((ntohl(len) - sizeof(len)) > 0) { buf = pool_read2(CONNECTION(backend, i), ntohl(len) - sizeof(len)); pool_push(CONNECTION(backend, i), buf, ntohl(len) - sizeof(len)); } if (kind == 'Z') /* Ready for query? */ { pool_pop(CONNECTION(backend, i), &poplen); ereport(DEBUG5, (errmsg("pool_wait_till_ready_for_query: backend:%d ready for query found. buffer length:%d", i, CONNECTION(backend, i)->len))); break; } } } } } #endif /* * Called when error response received in streaming replication mode and doing * extended query. Remove all pending messages and backend message buffer data * except POOL_SYNC pending message and ready for query. If sync message is * not received yet, continue to read data from frontend until a sync message * is read. */ static void pool_discard_except_sync_and_ready_for_query(POOL_CONNECTION * frontend, POOL_CONNECTION_POOL * backend) { POOL_PENDING_MESSAGE *pmsg; int i; if (!pool_is_doing_extended_query_message() || !SL_MODE) return; /* * Check to see if we aready received a sync message. If not, call * ProcessFrontendResponse() to get the sync message from client. */ pmsg = pool_pending_message_get(POOL_SYNC); if (pmsg == NULL) { char kind; int len; POOL_PENDING_MESSAGE *msg; char *contents = NULL; for (;;) { pool_read(frontend, &kind, sizeof(kind)); pool_read(frontend, &len, sizeof(len)); len = ntohl(len) - sizeof(len); if (len > 0) contents = pool_read2(frontend, len); if (kind == 'S') { msg = pool_pending_message_create('S', 0, NULL); pool_pending_message_add(msg); pool_pending_message_free_pending_message(msg); SimpleForwardToBackend(kind, frontend, backend, len, contents); break; } } } else pool_pending_message_free_pending_message(pmsg); /* Remove all pending messages except sync message */ do { pmsg = pool_pending_message_head_message(); if (pmsg && pmsg->type == POOL_SYNC) { ereport(DEBUG1, (errmsg("Process backend response: sync pending message found after receiving error response"))); pool_unset_ignore_till_sync(); pool_pending_message_free_pending_message(pmsg); break; } pool_pending_message_free_pending_message(pmsg); pmsg = pool_pending_message_pull_out(); pool_pending_message_free_pending_message(pmsg); } while (pmsg); pool_pending_message_reset_previous_message(); /* Discard read buffer execpt "Ready for query" */ for (i = 0; i < NUM_BACKENDS; i++) { if (VALID_BACKEND(i)) { char kind; int len; int sts; while (!pool_read_buffer_is_empty(CONNECTION(backend, i))) { sts = pool_read(CONNECTION(backend, i), &kind, sizeof(kind)); if (sts < 0 || kind == '\0') { ereport(DEBUG1, (errmsg("pool_discard_except_sync_and_ready_for_query: EOF detected while reading from backend: %d buffer length: %d sts: %d", i, CONNECTION(backend, i)->len, sts))); pool_unread(CONNECTION(backend, i), &kind, sizeof(kind)); break; } if (kind == 'Z') /* Ready for query? */ { pool_unread(CONNECTION(backend, i), &kind, sizeof(kind)); ereport(DEBUG1, (errmsg("pool_discard_except_sync_and_ready_for_query: Ready for query found. backend:%d", i))); break; } else { /* Read and discard packet */ pool_read(CONNECTION(backend, i), &len, sizeof(len)); if ((ntohl(len) - sizeof(len)) > 0) { pool_read2(CONNECTION(backend, i), ntohl(len) - sizeof(len)); } ereport(DEBUG1, (errmsg("pool_discard_except_sync_and_ready_for_query: discarding packet %c (len:%lu) of backend:%d", kind, ntohl(len) - sizeof(len), i))); } } } } } /* * Handle misc treatment when a command successfully completed. * Preconditions: query is in progress. The command is succeeded. */ void pool_at_command_success(POOL_CONNECTION * frontend, POOL_CONNECTION_POOL * backend) { Node *node; char *query; /* Sanity checks */ if (!pool_is_query_in_progress()) { ereport(ERROR, (errmsg("pool_at_command_success: query is not in progress"))); } if (!pool_is_command_success()) { ereport(ERROR, (errmsg("pool_at_command_success: command did not succeed"))); } node = pool_get_parse_tree(); if (!node) { ereport(ERROR, (errmsg("pool_at_command_success: no parse tree found"))); } query = pool_get_query_string(); if (query == NULL) { ereport(ERROR, (errmsg("pool_at_command_success: no query found"))); } /* * If the query was BEGIN/START TRANSACTION, clear the history that we had * a writing command in the transaction and forget the transaction * isolation level. * * XXX If BEGIN is received while we are already in an explicit * transaction, the command *successes* (just with a NOTICE message). In * this case we lose "writing_transaction" etc. info. */ if (is_start_transaction_query(node)) { if (pool_config->disable_load_balance_on_write != DLBOW_TRANS_TRANSACTION) pool_unset_writing_transaction(); pool_unset_failed_transaction(); pool_unset_transaction_isolation(); } /* * If the query was COMMIT/ABORT, clear the history that we had a writing * command in the transaction and forget the transaction isolation level. * This is necessary if succeeding transaction is not an explicit one. */ else if (is_commit_or_rollback_query(node)) { if (pool_config->disable_load_balance_on_write != DLBOW_TRANS_TRANSACTION) pool_unset_writing_transaction(); pool_unset_failed_transaction(); pool_unset_transaction_isolation(); } /* * SET TRANSACTION ISOLATION LEVEL SERIALIZABLE or SET SESSION * CHARACTERISTICS AS TRANSACTION ISOLATION LEVEL SERIALIZABLE, remember * it. */ else if (is_set_transaction_serializable(node)) { pool_set_transaction_isolation(POOL_SERIALIZABLE); } /* * If 2PC commands has been executed, automatically close transactions on * standbys if there is any open transaction since 2PC commands close * transaction on primary. */ else if (is_2pc_transaction_query(node)) { close_standby_transactions(frontend, backend); } else if (!is_select_query(node, query) || pool_has_function_call(node)) { /* * If the query was not READ SELECT, and we are in an explicit * transaction or disable_load_balance_on_write is 'ALWAYS', remember * that we had a write query in this transaction. */ if (TSTATE(backend, MASTER_SLAVE ? PRIMARY_NODE_ID : REAL_MASTER_NODE_ID) == 'T' || pool_config->disable_load_balance_on_write == DLBOW_ALWAYS) { /* * However, if the query is "SET TRANSACTION READ ONLY" or its * variant, don't set it. */ if (!pool_is_transaction_read_only(node)) { ereport(DEBUG1, (errmsg("not SET TRANSACTION READ ONLY"))); pool_set_writing_transaction(); } } /* * If the query was CREATE TEMP TABLE, discard temp table relcache * because we might have had persistent table relation cache which has * table name as the temp table. */ if (IsA(node, CreateStmt)) { CreateStmt *create_table_stmt = (CreateStmt *) node; if (create_table_stmt->relation->relpersistence == 't') discard_temp_table_relcache(); } } } pgpool-II-4.1.4/src/protocol/CommandComplete.c0000664000175000017500000003357213730350127016120 00000000000000/* -*-pgsql-c-*- */ /* * $Header$ * * pgpool: a language independent connection pool server for PostgreSQL * written by Tatsuo Ishii * * Copyright (c) 2003-2019 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 file contains modules which process the "Command Complete" and "Empty * query response" message sent from backend. The main function is * "CommandComplete". *--------------------------------------------------------------------- */ #include #include #include "pool.h" #include "protocol/pool_proto_modules.h" #include "parser/pg_config_manual.h" #include "parser/pool_string.h" #include "pool_config.h" #include "context/pool_session_context.h" #include "context/pool_query_context.h" #include "utils/elog.h" #include "utils/palloc.h" #include "utils/memutils.h" #include "utils/pool_stream.h" static int extract_ntuples(char *message); static POOL_STATUS handle_mismatch_tuples(POOL_CONNECTION * frontend, POOL_CONNECTION_POOL * backend, char *packet, int packetlen, bool command_complete); static int foward_command_complete(POOL_CONNECTION * frontend, char *packet, int packetlen); static int foward_empty_query(POOL_CONNECTION * frontend, char *packet, int packetlen); static int foward_packet_to_frontend(POOL_CONNECTION * frontend, char kind, char *packet, int packetlen); POOL_STATUS CommandComplete(POOL_CONNECTION * frontend, POOL_CONNECTION_POOL * backend, bool command_complete) { int len, len1; char *p, *p1; int i; POOL_SESSION_CONTEXT *session_context; POOL_CONNECTION *con; p1 = NULL; len1 = 0; /* Get session context */ session_context = pool_get_session_context(false); /* * Handle misc process which is neccessary when query context exists. */ if (session_context->query_context != NULL && (!SL_MODE || (SL_MODE && !pool_is_doing_extended_query_message()))) handle_query_context(backend); /* * If operated in streaming replication mode and doing an extended query, * read backend message according to the query context. Also we set the * transaction state at this point. */ if (SL_MODE && pool_is_doing_extended_query_message()) { p1 = NULL; for (i = 0; i < NUM_BACKENDS; i++) { if (VALID_BACKEND(i)) { con = CONNECTION(backend, i); if (pool_read(con, &len, sizeof(len)) < 0) { if (p1 != NULL) pfree(p1); return POOL_END; } len = ntohl(len); len -= 4; len1 = len; p = pool_read2(con, len); if (p == NULL) { if (p1 != NULL) pfree(p1); return POOL_END; } if (p1 != NULL) pfree(p1); p1 = palloc(len); memcpy(p1, p, len); if (session_context->query_context && session_context->query_context->parse_tree && is_start_transaction_query(session_context->query_context->parse_tree)) TSTATE(backend, i) = 'T'; /* we are inside a transaction */ { ereport(DEBUG1, (errmsg("processing command complete"), errdetail("set transaction state to T"))); } } } } /* * Otherwise just read from master node. */ else { con = MASTER(backend); if (pool_read(con, &len, sizeof(len)) < 0) return POOL_END; len = ntohl(len); len -= 4; len1 = len; p = pool_read2(con, len); if (p == NULL) return POOL_END; p1 = palloc(len); memcpy(p1, p, len); } /* * If operated in streaming replication mode and extended query mode, just * forward the packet to frontend and we are done. Otherwise, we need to * do mismatch tuples process (forwarding to frontend is done in * handle_mismatch_tuples(). */ if (SL_MODE && pool_is_doing_extended_query_message()) { int status; if (p1 == NULL) { elog(WARNING, "CommandComplete: expected p1 is not NULL"); return POOL_END; } if (command_complete) status = foward_command_complete(frontend, p1, len1); else status = foward_empty_query(frontend, p1, len1); if (status < 0) return POOL_END; } else { if (handle_mismatch_tuples(frontend, backend, p1, len1, command_complete) != POOL_CONTINUE) return POOL_END; } /* Save the received result to buffer for each kind */ if (pool_config->memory_cache_enabled) { if (pool_is_cache_safe() && !pool_is_cache_exceeded()) { memqcache_register('C', frontend, p1, len1); } /* * If we are in streaming replication mode and we are doing extended * query, register query cache now. */ if (SL_MODE && pool_is_doing_extended_query_message()) { char *query; Node *node; char state; if (session_context->query_context == NULL) { elog(WARNING, "expected query_contex is not NULL"); return POOL_END; } query = session_context->query_context->query_w_hex; node = pool_get_parse_tree(); state = TSTATE(backend, MASTER_NODE_ID); pool_handle_query_cache(backend, query, node, state); } } pfree(p1); if (pool_is_doing_extended_query_message() && pool_is_query_in_progress()) { pool_set_query_state(session_context->query_context, POOL_EXECUTE_COMPLETE); } /* * If we are in streaming replication mode and we are doing extended * query, reset query in progress flag and prevoius pending message. */ if (SL_MODE && pool_is_doing_extended_query_message()) { pool_at_command_success(frontend, backend); pool_unset_query_in_progress(); pool_pending_message_reset_previous_message(); if (session_context->query_context == NULL) { elog(WARNING, "At command complete there's no query context"); } else { /* * Destroy query context if it is not referenced from sent * messages and pending messages except bound to named statements * or portals. Named statements and portals should remain until * they are explicitly closed. */ if (can_query_context_destroy(session_context->query_context)) { POOL_SENT_MESSAGE * msg = pool_get_sent_message_by_query_context(session_context->query_context); if (!msg || (msg && *msg->name == '\0')) { pool_zap_query_context_in_sent_messages(session_context->query_context); pool_query_context_destroy(session_context->query_context); } } } } return POOL_CONTINUE; } /* * Handle misc process which is neccessary when query context exists. */ void handle_query_context(POOL_CONNECTION_POOL * backend) { POOL_SESSION_CONTEXT *session_context; Node *node; /* Get session context */ session_context = pool_get_session_context(false); node = session_context->query_context->parse_tree; if (IsA(node, PrepareStmt)) { if (session_context->uncompleted_message) { pool_add_sent_message(session_context->uncompleted_message); session_context->uncompleted_message = NULL; } } else if (IsA(node, DeallocateStmt)) { char *name; name = ((DeallocateStmt *) node)->name; if (name == NULL) { pool_remove_sent_messages('Q'); pool_remove_sent_messages('P'); } else { pool_remove_sent_message('Q', name); pool_remove_sent_message('P', name); } } else if (IsA(node, DiscardStmt)) { DiscardStmt *stmt = (DiscardStmt *) node; if (stmt->target == DISCARD_PLANS) { pool_remove_sent_messages('Q'); pool_remove_sent_messages('P'); } else if (stmt->target == DISCARD_ALL) { pool_clear_sent_message_list(); } } /* * JDBC driver sends "BEGIN" query internally if setAutoCommit(false). * But it does not send Sync message after "BEGIN" query. In extended * query protocol, PostgreSQL returns ReadyForQuery when a client sends * Sync message. Problem is, pgpool can't know the transaction state * without receiving ReadyForQuery. So we remember that we need to send * Sync message internally afterward, whenever we receive BEGIN in * extended protocol. */ else if (IsA(node, TransactionStmt)) { TransactionStmt *stmt = (TransactionStmt *) node; if (stmt->kind == TRANS_STMT_BEGIN || stmt->kind == TRANS_STMT_START) { int i; for (i = 0; i < NUM_BACKENDS; i++) { if (!VALID_BACKEND(i)) continue; TSTATE(backend, i) = 'T'; } if (pool_config->disable_load_balance_on_write != DLBOW_TRANS_TRANSACTION) pool_unset_writing_transaction(); pool_unset_failed_transaction(); pool_unset_transaction_isolation(); } else if (stmt->kind == TRANS_STMT_COMMIT) { /* Commit ongoing CRETAE/DROP temp table status */ pool_temp_tables_commit_pending(); } else if (stmt->kind == TRANS_STMT_ROLLBACK) { /* Remove ongoing CRETAE/DROP temp table status */ pool_temp_tables_remove_pending(); } } else if (IsA(node, CreateStmt)) { CreateStmt *stmt = (CreateStmt *) node; POOL_TEMP_TABLE_STATE state; /* Is this a temporary table? */ if (stmt->relation->relpersistence == 't') { if (TSTATE(backend, MASTER_NODE_ID ) == 'T') /* Are we inside a transaction? */ { state = TEMP_TABLE_CREATING; } else { state = TEMP_TABLE_CREATE_COMMITTED; } ereport(DEBUG1, (errmsg("Creating temp table: %s. commit status: %d", stmt->relation->relname, state))); pool_temp_tables_add(stmt->relation->relname, state); } } else if (IsA(node, DropStmt)) { DropStmt *stmt = (DropStmt *) node; POOL_TEMP_TABLE_STATE state; if (stmt->removeType == OBJECT_TABLE) { /* Loop through stmt->objects */ ListCell *cell; ListCell *next; if (TSTATE(backend, MASTER_NODE_ID ) == 'T') /* Are we inside a transaction? */ { state = TEMP_TABLE_DROPPING; } else { state = TEMP_TABLE_DROP_COMMITTED; } for (cell = list_head(session_context->temp_tables); cell; cell = next) { char *tablename = (char *)lfirst(cell); ereport(DEBUG1, (errmsg("Dropping temp table: %s", tablename))); pool_temp_tables_delete(tablename, state); next = lnext(cell); } } } } /* * Extract the number of tuples from CommandComplete message */ static int extract_ntuples(char *message) { char *rows; if ((rows = strstr(message, "UPDATE")) || (rows = strstr(message, "DELETE"))) rows += 7; else if ((rows = strstr(message, "INSERT"))) { rows += 7; while (*rows && *rows != ' ') rows++; } else return 0; return atoi(rows); } /* * Handle mismatch tuples */ static POOL_STATUS handle_mismatch_tuples(POOL_CONNECTION * frontend, POOL_CONNECTION_POOL * backend, char *packet, int packetlen, bool command_complete) { POOL_SESSION_CONTEXT *session_context; int rows; int i; int len; char *p; /* Get session context */ session_context = pool_get_session_context(false); rows = extract_ntuples(packet); /* * Save number of affected tuples of master node. */ session_context->ntuples[MASTER_NODE_ID] = rows; for (i = 0; i < NUM_BACKENDS; i++) { if (!IS_MASTER_NODE_ID(i)) { if (!VALID_BACKEND(i)) { session_context->ntuples[i] = -1; continue; } pool_read(CONNECTION(backend, i), &len, sizeof(len)); len = ntohl(len); len -= 4; p = pool_read2(CONNECTION(backend, i), len); if (p == NULL) return POOL_END; if (len != packetlen) { ereport(DEBUG1, (errmsg("processing command complete"), errdetail("length does not match between backends master(%d) %d th backend(%d)", len, i, packetlen))); } int n = extract_ntuples(p); /* * Save number of affected tuples. */ session_context->ntuples[i] = n; if (rows != n) { /* * Remember that we have different number of UPDATE/DELETE * affected tuples in backends. */ session_context->mismatch_ntuples = true; } } } if (session_context->mismatch_ntuples) { char msgbuf[128]; String *msg = init_string("pgpool detected difference of the number of inserted, updated or deleted tuples. Possible last query was: \""); string_append_char(msg, query_string_buffer); string_append_char(msg, "\""); pool_send_error_message(frontend, MAJOR(backend), "XX001", msg->data, "", "check data consistency between master and other db node", __FILE__, __LINE__); ereport(LOG, (errmsg("%s", msg->data))); free_string(msg); msg = init_string("CommandComplete: Number of affected tuples are:"); for (i = 0; i < NUM_BACKENDS; i++) { snprintf(msgbuf, sizeof(msgbuf), " %d", session_context->ntuples[i]); string_append_char(msg, msgbuf); } ereport(LOG, (errmsg("processing command complete"), errdetail("%s", msg->data))); free_string(msg); } else { if (command_complete) { if (foward_command_complete(frontend, packet, packetlen) < 0) return POOL_END; } else { if (foward_empty_query(frontend, packet, packetlen) < 0) return POOL_END; } } return POOL_CONTINUE; } /* * Forward Command complete packet to frontend */ static int foward_command_complete(POOL_CONNECTION * frontend, char *packet, int packetlen) { return foward_packet_to_frontend(frontend, 'C', packet, packetlen); } /* * Forward Empty query response to frontend */ static int foward_empty_query(POOL_CONNECTION * frontend, char *packet, int packetlen) { return foward_packet_to_frontend(frontend, 'I', packet, packetlen); } /* * Forward packet to frontend */ static int foward_packet_to_frontend(POOL_CONNECTION * frontend, char kind, char *packet, int packetlen) { int sendlen; if (pool_write(frontend, &kind, 1) < 0) return -1; sendlen = htonl(packetlen + 4); if (pool_write(frontend, &sendlen, sizeof(sendlen)) < 0) return -1; pool_write_and_flush(frontend, packet, packetlen); return 0; } pgpool-II-4.1.4/src/query_cache/0000775000175000017500000000000013730350746013411 500000000000000pgpool-II-4.1.4/src/query_cache/pool_memqcache.c0000664000175000017500000031710413730350127016450 00000000000000/* -*-pgsql-c-*- */ /* * pgpool: a language independent connection pool server for PostgreSQL * written by Tatsuo Ishii * * Copyright (c) 2003-2020 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 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(bool reset_dml_oids); static POOL_CACHEID * pool_add_item_shmem_cache(POOL_QUERY_HASH * query_hash, char *data, int size, time_t expire); 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); #ifdef NOT_USED static char *pool_get_buffer_pointer(POOL_INTERNAL_BUFFER * buffer); #endif 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 void inject_cached_message(POOL_CONNECTION * backend, char *qcache, int qcachelen); /* * if true, shared memory is locked in this process now. */ static int is_shmem_locked; /* * 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; POOL_SESSION_CONTEXT *session_context; POOL_QUERY_CONTEXT *query_context; cache = pool_get_current_cache(); if (cache == NULL) { session_context = pool_get_session_context(true); if (session_context && pool_is_query_in_progress()) { char *query = pool_get_query_string(); query_context = session_context->query_context; if (query) query_context->temp_cache = pool_create_temp_query_cache(query); } } 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,memqcache_expire); 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; } /* * Commit SELECT system catalog results to cache storage. */ int pool_catalog_commit_cache(POOL_CONNECTION_POOL * backend, char *query, char *data, size_t datalen) { #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 relation cache 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 relation cache to cache storage"), errdetail("search key : \"%s\"", tmpkey))); memcpy(cachekey.hashkey, tmpkey, 32); memqcache_expire = pool_config->relcache_expire; ereport(DEBUG1, (errmsg("commiting relation cache 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 relation cache to cache storage"), errdetail("item already exists"))); return 0; } else { cacheid = pool_add_item_shmem_cache(&query_hash, data, datalen, memqcache_expire); if (cacheid == NULL) { ereport(LOG, (errmsg("failed to add item to shmem cache"))); return -1; } else { ereport(DEBUG2, (errmsg("commiting relation cache 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 relation cache to cache storage"), errdetail("set cache succeeded"))); } #endif return 0; } /* * Fetch from memory cache. * Return: * 0: fetch success, * 1: not found */ 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; i < plen; i++) { fprintf(stderr, "%02x ", (unsigned char) (*data++)); len--; } fprintf(stderr, "\n"); } } #endif /* * send cached messages */ static int send_cached_messages(POOL_CONNECTION * frontend, const char *qcache, int qcachelen) { int msg = 0; int i = 0; int is_prepared_stmt = 0; int len; const char *p; while (i < qcachelen) { char tmpkind; int tmplen; tmpkind = qcache[i]; i++; memcpy(&tmplen, qcache + i, sizeof(tmplen)); i += sizeof(tmplen); len = ntohl(tmplen); p = qcache + i; i += len - sizeof(tmplen); /* No need to cache PARSE and BIND responses */ if (tmpkind == '1' || tmpkind == '2') { is_prepared_stmt = 1; continue; } /* * In the prepared statement execution, there is no need to send 'T' * response to the frontend. */ if (is_prepared_stmt && tmpkind == 'T') { continue; } /* send message to frontend */ ereport(DEBUG1, (errmsg("memcache: sending cached messages: '%c' len: %d", tmpkind, len))); send_message(frontend, tmpkind, len, p); msg++; } return msg; } /* * send message to frontend */ static void send_message(POOL_CONNECTION * conn, char kind, int len, const char *data) { ereport(DEBUG2, (errmsg("memcache: sending messages: kind '%c', len=%d, data=%p", kind, len, data))); pool_write(conn, &kind, 1); len = htonl(len); pool_write(conn, &len, sizeof(len)); len = ntohl(len); pool_write(conn, (void *) data, len - sizeof(len)); } #ifdef USE_MEMCACHED /* * delete query cache on memcached */ static int delete_cache_on_memcached(const char *key) { memcached_return rc; ereport(DEBUG2, (errmsg("memcache: deleteing cache on memcached with key: \"%s\"", key))); /* delete cache data on memcached. key is md5 hash query */ rc = memcached_delete(memc, key, 32, (time_t) 0); /* delete cache data on memcached is failed */ if (rc != MEMCACHED_SUCCESS && rc != MEMCACHED_BUFFERED) { ereport(LOG, (errmsg("failed to delete cache on memcached, error:\"%s\"", memcached_strerror(memc, rc)))); return 0; } return 1; } #endif /* * Fetch SELECT data from cache if possible. */ POOL_STATUS pool_fetch_from_memory_cache(POOL_CONNECTION * frontend, POOL_CONNECTION_POOL * backend, char *contents, bool *foundp) { char *qcache; size_t qcachelen; int sts; pool_sigset_t oldmask; ereport(DEBUG1, (errmsg("pool_fetch_from_memory_cache called"))); *foundp = false; POOL_SETMASK2(&BlockSig, &oldmask); pool_shmem_lock(); PG_TRY(); { sts = pool_fetch_cache(backend, contents, &qcache, &qcachelen); } PG_CATCH(); { pool_shmem_unlock(); POOL_SETMASK(&oldmask); PG_RE_THROW(); } PG_END_TRY(); pool_shmem_unlock(); POOL_SETMASK(&oldmask); if (sts != 0) /* Cache not found */ return POOL_CONTINUE; /* * Cache found. If we are doing extended query and in streaming * replication mode, we need to retrieve any responses from backend and * forward them to frontend. */ if (pool_is_doing_extended_query_message() && SL_MODE) { POOL_SESSION_CONTEXT *session_context; POOL_CONNECTION *target_backend; ereport(DEBUG1, (errmsg("memcache: injecting cache data"))); session_context = pool_get_session_context(true); target_backend = CONNECTION(backend, session_context->load_balance_node_id); inject_cached_message(target_backend, qcache, qcachelen); } else { /* * Send each messages to frontend */ send_cached_messages(frontend, qcache, qcachelen); } pfree(qcache); /* * Send a "READY FOR QUERY" if not in extended query. */ if (!pool_is_doing_extended_query_message() && MAJOR(backend) == PROTO_MAJOR_V3) { signed char state; /* * We keep previous transaction state. */ state = MASTER(backend)->tstate; send_message(frontend, 'Z', 5, (char *) &state); } if (!pool_is_doing_extended_query_message() || !SL_MODE) { 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; } /* * 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; /* * TABLESAMPLE is not allowed to cache. */ if (IsA(node, SelectStmt) &&((SelectStmt *) node)->fromClause) { List *tbl_list = ((SelectStmt *) node)->fromClause; ListCell *tbl; foreach(tbl, tbl_list) { if (IsA(lfirst(tbl), RangeTableSample)) 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; } /* * If Data-modifying statements in WITH clause, it's not allowed to cache. */ if(IsA(node, SelectStmt) && ((SelectStmt *) node)->withClause) { ListCell *lc; WithClause *withClause = ((SelectStmt *) node)->withClause; foreach(lc, withClause->ctes) { CommonTableExpr *cte = (CommonTableExpr *)lfirst(lc); if(IsA(cte->ctequery, InsertStmt) || IsA(cte->ctequery, DeleteStmt) || IsA(cte->ctequery, UpdateStmt)) { 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. * For SELECT, if Data-modifying statements in its WITH clause, * extract table oid from Data-modifying statements too. * 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; num_oids = pool_extract_withclause_oids((Node *) stmt->withClause, *oidsp); table = make_table_name_from_rangevar(stmt->relation); } else if (IsA(node, UpdateStmt)) { UpdateStmt *stmt = (UpdateStmt *) node; num_oids = pool_extract_withclause_oids((Node *) stmt->withClause, *oidsp); table = make_table_name_from_rangevar(stmt->relation); } else if (IsA(node, DeleteStmt)) { DeleteStmt *stmt = (DeleteStmt *) node; num_oids = pool_extract_withclause_oids((Node *) stmt->withClause, *oidsp); table = make_table_name_from_rangevar(stmt->relation); } else if(IsA(node, SelectStmt)) { SelectStmt *stmt = (SelectStmt *) node; num_oids = pool_extract_withclause_oids((Node *) stmt->withClause, *oidsp); table = NULL; } #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 = make_table_name_from_rangevar(stmt->relation); } #endif else if (IsA(node, AlterTableStmt)) { AlterTableStmt *stmt = (AlterTableStmt *) node; table = make_table_name_from_rangevar(stmt->relation); } else if (IsA(node, CopyStmt)) { CopyStmt *stmt = (CopyStmt *) node; if (stmt->is_from) /* COPY FROM? */ { table = make_table_name_from_rangevar(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 * make_table_name_from_rangevar. 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 = make_table_name_from_rangevar(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 = make_table_name_from_rangevar(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, ExplainStmt)) { ListCell *cell; DefElem *def; ExplainStmt *stmt = (ExplainStmt *) node; foreach(cell, stmt->options) { def = lfirst(cell); if (strncmp("analyze", def->defname, 7) == 0) { return pool_extract_table_oids(stmt->query, oidsp); } } table = NULL; } 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) { if (num_oids >= POOL_MAX_DML_OIDS) { ereport(LOG, (errmsg("memcache: error while extracting table oids. too many oids:%d", num_oids))); return 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; } /* * Extract table oid from INSERT/UPDATE/DELETE * FROM statement in WITH clause. * Returns number of oids. * oids buffer (oidsp) will be discarded by subsequent call. */ int pool_extract_withclause_oids(Node *node, int *oidsp) { int num_oids = 0; int oid; char *table; ListCell *lc; WithClause *with; if(oidsp == NULL) { return 0; } if(!node || !IsA(node, WithClause)) { return 0; } with = (WithClause *) node; foreach(lc, with->ctes) { CommonTableExpr *cte = (CommonTableExpr *)lfirst(lc); if(IsA(cte->ctequery, InsertStmt)) { InsertStmt *stmt = (InsertStmt *) cte->ctequery; table = make_table_name_from_rangevar(stmt->relation); } else if(IsA(cte->ctequery, DeleteStmt)) { DeleteStmt *stmt = (DeleteStmt *) cte->ctequery; table = make_table_name_from_rangevar(stmt->relation); } else if(IsA(cte->ctequery, UpdateStmt)) { UpdateStmt *stmt = (UpdateStmt *) cte->ctequery; table = make_table_name_from_rangevar(stmt->relation); } else { /* only check INSERT/DELETE/UPDATE in WITH clause */ table = NULL; } oid = pool_table_name_to_oid(table); if (oid > 0) { if (num_oids >= POOL_MAX_DML_OIDS) { break; } oidsp[num_oids++] = pool_table_name_to_oid(table); ereport(DEBUG1, (errmsg("memcache: extracting table oids: table: \"%s\" oid:%d", table, oidsp[num_oids - 1]))); } } return num_oids; } #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); MemoryContextSwitchTo(oldcxt); if (tmp == NULL) return; oidbuf = tmp; } for (i = 0; i < oidbufp; i++) { if (oidbuf[i] == oid) /* Already same oid exists */ return; } oidbuf[oidbufp++] = oid; } /* * Get table oid buffer */ static int pool_get_dml_table_oid(int **oid) { *oid = oidbuf; return oidbufp; } static int pool_get_dropdb_table_oids(int **oids, int dboid) { int *rtn = 0; int oids_size = 0; int *tmp; int num_oids = 0; DIR *dir; struct dirent *dp; char path[1024]; snprintf(path, sizeof(path), "%s/%d", pool_config->memqcache_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; i < num_table_oids; i++) { int fd; int oid = table_oids[i]; int sts; struct flock fl; /* * Create or open each memqcache_oiddir/database_oid/table_oid */ snprintf(path, sizeof(path), "%s/%d/%d", dir, dboid, oid); if ((fd = open(path, O_CREAT | O_RDWR, S_IRUSR | S_IWUSR)) == -1) { ereport(WARNING, (errmsg("memcache: adding table oid maps, failed to open file:\"%s\". error:\"%s\"", path, strerror(errno)))); return; } fl.l_type = F_WRLCK; fl.l_whence = SEEK_SET; fl.l_start = 0; /* Offset from l_whence */ fl.l_len = 0; /* length, 0 = to EOF */ sts = fcntl(fd, F_SETLKW, &fl); if (sts == -1) { ereport(WARNING, (errmsg("memcache: adding table oid maps, failed to lock file:\"%s\". error:\"%s\"", path, strerror(errno)))); close(fd); return; } /* * Below was ifdef-out because of a performance reason. Looking for * duplicate cache entries in a file needed unacceptably high cost. So * we gave up this and decided not to care about duplicate entries in * the file. */ #ifdef NOT_USED for (;;) { sts = read(fd, (char *) &buf, len); if (sts == -1) { ereport(WARNING, (errmsg("memcache: adding table oid maps, failed to read file:\"%s\". error:\"%s\"", path, strerror(errno)))); close(fd); return; } else if (sts == len) { if (memcmp(cachekey, &buf, len) == 0) { /* Same key found. Skip this */ close(fd); return; } continue; } /* * Must be EOF */ if (sts != 0) { ereport(WARNING, (errmsg("memcache: adding table oid maps, invalid data length:%d in file:\"%s\". error:\"%s\"", sts, path))); close(fd); return; } break; } #endif if (lseek(fd, 0, SEEK_END) == -1) { ereport(WARNING, (errmsg("memcache: adding table oid maps, failed seek on file:\"%s\". error:\"%s\"", path, strerror(errno)))); close(fd); return; } /* * Write cache_id or cache key at the end of file */ sts = write(fd, (char *) cachekey, len); if (sts == -1 || sts != len) { ereport(WARNING, (errmsg("memcache: adding table oid maps, failed to write file:\"%s\". error:\"%s\"", path, strerror(errno)))); close(fd); return; } close(fd); } } /* * Discard all oid maps at pgpool-II startup. * This is necessary for shmem case. */ void pool_discard_oid_maps(void) { char command[1024]; snprintf(command, sizeof(command), "/bin/rm -fr %s/[0-9]*", pool_config->memqcache_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)))); } } /* * Read 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; i < num_table_oids; i++) { int fd; int oid = table_oid[i]; int sts; struct flock fl; /* * Open each memqcache_oiddir/database_oid/table_oid */ snprintf(path, sizeof(path), "%s/%d/%d", dir, dboid, oid); if ((fd = open(path, O_RDONLY)) == -1) { /* * This may be normal. It is possible that no SELECT has been * issued since the table has been created or since pgpool-II * started up. */ ereport(DEBUG1, (errmsg("memcache invalidating query cache"), errdetail("failed to open \"%s\". reason:\"%s\"", path, strerror(errno)))); continue; } fl.l_type = F_RDLCK; fl.l_whence = SEEK_SET; fl.l_start = 0; /* Offset from l_whence */ fl.l_len = 0; /* length, 0 = to EOF */ sts = fcntl(fd, F_SETLKW, &fl); if (sts == -1) { ereport(WARNING, (errmsg("memcache: invalidating query cache, failed to lock file:\"%s\". error:\"%s\"", path, strerror(errno)))); close(fd); return; } for (;;) { sts = read(fd, (char *) &buf, len); if (sts == -1) { ereport(WARNING, (errmsg("memcache: invalidating query cache, failed to read file:\"%s\". error:\"%s\"", path, strerror(errno)))); close(fd); return; } else if (sts == len) { if (pool_is_shmem_cache()) { ereport(DEBUG1, (errmsg("memcache invalidating query cache"), errdetail("deleting cacheid:%d itemid:%d", buf.cacheid.blockid, buf.cacheid.itemid))); pool_delete_item_shmem_cache(&buf.cacheid); } #ifdef USE_MEMCACHED else { char delbuf[33]; memcpy(delbuf, buf.hashkey, 32); delbuf[32] = 0; ereport(DEBUG1, (errmsg("memcache invalidating query cache"), errdetail("deleting %s", delbuf))); delete_cache_on_memcached(delbuf); } #endif continue; } /* * Must be EOF */ if (sts != 0) { ereport(WARNING, (errmsg("memcache: invalidating query cache, invalid data length:%d in file:\"%s\"", sts, path))); close(fd); return; } break; } if (unlinkp) { unlink(path); } close(fd); } #ifdef SHMEMCACHE_DEBUG dump_shmem_cache(0); #endif } /* * Reset SELECT data buffers. If reset_dml_oids is true, call * pool_discard_dml_table_oid() to reset table oids used in DML statements. */ static void pool_reset_memqcache_buffer(bool reset_dml_oids) { POOL_SESSION_CONTEXT *session_context; session_context = pool_get_session_context(true); if (session_context && session_context->query_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 ((SL_MODE && pool_is_doing_extended_query_message()) || 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; } } if (reset_dml_oids) 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) { return (pool_config->memqcache_method == SHMEM_CACHE) ? 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; pool_sigset_t oldmask; 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; i < bh->num_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 < maxblock; i++) { if (p[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, time_t expire) { 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; i < bh->num_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; i < bh->num_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.expire = expire; 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 (cih->expire > 0) { now = time(NULL); if (now > (cih->timestamp + cih->expire)) { ereport(DEBUG1, (errmsg("memcache finding item"), errdetail("cache expired: now: %ld timestamp: %ld", now, cih->timestamp + cih->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; i < bh->num_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() && !is_shmem_locked) { pool_semaphore_lock(SHM_CACHE_SEM); is_shmem_locked = true; } } /* * Release lock */ void pool_shmem_unlock(void) { if (pool_is_shmem_cache() && is_shmem_locked) { pool_semaphore_unlock(SHM_CACHE_SEM); is_shmem_locked = false; } } /* * check lock */ bool pool_is_shmem_lock(void) { return is_shmem_locked; } /* * 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; i < bh->num_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; i < cache_array->num_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); ereport(DEBUG1, (errmsg("pool_create_temp_query_cache: cache created: %p", p))); 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); ereport(DEBUG1, (errmsg("pool_discard_temp_query_cache: cache discarded: %p", temp_cache))); 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; } #ifdef NOT_USED /* * Get internal buffer pointer. */ static char * pool_get_buffer_pointer(POOL_INTERNAL_BUFFER * buffer) { if (buffer == NULL) return NULL; return buffer->buf; } #endif /* * 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; i < num_caches; i++) { cache = session_context->query_cache_array->caches[i]; if (!cache || cache->is_discarded) continue; soids = (int *) pool_get_buffer(cache->oids, &len); if (!soids || !len) continue; for (j = 0; j < cache->num_oids; j++) { if (cache->is_discarded) break; for (k = 0; k < num_oids; k++) { if (soids[j] == oids[k]) { ereport(DEBUG1, (errmsg("discard cache for \"%s\"", cache->query))); cache->is_discarded = true; break; } } } pfree(soids); } } /* * At Ready for Query or Comand Complete handle query cache. For streaming * replication mode and extended query at Comand Complete handle query cache. * For other case At Ready for Query handle query cache. */ void pool_handle_query_cache(POOL_CONNECTION_POOL * backend, char *query, Node *node, char state) { POOL_SESSION_CONTEXT *session_context; pool_sigset_t oldmask; char *cache_buffer; size_t len; int num_oids; int *oids; int i; 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()) { POOL_TEMP_QUERY_CACHE *cache; /* * 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 (session_context->query_context->skip_cache_commit == false) { if (pool_commit_cache(backend, query, cache_buffer, len, num_oids, oids) != 0) { ereport(WARNING, (errmsg("ReadyForQuery: pool_commit_cache failed"))); } } /* * Reset temporary query cache buffer. This is necessary * if extended query protocol is used and a bind/execute * message arrives which uses a statement created by prior * parse message. In this case since the temp_cache is not * initialized by a parse message, messages are added to * pre existing temp cache buffer. The problem was found * in bug#152. * http://www.pgpool.net/mantisbt/view.php?id=152 */ cache = pool_get_current_cache(); ereport(DEBUG1, (errmsg("pool_handle_query_cache: temp_cache: %p", cache))); pool_discard_temp_query_cache(cache); if (SL_MODE && pool_is_doing_extended_query_message()) session_context->query_context->temp_cache = NULL; else session_context->query_context->temp_cache = pool_create_temp_query_cache(query); 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(true); } 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(true); } 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 the last DML * Thus we can register SELECT results to cache storage. *-------------------------------------------------------------------- */ num_caches = session_context->query_cache_array->num_caches; for (i = 0; i < num_caches; i++) { POOL_TEMP_QUERY_CACHE *cache; cache = session_context->query_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(true); } else /* Non cache safe queries */ { /* Non cachable SELECT */ if (node && IsA(node, SelectStmt)) { /* Extract table oids from buffer */ num_oids = pool_get_dml_table_oid(&oids); if (state == 'I') { /* * If Data-modifying statements in SELECT's WITH clause, * invalidate query cache. */ if (num_oids > 0 && pool_config->memqcache_auto_cache_invalidation) { POOL_SETMASK2(&BlockSig, &oldmask); pool_shmem_lock(); pool_invalidate_query_cache(num_oids, oids, true, 0); pool_shmem_unlock(); POOL_SETMASK(&oldmask); } /* Count up SELECT stats */ pool_stats_count_up_num_selects(1); pool_reset_memqcache_buffer(true); } 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. */ if (num_oids > 0 && pool_config->memqcache_auto_cache_invalidation) { pool_check_and_discard_cache_buffer(num_oids, oids); pool_reset_memqcache_buffer(false); } /* 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(true); 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(true); } 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); pool_reset_memqcache_buffer(false); } } else if (num_oids == 0) { /* * It is also necessary to clear cache buffers in case of no * oid queries (like BEGIN, CHECKPOINT, VACUUM, etc) too. */ pool_reset_memqcache_buffer(true); } } } } /* * 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; pool_sigset_t oldmask; 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) { pool_sigset_t oldmask; 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) { pool_sigset_t oldmask; 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; /* * 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 < nelements2 - 1; i++) { hash_elements[i].next = (POOL_HASH_ELEMENT *) & hash_elements[i + 1]; } hash_elements[nelements2 - 1].next = NULL; hash_free = hash_elements; return 0; } /* * Reset 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. */ static int pool_hash_reset(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("clearing 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; 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 < nelements2 - 1; i++) { hash_elements[i].next = (POOL_HASH_ELEMENT *) & hash_elements[i + 1]; } hash_elements[nelements2 - 1].next = NULL; hash_free = hash_elements; return 0; } /* * Search cacheid by MD5 hash key string * If found, returns cache id, otherwise NULL. */ POOL_CACHEID * pool_hash_search(POOL_QUERY_HASH * key) { volatile POOL_HASH_ELEMENT *element; uint32 hash_key = create_hash_key(key); if (hash_key >= 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 from 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; /* * Copy cache hit data */ mystats.cache_stats.num_selects = stats->num_selects; mystats.cache_stats.num_cache_hits = stats->num_cache_hits; if (pool_config->memqcache_method != SHMEM_CACHE) return &mystats; /* number of total hash entries */ mystats.num_hash_entries = hash_header->nhash; /* number of used hash entries */ for (i = 0; i < hash_header->nhash; i++) { element = hash_header->elements[i].element; while (element) { mystats.used_hash_entries++; element = element->next; } } nblocks = pool_get_memqcache_blocks(); for (i = 0; i < nblocks; i++) { POOL_CACHE_BLOCK_HEADER *bh; POOL_CACHE_ITEM_POINTER *cip; char *p = block_address(i); bh = (POOL_CACHE_BLOCK_HEADER *) p; int j; if (bh->flags & POOL_BLOCK_USED) { for (j = 0; j < bh->num_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; } /* * Inject cached message to the target backend buffer to pretend as if backend * actually replies with Data row and Command Complete message. */ static void inject_cached_message(POOL_CONNECTION * backend, char *qcache, int qcachelen) { char kind; int len; char *buf; int timeout; int i = 0; bool is_prepared_stmt = false; POOL_SESSION_CONTEXT *session_context; POOL_QUERY_CONTEXT *query_context; POOL_PENDING_MESSAGE *msg; session_context = pool_get_session_context(false); query_context = session_context->query_context; msg = pool_pending_message_find_lastest_by_query_context(query_context); if (msg) { /* * If pending message found, we should extract target backend from it */ int backend_id; backend_id = pool_pending_message_get_target_backend_id(msg); backend = CONNECTION(session_context->backend, backend_id); timeout = -1; } else timeout = 0; /* Send flush messsage to backend to retrieve response of backend */ pool_write(backend, "H", 1); len = htonl(sizeof(len)); pool_write_and_flush(backend, &len, sizeof(len)); /* * Push any response from backend */ for (;;) { /* check if there's any pending data */ if (!pool_ssl_pending(backend) && pool_read_buffer_is_empty(backend)) { pool_set_timeout(timeout); if (pool_check_fd(backend) != 0) { ereport(DEBUG1, (errmsg("inject_cached_message: select shows no pending data"))); pool_set_timeout(-1); break; } pool_set_timeout(-1); } pool_read(backend, &kind, 1); ereport(DEBUG1, (errmsg("inject_cached_message: push message kind: '%c'", kind))); if (msg && ((kind == 'T' && msg->type == POOL_DESCRIBE) || (kind == '2' && msg->type == POOL_BIND))) { /* Pending message seen. Now it is likely to end of pending data */ timeout = 0; } pool_push(backend, &kind, sizeof(kind)); pool_read(backend, &len, sizeof(len)); pool_push(backend, &len, sizeof(len)); if ((ntohl(len) - sizeof(len)) > 0) { buf = pool_read2(backend, ntohl(len) - sizeof(len)); pool_push(backend, buf, ntohl(len) - sizeof(len)); } } /* * Inject row data and command complete */ while (i < qcachelen) { char tmpkind; int tmplen; char *p; tmpkind = qcache[i]; i++; memcpy(&tmplen, qcache + i, sizeof(tmplen)); i += sizeof(tmplen); len = ntohl(tmplen); p = qcache + i; i += len - sizeof(tmplen); /* No need to cache PARSE and BIND responses */ if (tmpkind == '1' || tmpkind == '2') { is_prepared_stmt = true; continue; } /* * In the prepared statement execution, there is no need to send 'T' * response to the frontend. */ if (is_prepared_stmt && tmpkind == 'T') { continue; } /* push message */ ereport(DEBUG1, (errmsg("inject_cached_message: push cached messages: '%c' len: %d", tmpkind, len))); pool_push(backend, &tmpkind, 1); pool_push(backend, &tmplen, sizeof(tmplen)); if (len > 0) pool_push(backend, p, len - sizeof(tmplen)); } /* * Pop data. */ pool_pop(backend, &len); } pgpool-II-4.1.4/src/redhat/0000775000175000017500000000000013730350746012370 500000000000000pgpool-II-4.1.4/src/redhat/pgpool.init0000664000175000017500000000763113730350075014477 00000000000000#!/bin/sh # pgpool This is the init script for starting up pgpool-II # # chkconfig: - 64 36 # description: Starts and stops the pgpool daemon # processname: pgpool # pidfile: /var/run/${NAME}.pid # # v1.0.0 Devrim GUNDUZ # - Initial version of Red Hat / Fedora init script # # v2.2 Devrim GUNDUZ # - New and improved version which has some fixes. # # v2.2.5 Devrim GUNDUZ # - Fix logging. # # v3.3.3 Ryan Deshone and Yugo Nagata # - Update stop and reload to use pgpool commands properly # - Removed "switch" as pgpool no longer suppports that command # - Add try-restart option # - Fix exit code according with LSB # Source function library. INITD=/etc/rc.d/init.d . $INITD/functions # Get function listing for cross-distribution logic. TYPESET=`typeset -f|grep "declare"` # Get config. . /etc/sysconfig/network # Check that networking is up. # We need it for pgpool [ "${NETWORKING}" = "no" ] && exit 0 # Find the name of the script NAME=`basename $0` if [ ${NAME:0:1} = "S" -o ${NAME:0:1} = "K" ] then NAME=${NAME:3} fi # For SELinux we need to use 'runuser' not 'su' if [ -x /sbin/runuser ] then SU=runuser else SU=su fi # Set defaults for configuration variables PGPOOLUSER=postgres PGPOOLENGINE=/usr/bin PGPOOLDAEMON=$PGPOOLENGINE/pgpool PGPOOLCONF=/etc/pgpool-II/pgpool.conf PGPOOLPIDDIR=/var/run/pgpool PGPOOLLOG=/var/log/pgpool.log lockfile="/var/lock/subsys/${NAME}" pidfile="$PGPOOLPIDDIR/pgpool.pid" # Import configuration from /etc/sysconfig, if it exists [ -f /etc/sysconfig/${NAME} ] && . /etc/sysconfig/${NAME} test -x $PGPOOLDAEMON || exit 5 # Check whether the config file exists or not if [ ! -r $PGPOOLCONF ] then echo "$PGPOOLCONF not found" echo_failure echo exit 1 fi # Create the log file if it does not exist if [ ! -x $PGPOOLLOG ] then touch $PGPOOLLOG chown ${PGPOOLUSER}: $PGPOOLLOG fi if [ ! -d $PGPOOLPIDDIR ] then mkdir $PGPOOLPIDDIR chown ${PGPOOLUSER}: $PGPOOLPIDDIR fi script_result=0 start(){ PGPOOL_START=$"Starting ${NAME} service: " echo -n "$PGPOOL_START" if [ -n "`pidofproc -p $pidfile $PGPOOLDAEMON`" ] then echo_success echo exit 0 fi $SU -l $PGPOOLUSER -c "$PGPOOLDAEMON -f $PGPOOLCONF $OPTS & " >> "$PGPOOLLOG" 2>&1 < /dev/null sleep 2 if [ -n "`pidofproc -p $pidfile $PGPOOLDAEMON`" ] then success "$PGPOOL_START" touch "$lockfile" echo else failure "$PGPOOL_START" echo script_result=1 fi } stop(){ PGPOOL_STOP=$"Stopping ${NAME} service: " echo -n "$PGPOOL_STOP" if [ -e "$lockfile" ] then $SU -l $PGPOOLUSER -c "$PGPOOLDAEMON -f $PGPOOLCONF -m fast stop" >> "$PGPOOLLOG" 2>&1 < /dev/null RETVAL=$? if [ $RETVAL -eq 0 ] then success "$PGPOOL_STOP" rm -f "$lockfile" else failure "$PGPOOL_STOP" script_result=1 fi else echo_success fi echo } restart(){ stop start } reload(){ PGPOOL_RELOAD=$"Reloading ${NAME} configuration: " echo -n "$PGPOOL_RELOAD" if [ -n "`pidofproc -p $pidfile $PGPOOLDAEMON`" ] then $SU -l $PGPOOLUSER -c "$PGPOOLDAEMON -f $PGPOOLCONF reload" >> "$PGPOOLLOG" 2>&1 < /dev/null else failure "$PGPOOL_RELOAD" echo exit 1 fi RETVAL=$? if [ $RETVAL -eq 0 ]; then success "$PGPOOL_RELOAD" else failure "$PGPOOL_RELOAD" script_result=1 fi echo } condrestart(){ [ -e "$lockfile" ] && restart } condstop(){ [ -e "$lockfile" ] && stop } # See how we were called. case "$1" in start) start ;; stop) stop ;; status) status -p $pidfile pgpool script_result=$? ;; restart) restart ;; reload|force-reload) reload ;; condrestart|try-restart) condrestart ;; condstop) condstop ;; *) echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|condstop|reload|force-reload}" exit 2 esac exit $script_result pgpool-II-4.1.4/src/redhat/pgpool_rhel.sysconfig0000664000175000017500000000030013730350075016534 00000000000000# Options for pgpool # -n: don't run in daemon mode. does not detatch control tty # -d: debug mode. lots of debug information will be printed #OPTS=" -d -n" OPTS=" -n" STOP_OPTS=" -m fast" pgpool-II-4.1.4/src/redhat/pgpool_rhel6.sysconfig0000664000175000017500000000025213730350075016630 00000000000000# Options for pgpool # -n: don't run in daemon mode. does not detatch control tty # -d: debug mode. lots of debug information will be printed #OPTS=" -d -n" OPTS=" -n" pgpool-II-4.1.4/src/redhat/pgpool.conf.sample.patch0000664000175000017500000000521313730350075017031 00000000000000*** src/sample/pgpool.conf.sample 2014-10-21 16:03:55.605775451 +0900 --- pgpool.conf.sample.new 2014-10-21 16:04:15.557776162 +0900 *************** *** 58,72 **** # - Backend Connection Settings - ! #backend_hostname0 = 'host1' # Host name or IP address to connect to for backend 0 ! #backend_port0 = 5432 # Port number for backend 0 ! #backend_weight0 = 1 # Weight for backend 0 (only in load balancing mode) ! #backend_data_directory0 = '/data' # Data directory for backend 0 ! #backend_flag0 = 'ALLOW_TO_FAILOVER' # Controls various backend behavior # ALLOW_TO_FAILOVER or DISALLOW_TO_FAILOVER #backend_hostname1 = 'host2' --- 58,72 ---- # - Backend Connection Settings - ! backend_hostname0 = 'localhost' # Host name or IP address to connect to for backend 0 ! backend_port0 = 5432 # Port number for backend 0 ! backend_weight0 = 1 # Weight for backend 0 (only in load balancing mode) ! backend_data_directory0 = '/var/lib/pgsql/data' # Data directory for backend 0 ! backend_flag0 = 'ALLOW_TO_FAILOVER' # Controls various backend behavior # ALLOW_TO_FAILOVER or DISALLOW_TO_FAILOVER #backend_hostname1 = 'host2' *************** *** 214,220 **** pid_file_name = '/var/run/pgpool/pgpool.pid' # PID file name # Can be specified as relative to the" # location of pgpool.conf file or # as an absolute path # (change requires restart) ! logdir = '/tmp' # Directory of pgPool status file # (change requires restart) --- 214,220 ---- pid_file_name = '/var/run/pgpool/pgpool.pid' # PID file name # Can be specified as relative to the" # location of pgpool.conf file or # or as absolute path # (change requires restart) ! logdir = '/var/log/pgpool' # Directory of pgPool status file # (change requires restart) pgpool-II-4.1.4/src/redhat/pgpool.service0000664000175000017500000000057513730350075015174 00000000000000[Unit] Description=Pgpool-II After=syslog.target network.target [Service] User=postgres Group=postgres EnvironmentFile=-/etc/sysconfig/pgpool ExecStart=/usr/bin/pgpool -f /etc/pgpool-II/pgpool.conf $OPTS ExecStop=/usr/bin/pgpool -f /etc/pgpool-II/pgpool.conf $STOP_OPTS stop ExecReload=/usr/bin/pgpool -f /etc/pgpool-II/pgpool.conf reload [Install] WantedBy=multi-user.target pgpool-II-4.1.4/src/rewrite/0000775000175000017500000000000013730350746012602 500000000000000pgpool-II-4.1.4/src/rewrite/pool_timestamp.c0000664000175000017500000013260113730350127015716 00000000000000/* -*-pgsql-c-*- */ /* * $Header$ * * pgpool: a language independent connection pool server for PostgreSQL * written by Tatsuo Ishii * * Copyright (c) 2003-2016 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 "rewrite/pool_timestamp.h" #include "utils/elog.h" #include "utils/pool_relcache.h" #include "utils/pool_select_walker.h" #include "pool_config.h" #include "parser/parsenodes.h" #include "parser/parser.h" #include "utils/palloc.h" #include "utils/memutils.h" #include "context/pool_session_context.h" typedef struct { char *attrname; /* attribute name */ char *adsrc; /* default value expression */ int use_timestamp; /* not zero if timestamp is used in default * value */ } TSAttr; typedef struct { int relnatts; /* num of attributes */ TSAttr attr[1]; } TSRel; typedef struct { A_Const *ts_const; POOL_CONNECTION_POOL *backend; char *relname; int num_params; /* num of original params (for Parse) */ bool rewrite_to_params; /* true if timestamp is rewritten to param * insread of const */ bool rewrite; /* has rewritten? */ List *params; /* list of additional params */ } TSRewriteContext; static void *ts_register_func(POOL_SELECT_RESULT * res); static void *ts_unregister_func(void *data); static TSRel * relcache_lookup(TSRewriteContext * ctx); static bool isStringConst(Node *node, const char *str); static bool rewrite_timestamp_walker(Node *node, void *context); static bool rewrite_timestamp_insert(InsertStmt *i_stmt, TSRewriteContext * ctx); static bool rewrite_timestamp_update(UpdateStmt *u_stmt, TSRewriteContext * ctx); static char *get_current_timestamp(POOL_CONNECTION_POOL * backend); static Node *makeTsExpr(TSRewriteContext * ctx); static TypeCast *makeTypeCastFromSvfOp(SQLValueFunctionOp op); static A_Const *makeStringConstFromQuery(POOL_CONNECTION_POOL * backend, char *expression); bool raw_expression_tree_walker(Node *node, bool (*walker) (), void *context); POOL_RELCACHE *ts_relcache; static void * ts_register_func(POOL_SELECT_RESULT * res) { /* Number of result columns included in res */ #define NUM_COLS 3 TSRel *rel; int i; if (res->numrows == 0) return NULL; rel = (TSRel *) malloc(sizeof(TSRel) + sizeof(TSAttr) * (res->numrows - 1)); for (i = 0; i < res->numrows; i++) { int index = 0; /* attribute name */ rel->attr[i].attrname = strdup(res->data[i * NUM_COLS + index]); index++; /* attribute default value */ if (res->data[i * NUM_COLS + index]) rel->attr[i].adsrc = strdup(res->data[i * NUM_COLS + index]); else rel->attr[i].adsrc = NULL; index++; /* if timestamp is used in default value */ rel->attr[i].use_timestamp = *(res->data[i * NUM_COLS + index]) == 't'; ereport(DEBUG1, (errmsg("timestamp register function"), errdetail("attrname %s adsrc %s use_timestamp = %d", rel->attr[i].attrname, (rel->attr[i].adsrc ? rel->attr[i].adsrc : "NULL"), rel->attr[i].use_timestamp))); } /* num of attributes */ rel->relnatts = res->numrows; return (void *) rel; } static void * ts_unregister_func(void *data) { TSRel *rel = (TSRel *) data; if (rel) free(rel); return (void *) 0; } static TSRel * relcache_lookup(TSRewriteContext * ctx) { #define ATTRDEFQUERY (Pgversion(ctx->backend)->major >= 73 ? \ "SELECT attname, pg_get_expr(d.adbin, d.adrelid), coalesce((pg_get_expr(d.adbin, d.adrelid) LIKE '%%now()%%' OR pg_get_expr(d.adbin, d.adrelid) LIKE '%%''now''::text%%' OR" \ " pg_get_expr(d.adbin, d.adrelid) LIKE '%%CURRENT_TIMESTAMP%%' OR pg_get_expr(d.adbin, d.adrelid) LIKE '%%CURRENT_TIME%%' OR pg_get_expr(d.adbin, d.adrelid) LIKE '%%CURRENT_DATE%%' OR" \ " pg_get_expr(d.adbin, d.adrelid) LIKE '%%LOCALTIME%%' OR pg_get_expr(d.adbin, d.adrelid) LIKE '%%LOCALTIMESTAMP%%')" \ " AND (a.atttypid = 'timestamp'::regtype::oid OR" \ " a.atttypid = 'timestamp with time zone'::regtype::oid OR" \ " a.atttypid = 'date'::regtype::oid OR" \ " a.atttypid = 'time'::regtype::oid OR" \ " a.atttypid = 'time with time zone'::regtype::oid)" \ " , false)" \ " FROM pg_catalog.pg_class c, pg_catalog.pg_attribute a " \ " LEFT JOIN pg_catalog.pg_attrdef d ON (a.attrelid = d.adrelid AND a.attnum = d.adnum)" \ " WHERE c.oid = a.attrelid AND a.attnum >= 1 AND a.attisdropped = 'f' AND c.relname = '%s'" \ " ORDER BY a.attnum" : \ "SELECT attname, d.adsrc, coalesce((d.adsrc LIKE '%%now()%%' OR d.adsrc LIKE '%%''now''::text%%' OR" \ " d.adsrc LIKE '%%CURRENT_TIMESTAMP%%' OR d.adsrc LIKE '%%CURRENT_TIME%%' OR d.adsrc LIKE '%%CURRENT_DATE%%' OR" \ " d.adsrc LIKE '%%LOCALTIME%%' OR d.adsrc LIKE '%%LOCALTIMESTAMP%%')" \ " AND (a.atttypid = 'timestamp'::regtype::oid OR" \ " a.atttypid = 'timestamp with time zone'::regtype::oid OR" \ " a.atttypid = 'date'::regtype::oid OR" \ " a.atttypid = 'time'::regtype::oid OR" \ " a.atttypid = 'time with time zone'::regtype::oid)" \ " , false)" \ " FROM pg_catalog.pg_class c, pg_catalog.pg_attribute a " \ " LEFT JOIN pg_catalog.pg_attrdef d ON (a.attrelid = d.adrelid AND a.attnum = d.adnum)" \ " WHERE c.oid = a.attrelid AND a.attnum >= 1 AND a.attisdropped = 'f' AND c.relname = '%s'" \ " ORDER BY a.attnum") #define ATTRDEFQUERY2 (Pgversion(ctx->backend)->major >= 73 ? \ "SELECT attname, pg_get_expr(d.adbin, d.adrelid), coalesce((pg_get_expr(d.adbin, d.adrelid) LIKE '%%now()%%' OR pg_get_expr(d.adbin, d.adrelid) LIKE '%%''now''::text%%' OR" \ " pg_get_expr(d.adbin, d.adrelid) LIKE '%%CURRENT_TIMESTAMP%%' OR pg_get_expr(d.adbin, d.adrelid) LIKE '%%CURRENT_TIME%%' OR pg_get_expr(d.adbin, d.adrelid) LIKE '%%CURRENT_DATE%%' OR" \ " pg_get_expr(d.adbin, d.adrelid) LIKE '%%LOCALTIME%%' OR pg_get_expr(d.adbin, d.adrelid) LIKE '%%LOCALTIMESTAMP%%')" \ " AND (a.atttypid = 'timestamp'::regtype::oid OR" \ " a.atttypid = 'timestamp with time zone'::regtype::oid OR" \ " a.atttypid = 'date'::regtype::oid OR" \ " a.atttypid = 'time'::regtype::oid OR" \ " a.atttypid = 'time with time zone'::regtype::oid)" \ " , false)" \ " FROM pg_catalog.pg_class c, pg_catalog.pg_attribute a " \ " LEFT JOIN pg_catalog.pg_attrdef d ON (a.attrelid = d.adrelid AND a.attnum = d.adnum)" \ " WHERE c.oid = a.attrelid AND a.attnum >= 1 AND a.attisdropped = 'f' AND c.oid = pgpool_regclass('%s')" \ " ORDER BY a.attnum" : \ "SELECT attname, d.adsrc, coalesce((d.adsrc LIKE '%%now()%%' OR d.adsrc LIKE '%%''now''::text%%' OR" \ " d.adsrc LIKE '%%CURRENT_TIMESTAMP%%' OR d.adsrc LIKE '%%CURRENT_TIME%%' OR d.adsrc LIKE '%%CURRENT_DATE%%' OR" \ " d.adsrc LIKE '%%LOCALTIME%%' OR d.adsrc LIKE '%%LOCALTIMESTAMP%%')" \ " AND (a.atttypid = 'timestamp'::regtype::oid OR" \ " a.atttypid = 'timestamp with time zone'::regtype::oid OR" \ " a.atttypid = 'date'::regtype::oid OR" \ " a.atttypid = 'time'::regtype::oid OR" \ " a.atttypid = 'time with time zone'::regtype::oid)" \ " , false)" \ " FROM pg_catalog.pg_class c, pg_catalog.pg_attribute a " \ " LEFT JOIN pg_catalog.pg_attrdef d ON (a.attrelid = d.adrelid AND a.attnum = d.adnum)" \ " WHERE c.oid = a.attrelid AND a.attnum >= 1 AND a.attisdropped = 'f' AND c.oid = pgpool_regclass('%s')" \ " ORDER BY a.attnum") #define ATTRDEFQUERY3 (Pgversion(ctx->backend)->major >= 73 ? \ "SELECT attname, pg_get_expr(d.adbin, d.adrelid), coalesce((pg_get_expr(d.adbin, d.adrelid) LIKE '%%now()%%' OR pg_get_expr(d.adbin, d.adrelid) LIKE '%%''now''::text%%' OR" \ " pg_get_expr(d.adbin, d.adrelid) LIKE '%%CURRENT_TIMESTAMP%%' OR pg_get_expr(d.adbin, d.adrelid) LIKE '%%CURRENT_TIME%%' OR pg_get_expr(d.adbin, d.adrelid) LIKE '%%CURRENT_DATE%%' OR" \ " pg_get_expr(d.adbin, d.adrelid) LIKE '%%LOCALTIME%%' OR pg_get_expr(d.adbin, d.adrelid) LIKE '%%LOCALTIMESTAMP%%')" \ " AND (a.atttypid = 'timestamp'::regtype::oid OR" \ " a.atttypid = 'timestamp with time zone'::regtype::oid OR" \ " a.atttypid = 'date'::regtype::oid OR" \ " a.atttypid = 'time'::regtype::oid OR" \ " a.atttypid = 'time with time zone'::regtype::oid)" \ " , false)" \ " FROM pg_catalog.pg_class c, pg_catalog.pg_attribute a " \ " LEFT JOIN pg_catalog.pg_attrdef d ON (a.attrelid = d.adrelid AND a.attnum = d.adnum)" \ " WHERE c.oid = a.attrelid AND a.attnum >= 1 AND a.attisdropped = 'f' AND c.oid = to_regclass('%s')" \ " ORDER BY a.attnum" : \ "SELECT attname, d.adsrc, coalesce((d.adsrc LIKE '%%now()%%' OR d.adsrc LIKE '%%''now''::text%%' OR" \ " d.adsrc LIKE '%%CURRENT_TIMESTAMP%%' OR d.adsrc LIKE '%%CURRENT_TIME%%' OR d.adsrc LIKE '%%CURRENT_DATE%%' OR" \ " d.adsrc LIKE '%%LOCALTIME%%' OR d.adsrc LIKE '%%LOCALTIMESTAMP%%')" \ " AND (a.atttypid = 'timestamp'::regtype::oid OR" \ " a.atttypid = 'timestamp with time zone'::regtype::oid OR" \ " a.atttypid = 'date'::regtype::oid OR" \ " a.atttypid = 'time'::regtype::oid OR" \ " a.atttypid = 'time with time zone'::regtype::oid)" \ " , false)" \ " FROM pg_catalog.pg_class c, pg_catalog.pg_attribute a " \ " LEFT JOIN pg_catalog.pg_attrdef d ON (a.attrelid = d.adrelid AND a.attnum = d.adnum)" \ " WHERE c.oid = a.attrelid AND a.attnum >= 1 AND a.attisdropped = 'f' AND c.oid = to_regclass('%s')" \ " ORDER BY a.attnum") char *query; char *table_name; table_name = ctx->relname; if (pool_has_to_regclass()) { query = ATTRDEFQUERY3; } else if (pool_has_pgpool_regclass()) { query = ATTRDEFQUERY2; } else { query = ATTRDEFQUERY; table_name = remove_quotes_and_schema_from_relname(table_name); } if (!ts_relcache) { ts_relcache = pool_create_relcache(pool_config->relcache_size, query, ts_register_func, ts_unregister_func, false); if (ts_relcache == NULL) { ereport(WARNING, (errmsg("unable to create relcache"))); return NULL; } } return (TSRel *) pool_search_relcache(ts_relcache, ctx->backend, table_name); } /* If timestamp valus is required then return ts_const. Otherwize make * a new ParamRef, whose number member is 0 and is overwritten at last, * and add it into params list in context. */ static Node * makeTsExpr(TSRewriteContext * ctx) { ParamRef *param; if (!ctx->rewrite_to_params) return (Node *) ctx->ts_const; param = makeNode(ParamRef); param->number = 0; ctx->params = lappend(ctx->params, param); return (Node *) param; } static bool isStringConst(Node *node, const char *str) { A_Const *a_const; Value val; if (!IsA(node, A_Const)) return false; a_const = (A_Const *) node; val = a_const->val; if (val.type == T_String && val.val.str && strcmp(str, val.val.str) == 0) return true; return false; } bool isSystemType(Node *node, const char *name) { TypeName *typename; if (!IsA(node, TypeName)) return false; typename = (TypeName *) node; if (list_length(typename->names) == 2 && strcmp("pg_catalog", strVal(linitial(typename->names))) == 0 && strcmp(name, strVal(lsecond(typename->names))) == 0) return true; return false; } static bool isSystemTypeCast(Node *node, const char *name) { TypeCast *typecast; if (!IsA(node, TypeCast)) return false; typecast = (TypeCast *) node; return isSystemType((Node *) typecast->typeName, name); } /* * walker function for raw_expression_tree_walker */ static bool rewrite_timestamp_walker(Node *node, void *context) { TSRewriteContext *ctx = (TSRewriteContext *) context; if (node == NULL) return false; switch (nodeTag(node)) { case T_InsertStmt: { TSRewriteContext *ctx = (TSRewriteContext *) context; char *relname_old; InsertStmt *i_stmt = (InsertStmt *) node; relname_old = ctx->relname; ctx->relname = make_table_name_from_rangevar(i_stmt->relation); rewrite_timestamp_insert(i_stmt, ctx); ctx->relname = relname_old; } /* tree walker is called in rewrite_timestamp_insert() */ return false; case T_UpdateStmt: { TSRewriteContext *ctx = (TSRewriteContext *) context; char *relname_old; UpdateStmt *u_stmt = (UpdateStmt *) node; relname_old = ctx->relname; ctx->relname = make_table_name_from_rangevar(u_stmt->relation); rewrite_timestamp_update(u_stmt, ctx); ctx->relname = relname_old; } /* tree walker is called in rewrite_timestamp_update() */ return false; case T_FuncCall: { /* `now()' FuncCall */ FuncCall *fcall = (FuncCall *) node; if ((list_length(fcall->funcname) == 1 && strcmp("now", strVal(linitial(fcall->funcname))) == 0) || (list_length(fcall->funcname) == 2 && strcmp("pg_catalog", strVal(linitial(fcall->funcname))) == 0 && strcmp("now", strVal(lsecond(fcall->funcname))) == 0)) { TypeCast *tc = makeNode(TypeCast); tc->arg = makeTsExpr(ctx); tc->typeName = SystemTypeName("text"); fcall->funcname = SystemFuncName("timestamptz"); fcall->args = list_make1(tc); ctx->rewrite = true; } } break; case T_SQLValueFunction: { /* * CURRENT_DATE, CURRENT_TIME, LOCALTIMESTAMP, LOCALTIME etc. * From PostgreSQL 10, timestamp conversion is changed and * SQLValueFunction is added. But Pgpool-II should use the old * timestamp translate like "'now'::text::date". So we have to * cast the node to TypeCast first. */ SQLValueFunction *svf = (SQLValueFunction *) node; if (svf->op == SVFOP_CURRENT_DATE || svf->op == SVFOP_CURRENT_TIME || svf->op == SVFOP_CURRENT_TIME_N || svf->op == SVFOP_CURRENT_TIMESTAMP || svf->op == SVFOP_CURRENT_TIMESTAMP_N || svf->op == SVFOP_LOCALTIME || svf->op == SVFOP_LOCALTIME_N || svf->op == SVFOP_LOCALTIMESTAMP || svf->op == SVFOP_LOCALTIMESTAMP_N) { TypeCast *tc, *tc1; tc1 = makeTypeCastFromSvfOp(svf->op); tc = (TypeCast *) node; tc->arg = tc1->arg; tc->typeName = (TypeName *) copyObject(tc1->typeName); tc->location = -1; node->type = T_TypeCast; /* * rewrite `'now'::timestamp' and `'now'::text::timestamp' * both */ if (isSystemTypeCast(tc->arg, "text")) tc = (TypeCast *) tc->arg; if (isStringConst(tc->arg, "now")) { tc->arg = (Node *) makeTsExpr(ctx); ctx->rewrite = true; } } } break; case T_TypeCast: { TypeCast *tc = (TypeCast *) node; if ((isSystemType((Node *) tc->typeName, "date") || isSystemType((Node *) tc->typeName, "timestamp") || isSystemType((Node *) tc->typeName, "timestamptz") || isSystemType((Node *) tc->typeName, "time") || isSystemType((Node *) tc->typeName, "timetz"))) { /* * rewrite `'now'::timestamp' and `'now'::text::timestamp' * both */ if (isSystemTypeCast(tc->arg, "text")) tc = (TypeCast *) tc->arg; if (isStringConst(tc->arg, "now")) { tc->arg = (Node *) makeTsExpr(ctx); ctx->rewrite = true; } } } break; case T_ParamRef: { ParamRef *param = (ParamRef *) node; /* count how many params in original query */ if (ctx->num_params < param->number) ctx->num_params = param->number; } break; default: break; } return raw_expression_tree_walker(node, rewrite_timestamp_walker, context); } /* * Get `now()' from MASTER node */ static char * get_current_timestamp(POOL_CONNECTION_POOL * backend) { POOL_SELECT_RESULT *res; static char timestamp[64]; do_query(MASTER(backend), "SELECT now()", &res, MAJOR(backend)); if (res->numrows != 1) { free_select_result(res); return NULL; } strlcpy(timestamp, res->data[0], sizeof(timestamp)); free_select_result(res); return timestamp; } /* * rewrite InsertStmt */ static bool rewrite_timestamp_insert(InsertStmt *i_stmt, TSRewriteContext * ctx) { int i; bool rewrite = false; TSRel *relcache; raw_expression_tree_walker( (Node *) i_stmt->withClause, rewrite_timestamp_walker, (void *) ctx); raw_expression_tree_walker( (Node *) i_stmt->onConflictClause, rewrite_timestamp_walker, (void *) ctx); raw_expression_tree_walker( (Node *) i_stmt->returningList, rewrite_timestamp_walker, (void *) ctx); rewrite = ctx->rewrite; /* * INSERT INTO rel DEFAULT VALUES rewrite to: INSERT INTO rel VALUES * (DEFAULT, '2009-..',...) */ if (i_stmt->selectStmt == NULL) { List *values = NIL; SelectStmt *selectStmt = makeNode(SelectStmt); relcache = relcache_lookup(ctx); if (relcache == NULL) return false; for (i = 0; i < relcache->relnatts; i++) { if (relcache->attr[i].use_timestamp) { rewrite = true; if (ctx->rewrite_to_params) values = lappend(values, makeTsExpr(ctx)); else values = lappend(values, makeStringConstFromQuery(ctx->backend, relcache->attr[i].adsrc)); } else values = lappend(values, makeNode(SetToDefault)); } if (rewrite) { selectStmt->valuesLists = list_make1(values); i_stmt->selectStmt = (Node *) selectStmt; } } else if (IsA(i_stmt->selectStmt, SelectStmt)) { SelectStmt *selectStmt = (SelectStmt *) i_stmt->selectStmt; ListCell *lc_row, *lc_val, *lc_col; /* * Rewrite `now()' call to timestamp literal. */ raw_expression_tree_walker( (Node *) selectStmt, rewrite_timestamp_walker, (void *) ctx); rewrite = ctx->rewrite; /* * if `INSERT INTO rel SELECT ...' */ if (selectStmt->valuesLists == NIL) return rewrite; relcache = relcache_lookup(ctx); if (relcache == NULL) return false; if (i_stmt->cols == NIL) { /* * INSERT INTO rel VALUES (...) * * CREATE TABLE r1 ( i1 int, t1 timestamp default now(), i2 int, * t2 timestamp default now(), ) * * INSERT INTO r1 VALUES (1, DEFAULT); rewrite to: INSERT INTO r1 * VALUES (1, '20xx-xx-xx...', DEFAULT, '2..') */ foreach(lc_row, selectStmt->valuesLists) { List *values = lfirst(lc_row); i = 0; foreach(lc_val, values) { if (relcache->attr[i].use_timestamp == true && IsA(lfirst(lc_val), SetToDefault)) { rewrite = true; if (ctx->rewrite_to_params) lfirst(lc_val) = makeTsExpr(ctx); else lfirst(lc_val) = makeStringConstFromQuery(ctx->backend, relcache->attr[i].adsrc); } i++; } /* fill rest columns */ for (; i < relcache->relnatts; i++) { if (relcache->attr[i].use_timestamp == true) { rewrite = true; if (ctx->rewrite_to_params) values = lappend(values, makeTsExpr(ctx)); else values = lappend(values, makeStringConstFromQuery(ctx->backend, relcache->attr[i].adsrc)); } else values = lappend(values, makeNode(SetToDefault)); } } } else { /* * INSERT INTO rel(col1, col2) VALUES (val, val2) * * if timestamp column is not given by column list add colname to * column list and add timestamp to values list. */ int appended_columns = 0; int *appended_columns_list; ResTarget *col; appended_columns_list = (int *) malloc(sizeof(int) * relcache->relnatts); for (i = 0; i < relcache->relnatts; i++) { if (relcache->attr[i].use_timestamp == false) continue; foreach(lc_col, i_stmt->cols) { col = lfirst(lc_col); if (strcmp(relcache->attr[i].attrname, col->name) == 0) break; } /* If columns are not found in query, append these. */ if (lc_col == NULL) { rewrite = true; col = makeNode(ResTarget); col->name = relcache->attr[i].attrname; col->indirection = NIL; col->val = NULL; i_stmt->cols = lappend(i_stmt->cols, col); appended_columns_list[appended_columns++] = i; } } foreach(lc_row, selectStmt->valuesLists) { List *values = lfirst(lc_row); /* replace DEFAULT in VALUES to literal */ forboth(lc_col, i_stmt->cols, lc_val, values) { col = lfirst(lc_col); for (i = 0; i < relcache->relnatts; i++) { if (strcmp(relcache->attr[i].attrname, col->name) == 0) break; } if (relcache->attr[i].use_timestamp == true && IsA(lfirst(lc_val), SetToDefault)) { rewrite = true; if (ctx->rewrite_to_params) lfirst(lc_val) = makeTsExpr(ctx); else lfirst(lc_val) = makeStringConstFromQuery(ctx->backend, relcache->attr[i].adsrc); } } /* add timestamp value to values list */ for (i = 0; i < appended_columns; i++) { if (ctx->rewrite_to_params) values = lappend(values, makeTsExpr(ctx)); else values = lappend(values, makeStringConstFromQuery(ctx->backend, relcache->attr[appended_columns_list[i]].adsrc)); } } free(appended_columns_list); } } return rewrite; } /* * rewrite UpdateStmt */ static bool rewrite_timestamp_update(UpdateStmt *u_stmt, TSRewriteContext * ctx) { TSRel *relcache = NULL; ListCell *lc; bool rewrite; /* rewrite "update ... set col1 = now()" */ raw_expression_tree_walker( (Node *) u_stmt->targetList, rewrite_timestamp_walker, (void *) ctx); raw_expression_tree_walker( (Node *) u_stmt->whereClause, rewrite_timestamp_walker, (void *) ctx); raw_expression_tree_walker( (Node *) u_stmt->fromClause, rewrite_timestamp_walker, (void *) ctx); raw_expression_tree_walker( (Node *) u_stmt->withClause, rewrite_timestamp_walker, (void *) ctx); raw_expression_tree_walker( (Node *) u_stmt->returningList, rewrite_timestamp_walker, (void *) ctx); rewrite = ctx->rewrite; /* rewrite "update ... set col1 = default" */ foreach(lc, u_stmt->targetList) { ResTarget *res = (ResTarget *) lfirst(lc); int i; if (IsA(res->val, SetToDefault)) { relcache = relcache_lookup(ctx); if (relcache == NULL) return false; for (i = 0; i < relcache->relnatts; i++) { if (strcmp(relcache->attr[i].attrname, res->name) == 0) { if (relcache->attr[i].use_timestamp) { if (ctx->rewrite_to_params) res->val = (Node *) makeTsExpr(ctx); else res->val = (Node *) makeStringConstFromQuery(ctx->backend, relcache->attr[i].adsrc); rewrite = true; } break; } } } } return rewrite; } /* * Rewrite `now()' to timestamp literal. * If rewrite_to_params is false then, we rewrite `now()' to timestamp constant. * Otherwize, we rewrite `now()' to params and expand that at Bind message. * returns query string as palloced string, or NULL if not to need rewrite. */ char * rewrite_timestamp(POOL_CONNECTION_POOL * backend, Node *node, bool rewrite_to_params, POOL_SENT_MESSAGE * message) { TSRewriteContext ctx; Node *stmt; bool rewrite = false; char *timestamp; char *rewrite_query; if (node == NULL) return NULL; if (!REPLICATION) return NULL; /* init context */ ctx.ts_const = makeNode(A_Const); ctx.ts_const->val.type = T_String; ctx.rewrite_to_params = rewrite_to_params; ctx.backend = backend; ctx.num_params = 0; ctx.rewrite = false; ctx.params = NIL; /* * Prepare? */ if (IsA(node, PrepareStmt)) { stmt = ((PrepareStmt *) node)->query; ctx.rewrite_to_params = true; } /* * CopyStmt */ else if (IsA(node, CopyStmt) &&((CopyStmt *) node)->query != NULL) stmt = ((CopyStmt *) node)->query; /* * ExplainStmt */ else if (IsA(node, ExplainStmt)) { ListCell *lc; bool analyze = false; /* Check to see if this is EXPLAIN ANALYZE */ foreach(lc, ((ExplainStmt *) node)->options) { DefElem *opt = (DefElem *) lfirst(lc); if (strcmp(opt->defname, "analyze") == 0) { stmt = ((ExplainStmt *) node)->query; analyze = true; break; } } if (!analyze) return NULL; } else stmt = node; if (IsA(stmt, InsertStmt)) { InsertStmt *i_stmt = (InsertStmt *) stmt; ctx.relname = make_table_name_from_rangevar(i_stmt->relation); rewrite = rewrite_timestamp_insert(i_stmt, &ctx); } else if (IsA(stmt, UpdateStmt)) { UpdateStmt *u_stmt = (UpdateStmt *) stmt; ctx.relname = make_table_name_from_rangevar(u_stmt->relation); rewrite = rewrite_timestamp_update(u_stmt, &ctx); } else if (IsA(stmt, DeleteStmt)) { DeleteStmt *d_stmt = (DeleteStmt *) stmt; raw_expression_tree_walker( (Node *) d_stmt->usingClause, rewrite_timestamp_walker, (void *) &ctx); raw_expression_tree_walker( (Node *) d_stmt->whereClause, rewrite_timestamp_walker, (void *) &ctx); raw_expression_tree_walker( (Node *) d_stmt->returningList, rewrite_timestamp_walker, (void *) &ctx); raw_expression_tree_walker( (Node *) d_stmt->withClause, rewrite_timestamp_walker, (void *) &ctx); rewrite = ctx.rewrite; } else if (IsA(stmt, CopyStmt)) { CopyStmt *c_stmt = (CopyStmt *) stmt; raw_expression_tree_walker( (Node *) c_stmt->attlist, rewrite_timestamp_walker, (void *) &ctx); raw_expression_tree_walker( (Node *) c_stmt->options, rewrite_timestamp_walker, (void *) &ctx); raw_expression_tree_walker( (Node *) c_stmt->whereClause, rewrite_timestamp_walker, (void *) &ctx); rewrite = ctx.rewrite; } else if (IsA(stmt, ExecuteStmt)) { ExecuteStmt *e_stmt = (ExecuteStmt *) stmt; /* rewrite params */ raw_expression_tree_walker( (Node *) e_stmt->params, rewrite_timestamp_walker, (void *) &ctx); rewrite = ctx.rewrite; /* * add timestamp value into params list. The number of params is * stored in message */ if (message) { int i; for (i = 0; i < message->num_tsparams; i++) { e_stmt->params = lappend(e_stmt->params, ctx.ts_const); rewrite = true; } } } else if (IsA(stmt, CreateTableAsStmt)) { CreateTableAsStmt *c_stmt = (CreateTableAsStmt *) stmt; /* * CREATE TABLE t1 AS SELECT now(); */ if (IsA(c_stmt->query, SelectStmt) && c_stmt->relkind == OBJECT_TABLE) { /* rewrite params */ raw_expression_tree_walker( (Node *) c_stmt->query, rewrite_timestamp_walker, (void *) &ctx); rewrite = ctx.rewrite; } } else if (IsA(stmt, SelectStmt)) { SelectStmt *s_stmt = (SelectStmt *) stmt; /* * SELECT now() INTO t1; */ if (s_stmt->intoClause) { raw_expression_tree_walker( (Node *) s_stmt, rewrite_timestamp_walker, (void *) &ctx); } if (s_stmt->withClause) { raw_expression_tree_walker( (Node *) s_stmt->withClause, rewrite_timestamp_walker, (void *) &ctx); } rewrite = ctx.rewrite; } else ; /* * PREPARE, EXECUTE or Parse: save the number of parameters in the * original query */ if (message) message->query_context->num_original_params = ctx.num_params; /* don't rewrite the query if not necessary */ if (!rewrite) return NULL; /* * PREPARE or Parse: handle additinal parameters for timestamps */ if (ctx.rewrite_to_params && message) { ListCell *lc; int num = ctx.num_params + 1; /* renumber params */ foreach(lc, ctx.params) { ParamRef *param = (ParamRef *) lfirst(lc); param->number = num++; } /* save the number of additional params to portal */ message->num_tsparams = list_length(ctx.params); /* add type names of timestamptz into argtypes */ if (IsA(node, PrepareStmt)) { int i; PrepareStmt *p_stmt = (PrepareStmt *) node; for (i = 0; i < message->num_tsparams; i++) p_stmt->argtypes = lappend(p_stmt->argtypes, SystemTypeName("timestamptz")); } } else { timestamp = get_current_timestamp(backend); if (timestamp == NULL) { ereport(WARNING, (errmsg("rewrite timestamp failed, unable to get current timestamp"))); return NULL; } ctx.ts_const->val.val.str = timestamp; } rewrite_query = nodeToString(node); return rewrite_query; } /* * rewrite Bind message to add parameter values */ char * bind_rewrite_timestamp(POOL_CONNECTION_POOL * backend, POOL_SENT_MESSAGE * message, const char *orig_msg, int *len) { int16 tmp2, num_params, num_formats, num_formats_new; int32 tmp4; int i, ts_len, copy_len, num_org_params; const char *copy_from; char *ts, *copy_to, *new_msg; #ifdef TIMESTAMPDEBUG fprintf(stderr, "message length:%d\n", *len); for (i = 0; i < *len; i++) { fprintf(stderr, "%02x ", orig_msg[i]); } fprintf(stderr, "\n"); #endif ts = get_current_timestamp(backend); if (ts == NULL) { ereport(WARNING, (errmsg("bind rewrite timestamp failed, unable to get current timestamp"))); return NULL; } ts_len = strlen(ts); /* enlarge length for timestamp parameters */ *len += (ts_len + sizeof(int32)) * message->num_tsparams; /* allocate extra memory for parameter formats */ num_org_params = message->query_context->num_original_params; new_msg = copy_to = (char *) palloc(*len + sizeof(int16) * (message->num_tsparams + num_org_params)); copy_from = orig_msg; /* 1. portal_name */ copy_len = strlen(copy_from) + 1; memcpy(copy_to, copy_from, copy_len); copy_to += copy_len; copy_from += copy_len; /* 2. stmt_name */ copy_len = strlen(copy_from) + 1; memcpy(copy_to, copy_from, copy_len); copy_to += copy_len; copy_from += copy_len; /* 3. format codes */ /* 3.1. the number of format codes */ memcpy(&tmp2, copy_from, sizeof(int16)); num_formats = ntohs(tmp2); if (num_formats == 0) { /* * If num_formats is 0, the original message has no parameters or the parameter formats are all text, * so we don't need additional format codes since timestamp parametes use text as its format. */ num_formats_new = 0; } else { /* If num formats is 1, this means the specified format code is applied for all original parameters, * so enlarge message length to specify format codes for each of original paramters. */ if (num_formats == 1) *len += (num_org_params - 1) * sizeof(int16); /* enlarge message length for timestamp parameter's formats */ *len += message->num_tsparams * sizeof(int16); num_formats_new = num_org_params + message->num_tsparams; } /* copy the number of format codes */ tmp2 = htons(num_formats_new); copy_len = sizeof(int16); memcpy(copy_to, &tmp2, copy_len); copy_to += copy_len; copy_from += copy_len; /* 3.2. the format codes */ if (num_formats >= 1) { /* If num_formats is 1, copy the specified format code as numbers of original parameters */ if (num_formats == 1) { int16 org_format_code; memcpy(&org_format_code, copy_from, sizeof(int16)); copy_from += copy_len; for (i = 0; i < num_org_params; i++) { memcpy(copy_to, &org_format_code, sizeof(int16)); copy_to += sizeof(int16); } } /* otherwize, copy the original format codes as they are*/ else { copy_len = num_formats * sizeof(int16); memcpy(copy_to, copy_from, copy_len); copy_to += copy_len; copy_from += copy_len; } /* set additional format codes to zero(text) */ memset(copy_to, 0, message->num_tsparams * sizeof(int16)); copy_to += sizeof(int16) * message->num_tsparams; } /* 4. parameters */ /* num params */ memcpy(&tmp2, copy_from, sizeof(int16)); copy_len = sizeof(int16); num_params = ntohs(tmp2); tmp2 = htons(num_params + message->num_tsparams); memcpy(copy_to, &tmp2, sizeof(int16)); copy_to += copy_len; copy_from += copy_len; /* original params */ copy_len = 0; for (i = 0; i < num_params; i++) { memcpy(&tmp4, copy_from + copy_len, sizeof(int32)); tmp4 = ntohl(tmp4); /* param length */ copy_len += sizeof(int32); /* * If param length is -1, it indicates that the value is NULL and we * don't have value slot. So we don't add up copy_len. */ if (tmp4 > 0) { copy_len += tmp4; } } memcpy(copy_to, copy_from, copy_len); copy_to += copy_len; copy_from += copy_len; /* timestamp params */ tmp4 = htonl(ts_len); for (i = 0; i < message->num_tsparams; i++) { memcpy(copy_to, &tmp4, sizeof(int32)); copy_to += sizeof(int32); memcpy(copy_to, ts, ts_len); copy_to += ts_len; } /* 5. result format code */ memcpy(&tmp2, copy_from, sizeof(int16)); copy_len = sizeof(int16); copy_len += sizeof(int16) * ntohs(tmp2); memcpy(copy_to, copy_from, copy_len); #ifdef TIMESTAMPDEBUG fprintf(stderr, "message length:%d\n", *len); for(i = 0; i < *len; i++) { fprintf(stderr, "%02x ", new_msg[i]); } fprintf(stderr, "\n"); #endif return new_msg; } /* make A_Const of T_String from "SELECT "*/ static A_Const * makeStringConstFromQuery(POOL_CONNECTION_POOL * backend, char *expression) { A_Const *con; POOL_SELECT_RESULT *res; char query[1024]; int len; char *str; snprintf(query, sizeof(query), "SELECT %s", expression); do_query(MASTER(backend), query, &res, MAJOR(backend)); if (res->numrows != 1) { free_select_result(res); return NULL; } len = strlen(res->data[0]) + 1; str = palloc(len); strcpy(str, res->data[0]); free_select_result(res); con = makeNode(A_Const); con->val.type = T_String; con->val.val.str = str; return con; } static TypeCast * makeTypeCastFromSvfOp(SQLValueFunctionOp op) { TypeName *typename; Node *n; int location; switch (op) { case SVFOP_CURRENT_DATE: typename = SystemTypeName("date"); location = 0; break; case SVFOP_CURRENT_TIME: typename = SystemTypeName("timetz"); location = 0; break; case SVFOP_CURRENT_TIME_N: typename = SystemTypeName("timetz"); typename->typmods = lcons(makeIntConst(0, 0), NIL); location = -3; break; case SVFOP_CURRENT_TIMESTAMP: typename = SystemTypeName("timestamptz"); location = 0; break; case SVFOP_CURRENT_TIMESTAMP_N: typename = SystemTypeName("timestamptz"); typename->typmods = lcons(makeIntConst(0, 0), NIL); location = -3; break; case SVFOP_LOCALTIME: typename = SystemTypeName("time"); location = 0; break; case SVFOP_LOCALTIME_N: typename = SystemTypeName("time"); typename->typmods = lcons(makeIntConst(0, 0), NIL); location = -3; break; case SVFOP_LOCALTIMESTAMP: typename = SystemTypeName("timestamp"); location = 0; break; case SVFOP_LOCALTIMESTAMP_N: typename = SystemTypeName("timestamp"); typename->typmods = lcons(makeIntConst(0, 0), NIL); location = -3; break; case SVFOP_CURRENT_ROLE: case SVFOP_CURRENT_USER: case SVFOP_USER: case SVFOP_SESSION_USER: case SVFOP_CURRENT_CATALOG: case SVFOP_CURRENT_SCHEMA: typename = SystemTypeName("name"); location = 0; break; } n = makeStringConstCast("now", -1, SystemTypeName("text")); return (TypeCast *) makeTypeCast(n, typename, location); } /* from nodeFuncs.c start */ /* * raw_expression_tree_walker --- walk raw parse trees * * This has exactly the same API as expression_tree_walker, but instead of * walking post-analysis parse trees, it knows how to walk the node types * found in raw grammar output. (There is not currently any need for a * combined walker, so we keep them separate in the name of efficiency.) * Unlike expression_tree_walker, there is no special rule about query * boundaries: we descend to everything that's possibly interesting. * * Currently, the node type coverage extends to SelectStmt and everything * that could appear under it, but not other statement types. */ bool raw_expression_tree_walker(Node *node, bool (*walker) (), void *context) { ListCell *temp; /* * The walker has already visited the current node, and so we need only * recurse into any sub-nodes it has. */ if (node == NULL) return false; /* Guard against stack overflow due to overly complex expressions */ /* * check_stack_depth(); */ switch (nodeTag(node)) { case T_SetToDefault: case T_CurrentOfExpr: case T_Integer: case T_Float: case T_String: case T_BitString: case T_Null: case T_ParamRef: case T_A_Const: case T_A_Star: /* primitive node types with no subnodes */ break; case T_Alias: /* we assume the colnames list isn't interesting */ break; case T_RangeVar: return walker(((RangeVar *) node)->alias, context); case T_GroupingFunc: return walker(((GroupingFunc *) node)->args, context); case T_SubLink: { SubLink *sublink = (SubLink *) node; if (walker(sublink->testexpr, context)) return true; /* we assume the operName is not interesting */ if (walker(sublink->subselect, context)) return true; } break; case T_CaseExpr: { CaseExpr *caseexpr = (CaseExpr *) node; if (walker(caseexpr->arg, context)) return true; /* we assume walker doesn't care about CaseWhens, either */ foreach(temp, caseexpr->args) { CaseWhen *when = (CaseWhen *) lfirst(temp); Assert(IsA(when, CaseWhen)); if (walker(when->expr, context)) return true; if (walker(when->result, context)) return true; } if (walker(caseexpr->defresult, context)) return true; } break; case T_RowExpr: /* Assume colnames isn't interesting */ return walker(((RowExpr *) node)->args, context); case T_CoalesceExpr: return walker(((CoalesceExpr *) node)->args, context); case T_MinMaxExpr: return walker(((MinMaxExpr *) node)->args, context); case T_XmlExpr: { XmlExpr *xexpr = (XmlExpr *) node; if (walker(xexpr->named_args, context)) return true; /* we assume walker doesn't care about arg_names */ if (walker(xexpr->args, context)) return true; } break; case T_NullTest: return walker(((NullTest *) node)->arg, context); case T_BooleanTest: return walker(((BooleanTest *) node)->arg, context); case T_JoinExpr: { JoinExpr *join = (JoinExpr *) node; if (walker(join->larg, context)) return true; if (walker(join->rarg, context)) return true; if (walker(join->quals, context)) return true; if (walker(join->alias, context)) return true; /* using list is deemed uninteresting */ } break; case T_IntoClause: { IntoClause *into = (IntoClause *) node; if (walker(into->rel, context)) return true; /* colNames, options are deemed uninteresting */ /* viewQuery should be null in raw parsetree, but check it */ if (walker(into->viewQuery, context)) return true; } break; case T_List: foreach(temp, (List *) node) { if (walker((Node *) lfirst(temp), context)) return true; } break; case T_InsertStmt: { InsertStmt *stmt = (InsertStmt *) node; if (walker(stmt->relation, context)) return true; if (walker(stmt->cols, context)) return true; if (walker(stmt->selectStmt, context)) return true; if (walker(stmt->onConflictClause, context)) return true; if (walker(stmt->returningList, context)) return true; if (walker(stmt->withClause, context)) return true; } break; case T_DeleteStmt: { DeleteStmt *stmt = (DeleteStmt *) node; if (walker(stmt->relation, context)) return true; if (walker(stmt->usingClause, context)) return true; if (walker(stmt->whereClause, context)) return true; if (walker(stmt->returningList, context)) return true; if (walker(stmt->withClause, context)) return true; } break; case T_UpdateStmt: { UpdateStmt *stmt = (UpdateStmt *) node; if (walker(stmt->relation, context)) return true; if (walker(stmt->targetList, context)) return true; if (walker(stmt->whereClause, context)) return true; if (walker(stmt->fromClause, context)) return true; if (walker(stmt->returningList, context)) return true; if (walker(stmt->withClause, context)) return true; } break; case T_SelectStmt: { SelectStmt *stmt = (SelectStmt *) node; if (walker(stmt->distinctClause, context)) return true; if (walker(stmt->intoClause, context)) return true; if (walker(stmt->targetList, context)) return true; if (walker(stmt->fromClause, context)) return true; if (walker(stmt->whereClause, context)) return true; if (walker(stmt->groupClause, context)) return true; if (walker(stmt->havingClause, context)) return true; if (walker(stmt->windowClause, context)) return true; if (walker(stmt->valuesLists, context)) return true; if (walker(stmt->sortClause, context)) return true; if (walker(stmt->limitOffset, context)) return true; if (walker(stmt->limitCount, context)) return true; if (walker(stmt->lockingClause, context)) return true; if (walker(stmt->withClause, context)) return true; if (walker(stmt->larg, context)) return true; if (walker(stmt->rarg, context)) return true; } break; case T_A_Expr: { A_Expr *expr = (A_Expr *) node; if (walker(expr->lexpr, context)) return true; if (walker(expr->rexpr, context)) return true; /* operator name is deemed uninteresting */ } break; case T_BoolExpr: { BoolExpr *expr = (BoolExpr *) node; if (walker(expr->args, context)) return true; } break; case T_ColumnRef: /* we assume the fields contain nothing interesting */ break; case T_FuncCall: { FuncCall *fcall = (FuncCall *) node; if (walker(fcall->args, context)) return true; if (walker(fcall->agg_order, context)) return true; if (walker(fcall->agg_filter, context)) return true; if (walker(fcall->over, context)) return true; /* function name is deemed uninteresting */ } break; case T_NamedArgExpr: return walker(((NamedArgExpr *) node)->arg, context); case T_A_Indices: { A_Indices *indices = (A_Indices *) node; if (walker(indices->lidx, context)) return true; if (walker(indices->uidx, context)) return true; } break; case T_A_Indirection: { A_Indirection *indir = (A_Indirection *) node; if (walker(indir->arg, context)) return true; if (walker(indir->indirection, context)) return true; } break; case T_A_ArrayExpr: return walker(((A_ArrayExpr *) node)->elements, context); case T_ResTarget: { ResTarget *rt = (ResTarget *) node; if (walker(rt->indirection, context)) return true; if (walker(rt->val, context)) return true; } break; case T_MultiAssignRef: return walker(((MultiAssignRef *) node)->source, context); case T_TypeCast: { TypeCast *tc = (TypeCast *) node; if (walker(tc->arg, context)) return true; if (walker(tc->typeName, context)) return true; } break; case T_CollateClause: return walker(((CollateClause *) node)->arg, context); case T_SortBy: return walker(((SortBy *) node)->node, context); case T_WindowDef: { WindowDef *wd = (WindowDef *) node; if (walker(wd->partitionClause, context)) return true; if (walker(wd->orderClause, context)) return true; if (walker(wd->startOffset, context)) return true; if (walker(wd->endOffset, context)) return true; } break; case T_RangeSubselect: { RangeSubselect *rs = (RangeSubselect *) node; if (walker(rs->subquery, context)) return true; if (walker(rs->alias, context)) return true; } break; case T_RangeFunction: { RangeFunction *rf = (RangeFunction *) node; if (walker(rf->functions, context)) return true; if (walker(rf->alias, context)) return true; if (walker(rf->coldeflist, context)) return true; } break; case T_RangeTableSample: { RangeTableSample *rts = (RangeTableSample *) node; if (walker(rts->relation, context)) return true; /* method name is deemed uninteresting */ if (walker(rts->args, context)) return true; if (walker(rts->repeatable, context)) return true; } break; case T_TypeName: { TypeName *tn = (TypeName *) node; if (walker(tn->typmods, context)) return true; if (walker(tn->arrayBounds, context)) return true; /* type name itself is deemed uninteresting */ } break; case T_ColumnDef: { ColumnDef *coldef = (ColumnDef *) node; if (walker(coldef->typeName, context)) return true; if (walker(coldef->raw_default, context)) return true; if (walker(coldef->collClause, context)) return true; /* for now, constraints are ignored */ } break; case T_GroupingSet: return walker(((GroupingSet *) node)->content, context); case T_LockingClause: return walker(((LockingClause *) node)->lockedRels, context); case T_XmlSerialize: { XmlSerialize *xs = (XmlSerialize *) node; if (walker(xs->expr, context)) return true; if (walker(xs->typeName, context)) return true; } break; case T_WithClause: return walker(((WithClause *) node)->ctes, context); case T_InferClause: { InferClause *stmt = (InferClause *) node; if (walker(stmt->indexElems, context)) return true; if (walker(stmt->whereClause, context)) return true; } break; case T_OnConflictClause: { OnConflictClause *stmt = (OnConflictClause *) node; if (walker(stmt->infer, context)) return true; if (walker(stmt->targetList, context)) return true; if (walker(stmt->whereClause, context)) return true; } break; case T_CommonTableExpr: return walker(((CommonTableExpr *) node)->ctequery, context); default: /* * elog(ERROR, "unrecognized node type: %d", (int) nodeTag(node)); */ break; } return false; } /* from nodeFuncs.c end */ pgpool-II-4.1.4/src/rewrite/pool_lobj.c0000664000175000017500000001631213730350127014641 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_lobj.c: Transparently translate lo_creat call to lo_create so * that large objects replicated safely. * lo_create anyway. */ #include "config.h" #include #include #include #include #include "pool.h" #include "rewrite/pool_lobj.h" #include "utils/pool_relcache.h" #include "utils/elog.h" #include "pool_config.h" /* * Rewrite lo_creat call to lo_create call if: * 1) it's a lo_creat function call * 2) PostgreSQL has lo_create * 3) In replication mode * 4) lobj_lock_table exists and writable to everyone * * The argument for lo_create is created by fetching max(loid)+1 from * pg_largeobject. To avoid race condition, we lock lobj_lock_table. * * Caller should call this only if protocol is V3 or higher(for * now. There's no reason for this function not working with V2 * protocol). Return value is a rewritten packet without kind and * length. This is allocated in a static memory. New packet length is * set to *len. */ char * pool_rewrite_lo_creat(char kind, char *packet, int packet_len, POOL_CONNECTION * frontend, POOL_CONNECTION_POOL * backend, int *len) { #define LO_CREAT_OID_QUERY "SELECT oid FROM pg_catalog.pg_proc WHERE proname = 'lo_creat' and pronamespace = (SELECT oid FROM pg_catalog.pg_namespace WHERE nspname = 'pg_catalog')" #define LO_CREATE_OID_QUERY "SELECT oid FROM pg_catalog.pg_proc WHERE proname = 'lo_create' and pronamespace = (SELECT oid FROM pg_catalog.pg_namespace WHERE nspname = 'pg_catalog')" #define LO_CREATE_PACKET_LENGTH sizeof(int32)*3+sizeof(int16)*4 #define LOCK_QUERY "LOCK TABLE %s IN SHARE ROW EXCLUSIVE MODE" #define GET_MAX_LOBJ_KEY "SELECT coalesce(max(loid)::INTEGER, 0)+1 FROM pg_catalog.pg_largeobject" static char rewritten_packet[LO_CREATE_PACKET_LENGTH]; static POOL_RELCACHE * relcache_lo_creat; static POOL_RELCACHE * relcache_lo_create; int lo_creat_oid; int lo_create_oid; int orig_fcall_oid; POOL_STATUS status; char qbuf[1024]; char *p; POOL_SELECT_RESULT *result; int lobjid; int32 int32val; int16 int16val; int16 result_format_code; if (kind != 'F') return NULL; /* not function call */ if (!strcmp(pool_config->lobj_lock_table, "")) return NULL; /* no lock table */ if (!REPLICATION) return NULL; /* not in replication mode */ /* * If relcache does not exist, create it. */ if (!relcache_lo_creat) { relcache_lo_creat = pool_create_relcache(1, LO_CREAT_OID_QUERY, int_register_func, int_unregister_func, false); if (relcache_lo_creat == NULL) { ereport(WARNING, (errmsg("unable to create relcache, while rewriting LO CREATE"))); return NULL; } } /* * Get lo_creat oid */ lo_creat_oid = (int) (intptr_t) pool_search_relcache(relcache_lo_creat, backend, "pg_proc"); memmove(&orig_fcall_oid, packet, sizeof(int32)); orig_fcall_oid = ntohl(orig_fcall_oid); ereport(DEBUG1, (errmsg("rewriting LO CREATE"), errdetail("orig_fcall_oid:% d lo_creat_oid: %d", orig_fcall_oid, lo_creat_oid))); /* * This function call is calling lo_creat? */ if (orig_fcall_oid != lo_creat_oid) return NULL; /* * If relcache does not exist, create it. */ if (!relcache_lo_create) { relcache_lo_create = pool_create_relcache(1, LO_CREATE_OID_QUERY, int_register_func, int_unregister_func, false); if (relcache_lo_create == NULL) { ereport(LOG, (errmsg("rewriting LO CREATE, unable to create relcache"))); return NULL; } } /* * Get lo_create oid */ lo_create_oid = (int) (intptr_t) pool_search_relcache(relcache_lo_create, backend, "pg_proc"); ereport(DEBUG1, (errmsg("rewriting LO CREATE"), errdetail("lo_creat_oid: %d lo_create_oid: %d", lo_creat_oid, lo_create_oid))); /* * Parse input packet */ memmove(&int16val, packet + packet_len - sizeof(int16), sizeof(int16)); result_format_code = ntohs(int16val); /* sanity check */ if (result_format_code != 0 && result_format_code != 1) { ereport(LOG, (errmsg("rewriting LO CREATE, invalid return format code: %d", int16val))); return NULL; } ereport(DEBUG1, (errmsg("rewriting LO CREATE"), errdetail("return format code: %d", int16val))); /* * Ok, do it... */ /* issue lock table command to lob_lock_table */ snprintf(qbuf, sizeof(qbuf), "LOCK TABLE %s IN SHARE ROW EXCLUSIVE MODE", pool_config->lobj_lock_table); per_node_statement_log(backend, MASTER_NODE_ID, qbuf); status = do_command(frontend, MASTER(backend), qbuf, MAJOR(backend), MASTER_CONNECTION(backend)->pid, MASTER_CONNECTION(backend)->key, 0); if (status == POOL_END) { ereport(WARNING, (errmsg("rewriting LO CREATE, failed to execute LOCK"))); return NULL; } /* * If transaction state is E, do_command failed to execute command */ if (TSTATE(backend, MASTER_NODE_ID) == 'E') { ereport(LOG, (errmsg("failed while rewriting LO CREATE"), errdetail("failed to execute: %s", qbuf))); return NULL; } /* get max lobj id */ per_node_statement_log(backend, MASTER_NODE_ID, GET_MAX_LOBJ_KEY); do_query(MASTER(backend), GET_MAX_LOBJ_KEY, &result, MAJOR(backend)); if (!result) { ereport(LOG, (errmsg("failed while rewriting LO CREATE"), errdetail("failed to execute: %s", GET_MAX_LOBJ_KEY))); return NULL; } lobjid = atoi(result->data[0]); ereport(DEBUG1, (errmsg("rewriting LO CREATE"), errdetail("lobjid:%d", lobjid))); free_select_result(result); /* sanity check */ if (lobjid <= 0) { ereport(WARNING, (errmsg("rewriting LO CREATE, wrong lob id: %d", lobjid))); return NULL; } /* * Create lo_create call packet */ p = rewritten_packet; *len = LO_CREATE_PACKET_LENGTH; int32val = htonl(lo_create_oid); memmove(p, &int32val, sizeof(int32)); /* lo_create oid */ p += sizeof(int32); int16val = htons(1); memmove(p, &int16val, sizeof(int16)); /* number of argument format code */ p += sizeof(int16); int16val = htons(1); memmove(p, &int16val, sizeof(int16)); /* format code */ p += sizeof(int16); int16val = htons(1); memmove(p, &int16val, sizeof(int16)); /* number of arguments */ p += sizeof(int16); int32val = htonl(4); memmove(p, &int32val, sizeof(int32)); /* argument length */ p += sizeof(int32); int32val = htonl(lobjid); memmove(p, &int32val, sizeof(int32)); /* argument(lobj id) */ p += sizeof(int32); int16val = htons(result_format_code); memmove(p, &int16val, sizeof(int16)); /* result format code */ return rewritten_packet; } pgpool-II-4.1.4/src/sample/0000775000175000017500000000000013730350746012402 500000000000000pgpool-II-4.1.4/src/sample/scripts/0000775000175000017500000000000013730350746014071 500000000000000pgpool-II-4.1.4/src/sample/scripts/failover.sh.sample0000775000175000017500000000530413730350075017434 00000000000000#!/bin/bash # This script is run by failover_command. set -o xtrace exec > >(logger -i -p local1.info) 2>&1 # Special values: # %d = failed node id # %h = failed node hostname # %p = failed node port number # %D = failed node database cluster path # %m = new master node id # %H = new master node hostname # %M = old master node id # %P = old primary node id # %r = new master port number # %R = new master database cluster path # %N = old primary node hostname # %S = old primary node port number # %% = '%' character FAILED_NODE_ID="$1" FAILED_NODE_HOST="$2" FAILED_NODE_PORT="$3" FAILED_NODE_PGDATA="$4" NEW_MASTER_NODE_ID="$5" NEW_MASTER_NODE_HOST="$6" OLD_MASTER_NODE_ID="$7" OLD_PRIMARY_NODE_ID="$8" NEW_MASTER_NODE_PORT="$9" NEW_MASTER_NODE_PGDATA="${10}" OLD_PRIMARY_NODE_HOST="${11}" OLD_PRIMARY_NODE_PORT="${12}" PGHOME=/usr/pgsql-11 logger -i -p local1.info failover.sh: start: failed_node_id=$FAILED_NODE_ID old_primary_node_id=$OLD_PRIMARY_NODE_ID failed_host=$FAILED_NODE_HOST new_master_host=$NEW_MASTER_NODE_HOST ## If there's no master node anymore, skip failover. if [ $NEW_MASTER_NODE_ID -lt 0 ]; then logger -i -p local1.info failover.sh: All nodes are down. Skipping failover. exit 0 fi ## Test passwrodless SSH ssh -T -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null postgres@${NEW_MASTER_NODE_HOST} -i ~/.ssh/id_rsa_pgpool ls /tmp > /dev/null if [ $? -ne 0 ]; then logger -i -p local1.info failover.sh: passwrodless SSH to postgres@${NEW_MASTER_NODE_HOST} failed. Please setup passwrodless SSH. exit 1 fi ## If Standby node is down, skip failover. if [ $FAILED_NODE_ID -ne $OLD_PRIMARY_NODE_ID ]; then logger -i -p local1.info failover.sh: Standby node is down. Skipping failover. ssh -T -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null postgres@$OLD_PRIMARY_NODE_HOST -i ~/.ssh/id_rsa_pgpool " ${PGHOME}/bin/psql -p $OLD_PRIMARY_NODE_PORT -c \"SELECT pg_drop_replication_slot('${FAILED_NODE_HOST}')\" " if [ $? -ne 0 ]; then logger -i -p local1.error failover.sh: drop replication slot "${FAILED_NODE_HOST}" failed exit 1 fi exit 0 fi ## Promote Standby node. logger -i -p local1.info failover.sh: Primary node is down, promote standby node ${NEW_MASTER_NODE_HOST}. ssh -T -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null \ postgres@${NEW_MASTER_NODE_HOST} -i ~/.ssh/id_rsa_pgpool ${PGHOME}/bin/pg_ctl -D ${NEW_MASTER_NODE_PGDATA} -w promote if [ $? -ne 0 ]; then logger -i -p local1.error failover.sh: new_master_host=$NEW_MASTER_NODE_HOST promote failed exit 1 fi logger -i -p local1.info failover.sh: end: new_master_node_id=$NEW_MASTER_NODE_ID started as the primary node exit 0 pgpool-II-4.1.4/src/sample/scripts/follow_master.sh.sample0000775000175000017500000001465713730350075020515 00000000000000#!/bin/bash # This script is run after failover_command to synchronize the Standby with the new Primary. # First try pg_rewind. If pg_rewind failed, use pg_basebackup. set -o xtrace exec > >(logger -i -p local1.info) 2>&1 # Special values: # %d = failed node id # %h = failed node hostname # %p = failed node port number # %D = failed node database cluster path # %m = new master node id # %H = new master node hostname # %M = old master node id # %P = old primary node id # %r = new master port number # %R = new master database cluster path # %N = old primary node hostname # %S = old primary node port number # %% = '%' character FAILED_NODE_ID="$1" FAILED_NODE_HOST="$2" FAILED_NODE_PORT="$3" FAILED_NODE_PGDATA="$4" NEW_MASTER_NODE_ID="$5" NEW_MASTER_NODE_HOST="$6" OLD_MASTER_NODE_ID="$7" OLD_PRIMARY_NODE_ID="$8" NEW_MASTER_NODE_PORT="$9" NEW_MASTER_NODE_PGDATA="${10}" PGHOME=/usr/pgsql-11 ARCHIVEDIR=/var/lib/pgsql/archivedir REPLUSER=repl PCP_USER=pgpool PGPOOL_PATH=/usr/bin PCP_PORT=9898 logger -i -p local1.info follow_master.sh: start: Standby node ${FAILED_NODE_ID} ## Test passwrodless SSH ssh -T -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null postgres@${NEW_MASTER_NODE_HOST} -i ~/.ssh/id_rsa_pgpool ls /tmp > /dev/null if [ $? -ne 0 ]; then logger -i -p local1.info follow_master.sh: passwrodless SSH to postgres@${NEW_MASTER_NODE_HOST} failed. Please setup passwrodless SSH. exit 1 fi ## Get PostgreSQL major version PGVERSION=`${PGHOME}/bin/initdb -V | awk '{print $3}' | sed 's/\..*//' | sed 's/\([0-9]*\)[a-zA-Z].*/\1/'` if [ $PGVERSION -ge 12 ]; then RECOVERYCONF=${FAILED_NODE_PGDATA}/myrecovery.conf else RECOVERYCONF=${FAILED_NODE_PGDATA}/recovery.conf fi ## Check the status of Standby ssh -T -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null \ postgres@${FAILED_NODE_HOST} -i ~/.ssh/id_rsa_pgpool ${PGHOME}/bin/pg_ctl -w -D ${FAILED_NODE_PGDATA} status ## If Standby is running, synchronize it with the new Primary. if [ $? -eq 0 ]; then logger -i -p local1.info follow_master.sh: pg_rewind for $FAILED_NODE_ID # Create replication slot "${FAILED_NODE_HOST}" ssh -T -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null postgres@${NEW_MASTER_NODE_HOST} -i ~/.ssh/id_rsa_pgpool " ${PGHOME}/bin/psql -p ${NEW_MASTER_NODE_PORT} -c \"SELECT pg_create_physical_replication_slot('${FAILED_NODE_HOST}');\" " ssh -T -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null postgres@${FAILED_NODE_HOST} -i ~/.ssh/id_rsa_pgpool " set -o errexit ${PGHOME}/bin/pg_ctl -w -m f -D ${FAILED_NODE_PGDATA} stop cat > ${RECOVERYCONF} << EOT primary_conninfo = 'host=${NEW_MASTER_NODE_HOST} port=${NEW_MASTER_NODE_PORT} user=${REPLUSER} application_name=${FAILED_NODE_HOST} passfile=''/var/lib/pgsql/.pgpass''' recovery_target_timeline = 'latest' restore_command = 'scp ${NEW_MASTER_NODE_HOST}:${ARCHIVEDIR}/%f %p' primary_slot_name = '${FAILED_NODE_HOST}' EOT if [ ${PGVERSION} -ge 12 ]; then touch ${FAILED_NODE_PGDATA}/standby.signal else echo \"standby_mode = 'on'\" >> ${RECOVERYCONF} fi ${PGHOME}/bin/pg_rewind -D ${FAILED_NODE_PGDATA} --source-server=\"user=postgres host=${NEW_MASTER_NODE_HOST} port=${NEW_MASTER_NODE_PORT}\" " if [ $? -ne 0 ]; then logger -i -p local1.error follow_master.sh: end: pg_rewind failed. Try pg_basebackup. ssh -T -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null postgres@${FAILED_NODE_HOST} -i ~/.ssh/id_rsa_pgpool " set -o errexit # Execute pg_basebackup rm -rf ${FAILED_NODE_PGDATA} rm -rf ${ARCHIVEDIR}/* ${PGHOME}/bin/pg_basebackup -h ${NEW_MASTER_NODE_HOST} -U $REPLUSER -p ${NEW_MASTER_NODE_PORT} -D ${FAILED_NODE_PGDATA} -X stream if [ ${PGVERSION} -ge 12 ]; then sed -i -e \"\\\$ainclude_if_exists = '$(echo ${RECOVERYCONF} | sed -e 's/\//\\\//g')'\" \ -e \"/^include_if_exists = '$(echo ${RECOVERYCONF} | sed -e 's/\//\\\//g')'/d\" ${FAILED_NODE_PGDATA}/postgresql.conf fi cat > ${RECOVERYCONF} << EOT primary_conninfo = 'host=${NEW_MASTER_NODE_HOST} port=${NEW_MASTER_NODE_PORT} user=${REPLUSER} application_name=${FAILED_NODE_HOST} passfile=''/var/lib/pgsql/.pgpass''' recovery_target_timeline = 'latest' restore_command = 'scp ${NEW_MASTER_NODE_HOST}:${ARCHIVEDIR}/%f %p' primary_slot_name = '${FAILED_NODE_HOST}' EOT if [ ${PGVERSION} -ge 12 ]; then touch ${FAILED_NODE_PGDATA}/standby.signal else echo \"standby_mode = 'on'\" >> ${RECOVERYCONF} fi " if [ $? -ne 0 ]; then # drop replication slot ssh -T -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null postgres@${NEW_MASTER_NODE_HOST} -i ~/.ssh/id_rsa_pgpool " ${PGHOME}/bin/psql -p ${NEW_MASTER_NODE_PORT} -c \"SELECT pg_drop_replication_slot('${FAILED_NODE_HOST}')\" " logger -i -p local1.error follow_master.sh: end: pg_basebackup failed exit 1 fi fi # start Standby node on ${FAILED_NODE_HOST} ssh -T -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null \ postgres@${FAILED_NODE_HOST} -i ~/.ssh/id_rsa_pgpool $PGHOME/bin/pg_ctl -l /dev/null -w -D ${FAILED_NODE_PGDATA} start # If start Standby successfully, attach this node if [ $? -eq 0 ]; then # Run pcp_attact_node to attach Standby node to Pgpool-II. ${PGPOOL_PATH}/pcp_attach_node -w -h localhost -U $PCP_USER -p ${PCP_PORT} -n ${FAILED_NODE_ID} if [ $? -ne 0 ]; then logger -i -p local1.error follow_master.sh: end: pcp_attach_node failed exit 1 fi # If start Standby failed, drop replication slot "${FAILED_NODE_HOST}" else ssh -T -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null postgres@${NEW_MASTER_NODE_HOST} -i ~/.ssh/id_rsa_pgpool \ ${PGHOME}/bin/psql -p ${NEW_MASTER_NODE_PORT} -c "SELECT pg_drop_replication_slot('${FAILED_NODE_HOST}')" logger -i -p local1.error follow_master.sh: end: follow master command failed exit 1 fi else logger -i -p local1.info follow_master.sh: failed_nod_id=${FAILED_NODE_ID} is not running. skipping follow master command exit 0 fi logger -i -p local1.info follow_master.sh: end: follow master command complete exit 0 pgpool-II-4.1.4/src/sample/scripts/pgpool_remote_start.sample0000775000175000017500000000207013730350075021301 00000000000000#!/bin/bash # This script is run after recovery_1st_stage to start Standby node. set -o xtrace exec > >(logger -i -p local1.info) 2>&1 DEST_NODE_HOST="$1" DEST_NODE_PGDATA="$2" PGHOME=/usr/pgsql-11 logger -i -p local1.info pgpool_remote_start: start: remote start Standby node $DEST_NODE_HOST ## Test passwrodless SSH ssh -T -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null postgres@${DEST_NODE_HOST} -i ~/.ssh/id_rsa_pgpool ls /tmp > /dev/null if [ $? -ne 0 ]; then logger -i -p local1.info pgpool_remote_start: passwrodless SSH to postgres@${DEST_NODE_HOST} failed. Please setup passwrodless SSH. exit 1 fi ## Start Standby node ssh -T -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null postgres@$DEST_NODE_HOST -i ~/.ssh/id_rsa_pgpool " $PGHOME/bin/pg_ctl -l /dev/null -w -D $DEST_NODE_PGDATA start " if [ $? -ne 0 ]; then logger -i -p local1.error pgpool_remote_start: $DEST_NODE_HOST PostgreSQL start failed. exit 1 fi logger -i -p local1.info pgpool_remote_start: end: $DEST_NODE_HOST PostgreSQL started successfully. exit 0 pgpool-II-4.1.4/src/sample/scripts/recovery_1st_stage.sample0000775000175000017500000000541613730350075021030 00000000000000#!/bin/bash # This script is executed by "recovery_1st_stage" to recovery a Standby node. set -o xtrace exec > >(logger -i -p local1.info) 2>&1 PRIMARY_NODE_PGDATA="$1" DEST_NODE_HOST="$2" DEST_NODE_PGDATA="$3" PRIMARY_NODE_PORT="$4" DEST_NODE_ID="$5" DEST_NODE_PORT="$6" PRIMARY_NODE_HOST=$(hostname) PGHOME=/usr/pgsql-11 ARCHIVEDIR=/var/lib/pgsql/archivedir REPLUSER=repl logger -i -p local1.info recovery_1st_stage: start: pg_basebackup for Standby node $DEST_NODE_ID ## Test passwrodless SSH ssh -T -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null postgres@${DEST_NODE_HOST} -i ~/.ssh/id_rsa_pgpool ls /tmp > /dev/null if [ $? -ne 0 ]; then logger -i -p local1.info recovery_1st_stage: passwrodless SSH to postgres@${DEST_NODE_HOST} failed. Please setup passwrodless SSH. exit 1 fi ## Get PostgreSQL major version PGVERSION=`${PGHOME}/bin/initdb -V | awk '{print $3}' | sed 's/\..*//' | sed 's/\([0-9]*\)[a-zA-Z].*/\1/'` if [ $PGVERSION -ge 12 ]; then RECOVERYCONF=${DEST_NODE_PGDATA}/myrecovery.conf else RECOVERYCONF=${DEST_NODE_PGDATA}/recovery.conf fi ## Create replication slot "${DEST_NODE_HOST}" ${PGHOME}/bin/psql -p ${PRIMARY_NODE_PORT} << EOQ SELECT pg_create_physical_replication_slot('${DEST_NODE_HOST}'); EOQ ## Execute pg_basebackup to recovery Standby node ssh -T -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null postgres@$DEST_NODE_HOST -i ~/.ssh/id_rsa_pgpool " set -o errexit rm -rf $DEST_NODE_PGDATA rm -rf $ARCHIVEDIR/* ${PGHOME}/bin/pg_basebackup -h $PRIMARY_NODE_HOST -U $REPLUSER -p $PRIMARY_NODE_PORT -D $DEST_NODE_PGDATA -X stream if [ ${PGVERSION} -ge 12 ]; then sed -i -e \"\\\$ainclude_if_exists = '$(echo ${RECOVERYCONF} | sed -e 's/\//\\\//g')'\" \ -e \"/^include_if_exists = '$(echo ${RECOVERYCONF} | sed -e 's/\//\\\//g')'/d\" ${DEST_NODE_PGDATA}/postgresql.conf fi cat > ${RECOVERYCONF} << EOT primary_conninfo = 'host=${PRIMARY_NODE_HOST} port=${PRIMARY_NODE_PORT} user=${REPLUSER} application_name=${DEST_NODE_HOST} passfile=''/var/lib/pgsql/.pgpass''' recovery_target_timeline = 'latest' restore_command = 'scp ${PRIMARY_NODE_HOST}:${ARCHIVEDIR}/%f %p' primary_slot_name = '${DEST_NODE_HOST}' EOT if [ ${PGVERSION} -ge 12 ]; then touch ${DEST_NODE_PGDATA}/standby.signal else echo \"standby_mode = 'on'\" >> ${RECOVERYCONF} fi sed -i \"s/#*port = .*/port = ${DEST_NODE_PORT}/\" ${DEST_NODE_PGDATA}/postgresql.conf " if [ $? -ne 0 ]; then ${PGHOME}/bin/psql -p ${PRIMARY_NODE_PORT} << EOQ SELECT pg_drop_replication_slot('${DEST_NODE_HOST}'); EOQ logger -i -p local1.error recovery_1st_stage: end: pg_basebackup failed. online recovery failed exit 1 fi logger -i -p local1.info recovery_1st_stage: end: recovery_1st_stage complete exit 0 pgpool-II-4.1.4/src/sample/scripts/recovery_2nd_stage.sample0000775000175000017500000000131013730350075020771 00000000000000#! /bin/sh # Online recovery 2nd stage script # DATADIR=$1 # master dabatase cluster DEST=$2 # hostname of the DB node to be recovered DESTDIR=$3 # database cluster of the DB node to be recovered PORT=$4 # PostgreSQL port number PGHOME=/usr/pgsql-11 ARCHIVEDIR=/var/lib/pgsql/archivedir # archive log directory # Force to flush current value of sequences to xlog ${PGHOME}/bin/psql -p $PORT -t -c 'SELECT datname FROM pg_database WHERE NOT datistemplate AND datallowconn' template1| while read i do if [ "$i" != "" ]; then psql -p $PORT -c "SELECT setval(oid, nextval(oid)) FROM pg_class WHERE relkind = 'S'" $i fi done psql -p $PORT -c "SELECT pgpool_switch_xlog('$ARCHIVEDIR')" template1 pgpool-II-4.1.4/src/sample/pgpool.pam0000664000175000017500000000010713730350075014312 00000000000000#%PAM-1.0 auth required pam_permit.so account required pam_permit.so pgpool-II-4.1.4/src/sample/pgpool.conf.sample0000664000175000017500000012477113730350127015756 00000000000000# ---------------------------- # pgPool-II configuration file # ---------------------------- # # This file consists of lines of the form: # # name = value # # Whitespace may be used. Comments are introduced with "#" anywhere on a line. # The complete list of parameter names and allowed values can be found in the # pgPool-II documentation. # # This file is read on server startup and when the server receives a SIGHUP # signal. If you edit the file on a running system, you have to SIGHUP the # server for the changes to take effect, or use "pgpool reload". Some # parameters, which are marked below, require a server shutdown and restart to # take effect. # #------------------------------------------------------------------------------ # CONNECTIONS #------------------------------------------------------------------------------ # - pgpool Connection Settings - listen_addresses = 'localhost' # Host name or IP address to listen on: # '*' for all, '' for no TCP/IP connections # (change requires restart) port = 9999 # Port number # (change requires restart) socket_dir = '/tmp' # Unix domain socket path # The Debian package defaults to # /var/run/postgresql # (change requires restart) listen_backlog_multiplier = 2 # Set the backlog parameter of listen(2) to # num_init_children * listen_backlog_multiplier. # (change requires restart) serialize_accept = off # whether to serialize accept() call to avoid thundering herd problem # (change requires restart) reserved_connections = 0 # Number of reserved connections. # Pgpool-II does not accept connections if over # num_init_chidlren - reserved_connections. # - pgpool Communication Manager Connection Settings - pcp_listen_addresses = '*' # Host name or IP address for pcp process to listen on: # '*' for all, '' for no TCP/IP connections # (change requires restart) pcp_port = 9898 # Port number for pcp # (change requires restart) pcp_socket_dir = '/tmp' # Unix domain socket path for pcp # The Debian package defaults to # /var/run/postgresql # (change requires restart) # - Backend Connection Settings - backend_hostname0 = 'localhost' # Host name or IP address to connect to for backend 0 backend_port0 = 5432 # Port number for backend 0 backend_weight0 = 1 # Weight for backend 0 (only in load balancing mode) backend_data_directory0 = '/var/lib/pgsql/data' # Data directory for backend 0 backend_flag0 = 'ALLOW_TO_FAILOVER' # Controls various backend behavior # ALLOW_TO_FAILOVER, DISALLOW_TO_FAILOVER # or ALWAYS_MASTER backend_application_name0 = 'server0' # walsender's application_name, used for "show pool_nodes" command #backend_hostname1 = 'host2' #backend_port1 = 5433 #backend_weight1 = 1 #backend_data_directory1 = '/data1' #backend_flag1 = 'ALLOW_TO_FAILOVER' #backend_application_name1 = 'server1' # - Authentication - enable_pool_hba = off # Use pool_hba.conf for client authentication pool_passwd = 'pool_passwd' # File name of pool_passwd for md5 authentication. # "" disables pool_passwd. # (change requires restart) authentication_timeout = 60 # Delay in seconds to complete client authentication # 0 means no timeout. allow_clear_text_frontend_auth = off # Allow Pgpool-II to use clear text password authentication # with clients, when pool_passwd does not # contain the user password # - SSL Connections - ssl = off # Enable SSL support # (change requires restart) #ssl_key = './server.key' # Path to the SSL private key file # (change requires restart) #ssl_cert = './server.cert' # Path to the SSL public certificate file # (change requires restart) #ssl_ca_cert = '' # Path to a single PEM format file # containing CA root certificate(s) # (change requires restart) #ssl_ca_cert_dir = '' # Directory containing CA root certificate(s) # (change requires restart) ssl_ciphers = 'HIGH:MEDIUM:+3DES:!aNULL' # Allowed SSL ciphers # (change requires restart) ssl_prefer_server_ciphers = off # Use server's SSL cipher preferences, # rather than the client's # (change requires restart) ssl_ecdh_curve = 'prime256v1' # Name of the curve to use in ECDH key exchange ssl_dh_params_file = '' # Name of the file containing Diffie-Hellman parameters used # for so-called ephemeral DH family of SSL cipher. #------------------------------------------------------------------------------ # POOLS #------------------------------------------------------------------------------ # - Concurrent session and pool size - num_init_children = 32 # Number of concurrent sessions allowed # (change requires restart) max_pool = 4 # Number of connection pool caches per connection # (change requires restart) # - Life time - child_life_time = 300 # Pool exits after being idle for this many seconds child_max_connections = 0 # Pool exits after receiving that many connections # 0 means no exit connection_life_time = 0 # Connection to backend closes after being idle for this many seconds # 0 means no close client_idle_limit = 0 # Client is disconnected after being idle for that many seconds # (even inside an explicit transactions!) # 0 means no disconnection #------------------------------------------------------------------------------ # LOGS #------------------------------------------------------------------------------ # - Where to log - log_destination = 'stderr' # Where to log # Valid values are combinations of stderr, # and syslog. Default to stderr. # - What to log - log_line_prefix = '%t: pid %p: ' # printf-style string to output at beginning of each log line. log_connections = off # Log connections log_hostname = off # Hostname will be shown in ps status # and in logs if connections are logged log_statement = off # Log all statements log_per_node_statement = off # Log all statements # with node and backend informations log_client_messages = off # Log any client messages log_standby_delay = 'none' # Log standby delay # Valid values are combinations of always, # if_over_threshold, none # - Syslog specific - syslog_facility = 'LOCAL0' # Syslog local facility. Default to LOCAL0 syslog_ident = 'pgpool' # Syslog program identification string # Default to 'pgpool' # - Debug - #log_error_verbosity = default # terse, default, or verbose messages #client_min_messages = notice # values in order of decreasing detail: # debug5 # debug4 # debug3 # debug2 # debug1 # log # notice # warning # error #log_min_messages = warning # values in order of decreasing detail: # debug5 # debug4 # debug3 # debug2 # debug1 # info # notice # warning # error # log # fatal # panic #------------------------------------------------------------------------------ # FILE LOCATIONS #------------------------------------------------------------------------------ pid_file_name = '/var/run/pgpool/pgpool.pid' # PID file name # Can be specified as relative to the" # location of pgpool.conf file or # as an absolute path # (change requires restart) logdir = '/var/log/pgpool' # Directory of pgPool status file # (change requires restart) #------------------------------------------------------------------------------ # CONNECTION POOLING #------------------------------------------------------------------------------ connection_cache = on # Activate connection pools # (change requires restart) # Semicolon separated list of queries # to be issued at the end of a session # The default is for 8.3 and later reset_query_list = 'ABORT; DISCARD ALL' # The following one is for 8.2 and before #reset_query_list = 'ABORT; RESET ALL; SET SESSION AUTHORIZATION DEFAULT' #------------------------------------------------------------------------------ # REPLICATION MODE #------------------------------------------------------------------------------ replication_mode = off # Activate replication mode # (change requires restart) replicate_select = off # Replicate SELECT statements # when in replication mode # replicate_select is higher priority than # load_balance_mode. insert_lock = on # Automatically locks a dummy row or a table # with INSERT statements to keep SERIAL data # consistency # Without SERIAL, no lock will be issued lobj_lock_table = '' # When rewriting lo_creat command in # replication mode, specify table name to # lock # - Degenerate handling - replication_stop_on_mismatch = off # On disagreement with the packet kind # sent from backend, degenerate the node # which is most likely "minority" # If off, just force to exit this session failover_if_affected_tuples_mismatch = off # On disagreement with the number of affected # tuples in UPDATE/DELETE queries, then # degenerate the node which is most likely # "minority". # If off, just abort the transaction to # keep the consistency #------------------------------------------------------------------------------ # LOAD BALANCING MODE #------------------------------------------------------------------------------ load_balance_mode = off # Activate load balancing mode # (change requires restart) ignore_leading_white_space = on # Ignore leading white spaces of each query white_function_list = '' # Comma separated list of function names # that don't write to database # Regexp are accepted black_function_list = 'currval,lastval,nextval,setval' # Comma separated list of function names # that write to database # Regexp are accepted black_query_pattern_list = '' # Semicolon separated list of query patterns # that should be sent to primary node # Regexp are accepted # valid for streaming replicaton mode only. database_redirect_preference_list = '' # comma separated list of pairs of database and node id. # example: postgres:primary,mydb[0-4]:1,mydb[5-9]:2' # valid for streaming replicaton mode only. app_name_redirect_preference_list = '' # comma separated list of pairs of app name and node id. # example: 'psql:primary,myapp[0-4]:1,myapp[5-9]:standby' # valid for streaming replicaton mode only. allow_sql_comments = off # if on, ignore SQL comments when judging if load balance or # query cache is possible. # If off, SQL comments effectively prevent the judgment # (pre 3.4 behavior). disable_load_balance_on_write = 'transaction' # Load balance behavior when write query is issued # in an explicit transaction. # Note that any query not in an explicit transaction # is not affected by the parameter. # 'transaction' (the default): if a write query is issued, # subsequent read queries will not be load balanced # until the transaction ends. # 'trans_transaction': if a write query is issued, # subsequent read queries in an explicit transaction # will not be load balanced until the session ends. # 'always': if a write query is issued, read queries will # not be load balanced until the session ends. statement_level_load_balance = off # Enables statement level load balancing #------------------------------------------------------------------------------ # MASTER/SLAVE MODE #------------------------------------------------------------------------------ master_slave_mode = off # Activate master/slave mode # (change requires restart) master_slave_sub_mode = 'stream' # Master/slave sub mode # Valid values are combinations stream, slony # or logical. Default is stream. # (change requires restart) # - Streaming - sr_check_period = 0 # Streaming replication check period # Disabled (0) by default sr_check_user = 'nobody' # Streaming replication check user # This is necessary even if you disable # streaming replication delay check with # sr_check_period = 0 sr_check_password = '' # Password for streaming replication check user. # Leaving it empty will make Pgpool-II to first look for the # Password in pool_passwd file before using the empty password sr_check_database = 'postgres' # Database name for streaming replication check delay_threshold = 0 # Threshold before not dispatching query to standby node # Unit is in bytes # Disabled (0) by default # - Special commands - follow_master_command = '' # Executes this command after master failover # Special values: # %d = failed node id # %h = failed node host name # %p = failed node port number # %D = failed node database cluster path # %m = new master node id # %H = new master node hostname # %M = old master node id # %P = old primary node id # %r = new master port number # %R = new master database cluster path # %N = old primary node hostname # %S = old primary node port number # %% = '%' character #------------------------------------------------------------------------------ # HEALTH CHECK GLOBAL PARAMETERS #------------------------------------------------------------------------------ health_check_period = 0 # Health check period # Disabled (0) by default health_check_timeout = 20 # Health check timeout # 0 means no timeout health_check_user = 'nobody' # Health check user health_check_password = '' # Password for health check user # Leaving it empty will make Pgpool-II to first look for the # Password in pool_passwd file before using the empty password health_check_database = '' # Database name for health check. If '', tries 'postgres' frist, then 'template1' health_check_max_retries = 0 # Maximum number of times to retry a failed health check before giving up. health_check_retry_delay = 1 # Amount of time to wait (in seconds) between retries. connect_timeout = 10000 # Timeout value in milliseconds before giving up to connect to backend. # Default is 10000 ms (10 second). Flaky network user may want to increase # the value. 0 means no timeout. # Note that this value is not only used for health check, # but also for ordinary conection to backend. #------------------------------------------------------------------------------ # HEALTH CHECK PER NODE PARAMETERS (OPTIONAL) #------------------------------------------------------------------------------ #health_check_period0 = 0 #health_check_timeout0 = 20 #health_check_user0 = 'nobody' #health_check_password0 = '' #health_check_database0 = '' #health_check_max_retries0 = 0 #health_check_retry_delay0 = 1 #connect_timeout0 = 10000 #------------------------------------------------------------------------------ # FAILOVER AND FAILBACK #------------------------------------------------------------------------------ failover_command = '' # Executes this command at failover # Special values: # %d = failed node id # %h = failed node host name # %p = failed node port number # %D = failed node database cluster path # %m = new master node id # %H = new master node hostname # %M = old master node id # %P = old primary node id # %r = new master port number # %R = new master database cluster path # %N = old primary node hostname # %S = old primary node port number # %% = '%' character failback_command = '' # Executes this command at failback. # Special values: # %d = failed node id # %h = failed node host name # %p = failed node port number # %D = failed node database cluster path # %m = new master node id # %H = new master node hostname # %M = old master node id # %P = old primary node id # %r = new master port number # %R = new master database cluster path # %N = old primary node hostname # %S = old primary node port number # %% = '%' character failover_on_backend_error = on # Initiates failover when reading/writing to the # backend communication socket fails # If set to off, pgpool will report an # error and disconnect the session. detach_false_primary = off # Detach false primary if on. Only # valid in streaming replicaton # mode and with PostgreSQL 9.6 or # after. search_primary_node_timeout = 300 # Timeout in seconds to search for the # primary node when a failover occurs. # 0 means no timeout, keep searching # for a primary node forever. auto_failback = off # Dettached backend node reattach automatically # if replication_state is 'streaming'. auto_failback_interval = 60 # Min interval of executing auto_failback in # seconds. #------------------------------------------------------------------------------ # ONLINE RECOVERY #------------------------------------------------------------------------------ recovery_user = 'nobody' # Online recovery user recovery_password = '' # Online recovery password # Leaving it empty will make Pgpool-II to first look for the # Password in pool_passwd file before using the empty password recovery_1st_stage_command = '' # Executes a command in first stage recovery_2nd_stage_command = '' # Executes a command in second stage recovery_timeout = 90 # Timeout in seconds to wait for the # recovering node's postmaster to start up # 0 means no wait client_idle_limit_in_recovery = 0 # Client is disconnected after being idle # for that many seconds in the second stage # of online recovery # 0 means no disconnection # -1 means immediate disconnection #------------------------------------------------------------------------------ # WATCHDOG #------------------------------------------------------------------------------ # - Enabling - use_watchdog = off # Activates watchdog # (change requires restart) # -Connection to up stream servers - trusted_servers = '' # trusted server list which are used # to confirm network connection # (hostA,hostB,hostC,...) # (change requires restart) ping_path = '/bin' # ping command path # (change requires restart) # - Watchdog communication Settings - wd_hostname = '' # Host name or IP address of this watchdog # (change requires restart) wd_port = 9000 # port number for watchdog service # (change requires restart) wd_priority = 1 # priority of this watchdog in leader election # (change requires restart) wd_authkey = '' # Authentication key for watchdog communication # (change requires restart) wd_ipc_socket_dir = '/tmp' # Unix domain socket path for watchdog IPC socket # The Debian package defaults to # /var/run/postgresql # (change requires restart) # - Virtual IP control Setting - delegate_IP = '' # delegate IP address # If this is empty, virtual IP never bring up. # (change requires restart) if_cmd_path = '/sbin' # path to the directory where if_up/down_cmd exists # If if_up/down_cmd starts with "/", if_cmd_path will be ignored. # (change requires restart) if_up_cmd = '/usr/bin/sudo /sbin/ip addr add $_IP_$/24 dev eth0 label eth0:0' # startup delegate IP command # (change requires restart) if_down_cmd = '/usr/bin/sudo /sbin/ip addr del $_IP_$/24 dev eth0' # shutdown delegate IP command # (change requires restart) arping_path = '/usr/sbin' # arping command path # If arping_cmd starts with "/", if_cmd_path will be ignored. # (change requires restart) arping_cmd = '/usr/bin/sudo /usr/sbin/arping -U $_IP_$ -w 1 -I eth0' # arping command # (change requires restart) # - Behaivor on escalation Setting - clear_memqcache_on_escalation = on # Clear all the query cache on shared memory # when standby pgpool escalate to active pgpool # (= virtual IP holder). # This should be off if client connects to pgpool # not using virtual IP. # (change requires restart) wd_escalation_command = '' # Executes this command at escalation on new active pgpool. # (change requires restart) wd_de_escalation_command = '' # Executes this command when master pgpool resigns from being master. # (change requires restart) # - Watchdog consensus settings for failover - failover_when_quorum_exists = on # Only perform backend node failover # when the watchdog cluster holds the quorum # (change requires restart) failover_require_consensus = on # Perform failover when majority of Pgpool-II nodes # aggrees on the backend node status change # (change requires restart) allow_multiple_failover_requests_from_node = off # A Pgpool-II node can cast multiple votes # for building the consensus on failover # (change requires restart) enable_consensus_with_half_votes = off # apply majority rule for consensus and quorum computation # at 50% of votes in a cluster with even number of nodes. # when enabled the existence of quorum and consensus # on failover is resolved after receiving half of the # total votes in the cluster, otherwise both these # decisions require at least one more vote than # half of the total votes. # (change requires restart) # - Lifecheck Setting - # -- common -- wd_monitoring_interfaces_list = '' # Comma separated list of interfaces names to monitor. # if any interface from the list is active the watchdog will # consider the network is fine # 'any' to enable monitoring on all interfaces except loopback # '' to disable monitoring # (change requires restart) wd_lifecheck_method = 'heartbeat' # Method of watchdog lifecheck ('heartbeat' or 'query' or 'external') # (change requires restart) wd_interval = 10 # lifecheck interval (sec) > 0 # (change requires restart) # -- heartbeat mode -- wd_heartbeat_port = 9694 # Port number for receiving heartbeat signal # (change requires restart) wd_heartbeat_keepalive = 2 # Interval time of sending heartbeat signal (sec) # (change requires restart) wd_heartbeat_deadtime = 30 # Deadtime interval for heartbeat signal (sec) # (change requires restart) heartbeat_destination0 = 'host0_ip1' # Host name or IP address of destination 0 # for sending heartbeat signal. # (change requires restart) heartbeat_destination_port0 = 9694 # Port number of destination 0 for sending # heartbeat signal. Usually this is the # same as wd_heartbeat_port. # (change requires restart) heartbeat_device0 = '' # Name of NIC device (such like 'eth0') # used for sending/receiving heartbeat # signal to/from destination 0. # This works only when this is not empty # and pgpool has root privilege. # (change requires restart) #heartbeat_destination1 = 'host0_ip2' #heartbeat_destination_port1 = 9694 #heartbeat_device1 = '' # -- query mode -- wd_life_point = 3 # lifecheck retry times # (change requires restart) wd_lifecheck_query = 'SELECT 1' # lifecheck query to pgpool from watchdog # (change requires restart) wd_lifecheck_dbname = 'template1' # Database name connected for lifecheck # (change requires restart) wd_lifecheck_user = 'nobody' # watchdog user monitoring pgpools in lifecheck # (change requires restart) wd_lifecheck_password = '' # Password for watchdog user in lifecheck # Leaving it empty will make Pgpool-II to first look for the # Password in pool_passwd file before using the empty password # (change requires restart) # - Other pgpool Connection Settings - #other_pgpool_hostname0 = 'host0' # Host name or IP address to connect to for other pgpool 0 # (change requires restart) #other_pgpool_port0 = 5432 # Port number for other pgpool 0 # (change requires restart) #other_wd_port0 = 9000 # Port number for other watchdog 0 # (change requires restart) #other_pgpool_hostname1 = 'host1' #other_pgpool_port1 = 5432 #other_wd_port1 = 9000 #------------------------------------------------------------------------------ # OTHERS #------------------------------------------------------------------------------ relcache_expire = 0 # Life time of relation cache in seconds. # 0 means no cache expiration(the default). # The relation cache is used for cache the # query result against PostgreSQL system # catalog to obtain various information # including table structures or if it's a # temporary table or not. The cache is # maintained in a pgpool child local memory # and being kept as long as it survives. # If someone modify the table by using # ALTER TABLE or some such, the relcache is # not consistent anymore. # For this purpose, cache_expiration # controls the life time of the cache. relcache_size = 256 # Number of relation cache # entry. If you see frequently: # "pool_search_relcache: cache replacement happend" # in the pgpool log, you might want to increate this number. check_temp_table = catalog # Temporary table check method. catalog, trace or none. # Default is catalog. check_unlogged_table = on # If on, enable unlogged table check in SELECT statements. # This initiates queries against system catalog of primary/master # thus increases load of master. # If you are absolutely sure that your system never uses unlogged tables # and you want to save access to primary/master, you could turn this off. # Default is on. enable_shared_relcache = on # If on, relation cache stored in memory cache, # the cache is shared among child process. # Default is on. # (change requires restart) relcache_query_target = master # Target node to send relcache queries. Default is master (primary) node. # If load_balance_node is specified, queries will be sent to load balance node. #------------------------------------------------------------------------------ # IN MEMORY QUERY MEMORY CACHE #------------------------------------------------------------------------------ memory_cache_enabled = off # If on, use the memory cache functionality, off by default # (change requires restart) memqcache_method = 'shmem' # Cache storage method. either 'shmem'(shared memory) or # 'memcached'. 'shmem' by default # (change requires restart) memqcache_memcached_host = 'localhost' # Memcached host name or IP address. Mandatory if # memqcache_method = 'memcached'. # Defaults to localhost. # (change requires restart) memqcache_memcached_port = 11211 # Memcached port number. Mondatory if memqcache_method = 'memcached'. # Defaults to 11211. # (change requires restart) memqcache_total_size = 67108864 # Total memory size in bytes for storing memory cache. # Mandatory if memqcache_method = 'shmem'. # Defaults to 64MB. # (change requires restart) memqcache_max_num_cache = 1000000 # Total number of cache entries. Mandatory # if memqcache_method = 'shmem'. # Each cache entry consumes 48 bytes on shared memory. # Defaults to 1,000,000(45.8MB). # (change requires restart) memqcache_expire = 0 # Memory cache entry life time specified in seconds. # 0 means infinite life time. 0 by default. # (change requires restart) memqcache_auto_cache_invalidation = on # If on, invalidation of query cache is triggered by corresponding # DDL/DML/DCL(and memqcache_expire). If off, it is only triggered # by memqcache_expire. on by default. # (change requires restart) memqcache_maxcache = 409600 # Maximum SELECT result size in bytes. # Must be smaller than memqcache_cache_block_size. Defaults to 400KB. # (change requires restart) memqcache_cache_block_size = 1048576 # Cache block size in bytes. Mandatory if memqcache_method = 'shmem'. # Defaults to 1MB. # (change requires restart) memqcache_oiddir = '/var/log/pgpool/oiddir' # Temporary work directory to record table oids # (change requires restart) white_memqcache_table_list = '' # Comma separated list of table names to memcache # that don't write to database # Regexp are accepted black_memqcache_table_list = '' # Comma separated list of table names not to memcache # that don't write to database # Regexp are accepted pgpool-II-4.1.4/src/sample/pool_hba.conf.sample0000664000175000017500000000662413730350075016237 00000000000000# pgpool Client Authentication Configuration File # =============================================== # # The format rule in this file follows the rules in the PostgreSQL # Administrator's Guide. Refer to chapter "Client Authentication" for a # complete description. A short synopsis follows. # # This file controls: which hosts are allowed to connect, how clients # are authenticated, which user names they can use, which databases they # can access. Records take one of these forms: # # local DATABASE USER METHOD [OPTION] # host DATABASE USER ADDRESS METHOD [OPTIONS] # hostssl DATABASE USER ADDRESS METHOD [OPTIONS] # hostnossl DATABASE USER ADDRESS METHOD [OPTIONS] # # (The uppercase items must be replaced by actual values.) # # The first field is the connection type: "local" is a Unix-domain # socket, "host" is either a plain or SSL-encrypted TCP/IP socket. # "hostssl" is an SSL-encrypted TCP/IP socket, and "hostnossl" is a # plain TCP/IP socket. # # DATABASE can be "all", "sameuser", a database name, or a comma-separated # list thereof. Note that "samegroup" like in PostgreSQL's pg_hba.conf # file is not supported, since pgpool does not know which group a user # belongs to. Also note that the database specified here may not exist in # the backend PostgreSQL. pgpool will authenticate based on the database's # name, not based on whether it exists or not. # # USER can be "all", a user name, or a comma-separated list thereof. In # both the DATABASE and USER fields you can also write a file name prefixed # with "@" to include names from a separate file. Note that a group name # prefixed with "+" like in PostgreSQL's pg_hba.conf file is not supported # because of the same reason as "samegroup" token. Also note that a user # name specified here may not exist in the backend PostgreSQL. pgpool will # authenticate based on the user's name, not based on whether he/she exists. # # CIDR-ADDRESS specifies the set of hosts the record matches. # It is made up of an IP address and a CIDR mask that is an integer # (between 0 and 32 (IPv4) that specifies the number of significant bits in # the mask. Alternatively, you can write an IP address and netmask in # separate columns to specify the set of hosts. # # METHOD can be "trust", "reject", "md5" , "scram-sha-256" or "pam". # Note that "pam" sends passwords in clear text. # # OPTION is the name of the PAM service. Default service name is "pgpool" # # Database and user names containing spaces, commas, quotes and other special # characters must be quoted. Quoting one of the keywords "all" or "sameuser" # makes the name lose its special character, and just match a database or # username with that name. # # This file is read on pgpool startup. If you edit the file on a running # system, you have to restart the pgpool for the changes to take effect. # Put your actual configuration here # ---------------------------------- # # If you want to allow non-local connections, you need to add more # "host" records. In that case you will also need to make pgpool listen # on a non-local interface via the listen_addresses configuration parameter. # # TYPE DATABASE USER CIDR-ADDRESS METHOD # "local" is for Unix domain socket connections only local all all trust # IPv4 local connections: host all all 127.0.0.1/32 trust host all all ::1/128 trust pgpool-II-4.1.4/src/sample/pgpool.conf.sample-replication0000664000175000017500000012451313730350127020257 00000000000000# ---------------------------- # pgPool-II configuration file # ---------------------------- # # This file consists of lines of the form: # # name = value # # Whitespace may be used. Comments are introduced with "#" anywhere on a line. # The complete list of parameter names and allowed values can be found in the # pgPool-II documentation. # # This file is read on server startup and when the server receives a SIGHUP # signal. If you edit the file on a running system, you have to SIGHUP the # server for the changes to take effect, or use "pgpool reload". Some # parameters, which are marked below, require a server shutdown and restart to # take effect. # #------------------------------------------------------------------------------ # CONNECTIONS #------------------------------------------------------------------------------ # - pgpool Connection Settings - listen_addresses = 'localhost' # Host name or IP address to listen on: # '*' for all, '' for no TCP/IP connections # (change requires restart) port = 9999 # Port number # (change requires restart) socket_dir = '/tmp' # Unix domain socket path # The Debian package defaults to # /var/run/postgresql # (change requires restart) listen_backlog_multiplier = 2 # Set the backlog parameter of listen(2) to # num_init_children * listen_backlog_multiplier. # (change requires restart) serialize_accept = off # whether to serialize accept() call to avoid thundering herd problem # (change requires restart) reserved_connections = 0 # Number of reserved connections. # Pgpool-II does not accept connections if over # num_init_chidlren - reserved_connections. # - pgpool Communication Manager Connection Settings - pcp_listen_addresses = '*' # Host name or IP address for pcp process to listen on: # '*' for all, '' for no TCP/IP connections # (change requires restart) pcp_port = 9898 # Port number for pcp # (change requires restart) pcp_socket_dir = '/tmp' # Unix domain socket path for pcp # The Debian package defaults to # /var/run/postgresql # (change requires restart) # - Backend Connection Settings - backend_hostname0 = 'host1' # Host name or IP address to connect to for backend 0 backend_port0 = 5432 # Port number for backend 0 backend_weight0 = 1 # Weight for backend 0 (only in load balancing mode) backend_data_directory0 = '/data' # Data directory for backend 0 backend_flag0 = 'ALLOW_TO_FAILOVER' # Controls various backend behavior # ALLOW_TO_FAILOVER or DISALLOW_TO_FAILOVER #backend_hostname1 = 'host2' #backend_port1 = 5433 #backend_weight1 = 1 #backend_data_directory1 = '/data1' #backend_flag1 = 'ALLOW_TO_FAILOVER' # - Authentication - enable_pool_hba = off # Use pool_hba.conf for client authentication pool_passwd = 'pool_passwd' # File name of pool_passwd for md5 authentication. # "" disables pool_passwd. # (change requires restart) authentication_timeout = 60 # Delay in seconds to complete client authentication # 0 means no timeout. allow_clear_text_frontend_auth = off # Allow Pgpool-II to use clear text password authentication # with clients, when pool_passwd does not # contain the user password # - SSL Connections - ssl = off # Enable SSL support # (change requires restart) #ssl_key = './server.key' # Path to the SSL private key file # (change requires restart) #ssl_cert = './server.cert' # Path to the SSL public certificate file # (change requires restart) #ssl_ca_cert = '' # Path to a single PEM format file # containing CA root certificate(s) # (change requires restart) #ssl_ca_cert_dir = '' # Directory containing CA root certificate(s) # (change requires restart) ssl_ciphers = 'HIGH:MEDIUM:+3DES:!aNULL' # Allowed SSL ciphers # (change requires restart) ssl_prefer_server_ciphers = off # Use server's SSL cipher preferences, # rather than the client's # (change requires restart) ssl_ecdh_curve = 'prime256v1' # Name of the curve to use in ECDH key exchange ssl_dh_params_file = '' # Name of the file containing Diffie-Hellman parameters used # for so-called ephemeral DH family of SSL cipher. #------------------------------------------------------------------------------ # POOLS #------------------------------------------------------------------------------ # - Concurrent session and pool size - num_init_children = 32 # Number of concurrent sessions allowed # (change requires restart) max_pool = 4 # Number of connection pool caches per connection # (change requires restart) # - Life time - child_life_time = 300 # Pool exits after being idle for this many seconds child_max_connections = 0 # Pool exits after receiving that many connections # 0 means no exit connection_life_time = 0 # Connection to backend closes after being idle for this many seconds # 0 means no close client_idle_limit = 0 # Client is disconnected after being idle for that many seconds # (even inside an explicit transactions!) # 0 means no disconnection #------------------------------------------------------------------------------ # LOGS #------------------------------------------------------------------------------ # - Where to log - log_destination = 'stderr' # Where to log # Valid values are combinations of stderr, # and syslog. Default to stderr. # - What to log - log_line_prefix = '%t: pid %p: ' # printf-style string to output at beginning of each log line. log_connections = off # Log connections log_hostname = off # Hostname will be shown in ps status # and in logs if connections are logged log_statement = off # Log all statements log_per_node_statement = off # Log all statements # with node and backend informations log_client_messages = off # Log any client messages log_standby_delay = 'none' # Log standby delay # Valid values are combinations of always, # if_over_threshold, none # - Syslog specific - syslog_facility = 'LOCAL0' # Syslog local facility. Default to LOCAL0 syslog_ident = 'pgpool' # Syslog program identification string # Default to 'pgpool' # - Debug - #log_error_verbosity = default # terse, default, or verbose messages #client_min_messages = notice # values in order of decreasing detail: # debug5 # debug4 # debug3 # debug2 # debug1 # log # notice # warning # error #log_min_messages = warning # values in order of decreasing detail: # debug5 # debug4 # debug3 # debug2 # debug1 # info # notice # warning # error # log # fatal # panic #------------------------------------------------------------------------------ # FILE LOCATIONS #------------------------------------------------------------------------------ pid_file_name = '/var/run/pgpool/pgpool.pid' # PID file name # Can be specified as relative to the" # location of pgpool.conf file or # as an absolute path # (change requires restart) logdir = '/tmp' # Directory of pgPool status file # (change requires restart) #------------------------------------------------------------------------------ # CONNECTION POOLING #------------------------------------------------------------------------------ connection_cache = on # Activate connection pools # (change requires restart) # Semicolon separated list of queries # to be issued at the end of a session # The default is for 8.3 and later reset_query_list = 'ABORT; DISCARD ALL' # The following one is for 8.2 and before #reset_query_list = 'ABORT; RESET ALL; SET SESSION AUTHORIZATION DEFAULT' #------------------------------------------------------------------------------ # REPLICATION MODE #------------------------------------------------------------------------------ replication_mode = on # Activate replication mode # (change requires restart) replicate_select = off # Replicate SELECT statements # when in replication mode # replicate_select is higher priority than # load_balance_mode. insert_lock = on # Automatically locks a dummy row or a table # with INSERT statements to keep SERIAL data # consistency # Without SERIAL, no lock will be issued lobj_lock_table = '' # When rewriting lo_creat command in # replication mode, specify table name to # lock # - Degenerate handling - replication_stop_on_mismatch = off # On disagreement with the packet kind # sent from backend, degenerate the node # which is most likely "minority" # If off, just force to exit this session failover_if_affected_tuples_mismatch = off # On disagreement with the number of affected # tuples in UPDATE/DELETE queries, then # degenerate the node which is most likely # "minority". # If off, just abort the transaction to # keep the consistency #------------------------------------------------------------------------------ # LOAD BALANCING MODE #------------------------------------------------------------------------------ load_balance_mode = on # Activate load balancing mode # (change requires restart) ignore_leading_white_space = on # Ignore leading white spaces of each query white_function_list = '' # Comma separated list of function names # that don't write to database # Regexp are accepted black_function_list = 'currval,lastval,nextval,setval' # Comma separated list of function names # that write to database # Regexp are accepted black_query_pattern_list = '' # Semicolon separated list of query patterns # that should be sent to primary node # Regexp are accepted # valid for streaming replicaton mode only. database_redirect_preference_list = '' # comma separated list of pairs of database and node id. # example: postgres:primary,mydb[0-4]:1,mydb[5-9]:2' # valid for streaming replicaton mode only. app_name_redirect_preference_list = '' # comma separated list of pairs of app name and node id. # example: 'psql:primary,myapp[0-4]:1,myapp[5-9]:standby' # valid for streaming replicaton mode only. allow_sql_comments = off # if on, ignore SQL comments when judging if load balance or # query cache is possible. # If off, SQL comments effectively prevent the judgment # (pre 3.4 behavior). disable_load_balance_on_write = 'transaction' # Load balance behavior when write query is issued # in an explicit transaction. # Note that any query not in an explicit transaction # is not affected by the parameter. # 'transaction' (the default): if a write query is issued, # subsequent read queries will not be load balanced # until the transaction ends. # 'trans_transaction': if a write query is issued, # subsequent read queries in an explicit transaction # will not be load balanced until the session ends. # 'always': if a write query is issued, read queries will # not be load balanced until the session ends. statement_level_load_balance = off # Enables statement level load balancing #------------------------------------------------------------------------------ # MASTER/SLAVE MODE #------------------------------------------------------------------------------ master_slave_mode = off # Activate master/slave mode # (change requires restart) master_slave_sub_mode = 'stream' # Master/slave sub mode # Valid values are combinations stream, slony # or logical. Default is stream. # (change requires restart) # - Streaming - sr_check_period = 0 # Streaming replication check period # Disabled (0) by default sr_check_user = 'nobody' # Streaming replication check user # This is neccessary even if you disable streaming # replication delay check by sr_check_period = 0 sr_check_password = '' # Password for streaming replication check user # Leaving it empty will make Pgpool-II to first look for the # Password in pool_passwd file before using the empty password sr_check_database = 'postgres' # Database name for streaming replication check delay_threshold = 0 # Threshold before not dispatching query to standby node # Unit is in bytes # Disabled (0) by default # - Special commands - follow_master_command = '' # Executes this command after master failover # Special values: # %d = failed node id # %h = failed node host name # %p = failed node port number # %D = failed node database cluster path # %m = new master node id # %H = new master node hostname # %M = old master node id # %P = old primary node id # %r = new master port number # %R = new master database cluster path # %N = old primary node hostname # %S = old primary node port number # %% = '%' character #------------------------------------------------------------------------------ # HEALTH CHECK GLOBAL PARAMETERS #------------------------------------------------------------------------------ health_check_period = 0 # Health check period # Disabled (0) by default health_check_timeout = 20 # Health check timeout # 0 means no timeout health_check_user = 'nobody' # Health check user health_check_password = '' # Password for health check user # Leaving it empty will make Pgpool-II to first look for the # Password in pool_passwd file before using the empty password health_check_database = '' # Database name for health check. If '', tries 'postgres' frist, health_check_max_retries = 0 # Maximum number of times to retry a failed health check before giving up. health_check_retry_delay = 1 # Amount of time to wait (in seconds) between retries. connect_timeout = 10000 # Timeout value in milliseconds before giving up to connect to backend. # Default is 10000 ms (10 second). Flaky network user may want to increase # the value. 0 means no timeout. # Note that this value is not only used for health check, # but also for ordinary conection to backend. #------------------------------------------------------------------------------ # HEALTH CHECK PER NODE PARAMETERS (OPTIONAL) #------------------------------------------------------------------------------ #health_check_period0 = 0 #health_check_timeout0 = 20 #health_check_user0 = 'nobody' #health_check_password0 = '' #health_check_database0 = '' #health_check_max_retries0 = 0 #health_check_retry_delay0 = 1 #connect_timeout0 = 10000 #------------------------------------------------------------------------------ # FAILOVER AND FAILBACK #------------------------------------------------------------------------------ failover_command = '' # Executes this command at failover # Special values: # %d = failed node id # %h = failed node host name # %p = failed node port number # %D = failed node database cluster path # %m = new master node id # %H = new master node hostname # %M = old master node id # %P = old primary node id # %r = new master port number # %R = new master database cluster path # %N = old primary node hostname # %S = old primary node port number # %% = '%' character failback_command = '' # Executes this command at failback. # Special values: # %d = failed node id # %h = failed node host name # %p = failed node port number # %D = failed node database cluster path # %m = new master node id # %H = new master node hostname # %M = old master node id # %P = old primary node id # %r = new master port number # %R = new master database cluster path # %N = old primary node hostname # %S = old primary node port number # %% = '%' character failover_on_backend_error = on # Initiates failover when reading/writing to the # backend communication socket fails # If set to off, pgpool will report an # error and disconnect the session. detach_false_primary = off # Detach false primary if on. Only # valid in streaming replicaton # mode and with PostgreSQL 9.6 or # after. search_primary_node_timeout = 300 # Timeout in seconds to search for the # primary node when a failover occurs. # 0 means no timeout, keep searching # for a primary node forever. auto_failback = off # Dettached backend node reattach automatically # if replication_state is 'streaming'. auto_failback_interval = 60 # Min interval of executing auto_failback in # seconds. #------------------------------------------------------------------------------ # ONLINE RECOVERY #------------------------------------------------------------------------------ recovery_user = 'nobody' # Online recovery user recovery_password = '' # Online recovery password # Leaving it empty will make Pgpool-II to first look for the # Password in pool_passwd file before using the empty password recovery_1st_stage_command = '' # Executes a command in first stage recovery_2nd_stage_command = '' # Executes a command in second stage recovery_timeout = 90 # Timeout in seconds to wait for the # recovering node's postmaster to start up # 0 means no wait client_idle_limit_in_recovery = 0 # Client is disconnected after being idle # for that many seconds in the second stage # of online recovery # 0 means no disconnection # -1 means immediate disconnection #------------------------------------------------------------------------------ # WATCHDOG #------------------------------------------------------------------------------ # - Enabling - use_watchdog = off # Activates watchdog # (change requires restart) # -Connection to up stream servers - trusted_servers = '' # trusted server list which are used # to confirm network connection # (hostA,hostB,hostC,...) # (change requires restart) ping_path = '/bin' # ping command path # (change requires restart) # - Watchdog communication Settings - wd_hostname = '' # Host name or IP address of this watchdog # (change requires restart) wd_port = 9000 # port number for watchdog service # (change requires restart) wd_priority = 1 # priority of this watchdog in leader election # (change requires restart) wd_authkey = '' # Authentication key for watchdog communication # (change requires restart) wd_ipc_socket_dir = '/tmp' # Unix domain socket path for watchdog IPC socket # The Debian package defaults to # /var/run/postgresql # (change requires restart) # - Virtual IP control Setting - delegate_IP = '' # delegate IP address # If this is empty, virtual IP never bring up. # (change requires restart) if_cmd_path = '/sbin' # path to the directory where if_up/down_cmd exists # If if_up/down_cmd starts with "/", if_cmd_path will be ignored. # (change requires restart) if_up_cmd = '/usr/bin/sudo /sbin/ip addr add $_IP_$/24 dev eth0 label eth0:0' # startup delegate IP command # (change requires restart) if_down_cmd = '/usr/bin/sudo /sbin/ip addr del $_IP_$/24 dev eth0' # shutdown delegate IP command # (change requires restart) arping_path = '/usr/sbin' # arping command path # If arping_cmd starts with "/", if_cmd_path will be ignored. # (change requires restart) arping_cmd = '/usr/bin/sudo /usr/sbin/arping -U $_IP_$ -w 1 -I eth0' # arping command # (change requires restart) # - Behaivor on escalation Setting - clear_memqcache_on_escalation = on # Clear all the query cache on shared memory # when standby pgpool escalate to active pgpool # (= virtual IP holder). # This should be off if client connects to pgpool # not using virtual IP. # (change requires restart) wd_escalation_command = '' # Executes this command at escalation on new active pgpool. # (change requires restart) wd_de_escalation_command = '' # Executes this command when master pgpool resigns from being master. # (change requires restart) # - Watchdog consensus settings for failover - failover_when_quorum_exists = off # Only perform backend node failover # when the watchdog cluster holds the quorum. # not allowed in replication mode # (change requires restart) failover_require_consensus = off # Perform failover when majority of Pgpool-II nodes # aggrees on the backend node status change. # not allowed in replication mode # (change requires restart) allow_multiple_failover_requests_from_node = off # A Pgpool-II node can cast multiple votes # for building the consensus on failover # (change requires restart) enable_consensus_with_half_votes = off # apply majority rule for consensus and quorum computation # at 50% of votes in a cluster with even number of nodes. # when enabled the existence of quorum and consensus # on failover is resolved after receiving half of the # total votes in the cluster, otherwise both these # decisions require at least one more vote than # half of the total votes. # (change requires restart) # - Lifecheck Setting - # -- common -- wd_monitoring_interfaces_list = '' # Comma separated list of interfaces names to monitor. # if any interface from the list is active the watchdog will # consider the network is fine # 'any' to enable monitoring on all interfaces except loopback # '' to disable monitoring # (change requires restart) wd_lifecheck_method = 'heartbeat' # Method of watchdog lifecheck ('heartbeat' or 'query' or 'external') # (change requires restart) wd_interval = 10 # lifecheck interval (sec) > 0 # (change requires restart) # -- heartbeat mode -- wd_heartbeat_port = 9694 # Port number for receiving heartbeat signal # (change requires restart) wd_heartbeat_keepalive = 2 # Interval time of sending heartbeat signal (sec) # (change requires restart) wd_heartbeat_deadtime = 30 # Deadtime interval for heartbeat signal (sec) # (change requires restart) heartbeat_destination0 = 'host0_ip1' # Host name or IP address of destination 0 # for sending heartbeat signal. # (change requires restart) heartbeat_destination_port0 = 9694 # Port number of destination 0 for sending # heartbeat signal. Usually this is the # same as wd_heartbeat_port. # (change requires restart) heartbeat_device0 = '' # Name of NIC device (such like 'eth0') # used for sending/receiving heartbeat # signal to/from destination 0. # This works only when this is not empty # and pgpool has root privilege. # (change requires restart) #heartbeat_destination1 = 'host0_ip2' #heartbeat_destination_port1 = 9694 #heartbeat_device1 = '' # -- query mode -- wd_life_point = 3 # lifecheck retry times # (change requires restart) wd_lifecheck_query = 'SELECT 1' # lifecheck query to pgpool from watchdog # (change requires restart) wd_lifecheck_dbname = 'template1' # Database name connected for lifecheck # (change requires restart) wd_lifecheck_user = 'nobody' # watchdog user monitoring pgpools in lifecheck # (change requires restart) wd_lifecheck_password = '' # Password for watchdog user in lifecheck # Leaving it empty will make Pgpool-II to first look for the # Password in pool_passwd file before using the empty password # (change requires restart) # - Other pgpool Connection Settings - #other_pgpool_hostname0 = 'host0' # Host name or IP address to connect to for other pgpool 0 # (change requires restart) #other_pgpool_port0 = 5432 # Port number for other pgpool 0 # (change requires restart) #other_wd_port0 = 9000 # Port number for other watchdog 0 # (change requires restart) #other_pgpool_hostname1 = 'host1' #other_pgpool_port1 = 5432 #other_wd_port1 = 9000 #------------------------------------------------------------------------------ # OTHERS #------------------------------------------------------------------------------ relcache_expire = 0 # Life time of relation cache in seconds. # 0 means no cache expiration(the default). # The relation cache is used for cache the # query result against PostgreSQL system # catalog to obtain various information # including table structures or if it's a # temporary table or not. The cache is # maintained in a pgpool child local memory # and being kept as long as it survives. # If someone modify the table by using # ALTER TABLE or some such, the relcache is # not consistent anymore. # For this purpose, cache_expiration # controls the life time of the cache. relcache_size = 256 # Number of relation cache # entry. If you see frequently: # "pool_search_relcache: cache replacement happend" # in the pgpool log, you might want to increate this number. check_temp_table = catalog # Temporary table check method. catalog, trace or none. # Default is catalog. check_unlogged_table = on # If on, enable unlogged table check in SELECT statements. # This initiates queries against system catalog of primary/master # thus increases load of master. # If you are absolutely sure that your system never uses unlogged tables # and you want to save access to primary/master, you could turn this off. # Default is on. enable_shared_relcache = on # If on, relation cache stored in memory cache, # the cache is shared among child process. # Default is on. # (change requires restart) relcache_query_target = master # Target node to send relcache queries. Default is master (primary) node. # If load_balance_node is specified, queries will be sent to load balance node. #------------------------------------------------------------------------------ # IN MEMORY QUERY MEMORY CACHE #------------------------------------------------------------------------------ memory_cache_enabled = off # If on, use the memory cache functionality, off by default # (change requires restart) memqcache_method = 'shmem' # Cache storage method. either 'shmem'(shared memory) or # 'memcached'. 'shmem' by default # (change requires restart) memqcache_memcached_host = 'localhost' # Memcached host name or IP address. Mandatory if # memqcache_method = 'memcached'. # Defaults to localhost. # (change requires restart) memqcache_memcached_port = 11211 # Memcached port number. Mondatory if memqcache_method = 'memcached'. # Defaults to 11211. # (change requires restart) memqcache_total_size = 67108864 # Total memory size in bytes for storing memory cache. # Mandatory if memqcache_method = 'shmem'. # Defaults to 64MB. # (change requires restart) memqcache_max_num_cache = 1000000 # Total number of cache entries. Mandatory # if memqcache_method = 'shmem'. # Each cache entry consumes 48 bytes on shared memory. # Defaults to 1,000,000(45.8MB). # (change requires restart) memqcache_expire = 0 # Memory cache entry life time specified in seconds. # 0 means infinite life time. 0 by default. # (change requires restart) memqcache_auto_cache_invalidation = on # If on, invalidation of query cache is triggered by corresponding # DDL/DML/DCL(and memqcache_expire). If off, it is only triggered # by memqcache_expire. on by default. # (change requires restart) memqcache_maxcache = 409600 # Maximum SELECT result size in bytes. # Must be smaller than memqcache_cache_block_size. Defaults to 400KB. # (change requires restart) memqcache_cache_block_size = 1048576 # Cache block size in bytes. Mandatory if memqcache_method = 'shmem'. # Defaults to 1MB. # (change requires restart) memqcache_oiddir = '/var/log/pgpool/oiddir' # Temporary work directory to record table oids # (change requires restart) white_memqcache_table_list = '' # Comma separated list of table names to memcache # that don't write to database # Regexp are accepted black_memqcache_table_list = '' # Comma separated list of table names not to memcache # that don't write to database # Regexp are accepted pgpool-II-4.1.4/src/sample/pgpool.conf.sample-master-slave0000664000175000017500000012435613730350127020356 00000000000000# ---------------------------- # pgPool-II configuration file # ---------------------------- # # This file consists of lines of the form: # # name = value # # Whitespace may be used. Comments are introduced with "#" anywhere on a line. # The complete list of parameter names and allowed values can be found in the # pgPool-II documentation. # # This file is read on server startup and when the server receives a SIGHUP # signal. If you edit the file on a running system, you have to SIGHUP the # server for the changes to take effect, or use "pgpool reload". Some # parameters, which are marked below, require a server shutdown and restart to # take effect. # #------------------------------------------------------------------------------ # CONNECTIONS #------------------------------------------------------------------------------ # - pgpool Connection Settings - listen_addresses = 'localhost' # Host name or IP address to listen on: # '*' for all, '' for no TCP/IP connections # (change requires restart) port = 9999 # Port number # (change requires restart) socket_dir = '/tmp' # Unix domain socket path # The Debian package defaults to # /var/run/postgresql # (change requires restart) listen_backlog_multiplier = 2 # Set the backlog parameter of listen(2) to # num_init_children * listen_backlog_multiplier. # (change requires restart) serialize_accept = off # whether to serialize accept() call to avoid thundering herd problem # (change requires restart) reserved_connections = 0 # Number of reserved connections. # Pgpool-II does not accept connections if over # num_init_chidlren - reserved_connections. # - pgpool Communication Manager Connection Settings - pcp_listen_addresses = '*' # Host name or IP address for pcp process to listen on: # '*' for all, '' for no TCP/IP connections # (change requires restart) pcp_port = 9898 # Port number for pcp # (change requires restart) pcp_socket_dir = '/tmp' # Unix domain socket path for pcp # The Debian package defaults to # /var/run/postgresql # (change requires restart) # - Backend Connection Settings - backend_hostname0 = 'host1' # Host name or IP address to connect to for backend 0 backend_port0 = 5432 # Port number for backend 0 backend_weight0 = 1 # Weight for backend 0 (only in load balancing mode) backend_data_directory0 = '/data' # Data directory for backend 0 backend_flag0 = 'ALLOW_TO_FAILOVER' # Controls various backend behavior # ALLOW_TO_FAILOVER, DISALLOW_TO_FAILOVER # or ALWAYS_MASTER #backend_hostname1 = 'host2' #backend_port1 = 5433 #backend_weight1 = 1 #backend_data_directory1 = '/data1' #backend_flag1 = 'ALLOW_TO_FAILOVER' # - Authentication - enable_pool_hba = off # Use pool_hba.conf for client authentication pool_passwd = 'pool_passwd' # File name of pool_passwd for md5 authentication. # "" disables pool_passwd. # (change requires restart) authentication_timeout = 60 # Delay in seconds to complete client authentication # 0 means no timeout. allow_clear_text_frontend_auth = off # Allow Pgpool-II to use clear text password authentication # with clients, when pool_passwd does not # contain the user password # - SSL Connections - ssl = off # Enable SSL support # (change requires restart) #ssl_key = './server.key' # Path to the SSL private key file # (change requires restart) #ssl_cert = './server.cert' # Path to the SSL public certificate file # (change requires restart) #ssl_ca_cert = '' # Path to a single PEM format file # containing CA root certificate(s) # (change requires restart) #ssl_ca_cert_dir = '' # Directory containing CA root certificate(s) # (change requires restart) ssl_ciphers = 'HIGH:MEDIUM:+3DES:!aNULL' # Allowed SSL ciphers # (change requires restart) ssl_prefer_server_ciphers = off # Use server's SSL cipher preferences, # rather than the client's # (change requires restart) ssl_ecdh_curve = 'prime256v1' # Name of the curve to use in ECDH key exchange ssl_dh_params_file = '' # Name of the file containing Diffie-Hellman parameters used # for so-called ephemeral DH family of SSL cipher. #------------------------------------------------------------------------------ # POOLS #------------------------------------------------------------------------------ # - Concurrent session and pool size - num_init_children = 32 # Number of concurrent sessions allowed # (change requires restart) max_pool = 4 # Number of connection pool caches per connection # (change requires restart) # - Life time - child_life_time = 300 # Pool exits after being idle for this many seconds child_max_connections = 0 # Pool exits after receiving that many connections # 0 means no exit connection_life_time = 0 # Connection to backend closes after being idle for this many seconds # 0 means no close client_idle_limit = 0 # Client is disconnected after being idle for that many seconds # (even inside an explicit transactions!) # 0 means no disconnection #------------------------------------------------------------------------------ # LOGS #------------------------------------------------------------------------------ # - Where to log - log_destination = 'stderr' # Where to log # Valid values are combinations of stderr, # and syslog. Default to stderr. # - What to log - log_line_prefix = '%t: pid %p: ' # printf-style string to output at beginning of each log line. log_connections = off # Log connections log_hostname = off # Hostname will be shown in ps status # and in logs if connections are logged log_statement = off # Log all statements log_per_node_statement = off # Log all statements # with node and backend informations log_client_messages = off # Log any client messages log_standby_delay = 'none' # Log standby delay # Valid values are combinations of always, # if_over_threshold, none # - Syslog specific - syslog_facility = 'LOCAL0' # Syslog local facility. Default to LOCAL0 syslog_ident = 'pgpool' # Syslog program identification string # Default to 'pgpool' # - Debug - #log_error_verbosity = default # terse, default, or verbose messages #client_min_messages = notice # values in order of decreasing detail: # debug5 # debug4 # debug3 # debug2 # debug1 # log # notice # warning # error #log_min_messages = warning # values in order of decreasing detail: # debug5 # debug4 # debug3 # debug2 # debug1 # info # notice # warning # error # log # fatal # panic #------------------------------------------------------------------------------ # FILE LOCATIONS #------------------------------------------------------------------------------ pid_file_name = '/var/run/pgpool/pgpool.pid' # PID file name # Can be specified as relative to the" # location of pgpool.conf file or # as an absolute path # (change requires restart) logdir = '/tmp' # Directory of pgPool status file # (change requires restart) #------------------------------------------------------------------------------ # CONNECTION POOLING #------------------------------------------------------------------------------ connection_cache = on # Activate connection pools # (change requires restart) # Semicolon separated list of queries # to be issued at the end of a session # The default is for 8.3 and later reset_query_list = 'ABORT; DISCARD ALL' # The following one is for 8.2 and before #reset_query_list = 'ABORT; RESET ALL; SET SESSION AUTHORIZATION DEFAULT' #------------------------------------------------------------------------------ # REPLICATION MODE #------------------------------------------------------------------------------ replication_mode = off # Activate replication mode # (change requires restart) replicate_select = off # Replicate SELECT statements # when in replication mode # replicate_select is higher priority than # load_balance_mode. insert_lock = off # Automatically locks a dummy row or a table # with INSERT statements to keep SERIAL data # consistency # Without SERIAL, no lock will be issued lobj_lock_table = '' # When rewriting lo_creat command in # replication mode, specify table name to # lock # - Degenerate handling - replication_stop_on_mismatch = off # On disagreement with the packet kind # sent from backend, degenerate the node # which is most likely "minority" # If off, just force to exit this session failover_if_affected_tuples_mismatch = off # On disagreement with the number of affected # tuples in UPDATE/DELETE queries, then # degenerate the node which is most likely # "minority". # If off, just abort the transaction to # keep the consistency #------------------------------------------------------------------------------ # LOAD BALANCING MODE #------------------------------------------------------------------------------ load_balance_mode = on # Activate load balancing mode # (change requires restart) ignore_leading_white_space = on # Ignore leading white spaces of each query white_function_list = '' # Comma separated list of function names # that don't write to database # Regexp are accepted black_function_list = 'currval,lastval,nextval,setval' # Comma separated list of function names # that write to database # Regexp are accepted black_query_pattern_list = '' # Semicolon separated list of query patterns # that should be sent to primary node # Regexp are accepted # valid for streaming replicaton mode only. database_redirect_preference_list = '' # comma separated list of pairs of database and node id. # example: postgres:primary,mydb[0-4]:1,mydb[5-9]:2' # valid for streaming replicaton mode only. app_name_redirect_preference_list = '' # comma separated list of pairs of app name and node id. # example: 'psql:primary,myapp[0-4]:1,myapp[5-9]:standby' # valid for streaming replicaton mode only. allow_sql_comments = off # if on, ignore SQL comments when judging if load balance or # query cache is possible. # If off, SQL comments effectively prevent the judgment # (pre 3.4 behavior). disable_load_balance_on_write = 'transaction' # Load balance behavior when write query is issued # in an explicit transaction. # Note that any query not in an explicit transaction # is not affected by the parameter. # 'transaction' (the default): if a write query is issued, # subsequent read queries will not be load balanced # until the transaction ends. # 'trans_transaction': if a write query is issued, # subsequent read queries in an explicit transaction # will not be load balanced until the session ends. # 'always': if a write query is issued, read queries will # not be load balanced until the session ends. statement_level_load_balance = off # Enables statement level load balancing #------------------------------------------------------------------------------ # MASTER/SLAVE MODE #------------------------------------------------------------------------------ master_slave_mode = on # Activate master/slave mode # (change requires restart) master_slave_sub_mode = 'slony' # Master/slave sub mode # Valid values are combinations stream, slony # or logical. Default is stream. # (change requires restart) # - Streaming - sr_check_period = 0 # Streaming replication check period # Disabled (0) by default sr_check_user = 'nobody' # Streaming replication check user # This is neccessary even if you disable streaming # replication delay check by sr_check_period = 0 sr_check_password = '' # Password for streaming replication check user # Leaving it empty will make Pgpool-II to first look for the # Password in pool_passwd file before using the empty password sr_check_database = 'postgres' # Database name for streaming replication check delay_threshold = 0 # Threshold before not dispatching query to standby node # Unit is in bytes # Disabled (0) by default # - Special commands - follow_master_command = '' # Executes this command after master failover # Special values: # %d = failed node id # %h = failed node host name # %p = failed node port number # %D = failed node database cluster path # %m = new master node id # %H = new master node hostname # %M = old master node id # %P = old primary node id # %r = new master port number # %R = new master database cluster path # %N = old primary node hostname # %S = old primary node port number # %% = '%' character #------------------------------------------------------------------------------ # HEALTH CHECK GLOBAL PARAMETERS #------------------------------------------------------------------------------ health_check_period = 0 # Health check period # Disabled (0) by default health_check_timeout = 20 # Health check timeout # 0 means no timeout health_check_user = 'nobody' # Health check user health_check_password = '' # Password for health check user # Leaving it empty will make Pgpool-II to first look for the # Password in pool_passwd file before using the empty password health_check_database = '' # Database name for health check. If '', tries 'postgres' frist, health_check_max_retries = 0 # Maximum number of times to retry a failed health check before giving up. health_check_retry_delay = 1 # Amount of time to wait (in seconds) between retries. connect_timeout = 10000 # Timeout value in milliseconds before giving up to connect to backend. # Default is 10000 ms (10 second). Flaky network user may want to increase # the value. 0 means no timeout. # Note that this value is not only used for health check, # but also for ordinary conection to backend. #------------------------------------------------------------------------------ # HEALTH CHECK PER NODE PARAMETERS (OPTIONAL) #------------------------------------------------------------------------------ #health_check_period0 = 0 #health_check_timeout0 = 20 #health_check_user0 = 'nobody' #health_check_password0 = '' #health_check_database0 = '' #health_check_max_retries0 = 0 #health_check_retry_delay0 = 1 #connect_timeout0 = 10000 #------------------------------------------------------------------------------ # FAILOVER AND FAILBACK #------------------------------------------------------------------------------ failover_command = '' # Executes this command at failover # Special values: # %d = failed node id # %h = failed node host name # %p = failed node port number # %D = failed node database cluster path # %m = new master node id # %H = new master node hostname # %M = old master node id # %P = old primary node id # %r = new master port number # %R = new master database cluster path # %N = old primary node hostname # %S = old primary node port number # %% = '%' character failback_command = '' # Executes this command at failback. # Special values: # %d = failed node id # %h = failed node host name # %p = failed node port number # %D = failed node database cluster path # %m = new master node id # %H = new master node hostname # %M = old master node id # %P = old primary node id # %r = new master port number # %R = new master database cluster path # %N = old primary node hostname # %S = old primary node port number # %% = '%' character failover_on_backend_error = on # Initiates failover when reading/writing to the # backend communication socket fails # If set to off, pgpool will report an # error and disconnect the session. detach_false_primary = off # Detach false primary if on. Only # valid in streaming replicaton # mode and with PostgreSQL 9.6 or # after. search_primary_node_timeout = 300 # Timeout in seconds to search for the # primary node when a failover occurs. # 0 means no timeout, keep searching # for a primary node forever. auto_failback = off # Dettached backend node reattach automatically # if replication_state is 'streaming'. auto_failback_interval = 60 # Min interval of executing auto_failback in # seconds. #------------------------------------------------------------------------------ # ONLINE RECOVERY #------------------------------------------------------------------------------ recovery_user = 'nobody' # Online recovery user recovery_password = '' # Online recovery password # Leaving it empty will make Pgpool-II to first look for the # Password in pool_passwd file before using the empty password recovery_1st_stage_command = '' # Executes a command in first stage recovery_2nd_stage_command = '' # Executes a command in second stage recovery_timeout = 90 # Timeout in seconds to wait for the # recovering node's postmaster to start up # 0 means no wait client_idle_limit_in_recovery = 0 # Client is disconnected after being idle # for that many seconds in the second stage # of online recovery # 0 means no disconnection # -1 means immediate disconnection #------------------------------------------------------------------------------ # WATCHDOG #------------------------------------------------------------------------------ # - Enabling - use_watchdog = off # Activates watchdog # (change requires restart) # -Connection to up stream servers - trusted_servers = '' # trusted server list which are used # to confirm network connection # (hostA,hostB,hostC,...) # (change requires restart) ping_path = '/bin' # ping command path # (change requires restart) # - Watchdog communication Settings - wd_hostname = '' # Host name or IP address of this watchdog # (change requires restart) wd_port = 9000 # port number for watchdog service # (change requires restart) wd_priority = 1 # priority of this watchdog in leader election # (change requires restart) wd_authkey = '' # Authentication key for watchdog communication # (change requires restart) wd_ipc_socket_dir = '/tmp' # Unix domain socket path for watchdog IPC socket # The Debian package defaults to # /var/run/postgresql # (change requires restart) # - Virtual IP control Setting - delegate_IP = '' # delegate IP address # If this is empty, virtual IP never bring up. # (change requires restart) if_cmd_path = '/sbin' # path to the directory where if_up/down_cmd exists # If if_up/down_cmd starts with "/", if_cmd_path will be ignored. # (change requires restart) if_up_cmd = '/usr/bin/sudo /sbin/ip addr add $_IP_$/24 dev eth0 label eth0:0' # startup delegate IP command # (change requires restart) if_down_cmd = '/usr/bin/sudo /sbin/ip addr del $_IP_$/24 dev eth0' # shutdown delegate IP command # (change requires restart) arping_path = '/usr/sbin' # arping command path # If arping_cmd starts with "/", arping_path will be ignored. # (change requires restart) arping_cmd = '/usr/bin/sudo /usr/sbin/arping -U $_IP_$ -w 1 -I eth0' # arping command # (change requires restart) # - Behaivor on escalation Setting - clear_memqcache_on_escalation = on # Clear all the query cache on shared memory # when standby pgpool escalate to active pgpool # (= virtual IP holder). # This should be off if client connects to pgpool # not using virtual IP. # (change requires restart) wd_escalation_command = '' # Executes this command at escalation on new active pgpool. # (change requires restart) wd_de_escalation_command = '' # Executes this command when master pgpool resigns from being master. # (change requires restart) # - Watchdog consensus settings for failover - failover_when_quorum_exists = on # Only perform backend node failover # when the watchdog cluster holds the quorum # (change requires restart) failover_require_consensus = on # Perform failover when majority of Pgpool-II nodes # aggrees on the backend node status change # (change requires restart) allow_multiple_failover_requests_from_node = off # A Pgpool-II node can cast multiple votes # for building the consensus on failover # (change requires restart) enable_consensus_with_half_votes = off # apply majority rule for consensus and quorum computation # at 50% of votes in a cluster with even number of nodes. # when enabled the existence of quorum and consensus # on failover is resolved after receiving half of the # total votes in the cluster, otherwise both these # decisions require at least one more vote than # half of the total votes. # (change requires restart) # - Lifecheck Setting - # -- common -- wd_monitoring_interfaces_list = '' # Comma separated list of interfaces names to monitor. # if any interface from the list is active the watchdog will # consider the network is fine # 'any' to enable monitoring on all interfaces except loopback # '' to disable monitoring # (change requires restart) wd_lifecheck_method = 'heartbeat' # Method of watchdog lifecheck ('heartbeat' or 'query' or 'external') # (change requires restart) wd_interval = 10 # lifecheck interval (sec) > 0 # (change requires restart) # -- heartbeat mode -- wd_heartbeat_port = 9694 # Port number for receiving heartbeat signal # (change requires restart) wd_heartbeat_keepalive = 2 # Interval time of sending heartbeat signal (sec) # (change requires restart) wd_heartbeat_deadtime = 30 # Deadtime interval for heartbeat signal (sec) # (change requires restart) heartbeat_destination0 = 'host0_ip1' # Host name or IP address of destination 0 # for sending heartbeat signal. # (change requires restart) heartbeat_destination_port0 = 9694 # Port number of destination 0 for sending # heartbeat signal. Usually this is the # same as wd_heartbeat_port. # (change requires restart) heartbeat_device0 = '' # Name of NIC device (such like 'eth0') # used for sending/receiving heartbeat # signal to/from destination 0. # This works only when this is not empty # and pgpool has root privilege. # (change requires restart) #heartbeat_destination1 = 'host0_ip2' #heartbeat_destination_port1 = 9694 #heartbeat_device1 = '' # -- query mode -- wd_life_point = 3 # lifecheck retry times # (change requires restart) wd_lifecheck_query = 'SELECT 1' # lifecheck query to pgpool from watchdog # (change requires restart) wd_lifecheck_dbname = 'template1' # Database name connected for lifecheck # (change requires restart) wd_lifecheck_user = 'nobody' # watchdog user monitoring pgpools in lifecheck # (change requires restart) wd_lifecheck_password = '' # Password for watchdog user in lifecheck # Leaving it empty will make Pgpool-II to first look for the # Password in pool_passwd file before using the empty password # (change requires restart) # - Other pgpool Connection Settings - #other_pgpool_hostname0 = 'host0' # Host name or IP address to connect to for other pgpool 0 # (change requires restart) #other_pgpool_port0 = 5432 # Port number for other pgpool 0 # (change requires restart) #other_wd_port0 = 9000 # Port number for other watchdog 0 # (change requires restart) #other_pgpool_hostname1 = 'host1' #other_pgpool_port1 = 5432 #other_wd_port1 = 9000 #------------------------------------------------------------------------------ # OTHERS #------------------------------------------------------------------------------ relcache_expire = 0 # Life time of relation cache in seconds. # 0 means no cache expiration(the default). # The relation cache is used for cache the # query result against PostgreSQL system # catalog to obtain various information # including table structures or if it's a # temporary table or not. The cache is # maintained in a pgpool child local memory # and being kept as long as it survives. # If someone modify the table by using # ALTER TABLE or some such, the relcache is # not consistent anymore. # For this purpose, cache_expiration # controls the life time of the cache. relcache_size = 256 # Number of relation cache # entry. If you see frequently: # "pool_search_relcache: cache replacement happend" # in the pgpool log, you might want to increate this number. check_temp_table = catalog # Temporary table check method. catalog, trace or none. # Default is catalog. check_unlogged_table = on # If on, enable unlogged table check in SELECT statements. # This initiates queries against system catalog of primary/master # thus increases load of master. # If you are absolutely sure that your system never uses unlogged tables # and you want to save access to primary/master, you could turn this off. # Default is on. enable_shared_relcache = on # If on, relation cache stored in memory cache, # the cache is shared among child process. # Default is on. # (change requires restart) relcache_query_target = master # Target node to send relcache queries. Default is master (primary) node. # If load_balance_node is specified, queries will be sent to load balance node. #------------------------------------------------------------------------------ # IN MEMORY QUERY MEMORY CACHE #------------------------------------------------------------------------------ memory_cache_enabled = off # If on, use the memory cache functionality, off by default # (change requires restart) memqcache_method = 'shmem' # Cache storage method. either 'shmem'(shared memory) or # 'memcached'. 'shmem' by default # (change requires restart) memqcache_memcached_host = 'localhost' # Memcached host name or IP address. Mandatory if # memqcache_method = 'memcached'. # Defaults to localhost. # (change requires restart) memqcache_memcached_port = 11211 # Memcached port number. Mondatory if memqcache_method = 'memcached'. # Defaults to 11211. # (change requires restart) memqcache_total_size = 67108864 # Total memory size in bytes for storing memory cache. # Mandatory if memqcache_method = 'shmem'. # Defaults to 64MB. # (change requires restart) memqcache_max_num_cache = 1000000 # Total number of cache entries. Mandatory # if memqcache_method = 'shmem'. # Each cache entry consumes 48 bytes on shared memory. # Defaults to 1,000,000(45.8MB). # (change requires restart) memqcache_expire = 0 # Memory cache entry life time specified in seconds. # 0 means infinite life time. 0 by default. # (change requires restart) memqcache_auto_cache_invalidation = on # If on, invalidation of query cache is triggered by corresponding # DDL/DML/DCL(and memqcache_expire). If off, it is only triggered # by memqcache_expire. on by default. # (change requires restart) memqcache_maxcache = 409600 # Maximum SELECT result size in bytes. # Must be smaller than memqcache_cache_block_size. Defaults to 400KB. # (change requires restart) memqcache_cache_block_size = 1048576 # Cache block size in bytes. Mandatory if memqcache_method = 'shmem'. # Defaults to 1MB. # (change requires restart) memqcache_oiddir = '/var/log/pgpool/oiddir' # Temporary work directory to record table oids # (change requires restart) white_memqcache_table_list = '' # Comma separated list of table names to memcache # that don't write to database # Regexp are accepted black_memqcache_table_list = '' # Comma separated list of table names not to memcache # that don't write to database # Regexp are accepted pgpool-II-4.1.4/src/sample/pgpool.conf.sample-stream0000664000175000017500000012466613730350127017252 00000000000000# ---------------------------- # pgPool-II configuration file # ---------------------------- # # This file consists of lines of the form: # # name = value # # Whitespace may be used. Comments are introduced with "#" anywhere on a line. # The complete list of parameter names and allowed values can be found in the # pgPool-II documentation. # # This file is read on server startup and when the server receives a SIGHUP # signal. If you edit the file on a running system, you have to SIGHUP the # server for the changes to take effect, or use "pgpool reload". Some # parameters, which are marked below, require a server shutdown and restart to # take effect. # #------------------------------------------------------------------------------ # CONNECTIONS #------------------------------------------------------------------------------ # - pgpool Connection Settings - listen_addresses = 'localhost' # Host name or IP address to listen on: # '*' for all, '' for no TCP/IP connections # (change requires restart) port = 9999 # Port number # (change requires restart) socket_dir = '/tmp' # Unix domain socket path # The Debian package defaults to # /var/run/postgresql # (change requires restart) reserved_connections = 0 # Number of reserved connections. # Pgpool-II does not accept connections if over # num_init_chidlren - reserved_connections. # - pgpool Communication Manager Connection Settings - pcp_listen_addresses = '*' # Host name or IP address for pcp process to listen on: # '*' for all, '' for no TCP/IP connections # (change requires restart) pcp_port = 9898 # Port number for pcp # (change requires restart) pcp_socket_dir = '/tmp' # Unix domain socket path for pcp # The Debian package defaults to # /var/run/postgresql # (change requires restart) listen_backlog_multiplier = 2 # Set the backlog parameter of listen(2) to # num_init_children * listen_backlog_multiplier. # (change requires restart) serialize_accept = off # whether to serialize accept() call to avoid thundering herd problem # (change requires restart) # - Backend Connection Settings - backend_hostname0 = 'host1' # Host name or IP address to connect to for backend 0 backend_port0 = 5432 # Port number for backend 0 backend_weight0 = 1 # Weight for backend 0 (only in load balancing mode) backend_data_directory0 = '/data' # Data directory for backend 0 backend_flag0 = 'ALLOW_TO_FAILOVER' # Controls various backend behavior # ALLOW_TO_FAILOVER, DISALLOW_TO_FAILOVER # or ALWAYS_MASTER backend_application_name0 = 'server0' # walsender's application_name, used for "show pool_nodes" command #backend_hostname1 = 'host2' #backend_port1 = 5433 #backend_weight1 = 1 #backend_data_directory1 = '/data1' #backend_flag1 = 'ALLOW_TO_FAILOVER' #backend_application_name1 = 'server1' # - Authentication - enable_pool_hba = off # Use pool_hba.conf for client authentication pool_passwd = 'pool_passwd' # File name of pool_passwd for md5 authentication. # "" disables pool_passwd. # (change requires restart) authentication_timeout = 60 # Delay in seconds to complete client authentication # 0 means no timeout. allow_clear_text_frontend_auth = off # Allow Pgpool-II to use clear text password authentication # with clients, when pool_passwd does not # contain the user password # - SSL Connections - ssl = off # Enable SSL support # (change requires restart) #ssl_key = './server.key' # Path to the SSL private key file # (change requires restart) #ssl_cert = './server.cert' # Path to the SSL public certificate file # (change requires restart) #ssl_ca_cert = '' # Path to a single PEM format file # containing CA root certificate(s) # (change requires restart) #ssl_ca_cert_dir = '' # Directory containing CA root certificate(s) # (change requires restart) ssl_ciphers = 'HIGH:MEDIUM:+3DES:!aNULL' # Allowed SSL ciphers # (change requires restart) ssl_prefer_server_ciphers = off # Use server's SSL cipher preferences, # rather than the client's # (change requires restart) ssl_ecdh_curve = 'prime256v1' # Name of the curve to use in ECDH key exchange ssl_dh_params_file = '' # Name of the file containing Diffie-Hellman parameters used # for so-called ephemeral DH family of SSL cipher. #------------------------------------------------------------------------------ # POOLS #------------------------------------------------------------------------------ # - Concurrent session and pool size - num_init_children = 32 # Number of concurrent sessions allowed # (change requires restart) max_pool = 4 # Number of connection pool caches per connection # (change requires restart) # - Life time - child_life_time = 300 # Pool exits after being idle for this many seconds child_max_connections = 0 # Pool exits after receiving that many connections # 0 means no exit connection_life_time = 0 # Connection to backend closes after being idle for this many seconds # 0 means no close client_idle_limit = 0 # Client is disconnected after being idle for that many seconds # (even inside an explicit transactions!) # 0 means no disconnection #------------------------------------------------------------------------------ # LOGS #------------------------------------------------------------------------------ # - Where to log - log_destination = 'stderr' # Where to log # Valid values are combinations of stderr, # and syslog. Default to stderr. # - What to log - log_line_prefix = '%t: pid %p: ' # printf-style string to output at beginning of each log line. log_connections = off # Log connections log_hostname = off # Hostname will be shown in ps status # and in logs if connections are logged log_statement = off # Log all statements log_per_node_statement = off # Log all statements # with node and backend informations log_client_messages = off # Log any client messages log_standby_delay = 'if_over_threshold' # Log standby delay # Valid values are combinations of always, # if_over_threshold, none # - Syslog specific - syslog_facility = 'LOCAL0' # Syslog local facility. Default to LOCAL0 syslog_ident = 'pgpool' # Syslog program identification string # Default to 'pgpool' # - Debug - #log_error_verbosity = default # terse, default, or verbose messages #client_min_messages = notice # values in order of decreasing detail: # debug5 # debug4 # debug3 # debug2 # debug1 # log # notice # warning # error #log_min_messages = warning # values in order of decreasing detail: # debug5 # debug4 # debug3 # debug2 # debug1 # info # notice # warning # error # log # fatal # panic #------------------------------------------------------------------------------ # FILE LOCATIONS #------------------------------------------------------------------------------ pid_file_name = '/var/run/pgpool/pgpool.pid' # PID file name # Can be specified as relative to the" # location of pgpool.conf file or # as an absolute path # (change requires restart) logdir = '/tmp' # Directory of pgPool status file # (change requires restart) #------------------------------------------------------------------------------ # CONNECTION POOLING #------------------------------------------------------------------------------ connection_cache = on # Activate connection pools # (change requires restart) # Semicolon separated list of queries # to be issued at the end of a session # The default is for 8.3 and later reset_query_list = 'ABORT; DISCARD ALL' # The following one is for 8.2 and before #reset_query_list = 'ABORT; RESET ALL; SET SESSION AUTHORIZATION DEFAULT' #------------------------------------------------------------------------------ # REPLICATION MODE #------------------------------------------------------------------------------ replication_mode = off # Activate replication mode # (change requires restart) replicate_select = off # Replicate SELECT statements # when in replication mode # replicate_select is higher priority than # load_balance_mode. insert_lock = off # Automatically locks a dummy row or a table # with INSERT statements to keep SERIAL data # consistency # Without SERIAL, no lock will be issued lobj_lock_table = '' # When rewriting lo_creat command in # replication mode, specify table name to # lock # - Degenerate handling - replication_stop_on_mismatch = off # On disagreement with the packet kind # sent from backend, degenerate the node # which is most likely "minority" # If off, just force to exit this session failover_if_affected_tuples_mismatch = off # On disagreement with the number of affected # tuples in UPDATE/DELETE queries, then # degenerate the node which is most likely # "minority". # If off, just abort the transaction to # keep the consistency #------------------------------------------------------------------------------ # LOAD BALANCING MODE #------------------------------------------------------------------------------ load_balance_mode = on # Activate load balancing mode # (change requires restart) ignore_leading_white_space = on # Ignore leading white spaces of each query white_function_list = '' # Comma separated list of function names # that don't write to database # Regexp are accepted black_function_list = 'currval,lastval,nextval,setval' # Comma separated list of function names # that write to database # Regexp are accepted black_query_pattern_list = '' # Semicolon separated list of query patterns # that should be sent to primary node # Regexp are accepted # valid for streaming replicaton mode only. database_redirect_preference_list = '' # comma separated list of pairs of database and node id. # example: postgres:primary,mydb[0-4]:1,mydb[5-9]:2' # valid for streaming replicaton mode only. app_name_redirect_preference_list = '' # comma separated list of pairs of app name and node id. # example: 'psql:primary,myapp[0-4]:1,myapp[5-9]:standby' # valid for streaming replicaton mode only. allow_sql_comments = off # if on, ignore SQL comments when judging if load balance or # query cache is possible. # If off, SQL comments effectively prevent the judgment # (pre 3.4 behavior). disable_load_balance_on_write = 'transaction' # Load balance behavior when write query is issued # in an explicit transaction. # Note that any query not in an explicit transaction # is not affected by the parameter. # 'transaction' (the default): if a write query is issued, # subsequent read queries will not be load balanced # until the transaction ends. # 'trans_transaction': if a write query is issued, # subsequent read queries in an explicit transaction # will not be load balanced until the session ends. # 'always': if a write query is issued, read queries will # not be load balanced until the session ends. statement_level_load_balance = off # Enables statement level load balancing #------------------------------------------------------------------------------ # MASTER/SLAVE MODE #------------------------------------------------------------------------------ master_slave_mode = on # Activate master/slave mode # (change requires restart) master_slave_sub_mode = 'stream' # Master/slave sub mode # Valid values are combinations stream, slony # or logical. Default is stream. # (change requires restart) # - Streaming - sr_check_period = 10 # Streaming replication check period # Disabled (0) by default sr_check_user = 'nobody' # Streaming replication check user # This is neccessary even if you disable streaming # replication delay check by sr_check_period = 0 sr_check_password = '' # Password for streaming replication check user # Leaving it empty will make Pgpool-II to first look for the # Password in pool_passwd file before using the empty password sr_check_database = 'postgres' # Database name for streaming replication check delay_threshold = 10000000 # Threshold before not dispatching query to standby node # Unit is in bytes # Disabled (0) by default # - Special commands - follow_master_command = '' # Executes this command after master failover # Special values: # %d = failed node id # %h = failed node host name # %p = failed node port number # %D = failed node database cluster path # %m = new master node id # %H = new master node hostname # %M = old master node id # %P = old primary node id # %r = new master port number # %R = new master database cluster path # %N = old primary node hostname # %S = old primary node port number # %% = '%' character #------------------------------------------------------------------------------ # HEALTH CHECK GLOBAL PARAMETERS #------------------------------------------------------------------------------ health_check_period = 0 # Health check period # Disabled (0) by default health_check_timeout = 20 # Health check timeout # 0 means no timeout health_check_user = 'nobody' # Health check user health_check_password = '' # Password for health check user # Leaving it empty will make Pgpool-II to first look for the # Password in pool_passwd file before using the empty password health_check_database = '' # Database name for health check. If '', tries 'postgres' frist, health_check_max_retries = 0 # Maximum number of times to retry a failed health check before giving up. health_check_retry_delay = 1 # Amount of time to wait (in seconds) between retries. connect_timeout = 10000 # Timeout value in milliseconds before giving up to connect to backend. # Default is 10000 ms (10 second). Flaky network user may want to increase # the value. 0 means no timeout. # Note that this value is not only used for health check, # but also for ordinary conection to backend. #------------------------------------------------------------------------------ # HEALTH CHECK PER NODE PARAMETERS (OPTIONAL) #------------------------------------------------------------------------------ #health_check_period0 = 0 #health_check_timeout0 = 20 #health_check_user0 = 'nobody' #health_check_password0 = '' #health_check_database0 = '' #health_check_max_retries0 = 0 #health_check_retry_delay0 = 1 #connect_timeout0 = 10000 #------------------------------------------------------------------------------ # FAILOVER AND FAILBACK #------------------------------------------------------------------------------ failover_command = '' # Executes this command at failover # Special values: # %d = failed node id # %h = failed node host name # %p = failed node port number # %D = failed node database cluster path # %m = new master node id # %H = new master node hostname # %M = old master node id # %P = old primary node id # %r = new master port number # %R = new master database cluster path # %N = old primary node hostname # %S = old primary node port number # %% = '%' character failback_command = '' # Executes this command at failback. # Special values: # %d = failed node id # %h = failed node host name # %p = failed node port number # %D = failed node database cluster path # %m = new master node id # %H = new master node hostname # %M = old master node id # %P = old primary node id # %r = new master port number # %R = new master database cluster path # %N = old primary node hostname # %S = old primary node port number # %% = '%' character failover_on_backend_error = on # Initiates failover when reading/writing to the # backend communication socket fails # If set to off, pgpool will report an # error and disconnect the session. detach_false_primary = off # Detach false primary if on. Only # valid in streaming replicaton # mode and with PostgreSQL 9.6 or # after. search_primary_node_timeout = 300 # Timeout in seconds to search for the # primary node when a failover occurs. # 0 means no timeout, keep searching # for a primary node forever. #------------------------------------------------------------------------------ # ONLINE RECOVERY #------------------------------------------------------------------------------ recovery_user = 'nobody' # Online recovery user recovery_password = '' # Online recovery password # Leaving it empty will make Pgpool-II to first look for the # Password in pool_passwd file before using the empty password recovery_1st_stage_command = '' # Executes a command in first stage recovery_2nd_stage_command = '' # Executes a command in second stage recovery_timeout = 90 # Timeout in seconds to wait for the # recovering node's postmaster to start up # 0 means no wait client_idle_limit_in_recovery = 0 # Client is disconnected after being idle # for that many seconds in the second stage # of online recovery # 0 means no disconnection # -1 means immediate disconnection auto_failback = off # Dettached backend node reattach automatically # if replication_state is 'streaming'. auto_failback_interval = 60 # Min interval of executing auto_failback in # seconds. #------------------------------------------------------------------------------ # WATCHDOG #------------------------------------------------------------------------------ # - Enabling - use_watchdog = off # Activates watchdog # (change requires restart) # -Connection to up stream servers - trusted_servers = '' # trusted server list which are used # to confirm network connection # (hostA,hostB,hostC,...) # (change requires restart) ping_path = '/bin' # ping command path # (change requires restart) # - Watchdog communication Settings - wd_hostname = '' # Host name or IP address of this watchdog # (change requires restart) wd_port = 9000 # port number for watchdog service # (change requires restart) wd_priority = 1 # priority of this watchdog in leader election # (change requires restart) wd_authkey = '' # Authentication key for watchdog communication # (change requires restart) wd_ipc_socket_dir = '/tmp' # Unix domain socket path for watchdog IPC socket # The Debian package defaults to # /var/run/postgresql # (change requires restart) # - Virtual IP control Setting - delegate_IP = '' # delegate IP address # If this is empty, virtual IP never bring up. # (change requires restart) if_cmd_path = '/sbin' # path to the directory where if_up/down_cmd exists # If if_up/down_cmd starts with "/", if_cmd_path will be ignored. # (change requires restart) if_up_cmd = '/usr/bin/sudo /sbin/ip addr add $_IP_$/24 dev eth0 label eth0:0' # startup delegate IP command # (change requires restart) if_down_cmd = '/usr/bin/sudo /sbin/ip addr del $_IP_$/24 dev eth0' # shutdown delegate IP command # (change requires restart) arping_path = '/usr/sbin' # arping command path # If arping_cmd starts with "/", if_cmd_path will be ignored. # (change requires restart) arping_cmd = '/usr/bin/sudo /usr/sbin/arping -U $_IP_$ -w 1 -I eth0' # arping command # (change requires restart) # - Behaivor on escalation Setting - clear_memqcache_on_escalation = on # Clear all the query cache on shared memory # when standby pgpool escalate to active pgpool # (= virtual IP holder). # This should be off if client connects to pgpool # not using virtual IP. # (change requires restart) wd_escalation_command = '' # Executes this command at escalation on new active pgpool. # (change requires restart) wd_de_escalation_command = '' # Executes this command when master pgpool resigns from being master. # (change requires restart) # - Watchdog consensus settings for failover - failover_when_quorum_exists = on # Only perform backend node failover # when the watchdog cluster holds the quorum # (change requires restart) failover_require_consensus = on # Perform failover when majority of Pgpool-II nodes # aggrees on the backend node status change # (change requires restart) allow_multiple_failover_requests_from_node = off # A Pgpool-II node can cast multiple votes # for building the consensus on failover # (change requires restart) enable_consensus_with_half_votes = off # apply majority rule for consensus and quorum computation # at 50% of votes in a cluster with even number of nodes. # when enabled the existence of quorum and consensus # on failover is resolved after receiving half of the # total votes in the cluster, otherwise both these # decisions require at least one more vote than # half of the total votes. # (change requires restart) # - Lifecheck Setting - # -- common -- wd_monitoring_interfaces_list = '' # Comma separated list of interfaces names to monitor. # if any interface from the list is active the watchdog will # consider the network is fine # 'any' to enable monitoring on all interfaces except loopback # '' to disable monitoring # (change requires restart) wd_lifecheck_method = 'heartbeat' # Method of watchdog lifecheck ('heartbeat' or 'query' or 'external') # (change requires restart) wd_interval = 10 # lifecheck interval (sec) > 0 # (change requires restart) # -- heartbeat mode -- wd_heartbeat_port = 9694 # Port number for receiving heartbeat signal # (change requires restart) wd_heartbeat_keepalive = 2 # Interval time of sending heartbeat signal (sec) # (change requires restart) wd_heartbeat_deadtime = 30 # Deadtime interval for heartbeat signal (sec) # (change requires restart) heartbeat_destination0 = 'host0_ip1' # Host name or IP address of destination 0 # for sending heartbeat signal. # (change requires restart) heartbeat_destination_port0 = 9694 # Port number of destination 0 for sending # heartbeat signal. Usually this is the # same as wd_heartbeat_port. # (change requires restart) heartbeat_device0 = '' # Name of NIC device (such like 'eth0') # used for sending/receiving heartbeat # signal to/from destination 0. # This works only when this is not empty # and pgpool has root privilege. # (change requires restart) #heartbeat_destination1 = 'host0_ip2' #heartbeat_destination_port1 = 9694 #heartbeat_device1 = '' # -- query mode -- wd_life_point = 3 # lifecheck retry times # (change requires restart) wd_lifecheck_query = 'SELECT 1' # lifecheck query to pgpool from watchdog # (change requires restart) wd_lifecheck_dbname = 'template1' # Database name connected for lifecheck # (change requires restart) wd_lifecheck_user = 'nobody' # watchdog user monitoring pgpools in lifecheck # (change requires restart) wd_lifecheck_password = '' # Password for watchdog user in lifecheck # Leaving it empty will make Pgpool-II to first look for the # Password in pool_passwd file before using the empty password # (change requires restart) # - Other pgpool Connection Settings - #other_pgpool_hostname0 = 'host0' # Host name or IP address to connect to for other pgpool 0 # (change requires restart) #other_pgpool_port0 = 5432 # Port number for other pgpool 0 # (change requires restart) #other_wd_port0 = 9000 # Port number for other watchdog 0 # (change requires restart) #other_pgpool_hostname1 = 'host1' #other_pgpool_port1 = 5432 #other_wd_port1 = 9000 #------------------------------------------------------------------------------ # OTHERS #------------------------------------------------------------------------------ relcache_expire = 0 # Life time of relation cache in seconds. # 0 means no cache expiration(the default). # The relation cache is used for cache the # query result against PostgreSQL system # catalog to obtain various information # including table structures or if it's a # temporary table or not. The cache is # maintained in a pgpool child local memory # and being kept as long as it survives. # If someone modify the table by using # ALTER TABLE or some such, the relcache is # not consistent anymore. # For this purpose, cache_expiration # controls the life time of the cache. relcache_size = 256 # Number of relation cache # entry. If you see frequently: # "pool_search_relcache: cache replacement happend" # in the pgpool log, you might want to increate this number. check_temp_table = catalog # Temporary table check method. catalog, trace or none. # Default is catalog. check_unlogged_table = on # If on, enable unlogged table check in SELECT statements. # This initiates queries against system catalog of primary/master # thus increases load of master. # If you are absolutely sure that your system never uses unlogged tables # and you want to save access to primary/master, you could turn this off. # Default is on. enable_shared_relcache = on # If on, relation cache stored in memory cache, # the cache is shared among child process. # Default is on. # (change requires restart) relcache_query_target = master # Target node to send relcache queries. Default is master (primary) node. # If load_balance_node is specified, queries will be sent to load balance node. #------------------------------------------------------------------------------ # IN MEMORY QUERY MEMORY CACHE #------------------------------------------------------------------------------ memory_cache_enabled = off # If on, use the memory cache functionality, off by default # (change requires restart) memqcache_method = 'shmem' # Cache storage method. either 'shmem'(shared memory) or # 'memcached'. 'shmem' by default # (change requires restart) memqcache_memcached_host = 'localhost' # Memcached host name or IP address. Mandatory if # memqcache_method = 'memcached'. # Defaults to localhost. # (change requires restart) memqcache_memcached_port = 11211 # Memcached port number. Mondatory if memqcache_method = 'memcached'. # Defaults to 11211. # (change requires restart) memqcache_total_size = 67108864 # Total memory size in bytes for storing memory cache. # Mandatory if memqcache_method = 'shmem'. # Defaults to 64MB. # (change requires restart) memqcache_max_num_cache = 1000000 # Total number of cache entries. Mandatory # if memqcache_method = 'shmem'. # Each cache entry consumes 48 bytes on shared memory. # Defaults to 1,000,000(45.8MB). # (change requires restart) memqcache_expire = 0 # Memory cache entry life time specified in seconds. # 0 means infinite life time. 0 by default. # (change requires restart) memqcache_auto_cache_invalidation = on # If on, invalidation of query cache is triggered by corresponding # DDL/DML/DCL(and memqcache_expire). If off, it is only triggered # by memqcache_expire. on by default. # (change requires restart) memqcache_maxcache = 409600 # Maximum SELECT result size in bytes. # Must be smaller than memqcache_cache_block_size. Defaults to 400KB. # (change requires restart) memqcache_cache_block_size = 1048576 # Cache block size in bytes. Mandatory if memqcache_method = 'shmem'. # Defaults to 1MB. # (change requires restart) memqcache_oiddir = '/var/log/pgpool/oiddir' # Temporary work directory to record table oids # (change requires restart) white_memqcache_table_list = '' # Comma separated list of table names to memcache # that don't write to database # Regexp are accepted black_memqcache_table_list = '' # Comma separated list of table names not to memcache # that don't write to database # Regexp are accepted pgpool-II-4.1.4/src/sample/pgpool.conf.sample-logical0000664000175000017500000012217613730350127017363 00000000000000# ---------------------------- # pgPool-II configuration file # ---------------------------- # # This file consists of lines of the form: # # name = value # # Whitespace may be used. Comments are introduced with "#" anywhere on a line. # The complete list of parameter names and allowed values can be found in the # pgPool-II documentation. # # This file is read on server startup and when the server receives a SIGHUP # signal. If you edit the file on a running system, you have to SIGHUP the # server for the changes to take effect, or use "pgpool reload". Some # parameters, which are marked below, require a server shutdown and restart to # take effect. # #------------------------------------------------------------------------------ # CONNECTIONS #------------------------------------------------------------------------------ # - pgpool Connection Settings - listen_addresses = 'localhost' # Host name or IP address to listen on: # '*' for all, '' for no TCP/IP connections # (change requires restart) port = 9999 # Port number # (change requires restart) socket_dir = '/tmp' # Unix domain socket path # The Debian package defaults to # /var/run/postgresql # (change requires restart) reserved_connections = 0 # Number of reserved connections. # Pgpool-II does not accept connections if over # num_init_chidlren - reserved_connections. # - pgpool Communication Manager Connection Settings - pcp_listen_addresses = '*' # Host name or IP address for pcp process to listen on: # '*' for all, '' for no TCP/IP connections # (change requires restart) pcp_port = 9898 # Port number for pcp # (change requires restart) pcp_socket_dir = '/tmp' # Unix domain socket path for pcp # The Debian package defaults to # /var/run/postgresql # (change requires restart) listen_backlog_multiplier = 2 # Set the backlog parameter of listen(2) to # num_init_children * listen_backlog_multiplier. # (change requires restart) serialize_accept = off # whether to serialize accept() call to avoid thundering herd problem # (change requires restart) # - Backend Connection Settings - backend_hostname0 = 'host1' # Host name or IP address to connect to for backend 0 backend_port0 = 5432 # Port number for backend 0 backend_weight0 = 1 # Weight for backend 0 (only in load balancing mode) backend_data_directory0 = '/data' # Data directory for backend 0 backend_flag0 = 'ALLOW_TO_FAILOVER' # Controls various backend behavior # ALLOW_TO_FAILOVER, DISALLOW_TO_FAILOVER # or ALWAYS_MASTER backend_application_name0 = 'server0' # walsender's application_name, used for "show pool_nodes" command #backend_hostname1 = 'host2' #backend_port1 = 5433 #backend_weight1 = 1 #backend_data_directory1 = '/data1' #backend_flag1 = 'ALLOW_TO_FAILOVER' #backend_application_name1 = 'server1' # - Authentication - enable_pool_hba = off # Use pool_hba.conf for client authentication pool_passwd = 'pool_passwd' # File name of pool_passwd for md5 authentication. # "" disables pool_passwd. # (change requires restart) authentication_timeout = 60 # Delay in seconds to complete client authentication # 0 means no timeout. allow_clear_text_frontend_auth = off # Allow Pgpool-II to use clear text password authentication # with clients, when pool_passwd does not # contain the user password # - SSL Connections - ssl = off # Enable SSL support # (change requires restart) #ssl_key = './server.key' # Path to the SSL private key file # (change requires restart) #ssl_cert = './server.cert' # Path to the SSL public certificate file # (change requires restart) #ssl_ca_cert = '' # Path to a single PEM format file # containing CA root certificate(s) # (change requires restart) #ssl_ca_cert_dir = '' # Directory containing CA root certificate(s) # (change requires restart) ssl_ciphers = 'HIGH:MEDIUM:+3DES:!aNULL' # Allowed SSL ciphers # (change requires restart) ssl_prefer_server_ciphers = off # Use server's SSL cipher preferences, # rather than the client's # (change requires restart) ssl_ecdh_curve = 'prime256v1' # Name of the curve to use in ECDH key exchange ssl_dh_params_file = '' # Name of the file containing Diffie-Hellman parameters used # for so-called ephemeral DH family of SSL cipher. #------------------------------------------------------------------------------ # POOLS #------------------------------------------------------------------------------ # - Concurrent session and pool size - num_init_children = 32 # Number of concurrent sessions allowed # (change requires restart) max_pool = 4 # Number of connection pool caches per connection # (change requires restart) # - Life time - child_life_time = 300 # Pool exits after being idle for this many seconds child_max_connections = 0 # Pool exits after receiving that many connections # 0 means no exit connection_life_time = 0 # Connection to backend closes after being idle for this many seconds # 0 means no close client_idle_limit = 0 # Client is disconnected after being idle for that many seconds # (even inside an explicit transactions!) # 0 means no disconnection #------------------------------------------------------------------------------ # LOGS #------------------------------------------------------------------------------ # - Where to log - log_destination = 'stderr' # Where to log # Valid values are combinations of stderr, # and syslog. Default to stderr. # - What to log - log_line_prefix = '%t: pid %p: ' # printf-style string to output at beginning of each log line. log_connections = off # Log connections log_hostname = off # Hostname will be shown in ps status # and in logs if connections are logged log_statement = off # Log all statements log_per_node_statement = off # Log all statements # with node and backend informations log_client_messages = off # Log any client messages log_standby_delay = 'if_over_threshold' # Log standby delay # Valid values are combinations of always, # if_over_threshold, none # - Syslog specific - syslog_facility = 'LOCAL0' # Syslog local facility. Default to LOCAL0 syslog_ident = 'pgpool' # Syslog program identification string # Default to 'pgpool' # - Debug - #log_error_verbosity = default # terse, default, or verbose messages #client_min_messages = notice # values in order of decreasing detail: # debug5 # debug4 # debug3 # debug2 # debug1 # log # notice # warning # error #log_min_messages = warning # values in order of decreasing detail: # debug5 # debug4 # debug3 # debug2 # debug1 # info # notice # warning # error # log # fatal # panic #------------------------------------------------------------------------------ # FILE LOCATIONS #------------------------------------------------------------------------------ pid_file_name = '/var/run/pgpool/pgpool.pid' # PID file name # Can be specified as relative to the" # location of pgpool.conf file or # as an absolute path # (change requires restart) logdir = '/tmp' # Directory of pgPool status file # (change requires restart) #------------------------------------------------------------------------------ # CONNECTION POOLING #------------------------------------------------------------------------------ connection_cache = on # Activate connection pools # (change requires restart) # Semicolon separated list of queries # to be issued at the end of a session # The default is for 8.3 and later reset_query_list = 'ABORT; DISCARD ALL' # The following one is for 8.2 and before #reset_query_list = 'ABORT; RESET ALL; SET SESSION AUTHORIZATION DEFAULT' #------------------------------------------------------------------------------ # REPLICATION MODE #------------------------------------------------------------------------------ replication_mode = off # Activate replication mode # (change requires restart) replicate_select = off # Replicate SELECT statements # when in replication mode # replicate_select is higher priority than # load_balance_mode. insert_lock = off # Automatically locks a dummy row or a table # with INSERT statements to keep SERIAL data # consistency # Without SERIAL, no lock will be issued lobj_lock_table = '' # When rewriting lo_creat command in # replication mode, specify table name to # lock # - Degenerate handling - replication_stop_on_mismatch = off # On disagreement with the packet kind # sent from backend, degenerate the node # which is most likely "minority" # If off, just force to exit this session failover_if_affected_tuples_mismatch = off # On disagreement with the number of affected # tuples in UPDATE/DELETE queries, then # degenerate the node which is most likely # "minority". # If off, just abort the transaction to # keep the consistency #------------------------------------------------------------------------------ # LOAD BALANCING MODE #------------------------------------------------------------------------------ load_balance_mode = on # Activate load balancing mode # (change requires restart) ignore_leading_white_space = on # Ignore leading white spaces of each query white_function_list = '' # Comma separated list of function names # that don't write to database # Regexp are accepted black_function_list = 'currval,lastval,nextval,setval' # Comma separated list of function names # that write to database # Regexp are accepted black_query_pattern_list = '' # Semicolon separated list of query patterns # that should be sent to primary node # Regexp are accepted # valid for streaming replicaton mode only. database_redirect_preference_list = '' # comma separated list of pairs of database and node id. # example: postgres:primary,mydb[0-4]:1,mydb[5-9]:2' # valid for streaming replicaton mode only. app_name_redirect_preference_list = '' # comma separated list of pairs of app name and node id. # example: 'psql:primary,myapp[0-4]:1,myapp[5-9]:standby' # valid for streaming replicaton mode only. allow_sql_comments = off # if on, ignore SQL comments when judging if load balance or # query cache is possible. # If off, SQL comments effectively prevent the judgment # (pre 3.4 behavior). statement_level_load_balance = off # Enables statement level load balancing #------------------------------------------------------------------------------ # MASTER/SLAVE MODE #------------------------------------------------------------------------------ master_slave_mode = on # Activate master/slave mode # (change requires restart) master_slave_sub_mode = 'logical' # Master/slave sub mode # Valid values are combinations stream, slony # or logical. Default is stream. # (change requires restart) # - Streaming - sr_check_period = 0 # Streaming replication check period # Disabled (0) by default sr_check_user = 'nobody' # Streaming replication check user # This is neccessary even if you disable streaming # replication delay check by sr_check_period = 0 sr_check_password = '' # Password for streaming replication check user. # Leaving it empty will make Pgpool-II to first look for the # Password in pool_passwd file before using the empty password sr_check_database = 'postgres' # Database name for streaming replication check delay_threshold = 10000000 # Threshold before not dispatching query to standby node # Unit is in bytes # Disabled (0) by default # - Special commands - follow_master_command = '' # Executes this command after master failover # Special values: # %d = failed node id # %h = failed node host name # %p = failed node port number # %D = failed node database cluster path # %m = new master node id # %H = new master node hostname # %M = old master node id # %P = old primary node id # %r = new master port number # %R = new master database cluster path # %N = old primary node hostname # %S = old primary node port number # %% = '%' character #------------------------------------------------------------------------------ # HEALTH CHECK GLOBAL PARAMETERS #------------------------------------------------------------------------------ health_check_period = 0 # Health check period # Disabled (0) by default health_check_timeout = 20 # Health check timeout # 0 means no timeout health_check_user = 'nobody' # Health check user health_check_password = '' # Password for health check user # Leaving it empty will make Pgpool-II to first look for the # Password in pool_passwd file before using the empty password health_check_database = '' # Database name for health check. If '', tries 'postgres' frist, health_check_max_retries = 0 # Maximum number of times to retry a failed health check before giving up. health_check_retry_delay = 1 # Amount of time to wait (in seconds) between retries. connect_timeout = 10000 # Timeout value in milliseconds before giving up to connect to backend. # Default is 10000 ms (10 second). Flaky network user may want to increase # the value. 0 means no timeout. # Note that this value is not only used for health check, # but also for ordinary conection to backend. #------------------------------------------------------------------------------ # HEALTH CHECK PER NODE PARAMETERS (OPTIONAL) #------------------------------------------------------------------------------ #health_check_period0 = 0 #health_check_timeout0 = 20 #health_check_user0 = 'nobody' #health_check_password0 = '' #health_check_database0 = '' #health_check_max_retries0 = 0 #health_check_retry_delay0 = 1 #connect_timeout0 = 10000 #------------------------------------------------------------------------------ # FAILOVER AND FAILBACK #------------------------------------------------------------------------------ failover_command = '' # Executes this command at failover # Special values: # %d = failed node id # %h = failed node host name # %p = failed node port number # %D = failed node database cluster path # %m = new master node id # %H = new master node hostname # %M = old master node id # %P = old primary node id # %r = new master port number # %R = new master database cluster path # %N = old primary node hostname # %S = old primary node port number # %% = '%' character failback_command = '' # Executes this command at failback. # Special values: # %d = failed node id # %h = failed node host name # %p = failed node port number # %D = failed node database cluster path # %m = new master node id # %H = new master node hostname # %M = old master node id # %P = old primary node id # %r = new master port number # %R = new master database cluster path # %N = old primary node hostname # %S = old primary node port number # %% = '%' character failover_on_backend_error = on # Initiates failover when reading/writing to the # backend communication socket fails # If set to off, pgpool will report an # error and disconnect the session. detach_false_primary = off # Detach false primary if on. Only # valid in streaming replicaton # mode and with PostgreSQL 9.6 or # after. search_primary_node_timeout = 300 # Timeout in seconds to search for the # primary node when a failover occurs. # 0 means no timeout, keep searching # for a primary node forever. auto_failback = off # Dettached backend node reattach automatically # if replication_state is 'streaming'. auto_failback_interval = 60 # Min interval of executing auto_failback in # seconds. #------------------------------------------------------------------------------ # ONLINE RECOVERY #------------------------------------------------------------------------------ recovery_user = 'nobody' # Online recovery user recovery_password = '' # Online recovery password # Leaving it empty will make Pgpool-II to first look for the # Password in pool_passwd file before using the empty password recovery_1st_stage_command = '' # Executes a command in first stage recovery_2nd_stage_command = '' # Executes a command in second stage recovery_timeout = 90 # Timeout in seconds to wait for the # recovering node's postmaster to start up # 0 means no wait client_idle_limit_in_recovery = 0 # Client is disconnected after being idle # for that many seconds in the second stage # of online recovery # 0 means no disconnection # -1 means immediate disconnection #------------------------------------------------------------------------------ # WATCHDOG #------------------------------------------------------------------------------ # - Enabling - use_watchdog = off # Activates watchdog # (change requires restart) # -Connection to up stream servers - trusted_servers = '' # trusted server list which are used # to confirm network connection # (hostA,hostB,hostC,...) # (change requires restart) ping_path = '/bin' # ping command path # (change requires restart) # - Watchdog communication Settings - wd_hostname = '' # Host name or IP address of this watchdog # (change requires restart) wd_port = 9000 # port number for watchdog service # (change requires restart) wd_priority = 1 # priority of this watchdog in leader election # (change requires restart) wd_authkey = '' # Authentication key for watchdog communication # (change requires restart) wd_ipc_socket_dir = '/tmp' # Unix domain socket path for watchdog IPC socket # The Debian package defaults to # /var/run/postgresql # (change requires restart) # - Virtual IP control Setting - delegate_IP = '' # delegate IP address # If this is empty, virtual IP never bring up. # (change requires restart) if_cmd_path = '/sbin' # path to the directory where if_up/down_cmd exists # If if_up/down_cmd starts with "/", if_cmd_path will be ignored. # (change requires restart) if_up_cmd = '/usr/bin/sudo /sbin/ip addr add $_IP_$/24 dev eth0 label eth0:0' # startup delegate IP command # (change requires restart) if_down_cmd = '/usr/bin/sudo /sbin/ip addr del $_IP_$/24 dev eth0' # shutdown delegate IP command # (change requires restart) arping_path = '/usr/sbin' # arping command path # If arping_cmd starts with "/", if_cmd_path will be ignored. # (change requires restart) arping_cmd = '/usr/bin/sudo /usr/sbin/arping -U $_IP_$ -w 1 -I eth0' # arping command # (change requires restart) # - Behaivor on escalation Setting - clear_memqcache_on_escalation = on # Clear all the query cache on shared memory # when standby pgpool escalate to active pgpool # (= virtual IP holder). # This should be off if client connects to pgpool # not using virtual IP. # (change requires restart) wd_escalation_command = '' # Executes this command at escalation on new active pgpool. # (change requires restart) wd_de_escalation_command = '' # Executes this command when master pgpool resigns from being master. # (change requires restart) # - Watchdog consensus settings for failover - failover_when_quorum_exists = on # Only perform backend node failover # when the watchdog cluster holds the quorum failover_require_consensus = on # Perform failover when majority of Pgpool-II nodes # aggrees on the backend node status change enable_multiple_failover_requests_from_node = off # A Pgpool-II node can cast multiple votes # for building the consensus on failover enable_consensus_with_half_votes = off # apply majority rule for consensus and quorum computation # at 50% of votes in a cluster with even number of nodes. # when enabled the existence of quorum and consensus # on failover is resolved after receiving half of the # total votes in the cluster, otherwise both these # decisions require at least one more vote than # half of the total votes. # (change requires restart) # - Lifecheck Setting - # -- common -- wd_monitoring_interfaces_list = '' # Comma separated list of interfaces names to monitor. # if any interface from the list is active the watchdog will # consider the network is fine # 'any' to enable monitoring on all interfaces except loopback # '' to disable monitoring wd_lifecheck_method = 'heartbeat' # Method of watchdog lifecheck ('heartbeat' or 'query' or 'external') # (change requires restart) wd_interval = 10 # lifecheck interval (sec) > 0 # (change requires restart) # -- heartbeat mode -- wd_heartbeat_port = 9694 # Port number for receiving heartbeat signal # (change requires restart) wd_heartbeat_keepalive = 2 # Interval time of sending heartbeat signal (sec) # (change requires restart) wd_heartbeat_deadtime = 30 # Deadtime interval for heartbeat signal (sec) # (change requires restart) heartbeat_destination0 = 'host0_ip1' # Host name or IP address of destination 0 # for sending heartbeat signal. # (change requires restart) heartbeat_destination_port0 = 9694 # Port number of destination 0 for sending # heartbeat signal. Usually this is the # same as wd_heartbeat_port. # (change requires restart) heartbeat_device0 = '' # Name of NIC device (such like 'eth0') # used for sending/receiving heartbeat # signal to/from destination 0. # This works only when this is not empty # and pgpool has root privilege. # (change requires restart) #heartbeat_destination1 = 'host0_ip2' #heartbeat_destination_port1 = 9694 #heartbeat_device1 = '' # -- query mode -- wd_life_point = 3 # lifecheck retry times # (change requires restart) wd_lifecheck_query = 'SELECT 1' # lifecheck query to pgpool from watchdog # (change requires restart) wd_lifecheck_dbname = 'template1' # Database name connected for lifecheck # (change requires restart) wd_lifecheck_user = 'nobody' # watchdog user monitoring pgpools in lifecheck # (change requires restart) wd_lifecheck_password = '' # Password for watchdog user in lifecheck # Leaving it empty will make Pgpool-II to first look for the # Password in pool_passwd file before using the empty password # (change requires restart) # - Other pgpool Connection Settings - #other_pgpool_hostname0 = 'host0' # Host name or IP address to connect to for other pgpool 0 # (change requires restart) #other_pgpool_port0 = 5432 # Port number for other pgpool 0 # (change requires restart) #other_wd_port0 = 9000 # Port number for other watchdog 0 # (change requires restart) #other_pgpool_hostname1 = 'host1' #other_pgpool_port1 = 5432 #other_wd_port1 = 9000 #------------------------------------------------------------------------------ # OTHERS #------------------------------------------------------------------------------ relcache_expire = 0 # Life time of relation cache in seconds. # 0 means no cache expiration(the default). # The relation cache is used for cache the # query result against PostgreSQL system # catalog to obtain various information # including table structures or if it's a # temporary table or not. The cache is # maintained in a pgpool child local memory # and being kept as long as it survives. # If someone modify the table by using # ALTER TABLE or some such, the relcache is # not consistent anymore. # For this purpose, cache_expiration # controls the life time of the cache. relcache_size = 256 # Number of relation cache # entry. If you see frequently: # "pool_search_relcache: cache replacement happend" # in the pgpool log, you might want to increate this number. check_temp_table = catalog # Temporary table check method. catalog, trace or none. # Default is catalog. check_unlogged_table = on # If on, enable unlogged table check in SELECT statements. # This initiates queries against system catalog of primary/master # thus increases load of master. # If you are absolutely sure that your system never uses unlogged tables # and you want to save access to primary/master, you could turn this off. # Default is on. enable_shared_relcache = on # If on, relation cache stored in memory cache, # the cache is shared among child process. # Default is on. # (change requires restart) relcache_query_target = master # Target node to send relcache queries. Default is master (primary) node. # If load_balance_node is specified, queries will be sent to load balance node. #------------------------------------------------------------------------------ # IN MEMORY QUERY MEMORY CACHE #------------------------------------------------------------------------------ memory_cache_enabled = off # If on, use the memory cache functionality, off by default # (change requires restart) memqcache_method = 'shmem' # Cache storage method. either 'shmem'(shared memory) or # 'memcached'. 'shmem' by default # (change requires restart) memqcache_memcached_host = 'localhost' # Memcached host name or IP address. Mandatory if # memqcache_method = 'memcached'. # Defaults to localhost. # (change requires restart) memqcache_memcached_port = 11211 # Memcached port number. Mondatory if memqcache_method = 'memcached'. # Defaults to 11211. # (change requires restart) memqcache_total_size = 67108864 # Total memory size in bytes for storing memory cache. # Mandatory if memqcache_method = 'shmem'. # Defaults to 64MB. # (change requires restart) memqcache_max_num_cache = 1000000 # Total number of cache entries. Mandatory # if memqcache_method = 'shmem'. # Each cache entry consumes 48 bytes on shared memory. # Defaults to 1,000,000(45.8MB). # (change requires restart) memqcache_expire = 0 # Memory cache entry life time specified in seconds. # 0 means infinite life time. 0 by default. # (change requires restart) memqcache_auto_cache_invalidation = on # If on, invalidation of query cache is triggered by corresponding # DDL/DML/DCL(and memqcache_expire). If off, it is only triggered # by memqcache_expire. on by default. # (change requires restart) memqcache_maxcache = 409600 # Maximum SELECT result size in bytes. # Must be smaller than memqcache_cache_block_size. Defaults to 400KB. # (change requires restart) memqcache_cache_block_size = 1048576 # Cache block size in bytes. Mandatory if memqcache_method = 'shmem'. # Defaults to 1MB. # (change requires restart) memqcache_oiddir = '/var/log/pgpool/oiddir' # Temporary work directory to record table oids # (change requires restart) white_memqcache_table_list = '' # Comma separated list of table names to memcache # that don't write to database # Regexp are accepted black_memqcache_table_list = '' # Comma separated list of table names not to memcache # that don't write to database # Regexp are accepted pgpool-II-4.1.4/src/sample/pcp.conf.sample0000664000175000017500000000153213730350075015227 00000000000000# PCP Client Authentication Configuration File # ============================================ # # This file contains user ID and his password for pgpool # communication manager authentication. # # Note that users defined here do not need to be PostgreSQL # users. These users are authorized ONLY for pgpool # communication manager. # # File Format # =========== # # List one UserID and password on a single line. They must # be concatenated together using ':' (colon) between them. # No spaces or tabs are allowed anywhere in the line. # # Example: # postgres:e8a48653851e28c69d0506508fb27fc5 # # Be aware that there will be no spaces or tabs at the # beginning of the line! although the above example looks # like so. # # Lines beginning with '#' (pound) are comments and will # be ignored. Again, no spaces or tabs allowed before '#'. # USERID:MD5PASSWD pgpool-II-4.1.4/src/sql/0000775000175000017500000000000013730350746011720 500000000000000pgpool-II-4.1.4/src/sql/pgpool-recovery/0000775000175000017500000000000013730350746015054 500000000000000pgpool-II-4.1.4/src/sql/pgpool-recovery/pgpool-recovery.c0000664000175000017500000002433413730350075020275 00000000000000/* -*-pgsql-c-*- */ /* * $Header$ * * pgpool-recovery: exec online recovery script from SELECT statement. * * Copyright (c) 2003-2019 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 "postgres.h" #include "fmgr.h" #include "miscadmin.h" #include "executor/spi.h" #include "funcapi.h" #include "catalog/namespace.h" #include "catalog/pg_proc.h" #include "utils/syscache.h" #include "utils/builtins.h" /* PostgreSQL 8.4 needs this for textout */ #include "utils/guc.h" #if defined(PG_VERSION_NUM) && (PG_VERSION_NUM >= 90300) #include "access/htup_details.h" /* PostgreSQL 9.3 or later needs this */ #endif #define REMOTE_START_FILE "pgpool_remote_start" #include #ifdef PG_MODULE_MAGIC PG_MODULE_MAGIC; #endif PG_FUNCTION_INFO_V1(pgpool_recovery); PG_FUNCTION_INFO_V1(pgpool_remote_start); PG_FUNCTION_INFO_V1(pgpool_pgctl); PG_FUNCTION_INFO_V1(pgpool_switch_xlog); extern Datum pgpool_recovery(PG_FUNCTION_ARGS); extern Datum pgpool_remote_start(PG_FUNCTION_ARGS); extern Datum pgpool_pgctl(PG_FUNCTION_ARGS); extern Datum pgpool_switch_xlog(PG_FUNCTION_ARGS); static char recovery_script[1024]; static char command_text[1024]; static Oid get_function_oid(const char *funcname, const char *argtype, const char *nspname); char *Log_line_prefix = NULL; Datum pgpool_recovery(PG_FUNCTION_ARGS) { int r; char *script = DatumGetCString(DirectFunctionCall1(textout, PointerGetDatum(PG_GETARG_TEXT_P(0)))); char *remote_host = DatumGetCString(DirectFunctionCall1(textout, PointerGetDatum(PG_GETARG_TEXT_P(1)))); char *remote_data_directory = DatumGetCString(DirectFunctionCall1(textout, PointerGetDatum(PG_GETARG_TEXT_P(2)))); if (!superuser()) #ifdef ERRCODE_INSUFFICIENT_PRIVILEGE ereport(ERROR, (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE), (errmsg("must be superuser to use pgpool_recovery function")))); #else elog(ERROR, "must be superuser to use pgpool_recovery function"); #endif if (PG_NARGS() >= 6) /* Pgpool-II 4.1 or later */ { char *primary_port = DatumGetCString(DirectFunctionCall1(textout, PointerGetDatum(PG_GETARG_TEXT_P(3)))); int remote_node = PG_GETARG_INT32(4); char *remote_port = DatumGetCString(DirectFunctionCall1(textout, PointerGetDatum(PG_GETARG_TEXT_P(5)))); snprintf(recovery_script, sizeof(recovery_script), "\"%s/%s\" \"%s\" \"%s\" \"%s\" \"%s\" %d \"%s\"", DataDir, script, DataDir, remote_host, remote_data_directory, primary_port, remote_node, remote_port); } else if (PG_NARGS() >= 5) /* Pgpool-II 4.0 */ { char *primary_port = DatumGetCString(DirectFunctionCall1(textout, PointerGetDatum(PG_GETARG_TEXT_P(3)))); int remote_node = PG_GETARG_INT32(4); snprintf(recovery_script, sizeof(recovery_script), "\"%s/%s\" \"%s\" \"%s\" \"%s\" \"%s\" %d", DataDir, script, DataDir, remote_host, remote_data_directory, primary_port, remote_node); } else if (PG_NARGS() >= 4) /* Pgpool-II 3.4 - 3.7 */ { char *primary_port = DatumGetCString(DirectFunctionCall1(textout, PointerGetDatum(PG_GETARG_TEXT_P(3)))); snprintf(recovery_script, sizeof(recovery_script), "\"%s/%s\" \"%s\" \"%s\" \"%s\" \"%s\"", DataDir, script, DataDir, remote_host, remote_data_directory, primary_port); } else { snprintf(recovery_script, sizeof(recovery_script), "\"%s/%s\" \"%s\" \"%s\" \"%s\"", DataDir, script, DataDir, remote_host, remote_data_directory); } elog(DEBUG1, "recovery_script: %s", recovery_script); r = system(recovery_script); if (r != 0) { elog(ERROR, "pgpool_recovery failed"); } PG_RETURN_BOOL(true); } Datum pgpool_remote_start(PG_FUNCTION_ARGS) { int r; char *remote_host = DatumGetCString(DirectFunctionCall1(textout, PointerGetDatum(PG_GETARG_TEXT_P(0)))); char *remote_data_directory = DatumGetCString(DirectFunctionCall1(textout, PointerGetDatum(PG_GETARG_TEXT_P(1)))); if (!superuser()) #ifdef ERRCODE_INSUFFICIENT_PRIVILEGE ereport(ERROR, (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE), (errmsg("must be superuser to use pgpool_remote_start function")))); #else elog(ERROR, "must be superuser to use pgpool_remote_start function"); #endif snprintf(recovery_script, sizeof(recovery_script), "%s/%s %s %s", DataDir, REMOTE_START_FILE, remote_host, remote_data_directory); elog(DEBUG1, "recovery_script: %s", recovery_script); r = system(recovery_script); if (r != 0) { elog(ERROR, "pgpool_remote_start failed"); } PG_RETURN_BOOL(true); } Datum pgpool_pgctl(PG_FUNCTION_ARGS) { int r; char *action = DatumGetCString(DirectFunctionCall1(textout, PointerGetDatum(PG_GETARG_TEXT_P(0)))); char *stop_mode = DatumGetCString(DirectFunctionCall1(textout, PointerGetDatum(PG_GETARG_TEXT_P(1)))); char *pg_ctl; char *data_directory; if (!superuser()) #ifdef ERRCODE_INSUFFICIENT_PRIVILEGE ereport(ERROR, (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE), (errmsg("must be superuser to use pgpool_pgctl function")))); #else elog(ERROR, "must be superuser to use pgpool_pgctl function"); #endif #if defined(PG_VERSION_NUM) && (PG_VERSION_NUM >= 90600) pg_ctl = GetConfigOptionByName("pgpool.pg_ctl", NULL, false); data_directory = GetConfigOptionByName("data_directory", NULL, false); #else pg_ctl = GetConfigOptionByName("pgpool.pg_ctl", NULL); data_directory = GetConfigOptionByName("data_directory", NULL); #endif if (strcmp(stop_mode, "") != 0) { snprintf(command_text, sizeof(command_text), "%s %s -D %s -m %s 2>/dev/null 1>/dev/null < /dev/null &", pg_ctl, action, data_directory, stop_mode); } else { snprintf(command_text, sizeof(command_text), "%s %s -D %s 2>/dev/null 1>/dev/null < /dev/null &", pg_ctl, action, data_directory); } elog(DEBUG1, "command_text: %s", command_text); r = system(command_text); if (strcmp(action, "reload") == 0 && r != 0) { elog(ERROR, "pgpool_pgctl failed"); } PG_RETURN_BOOL(true); } /* * pgpool_switch_log is the same as pg_switch_xlog except that * it wait till archiving is completed. * We call xlog functions with the oid to avoid a compile error * at old PostgreSQL. */ Datum pgpool_switch_xlog(PG_FUNCTION_ARGS) { char *archive_dir; char *filename; char path[MAXPGPATH]; struct stat fst; Datum location; text *filename_t; text *result; Oid switch_xlog_oid; Oid xlogfile_name_oid; #if !defined(PG_VERSION_NUM) || (PG_VERSION_NUM < 90400) char *pg_xlogfile_name_arg_type = "text"; #else /* * The argument data type of PG's pg_xlogfile_name() function has been * changed from text to pg_lsn since PostgreSQL 9.4 */ char *pg_xlogfile_name_arg_type = "pg_lsn"; #endif archive_dir = DatumGetCString(DirectFunctionCall1(textout, PointerGetDatum(PG_GETARG_TEXT_P(0)))); if (stat(archive_dir, &fst) < 0) #ifdef ERRCODE_INSUFFICIENT_PRIVILEGE ereport(ERROR, (errcode_for_file_access(), errmsg("could not stat file \"%s\": %m", archive_dir))); #else elog(ERROR, "could not stat file \"%s\"", archive_dir); #endif switch_xlog_oid = get_function_oid("pg_switch_xlog", NULL, "pg_catalog"); xlogfile_name_oid = get_function_oid("pg_xlogfile_name", pg_xlogfile_name_arg_type, "pg_catalog"); if (!switch_xlog_oid || !xlogfile_name_oid) { /* probably PostgreSQL is 10 or greater */ switch_xlog_oid = get_function_oid("pg_switch_wal", NULL, "pg_catalog"); xlogfile_name_oid = get_function_oid("pg_walfile_name", pg_xlogfile_name_arg_type, "pg_catalog"); if (!switch_xlog_oid || !xlogfile_name_oid) elog(ERROR, "cannot find xlog functions"); } location = OidFunctionCall1(switch_xlog_oid, PointerGetDatum(NULL)); filename_t = DatumGetTextP(OidFunctionCall1(xlogfile_name_oid, location)); filename = DatumGetCString(DirectFunctionCall1(textout, PointerGetDatum(filename_t))); snprintf(path, MAXPGPATH, "%s/%s", archive_dir, filename); elog(LOG, "pgpool_switch_xlog: waiting for \"%s\"", path); while (stat(path, &fst) != 0 || fst.st_size == 0 || fst.st_size % (1024 * 1024) != 0) { CHECK_FOR_INTERRUPTS(); sleep(1); } result = DatumGetTextP(DirectFunctionCall1(textin, CStringGetDatum(path))); PG_RETURN_TEXT_P(result); } static Oid get_function_oid(const char *funcname, const char *argtype, const char *nspname) { #ifndef PROCNAMENSP Oid typid; Oid nspid; Oid funcid; Oid oids[1]; oidvector *oid_v; HeapTuple tup; if (argtype) { typid = TypenameGetTypid(argtype); elog(DEBUG1, "get_function_oid: %s typid: %d", argtype, typid); oids[0] = typid; oid_v = buildoidvector(oids, 1); } else { oid_v = buildoidvector(NULL, 0); } #if !defined(PG_VERSION_NUM) || (PG_VERSION_NUM < 90300) nspid = LookupExplicitNamespace(nspname); #else /* * LookupExplicitNamespace() of PostgreSQL 9.3 or later, has third * argument "missing_ok" which suppresses ERROR exception, but returns * invlaid_oid. See include/catalog/namespace.h */ nspid = LookupExplicitNamespace(nspname, false); #endif elog(DEBUG1, "get_function_oid: oid of \"%s\": %d", nspname, nspid); tup = SearchSysCache(PROCNAMEARGSNSP, PointerGetDatum(funcname), PointerGetDatum(oid_v), ObjectIdGetDatum(nspid), 0); if (HeapTupleIsValid(tup)) { #if defined(PG_VERSION_NUM) && (PG_VERSION_NUM >= 120000) Form_pg_proc proctup = (Form_pg_proc) GETSTRUCT(tup); funcid = proctup->oid; #else funcid = HeapTupleGetOid(tup); #endif elog(DEBUG1, "get_function_oid: oid of \"%s\": %d", funcname, funcid); ReleaseSysCache(tup); return funcid; } #endif return 0; } pgpool-II-4.1.4/src/sql/pgpool-recovery/pgpool-recovery.sql.in0000664000175000017500000000235713730350075021260 00000000000000CREATE FUNCTION pgpool_recovery(IN script_name text, IN remote_host text, IN remote_data_directory text, IN primary_port text, IN remote_node integer, IN remote_port text) RETURNS bool AS 'MODULE_PATHNAME', 'pgpool_recovery' LANGUAGE C STRICT; CREATE FUNCTION pgpool_recovery(IN script_name text, IN remote_host text, IN remote_data_directory text, IN primary_port text, IN remote_node integer) RETURNS bool AS 'MODULE_PATHNAME', 'pgpool_recovery' LANGUAGE C STRICT; CREATE FUNCTION pgpool_recovery(IN script_name text, IN remote_host text, IN remote_data_directory text, IN primary_port text) RETURNS bool AS 'MODULE_PATHNAME', 'pgpool_recovery' LANGUAGE C STRICT; CREATE FUNCTION pgpool_recovery(IN script_name text, IN remote_host text, IN remote_data_directory text) RETURNS bool AS 'MODULE_PATHNAME', 'pgpool_recovery' LANGUAGE C STRICT; CREATE FUNCTION pgpool_remote_start(text, text) RETURNS bool AS 'MODULE_PATHNAME', 'pgpool_remote_start' LANGUAGE C STRICT; CREATE FUNCTION pgpool_pgctl(text, text) RETURNS bool AS '$libdir/pgpool-recovery', 'pgpool_pgctl' LANGUAGE C STRICT; CREATE FUNCTION pgpool_switch_xlog(text) RETURNS text AS 'MODULE_PATHNAME', 'pgpool_switch_xlog' LANGUAGE C STRICT; pgpool-II-4.1.4/src/sql/pgpool-recovery/uninstall_pgpool-recovery.sql0000664000175000017500000000021013730350075022726 00000000000000DROP FUNCTION pgpool_switch_xlog(text); DROP FUNCTION pgpool_remote_start(text, text); DROP FUNCTION pgpool_recovery(text, text, text); pgpool-II-4.1.4/src/sql/pgpool-recovery/pgpool_recovery--1.3.sql0000664000175000017500000000271613730350075021310 00000000000000-- complain if script is sourced in psql, rather than via CREATE EXTENSION \echo Use "CREATE EXTENSION pgpool_recovery" to load this file. \quit CREATE FUNCTION pgpool_recovery(IN script_name text, IN remote_host text, IN remote_data_directory text, IN primary_port text, IN remote_node integer, IN remote_port text) RETURNS bool AS 'MODULE_PATHNAME', 'pgpool_recovery' LANGUAGE C STRICT; CREATE FUNCTION pgpool_recovery(IN script_name text, IN remote_host text, IN remote_data_directory text, IN primary_port text, IN remote_node integer) RETURNS bool AS 'MODULE_PATHNAME', 'pgpool_recovery' LANGUAGE C STRICT; CREATE FUNCTION pgpool_recovery(IN script_name text, IN remote_host text, IN remote_data_directory text, IN primary_port text) RETURNS bool AS 'MODULE_PATHNAME', 'pgpool_recovery' LANGUAGE C STRICT; CREATE FUNCTION pgpool_recovery(IN script_name text, IN remote_host text, IN remote_data_directory text) RETURNS bool AS 'MODULE_PATHNAME', 'pgpool_recovery' LANGUAGE C STRICT; CREATE FUNCTION pgpool_remote_start(IN remote_host text, IN remote_data_directory text) RETURNS bool AS 'MODULE_PATHNAME', 'pgpool_remote_start' LANGUAGE C STRICT; CREATE FUNCTION pgpool_pgctl(IN action text, IN stop_mode text) RETURNS bool AS '$libdir/pgpool-recovery', 'pgpool_pgctl' LANGUAGE C STRICT; CREATE FUNCTION pgpool_switch_xlog(IN arcive_dir text) RETURNS text AS 'MODULE_PATHNAME', 'pgpool_switch_xlog' LANGUAGE C STRICT; pgpool-II-4.1.4/src/sql/pgpool-recovery/pgpool_recovery--1.2--1.3.sql0000664000175000017500000000067713730350075021667 00000000000000/* contrib/pgpool_recovery/pgpool_recovery--1.2--1.3.sql */ -- complain if script is sourced in psql, rather than via ALTER EXTENSION \echo Use "ALTER EXTENSION pgpool_recovery UPDATE TO '1.3'" to load this file. \quit create FUNCTION pgpool_recovery(script_name text, remote_host text, remote_data_directory text, primary_port text, remote_node integer, remote_port text) RETURNS bool AS 'MODULE_PATHNAME', 'pgpool_recovery' LANGUAGE C STRICT; pgpool-II-4.1.4/src/sql/pgpool-recovery/pgpool_recovery--1.2.sql0000664000175000017500000000230513730350075021301 00000000000000-- complain if script is sourced in psql, rather than via CREATE EXTENSION \echo Use "CREATE EXTENSION pgpool_recovery" to load this file. \quit CREATE FUNCTION pgpool_recovery(IN script_name text, IN remote_host text, IN remote_data_directory text, IN remote_port text, IN recovery_node integer) RETURNS bool AS 'MODULE_PATHNAME', 'pgpool_recovery' LANGUAGE C STRICT; CREATE FUNCTION pgpool_recovery(IN script_name text, IN remote_host text, IN remote_data_directory text, IN remote_port text) RETURNS bool AS 'MODULE_PATHNAME', 'pgpool_recovery' LANGUAGE C STRICT; CREATE FUNCTION pgpool_recovery(IN script_name text, IN remote_host text, IN remote_data_directory text) RETURNS bool AS 'MODULE_PATHNAME', 'pgpool_recovery' LANGUAGE C STRICT; CREATE FUNCTION pgpool_remote_start(IN remote_host text, IN remote_data_directory text) RETURNS bool AS 'MODULE_PATHNAME', 'pgpool_remote_start' LANGUAGE C STRICT; CREATE FUNCTION pgpool_pgctl(IN action text, IN stop_mode text) RETURNS bool AS '$libdir/pgpool-recovery', 'pgpool_pgctl' LANGUAGE C STRICT; CREATE FUNCTION pgpool_switch_xlog(IN arcive_dir text) RETURNS text AS 'MODULE_PATHNAME', 'pgpool_switch_xlog' LANGUAGE C STRICT; pgpool-II-4.1.4/src/sql/pgpool-recovery/pgpool_recovery--1.1--1.2.sql0000664000175000017500000000065513730350075021661 00000000000000/* contrib/pgpool_recovery/pgpool_recovery--1.1--1.2.sql */ -- complain if script is sourced in psql, rather than via ALTER EXTENSION \echo Use "ALTER EXTENSION pgpool_recovery UPDATE TO '1.2'" to load this file. \quit create FUNCTION pgpool_recovery(script_name text, remote_host text, remote_data_directory text, primary_port text, remote_node integer) RETURNS bool AS 'MODULE_PATHNAME', 'pgpool_recovery' LANGUAGE C STRICT; pgpool-II-4.1.4/src/sql/pgpool-recovery/pgpool_recovery--1.1.sql0000664000175000017500000000172413730350075021304 00000000000000-- complain if script is sourced in psql, rather than via CREATE EXTENSION \echo Use "CREATE EXTENSION pgpool_recovery" to load this file. \quit CREATE FUNCTION pgpool_recovery(IN script_name text, IN remote_host text, IN remote_data_directory text, IN remote_port text) RETURNS bool AS 'MODULE_PATHNAME', 'pgpool_recovery' LANGUAGE C STRICT; CREATE FUNCTION pgpool_recovery(IN script_name text, IN remote_host text, IN remote_data_directory text) RETURNS bool AS 'MODULE_PATHNAME', 'pgpool_recovery' LANGUAGE C STRICT; CREATE FUNCTION pgpool_remote_start(IN remote_host text, IN remote_data_directory text) RETURNS bool AS 'MODULE_PATHNAME', 'pgpool_remote_start' LANGUAGE C STRICT; CREATE FUNCTION pgpool_pgctl(IN action text, IN stop_mode text) RETURNS bool AS '$libdir/pgpool-recovery', 'pgpool_pgctl' LANGUAGE C STRICT; CREATE FUNCTION pgpool_switch_xlog(IN arcive_dir text) RETURNS text AS 'MODULE_PATHNAME', 'pgpool_switch_xlog' LANGUAGE C STRICT; pgpool-II-4.1.4/src/sql/pgpool-recovery/pgpool_recovery.control0000664000175000017500000000026213730350075021607 00000000000000# pgpool-recovery extension comment = 'recovery functions for pgpool-II for V4.1 or later' default_version = '1.3' module_pathname = '$libdir/pgpool-recovery' relocatable = true pgpool-II-4.1.4/src/sql/pgpool-recovery/Makefile0000664000175000017500000000142613730350075016432 00000000000000MODULES = pgpool-recovery DATA_built = pgpool-recovery.sql DATA = uninstall_pgpool-recovery.sql EXTENSION = pgpool_recovery DATA = pgpool_recovery--1.1.sql pgpool_recovery--1.2.sql pgpool_recovery--1.1--1.2.sql pgpool_recovery--1.3.sql pgpool_recovery--1.2--1.3.sql # if you are using PostgreSQL 8.0 or later, # using pg_config is recommended. # if you are not, comment out following line and... USE_PGXS = true # set top_builddir to the PostgreSQL build source tree top. # (for example /usr/local/src/postgresql-8.4) top_builddir = ../.. ifdef USE_PGXS PG_CONFIG ?= pg_config PGXS = $(shell $(PG_CONFIG) --pgxs) include $(PGXS) else subdir = contrib/pgpool-recovery #top_builddir = ../.. include $(top_builddir)/src/Makefile.global include $(top_srcdir)/contrib/contrib-global.mk endif pgpool-II-4.1.4/src/sql/pgpool-regclass/0000775000175000017500000000000013730350746015021 500000000000000pgpool-II-4.1.4/src/sql/pgpool-regclass/pgpool-regclass.c0000664000175000017500000001203213730350075020177 00000000000000/* -*-pgsql-c-*- */ /* * $Header$ * * Copyright (c) 2003-2012 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. * * pgpool-regclass.c is similar to PostgreSQL builtin function * reglcass but does not throw exceptions. * If something goes wrong, it returns InvalidOid. */ #include #include #include #include "postgres.h" #include "utils/builtins.h" #include "utils/syscache.h" #include "utils/elog.h" #include "catalog/namespace.h" #include "nodes/makefuncs.h" #include "commands/dbcommands.h" #include "fmgr.h" #include "funcapi.h" #include #ifdef PG_MODULE_MAGIC PG_MODULE_MAGIC; #endif PG_FUNCTION_INFO_V1(pgpool_regclass); extern Datum pgpool_regclass(PG_FUNCTION_ARGS); static List *MystringToQualifiedNameList(const char *string); static RangeVar *MymakeRangeVarFromNameList(List *names); extern Oid MyDatabaseId; #if !defined(PG_VERSION_NUM) || (PG_VERSION_NUM < 90100) static Oid get_namespace_oid(const char *nspname, bool missing_ok); #endif Datum pgpool_regclass(PG_FUNCTION_ARGS) { char *pro_name_or_oid = PG_GETARG_CSTRING(0); Oid result; List *names; RangeVar *rel; names = MystringToQualifiedNameList(pro_name_or_oid); if (names == NIL) PG_RETURN_OID(InvalidOid); rel = MymakeRangeVarFromNameList(names); if (rel == NULL) PG_RETURN_OID(InvalidOid); /* * Check to see if cross-database reference is used. This is to be done in * RangeVarGetRelid(). The reason we do this here is, to avoid raising an * error in RangeVarGetRelid(). */ if (rel->catalogname) { if (strcmp(rel->catalogname, get_database_name(MyDatabaseId)) != 0) PG_RETURN_OID(InvalidOid); } /* * Check to see if schema exists. This is to be done in * RangeVarGetRelid(). The reason we do this here is, to avoid raising an * error in RangeVarGetRelid(). */ if (rel->schemaname) { if (get_namespace_oid(rel->schemaname, true) == InvalidOid) PG_RETURN_OID(InvalidOid); } #if !defined(PG_VERSION_NUM) || (PG_VERSION_NUM < 90200) result = RangeVarGetRelid(rel, true); #else /* * RangeVarGetRelid() of PostgreSQL 9.2 or later, has third argument * "missing_ok" which suppresses ERROR exception, but returns invlaid_oid. * See include/catalog/namespace.h */ result = RangeVarGetRelid(rel, true, true); #endif PG_RETURN_OID(result); } /* * Given a C string, parse it into a qualified-name list. * Stolen from PostgreSQL, removing elog calls. */ static List * MystringToQualifiedNameList(const char *string) { char *rawname; List *result = NIL; List *namelist; ListCell *l; /* We need a modifiable copy of the input string. */ rawname = pstrdup(string); if (!SplitIdentifierString(rawname, '.', &namelist)) return NIL; if (namelist == NIL) return NIL; foreach(l, namelist) { char *curname = (char *) lfirst(l); result = lappend(result, makeString(pstrdup(curname))); } pfree(rawname); list_free(namelist); return result; } /* * makeRangeVarFromNameList * Utility routine to convert a qualified-name list into RangeVar form. * Stolen from PostgreSQL, removing ereport calls. */ static RangeVar * MymakeRangeVarFromNameList(List *names) { /* * Number of arguments of makeRangeVar() has been increased in 8.4 or * later. */ #if PG_VERSION_NUM >= 80400 RangeVar *rel = makeRangeVar(NULL, NULL, -1); #else RangeVar *rel = makeRangeVar(NULL, NULL); #endif switch (list_length(names)) { case 1: rel->relname = strVal(linitial(names)); break; case 2: rel->schemaname = strVal(linitial(names)); rel->relname = strVal(lsecond(names)); break; case 3: rel->catalogname = strVal(linitial(names)); rel->schemaname = strVal(lsecond(names)); rel->relname = strVal(lthird(names)); break; default: rel = NULL; break; } return rel; } #if !defined(PG_VERSION_NUM) || (PG_VERSION_NUM < 90100) /* * get_namespace_oid - given a namespace name, look up the OID * * If missing_ok is false, throw an error if namespace name not found. If * true, just return InvalidOid. * * This function was stolen from PostgreSQL 9.0 and modified to not * use GetSysCacheOid1. Since it is new in 9.0. */ static Oid get_namespace_oid(const char *nspname, bool missing_ok) { Oid oid; oid = GetSysCacheOid(NAMESPACENAME, CStringGetDatum(nspname), 0, 0, 0); if (!OidIsValid(oid) && !missing_ok) ereport(ERROR, (errcode(ERRCODE_UNDEFINED_SCHEMA), errmsg("schema \"%s\" does not exist", nspname))); return oid; } #endif pgpool-II-4.1.4/src/sql/pgpool-regclass/pgpool-regclass.sql.in0000664000175000017500000000017313730350075021164 00000000000000CREATE FUNCTION pg_catalog.pgpool_regclass(cstring) RETURNS oid AS 'MODULE_PATHNAME', 'pgpool_regclass' LANGUAGE C STRICT; pgpool-II-4.1.4/src/sql/pgpool-regclass/uninstall_pgpool-regclass.sql0000664000175000017500000000005013730350075022642 00000000000000DROP FUNCTION pgpool_regclass(cstring); pgpool-II-4.1.4/src/sql/pgpool-regclass/pgpool_regclass--1.0.sql0000664000175000017500000000043313730350075021211 00000000000000-- complain if script is sourced in psql, rather than via CREATE EXTENSION \echo Use "CREATE EXTENSION pgpool_regclass" to load this file. \quit CREATE FUNCTION pg_catalog.pgpool_regclass(IN expression cstring) RETURNS oid AS 'MODULE_PATHNAME', 'pgpool_regclass' LANGUAGE C STRICT; pgpool-II-4.1.4/src/sql/pgpool-regclass/pgpool_regclass.control0000664000175000017500000000023013730350075021514 00000000000000# pgpool-regclass extension comment = 'replacement for regclass' default_version = '1.0' module_pathname = '$libdir/pgpool-regclass' relocatable = true pgpool-II-4.1.4/src/sql/pgpool-regclass/Makefile0000664000175000017500000000125013730350075016372 00000000000000MODULES = pgpool-regclass DATA_built = pgpool-regclass.sql DATA = uninstall_pgpool-regclass.sql EXTENSION = pgpool_regclass DATA = pgpool_regclass--1.0.sql # if you are using PostgreSQL 8.0 or later, # using pg_config is recommended. # if you are not, comment out following line and... USE_PGXS = true # set top_builddir to the PostgreSQL build source tree top. # (for example /usr/local/src/postgresql-8.4) top_builddir = ../.. ifdef USE_PGXS PG_CONFIG ?= pg_config PGXS = $(shell $(PG_CONFIG) --pgxs) include $(PGXS) else subdir = contrib/pgpool-regclass #top_builddir = ../.. include $(top_builddir)/src/Makefile.global include $(top_srcdir)/contrib/contrib-global.mk endif pgpool-II-4.1.4/src/sql/pgpool_adm/0000775000175000017500000000000013730350746014041 500000000000000pgpool-II-4.1.4/src/sql/pgpool_adm/pgpool_adm.c0000664000175000017500000003660613730350127016252 00000000000000/*------------------------------------------------------------------------- * * pgpool_adm.c * * * Copyright (c) 2002-2019, PostgreSQL Global Development Group * * Author: Jehan-Guillaume (ioguix) de Rorthais * * IDENTIFICATION * contrib/pgpool_adm/pgpool_adm.c * *------------------------------------------------------------------------- */ #include "postgres.h" #include "miscadmin.h" #include "utils/builtins.h" #include "foreign/foreign.h" #include "nodes/pg_list.h" #include "utils/timestamp.h" /* * PostgreSQL 9.3 or later requires htup_details.h to get the definition of * heap_form_tuple */ #if defined(PG_VERSION_NUM) && (PG_VERSION_NUM >= 90300) #include "access/htup_details.h" #endif #include #include #include "catalog/pg_type.h" #include "funcapi.h" #include "libpcp_ext.h" #include "pgpool_adm.h" static PCPConnInfo * connect_to_server(char *host, int port, char *user, char *pass); static PCPConnInfo * connect_to_server_from_foreign_server(char *name); /** * Wrapper around pcp_connect * pcp_conninfo: pcpConninfo structure having pcp connection properties */ static PCPConnInfo * connect_to_server(char *host, int port, char *user, char *pass) { PCPConnInfo *pcpConnInfo; pcpConnInfo = pcp_connect(host, port, user, pass, NULL); if (PCPConnectionStatus(pcpConnInfo) != PCP_CONNECTION_OK) ereport(ERROR, (errcode(ERRCODE_CONNECTION_FAILURE), errmsg("connection to PCP server failed."), errdetail("%s\n", pcp_get_last_error(pcpConnInfo) ? pcp_get_last_error(pcpConnInfo) : "unknown reason"))); return pcpConnInfo; } /** * Returns a pcpConninfo structure filled from a foreign server * name: the name of the foreign server */ static PCPConnInfo * connect_to_server_from_foreign_server(char *name) { Oid userid = GetUserId(); char *user = NULL; char *host = NULL; int port = 9898; char *pass = NULL; /* raise an error if given foreign server doesn't exists */ ForeignServer *foreign_server = GetForeignServerByName(name, false); UserMapping *user_mapping; ListCell *cell; /* * raise an error if the current user isn't mapped with the given foreign * server */ user_mapping = GetUserMapping(userid, foreign_server->serverid); foreach(cell, foreign_server->options) { DefElem *def = lfirst(cell); if (strcmp(def->defname, "host") == 0) { host = pstrdup(strVal(def->arg)); } else if (strcmp(def->defname, "port") == 0) { port = atoi(strVal(def->arg)); } } foreach(cell, user_mapping->options) { DefElem *def = lfirst(cell); if (strcmp(def->defname, "user") == 0) { user = pstrdup(strVal(def->arg)); } else if (strcmp(def->defname, "password") == 0) { pass = pstrdup(strVal(def->arg)); } } return connect_to_server(host, port, user, pass); } /** * nodeID: the node id to get info from * host_or_srv: server name or ip address of the pgpool server * port: pcp port number * user: user to connect with * pass: password **/ Datum _pcp_node_info(PG_FUNCTION_ARGS) { int16 nodeID = PG_GETARG_INT16(0); char *host_or_srv = text_to_cstring(PG_GETARG_TEXT_PP(1)); PCPConnInfo *pcpConnInfo; PCPResultInfo *pcpResInfo; BackendInfo *backend_info = NULL; Datum values[9]; /* values to build the returned tuple from */ bool nulls[] = {false, false, false, false, false, false, false, false, false}; TupleDesc tupledesc; HeapTuple tuple; struct tm tm; char datebuf[20]; if (nodeID < 0 || nodeID >= MAX_NUM_BACKENDS) ereport(ERROR, (errcode(ERRCODE_INVALID_PARAMETER_VALUE), errmsg("NodeID is out of range."))); if (PG_NARGS() == 5) { char *user, *pass; int port; port = PG_GETARG_INT16(2); user = text_to_cstring(PG_GETARG_TEXT_PP(3)); pass = text_to_cstring(PG_GETARG_TEXT_PP(4)); pcpConnInfo = connect_to_server(host_or_srv, port, user, pass); } else if (PG_NARGS() == 2) { pcpConnInfo = connect_to_server_from_foreign_server(host_or_srv); } else { ereport(ERROR, (errcode(ERRCODE_INTERNAL_ERROR), errmsg("Wrong number of argument."))); } pcpResInfo = pcp_node_info(pcpConnInfo, nodeID); if (pcpResInfo == NULL || PCPResultStatus(pcpResInfo) != PCP_RES_COMMAND_OK) { char *error = pcp_get_last_error(pcpConnInfo) ? pstrdup(pcp_get_last_error(pcpConnInfo)) : NULL; pcp_disconnect(pcpConnInfo); pcp_free_connection(pcpConnInfo); ereport(ERROR, (errcode(ERRCODE_INTERNAL_ERROR), errmsg("failed to get node information"), errdetail("%s\n", error ? error : "unknown reason"))); } /** * Construct a tuple descriptor for the result rows. **/ #if defined(PG_VERSION_NUM) && (PG_VERSION_NUM >= 120000) tupledesc = CreateTemplateTupleDesc(9); #else tupledesc = CreateTemplateTupleDesc(9, false); #endif TupleDescInitEntry(tupledesc, (AttrNumber) 1, "hostname", TEXTOID, -1, 0); TupleDescInitEntry(tupledesc, (AttrNumber) 2, "port", INT4OID, -1, 0); TupleDescInitEntry(tupledesc, (AttrNumber) 3, "status", TEXTOID, -1, 0); TupleDescInitEntry(tupledesc, (AttrNumber) 4, "weight", FLOAT4OID, -1, 0); TupleDescInitEntry(tupledesc, (AttrNumber) 5, "role", TEXTOID, -1, 0); TupleDescInitEntry(tupledesc, (AttrNumber) 6, "replication_delay", INT8OID, -1, 0); TupleDescInitEntry(tupledesc, (AttrNumber) 7, "replcation_state", TEXTOID, -1, 0); TupleDescInitEntry(tupledesc, (AttrNumber) 8, "replcation_sync_state", TEXTOID, -1, 0); TupleDescInitEntry(tupledesc, (AttrNumber) 9, "last_status_change", TIMESTAMPOID, -1, 0); tupledesc = BlessTupleDesc(tupledesc); backend_info = (BackendInfo *) pcp_get_binary_data(pcpResInfo, 0); /* set values */ values[0] = CStringGetTextDatum(backend_info->backend_hostname); nulls[0] = false; values[1] = Int16GetDatum(backend_info->backend_port); nulls[1] = false; switch (backend_info->backend_status) { case CON_UNUSED: values[2] = CStringGetTextDatum("Connection unused"); break; case CON_CONNECT_WAIT: values[2] = CStringGetTextDatum("Waiting for connection to start"); break; case CON_UP: values[2] = CStringGetTextDatum("Connection in use"); break; case CON_DOWN: values[2] = CStringGetTextDatum("Disconnected"); break; } nulls[2] = false; values[3] = Float8GetDatum(backend_info->backend_weight / RAND_MAX); nulls[3] = false; nulls[4] = false; values[4] = backend_info->role == ROLE_PRIMARY ? CStringGetTextDatum("Primary") : CStringGetTextDatum("Standby"); nulls[5] = false; values[5] = Int64GetDatum(backend_info->standby_delay); nulls[6] = false; values[6] = CStringGetTextDatum(backend_info->replication_state); nulls[7] = false; values[7] = CStringGetTextDatum(backend_info->replication_sync_state); nulls[8] = false; localtime_r(&backend_info->status_changed_time, &tm); strftime(datebuf, sizeof(datebuf), "%F %T", &tm); values[8] = DatumGetTimestamp(DirectFunctionCall3(timestamp_in, CStringGetDatum(datebuf), ObjectIdGetDatum(InvalidOid), Int32GetDatum(-1))); pcp_disconnect(pcpConnInfo); pcp_free_connection(pcpConnInfo); /* build and return the tuple */ tuple = heap_form_tuple(tupledesc, values, nulls); ReleaseTupleDesc(tupledesc); PG_RETURN_DATUM(HeapTupleGetDatum(tuple)); } /** * host_or_srv: server name or ip address of the pgpool server * port: pcp port number * user: user to connect with * pass: password **/ Datum _pcp_pool_status(PG_FUNCTION_ARGS) { MemoryContext oldcontext; FuncCallContext *funcctx; int32 nrows; int32 call_cntr; int32 max_calls; AttInMetadata *attinmeta; PCPConnInfo *pcpConnInfo; PCPResultInfo *pcpResInfo; /* stuff done only on the first call of the function */ if (SRF_IS_FIRSTCALL()) { TupleDesc tupdesc; char *host_or_srv = text_to_cstring(PG_GETARG_TEXT_PP(0)); /* create a function context for cross-call persistence */ funcctx = SRF_FIRSTCALL_INIT(); /* switch to memory context appropriate for multiple function calls */ oldcontext = MemoryContextSwitchTo(funcctx->multi_call_memory_ctx); if (PG_NARGS() == 4) { char *user, *pass; int port; port = PG_GETARG_INT16(1); user = text_to_cstring(PG_GETARG_TEXT_PP(2)); pass = text_to_cstring(PG_GETARG_TEXT_PP(3)); pcpConnInfo = connect_to_server(host_or_srv, port, user, pass); } else if (PG_NARGS() == 1) { pcpConnInfo = connect_to_server_from_foreign_server(host_or_srv); } else { MemoryContextSwitchTo(oldcontext); ereport(ERROR, (errcode(ERRCODE_INTERNAL_ERROR), errmsg("Wrong number of argument."))); } pcpResInfo = pcp_pool_status(pcpConnInfo); if (pcpResInfo == NULL || PCPResultStatus(pcpResInfo) != PCP_RES_COMMAND_OK) { char *error = pcp_get_last_error(pcpConnInfo) ? pstrdup(pcp_get_last_error(pcpConnInfo)) : NULL; pcp_disconnect(pcpConnInfo); pcp_free_connection(pcpConnInfo); MemoryContextSwitchTo(oldcontext); ereport(ERROR, (errcode(ERRCODE_INTERNAL_ERROR), errmsg("failed to get pool status"), errdetail("%s\n", error ? error : "unknown reason"))); } nrows = pcp_result_slot_count(pcpResInfo); pcp_disconnect(pcpConnInfo); /* Construct a tuple descriptor for the result rows */ #if defined(PG_VERSION_NUM) && (PG_VERSION_NUM >= 120000) tupdesc = CreateTemplateTupleDesc(3); #else tupdesc = CreateTemplateTupleDesc(3, false); #endif TupleDescInitEntry(tupdesc, (AttrNumber) 1, "item", TEXTOID, -1, 0); TupleDescInitEntry(tupdesc, (AttrNumber) 2, "value", TEXTOID, -1, 0); TupleDescInitEntry(tupdesc, (AttrNumber) 3, "description", TEXTOID, -1, 0); /* * Generate attribute metadata needed later to produce tuples from raw * C strings */ attinmeta = TupleDescGetAttInMetadata(tupdesc); funcctx->attinmeta = attinmeta; if (nrows > 0) { funcctx->max_calls = nrows; /* got results, keep track of them */ funcctx->user_fctx = pcpConnInfo; } else { /* fast track when no results */ MemoryContextSwitchTo(oldcontext); SRF_RETURN_DONE(funcctx); } MemoryContextSwitchTo(oldcontext); } /* stuff done on every call of the function */ funcctx = SRF_PERCALL_SETUP(); /* initialize per-call variables */ call_cntr = funcctx->call_cntr; max_calls = funcctx->max_calls; pcpConnInfo = (PCPConnInfo *) funcctx->user_fctx; pcpResInfo = (PCPResultInfo *) pcpConnInfo->pcpResInfo; attinmeta = funcctx->attinmeta; if (call_cntr < max_calls) /* executed while there is more left to send */ { char *values[3]; HeapTuple tuple; Datum result; POOL_REPORT_CONFIG *status = (POOL_REPORT_CONFIG *) pcp_get_binary_data(pcpResInfo, call_cntr); values[0] = pstrdup(status->name); values[1] = pstrdup(status->value); values[2] = pstrdup(status->desc); /* build the tuple */ tuple = BuildTupleFromCStrings(attinmeta, values); /* make the tuple into a datum */ result = HeapTupleGetDatum(tuple); SRF_RETURN_NEXT(funcctx, result); } else { /* do when there is no more left */ pcp_free_connection(pcpConnInfo); SRF_RETURN_DONE(funcctx); } } /** * nodeID: the node id to get info from * host_or_srv: server name or ip address of the pgpool server * port: pcp port number * user: user to connect with * pass: password **/ Datum _pcp_node_count(PG_FUNCTION_ARGS) { char *host_or_srv = text_to_cstring(PG_GETARG_TEXT_PP(0)); int16 node_count = 0; PCPConnInfo *pcpConnInfo; PCPResultInfo *pcpResInfo; if (PG_NARGS() == 4) { char *user, *pass; int port; port = PG_GETARG_INT16(1); user = text_to_cstring(PG_GETARG_TEXT_PP(2)); pass = text_to_cstring(PG_GETARG_TEXT_PP(3)); pcpConnInfo = connect_to_server(host_or_srv, port, user, pass); } else if (PG_NARGS() == 1) { pcpConnInfo = connect_to_server_from_foreign_server(host_or_srv); } else { ereport(ERROR, (errcode(ERRCODE_INTERNAL_ERROR), errmsg("Wrong number of argument."))); } pcpResInfo = pcp_node_count(pcpConnInfo); if (pcpResInfo == NULL || PCPResultStatus(pcpResInfo) != PCP_RES_COMMAND_OK) { char *error = pcp_get_last_error(pcpConnInfo) ? pstrdup(pcp_get_last_error(pcpConnInfo)) : NULL; pcp_disconnect(pcpConnInfo); pcp_free_connection(pcpConnInfo); ereport(ERROR, (errcode(ERRCODE_INTERNAL_ERROR), errmsg("failed to get node count"), errdetail("%s\n", error ? error : "unknown reason"))); } node_count = pcp_get_int_data(pcpResInfo, 0); pcp_disconnect(pcpConnInfo); pcp_free_connection(pcpConnInfo); PG_RETURN_INT16(node_count); } /** * nodeID: the node id to get info from * host_or_srv: server name or ip address of the pgpool server * port: pcp port number * user: user to connect with * pass: password **/ Datum _pcp_attach_node(PG_FUNCTION_ARGS) { int16 nodeID = PG_GETARG_INT16(0); char *host_or_srv = text_to_cstring(PG_GETARG_TEXT_PP(1)); PCPConnInfo *pcpConnInfo; PCPResultInfo *pcpResInfo; if (nodeID < 0 || nodeID >= MAX_NUM_BACKENDS) ereport(ERROR, (errcode(ERRCODE_INVALID_PARAMETER_VALUE), errmsg("NodeID is out of range."))); if (PG_NARGS() == 5) { char *user, *pass; int port; port = PG_GETARG_INT16(2); user = text_to_cstring(PG_GETARG_TEXT_PP(3)); pass = text_to_cstring(PG_GETARG_TEXT_PP(4)); pcpConnInfo = connect_to_server(host_or_srv, port, user, pass); } else if (PG_NARGS() == 2) { pcpConnInfo = connect_to_server_from_foreign_server(host_or_srv); } else { ereport(ERROR, (errcode(ERRCODE_INTERNAL_ERROR), errmsg("Wrong number of argument."))); } pcpResInfo = pcp_attach_node(pcpConnInfo, nodeID); if (pcpResInfo == NULL || PCPResultStatus(pcpResInfo) != PCP_RES_COMMAND_OK) { char *error = pcp_get_last_error(pcpConnInfo) ? pstrdup(pcp_get_last_error(pcpConnInfo)) : NULL; pcp_disconnect(pcpConnInfo); pcp_free_connection(pcpConnInfo); ereport(ERROR, (errcode(ERRCODE_INTERNAL_ERROR), errmsg("failed to attach node"), errdetail("%s\n", error ? error : "unknown reason"))); } pcp_disconnect(pcpConnInfo); pcp_free_connection(pcpConnInfo); PG_RETURN_BOOL(true); } /** * nodeID: the node id to get info from * gracefully: detach node gracefully if true * host_or_srv: server name or ip address of the pgpool server * port: pcp port number * user: user to connect with * pass: password **/ Datum _pcp_detach_node(PG_FUNCTION_ARGS) { int16 nodeID = PG_GETARG_INT16(0); bool gracefully = PG_GETARG_BOOL(1); char *host_or_srv = text_to_cstring(PG_GETARG_TEXT_PP(2)); PCPConnInfo *pcpConnInfo; PCPResultInfo *pcpResInfo; if (nodeID < 0 || nodeID >= MAX_NUM_BACKENDS) ereport(ERROR, (errcode(ERRCODE_INVALID_PARAMETER_VALUE), errmsg("NodeID is out of range."))); if (PG_NARGS() == 6) { char *user, *pass; int port; port = PG_GETARG_INT16(3); user = text_to_cstring(PG_GETARG_TEXT_PP(4)); pass = text_to_cstring(PG_GETARG_TEXT_PP(5)); pcpConnInfo = connect_to_server(host_or_srv, port, user, pass); } else if (PG_NARGS() == 3) { pcpConnInfo = connect_to_server_from_foreign_server(host_or_srv); } else { ereport(ERROR, (errcode(ERRCODE_INTERNAL_ERROR), errmsg("Wrong number of argument."))); } if (gracefully) { pcpResInfo = pcp_detach_node_gracefully(pcpConnInfo, nodeID); } else { pcpResInfo = pcp_detach_node(pcpConnInfo, nodeID); } if (pcpResInfo == NULL || PCPResultStatus(pcpResInfo) != PCP_RES_COMMAND_OK) { char *error = pcp_get_last_error(pcpConnInfo) ? pstrdup(pcp_get_last_error(pcpConnInfo)) : NULL; pcp_disconnect(pcpConnInfo); pcp_free_connection(pcpConnInfo); ereport(ERROR, (errcode(ERRCODE_INTERNAL_ERROR), errmsg("failed to detach node"), errdetail("%s\n", error ? error : "unknown reason"))); } pcp_disconnect(pcpConnInfo); pcp_free_connection(pcpConnInfo); PG_RETURN_BOOL(true); } pgpool-II-4.1.4/src/sql/pgpool_adm/pgpool_adm.h0000664000175000017500000000152313730350127016245 00000000000000/*------------------------------------------------------------------------- * * pgpool_adm.h * * * Copyright (c) 2002-2018, PostgreSQL Global Development Group * * Author: Jehan-Guillaume (ioguix) de Rorthais * * IDENTIFICATION * contrib/pgpool_adm/pgpool_adm.h * *------------------------------------------------------------------------- */ #ifndef PGPOOL_ADM_H #define PGPOOL_ADM_H PG_MODULE_MAGIC; Datum _pcp_node_info(PG_FUNCTION_ARGS); Datum _pcp_pool_status(PG_FUNCTION_ARGS); Datum _pcp_node_count(PG_FUNCTION_ARGS); Datum _pcp_attach_node(PG_FUNCTION_ARGS); Datum _pcp_detach_node(PG_FUNCTION_ARGS); PG_FUNCTION_INFO_V1(_pcp_node_info); PG_FUNCTION_INFO_V1(_pcp_pool_status); PG_FUNCTION_INFO_V1(_pcp_node_count); PG_FUNCTION_INFO_V1(_pcp_attach_node); PG_FUNCTION_INFO_V1(_pcp_detach_node); #endif pgpool-II-4.1.4/src/sql/pgpool_adm/pgpool_adm.control0000664000175000017500000000022213730350127017471 00000000000000# pcp extension comment = 'Administrative functions for pgPool' default_version = '1.2' module_pathname = '$libdir/pgpool_adm' relocatable = true pgpool-II-4.1.4/src/sql/pgpool_adm/pgpool_adm--1.1.sql0000664000175000017500000000513513730350075017174 00000000000000/* contrib/pgpool_adm/pgpool_adm--1.1.sql */ /* *********************************************** * Administrative functions for pgPool * *********************************************** */ /** * input parameters: node_id, host, port, username, password */ CREATE FUNCTION pcp_node_info(integer, text, integer, text, text, OUT host text, OUT port integer, OUT status text, OUT weight float4, OUT role text, OUT replication_delay bigint, OUT last_status_change timestamp) RETURNS record AS 'MODULE_PATHNAME', '_pcp_node_info' LANGUAGE C VOLATILE STRICT; /** * input parameters: node_id, server_name */ CREATE FUNCTION pcp_node_info(integer, text, OUT host text, OUT port integer, OUT status text, OUT weight float4) RETURNS record AS 'MODULE_PATHNAME', '_pcp_node_info' LANGUAGE C VOLATILE STRICT; /** * input parameters: host, port, username, password */ CREATE FUNCTION pcp_pool_status(text, integer, text, text, OUT item text, OUT value text, OUT description text) RETURNS record AS 'MODULE_PATHNAME', '_pcp_pool_status' LANGUAGE C VOLATILE STRICT; /** * input parameters: server_name */ CREATE FUNCTION pcp_pool_status(text, OUT item text, OUT value text, OUT description text) RETURNS record AS 'MODULE_PATHNAME', '_pcp_pool_status' LANGUAGE C VOLATILE STRICT; /** * input parameters: host, port, username, password */ CREATE FUNCTION pcp_node_count(text, integer, text, text, OUT node_count integer) RETURNS integer AS 'MODULE_PATHNAME', '_pcp_node_count' LANGUAGE C VOLATILE STRICT; /** * input parameters: server_name */ CREATE FUNCTION pcp_node_count(text, OUT node_count integer) RETURNS integer AS 'MODULE_PATHNAME', '_pcp_node_count' LANGUAGE C VOLATILE STRICT; /** * input parameters: node_id, host, port, username, password */ CREATE FUNCTION pcp_attach_node(integer, text, integer, text, text, OUT node_attached boolean) RETURNS boolean AS 'MODULE_PATHNAME', '_pcp_attach_node' LANGUAGE C VOLATILE STRICT; /** * input parameters: node_id, server_name */ CREATE FUNCTION pcp_attach_node(integer, text, OUT node_attached boolean) RETURNS boolean AS 'MODULE_PATHNAME', '_pcp_attach_node' LANGUAGE C VOLATILE STRICT; /** * input parameters: node_id, gracefully, host, port, username, password */ CREATE FUNCTION pcp_detach_node(integer, boolean, text, integer, text, text, OUT node_detached boolean) RETURNS boolean AS 'MODULE_PATHNAME', '_pcp_detach_node' LANGUAGE C VOLATILE STRICT; /** * input parameters: node_id, gracefully, server_name */ CREATE FUNCTION pcp_detach_node(integer, boolean, text, OUT node_detached boolean) RETURNS boolean AS 'MODULE_PATHNAME', '_pcp_detach_node' LANGUAGE C VOLATILE STRICT; pgpool-II-4.1.4/src/sql/pgpool_adm/pgpool_adm--1.0--1.1.sql0000664000175000017500000000143613730350075017545 00000000000000/* contrib/pgpool_adm/pgpool_adm--1.0--1.1.sql */ -- complain if script is sourced in psql, rather than via ALTER EXTENSION \echo Use "ALTER EXTENSION pgpool_adm UPDATE TO '1.1'" to load this file. \quit ALTER EXTENSION pgpool_adm DROP FUNCTION pcp_node_info(integer, text, integer, text, text, OUT host text, OUT port integer, OUT status text, OUT weight float4); DROP FUNCTION pcp_node_info(integer, text, integer, text, text, OUT host text, OUT port integer, OUT status text, OUT weight float4); CREATE FUNCTION pcp_node_info(integer, text, integer, text, text, OUT host text, OUT port integer, OUT status text, OUT weight float4, OUT role text, OUT replication_delay bigint, OUT last_status_change timestamp) RETURNS record AS 'MODULE_PATHNAME', '_pcp_node_info' LANGUAGE C VOLATILE STRICT; pgpool-II-4.1.4/src/sql/pgpool_adm/pgpool_adm--1.0.sql0000664000175000017500000000501613730350075017171 00000000000000/* contrib/pgpool_adm/pgpool_adm--1.0.sql */ /* *********************************************** * Administrative functions for pgPool * *********************************************** */ /** * input parameters: node_id, host, port, username, password */ CREATE FUNCTION pcp_node_info(integer, text, integer, text, text, OUT host text, OUT port integer, OUT status text, OUT weight float4) RETURNS record AS 'MODULE_PATHNAME', '_pcp_node_info' LANGUAGE C VOLATILE STRICT; /** * input parameters: node_id, server_name */ CREATE FUNCTION pcp_node_info(integer, text, OUT host text, OUT port integer, OUT status text, OUT weight float4) RETURNS record AS 'MODULE_PATHNAME', '_pcp_node_info' LANGUAGE C VOLATILE STRICT; /** * input parameters: host, port, username, password */ CREATE FUNCTION pcp_pool_status(text, integer, text, text, OUT item text, OUT value text, OUT description text) RETURNS record AS 'MODULE_PATHNAME', '_pcp_pool_status' LANGUAGE C VOLATILE STRICT; /** * input parameters: server_name */ CREATE FUNCTION pcp_pool_status(text, OUT item text, OUT value text, OUT description text) RETURNS record AS 'MODULE_PATHNAME', '_pcp_pool_status' LANGUAGE C VOLATILE STRICT; /** * input parameters: host, port, username, password */ CREATE FUNCTION pcp_node_count(text, integer, text, text, OUT node_count integer) RETURNS integer AS 'MODULE_PATHNAME', '_pcp_node_count' LANGUAGE C VOLATILE STRICT; /** * input parameters: server_name */ CREATE FUNCTION pcp_node_count(text, OUT node_count integer) RETURNS integer AS 'MODULE_PATHNAME', '_pcp_node_count' LANGUAGE C VOLATILE STRICT; /** * input parameters: node_id, host, port, username, password */ CREATE FUNCTION pcp_attach_node(integer, text, integer, text, text, OUT node_attached boolean) RETURNS boolean AS 'MODULE_PATHNAME', '_pcp_attach_node' LANGUAGE C VOLATILE STRICT; /** * input parameters: node_id, server_name */ CREATE FUNCTION pcp_attach_node(integer, text, OUT node_attached boolean) RETURNS boolean AS 'MODULE_PATHNAME', '_pcp_attach_node' LANGUAGE C VOLATILE STRICT; /** * input parameters: node_id, gracefully, host, port, username, password */ CREATE FUNCTION pcp_detach_node(integer, boolean, text, integer, text, text, OUT node_detached boolean) RETURNS boolean AS 'MODULE_PATHNAME', '_pcp_detach_node' LANGUAGE C VOLATILE STRICT; /** * input parameters: node_id, gracefully, server_name */ CREATE FUNCTION pcp_detach_node(integer, boolean, text, OUT node_detached boolean) RETURNS boolean AS 'MODULE_PATHNAME', '_pcp_detach_node' LANGUAGE C VOLATILE STRICT; pgpool-II-4.1.4/src/sql/pgpool_adm/pgpool_adm--1.2.sql0000664000175000017500000000523213730350075017173 00000000000000/* contrib/pgpool_adm/pgpool_adm--1.2.sql */ /* *********************************************** * Administrative functions for pgPool * *********************************************** */ /** * input parameters: node_id, host, port, username, password */ CREATE FUNCTION pcp_node_info(integer, text, integer, text, text, OUT host text, OUT port integer, OUT status text, OUT weight float4, OUT role text, OUT replication_delay bigint, OUT replication_state text, OUT replication_sync_state text, OUT last_status_change timestamp) RETURNS record AS 'MODULE_PATHNAME', '_pcp_node_info' LANGUAGE C VOLATILE STRICT; /** * input parameters: node_id, server_name */ CREATE FUNCTION pcp_node_info(integer, text, OUT host text, OUT port integer, OUT status text, OUT weight float4) RETURNS record AS 'MODULE_PATHNAME', '_pcp_node_info' LANGUAGE C VOLATILE STRICT; /** * input parameters: host, port, username, password */ CREATE FUNCTION pcp_pool_status(text, integer, text, text, OUT item text, OUT value text, OUT description text) RETURNS record AS 'MODULE_PATHNAME', '_pcp_pool_status' LANGUAGE C VOLATILE STRICT; /** * input parameters: server_name */ CREATE FUNCTION pcp_pool_status(text, OUT item text, OUT value text, OUT description text) RETURNS record AS 'MODULE_PATHNAME', '_pcp_pool_status' LANGUAGE C VOLATILE STRICT; /** * input parameters: host, port, username, password */ CREATE FUNCTION pcp_node_count(text, integer, text, text, OUT node_count integer) RETURNS integer AS 'MODULE_PATHNAME', '_pcp_node_count' LANGUAGE C VOLATILE STRICT; /** * input parameters: server_name */ CREATE FUNCTION pcp_node_count(text, OUT node_count integer) RETURNS integer AS 'MODULE_PATHNAME', '_pcp_node_count' LANGUAGE C VOLATILE STRICT; /** * input parameters: node_id, host, port, username, password */ CREATE FUNCTION pcp_attach_node(integer, text, integer, text, text, OUT node_attached boolean) RETURNS boolean AS 'MODULE_PATHNAME', '_pcp_attach_node' LANGUAGE C VOLATILE STRICT; /** * input parameters: node_id, server_name */ CREATE FUNCTION pcp_attach_node(integer, text, OUT node_attached boolean) RETURNS boolean AS 'MODULE_PATHNAME', '_pcp_attach_node' LANGUAGE C VOLATILE STRICT; /** * input parameters: node_id, gracefully, host, port, username, password */ CREATE FUNCTION pcp_detach_node(integer, boolean, text, integer, text, text, OUT node_detached boolean) RETURNS boolean AS 'MODULE_PATHNAME', '_pcp_detach_node' LANGUAGE C VOLATILE STRICT; /** * input parameters: node_id, gracefully, server_name */ CREATE FUNCTION pcp_detach_node(integer, boolean, text, OUT node_detached boolean) RETURNS boolean AS 'MODULE_PATHNAME', '_pcp_detach_node' LANGUAGE C VOLATILE STRICT; pgpool-II-4.1.4/src/sql/pgpool_adm/pgpool_adm--1.1--1.2.sql0000664000175000017500000000146313730350127017545 00000000000000/* contrib/pgpool_adm/pgpool_adm--1.1--1.2.sql */ -- complain if script is sourced in psql, rather than via ALTER EXTENSION \echo Use "ALTER EXTENSION pgpool_adm UPDATE TO '1.1'" to load this file. \quit ALTER EXTENSION pgpool_adm DROP FUNCTION CREATE FUNCTION pcp_node_info(integer, text, integer, text, text, OUT host text, OUT port integer, OUT status text, OUT weight float4, OUT role text, OUT replication_delay bigint, OUT last_status_change timestamp) CREATE FUNCTION pcp_node_info(integer, text, integer, text, text, OUT host text, OUT port integer, OUT status text, OUT weight float4, OUT role text, OUT replication_delay bigint, OUT replication_state text, OUT replication_sync_state text, OUT last_status_change timestamp) RETURNS record AS 'MODULE_PATHNAME', '_pcp_node_info' LANGUAGE C VOLATILE STRICT; pgpool-II-4.1.4/src/sql/pgpool_adm/Makefile0000664000175000017500000000157313730350127015420 00000000000000# contrib/pgpool_adm/Makefile MODULE_big = pgpool_adm OBJS = pgpool_adm.o PG_CPPFLAGS = -I$(libpq_srcdir) -I../../include/pcp EXTENSION = pgpool_adm DATA = pgpool_adm--1.0.sql pgpool_adm--1.1.sql pgpool_adm--1.2.sql pgpool_adm--1.0--1.1.sql pgpool_adm--1.1--1.2.sql SHLIB_LINK = -L../../libs/pcp/.libs -lpcp -Wl,--as-needed -Wl,-rpath,'${prefix}/lib',--enable-new-dtags # if you are using PostgreSQL 8.0 or later, # using pg_config is recommended. # if you are not, comment out following line and... USE_PGXS = true # set top_builddir to the PostgreSQL build source tree top. # (for example /usr/local/src/postgresql-8.4) top_builddir = ../.. ifdef USE_PGXS PG_CONFIG ?= pg_config PGXS := $(shell $(PG_CONFIG) --pgxs) include $(PGXS) else subdir = contrib/pgpool_adm #top_builddir = ../.. include $(top_builddir)/src/Makefile.global include $(top_srcdir)/contrib/contrib-global.mk endif pgpool-II-4.1.4/src/sql/Makefile0000664000175000017500000000257713730350075013306 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. # # Makefile for sql/ directory. subdir = sql # if you are using PostgreSQL 8.0 or later, # using pg_config is recommended. # if you are not, comment out following line and... USE_PGXS = true # set top_builddir to the PostgreSQL build source tree top. # (for example /usr/local/src/postgresql-9.0) top_builddir = .. ifdef USE_PGXS PG_CONFIG ?= pg_config PGXS = $(shell $(PG_CONFIG) --pgxs) include $(PGXS) else subdir = contrib include $(top_builddir)/src/Makefile.global include $(top_srcdir)/contrib/contrib-global.mk endif SUBDIRS = \ pgpool-recovery \ pgpool-regclass \ pgpool_adm $(recurse) pgpool-II-4.1.4/src/sql/insert_lock.sql0000664000175000017500000000115113730350075014666 00000000000000-- Create lock control table for tables using sequence in native replication mode. DROP TABLE pgpool_catalog.insert_lock; CREATE SCHEMA pgpool_catalog; CREATE TABLE pgpool_catalog.insert_lock(reloid OID PRIMARY KEY); -- this row is used as the row lock target when pgpool inserts new oid INSERT INTO pgpool_catalog.insert_lock VALUES (0); -- allow "SELECT ... FOR UPDATE" and "INSERT ..." to all roles GRANT USAGE ON SCHEMA pgpool_catalog TO PUBLIC; GRANT SELECT ON pgpool_catalog.insert_lock TO PUBLIC; GRANT UPDATE ON pgpool_catalog.insert_lock TO PUBLIC; GRANT INSERT ON pgpool_catalog.insert_lock TO PUBLIC; pgpool-II-4.1.4/src/streaming_replication/0000775000175000017500000000000013730350746015503 500000000000000pgpool-II-4.1.4/src/streaming_replication/pool_worker_child.c0000664000175000017500000003316013730350127021270 00000000000000/* -*-pgsql-c-*- */ /* * pgpool: a language independent connection pool server for PostgreSQL * written by Tatsuo Ishii * * Copyright (c) 2003-2020 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. * * child.c: worker child process main * */ #include "config.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_CRYPT_H #include #endif #include "pool.h" #include "utils/palloc.h" #include "utils/memutils.h" #include "utils/elog.h" #include "context/pool_process_context.h" #include "context/pool_session_context.h" #include "pool_config.h" #include "utils/pool_ip.h" #include "auth/md5.h" #include "auth/pool_hba.h" #include "utils/pool_stream.h" static POOL_CONNECTION_POOL_SLOT * slots[MAX_NUM_BACKENDS]; static volatile sig_atomic_t reload_config_request = 0; static volatile sig_atomic_t restart_request = 0; static void establish_persistent_connection(void); static void discard_persistent_connection(void); static void check_replication_time_lag(void); static void CheckReplicationTimeLagErrorCb(void *arg); static unsigned long long int text_to_lsn(char *text); static RETSIGTYPE my_signal_handler(int sig); static RETSIGTYPE reload_config_handler(int sig); static void reload_config(void); #define CHECK_REQUEST \ do { \ if (reload_config_request) \ { \ reload_config(); \ reload_config_request = 0; \ } else if (restart_request) \ { \ ereport(LOG,(errmsg("worker process received restart request"))); \ exit(1); \ } \ } while (0) #define PG10_SERVER_VERSION 100000 /* PostgreSQL 10 server version num */ #define PG91_SERVER_VERSION 90100 /* PostgreSQL 9.1 server version num */ /* * worker child main loop */ void do_worker_child(void) { sigjmp_buf local_sigjmp_buf; MemoryContext WorkerMemoryContext; ereport(DEBUG1, (errmsg("I am %d", getpid()))); /* Identify myself via ps */ init_ps_display("", "", "", ""); set_ps_display("worker process", false); /* set up signal handlers */ signal(SIGALRM, SIG_DFL); signal(SIGTERM, my_signal_handler); signal(SIGINT, my_signal_handler); signal(SIGHUP, reload_config_handler); signal(SIGQUIT, my_signal_handler); signal(SIGCHLD, SIG_IGN); signal(SIGUSR1, my_signal_handler); signal(SIGUSR2, SIG_IGN); signal(SIGPIPE, SIG_IGN); /* Create per loop iteration memory context */ WorkerMemoryContext = AllocSetContextCreate(TopMemoryContext, "Worker_main_loop", ALLOCSET_DEFAULT_MINSIZE, ALLOCSET_DEFAULT_INITSIZE, ALLOCSET_DEFAULT_MAXSIZE); MemoryContextSwitchTo(TopMemoryContext); /* Initialize my backend status */ pool_initialize_private_backend_status(); /* Initialize per process context */ pool_init_process_context(); if (sigsetjmp(local_sigjmp_buf, 1) != 0) { pool_signal(SIGALRM, SIG_IGN); error_context_stack = NULL; EmitErrorReport(); MemoryContextSwitchTo(TopMemoryContext); FlushErrorState(); } /* We can now handle ereport(ERROR) */ PG_exception_stack = &local_sigjmp_buf; for (;;) { MemoryContextSwitchTo(WorkerMemoryContext); MemoryContextResetAndDeleteChildren(WorkerMemoryContext); CHECK_REQUEST; if (pool_config->sr_check_period <= 0) { sleep(30); } /* * If streaming replication mode, do time lag checking */ if (pool_config->sr_check_period > 0 && STREAM) { establish_persistent_connection(); PG_TRY(); { POOL_NODE_STATUS *node_status; int i; /* Do replication time lag checking */ check_replication_time_lag(); /* Check node status */ node_status = verify_backend_node_status(slots); for (i = 0; i < NUM_BACKENDS; i++) { ereport(DEBUG1, (errmsg("node status[%d]: %d", i, node_status[i]))); if (node_status[i] == POOL_NODE_STATUS_INVALID) { int n; ereport(LOG, (errmsg("pgpool_worker_child: invalid node found %d", i))); if (pool_config->detach_false_primary) { n = i; degenerate_backend_set(&n, 1, REQ_DETAIL_SWITCHOVER | REQ_DETAIL_CONFIRMED); } } } } PG_CATCH(); { discard_persistent_connection(); sleep(pool_config->sr_check_period); PG_RE_THROW(); } PG_END_TRY(); /* Discard persistent connections */ discard_persistent_connection(); } sleep(pool_config->sr_check_period); } exit(0); } /* * Establish persistent connection to backend */ static void establish_persistent_connection(void) { int i; BackendInfo *bkinfo; char *password = get_pgpool_config_user_password(pool_config->sr_check_user, pool_config->sr_check_password); for (i = 0; i < NUM_BACKENDS; i++) { if (!VALID_BACKEND(i)) continue; if (slots[i] == NULL) { bkinfo = pool_get_node_info(i); slots[i] = make_persistent_db_connection_noerror(i, bkinfo->backend_hostname, bkinfo->backend_port, pool_config->sr_check_database, pool_config->sr_check_user, password ? password : "", true); } } if (password) pfree(password); } /* * Discard persistent connection to backend */ static void discard_persistent_connection(void) { int i; for (i = 0; i < NUM_BACKENDS; i++) { if (slots[i]) { discard_persistent_db_connection(slots[i]); slots[i] = NULL; } } } /* * Check replication time lag */ static void check_replication_time_lag(void) { /* backend server version cache */ static int server_version[MAX_NUM_BACKENDS]; int i; POOL_SELECT_RESULT *res; POOL_SELECT_RESULT *res_rep; /* query results of pg_stat_replication */ unsigned long long int lsn[MAX_NUM_BACKENDS]; char *query; char *stat_rep_query; BackendInfo *bkinfo; unsigned long long int lag; ErrorContextCallback callback; int active_standby_node; /* clear replication state */ for (i = 0; i < NUM_BACKENDS; i++) { bkinfo = pool_get_node_info(i); *bkinfo->replication_state = '\0'; *bkinfo->replication_sync_state = '\0'; } if (NUM_BACKENDS <= 1) { /* If there's only one node, there's no point to do checking */ return; } if (REAL_PRIMARY_NODE_ID < 0) { /* No need to check if there's no primary */ return; } /* * Register a error context callback to throw proper context message */ callback.callback = CheckReplicationTimeLagErrorCb; callback.arg = NULL; callback.previous = error_context_stack; error_context_stack = &callback; stat_rep_query = NULL; active_standby_node = 0; for (i = 0; i < NUM_BACKENDS; i++) { lsn[i] = 0; if (!VALID_BACKEND(i)) continue; if (!slots[i]) { ereport(ERROR, (errmsg("Failed to check replication time lag"), errdetail("No persistent db connection for the node %d", i), errhint("check sr_check_user and sr_check_password"))); } if (server_version[i] == 0) { query = "SELECT current_setting('server_version_num')"; /* * Get backend server version. If the query fails, keep previous * info. */ if (get_query_result(slots, i, query, &res) == 0) { server_version[i] = atoi(res->data[0]); ereport(DEBUG1, (errmsg("backend %d server version: %d", i, server_version[i]))); } } if (PRIMARY_NODE_ID == i) { if (server_version[i] >= PG10_SERVER_VERSION) query = "SELECT pg_current_wal_lsn()"; else query = "SELECT pg_current_xlog_location()"; if (server_version[i] == PG91_SERVER_VERSION) stat_rep_query = "SELECT application_name, state, '' AS sync_state FROM pg_stat_replication"; else if (server_version[i] > PG91_SERVER_VERSION) stat_rep_query = "SELECT application_name, state, sync_state FROM pg_stat_replication"; } else { if (server_version[i] >= PG10_SERVER_VERSION) query = "SELECT pg_last_wal_replay_lsn()"; else query = "SELECT pg_last_xlog_replay_location()"; active_standby_node++; } if (get_query_result(slots, i, query, &res) == 0 && res->nullflags[0] != -1) { lsn[i] = text_to_lsn(res->data[0]); free_select_result(res); } } /* * Call pg_stat_replication and fill the replication status. */ if (slots[PRIMARY_NODE_ID] && stat_rep_query != NULL) { int status; status = get_query_result(slots, PRIMARY_NODE_ID, stat_rep_query, &res_rep); if (status == -1 || (status == -2 && active_standby_node > 0)) { ereport(LOG, (errmsg("get_query_result falied: status: %d", status))); } for (i = 0; i < NUM_BACKENDS; i++) { bkinfo = pool_get_node_info(i); *bkinfo->replication_state = '\0'; *bkinfo->replication_sync_state = '\0'; if (i == PRIMARY_NODE_ID) continue; if (status == 0) { int j; char *s; for (j = 0; j < res_rep->numrows; j++) { if (strcmp(res_rep->data[j*3], bkinfo->backend_application_name) == 0) { /* * If sr_check_user has enough privilege, it should return * some string. If not, NULL pointer will be returned for * res_rep->data[1] and [2]. So we need to prepare for the * latter case. */ s = res_rep->data[j*3+1]? res_rep->data[j*3+1] : ""; strlcpy(bkinfo->replication_state, s, NAMEDATALEN); s = res_rep->data[j*3+2]? res_rep->data[j*3+2] : ""; strlcpy(bkinfo->replication_sync_state, s, NAMEDATALEN); } } } } if (status == 0) free_select_result(res_rep); } for (i = 0; i < NUM_BACKENDS; i++) { if (!VALID_BACKEND(i)) continue; /* Set standby delay value */ bkinfo = pool_get_node_info(i); lag = (lsn[PRIMARY_NODE_ID] > lsn[i]) ? lsn[PRIMARY_NODE_ID] - lsn[i] : 0; if (PRIMARY_NODE_ID == i) { bkinfo->standby_delay = 0; } else { bkinfo->standby_delay = lag; /* Log delay if necessary */ if ((pool_config->log_standby_delay == LSD_ALWAYS && lag > 0) || (pool_config->delay_threshold && pool_config->log_standby_delay == LSD_OVER_THRESHOLD && lag > pool_config->delay_threshold)) { ereport(LOG, (errmsg("Replication of node:%d is behind %llu bytes from the primary server (node:%d)", i, lsn[PRIMARY_NODE_ID] - lsn[i], PRIMARY_NODE_ID))); } } } error_context_stack = callback.previous; } static void CheckReplicationTimeLagErrorCb(void *arg) { errcontext("while checking replication time lag"); } /* * Convert logid/recoff style text to 64bit log location (LSN) */ static unsigned long long int text_to_lsn(char *text) { /* * WAL segment size in bytes. XXX We should fetch this from * PostgreSQL, rather than having fixed value. */ #define WALSEGMENTSIZE 16 * 1024 * 1024 unsigned int xlogid; unsigned int xrecoff; unsigned long long int lsn; if (sscanf(text, "%X/%X", &xlogid, &xrecoff) !=2) { ereport(ERROR, (errmsg("invalid LSN format"), errdetail("wrong log location format: %s", text))); } lsn = xlogid * ((unsigned long long int) 0xffffffff - WALSEGMENTSIZE) + xrecoff; #ifdef DEBUG ereport(LOG, (errmsg("lsn: %X %X %llX", xlogid, xrecoff, lsn))); #endif return lsn; } static RETSIGTYPE my_signal_handler(int sig) { int save_errno = errno; POOL_SETMASK(&BlockSig); switch (sig) { case SIGTERM: case SIGINT: case SIGQUIT: exit(0); break; /* Failback or new node added */ case SIGUSR1: restart_request = 1; break; default: exit(1); break; } POOL_SETMASK(&UnBlockSig); errno = save_errno; } static RETSIGTYPE reload_config_handler(int sig) { int save_errno = errno; POOL_SETMASK(&BlockSig); reload_config_request = 1; POOL_SETMASK(&UnBlockSig); errno = save_errno; } static void reload_config(void) { ereport(LOG, (errmsg("reloading config file"))); MemoryContext oldContext = MemoryContextSwitchTo(TopMemoryContext); pool_get_config(get_config_file_name(), CFGCXT_RELOAD); MemoryContextSwitchTo(oldContext); if (pool_config->enable_pool_hba) load_hba(get_hba_file_name()); reload_config_request = 0; } /* * Execute query against specified backend using an established connection to * backend. Return -1 on failure, -2 on no rows returned, or 0 otherwise. * Caller must prepare memory for POOL_SELECT_RESULT and pass it as "res". It * is guaranteed that no exception occurs within this function. */ int get_query_result(POOL_CONNECTION_POOL_SLOT * *slots, int backend_id, char *query, POOL_SELECT_RESULT * *res) { int sts = -1; MemoryContext oldContext = CurrentMemoryContext; PG_TRY(); { do_query(slots[backend_id]->con, query, res, PROTO_MAJOR_V3); } PG_CATCH(); { /* ignore the error message */ res = NULL; MemoryContextSwitchTo(oldContext); FlushErrorState(); ereport(LOG, (errmsg("get_query_result: do_query failed"))); } PG_END_TRY(); if (!res) { ereport(LOG, (errmsg("get_query_result: no result returned"), errdetail("node id (%d)", backend_id))); return sts; } if ((*res)->numrows <= 0) { free_select_result(*res); ereport(DEBUG1, (errmsg("get_query_result: no rows returned"), errdetail("node id (%d)", backend_id))); return -2; } sts = 0; return sts; } pgpool-II-4.1.4/src/test/0000775000175000017500000000000013730350746012100 500000000000000pgpool-II-4.1.4/src/test/C/0000775000175000017500000000000013730350746012262 500000000000000pgpool-II-4.1.4/src/test/C/Makefile0000664000175000017500000000054313730350075013637 00000000000000# # Makefile for example programs # subdir = . top_builddir = /usr/local/src/pgsql/current/pgsql include $(top_builddir)/src/Makefile.global ifeq ($(PORTNAME), win32) LDLIBS += -lws2_32 endif override CPPFLAGS := -I$(libpq_srcdir) $(CPPFLAGS) override LDLIBS := $(libpq_pgport) $(LDLIBS) PROGS = test_extended all: $(PROGS) clean: rm -f $(PROGS) pgpool-II-4.1.4/src/test/C/test_extended.c0000664000175000017500000000474213730350075015207 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. * * Extended protocol test program. * Features are: * libq trace on/off * explicit transaction on/off * multiple SQL statements */ #include #include #include #include #include #include #include #include "libpq-fe.h" #include "libpq/libpq-fs.h" int main(int argc, char **argv) { char *connect_string = "user=t-ishii dbname=test port=5432"; int doTrace = 1; /* set 1 to start libpq trace */ int doTransaction = 1; /* set 1 to start explicit transaction */ int doSleep = 0; /* set non 0 seconds to sleep after connection * and beforfe starting command */ /* SQL commands to be executed */ static char *commands[] = { "SAVEPOINT S1", "UPDATE t1 SET k = 1", "ROLLBACK TO S1", "SELECT 1", "RELEASE SAVEPOINT S1" }; PGconn *conn; PGresult *res; int i; conn = PQconnectdb(connect_string); if (PQstatus(conn) == CONNECTION_BAD) { printf("Unable to connect to db\n"); PQfinish(conn); return 1; } if (doSleep) sleep(doSleep); if (doTrace == 1) PQtrace(conn, stdout); if (doTransaction) PQexec(conn, "BEGIN;"); for (i = 0; i < sizeof(commands) / sizeof(char *); i++) { char *command = commands[i]; res = PQexecParams(conn, command, 0, NULL, NULL, NULL, NULL, 0); switch (PQresultStatus(res)) { case PGRES_COMMAND_OK: case PGRES_TUPLES_OK: fprintf(stderr, "\"%s\" : succeeded\n", command); break; default: fprintf(stderr, "\"%s\" failed: %s\n", command, PQresultErrorMessage(res)); break; } PQclear(res); } if (doTransaction == 1) { PQexec(conn, "COMMIT;"); } PQfinish(conn); return 0; } pgpool-II-4.1.4/src/test/parser/0000775000175000017500000000000013730350746013374 500000000000000pgpool-II-4.1.4/src/test/parser/expected/0000775000175000017500000000000013730350746015175 500000000000000pgpool-II-4.1.4/src/test/parser/expected/copy.out0000664000175000017500000000106613730350075016616 00000000000000COPY "t" FROM 'xxx' COPY "t" FROM STDIN COPY "t"("x", "y") FROM 'xxx' COPY "t" FROM 'xxx' BINARY COPY "t" FROM 'xxx' CSV HEADER QUOTE '#' ESCAPE '$' FORCE NOT NULL "foo", "bar" COPY "t" FROM 'xxx' OIDS COPY "t" FROM 'xxx' DELIMITERS ',' COPY "t" FROM 'xxx' NULL 'x' COPY "t" TO 'yyy' COPY "t" TO STDOUT COPY "t"("x", "y") TO 'yyy' COPY "t" TO 'yyy' BINARY COPY "t" FROM 'xxx' CSV HEADER QUOTE '#' ESCAPE '$' FORCE QUOTE "foo", "bar" COPY "t" TO 'yyy' OIDS COPY "t" TO 'yyy' DELIMITERS ',' COPY "t" TO 'yyy' NULL 'x' COPY ( SELECT * FROM "t") TO 'xxx' pgpool-II-4.1.4/src/test/parser/expected/create.out0000664000175000017500000000637513730350075017117 00000000000000CREATE TABLE "foo" ("a" int4,"b" "text") CREATE TABLE "foo" ("a" int4,"b" "text") INHERITS ("bar") CREATE TABLE "foo" ("a" int4,"b" "text") INHERITS ("a","b","c","d") CREATE TABLE "foo" ("a" int4,"b" numeric) WITH OIDS CREATE TABLE "foo" ("a" int4,"b" numeric) WITHOUT OIDS CREATE TABLE "foo" ("a" int4,"b" numeric) WITH ("fillfactor"=10) CREATE TABLE "foo" ("a", "b") AS SELECT 1,2 CREATE TABLE "foo" ("a", "b") WITH OIDS AS SELECT 1,2 CREATE TABLE "foo" ("a", "b") WITHOUT OIDS AS SELECT 1,2 CREATE TABLE "foo" ("a", "b") WITH ("fillfactor"=10) AS SELECT 1,2 syntax error: CREATE TABLE foo (a, b) ON COMMIT DROP syntax error: CREATE TABLE foo (a, b) ON COMMIT DELETE syntax error: CREATE TABLE foo (a, b) ON COMMIT PRESERVE syntax error: CREATE TABLE foo (a, b) ON COMMIT PRESERVE ROWS TABLESPACE data CREATE TABLE "foo" ("a", "b") ON COMMIT DROP AS SELECT 1,2 CREATE TABLE "foo" ("a", "b") ON COMMIT DELETE ROWS AS SELECT 1,2 CREATE TABLE "foo" ("a", "b") ON COMMIT PRESERVE ROWS AS SELECT 1,2 CREATE TABLE "foo" ("a", "b") ON COMMIT PRESERVE ROWS TABLESPACE "data" AS SELECT 1,2 CREATE TABLE "foo" ("a" int4,LIKE "a" INCLUDING DEFAULTS) CREATE TABLE "foo" ("a" int4,LIKE "a" INCLUDING CONSTRAINTS) CREATE TABLE "foo" ("a" int4,LIKE "a" INCLUDING CONSTRAINTS INCLUDING INDEXES) CREATE TABLE "foo" ("a" int4,LIKE "a" INCLUDING DEFAULTS INCLUDING INDEXES) CREATE TABLE "foo" ("a" int4 UNIQUE) CREATE TABLE "foo" ("a" int4 UNIQUE WITH ("fillfactor"=10)) CREATE TABLE "foo" ("a" int4 PRIMARY KEY) CREATE TABLE "foo" ("a" int4 CHECK ( ("a">100 ))) CREATE TABLE "foo" ("a" int4 REFERENCES "b"("c")) CREATE TABLE "foo" ("a" int4 REFERENCES "b"("c") MATCH FULL) syntax error: CREATE TABLE foo (a int references b(c) MATCH PARTIAL) CREATE TABLE "foo" ("a" int4 REFERENCES "b"("c")) CREATE TABLE "foo" ("a" int4 REFERENCES "b"("c") ON UPDATE RESTRICT) CREATE TABLE "foo" ("a" int4 REFERENCES "b"("c") ON UPDATE CASCADE) CREATE TABLE "foo" ("a" int4 REFERENCES "b"("c") ON UPDATE SET NULL) CREATE TABLE "foo" ("a" int4 REFERENCES "b"("c") ON UPDATE SET DEFAULT) CREATE TABLE "foo" ("a" int4 REFERENCES "b"("c") ON DELETE RESTRICT) CREATE TABLE "foo" ("a" int4 REFERENCES "b"("c") ON DELETE CASCADE) CREATE TABLE "foo" ("a" int4 REFERENCES "b"("c") ON DELETE SET NULL) CREATE TABLE "foo" ("a" int4 REFERENCES "b"("c") ON DELETE SET DEFAULT) CREATE TYPE "enum_test" AS ENUM ('label1','label2') CREATE TYPE "enum_test" AS ENUM () syntax error: CREATE TYPE enum_test AS ENUM; CREATE TEXT SEARCH PARSER "foo"("a"='b') CREATE TEXT SEARCH DICTIONARY "foo"("a"='b') CREATE TEXT SEARCH CONFIGURATION "foo"("a"='b') CREATE INDEX "foo" ON "a"("b") CREATE INDEX "foo" ON "a"("b","c") CREATE UNIQUE INDEX "foo" ON "a"("b") CREATE UNIQUE INDEX CONCURRENTLY "foo" ON "a"("b") CREATE SEQUENCE "a_seq" CREATE TEMP SEQUENCE "a_seq" CREATE TEMP SEQUENCE "a_seq" CREATE SEQUENCE "a_seq" INCREMENT 1 CREATE SEQUENCE "a_seq" INCREMENT 1 CREATE SEQUENCE "a_seq" MINVALUE 1 CREATE SEQUENCE "a_seq" NO MINVALUE CREATE SEQUENCE "a_seq" MAXVALUE 1 CREATE SEQUENCE "a_seq" NO MAXVALUE CREATE SEQUENCE "a_seq" START 1 CREATE SEQUENCE "a_seq" START 1 CREATE SEQUENCE "a_seq" CACHE 1 CREATE SEQUENCE "a_seq" CYCLE CREATE SEQUENCE "a_seq" NO CYCLE CREATE SEQUENCE "a_seq" OWNED BY "a", "b" CREATE SEQUENCE "a_seq" OWNED BY "none" pgpool-II-4.1.4/src/test/parser/expected/cursor.out0000664000175000017500000000200013730350075017146 00000000000000DECLARE "xx" CURSOR FOR SELECT * FROM "t" DECLARE "xx" BINARY CURSOR FOR SELECT * FROM "t" DECLARE "xx" INSENSITIVE CURSOR FOR SELECT * FROM "t" DECLARE "xx" SCROLL CURSOR FOR SELECT * FROM "t" DECLARE "xx" CURSOR WITH HOLD FOR SELECT * FROM "t" DECLARE "xx" CURSOR FOR SELECT * FROM "t" CLOSE "xx" FETCH FORWARD 1 IN "xx" FETCH FORWARD 1 IN "xx" FETCH BACKWARD 1 IN "xx" FETCH LAST IN "xx" FETCH ABSOLUTE 2 IN "xx" FETCH RELATIVE 2 IN "xx" FETCH FORWARD 1 IN "xx" FETCH FORWARD ALL IN "xx" FETCH FORWARD 1 IN "xx" FETCH FORWARD 2 IN "xx" FETCH FORWARD ALL IN "xx" FETCH BACKWARD 1 IN "xx" FETCH BACKWARD 3 IN "xx" FETCH BACKWARD ALL IN "xx" FETCH BACKWARD ALL IN "xx" MOVE FORWARD 1 IN "xx" MOVE FORWARD 1 IN "xx" MOVE BACKWARD 1 IN "xx" MOVE LAST IN "xx" MOVE ABSOLUTE 2 IN "xx" MOVE RELATIVE 2 IN "xx" MOVE FORWARD 1 IN "xx" MOVE FORWARD ALL IN "xx" MOVE FORWARD 1 IN "xx" MOVE FORWARD 2 IN "xx" MOVE FORWARD ALL IN "xx" MOVE BACKWARD 1 IN "xx" MOVE BACKWARD 3 IN "xx" MOVE BACKWARD ALL IN "xx" MOVE BACKWARD ALL IN "xx" pgpool-II-4.1.4/src/test/parser/expected/delete.out0000664000175000017500000000104213730350075017100 00000000000000DELETE FROM "t" syntax error: DELETE ; DELETE FROM "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" DELETE FROM "t" WHERE ("x"=3 ) DELETE FROM "t" WHERE "x" IN ( SELECT * FROM "t1") DELETE FROM "foo" WHERE ("a"=1 ) RETURNING * DELETE FROM "foo" WHERE ("a"=1 ) RETURNING "a" DELETE FROM "foo" WHERE ("a"=1 ) RETURNING "a","b" syntax error: DELETE FROM foo WHERE CURRENT OF $1 DELETE FROM "foo" WHERE CURRENT OF cur pgpool-II-4.1.4/src/test/parser/expected/drop.out0000664000175000017500000000061713730350075016611 00000000000000DROP TABLE "foo" DROP OWNED BY "role_a" DROP OWNED BY "role_a" CASCADE DROP OWNED BY "role_a" DROP OWNED BY "role_a", "role_b", "role_c" REASSIGN OWNED BY "role_a" TO "role_b" REASSIGN OWNED BY "role_a", "role1" TO "role_b" DROP OPERATOR FAMILY "foo" USING "bar" DROP OPERATOR FAMILY IF EXISTS "foo" USING "bar" syntax error: DROP OPERATOR FAMILY foo USING DROP ROLE "foo" DROP ROLE IF EXISTS "foo" pgpool-II-4.1.4/src/test/parser/expected/insert.out0000664000175000017500000000111413730350075017142 00000000000000INSERT INTO "t" VALUES (1) INSERT INTO "t"("a") VALUES (2) INSERT INTO "t"("a", "b", "c") VALUES (2,2) INSERT INTO "t"("a", "b", "c") VALUES (2,2,3) INSERT INTO "t"("a", "b", "c") VALUES (2,DEFAULT,'3') INSERT INTO "t" DEFAULT VALUES INSERT INTO "t" SELECT * FROM "t" INSERT INTO "t" VALUES ("func"("x","y")) INSERT INTO "t"("a", "b", "c") VALUES (2,DEFAULT,'''\\') INSERT INTO "foo"("a", "b") VALUES (1,2) RETURNING * INSERT INTO "foo"("a", "b") VALUES (1,2) RETURNING "a" INSERT INTO "foo"("a", "b") VALUES (1,2) RETURNING "a","b" INSERT INTO "foo"("a", "b") VALUES (1,2), (3,4), (5,6) pgpool-II-4.1.4/src/test/parser/expected/misc.out0000664000175000017500000000055713730350075016603 00000000000000 EXPLAIN SELECT * FROM "t" EXPLAIN ANALYZE SELECT * FROM "t" EXPLAIN ANALYZE VERBOSE SELECT * FROM "t" REINDEX INDEX "x" REINDEX INDEX "x" REINDEX TABLE "x" REINDEX TABLE "x" REINDEX DATABASE "x" REINDEX DATABASE "x" REINDEX SYSTEM "x" REINDEX SYSTEM "x" LISTEN "x" NOTIFY "x" DISCARD ALL DISCARD TEMP DISCARD TEMP DISCARD PLANS syntax error: DISCARD xxx pgpool-II-4.1.4/src/test/parser/expected/prepare.out0000664000175000017500000000016613730350075017302 00000000000000PREPARE "xx" (int4,"text") AS INSERT INTO "foo" VALUES ($1,$2) EXECUTE "xx" (1,'xxx') DEALLOCATE "xx" DEALLOCATE "xx" pgpool-II-4.1.4/src/test/parser/expected/privileges.out0000664000175000017500000000337413730350075020021 00000000000000GRANT select, insert, update, delete, rule, references, trigger ON "t1","t2" TO "x" GRANT select, insert, update, delete, rule, references, trigger ON "t1","t2" TO "x" WITH GRANT OPTION GRANT select, insert, update, delete, rule, references, trigger ON "t1","t2" TO "x" WITH GRANT OPTION GRANT select, insert, update, delete, rule, references, trigger ON "t1","t2" TO PUBLIC GRANT ALL ON "t1","t2" TO "x" GRANT create ON DATABASE "db1", "db2" TO "x","y" GRANT temporary ON DATABASE "db1", "db2" TO "x","y" GRANT temp ON DATABASE "db1", "db2" TO "x","y" GRANT execute ON FUNCTION "func"(int4,"text") TO "x","y" GRANT usage ON LANGUAGE "lang" TO "x","y" GRANT create ON SCHEMA "s" TO "x","y" GRANT usage ON SCHEMA "s" TO "x","y" GRANT create ON TABLESPACE "tblspc" TO "x","y" GRANT "role1" TO "role2" REVOKE select, insert, update, delete, rule, references, trigger ON "t1","t2" FROM "x","y" REVOKE select, insert, update, delete, rule, references, trigger ON "t1","t2" FROM "x","y" CASCADE REVOKE select, insert, update, delete, rule, references, trigger ON "t1","t2" FROM "x","y" REVOKE ALL ON "t1","t2" FROM "x","y" REVOKE ALL ON "t1","t2" FROM PUBLIC REVOKE GRANT OPTION FOR ALL ON "t1","t2" FROM PUBLIC REVOKE GRANT OPTION FOR create ON DATABASE "db1", "db2" FROM "x","y" REVOKE create ON DATABASE "db1", "db2" FROM "x","y" REVOKE temporary ON DATABASE "db1", "db2" FROM "x","y" REVOKE temp ON DATABASE "db1", "db2" FROM "x","y" syntax error: REVOKE EXECUTE on FUNCTION foo(int,text) db1,db2 FROM x,y; REVOKE usage ON LANGUAGE "lang" FROM "x","y" REVOKE create ON SCHEMA "s1", "s2" FROM "x","y" REVOKE usage ON SCHEMA "s1", "s2" FROM "x","y" REVOKE create ON TABLESPACE "tblspc" FROM "x","y" REVOKE ADMIN OPTION FOR "role1", "role2" FROM "x", "y" REVOKE "role1", "role2" FROM "x", "y" pgpool-II-4.1.4/src/test/parser/expected/scanner.out0000664000175000017500000000105513730350075017273 00000000000000pset 0 SELECT '''' SELECT '''' SELECT 'A BC' SELECT 'A BC' syntax error: SELECT U&'d\0061t\+000061'; --error pset 1 syntax error: SELECT '\''; -- error SELECT '''' SELECT 'A\\nBC' SELECT 'A BC' pset 0 SELECT * FROM "data" SELECT 'data' SELECT 'data' SELECT 'data' syntax error: SELECT E'\u3042\u3044\u3046\u3048\u304a'; -- error syntax error: SELECT U&'\3042\3044\3046\3048\304a'; -- error pset 6 SELECT * FROM "data" SELECT 'data' SELECT 'data' SELECT 'data' SELECT 'あいうえお' SELECT 'あいうえお' SELECT '𐀀' SELECT '𐀀' pgpool-II-4.1.4/src/test/parser/expected/select.out0000664000175000017500000000765213730350075017132 00000000000000 SELECT 1 SELECT * FROM "t" SELECT "x" FROM "a" SELECT "x"."y" FROM "a" SELECT "x" FROM "a"."b" SELECT "foo"() SELECT "y" FROM "foo"() syntax error: SELECT * FROM (SELECT * FROM foo); SELECT "a" AS "t" FROM "x" SELECT "x" FROM "a" AS "b" SELECT "a" AS "tttttttttttttttttttttttttttttttttttttttttttttttttttttttt" ,"b" AS "uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu" FROM "zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz" syntax error: SELECT ; SELECT * FROM "t" FOR UPDATE SELECT * FROM "t" FOR SHARED SELECT DISTINCT * FROM "t" SELECT DISTINCT ON ("x" ) "x" FROM "t" SELECT DISTINCT ON ("foo"("x") ) "x" FROM "t" SELECT * FROM "t" SELECT "x" FROM "t" WHERE ("x">3 ) SELECT "count"(*) FROM "t" GROUP BY "x" HAVING ("x">111 ) SELECT "count"(*) FROM "t" GROUP BY "x" HAVING ("x">111 ) ORDER BY "y" SELECT "count"(*) FROM "t" GROUP BY "x" HAVING ("x">111 ) ORDER BY "y" DESC SELECT "count"(*) FROM "t" GROUP BY "x" HAVING ("x">111 ) ORDER BY "y" SELECT "x" FROM "t" LIMIT ALL SELECT "x" FROM "t" LIMIT 1 SELECT * FROM "t" OFFSET 1 SELECT * FROM "t" OFFSET 1 LIMIT 2 SELECT * FROM "t" OFFSET 1 LIMIT 2 SELECT * FROM "t" LEFT OUTER JOIN "t1" ON ("x"="y" ) SELECT * FROM "t" RIGHT OUTER JOIN "t1" ON ("x"="y" ) SELECT * FROM "t" FULL OUTER JOIN "t1" ON ("x"="y" ) SELECT * FROM "t" LEFT OUTER JOIN "t1" USING("x") SELECT * FROM "t" RIGHT OUTER JOIN "t1" USING("x") SELECT * FROM "t" FULL OUTER JOIN "t1" USING("x") SELECT * FROM "t" JOIN "t1" ON "x" SELECT * FROM "t" NATURAL LEFT OUTER JOIN "t1" SELECT * FROM "t" NATURAL RIGHT OUTER JOIN "t1" SELECT * FROM "t" NATURAL FULL OUTER JOIN "t1" SELECT * FROM "t" WHERE "a" IS NULL SELECT * FROM "t" WHERE "a" IS NOT NULL SELECT * FROM "t" WHERE ("a"~~'abc' ) SELECT * FROM "t" WHERE ("a"!~~'abc' ) SELECT * FROM "t" WHERE ( ("a">=1 ) AND ("a"<=4 )) SELECT * FROM "t" WHERE "a" IN (1,2,3,4) SELECT * FROM "t" WHERE "a" NOT IN (1,2,3,4) SELECT * FROM "t" WHERE EXISTS ( SELECT * FROM "tt") SELECT * FROM "t" WHERE (NOT EXISTS ( SELECT * FROM "tt")) ( SELECT * FROM "t1") UNION ( SELECT * FROM "t2") ( SELECT * FROM "t1") UNION ALL ( SELECT * FROM "t2") ( SELECT * FROM "t1") INTERSECT ( SELECT * FROM "t2") ( SELECT * FROM "t1") INTERSECT ALL ( SELECT * FROM "t2") ( SELECT * FROM "t1") EXCEPT ( SELECT * FROM "t2") ( SELECT * FROM "t1") EXCEPT ALL ( SELECT * FROM "t2") CREATE TABLE "x" AS SELECT * FROM "t" SELECT * FROM "t1" WHERE "i"<> ALL ( SELECT "i" FROM "t2") ( SELECT * FROM "t1") UNION ALL ( SELECT * FROM "t2") ORDER BY "a" ( SELECT * FROM "t1") UNION ALL ( SELECT * FROM "t2" ORDER BY "a") SELECT "max"("i")::int4 FROM "test" SELECT "max"("i")::int4 FROM "test" WHERE ("a"='aaa''bbb\\ccc' ) SELECT "max"("i")::int4 FROM "test" WHERE ("a"='aaa''bbb\\ccc' ) SELECT * FROM "t" WHERE 1=ANY("arr") SELECT * FROM "t" WHERE 1=ALL("arr") SELECT * FROM "t" WHERE 1 IS OF (int4) SELECT * FROM "t" WHERE 1 IS OF (int4) SELECT * FROM "t" WHERE "a" IN ('a','b',1) SELECT * FROM "t" WHERE "a" NOT IN ('a','b',1) SELECT * FROM "t" WHERE "a" IS DOCUMENT SELECT * FROM "t" WHERE (NOT "a" IS DOCUMENT) SELECT XMLCONCAT ("a","b") SELECT XMLELEMENT (NAME "a") SELECT XMLELEMENT (NAME "a","b","c") SELECT XMLFOREST ("a") SELECT XMLPARSE (DOCUMENT 1) SELECT XMLPARSE (DOCUMENT 1 PRESERVE WHITESPACE) SELECT '1900-1-1'::"day" SELECT '1 year'::interval SELECT '1 year'::interval YEAR SELECT '1 year'::interval MONTH SELECT '1 year'::interval DAY SELECT '1 year'::interval HOUR SELECT '1 year'::interval MINUTE SELECT '1 year'::interval SECOND SELECT '1 year'::interval YEAR TO MONTH SELECT '1 year'::interval DAY TO HOUR SELECT '1 year'::interval DAY TO MINUTE SELECT '1 year'::interval DAY TO SECOND SELECT '1 year'::interval HOUR TO MINUTE SELECT '1 year'::interval HOUR TO SECOND VALUES (1,2), (3,4), (5,6) pgpool-II-4.1.4/src/test/parser/expected/transaction.out0000664000175000017500000000201413730350075020163 00000000000000BEGIN BEGIN BEGIN BEGIN ISOLATION LEVEL read committed BEGIN ISOLATION LEVEL serializable BEGIN READ WRITE BEGIN READ ONLY START TRANSACTION COMMIT COMMIT COMMIT COMMIT COMMIT COMMIT ABORT ABORT ABORT ABORT ABORT ABORT SET TRANSACTION ISOLATION LEVEL read committed SET TRANSACTION ISOLATION LEVEL serializable SET SESSION CHARACTERISTICS AS TRANSACTION ISOLATION LEVEL read committed SET SESSION CHARACTERISTICS AS TRANSACTION ISOLATION LEVEL serializable SET CONSTRAINTS ALL DEFERRED SET CONSTRAINTS ALL IMMEDIATE SET CONSTRAINTS "x" DEFERRED SET CONSTRAINTS "x" IMMEDIATE LOCK TABLE "t1","t2" IN ACCESS EXCLUSIVE MODE LOCK TABLE "t1","t2" IN ACCESS EXCLUSIVE MODE LOCK TABLE "t1","t2" IN ACCESS SHARE MODE LOCK TABLE "t1","t2" IN ROW SHARE MODE LOCK TABLE "t1","t2" IN ROW EXCLUSIVE MODE LOCK TABLE "t1","t2" IN SHARE UPDATE EXCLUSIVE MODE LOCK TABLE "t1","t2" IN SHARE MODE LOCK TABLE "t1","t2" IN SHARE ROW EXCLUSIVE MODE LOCK TABLE "t1","t2" IN EXCLUSIVE MODE LOCK TABLE "t1","t2" IN ACCESS EXCLUSIVE MODE pgpool-II-4.1.4/src/test/parser/expected/update.out0000664000175000017500000000072413730350075017126 00000000000000UPDATE "t" SET "a" = 1 UPDATE "t" SET "a" = 3, "b" = 'a', "c" = NULL, "d" = DEFAULT UPDATE "t" SET "a" = 1 FROM "x" UPDATE "t" SET "a" = 1 FROM "x","y","z" UPDATE "t" SET "a" = 1 FROM "x" WHERE ( ("x"<100 ) AND ("y">200 )) UPDATE "t" SET "a" = 1 UPDATE "foo" SET "a" = 1 RETURNING * UPDATE "foo" SET "a" = 1 RETURNING "a" UPDATE "foo" SET "a" = 1 RETURNING "a","b" syntax error: UPDATE foo SET a = 1 WHERE CURRENT OF $1 UPDATE "foo" SET "a" = 1 WHERE CURRENT OF cur pgpool-II-4.1.4/src/test/parser/expected/v84.out0000664000175000017500000000332313730350075016263 00000000000000 SELECT '1.23'::interval(0) SECOND SELECT '1 year'::interval(2) HOUR TO SECOND SELECT 'ABC'::char SELECT 'ABC'::"char" SELECT "avg"("c1") OVER ( PARTITION BY "depname" RANGE UNBOUNDED PRECEDING) FROM "r1" SELECT "avg"("c1") OVER ( PARTITION BY "depname" ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) FROM "r1" SELECT "sum"("c1") OVER "w1" FROM "r1" WINDOW "w1" AS ( PARTITION BY "c2" ORDER BY "c3"),"w2" AS ("w1" PARTITION BY "c4") WITH "w1" ("n") AS ( SELECT 1),"w2" ("n") AS ( SELECT 2) SELECT "sum"("n") FROM "r1" WITH RECURSIVE "t" ("n") AS (( VALUES (1)) UNION ALL ( SELECT ("n"+1 ) FROM "t" WHERE ("n"<100 )) ) SELECT "sum"("n") FROM "t" ALTER AGGREGATE "foo"(int4) OWNER TO "bar" ALTER CONVERSION "foo" OWNER TO "bar" ALTER DATABASE "foo" OWNER TO "bar" ALTER DOMAIN "foo" OWNER TO "bar" ALTER FUNCTION "foo"() OWNER TO "bar" ALTER LANGUAGE "foo" OWNER TO "bar" ALTER OPERATOR +(int4, int4) OWNER TO "bar" ALTER OPERATOR CLASS "foo" USING baz OWNER TO "bar" ALTER OPERATOR FAMILY "foo" USING baz OWNER TO "bar" ALTER TYPE "foo" OWNER TO "bar" ALTER TABLESPACE "foo" OWNER TO "bar" ALTER TEXT SEARCH DICTIONARY "foo" OWNER TO "bar" ALTER TEXT SEARCH CONFIGURATION "foo" OWNER TO "bar" ALTER FOREIGN DATA WRAPPER "foo" OWNER TO "bar" ALTER SERVER "foo" OWNER TO "bar" ALTER SCHEMA "foo" OWNER TO "bar" LISTEN "x" NOTIFY "x" UNLISTEN "x" UNLISTEN * CREATE TRIGGER "t1" BEFORE INSERT OR DELETE OR UPDATE OR TRUNCATE ON "r1" FOR EACH STATEMENT EXECUTE PROCEDURE "p1"() GRANT ALL ON "r1" TO PUBLIC GRANT ALL ON SEQUENCE "r1" TO PUBLIC GRANT ALL ON FUNCTION "r1"() TO PUBLIC GRANT ALL ON DATABASE "r1" TO PUBLIC GRANT ALL ON LANGUAGE "r1" TO PUBLIC GRANT ALL ON SCHEMA "r1" TO PUBLIC GRANT ALL ON TABLESPACE "r1" TO PUBLIC pgpool-II-4.1.4/src/test/parser/expected/v90.out0000664000175000017500000000224013730350075016255 00000000000000 SELECT "func"(a := 7,b := 12) SELECT "array_agg"("a" ORDER BY "b","c") SELECT "mleast"(VARIADIC ARRAY [10,-1,5,4.4]) SELECT "avg"("c1") OVER ( ROWS 1 PRECEDING) FROM "r1" SELECT "avg"("c1") OVER "w1" FROM "r1" WINDOW "w1" AS ( ROWS BETWEEN 1 FOLLOWING AND 2 FOLLOWING) SELECT * FROM "t1" OFFSET 1 LIMIT 2 SELECT * FROM "t1" LIMIT 2 pset 90000 EXPLAIN (analyze , verbose ) SELECT 1 EXPLAIN (analyze 'true', verbose 'true', costs 'true', buffers 'true', format 'xml') SELECT 1 EXPLAIN (analyze 'false', verbose 'false', costs 'false', buffers 'false', format 'json') SELECT 1 COPY "t" FROM STDIN COPY "t" FROM 'xxx' (format 'binary') COPY "t" FROM 'xxx' (format 'csv', header 1, quote '#', escape '$', force_not_null ("foo", "bar")) COPY "t" FROM 'xxx' (oids 1) COPY "t" FROM 'xxx' (delimiter ',') COPY "t" FROM 'xxx' (null 'x') COPY "t" FROM STDIN (format 'text') COPY "t" FROM STDIN (format 'csv') COPY "t" FROM STDIN (format 'binary') COPY "t" FROM 'f' (oids 'false') COPY "t" FROM 'f' (oids 'true', delimiter '|', null '', header 'false') COPY "t" FROM 'f' (header 'true', quote '"', escape '@') COPY "t" FROM 'f' (force_quote *, force_not_null ("one", "two", "three")) pgpool-II-4.1.4/src/test/parser/expected/var.out0000664000175000017500000000063113730350075016431 00000000000000SET var TO 'val' SET var TO 'val' SET var TO DEFAULT SET var TO DEFAULT SET TIME ZONE 'val' SET TIME ZONE 'val' SET TIME ZONE SET TIME ZONE SET LOCAL TIME ZONE SET TIME ZONE SET var FROM CURRENT SET XML OPTOIN DOCUMENT SET XML OPTOIN CONTENT syntax error: show 'x'; SHOW x SHOW ALL RESET x RESET ALL RESET TIME ZONE RESET TRANSACTION ISOLATION LEVEL RESET SESSION AUTHORIZATION syntax error: reset 'x'; pgpool-II-4.1.4/src/test/parser/input/0000775000175000017500000000000013730350746014533 500000000000000pgpool-II-4.1.4/src/test/parser/input/alter.sql0000664000175000017500000000006213730350075016274 00000000000000ALTER TABLE foo ; ALTER TEXT SEARCH CONFIGURATION pgpool-II-4.1.4/src/test/parser/input/copy.sql0000664000175000017500000000101313730350075016134 00000000000000COPY t FROM 'xxx'; COPY t FROM stdin; COPY t(x,y) FROM 'xxx'; COPY t FROM 'xxx' BINARY; COPY t FROM 'xxx' CSV HEADER QUOTE AS '#' ESCAPE AS '$' FORCE NOT NULL foo,bar; COPY t FROM 'xxx' OIDS; COPY t FROM 'xxx' DELIMITER ','; COPY t FROM 'xxx' NULL 'x'; COPY t TO 'yyy'; COPY t TO stdout; COPY t(x,y) TO 'yyy'; COPY t TO 'yyy' BINARY; COPY t FROM 'xxx' CSV HEADER QUOTE AS '#' ESCAPE AS '$' FORCE QUOTE foo,bar; COPY t TO 'yyy' OIDS; COPY t TO 'yyy' DELIMITER ','; COPY t TO 'yyy' NULL 'x'; COPY (SELECT * FROM t) TO 'xxx'; pgpool-II-4.1.4/src/test/parser/input/create.sql0000664000175000017500000000553313730350075016440 00000000000000CREATE TABLE foo (a int, b text) CREATE TABLE foo (a int, b text) INHERITS (bar) CREATE TABLE foo (a int, b text) INHERITS (a,b,c,d) CREATE TABLE foo (a int, b numeric) WITH OIDS CREATE TABLE foo (a int, b numeric) WITHOUT OIDS CREATE TABLE foo (a int, b numeric) WITH (fillfactor=10) CREATE TABLE foo (a, b) AS SELECT 1, 2 CREATE TABLE foo (a, b) WITH OIDS AS SELECT 1,2 CREATE TABLE foo (a, b) WITHOUT OIDS AS SELECT 1,2 CREATE TABLE foo (a, b) WITH (fillfactor=10) AS SELECT 1,2 CREATE TABLE foo (a, b) ON COMMIT DROP CREATE TABLE foo (a, b) ON COMMIT DELETE CREATE TABLE foo (a, b) ON COMMIT PRESERVE CREATE TABLE foo (a, b) ON COMMIT PRESERVE ROWS TABLESPACE data CREATE TABLE foo (a, b) ON COMMIT DROP AS SELECT 1,2 CREATE TABLE foo (a, b) ON COMMIT DELETE ROWS AS SELECT 1,2 CREATE TABLE foo (a, b) ON COMMIT PRESERVE ROWS AS SELECT 1,2 CREATE TABLE foo (a, b) ON COMMIT PRESERVE ROWS TABLESPACE data AS SELECT 1,2 CREATE TABLE foo (a int, LIKE a INCLUDING DEFAULTS); CREATE TABLE foo (a int, LIKE a INCLUDING CONSTRAINTS); CREATE TABLE foo (a int, LIKE a INCLUDING ALL EXCLUDING DEFAULTS); CREATE TABLE foo (a int, LIKE a INCLUDING ALL EXCLUDING CONSTRAINTS); CREATE TABLE foo (a int unique); CREATE TABLE foo (a int unique with(fillfactor=10)); CREATE TABLE foo (a int primary key); CREATE TABLE foo (a int check (a > 100)) CREATE TABLE foo (a int references b(c)) CREATE TABLE foo (a int references b(c) MATCH FULL) CREATE TABLE foo (a int references b(c) MATCH PARTIAL) CREATE TABLE foo (a int references b(c) MATCH SIMPLE) CREATE TABLE foo (a int references b(c) ON UPDATE RESTRICT) CREATE TABLE foo (a int references b(c) ON UPDATE CASCADE) CREATE TABLE foo (a int references b(c) ON UPDATE SET NULL) CREATE TABLE foo (a int references b(c) ON UPDATE SET DEFAULT) CREATE TABLE foo (a int references b(c) ON DELETE RESTRICT) CREATE TABLE foo (a int references b(c) ON DELETE CASCADE) CREATE TABLE foo (a int references b(c) ON DELETE SET NULL) CREATE TABLE foo (a int references b(c) ON DELETE SET DEFAULT) CREATE TYPE enum_test AS ENUM ('label1', 'label2'); CREATE TYPE enum_test AS ENUM (); CREATE TYPE enum_test AS ENUM; CREATE TEXT SEARCH PARSER foo (a='b') CREATE TEXT SEARCH DICTIONARY foo (a='b') CREATE TEXT SEARCH CONFIGURATION foo (a='b') CREATE INDEX foo on a(b) CREATE INDEX foo on a(b, c) CREATE UNIQUE INDEX foo on a(b) CREATE UNIQUE INDEX CONCURRENTLY foo on a(b) CREATE SEQUENCE a_seq CREATE TEMP SEQUENCE a_seq CREATE TEMPORARY SEQUENCE a_seq CREATE SEQUENCE a_seq INCREMENT 1 CREATE SEQUENCE a_seq INCREMENT BY 1 CREATE SEQUENCE a_seq minvalue 1 CREATE SEQUENCE a_seq no minvalue CREATE SEQUENCE a_seq maxvalue 1 CREATE SEQUENCE a_seq no maxvalue CREATE SEQUENCE a_seq start 1 CREATE SEQUENCE a_seq start with 1 CREATE SEQUENCE a_seq cache 1 CREATE SEQUENCE a_seq cycle CREATE SEQUENCE a_seq no cycle CREATE SEQUENCE a_seq OWNED BY a.b CREATE SEQUENCE a_seq OWNED BY NONE pgpool-II-4.1.4/src/test/parser/input/cursor.sql0000664000175000017500000000162013730350075016503 00000000000000DECLARE xx CURSOR FOR SELECT * FROM t; DECLARE xx BINARY CURSOR FOR SELECT * FROM t; DECLARE xx INSENSITIVE CURSOR FOR SELECT * FROM t; DECLARE xx SCROLL CURSOR FOR SELECT * FROM t; DECLARE xx CURSOR WITH HOLD FOR SELECT * FROM t; DECLARE xx CURSOR WITHOUT HOLD FOR SELECT * FROM t; CLOSE xx; FETCH IN xx; FETCH NEXT IN xx; FETCH PRIOR IN xx; FETCH LAST IN xx; FETCH ABSOLUTE 2 IN xx; FETCH RELATIVE 2 IN xx; FETCH 1 IN xx; FETCH ALL IN xx; FETCH FORWARD IN xx; FETCH FORWARD 2 IN xx; FETCH FORWARD ALL IN xx; FETCH BACKWARD IN xx; FETCH BACKWARD 3 IN xx; FETCH BACKWARD ALL IN xx; FETCH BACKWARD ALL FROM xx; MOVE IN xx; MOVE NEXT IN xx; MOVE PRIOR IN xx; MOVE LAST IN xx; MOVE ABSOLUTE 2 IN xx; MOVE RELATIVE 2 IN xx; MOVE 1 IN xx; MOVE ALL IN xx; MOVE FORWARD IN xx; MOVE FORWARD 2 IN xx; MOVE FORWARD ALL IN xx; MOVE BACKWARD IN xx; MOVE BACKWARD 3 IN xx; MOVE BACKWARD ALL IN xx; MOVE BACKWARD ALL FROM xx; pgpool-II-4.1.4/src/test/parser/input/delete.sql0000664000175000017500000000074713730350075016441 00000000000000DELETE FROM t; DELETE ; DELETE FROM ONLY xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx; DELETE FROM t WHERE x = 3; DELETE FROM t WHERE x IN (select * from t1); DELETE FROM foo WHERE a = 1 RETURNING *; DELETE FROM foo WHERE a = 1 RETURNING a; DELETE FROM foo WHERE a = 1 RETURNING a,b; DELETE FROM foo WHERE CURRENT OF $1 DELETE FROM foo WHERE CURRENT OF cur pgpool-II-4.1.4/src/test/parser/input/drop.sql0000664000175000017500000000054613730350075016140 00000000000000DROP TABLE foo DROP OWNED BY role_a DROP OWNED BY role_a CASCADE DROP OWNED BY role_a RESTRICT DROP OWNED BY role_a, role_b, role_c REASSIGN OWNED BY role_a TO role_b REASSIGN OWNED BY role_a, role1 TO role_b DROP OPERATOR FAMILY foo USING bar DROP OPERATOR FAMILY IF EXISTS foo USING bar DROP OPERATOR FAMILY foo USING DROP ROLE foo DROP ROLE IF EXISTS foo pgpool-II-4.1.4/src/test/parser/input/insert.sql0000664000175000017500000000100313730350075016465 00000000000000INSERT INTO t values (1); INSERT INTO t(a) VALUES (2); INSERT INTO t(a,b,c) VALUES (2,2); INSERT INTO t(a,b,c) VALUES (2,2,3); INSERT INTO t(a,b,c) VALUES (2,DEFAULT,'3'); INSERT INTO t DEFAULT VALUES; INSERT INTO t SELECT * FROM t; INSERT INTO t values (func(x, y)); INSERT INTO t(a,b,c) VALUES (2,DEFAULT,'\'\\'); INSERT INTO foo(a,b) VALUES (1, 2) RETURNING *; INSERT INTO foo(a,b) VALUES (1, 2) RETURNING a; INSERT INTO foo(a,b) VALUES (1, 2) RETURNING a,b; INSERT INTO foo(a,b) VALUES (1, 2), (3, 4), (5, 6); pgpool-II-4.1.4/src/test/parser/input/misc.sql0000664000175000017500000000102613730350075016121 00000000000000VACUUM; VACUUM FULL; VACUUM FULL FREEZE; VACUUM FULL FREEZE VERBOSE; VACUUM FULL FREEZE VERBOSE ANALYZE; VACUUM FULL t; ANALYZE ANALYZE VERBOSE ANALYZE VERBOSE x ANALYZE VERBOSE x(a,b,c); EXPLAIN SELECT * FROM t; EXPLAIN ANALYZE SELECT * FROM t; EXPLAIN ANALYZE VERBOSE SELECT * FROM t; REINDEX INDEX x REINDEX INDEX x force REINDEX TABLE x REINDEX TABLE x force REINDEX DATABASE x REINDEX DATABASE x force REINDEX SYSTEM x REINDEX SYSTEM x force LISTEN x NOTIFY x DISCARD ALL DISCARD TEMP DISCARD TEMPORARY DISCARD PLANS DISCARD xxx pgpool-II-4.1.4/src/test/parser/input/prepare.sql0000664000175000017500000000017213730350075016625 00000000000000PREPARE xx(integer, text) AS INSERT INTO foo VALUES ($1, $2); EXECUTE xx(1, 'xxx'); DEALLOCATE xx; DEALLOCATE PREPARE xx; pgpool-II-4.1.4/src/test/parser/input/privileges.sql0000664000175000017500000000311013730350075017333 00000000000000GRANT SELECT, INSERT, UPDATE, DELETE, RULE, REFERENCES, TRIGGER on t1, t2 to x; GRANT SELECT, INSERT, UPDATE, DELETE, RULE, REFERENCES, TRIGGER on t1, t2 to x WITH GRANT OPTION; GRANT SELECT, INSERT, UPDATE, DELETE, RULE, REFERENCES, TRIGGER on t1, t2 to GROUP x WITH GRANT OPTION; GRANT SELECT, INSERT, UPDATE, DELETE, RULE, REFERENCES, TRIGGER on t1, t2 to PUBLIC; GRANT ALL on t1, t2 to x; GRANT CREATE on DATABASE db1, db2 TO x,y; GRANT TEMPORARY on DATABASE db1, db2 TO x,y; GRANT TEMP on DATABASE db1, db2 TO x,y; GRANT EXECUTE on FUNCTION func(int, text) TO x,y; GRANT USAGE ON LANGUAGE lang TO x, y; GRANT CREATE ON SCHEMA s TO x, y; GRANT USAGE ON SCHEMA s TO x, y; GRANT CREATE ON TABLESPACE tblspc TO x, y; GRANT role1 to role2; REVOKE SELECT,INSERT,UPDATE,DELETE,RULE,REFERENCES,TRIGGER on t1, t2 FROM x, y; REVOKE SELECT,INSERT,UPDATE,DELETE,RULE,REFERENCES,TRIGGER on t1, t2 FROM x, y CASCADE; REVOKE SELECT,INSERT,UPDATE,DELETE,RULE,REFERENCES,TRIGGER on t1, t2 FROM x, y RESTRICT; REVOKE ALL on t1, t2 FROM x, y; REVOKE ALL on t1, t2 FROM PUBLIC; REVOKE GRANT OPTION FOR ALL on t1, t2 FROM PUBLIC; REVOKE GRANT OPTION FOR CREATE on DATABASE db1,db2 FROM x,y; REVOKE CREATE on DATABASE db1,db2 FROM x,y; REVOKE TEMPORARY on DATABASE db1,db2 FROM x,y; REVOKE TEMP on DATABASE db1,db2 FROM x,y; REVOKE EXECUTE on FUNCTION foo(int,text) db1,db2 FROM x,y; REVOKE USAGE ON LANGUAGE lang FROM x,y; REVOKE CREATE ON SCHEMA s1,s2 FROM x,y; REVOKE USAGE ON SCHEMA s1,s2 FROM x,y; REVOKE CREATE ON TABLESPACE tblspc FROM x,y; REVOKE ADMIN OPTION FOR role1, role2 FROM x,y; REVOKE role1, role2 FROM x,y; pgpool-II-4.1.4/src/test/parser/input/scanner.sql0000664000175000017500000000155313730350075016624 00000000000000\pset standard_conforming_strings off SELECT '\''; SELECT ''''; SELECT 'A\nBC'; SELECT E'A\nBC'; SELECT U&'d\0061t\+000061'; --error \pset standard_conforming_strings on SELECT '\''; -- error SELECT ''''; SELECT 'A\nBC'; SELECT E'A\nBC'; \pset server_encoding SQL_ASCII # unicode ident SELECT * FROM U&"d\0061t\+000061"; # unicode literal SELECT E'd\u0061t\U00000061'; SELECT U&'d\0061t\+000061'; SELECT U&'d!0061t!+000061' UESCAPE '!'; SELECT E'\u3042\u3044\u3046\u3048\u304a'; -- error SELECT U&'\3042\3044\3046\3048\304a'; -- error \pset server_encoding UTF8 # unicode ident SELECT * FROM U&"d\0061t\+000061"; # unicode literal SELECT E'd\u0061t\U00000061'; SELECT U&'d\0061t\+000061'; SELECT U&'d!0061t!+000061' UESCAPE '!'; SELECT E'\u3042\u3044\u3046\u3048\u304a'; SELECT U&'\3042\3044\3046\3048\304a'; # surrogate pair SELECT E'\ud800\udc00'; SELECT U&'\d800\dc00'; pgpool-II-4.1.4/src/test/parser/input/select.sql0000664000175000017500000000675013730350075016456 00000000000000SELECT 1; SELECT * FROM t; SELECT x FROM a; SELECT x.y FROM a; SELECT x FROM a.b; SeLeCt foo(); SELECT y FROM foo(); SELECT * FROM (SELECT * FROM foo); select a as t from x; SELECT x FROM a as b; SELECT a as tttttttttttttttttttttttttttttttttttttttttttttttttttttttt, b as uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu from zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz; SELECT ; SELECT * FROM t FOR UPDATE SELECT * FROM t FOR SHARE SELECT distinct * FROM t select distinct on (x) x from t; select distinct on (foo(x)) x from t; SELECT ALL * FROM t; SELECT x FROM t WHERE x > 3; SELECT count(*) FROM t GROUP BY x HAVING x > 111; SELECT count(*) FROM t GROUP BY x HAVING x > 111 ORDER BY y; SELECT count(*) FROM t GROUP BY x HAVING x > 111 ORDER BY y DESC; SELECT count(*) FROM t GROUP BY x HAVING x > 111 ORDER BY y ASC; SELECT x FROM t LIMIT ALL; SELECT x FROM t LIMIT 1; SELECT * from t offset 1; SELECT * from t limit 2 offset 1; SELECT * from t offset 1 limit 2; SELECT * FROM t left outer join t1 on (x = y); SELECT * FROM t right outer join t1 on (x = y); SELECT * FROM t full outer join t1 on (x = y); SELECT * FROM t left outer join t1 using (x); SELECT * FROM t right outer join t1 using (x); SELECT * FROM t full outer join t1 using (x); SELECT * FROM t inner join t1 on x; SELECT * FROM t natural left outer join t1; SELECT * FROM t natural right outer join t1; SELECT * FROM t natural full outer join t1; select * from t where a IS NULL select * from t where a IS NOT NULL select * from t where a like 'abc'; select * from t where a not like 'abc'; SELECT * FROM t where a between 1 and 4; SELECT * FROM t where a In (1,2,3,4); SELECT * FROM t where a not In (1,2,3,4); SELECT * FROM t WHERE EXISTS (select * from tt); SELECT * FROM t WHERE NOT EXISTS (select * from tt); (SELECT * FROM t1) UNION (SELECT * FROM t2); (SELECT * FROM t1) UNION ALL (SELECT * FROM t2); (SELECT * FROM t1) INTERSECT (SELECT * FROM t2); (SELECT * FROM t1) INTERSECT ALL (SELECT * FROM t2); (SELECT * FROM t1) EXCEPT (SELECT * FROM t2); (SELECT * FROM t1) EXCEPT ALL (SELECT * FROM t2); SELECT * INTO x FROM t; select * from t1 where i <> ALL (select i from t2); SELECT * FROM t1 UNION ALL SELECT * FROM t2 ORDER BY a; SELECT * FROM t1 UNION ALL (SELECT * FROM t2 ORDER BY a); select max(i)::int from test select max(i)::int from test where a = 'aaa''bbb\\ccc' select max(i)::int from test where a = 'aaa\'bbb\\ccc' SELECT * FROM t WHERE 1 = any(arr) SELECT * FROM t WHERE 1 = all(arr) SELECT * FROM t WHERE 1 IS OF (int) SELECT * FROM t WHERE 1 IS NOT OF (int) SELECT * FROM t WHERE a IN ('a','b',1); SELECT * FROM t WHERE a NOT IN ('a','b',1); SELECT * FROM t WHERE a IS DOCUMENT; SELECT * FROM t WHERE a IS NOT DOCUMENT; SELECT XMLCONCAT(a,b); SELECT XMLELEMENT(NAME a); SELECT XMLELEMENT(NAME a,b,c); SELECT XMLFOREST(a) SELECT XMLPARSE(DOCUMENT 1 STRIP WHITESPACE) SELECT XMLPARSE(DOCUMENT 1 PRESERVE WHITESPACE) SELECT day '1900-1-1' SELECT interval '1 year' SELECT interval '1 year' YEAR SELECT interval '1 year' MONTH SELECT interval '1 year' DAY SELECT interval '1 year' HOUR SELECT interval '1 year' MINUTE SELECT interval '1 year' SECOND SELECT interval '1 year' YEAR TO MONTH SELECT interval '1 year' DAY TO HOUR SELECT interval '1 year' DAY TO MINUTE SELECT interval '1 year' DAY TO SECOND SELECT interval '1 year' HOUR TO MINUTE SELECT interval '1 year' HOUR TO SECOND VALUES (1, 2), (3, 4), (5, 6); pgpool-II-4.1.4/src/test/parser/input/transaction.sql0000664000175000017500000000201313730350075017510 00000000000000BEGIN; BEGIN WORK; BEGIN TRANSACTION; BEGIN ISOLATION LEVEL READ COMMITTED; BEGIN ISOLATION LEVEL SERIALIZABLE; BEGIN READ WRITE; BEGIN READ ONLY; START TRANSACTION; COMMIT; COMMIT WORK; COMMIT TRANSACTION; END; END WORK; END TRANSACTION; ROLLBACK; ROLLBACK WORK; ROLLBACK TRANSACTION; ABORT; ABORT WORK; ABORT TRANSACTION; SET TRANSACTION ISOLATION LEVEL READ COMMITTED; SET TRANSACTION ISOLATION LEVEL SERIALIZABLE; SET SESSION CHARACTERISTICS AS TRANSACTION ISOLATION LEVEL READ COMMITTED; SET SESSION CHARACTERISTICS AS TRANSACTION ISOLATION LEVEL SERIALIZABLE; SET CONSTRAINTS ALL DEFERRED; SET CONSTRAINTS ALL IMMEDIATE; SET CONSTRAINTS x DEFERRED; SET CONSTRAINTS x IMMEDIATE; LOCK TABLE t1,t2; LOCK t1,t2; LOCK TABLE t1,t2 IN ACCESS SHARE MODE; LOCK TABLE t1,t2 IN ROW SHARE MODE; LOCK TABLE t1,t2 IN ROW EXCLUSIVE MODE; LOCK TABLE t1,t2 IN SHARE UPDATE EXCLUSIVE MODE; LOCK TABLE t1,t2 IN SHARE MODE; LOCK TABLE t1,t2 IN SHARE ROW EXCLUSIVE MODE; LOCK TABLE t1,t2 IN EXCLUSIVE MODE; LOCK TABLE t1,t2 IN ACCESS EXCLUSIVE MODE; pgpool-II-4.1.4/src/test/parser/input/update.sql0000664000175000017500000000061313730350075016451 00000000000000UPDATE t set a = 1; UPDATE t set a = 3, b = 'a', c = NULL, d = DEFAULT; UPDATE t set a = 1 FROM x; UPDATE t set a = 1 FROM x,y,z; UPDATE t set a = 1 FROM x where x < 100 and y > 200; UPDATE ONLY t set a = 1; UPDATE foo SET a = 1 RETURNING *; UPDATE foo SET a = 1 RETURNING a; UPDATE foo SET a = 1 RETURNING a,b; UPDATE foo SET a = 1 WHERE CURRENT OF $1 UPDATE foo SET a = 1 WHERE CURRENT OF cur pgpool-II-4.1.4/src/test/parser/input/v84.sql0000664000175000017500000000304313730350075015610 00000000000000SELECT INTERVAL(0) '1.23' SECOND; SELECT INTERVAL '1 year' HOUR TO SECOND(2) SELECT char 'ABC'; SELECT "char" 'ABC'; SELECT avg(c1) OVER (PARTITION BY depname RANGE UNBOUNDED PRECEDING) FROM r1; SELECT avg(c1) OVER (PARTITION BY depname ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) FROM r1; SELECT sum(c1) OVER w1 FROM r1 WINDOW w1 AS (PARTITION BY c2 ORDER BY c3), w2 AS (w1 PARTITION BY c4); WITH w1(n) AS (SELECT 1), w2(n) AS (SELECT 2) SELECT sum(n) FROM r1; WITH RECURSIVE t(n) AS (VALUES (1) UNION ALL SELECT n+1 FROM t WHERE n < 100) SELECT sum(n) FROM t; ALTER AGGREGATE FOO(int) OWNER TO BAR; ALTER CONVERSION FOO OWNER TO BAR; ALTER DATABASE FOO OWNER TO BAR; ALTER DOMAIN FOO OWNER TO BAR; ALTER FUNCTION FOO() OWNER TO BAR; ALTER LANGUAGE FOO OWNER TO BAR; ALTER OPERATOR + (int, int) OWNER TO BAR; ALTER OPERATOR CLASS FOO USING BAZ OWNER TO BAR; ALTER OPERATOR FAMILY FOO USING BAZ OWNER TO BAR; ALTER TYPE FOO OWNER TO BAR; ALTER TABLESPACE FOO OWNER TO BAR; ALTER TEXT SEARCH DICTIONARY FOO OWNER TO BAR; ALTER TEXT SEARCH CONFIGURATION FOO OWNER TO BAR; ALTER FOREIGN DATA WRAPPER FOO OWNER TO BAR; ALTER SERVER FOO OWNER TO BAR; ALTER SCHEMA FOO OWNER TO BAR; LISTEN x NOTIFY x UNLISTEN x UNLISTEN * CREATE TRIGGER t1 BEFORE INSERT OR UPDATE OR DELETE OR TRUNCATE ON r1 EXECUTE PROCEDURE p1(); GRANT ALL ON r1 TO PUBLIC; GRANT ALL ON SEQUENCE r1 TO PUBLIC; GRANT ALL ON FUNCTION r1() TO PUBLIC; GRANT ALL ON DATABASE r1 TO PUBLIC; GRANT ALL ON LANGUAGE r1 TO PUBLIC; GRANT ALL ON SCHEMA r1 TO PUBLIC; GRANT ALL ON TABLESPACE r1 TO PUBLIC; pgpool-II-4.1.4/src/test/parser/input/v90.sql0000664000175000017500000000250013730350075015602 00000000000000# named parameter SELECT func(a := 7, b := 12); # order by aggrigator SELECT array_agg(a ORDER BY b, c); # variadic from html/xfunc-sql.html SELECT mleast(VARIADIC ARRAY[10, -1, 5, 4.4]); # window function SELECT avg(c1) OVER (ROWS 1 PRECEDING) FROM r1; SELECT avg(c1) OVER w1 FROM r1 WINDOW w1 AS (ROWS BETWEEN 1 FOLLOWING AND 2 FOLLOWING); # offset SELECT * FROM t1 OFFSET 1 ROWS FETCH FIRST 2 ROWS ONLY; SELECT * FROM t1 FETCH NEXT 2 ROWS ONLY; # DO DO LANGUAGE PLPGSQL $$BEGIN RAISE NOTICE 'hello'; END$$; \pset server_version 9.0.0 # explain # old syntax EXPLAIN ANALYZE VERBOSE SELECT 1; # new syntax EXPLAIN (ANALYZE true,VERBOSE true,COSTS true,BUFFERS true,FORMAT XML) SELECT 1; EXPLAIN (ANALYZE false,VERBOSE false,COSTS false,BUFFERS false,FORMAT JSON) SELECT 1; # copy # old syntax COPY t FROM stdin; COPY t FROM 'xxx' BINARY; COPY t FROM 'xxx' CSV HEADER QUOTE AS '#' ESCAPE AS '$' FORCE NOT NULL foo,bar; COPY t FROM 'xxx' OIDS; COPY t FROM 'xxx' DELIMITER ','; COPY t FROM 'xxx' NULL 'x'; # new syntax COPY t FROM stdin (FORMAT 'text'); COPY t FROM stdin (FORMAT 'csv'); COPY t FROM stdin (FORMAT 'binary'); COPY t FROM 'f' (OIDS false); COPY t FROM 'f' (OIDS true, DELIMITER '|', NULL '', HEADER false); COPY t FROM 'f' (HEADER true, QUOTE '"', ESCAPE '@'); COPY t FROM 'f' (FORCE_QUOTE *, FORCE_NOT_NULL(one, two, three)); pgpool-II-4.1.4/src/test/parser/input/var.sql0000664000175000017500000000063513730350075015763 00000000000000SET var TO val SET var TO 'val' SET var TO DEFAULT SET var = DEFAULT SET TIME ZONE val SET TIME ZONE 'val' SET TIME ZONE local SET TIME ZONE default SET local TIME ZONE default SET session TIME ZONE default SET var FROM CURRENT SET XML OPTION DOCUMENT SET XML OPTION CONTENT show 'x'; show x; show all; reset x; reset all; reset time zone; reset transaction isolation level reset session authorization reset 'x'; pgpool-II-4.1.4/src/test/parser/.cvsignore0000664000175000017500000000006313730350075015306 00000000000000gram.c parse.h parser-test scan.c test.diff result pgpool-II-4.1.4/src/test/parser/Makefile0000664000175000017500000000417613730350075014757 00000000000000# $Header$ PROGRAM=parser-test PGPOOL_SRC=../../../src/parser PARSER_INCLUDES=../../../src/include/parser PARSER_OBJS=gram.o parser.o pool_string.o list.o makefuncs.o value.o nodes.o pool_memory.o main.o keywords.o outfuncs.o copyfuncs.o kwlookup.o scansup.o wchar.o #ENABLE_GCOV=1 CFLAGS=-Wall -c -g -include pool.h -I. -I $(PARSER_INCLUDES) CFLAGS+=-O0 -g -DPARSER_TEST LDFLAGS= ifdef ENABLE_GCOV CFLAGS+= -fprofile-arcs -ftest-coverage LDFLAGS+= -lgcov GENHTML_OUTDIR=genhtml endif all: $(PROGRAM) .SUFFIXES: .SUFFIXES: .o .c .c.o: gcc $(CFLAGS) $< $(PROGRAM): $(PARSER_OBJS) gcc $(PARSER_OBJS) -o $(PROGRAM) $(LDFLAGS) main.o: main.c keywords.o: $(PGPOOL_SRC)/keywords.c gcc $(CFLAGS) $< outfuncs.o: $(PGPOOL_SRC)/outfuncs.c gcc $(CFLAGS) $< gram.o: gram.c scan.c gcc $(CFLAGS) $< gram.c: $(PGPOOL_SRC)/gram.y scan.c bison -d $(PGPOOL_SRC)/gram.y ifdef ENABLE_GCOV cp gram.tab.c gram.c cp gram.tab.h gram.h else mv -f gram.tab.c gram.c mv -f gram.tab.h gram.h endif pool_string.o : $(PGPOOL_SRC)/pool_string.c $(PARSER_INCLUDES)/pool_string.h gcc $(CFLAGS) $< parser.o : $(PGPOOL_SRC)/parser.c gcc $(CFLAGS) $< list.o : $(PGPOOL_SRC)/list.c gcc $(CFLAGS) $< makefuncs.o : $(PGPOOL_SRC)/makefuncs.c gcc $(CFLAGS) $< value.o : $(PGPOOL_SRC)/value.c gcc $(CFLAGS) $< nodes.o : $(PGPOOL_SRC)/nodes.c gcc $(CFLAGS) $< scansup.o : $(PGPOOL_SRC)/scansup.c gcc $(CFLAGS) $< scan.c : $(PGPOOL_SRC)/scan.l flex -o$@ $< pool_memory.o: $(PGPOOL_SRC)/pool_memory.c $(PARSER_INCLUDES)/pool_memory.h gcc $(CFLAGS) $< copyfuncs.o: $(PGPOOL_SRC)/copyfuncs.c gcc $(CFLAGS) $< kwlookup.o: $(PGPOOL_SRC)/kwlookup.c gcc $(CFLAGS) $< wchar.o: $(PGPOOL_SRC)/wchar.c gcc $(CFLAGS) $< test: $(PROGRAM) ./run-test parse_schedule cov: test -d $(GENHTML_OUTDIR) || mkdir $(GENHTML_OUTDIR) lcov --directory . --capture --output-file $(PROGRAM).info genhtml -o $(GENHTML_OUTDIR) -f $(PROGRAM).info clean-cov: ifdef ENABLE_GCOV rm -f *.gcda *.gcno rm -f parser-test.info rm -rf $(GENHTML_OUTDIR) endif clean: clean-cov rm -f $(PROGRAM) rm -f *.o rm -f gram.c scan.c gram.h rm -f gram.tab.c gram.tab.h .PHONY: all test clean-cov clean cov pgpool-II-4.1.4/src/test/parser/README0000664000175000017500000000113113730350075014163 00000000000000$Header$ 1. Parser test program 1.1 How to build Parser test program builds with the following command. % make "parser-test" file is created. 1.2 Running program You passes a SQL statement to parser-test. If the program accepts the statement, it outputs SQL generated from a parse tree. % ./parser-test "select 1" SELECT 1 If the program does not accept, it outputs an error. % ./parser-test "aaa" syntax error: aaa 2. Testing 2.1 How to test You types the following command. % make test If test is failed, you should check test.diff. Then please send test.diff to developers. pgpool-II-4.1.4/src/test/parser/main.c0000664000175000017500000000322013730350075014374 00000000000000/* $Header$ */ #include "pool.h" #include "pool_memory.h" #include "parsenodes.h" #include "gramparse.h" #include "parser.h" #include #include #include enum { TEST_CONTINUE, TEST_QUIT }; extern int GetDatabaseEncoding(void); int command(const char *cmd) { char name[1024], value[1024]; if (*cmd == 'q') return TEST_QUIT; if (sscanf(cmd, "pset %s %s", name, value) == 2) { if (strcmp(name, "standard_conforming_strings") == 0) { parser_set_param(name, value); fprintf(stdout, "pset %d\n", standard_conforming_strings); } else if (strcmp(name, "server_version") == 0) { parser_set_param(name, value); fprintf(stdout, "pset %d\n", server_version_num); } else if (strcmp(name, "server_encoding") == 0) { parser_set_param(name, value); fprintf(stdout, "pset %d\n", GetDatabaseEncoding()); } else fprintf(stdout, "ERROR: pset %s\n", name); } return TEST_CONTINUE; } int main(int argc, char **argv) { List *tree; ListCell *l; int state = TEST_CONTINUE; int notty = (!isatty(fileno(stdin)) || !isatty(fileno(stdout))); char line[1024]; while (state != TEST_QUIT) { if (!notty) fprintf(stdout, "> "); if (!fgets(line, 1024, stdin)) break; *(strchr(line, (int) '\n')) = '\0'; if (line[0] == '#' || line[0] == '\0') continue; if (line[0] == '\\') { state = command(line + 1); continue; } tree = raw_parser(line); if (tree == NULL) { printf("syntax error: %s\n", line); } else { foreach(l, tree) { Node *node = (Node *) lfirst(l); printf("%s\n", nodeToString(node)); } } free_parser(); } return 0; } pgpool-II-4.1.4/src/test/parser/pool.h0000664000175000017500000000020113730350075014422 00000000000000#ifndef POOL_H #define POOL_H #include #include #define pool_error printf #define child_exit exit #endif pgpool-II-4.1.4/src/test/parser/run-test0000664000175000017500000000224213730350075015013 00000000000000#! /usr/bin/env ruby # $Header$ # # Usage./run-test schedule # ignore a line at the beginning of '#' # INPUT_DIRECTORY="input" EXPECTED_DIRECTORY="expected" RESULT_DIRECTORY="result" TEST_PROGRAM="./parser-test" DIFF_FILE="test.diff" if ARGV.size != 1 STDERR.puts "run-test schedule_file" exit 1 end file = ARGV.shift if !(File.exists? file) STDERR.puts "run-test: file does not exist: #{file}" exit 1 end if !(File.exists? RESULT_DIRECTORY) Dir.mkdir RESULT_DIRECTORY else Dir["#{RESULT_DIRECTORY}/*.out"].each do |f| File.unlink f end end File.unlink DIFF_FILE if File.exists? DIFF_FILE begin IO.foreach(file) do |testcase| testcase.chomp! if (/^\#/ =~ testcase or testcase == "") next end print "testcase #{testcase}:\t" begin system("#{TEST_PROGRAM} < #{INPUT_DIRECTORY}/#{testcase}.sql > #{RESULT_DIRECTORY}/#{testcase}.out\n") system("diff -c #{EXPECTED_DIRECTORY}/#{testcase}.out #{RESULT_DIRECTORY}/#{testcase}.out >> #{DIFF_FILE}") if ($? == 0) print "OK\n" else print "FAILED\n" end rescue print "FAILED\n" end end rescue STDERR.puts "NG" end pgpool-II-4.1.4/src/test/parser/parse_schedule0000664000175000017500000000015413730350075016220 00000000000000select insert update delete misc var copy privileges transaction cursor prepare create drop scanner v84 v90 pgpool-II-4.1.4/src/test/pdo-test/0000775000175000017500000000000013730350746013637 500000000000000pgpool-II-4.1.4/src/test/pdo-test/SQLlist/0000775000175000017500000000000013730350746015172 500000000000000pgpool-II-4.1.4/src/test/pdo-test/SQLlist/test1.sql0000664000175000017500000000002613730350075016664 00000000000000BEGIN; SELECT 1; END; pgpool-II-4.1.4/src/test/pdo-test/SQLlist/test2.sql0000664000175000017500000000002613730350075016665 00000000000000BEGIN; select 2; END; pgpool-II-4.1.4/src/test/pdo-test/mod/0000775000175000017500000000000013730350746014416 500000000000000pgpool-II-4.1.4/src/test/pdo-test/mod/database.inc0000664000175000017500000000144313730350075016572 00000000000000 setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);; return $dbh; } catch (Exception $e) { echo "fail : " .$e->getMessage()."
"; ErrorResult($php_errormsg); return NULL; } } function trans_end($dbh,$trans) { try { $stmt = $dbh->prepare($trans); $stmt->execute(); print_r($stmt->fetch()); } catch (Exception $e) { ErrorResult($php_errormsg); } } function ErrorResult($php_errormsg) { header('HTTP/1.0 402 SQL ERROR'); require_once("errorhandler.inc"); set_error_handler("userErrorHandler"); trigger_error($php_errormsg, E_USER_ERROR); exit; } ?> pgpool-II-4.1.4/src/test/pdo-test/mod/errorhandler.inc0000664000175000017500000000147013730350075017515 00000000000000 "Error", 2 => "Warning", 4 => "Parsing Error", 8 => "Notice", 16 => "Core Error", 32 => "Core Warning", 64 => "Compile Error", 128 => "Compile Warning", 256 => "User Error", 512 => "User Warning", 1024=> "User Notice" ); $err = $dt." "; $err .= $errortype[$error]." "; $err .= $errmsg." "; $err .= $filename." "; $err .= $linenum."\n"; $filename='log.txt'; $handle = fopen($filename, 'a'); fwrite($handle, $err); fclose($handle); } ?> pgpool-II-4.1.4/src/test/pdo-test/README.euc_jp0000664000175000017500000000314013730350075015674 00000000000000pdo-test README -pdo-testȤ? pdo-testphp PDOɥ饤ФѤpgpoolΥƥȤԤץ Ǥ pdo-testab(Apache HTTP server benchmarking tool)ȤƥȤ ޤ ºݤμ¹ϰʲ̤Ǥ abc 10 -n 100 "http://localhost/pdo-test/pdotest.php" PDOɥ饤ФpgpoolȤ³def.incեԽޤ def.incƤϰʲ̤Ǥ ¹Ԥ륯SQLListǥ쥯ȥΥե뤫 ¹Ԥޤ եˤ;(ߥ)ڤʣSQL򵭽ҤƤ ޤΥեΤ߼¹ԤˤϡʲΤ褦˼¹ ޤ http://localhost/pdo-test/pdotest.php?query=ե̾ PHPϤ륨顼log.txt˽Ϥޤ SQL٥Υ顼ˤĤƤabμ¹Է̤ʬ褦ˤʤäƤޤ ʲ顼ȯabμ¹Է̤Ǥ Non-2xx responsesɽ줿ˤϲDB˥顼ȯ ǽΤǡlog.txtDBΥǧƤ oncurrency Level: 10 Time taken for tests: 7.721773 seconds Complete requests: 100 Failed requests: 0 Write errors: 0 Non-2xx responses: 100 Total transferred: 25100 bytes HTML transferred: 5300 bytes Requests per second: 12.95 [#/sec] (mean) Time per request: 772.177 [ms] (mean) Time per request: 77.218 [ms] (mean, across all concurrent requests) Transfer rate: 3.11 [Kbytes/sec] received pgpool-II-4.1.4/src/test/pdo-test/collections.inc0000664000175000017500000000040113730350075016556 00000000000000"; } return $result; } ?> pgpool-II-4.1.4/src/test/pdo-test/def.inc0000664000175000017500000000022213730350075014777 00000000000000 pgpool-II-4.1.4/src/test/pdo-test/pdotest.php0000664000175000017500000000033113730350075015742 00000000000000 pgpool-II-4.1.4/src/test/pdo-test/regsql.inc0000664000175000017500000000171613730350075015547 00000000000000"; trans_end($con,$sql); } } ?> pgpool-II-4.1.4/src/test/pgpool_setup.in0000775000175000017500000010400613730350127015065 00000000000000#!/usr/bin/env bash # # Copyright (c) 2013-2020 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. #------------------------------------------------------------------- # Set up pgpool-II and PostgreSQL temporary installation in current # directory for *testing* purpose. # Do not use this tool for production environment! # # usage: pgpool_setup [-m r|s|n|l][-n num_clusters][-p base_port][-pg pg_base_port][--no-stop][-d][-s][-r] # -m s: create an installation as streaming replication mode. # (the default) # -m r: create an installation as native replication mode. # -m n: create an installation as raw mode. # -m l: create an installation as logical replication mode. # -m y: create an installation as slony mode. # -n num_clusters: create num_clusters PostgreSQL database cluster nodes # -p base_port: specify base port. pgpool port is base_port. # pcp port is base_port + 1. The first PostgreSQL node's port is # base_port + 2, second PostgreSQL node's port is base_port + 3 # and so on. # if -pg option is specified, the first PostgreSQL node's port is # assigned to pg_pase_port, the second PostgreSQL node's port is # pg_base_port + 1 and so on. # --no-stop: do not stop pgpool and PostgreSQL after the work # -d: start pgpool with debug mode # -s: use replication slot, rather than wal archive. # -r: use pg_rewind for base backup if possible. # # The user run this script will become the PostgreSQL super user as # well. Current directory must be empty. Assume that appropreate # pgpool and PostgreSQL binaries are in the command search path. # The user must have passwordless access to localhost over SSH. # # Rayout after executing this script: # data[0-]: PostgreSQL database clusters # log: pgpool.log and pgpool_status resides here # run: pgpool-II pid file resides here(generated by pgpool-II) # etc/pgpool.conf: pgpool-II configuration file # etc/pool_passwd: generated by pgpool-II # ./startall: a script to start pgpool-II and all PostgreSQL servers # ./shutdownall: a script to shutdown pgpool-II and all PostgreSQL servers # # test database "test" is created. # pcp username and password is set to the person who executed this script. # #------------------------------------------- # Configuration section #------------------------------------------- # Starting port number to be used. Each PostgreSQL is assigned # $BASEPORT + 2, $BASEPORT + 3 and so on. # pgpool port and pcp_port will be assigned to $BASEPORT and $BASEPORT +1 . BASEPORT=${BASEBOPRT:-"11000"} ORIGBASEPORT=$BASEPORT # PostgreSQL startig port number. PGBASEPORT=`expr $BASEPORT + 2` # Default number of PostgreSQL database clusters NUMCLUSTERS=${NUMCLUSTERS:-"2"} # Where to look for pgpool.conf.sample* PGPOOL_INSTALL_DIR=${PGPOOL_INSTALL_DIR:-"@@PGPOOL_INSTALL_DIR@@"} PGPOOLDIR=${PGPOOLDIR:-"@@PGPOOL_CONFIG_DIR@@"} # PostgreSQL commands(initdb, pg_ctl, psql) install dir PGBIN=${PGBIN:-"@@PGSQL_BIN_DIR@@"} # LD_LIBRARY_PATH LPATH=${PGLIB:-"@@PGSQL_LIB_DIR@@"} # unix socket directory PGSOCKET_DIR=${PGSOCKET_DIR:-"/tmp"} # initdb args INITDBARG="--no-locale -E UTF_8" # Use replication slot USE_REPLICATION_SLOT=${USE_REPLICATION_SLOT:-"false"} # Use pg_rewind USE_PG_REWIND=${USE_PG_REWIND:-"false"} # Check TIME_WAIT in shutdownall script CHECK_TIME_WAIT=${CHECK_TIME_WAIT:-"false"} #------------------------------------------- # End of configuration section #------------------------------------------- # # user name WHOAMI=`whoami` # our root directory BASEDIR=`pwd` # PostgreSQL bin directory INITDB=$PGBIN/initdb PG_CTL=$PGBIN/pg_ctl PSQL=$PGBIN/psql # get PostgreSQL major version vstr=`$INITDB -V|awk '{print $3}'|sed 's/\./ /g'` #vstr="12beta1" #vstr="9.1.24" #vstr="11.1" # check if alpha or beta echo $vstr|egrep "[a-z]" > /dev/null if [ $? = 0 ];then vstr=`echo $vstr|sed 's/\([0-9]*\).*/\1/'` major1=`echo $vstr|awk '{print $1}'` major2=`echo $vstr|awk '{print $2}'` if [ -z $major2 ];then major2=0 fi else vstr=`echo $vstr|sed 's/\./ /g'` major1=`echo $vstr|awk '{print $1}'` major2=`echo $vstr|awk '{print $2}'` fi major1=`expr $major1 \* 10` PGVERSION=`expr $major1 + $major2` echo PostgreSQL major version: $PGVERSION if [ $PGVERSION -gt 91 ];then INITDBARG="$INITDBARG --data-checksums" fi # pgpool-II configuration file localtion. CONF=$BASEDIR/etc/pgpool.conf # failover script FAILOVER_SCRIPT=$BASEDIR/etc/failover.sh # follow master script FOLLOW_MASTER_SCRIPT=$BASEDIR/etc/follow_master.sh # pgpool_remote_start PGPOOL_REMOTE_START_SCRIPT=pgpool_remote_start # Start script name. This will be generated in this script. STARTALL=$BASEDIR/startall # Shutdown script name. This will be generated in this script. SHUTDOWNALL=$BASEDIR/shutdownall PCP_PASS_FILE=$BASEDIR/pcppass # pgpool reload script name. This will be generated in this script. PGPOOL_RELOAD=$BASEDIR/pgpool_reload export PGHOST=$PGSOCKET_DIR #------------------------------------------- # create failover script #------------------------------------------- function create_failover_script() { cat >> $FAILOVER_SCRIPT <<'EOF' #! /bin/sh # Execute command by failover. # special values: %d = node id # %h = host name # %p = port number # %D = database cluster path # %m = new master node id # %M = old master node id # %H = new master node host name # %P = old primary node id # %R = new master database cluster path # %r = new master port number # %% = '%' character failed_node_id=$1 failed_host_name=$2 failed_port=$3 failed_db_cluster=$4 new_master_id=$5 old_master_id=$6 new_master_host_name=$7 old_primary_node_id=$8 new_master_port_number=$9 new_master_db_cluster=${10} mydir=__MYDIR__ log=$mydir/log/failover.log pg_ctl=__PGBIN__/pg_ctl cluster0=$mydir/data0 cluster1=$mydir/data1 date >> $log echo "failed_node_id $failed_node_id failed_host_name $failed_host_name failed_port $failed_port failed_db_cluster $failed_db_cluster new_master_id $new_master_id old_master_id $old_master_id new_master_host_name $new_master_host_name old_primary_node_id $old_primary_node_id new_master_port_number $new_master_port_number new_master_db_cluster $new_master_db_cluster" >> $log if [ a"$failed_node_id" = a"$old_primary_node_id" ];then # master failed ! new_primary_db_cluster=${mydir}/data"$new_master_id" echo $pg_ctl -D $new_primary_db_cluster promote >>$log # let standby take over $pg_ctl -D $new_primary_db_cluster promote >>$log # let standby take over sleep 2 fi EOF #------------------------------------------- # replace some variables in the script #------------------------------------------- /bin/sed -i \ -e "/__MYDIR__/s@__MYDIR__@$BASEDIR@" \ -e "/__PGBIN__/s@__PGBIN__@$PGBIN@" \ $FAILOVER_SCRIPT chmod 755 $FAILOVER_SCRIPT } #------------------------------------------- # create follow master script #------------------------------------------- function create_follow_master_script() { cat >> $FOLLOW_MASTER_SCRIPT <<'EOF' #! /bin/sh # Execute command by failover. # special values: %d = node id # %h = host name # %p = port number # %D = database cluster path # %m = new master node id # %M = old master node id # %H = new master node host name # %P = old primary node id # %R = new master database cluster path # %r = new master port number # %% = '%' character failed_node_id=$1 failed_host_name=$2 failed_port=$3 failed_db_cluster=$4 new_master_id=$5 old_master_id=$6 new_master_host_name=$7 old_primary_node_id=$8 new_master_port_number=$9 new_master_db_cluster=${10} mydir=__MYDIR__ log=$mydir/log/failover.log pg_ctl=__PGBIN__/pg_ctl cluster0=$mydir/data0 cluster1=$mydir/data1 cluster2=$mydir/data2 PCP_PORT=__PCPPORT__ export PCPPASSFILE=__PCPPASSFILE__ date >> $log echo "failed_node_id $failed_node_id failed_host_name $failed_host_name failed_port $failed_port failed_db_cluster $failed_db_cluster new_master_id $new_master_id old_master_id $old_master_id new_master_host_name $new_master_host_name old_primary_node_id $old_primary_node_id new_master_port_number $new_master_port_number new_master_db_cluster $new_master_db_cluster" >> $log # Stop standby node if it's running $pg_ctl -D $failed_db_cluster status >/dev/null 2>&1 if [ $? = 0 ] then $pg_ctl -w -m f -D $failed_db_cluster stop >> $log 2>&1 sleep 10 # recovery the node pcp_recovery_node -w -h localhost -p $PCP_PORT -n $failed_node_id >> $log 2>&1 else echo "$failed_db_cluster is not running. skipping follow master command." >> $log fi EOF #------------------------------------------- # replace some variables in the script #------------------------------------------- /bin/sed -i \ -e "/__MYDIR__/s@__MYDIR__@$BASEDIR@" \ -e "/__PGBIN__/s@__PGBIN__@$PGBIN@" \ -e "/__PCPPASSFILE__/s@__PCPPASSFILE__@$PCP_PASS_FILE@" \ -e "/__PCPPORT__/s/__PCPPORT__/$PCP_PORT/" \ $FOLLOW_MASTER_SCRIPT chmod 755 $FOLLOW_MASTER_SCRIPT } #------------------------------------------- # create pgpool_remote_start script # argument: PostgreSQL database cluster directory #------------------------------------------- function create_pgpool_remote_start_script() { cat >> $1/$PGPOOL_REMOTE_START_SCRIPT <<'EOF' #! /bin/sh # # start postmaster on the recoveried node # if [ $# -ne 2 ] then echo "pgpool_remote_start remote_host remote_datadir" exit 1 fi DEST=$1 DESTDIR=$2 PGCTL=__PGBIN__/pg_ctl ssh -T $DEST $PGCTL -w -D $DESTDIR start 2>/dev/null 1>/dev/null < /dev/null & EOF #------------------------------------------- # replace some variables in the script #------------------------------------------- /bin/sed -i \ -e "/__PGBIN__/s@__PGBIN__@$PGBIN@" \ $1/$PGPOOL_REMOTE_START_SCRIPT chmod 755 $1/$PGPOOL_REMOTE_START_SCRIPT } #------------------------------------------- # set postgresql.conf # argument: PostgreSQL database cluster directory #------------------------------------------- function set_postgresql_conf { PGCONF=$1/postgresql.conf PGHBACONF=$1/pg_hba.conf echo "listen_addresses = '*'" >> $PGCONF echo "port = $PORT" >> $PGCONF echo "logging_collector = on" >> $PGCONF echo "log_filename = '%A.log'" >> $PGCONF echo "log_line_prefix = '%p %t '" >> $PGCONF echo "log_truncate_on_rotation = on" >> $PGCONF echo "log_statement = 'all'" >> $PGCONF echo "max_prepared_transactions = 10" >> $PGCONF echo "unix_socket_directories = '$PGSOCKET_DIR'" >> $PGCONF if [ $PGVERSION -ge 120 ];then echo "include_if_exists = 'myrecovery.conf'" >> $PGCONF fi if [ $MODE = "s" ];then echo "hot_standby = on" >> $PGCONF echo "wal_level = hot_standby" >> $PGCONF echo "max_wal_senders = $NUMCLUSTERS" >> $PGCONF if [ $USE_REPLICATION_SLOT = "false" ];then echo "archive_mode = on" >> $PGCONF echo "archive_command = 'cp %p $BASEDIR/archivedir/%f > $PGCONF else num_slots=`expr $NUMCLUSTERS + 10` echo "max_replication_slots = $num_slots" >> $PGCONF fi elif [ $MODE = 'r' -o $MODE = 'l' -o $MODE = 'y' ];then echo "wal_level = archive" >> $PGCONF echo "archive_mode = on" >> $PGCONF echo "archive_command = 'cp %p $BASEDIR/archivedir/%f > $PGCONF if [ $MODE = 'l' ];then echo "wal_level = logical" >> $PGCONF fi fi sed -i '/host.*all.*all.*trust$/s/^/#/g' $PGHBACONF sed -i '/local.*all.*all.*trust$/s/^/#/g' $PGHBACONF if [ $PGVERSION -ge 100 ]; then echo "host all scram_user 0/0 scram-sha-256" >> $PGHBACONF echo "host all md5_user 0/0 md5" >> $PGHBACONF fi echo "host all all 0/0 trust" >> $PGHBACONF if [ $PGVERSION -ge 100 ]; then echo "local all scram_user scram-sha-256" >> $PGHBACONF echo "local all md5_user md5" >> $PGHBACONF fi echo "local all all trust" >> $PGHBACONF ed $1/pg_hba.conf <> $1/$SCRIPT <<'EOF' #! /bin/sh psql=__PGBIN__/psql pg_rewind=__PGBIN__/pg_rewind DATADIR_BASE=__DATADIR_BASE__ PGSUPERUSER=__PGSUPERUSER__ master_db_cluster=$1 recovery_node_host_name=$2 DEST_CLUSTER=$3 PORT=$4 recovery_node=$5 pg_rewind_failed="true" log=$DATADIR_BASE/log/recovery.log echo >> $log date >> $log EOF echo "export PGHOST=$PGSOCKET_DIR" >> $1/$SCRIPT pg_rewind_failed="true" if [ $USE_PG_REWIND = "true" ];then cat >> $1/$SCRIPT <<'EOF' # First try pg_rewind # Make backup copy of postgresql.conf since pg_rewind blindly copies # $master_db_cluster/postgresql.conf. cp $DEST_CLUSTER/postgresql.conf /tmp/ echo "pg_rewind starts" >> $log $pg_rewind -P -D $DEST_CLUSTER --source-server="port=$PORT user=$PGSUPERUSER dbname=postgres" >> $log 2>&1 if [ $? != 0 ];then # pg_rewind failed. Fallback to rsync. echo "pg_rewind failed. Fall back to rsync" >> $log pg_rewind_failed="true" else pg_rewind_failed="false" fi EOF fi cat >> $1/$SCRIPT <<'EOF' if [ $pg_rewind_failed = "true" ];then $psql -p $PORT -c "SELECT pg_start_backup('Streaming Replication', true)" postgres echo "source: $master_db_cluster dest: $DEST_CLUSTER" >> $log rsync -C -a -c --delete --exclude postgresql.conf --exclude postmaster.pid \ --exclude postmaster.opts --exclude pg_log \ --exclude recovery.conf --exclude recovery.done \ --exclude pg_xlog pg_wal \ $master_db_cluster/ $DEST_CLUSTER/ rm -fr $DEST_CLUSTER/pg_xlog mkdir $DEST_CLUSTER/pg_xlog chmod 700 $DEST_CLUSTER/pg_xlog rm -fr $DEST_CLUSTER/pg_wal mkdir $DEST_CLUSTER/pg_wal chmod 700 $DEST_CLUSTER/pg_wal rm $DEST_CLUSTER/recovery.done fi EOF if [ $USE_REPLICATION_SLOT = "true" ];then cat >> $1/$SCRIPT <<'EOF' $psql -p $PORT -c "SELECT * FROM pg_create_physical_replication_slot('pgpool_setup_slot$recovery_node')" postgres EOF fi if [ $PGVERSION -ge 120 ];then cat >> $1/$SCRIPT <<'EOF' cat > $DEST_CLUSTER/myrecovery.conf <> $1/$SCRIPT <<'EOF' cat > $DEST_CLUSTER/recovery.conf <> $1/$SCRIPT <<'EOF' restore_command = 'cp $DATADIR_BASE/archivedir/%f "%p" 2> /dev/null' REOF EOF else cat >> $1/$SCRIPT << 'EOF' primary_slot_name = 'pgpool_setup_slot$recovery_node' REOF EOF fi cat >> $1/$SCRIPT <<'EOF' if [ $pg_rewind_failed = "true" ];then $psql -p $PORT -c "SELECT pg_stop_backup()" postgres fi if [ $pg_rewind_failed = "false" ];then cp /tmp/postgresql.conf $DEST_CLUSTER/ fi touch $DEST_CLUSTER/standby.signal EOF #------------------------------------------- # replace some variables in the script #------------------------------------------- /bin/sed -i \ -e "/__PGBIN__/s@__PGBIN__@$PGBIN@" \ -e "/__DATADIR_BASE__/s@__DATADIR_BASE__@$BASEDIR@" \ -e "/__PGSUPERUSER__/s/__PGSUPERUSER__/$WHOAMI/" \ $1/$SCRIPT chmod 755 $1/$SCRIPT } #------------------------------------------- # create basebackup.sh for native replication mode # argument: PostgreSQL database cluster directory #------------------------------------------- function create_basebackup_replication { SCRIPT=basebackup.sh cat >> $1/$SCRIPT <<'EOF' #! /bin/sh psql=__PGBIN__/psql DATADIR_BASE=__DATADIR_BASE__ PGSUPERUSER=__PGSUPERUSER__ EOF echo "export PGHOST=$PGSOCKET_DIR" >> $1/$SCRIPT cat >> $1/$SCRIPT <<'EOF' master_db_cluster=$1 recovery_node_host_name=$2 DEST_CLUSTER=$3 PORT=$4 log=$DATADIR_BASE/log/recovery.log $psql -p $PORT -c "SELECT pg_start_backup('Native Replication', true)" postgres echo "source: $master_db_cluster dest: $DEST_CLUSTER" > $log EOF if [ $PGVERSION -ge 120 ];then cat >> $1/$SCRIPT <<'EOF' cat > $master_db_cluster/myrecovery.conf <> $1/$SCRIPT <<'EOF' cat > $master_db_cluster/recovery.conf <> $1/$SCRIPT <<'EOF' rsync -C -a -c --delete --exclude postgresql.conf --exclude postmaster.pid \ --exclude postmaster.opts --exclude pg_log \ --exclude recovery.done \ --exclude pg_xlog pg_wal \ $master_db_cluster/ $DEST_CLUSTER/ rm -fr $DEST_CLUSTER/pg_xlog mkdir $DEST_CLUSTER/pg_xlog chmod 700 $DEST_CLUSTER/pg_xlog rm -fr $DEST_CLUSTER/pg_wal mkdir $DEST_CLUSTER/pg_wal chmod 700 $DEST_CLUSTER/pg_wal EOF cat >> $1/$SCRIPT <<'EOF' $psql -p $PORT -c "SELECT pg_stop_backup()" postgres EOF if [ $PGVERSION -ge 120 ];then cat >> $1/$SCRIPT <<'EOF' touch $DEST_CLUSTER/recovery.signal EOF fi #------------------------------------------- # replace some variables in the script #------------------------------------------- /bin/sed -i \ -e "/__PGBIN__/s@__PGBIN__@$PGBIN@" \ -e "/__DATADIR_BASE__/s@__DATADIR_BASE__@$BASEDIR@" \ -e "/__PGSUPERUSER__/s/__PGSUPERUSER__/$WHOAMI/" \ -e "/__ARCHDIR__/s@__ARCHDIR__@$BASEDIR/archivedir@" \ $1/$SCRIPT chmod 755 $1/$SCRIPT } #------------------------------------------- # create pgpool_recovery_pitr (2nd stage script)for native replication mode # argument: PostgreSQL database cluster directory #------------------------------------------- function create_pgpool_recovery_pitr { SCRIPT=pgpool_recovery_pitr cat >> $1/$SCRIPT <<'EOF' #! /bin/sh psql=__PGBIN__/psql DATADIR_BASE=__DATADIR_BASE__ PGSUPERUSER=__PGSUPERUSER__ master_db_cluster=$1 recovery_node_host_name=$2 DEST_CLUSTER=$3 PORT=$4 log=$DATADIR_BASE/log/recovery.log EOF echo "export PGHOST=$PGSOCKET_DIR" >> $1/$SCRIPT cat >> $1/$SCRIPT <<'EOF' # Force to flush current value of sequences to xlog $psql -q -p $PORT -t -c 'SELECT datname FROM pg_database WHERE NOT datistemplate AND datallowconn' template1| while read i do if [ "$i" != "" ];then $psql -p $PORT -c "SELECT setval(oid, nextval(oid)) FROM pg_class WHERE relkind = 'S'" $i fi done $psql -p $PORT -c "SELECT pgpool_switch_xlog('__ARCHDIR__')" template1 EOF #------------------------------------------- # replace some variables in the script #------------------------------------------- /bin/sed -i \ -e "/__PGBIN__/s@__PGBIN__@$PGBIN@p" \ -e "/__DATADIR_BASE__/s@__DATADIR_BASE__@$BASEDIR@" \ -e "/__PGSUPERUSER__/s/__PGSUPERUSER__/$WHOAMI/" \ -e "/__ARCHDIR__/s@__ARCHDIR__@$BASEDIR/archivedir@" \ $1/$SCRIPT chmod 755 $1/$SCRIPT } #------------------------------------------- # create initial recovery.conf # argument1: PostgreSQL database cluster directory # argument2: cluster No. We assume that data0 is primary #------------------------------------------- function create_recovery_conf { if [ $PGVERSION -ge 120 ];then fname=myrecovery.conf elif [ $2 = "0" ];then fname=recovery.done else fname=recovery.conf fi if [ $PGVERSION -lt 120 ];then cat > $1/$fname < $1/$fname <> $1/$fname else cat >> $1/$fname <> $POOL_HBACONF echo "host all md5_user 0/0 md5" >> $POOL_HBACONF echo "local all scram_user scram-sha-256" >> $POOL_HBACONF echo "local all md5_user md5" >> $POOL_HBACONF fi echo "local all all trust" >> $POOL_HBACONF echo "host all all 127.0.0.1/32 trust" >> $POOL_HBACONF echo "host all all ::1/128 trust" >> $POOL_HBACONF } #------------------------------------------- # set pgpool.conf # argument: absolute path to pgpool.conf #------------------------------------------- function set_pgpool_conf { echo "sr_check_user = '$WHOAMI'" >> $CONF echo "recovery_user = '$WHOAMI'" >> $CONF echo "recovery_password = ''" >> $CONF echo "recovery_1st_stage_command = 'basebackup.sh'" >> $CONF if [ $MODE = "r" ];then echo "recovery_2nd_stage_command = 'pgpool_recovery_pitr'" >> $CONF fi n=0 while [ $n -lt $NUMCLUSTERS ] do echo "health_check_period$n = 10" >> $CONF echo "health_check_timeout$n = 20" >> $CONF echo "health_check_user$n = '$WHOAMI'" >> $CONF echo "health_check_password$n = ''" >> $CONF echo "health_check_database$n = 'postgres'" >> $CONF echo "health_check_max_retries$n = 3" >> $CONF echo "health_check_retry_delay$n = 1" >> $CONF echo "connect_timeout$n = 1000" >> $CONF n=`expr $n + 1` done OIDDIR=$BASEDIR/log/pgpool/oiddir mkdir -p $OIDDIR echo "memqcache_oiddir = '$OIDDIR'" >> $CONF echo "log_per_node_statement = on" >> $CONF if [ $MODE = "s" ];then echo "failover_command = '$FAILOVER_SCRIPT %d %h %p %D %m %M %H %P %r %R'" >> $CONF fi echo "socket_dir = '$PGSOCKET_DIR'" >> $CONF echo "pcp_socket_dir = '$PGSOCKET_DIR'" >> $CONF } #------------------------------------------- # wait for pgpool comes up #------------------------------------------- function wait_for_pgpool_startup { timeout=20 while [ $timeout -gt 0 ] do $PSQL -p $PGPOOL_PORT -c "show pool_nodes" postgres >/dev/null 2>&1 if [ $? = 0 ];then # echo "pgpool-II comes up after `expr 20 - $timeout` seconds" break; fi timeout=`expr $timeout - 1` sleep 1 done } #------------------------------------------- # wait for pgpool reload finished #------------------------------------------- function wait_for_pgpool_reload { timeout=20 num_node=$1 while [ $timeout -gt 0 ] do N=`$PSQL -p $PGPOOL_PORT -c "show pool_status" test | grep backend_data | wc -l` if [ $N = $num_node ];then break; fi timeout=`expr $timeout - 1` sleep 1 done } ################################################################################# # # main script # ################################################################################ function usage() { echo "usage: $0 [-m r|s|n|l|y] [-n num_clusters] [-p base_port] [-pg pg_base_port][--no-stop] [-d] [-s] [-r]";exit 1 } #------------------------------------------- # Argument check # usage: $0 [-m r|s|n][-n num_clusters][-p base_port][-pg pg_base_port][--no-stop][-d][-s][-r] #------------------------------------------- # # default mode is streaming replication mode MODE="s" NO_STOP="false" while [ $# -gt 0 ] do if [ $1 = "-m" ];then shift case $1 in r ) MODE="r";; s ) MODE="s";; n ) MODE="n";; l ) MODE="l";; y ) MODE="y";; * ) usage;; esac elif [ $1 = "-n" ];then shift NUMCLUSTERS=$1 elif [ $1 = "-p" ];then shift BASEPORT=$1 ORIGBASEPORT=$1 elif [ $1 = "-pg" ];then shift PGBASEPORT=$1 elif [ $1 = "--no-stop" ];then shift NO_STOP="true" elif [ $1 = "-d" ];then PGPOOLDEBUG="true" elif [ $1 = "-s" ];then USE_REPLICATION_SLOT="true" elif [ $1 = "-r" ];then USE_PG_REWIND="true" elif [ $1 = "--help" -o $1 = "-o" ];then usage exit else usage exit fi shift done case $MODE in r) MODENAME="native replication mode" SAMPLE_CONF=$PGPOOLDIR/pgpool.conf.sample-replication ;; s ) MODENAME="streaming replication mode" SAMPLE_CONF=$PGPOOLDIR/pgpool.conf.sample-stream ;; n ) MODENAME="raw mode" SAMPLE_CONF=$PGPOOLDIR/pgpool.conf.sample ;; l ) MODENAME="logical replication mode" SAMPLE_CONF=$PGPOOLDIR/pgpool.conf.sample-logical ;; y ) MODENAME="slony mode" SAMPLE_CONF=$PGPOOLDIR/pgpool.conf.sample-master-slave ;; esac # If USE_REPLICATION_SLOT is provided as an environment variable, turn on -s if [ a$USE_REPLICATION_SLOT = a"true" ];then USE_REPLICATION_SLOT="true" fi # If USE_PG_REWIND is provided as an environment variable, turn on -r if [ a$USE_PG_REWIND = a"true" ];then USE_PG_REWIND="true" fi #------------------------------------------- # Make sure that current directory is empty #------------------------------------------- if [ "`/bin/ls`" != "" ] then echo "$0: Current directory is not empty. Please remove files and directories then try again." exit 1 fi exec 5> $BASEDIR/pgpool_setup.log #------------------------------------------- # everything looks good. starting setup... #------------------------------------------- echo "Starting set up in $MODENAME" #------------------------------------------- # assign base port for PostgreSQL #------------------------------------------- ORIG_BASEPORT=$BASEPORT BASEPORT=$PGBASEPORT #------------------------------------------- # install pgpool.conf #------------------------------------------- test ! -d etc && mkdir etc cp $SAMPLE_CONF $CONF cp $PGPOOLDIR/pool_hba.conf.sample $BASEDIR/etc/pool_hba.conf #------------------------------------------- # create startall, shutdownall and pgpool_reload #------------------------------------------- echo "creating startall and shutdownall" echo "LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$LPATH" > $STARTALL echo 'dir=`pwd`' >> $STARTALL echo "PGPOOL_INSTALL_DIR=$PGPOOL_INSTALL_DIR" >> $STARTALL chmod 755 $STARTALL echo 'dir=`pwd`' > $SHUTDOWNALL echo "PGPOOL_INSTALL_DIR=$PGPOOL_INSTALL_DIR" >> $SHUTDOWNALL echo '$PGPOOL_INSTALL_DIR/bin/pgpool -f $dir/etc/pgpool.conf -m f stop' >> $SHUTDOWNALL echo 'while [ -f $dir/run/pgpool.pid ];do sleep 1;done' >> $SHUTDOWNALL if [ $CHECK_TIME_WAIT != "false" ];then echo "while netstat -a|grep $ORIGBASEPORT ;do sleep 1;done" >> $SHUTDOWNALL fi chmod 755 $SHUTDOWNALL echo 'dir=`pwd`' > $PGPOOL_RELOAD echo "PGPOOL_INSTALL_DIR=$PGPOOL_INSTALL_DIR" >> $PGPOOL_RELOAD echo '$PGPOOL_INSTALL_DIR/bin/pgpool -f $dir/etc/pgpool.conf reload' >> $PGPOOL_RELOAD chmod 755 $PGPOOL_RELOAD #------------------------------------------- # create failover script #------------------------------------------- echo "creating failover script" create_failover_script >&5 2>&1 #------------------------------------------- # create each PostgreSQL cluster #------------------------------------------- n=0 while [ $n -lt $NUMCLUSTERS ] do CLUSTER="data"`expr $n` CLUSTERDIR=$BASEDIR/$CLUSTER PORT=`expr $BASEPORT + $n` echo -n "creating database cluster $CLUSTERDIR..." $INITDB -D $CLUSTERDIR $INITDBARG >&5 2>&1 echo "done." # set postgresql.conf echo "update postgresql.conf" set_postgresql_conf $CLUSTERDIR >&5 2>&1 # create pgpool_remote_start script under cluster directory echo "creating pgpool_remote_start" create_pgpool_remote_start_script $CLUSTERDIR >&5 2>&1 echo "creating basebackup.sh" # create basebackup.sh if [ $MODE = 's' ];then create_basebackup_stream $CLUSTERDIR $n >&5 2>&1 elif [ $MODE = 'r' ];then create_basebackup_replication $CLUSTERDIR >&5 2>&1 create_pgpool_recovery_pitr $CLUSTERDIR >&5 2>&1 fi # create recovery.conf or recovery.done if streaming replication # mode if [ $MODE = "s" ];then echo "creating recovery.conf" create_recovery_conf $CLUSTERDIR $n >&5 2>&1 fi echo "$PG_CTL -D $CLUSTERDIR -m f stop" >> $SHUTDOWNALL echo "$PG_CTL -w -D $CLUSTERDIR start" >> $STARTALL n=`expr $n + 1` echo "#$n port is $PORT" >> README.port done set_pgpool_conf $CONF set_pool_hba_conf $BASEDIR/etc/pool_hba.conf PGPOOL_PORT=$ORIG_BASEPORT echo "port = $PGPOOL_PORT" >> $CONF PCP_PORT=`expr $PGPOOL_PORT + 1` echo "pcp_port = $PCP_PORT" >> $CONF #------------------------------------------- # create password file for pcp #------------------------------------------- echo "localhost:${PCP_PORT}:${WHOAMI}:${WHOAMI}" >> $PCP_PASS_FILE chmod 0600 $PCP_PASS_FILE test ! -d run && mkdir run echo "pid_file_name = '$BASEDIR/run/pgpool.pid'" >> $CONF test ! -d log && mkdir log echo "logdir = '$BASEDIR/log'" >> $CONF if [ "$PGPOOLDEBUG" = "true" ];then echo '$PGPOOL_INSTALL_DIR/bin/pgpool -d -D -n -f $dir/etc/pgpool.conf -F $dir/etc/pcp.conf -a $dir/etc/pool_hba.conf 2>&1 | cat > $dir/log/pgpool.log &' >> $STARTALL else echo '$PGPOOL_INSTALL_DIR/bin/pgpool -D -n -f $dir/etc/pgpool.conf -F $dir/etc/pcp.conf -a $dir/etc/pool_hba.conf 2>&1 | cat > $dir/log/pgpool.log &' >> $STARTALL fi # create pcp.conf if [ -f $PGPOOLDIR/pcp.conf.sample ];then cp $PGPOOLDIR/pcp.conf.sample etc/pcp.conf fi echo -n "${WHOAMI}:" >> etc/pcp.conf $PGPOOL_INSTALL_DIR/bin/pg_md5 $WHOAMI >> etc/pcp.conf # create pool_passwd $PGPOOL_INSTALL_DIR/bin/pg_md5 -m -f etc/pgpool.conf -u $WHOAMI $WHOAMI if [ $USE_REPLICATION_SLOT = "false" ];then # create archive directory mkdir archivedir fi #------------------------------------------- # if streaming replication mode, we need to create data1 and so on, by # using on line recovery. #------------------------------------------- if [ $MODE = 's' ];then # temporarily start data0 cluster to create extensions echo "temporarily start data0 cluster to create extensions" $PG_CTL -w -D data0 start >&5 2>&1 $PSQL -p $BASEPORT template1 >&5 2>&1 <&5 2>&1 n=`expr $n + 1` done fi n=0 PORT=$BASEPORT CLUSTER="data"`expr $n` CLUSTERDIR=$BASEDIR/$CLUSTER echo "backend_hostname$n = '$PGSOCKET_DIR'" >> $CONF echo "backend_port$n = $PORT" >> $CONF echo "backend_weight$n = 1" >> $CONF echo "backend_data_directory$n = '$CLUSTERDIR'" >> $CONF echo "backend_application_name$n = 'server$n'" >> $CONF # temporarily start pgpool echo "temporarily start pgpool-II to create standby nodes" $PGPOOL_INSTALL_DIR/bin/pgpool -D -n -f $BASEDIR/etc/pgpool.conf -F $BASEDIR/etc/pcp.conf -a $BASEDIR/etc/pool_hba.conf > $BASEDIR/log/pgpool.log 2>&1 & wait_for_pgpool_startup if [ $NUMCLUSTERS -gt 1 ];then n=1 while [ $n -lt $NUMCLUSTERS ] do # set up pgpool.conf PORT=`expr $PORT + 1` echo "backend_hostname$n = '$PGSOCKET_DIR'" >> $CONF echo "backend_port$n = $PORT" >> $CONF echo "backend_weight$n = 1" >> $CONF CLUSTER="data"`expr $n` CLUSTERDIR=$BASEDIR/$CLUSTER echo "backend_data_directory$n = '$CLUSTERDIR'" >> $CONF echo "backend_application_name$n = 'server$n'" >> $CONF n=`expr $n + 1` done $PGPOOL_INSTALL_DIR/bin/pgpool -f $BASEDIR/etc/pgpool.conf reload fi wait_for_pgpool_reload $NUMCLUSTERS $PSQL -p $PGPOOL_PORT -c "show pool_nodes" test export PCPPASSFILE=$PCP_PASS_FILE # recovery data1 and so on n=1 while [ $n -lt $NUMCLUSTERS ] do echo -n "recovery node $n..." $PGPOOL_INSTALL_DIR/bin/pcp_recovery_node -w -h localhost -p $PCP_PORT -n $n echo "done." n=`expr $n + 1` if [ $n -lt $NUMCLUSTERS ];then wait_for_pgpool_startup # sleep 10 fi done # # replication mode # else n=0 PORT=$BASEPORT CLUSTER="data"`expr $n` CLUSTERDIR=$BASEDIR/$CLUSTER while [ $n -lt $NUMCLUSTERS ] do if [ $MODE = 'l' -o $MODE = 'y' ] then # temporarily start data$n cluster to create extensions echo "temporarily start data${n} cluster to create extensions" $PG_CTL -w -D data${n} start >&5 2>&1 $PSQL -p `expr $BASEPORT + $n` template1 >&5 2>&1 <&5 2>&1 fi # set up pgpool.conf echo "backend_hostname$n = '$PGSOCKET_DIR'" >> $CONF echo "backend_port$n = $PORT" >> $CONF echo "backend_weight$n = 1" >> $CONF if [ $n -eq 0 -a $MODE = "l" ] then echo "backend_flag$n = ALWAYS_MASTER" >> $CONF fi CLUSTER="data"`expr $n` CLUSTERDIR=$BASEDIR/$CLUSTER echo "backend_data_directory$n = '$CLUSTERDIR'" >> $CONF PORT=`expr $PORT + 1` n=`expr $n + 1` done echo "start all" $STARTALL >&5 2>&1 echo -n "waiting for pgpool-II coming up..." wait_for_pgpool_startup # sleep 20 echo "done." fi if [ $MODE = "r" -o $MODE = "n" ];then echo "create extensions" $PSQL -p $PGPOOL_PORT template1 >&5 2>&1 <&5 2>&1 echo "follow_master_command = '$FOLLOW_MASTER_SCRIPT %d %h %p %D %m %M %H %P %r %R'" >> $CONF fi $PSQL -p $PGPOOL_PORT test <> README.port echo "pcp port is $PCP_PORT" >> README.port if [ $NO_STOP = "false" ];then echo "shutdown all" $SHUTDOWNALL >&5 2>&1 fi echo "export PGPOOL_PORT=$PGPOOL_PORT" > bashrc.ports echo "export PCP_PORT=$PCP_PORT" >> bashrc.ports echo "export PCPPASSFILE=$PCP_PASS_FILE" >> bashrc.ports chmod 755 bashrc.ports echo echo "pgpool-II setting for $MODENAME is done." echo "To start the whole system, use ${STARTALL}." echo "To shutdown the whole system, use ${SHUTDOWNALL}." echo "pcp command user name is \"$WHOAMI\", password is \"$WHOAMI\"." echo "Each PostgreSQL, pgpool-II and pcp port is as follows:" cat README.port echo "The info above is in README.port." if [ $NO_STOP = "true" ];then echo "CAUTION: whole system is still running." fi pgpool-II-4.1.4/src/test/watchdog_setup.in0000775000175000017500000002211013730350127015360 00000000000000#!/usr/bin/env bash # # Copyright (c) 2013-2019 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. #------------------------------------------------------------------- # Set up watchdog enabled pgpool-II and PostgreSQL temporary # installation in current directory for *testing* purpose. Do not use # this tool for production environment! # Note that this script uses pgpool_setup as a work horse. # # usage: watchdog_setup [-wn num_pgpool][-wp watchdog_base_port][-m r|s|n][-n num_clusters][-p base_port][--no-stop][-d] # -wn num_pgpool: create num_pgpool pgpool nodes. The default is 3. Must be greater than 1. # -wp watchdog_base_port: starting port number. The default is # 50000. #------------------------------------------- # Configuration section #------------------------------------------- # Number of Pgpool-II installations. W_NUM_PGPOOL=${W_NUM_PGPOOL:-"3"} # Starting port number. W_BASE_PORT=${W_BASE_PORT:-"50000"} # PostgreSQL startig port number. export PGBASEPORT=`expr $W_BASE_PORT + 1000` # number of ports used in a single pgpool-II installation. # (port, pcp_port, wd_port, wd_heartbeat_port) num_ports_per_node=4 #------------------------------------------- # End of configuration section #------------------------------------------- # # user name WHOAMI=`whoami` # our root directory BASEDIR=`pwd` # location of pgpool_setup PGPOOL_SETUP=${PGPOOL_SETUP:-"$(dirname $0)/pgpool_setup"} # PostgreSQL bin directory PGBIN=${PGBIN:-"@@PGSQL_BIN_DIR@@"} INITDB=$PGBIN/initdb PG_CTL=$PGBIN/pg_ctl PSQL=$PGBIN/psql #------------------------------------------- # set postgresql.conf # argument: PostgreSQL database cluster directory #------------------------------------------- function set_postgresql_conf { PGCONF=$1/postgresql.conf echo "listen_addresses = '*'" >> $PGCONF echo "port = $PORT" >> $PGCONF echo "logging_collector = on" >> $PGCONF echo "log_filename = '%A.log'" >> $PGCONF echo "log_line_prefix = '%p %t '" >> $PGCONF echo "log_truncate_on_rotation = on" >> $PGCONF echo "log_statement = 'all'" >> $PGCONF echo "max_prepared_transactions = 10" >> $PGCONF echo "unix_socket_directories = '$PGSOCKET_DIR'" >> $PGCONF if [ $MODE = "s" ];then echo "hot_standby = on" >> $PGCONF echo "wal_level = hot_standby" >> $PGCONF echo "max_wal_senders = $NUMCLUSTERS" >> $PGCONF echo "archive_mode = on" >> $PGCONF echo "archive_command = 'cp %p $BASEDIR/archivedir/%f > $PGCONF elif [ $MODE = 'r' ];then echo "wal_level = archive" >> $PGCONF echo "archive_mode = on" >> $PGCONF echo "archive_command = 'cp %p $BASEDIR/archivedir/%f > $PGCONF fi ed $1/pg_hba.conf <> $CONF echo "recovery_user = '$WHOAMI'" >> $CONF echo "recovery_password = ''" >> $CONF echo "recovery_1st_stage_command = 'basebackup.sh'" >> $CONF if [ $MODE = "r" ];then echo "recovery_2nd_stage_command = 'pgpool_recovery_pitr'" >> $CONF fi echo "health_check_period = 10" >> $CONF echo "health_check_user = '$WHOAMI'" >> $CONF OIDDIR=$BASEDIR/log/pgpool/oiddir mkdir -p $OIDDIR echo "memqcache_oiddir = '$OIDDIR'" >> $CONF echo "log_per_node_statement = on" >> $CONF if [ $MODE = "s" ];then echo "failover_command = '$FAILOVER_SCRIPT %d %h %p %D %m %M %H %P %r %R'" >> $CONF fi echo "socket_dir = '$PGSOCKET_DIR'" >> $CONF echo "pcp_socket_dir = '$PGSOCKET_DIR'" >> $CONF } #------------------------------------------- # wait for pgpool comes up #------------------------------------------- function wait_for_pgpool_startup { timeout=20 while [ $timeout -gt 0 ] do $PSQL -p $PGPOOL_PORT -c "show pool_nodes" postgres >/dev/null 2>&1 if [ $? = 0 ];then # echo "pgpool-II comes up after `expr 20 - $timeout` seconds" break; fi timeout=`expr $timeout - 1` sleep 1 done } #------------------------------------------- # wait for pgpool reload finished #------------------------------------------- function wait_for_pgpool_reload { timeout=20 num_node=$1 while [ $timeout -gt 0 ] do N=`$PSQL -p $PGPOOL_PORT -c "show pool_status" test | grep backend_data | wc -l` if [ $N = $num_node ];then break; fi timeout=`expr $timeout - 1` sleep 1 done } #------------------------------------------- # Set watchdog params to pgpool.conf #------------------------------------------- function set_watchdog_params { id=$1 num_pgpool=$2 base_port=$3 priority=`expr $num_pgpool - $id` n=0 conf=etc/pgpool.conf wd_port=`expr $base_port + \( $id \* $num_ports_per_node \) + 2` wd_heartbeat_port=`expr $wd_port + 1` cat >> $conf <> $conf pgpool_port=`expr $base_port + \( $n \* $num_ports_per_node \)` pcp_port=`expr $pgpool_port + 1` wd_port=`expr $pcp_port + 1` wd_heartbeat_port=`expr $wd_port + 1` echo "heartbeat_destination_port$suf = $wd_heartbeat_port" >> $conf echo "other_pgpool_hostname$suf = 'localhost'" >> $conf echo "other_pgpool_port$suf = $pgpool_port" >> $conf echo "other_wd_port$suf = $wd_port" >> $conf suf=`expr $suf + 1` fi n=`expr $n + 1` done } ################################################################################# # # main script # ################################################################################ function usage() { echo "usage: $0 [-wn num_pgpool][-wp watchdog_base_port][-m r|s|n] [-n num_clusters] [-p base_port] [-pg pg_base_port][--no-stop] [-d]";exit 1 } #------------------------------------------- # Argument check # usage: $0 [-wn num_pgpool][-wp watchdog_base_port][-m r|s|n][-n num_clusters][-p base_port][-pg pg_base_port][--no-stop][-d] #------------------------------------------- # # default mode is streaming replication mode MODE="s" NO_STOP="false" while [ $# -gt 0 ] do if [ $1 = "-wn" ];then shift W_NUM_PGPOOL=$1 if [ "$W_NUM_PGPOOL" -le 1 ];then echo "number of Pgpool-II nodes must be greater than 1" exit 1 fi elif [ $1 = "-wp" ];then shift W_BASE_PORT=$1 PGBASEPORT=`expr $W_BASE_PORT + 1000` # rest are pgpool_setup args elif [ $1 = "-m" ];then shift case $1 in r ) MODE="r";; s ) MODE="s";; n ) MODE="n";; * ) usage;; esac elif [ $1 = "-n" ];then shift export NUMCLUSTERS=$1 elif [ $1 = "-p" ];then shift export BASEPORT=$1 elif [ $1 = "-pg" ];then shift export PGBASEPORT=$1 elif [ $1 = "--no-stop" ];then shift NO_STOP="true" elif [ $1 = "-d" ];then export PGPOOLDEBUG="true" shift; elif [ $1 = "--help" -o $1 = "-o" ];then usage exit else usage exit fi shift done #------------------------------------------- # Make sure that current directory is empty #------------------------------------------- if [ "`/bin/ls`" != "" ] then echo "$0: Current directory is not empty. Please remove files and directories then try again." exit 1 fi #------------------------------------------- # everything looks good. starting setup... #------------------------------------------- echo "Starting set up " #------------------------------------------- # Run pgpool_setup #------------------------------------------- STARTALL=$BASEDIR/startall SHUTDOWNALL=$BASEDIR/shutdownall cnt=0 while [ $cnt -lt $W_NUM_PGPOOL ] do echo "============= setting up pgpool $cnt =============" mkdir pgpool$cnt cd pgpool$cnt port=`expr $W_BASE_PORT + \( $cnt \* $num_ports_per_node \)` $PGPOOL_SETUP -m $MODE -p $port -pg $PGBASEPORT set_watchdog_params $cnt $W_NUM_PGPOOL $W_BASE_PORT # remove "pg_ctl start" line from startall/shutdownall script in other than pgpool0 if [ $cnt != 0 ] then sed -i '/.*data.*/d' startall sed -i '/.*data.*/d' shutdownall fi echo "cd pgpool$cnt" >> $STARTALL echo "./startall" >> $STARTALL echo "cd .." >> $STARTALL echo "cd pgpool$cnt" >> $SHUTDOWNALL echo "./shutdownall" >> $SHUTDOWNALL echo "cd .." >> $SHUTDOWNALL cd .. cnt=`expr $cnt + 1` done chmod 755 $STARTALL chmod 755 $SHUTDOWNALL pgpool-II-4.1.4/src/test/regression/0000775000175000017500000000000013730350075014253 500000000000000pgpool-II-4.1.4/src/test/regression/.gitignore0000664000175000017500000000004013730350075016155 00000000000000clean regression.log log/ temp/ pgpool-II-4.1.4/src/test/regression/README0000664000175000017500000000271513730350075015060 00000000000000This directory contains files for simple regression tests. To execute regress.sh you need to install: - pgpool_setup - PostgreSQL 8.3 or later (requires EXTENSION) - pgbench - perl PostgreSQL interface - other tools or libraries required in each test cases regress.sh: the regression test driver. To execute the test, type "sh regress.sh". To get the lists of arguments accepted by regress.sh type "sh regress.sh -?" clean.sh: remove files including PostgreSQL DB clusters created by regress.sh. tests: test scripts live here. Each test case has its own subdirectory. In the directory the test script resides and the script name must be "test.sh". The script should return exit code 0 upon successfull completion of the test. Otherwise it should return non 0 value. To add a new test case, simply create a shell script under this. The test name "001.*" to "050.*" is for regular regression tests, while after "051.*" are for bugs. regress.sh exports following environment variables which can be used by test scripts. PGPOOL_SETUP file path of pgpool_setup file PGPOOL_INSTALL_DIR pgpool-II installed directory PGBIN directory path containing PostgreSQL binaries JDBC_DRIVER file path of JDBC driver log: any output of the test files above is created under the directory. The log file name is same as the test name. libs.sh: contains some useful bash functions. The file name is exported as "$TESTLIBS", pgpool-II-4.1.4/src/test/regression/clean.sh0000664000175000017500000000242213730350075015611 00000000000000#! /bin/sh # clean up test results dir=`pwd` export TESTLIBS=$dir/libs.sh export PGPOOL_SETUP=$HOME/bin/pgpool_setup export WATCHDOG_SETUP=$HOME/bin/watchdog_setup log=$dir/log rm -fr $log rm -fr $dir/temp cd tests dirs=`ls` for i in $dirs do cd $i rm -fr testdir *~ cd .. done rm -fr $dir/tests/004.watchdog/master rm -fr $dir/tests/004.watchdog/standby cd $dir/tests/010.rewrite_timestamp/timestamp/; make clean >/dev/null 2>&1; cd $dir rm -fr $dir/tests/011.watchdoc_quorum_failover/master/ rm -fr $dir/tests/011.watchdoc_quorum_failover/standby/ rm -fr $dir/tests/011.watchdoc_quorum_failover/standby2/ rm -fr $dir/tests/012.watchdog_failover_when_quorum_exists/master/ rm -fr $dir/tests/012.watchdog_failover_when_quorum_exists/standby/ rm -fr $dir/tests/012.watchdog_failover_when_quorum_exists/standby2/ rm -fr $dir/tests/013.watchdoc_test_failover_require_consensus/master/ rm -fr $dir/tests/013.watchdoc_test_failover_require_consensus/standby/ rm -fr $dir/tests/013.watchdoc_test_failover_require_consensus/standby2/ rm -fr $dir/tests/014.watchdoc_test_quorum_bypass/master/ rm -fr $dir/tests/015.watchdoc_test_master_and_backend_fail/master/ rm -fr $dir/tests/015.watchdoc_test_master_and_backend_fail/standby/ rm -fr $dir/tests/015.watchdoc_test_master_and_backend_fail/standby2/ pgpool-II-4.1.4/src/test/regression/libs.sh0000664000175000017500000000221213730350075015455 00000000000000#------------------------------------------- # wait for pgpool comes up #------------------------------------------- function wait_for_pgpool_startup { timeout=20 while [ $timeout -gt 0 ] do $PGBIN/psql -p $PGPOOL_PORT -c "show pool_nodes" test >/dev/null 2>&1 if [ $? = 0 ];then break; fi timeout=`expr $timeout - 1` sleep 1 done } #------------------------------------------- # wait for primary/master failover done #------------------------------------------- function wait_for_failover_done { timeout=20 while [ $timeout -gt 0 ] do $PGBIN/psql -p $PGPOOL_PORT -c "show pool_nodes" test >/dev/null 2>&1 if [ $? = 0 ];then $PGBIN/psql -p $PGPOOL_PORT -c "show pool_nodes" test |egrep -i "primary|master">/dev/null 2>&1 if [ $? = 0 ];then break; fi fi timeout=`expr $timeout - 1` echo "timeout: $timeout" sleep 1 done } #------------------------------------------- # clean remaining processes and sockets #------------------------------------------- function clean_all { pgrep pgpool | xargs kill -9 > /dev/null 2>&1 pgrep postgres | xargs kill -9 > /dev/null 2>&1 rm -f $PGSOCKET_DIR/.s.PGSQL.* } pgpool-II-4.1.4/src/test/regression/regress.sh0000775000175000017500000001274513730350075016215 00000000000000#!/usr/bin/env bash # # pgpool-II regression test driver. # # usage: regress.sh [test_name] # -i install directory of pgpool # -b pgbench path # -p installation path of Postgres # -j JDBC driver path # -m install (install pgpool-II and use that for tests) / noinstall : Default install # -s unix socket directory # -d start pgpool with debug option dir=`pwd` MODE=install PG_INSTALL_DIR=/usr/local/pgsql/bin PGPOOL_PATH=/usr/local JDBC_DRIVER=/usr/local/pgsql/share/postgresql-9.2-1003.jdbc4.jar export USE_REPLICATION_SLOT=true export log=$dir/log fail=0 ok=0 timeout=0 PGSOCKET_DIR=/tmp CRED=$(tput setaf 1) CGREEN=$(tput setaf 2) CBLUE=$(tput setaf 4) CNORM=$(tput sgr0) # timeout for each test (5 min.) TIMEOUT=300 function install_pgpool { echo "creating pgpool-II temporary installation ..." PGPOOL_PATH=$dir/temp/installed test -d $log || mkdir $log make install HEALTHCHECK_DEBUG=1 WATCHDOG_DEBUG=1 -C $dir/../../ -e prefix=${PGPOOL_PATH} >& regression.log 2>&1 if [ $? != 0 ];then echo "make install failed" exit 1 fi echo "moving pgpool_setup to temporary installation path ..." cp $dir/../pgpool_setup ${PGPOOL_PATH}/pgpool_setup export PGPOOL_SETUP=$PGPOOL_PATH/pgpool_setup echo "moving watchdog_setup to temporary installation path ..." cp $dir/../watchdog_setup ${PGPOOL_PATH}/watchdog_setup export WATCHDOG_SETUP=$PGPOOL_PATH/watchdog_setup } function verify_pginstallation { # PostgreSQL bin directory PGBIN=`$PG_INSTALL_DIR/pg_config --bindir` if [ -z $PGBIN ]; then echo "$0: cannot locate pg_config" exit 1 fi # PostgreSQL lib directory PGLIB=`$PG_INSTALL_DIR/pg_config --libdir` if [ -z $PGLIB ]; then echo "$0: cannot locate pg_config" exit 1 fi } function export_env_vars { if [[ -z "$PGPOOL_PATH" ]]; then # check if pgpool is in the path PGPOOL_PATH=/usr/local export PGPOOL_SETUP=$HOME/bin/pgpool_setup export WATCHDOG_SETUP=$HOME/bin/watchdog_setup fi if [[ -z "$PGBENCH_PATH" ]]; then if [ -x $PGBIN/pgbench ]; then PGBENCH_PATH=$PGBIN/pgbench else PGBENCH_PATH=`which pgbench` fi fi if [ ! -x $PGBENCH_PATH ]; then echo "$0] cannot locate pgbench"; exit 1 fi echo "using pgpool-II at "$PGPOOL_PATH export PGPOOL_INSTALL_DIR=$PGPOOL_PATH PGPOOLLIB=${PGPOOL_INSTALL_DIR}/lib if [ -z "$LD_LIBRARY_PATH" ];then export LD_LIBRARY_PATH=${PGPOOLLIB}:${PGLIB} else export LD_LIBRARY_PATH=${PGPOOLLIB}:${PGLIB}:${LD_LIBRARY_PATH} fi export TESTLIBS=$dir/libs.sh export PGBIN=$PGBIN export JDBC_DRIVER=$JDBC_DRIVER export PGBENCH_PATH=$PGBENCH_PATH export PGSOCKET_DIR=$PGSOCKET_DIR export PGVERSION=`$PGBIN/initdb -V|awk '{print $3}'|sed 's/\..*//'` } function print_info { echo ${CBLUE}"*************************"${CNORM} echo "REGRESSION MODE : "${CBLUE}$MODE${CNORM} echo "PGPOOL-II : "${CBLUE}$PGPOOL_PATH${CNORM} echo "PostgreSQL bin : "${CBLUE}$PGBIN${CNORM} echo "PostgreSQL Major version : "${CBLUE}$PGVERSION${CNORM} echo "pgbench : "${CBLUE}$PGBENCH_PATH${CNORM} echo "PostgreSQL jdbc : "${CBLUE}$JDBC_DRIVER${CNORM} echo ${CBLUE}"*************************"${CNORM} } function print_usage { printf "Usage:\n" printf " %s: [Options]... [test_name]\n" $(basename $0) >&2 printf "\nOptions:\n" printf " -p DIRECTORY Postgres installed directory\n" >&2 printf " -b PATH pgbench installed path, if different from Postgres installed directory\n" >&2 printf " -i DIRECTORY pgpool installed directory, if already installed pgpool is to be used for tests\n" >&2 printf " -m install/noinstall make install pgpool to temp directory for executing regression tests [Default: install]\n" >&2 printf " -j FILE Postgres jdbc jar file path\n" >&2 printf " -s DIRECTORY unix socket directory\n" >&2 printf " -t TIMEOUT timeout value for each test (sec)\n" >&2 printf " -d start pgpool with debug option\n" >&2 printf " -? print this help and then exit\n\n" >&2 printf "Please read the README for details on adding new tests\n" >&2 } trap "echo ; exit 0" SIGINT SIGQUIT while getopts "p:m:i:j:b:s:t:d?" OPTION do case $OPTION in p) PG_INSTALL_DIR="$OPTARG";; m) MODE="$OPTARG";; i) PGPOOL_PATH="$OPTARG";; j) JDBC_DRIVER="$OPTARG";; b) PGBENCH_PATH="$OPTARG";; s) PGSOCKET_DIR="$OPTARG";; t) TIMEOUT="$OPTARG";; d) export PGPOOLDEBUG="true";; ?) print_usage exit 2;; esac done shift $(($OPTIND - 1)) if [ "$MODE" = "install" ]; then install_pgpool elif [ "$MODE" = "noinstall" ]; then echo not installing pgpool for the tests ... if [[ -n "$PGPOOL_INSTALL_PATH" ]]; then PGPOOL_PATH=$PGPOOL_INSTALL_PATH fi export PGPOOL_SETUP=$dir/../pgpool_setup export WATCHDOG_SETUP=$dir/../watchdog_setup else echo $MODE : Invalid mode exit -1 fi verify_pginstallation export_env_vars print_info source $TESTLIBS #Start executing tests rm -fr $log mkdir $log cd tests if [ $# -eq 1 ];then dirs=`ls|grep $1` else dirs=`ls` fi for i in $dirs do cd $i echo -n "testing $i..." clean_all timeout $TIMEOUT ./test.sh > $log/$i 2>&1 rtn=$? if [ $rtn = 0 ];then echo ${CGREEN}"ok."${CNORM} ok=`expr $ok + 1` elif [ $rtn = 124 ];then echo "timeout." timeout=`expr $timeout + 1` else echo ${CRED}"failed."${CNORM} fail=`expr $fail + 1` fi cd .. done total=`expr $ok + $fail` echo "out of $total ok:$ok failed:$fail timeout:$timeout" pgpool-II-4.1.4/src/test/regression/tests/0000775000175000017500000000000013730350127015413 500000000000000pgpool-II-4.1.4/src/test/regression/tests/001.load_balance/0000775000175000017500000000000013730350127020276 500000000000000pgpool-II-4.1.4/src/test/regression/tests/001.load_balance/.gitignore0000664000175000017500000000001113730350075022200 00000000000000testdir/ pgpool-II-4.1.4/src/test/regression/tests/001.load_balance/test.sh0000775000175000017500000001177513730350127021547 00000000000000#!/usr/bin/env bash #------------------------------------------------------------------- # test script for load balancing. # source $TESTLIBS TESTDIR=testdir PSQL=$PGBIN/psql # sleep time after reload in seconds st=10 for mode in s r do rm -fr $TESTDIR mkdir $TESTDIR cd $TESTDIR # create test environment echo -n "creating test environment..." $PGPOOL_SETUP -m $mode -n 2 || exit 1 echo "done." source ./bashrc.ports echo "backend_weight0 = 0" >> etc/pgpool.conf echo "backend_weight1 = 1" >> etc/pgpool.conf echo "black_function_list = 'f1'" >> etc/pgpool.conf ./startall export PGPORT=$PGPOOL_PORT wait_for_pgpool_startup $PSQL test </dev/null 2>&1 if [ $? != 0 ];then # expected result not found echo fail: select is sent to zero-weight node. ./shutdownall exit 1 fi echo ok: load balance works. # check if black function list worked fgrep "SELECT f1(1);" log/pgpool.log |grep "DB node id: 0">/dev/null 2>&1 if [ $? != 0 ];then # expected result not found echo fail: black function is sent to node 1. ./shutdownall exit 1 fi echo ok: black function list works. echo "white_function_list = 'f1'" >> etc/pgpool.conf echo "black_function_list = ''" >> etc/pgpool.conf ./pgpool_reload sleep $st $PSQL test </dev/null 2>&1 if [ $? != 0 ];then # expected result not found echo fail: white function is sent to zero-weight node. ./shutdownall exit 1 fi echo ok: white function list works. # check if black query pattern list worked ./shutdownall echo "black_query_pattern_list = 'SELECT \'a\'\;;SELECT 1\;;SELECT \'\;\'\;;SELECT \* FROM t1\;;^.*t2.*\;$;^.*f1.*$'" >> etc/pgpool.conf ./startall wait_for_pgpool_startup queries=`cat << EOF SELECT * FROM t1; SELECT 'a'; SELECT 1; SELECT ';'; SELECT * FROM t2; SELECT f1(1); EOF ` echo "$queries" | while read query; do $PSQL test -c "$query" # If master-slave mode, all queries are sent to primary node only. # If query match both black_query_pattern_list and white_function_list, # white_function_list will be ignored, and query is sent to primary node only. # # If replication node, all queries are load-blanced. if [[ $mode = "s" ]];then node_id=0 else node_id=1 fi fgrep "${query}" log/pgpool.log | grep "DB node id: "`echo $node_id` > /dev/null 2>&1 if [ $? != 0 ];then # expected result not found echo "fail: black query: ${query} is load-blanced." ./shutdownall exit 1 fi done if [ $? -eq 1 ]; then exit 1 fi echo ok: black query pattern list works. # check if statement level load balance worked ./shutdownall echo "white_function_list = ''" >> etc/pgpool.conf echo "black_function_list = ''" >> etc/pgpool.conf echo "statement_level_load_balance = on" >> etc/pgpool.conf echo "log_min_messages = debug1" >> etc/pgpool.conf ./startall sleep $st $PSQL test <> etc/pgpool.conf ./startall wait_for_pgpool_startup $PSQL test </dev/null 2>&1 if [ $? = 0 ];then fgrep "SELECT 1;" log/pgpool.log |grep "DB node id: 1">/dev/null 2>&1 if [ $? != 0 ];then # the SELECT should not be executed on node 1 echo ok: select is sent to only master when not load-blanced. ok=1 fi # the SELECT should be executed on node 0 fi # in replication mode if load_balance_mode = off, SELECT query # including writing function should be sent to all the nodes. # per [pgpool-general: 2221]. echo "black_function_list = 'f1'" >> etc/pgpool.conf echo "white_function_list = ''" >> etc/pgpool.conf ./pgpool_reload sleep $st $PSQL test </dev/null 2>&1 if [ $? = 0 ];then fgrep "SELECT f1(2);" log/pgpool.log |grep "DB node id: 1">/dev/null 2>&1 if [ $? = 0 ];then # the SELECT should be executed on node 0 & 1 echo ok: black function is sent to all nodes. ok=`expr $ok + 1` fi # the SELECT should be executed on node 0 fi if [ $ok != 2 ];then exit 1; fi fi ./shutdownall cd .. done exit 0 pgpool-II-4.1.4/src/test/regression/tests/002.native_replication/0000775000175000017500000000000013730350075021574 500000000000000pgpool-II-4.1.4/src/test/regression/tests/002.native_replication/.gitignore0000664000175000017500000000001113730350075023474 00000000000000testdir/ pgpool-II-4.1.4/src/test/regression/tests/002.native_replication/PgTester.java0000664000175000017500000000240713730350075024117 00000000000000import java.sql.Connection; import java.sql.DriverManager; import java.sql.PreparedStatement; import java.sql.SQLException; public class PgTester { public static void main(String[] args) { Integer startValue = 0; try{ startValue = Integer.parseInt(args[0]); } catch (Exception e){ System.out.println("Please provide a valid number as the first argument to the program"); System.exit(-1); } Connection conn=null; try { Class.forName ("org.postgresql.Driver"); conn = DriverManager.getConnection("jdbc:postgresql://localhost:11000/test"); } catch (ClassNotFoundException e) { e.printStackTrace(); } catch (SQLException e) { e.printStackTrace(); } try { //conn.setAutoCommit(false); PreparedStatement query = conn.prepareStatement("INSERT INTO public.sequencetester (recordno) VALUES (?)"); int max = startValue + 10; for(int cv = startValue; cv <= max; cv++){ query.setInt(1, cv); query.execute(); //System.out.println("interted "+cv); } query.close(); //conn.commit(); conn.close(); System.out.println("Done"); } catch (SQLException e) { e.printStackTrace(); } } } pgpool-II-4.1.4/src/test/regression/tests/002.native_replication/create.sql0000664000175000017500000000015713730350075023503 00000000000000CREATE TABLE sequencetester ( id serial NOT NULL, recordno integer, CONSTRAINT sq_pk PRIMARY KEY (id ) ) pgpool-II-4.1.4/src/test/regression/tests/002.native_replication/test.sh0000775000175000017500000000505313730350075023035 00000000000000#!/usr/bin/env bash #------------------------------------------------------------------- # test script for native replication mode. # source $TESTLIBS TESTDIR=testdir PSQL=$PGBIN/psql PGBENCH=$PGBENCH_PATH rm -fr $TESTDIR mkdir $TESTDIR cd $TESTDIR # create test environment echo -n "creating test environment..." $PGPOOL_SETUP -m r -n 2 || exit 1 echo "done." source ./bashrc.ports ./startall export PGPORT=$PGPOOL_PORT wait_for_pgpool_startup $PSQL test < pgbench.sql < dump0.txt cat dump_t1_n1.txt dump_t2_n1.txt dump_t3_n1.txt dump_t4_n1.txt dump_t5_n1.txt dump_s1.txt > dump1.txt diff dump0.txt dump1.txt if [ $? != 0 ];then # contents are not identical ./shutdownall exit 1 fi ./shutdownall exit 0 pgpool-II-4.1.4/src/test/regression/tests/003.failover/0000775000175000017500000000000013730350075017525 500000000000000pgpool-II-4.1.4/src/test/regression/tests/003.failover/.gitignore0000664000175000017500000000001113730350075021425 00000000000000testdir/ pgpool-II-4.1.4/src/test/regression/tests/003.failover/create_expected.sql0000664000175000017500000000155313730350075023316 00000000000000CREATE TEMP TABLE tmp ( node_id text, hostname text, port text, status text, lb_weight text, role text, select_cnt text, load_balance_node text, replication_delay text, replication_state text, replication_sync_state text, last_status_change text, mode text); INSERT INTO tmp VALUES ('0',:dir,'11002','up','0.500000','primary','0','false','0','','','XXXX-XX-XX XX:XX:XX','s'), ('1',:dir,'11003','down','0.500000','standby','0','false','0','','','XXXX-XX-XX XX:XX:XX','s'), ('0',:dir,'11002','up','0.500000','master','0','false','0','','','XXXX-XX-XX XX:XX:XX','r'), ('1',:dir,'11003','down','0.500000','slave','0','false','0','','','XXXX-XX-XX XX:XX:XX','r'); SELECT node_id,hostname,port,status,lb_weight,role,select_cnt,load_balance_node,replication_delay,replication_state, replication_sync_state, last_status_change FROM tmp WHERE mode = :mode pgpool-II-4.1.4/src/test/regression/tests/003.failover/create_expected_node0.sql0000664000175000017500000000155313730350075024403 00000000000000CREATE TEMP TABLE tmp ( node_id text, hostname text, port text, status text, lb_weight text, role text, select_cnt text, load_balance_node text, replication_delay text, replication_state text, replication_sync_state text, last_status_change text, mode text); INSERT INTO tmp VALUES ('0',:dir,'11002','down','0.500000','standby','0','false','0','','','XXXX-XX-XX XX:XX:XX','s'), ('1',:dir,'11003','up','0.500000','primary','0','false','0','','','XXXX-XX-XX XX:XX:XX','s'), ('0',:dir,'11002','down','0.500000','slave','0','false','0','','','XXXX-XX-XX XX:XX:XX','r'), ('1',:dir,'11003','up','0.500000','master','0','false','0','','','XXXX-XX-XX XX:XX:XX','r'); SELECT node_id,hostname,port,status,lb_weight,role,select_cnt,load_balance_node,replication_delay,replication_state, replication_sync_state, last_status_change FROM tmp WHERE mode = :mode pgpool-II-4.1.4/src/test/regression/tests/003.failover/test.sh0000775000175000017500000000334213730350075020765 00000000000000#!/usr/bin/env bash #------------------------------------------------------------------- # test script for failover # source $TESTLIBS TESTDIR=testdir PG_CTL=$PGBIN/pg_ctl PSQL="$PGBIN/psql -X " for mode in s r do rm -fr $TESTDIR mkdir $TESTDIR cd $TESTDIR # create test environment echo -n "creating test environment..." $PGPOOL_SETUP -m $mode -n 2 --no-stop|| exit 1 echo "done." # disable replication delay check so that comparison between # expected and actual result is not confused. echo "sr_check_period = 0" >> etc/pgpool.conf source ./bashrc.ports export PGPORT=$PGPOOL_PORT $PSQL -c "show pool_nodes" test # trigger failover on node 1 $PG_CTL -D data1 -m f stop wait_for_pgpool_startup $PSQL -c "show pool_nodes" test |sed -e 's/true /false/' -e 's/....-..-.. ..:..:../XXXX-XX-XX XX:XX:XX/g'| sed -e 's/streaming/ /' | sed -e 's/async/ /'> result # check the output of "show pool_nodes". LANG=C $PSQL -f ../create_expected.sql -v mode="'$mode'" -v dir="'$PGSOCKET_DIR'" test | tail -n 6 > expected cmp result expected > /dev/null 2>&1 if [ $? != 0 ];then ./shutdownall exit 1 fi ./shutdownall ./startall wait_for_pgpool_startup # trigger failover on node 0 $PG_CTL -D data0 -m f stop wait_for_failover_done $PSQL -c "show pool_nodes" test |sed -e 's/true /false/' -e 's/....-..-.. ..:..:../XXXX-XX-XX XX:XX:XX/g'> result if [ ! -s result ];then ./shutdownall echo "result file is empty." exit 1 fi # check the output of "show pool_nodes". LANG=C $PSQL -f ../create_expected_node0.sql -v mode="'$mode'" -v dir="'$PGSOCKET_DIR'" test | tail -n 6 > expected cmp result expected > /dev/null 2>&1 if [ $? != 0 ];then ./shutdownall exit 1 fi ./shutdownall cd .. done exit 0 pgpool-II-4.1.4/src/test/regression/tests/004.watchdog/0000775000175000017500000000000013730350127017515 500000000000000pgpool-II-4.1.4/src/test/regression/tests/004.watchdog/.gitignore0000664000175000017500000000002113730350075021420 00000000000000master/ standby/ pgpool-II-4.1.4/src/test/regression/tests/004.watchdog/master.conf0000664000175000017500000000052113730350127021575 00000000000000# master watchdog use_watchdog = on wd_interval = 1 wd_priority = 2 wd_hostname = 'localhost' wd_port = 21004 wd_heartbeat_port = 21005 heartbeat_destination0 = 'localhost' heartbeat_destination_port0 = 21105 other_pgpool_hostname0 = 'localhost' other_pgpool_port0 = 11100 other_wd_port0 = 21104 enable_consensus_with_half_votes = on pgpool-II-4.1.4/src/test/regression/tests/004.watchdog/standby.conf0000664000175000017500000000055713730350127021757 00000000000000# standby watchdog port = 11100 pcp_port = 11105 use_watchdog = on wd_interval = 1 wd_priority = 1 wd_hostname = 'localhost' wd_port = 21104 wd_heartbeat_port = 21105 heartbeat_destination0 = 'localhost' heartbeat_destination_port0 = 21005 other_pgpool_hostname0 = 'localhost' other_pgpool_port0 = 11000 other_wd_port0 = 21004 enable_consensus_with_half_votes = on pgpool-II-4.1.4/src/test/regression/tests/004.watchdog/test.sh0000775000175000017500000000611713730350127020760 00000000000000#!/usr/bin/env bash #------------------------------------------------------------------- # test script for watchdog source $TESTLIBS MASTER_DIR=master STANDBY_DIR=standby success_count=0 rm -fr $MASTER_DIR rm -fr $STANDBY_DIR mkdir $MASTER_DIR mkdir $STANDBY_DIR # dir in master directory cd $MASTER_DIR # create master environment echo -n "creating master pgpool..." $PGPOOL_SETUP -m n -n 1 -p 11000|| exit 1 echo "master setup done." # copy the configurations from to standby cp -r etc ../$STANDBY_DIR/ source ./bashrc.ports cat ../master.conf >> etc/pgpool.conf ./startall wait_for_pgpool_startup # back to test root dir cd .. # create standby environment mkdir $STANDBY_DIR/log echo -n "creating standby pgpool..." cat standby.conf >> $STANDBY_DIR/etc/pgpool.conf # since we are using the same pgpool-II conf as of master. so change the pid file path in standby pgpool conf echo "pid_file_name = '$PWD/pgpool2.pid'" >> $STANDBY_DIR/etc/pgpool.conf # start the stnadby pgpool-II by hand $PGPOOL_INSTALL_DIR/bin/pgpool -D -n -f $STANDBY_DIR/etc/pgpool.conf -F $STANDBY_DIR/etc/pcp.conf -a $STANDBY_DIR/etc/pool_hba.conf > $STANDBY_DIR/log/pgpool.log 2>&1 & # First test check if both pgpool-II have found their correct place in watchdog cluster. echo "Waiting for the pgpool master..." for i in 1 2 3 4 5 6 7 8 9 10 do grep "I am the cluster leader node. Starting escalation process" $MASTER_DIR/log/pgpool.log > /dev/null 2>&1 if [ $? = 0 ];then success_count=$(( success_count + 1 )) echo "Master brought up successfully." break; fi echo "[check] $i times" sleep 2 done # now check if standby has successfully joined connected to the master. echo "Waiting for the standby to join cluster..." for i in 1 2 3 4 5 6 7 8 9 10 do grep "successfully joined the watchdog cluster as standby node" $STANDBY_DIR/log/pgpool.log > /dev/null 2>&1 if [ $? = 0 ];then success_count=$(( success_count + 1 )) echo "Standby successfully connected." break; fi echo "[check] $i times" sleep 2 done # step 2 stop master pgpool and see if standby take over $PGPOOL_INSTALL_DIR/bin/pgpool -f $MASTER_DIR/etc/pgpool.conf -m f stop echo "Checking if the Standby pgpool-II detected the master shutdown..." for i in 1 2 3 4 5 6 7 8 9 10 do grep " is shutting down" $STANDBY_DIR/log/pgpool.log > /dev/null 2>&1 if [ $? = 0 ];then success_count=$(( success_count + 1 )) echo "Master shutdown detected." break; fi echo "[check] $i times" sleep 2 done # Finally see if standby take over echo "Checking if the Standby pgpool-II takes over the master responsibility..." for i in 1 2 3 4 5 6 7 8 9 10 do grep "I am the cluster leader node. Starting escalation process" $STANDBY_DIR/log/pgpool.log > /dev/null 2>&1 if [ $? = 0 ];then success_count=$(( success_count + 1 )) echo "Standby successfully became the new master." break; fi echo "[check] $i times" sleep 2 done # we are done. Just stop the standby pgpool-II $PGPOOL_INSTALL_DIR/bin/pgpool -f $STANDBY_DIR/etc/pgpool.conf -m f stop cd master ./shutdownall echo "$success_count out of 4 successfull"; if test $success_count -eq 4 then exit 0 fi exit 1 pgpool-II-4.1.4/src/test/regression/tests/005.jdbc/0000775000175000017500000000000013730350075016622 500000000000000pgpool-II-4.1.4/src/test/regression/tests/005.jdbc/.gitignore0000664000175000017500000000001113730350075020522 00000000000000testdir/ pgpool-II-4.1.4/src/test/regression/tests/005.jdbc/AutoCommitTest.java0000664000175000017500000000226613730350075022334 00000000000000import java.util.*; import java.io.*; import java.sql.*; public class AutoCommitTest extends PgpoolTest{ public String sql = "select * from autocommit where a = ?"; public static void main(String[] args) throws SQLException { AutoCommitTest test = new AutoCommitTest(); test.do_test(); } public void do_test() throws SQLException { connection.setAutoCommit(true); PreparedStatement stmt = null; ResultSet rs = null; try { for(int i = 0; i < 10; i++) { stmt = connection.prepareStatement(sql); try { stmt.setInt(1, i + 1); rs = stmt.executeQuery(); while(rs.next()){ logwriter.print(rs.getInt(1) + " "); } logwriter.println(); } finally { if(rs != null) rs.close(); if(stmt != null) stmt.close(); } } } finally { connection.close(); logwriter.close(); } } public String getTestName() { return "autocommit"; } } pgpool-II-4.1.4/src/test/regression/tests/005.jdbc/BatchTest.java0000664000175000017500000000270313730350075021270 00000000000000import java.util.*; import java.io.*; import java.sql.*; public class BatchTest extends PgpoolTest { public String [] batchSqls = new String[] { "INSERT INTO batch VALUES (1)", "INSERT INTO batch VALUES (1)", "INSERT INTO batch VALUES (1)", "INSERT INTO batch VALUES (1)", "INSERT INTO batch VALUES (1)", "INSERT INTO batch VALUES (1)", "INSERT INTO batch VALUES (1)", "INSERT INTO batch VALUES (1)", "INSERT INTO batch VALUES (1)", "INSERT INTO batch VALUES (1)", "INSERT INTO batch VALUES (1)", }; public void do_test() throws SQLException { connection.setAutoCommit(false); Statement stmt = null; ResultSet rs = null; try { try { stmt = connection.createStatement(); for(int i=0; i> etc/pgpool.conf source ./bashrc.ports # create Java property file cat > pgpool.properties < result.txt 2>&1 cmp result.txt expected.txt if [ $? != 0 ];then ./shutdownall; exit 1; fi ./shutdownall cd .. done exit 0 pgpool-II-4.1.4/src/test/regression/tests/006.memqcache/0000775000175000017500000000000013730350127017642 500000000000000pgpool-II-4.1.4/src/test/regression/tests/006.memqcache/.gitignore0000664000175000017500000000001113730350075021544 00000000000000testdir/ pgpool-II-4.1.4/src/test/regression/tests/006.memqcache/expected.txt0000664000175000017500000000000213730350075022116 000000000000002 pgpool-II-4.1.4/src/test/regression/tests/006.memqcache/jdbctest.java0000664000175000017500000000257513730350075022242 00000000000000import java.sql.*; import javax.sql.*; import java.util.*; import java.io.*; public class jdbctest { public static void main(String[] args) { try { Properties prop = new Properties(); prop.load(new FileInputStream("jdbctest.prop")); String url = prop.getProperty("jdbc.url"); String user = prop.getProperty("jdbc.user"); String pwd = prop.getProperty("jdbc.password"); Connection conn = DriverManager.getConnection(url, user, pwd); conn.setAutoCommit(true); String sql = "INSERT INTO t1 VALUES (1);"; Statement pst = conn.createStatement(); pst.executeUpdate(sql); pst.close(); PreparedStatement prest = conn.prepareStatement("SELECT * FROM t1"); ResultSet rs = prest.executeQuery(); rs.next(); rs.close(); prest.close(); /* * Cache test in an explicit transaction */ conn.setAutoCommit(false); // execute DML. This should prevent SELECTs from using query cache in the transaction. sql = "UPDATE t1 SET i = 2;"; pst = conn.createStatement(); pst.executeUpdate(sql); pst.close(); // should not use the cache and should return "2", rather than "1" prest = conn.prepareStatement("SELECT * FROM t1"); rs = prest.executeQuery(); rs.next(); System.out.println(rs.getInt(1)); rs.close(); prest.close(); conn.commit(); conn.close(); } catch (Exception e) { System.err.println("jdbctest: ERROR: " + e); System.exit(1); } } } pgpool-II-4.1.4/src/test/regression/tests/006.memqcache/test.sh0000775000175000017500000000476413730350127021113 00000000000000#!/usr/bin/env bash #------------------------------------------------------------------- # test script for memqcache. # requires Java PostgreSQL JDBC driver. PGBENCH=$PGBENCH_PATH WHOAMI=`whoami` source $TESTLIBS TESTDIR=testdir PSQL=$PGBIN/psql for mode in s r n do rm -fr $TESTDIR mkdir $TESTDIR cd $TESTDIR # create test environment echo -n "creating test environment..." $PGPOOL_SETUP -m $mode -n 2 || exit 1 echo "done." echo "memory_cache_enabled = on" >> etc/pgpool.conf echo "white_memqcache_table_list = 'white_v'" >> etc/pgpool.conf echo "black_memqcache_table_list = 'black_t'" >> etc/pgpool.conf source ./bashrc.ports export PGPORT=$PGPOOL_PORT echo "jdbc.url=jdbc:postgresql://localhost:$PGPOOL_PORT/test" > jdbctest.prop echo "jdbc.user=$WHOAMI" >> jdbctest.prop echo "jdbc.password=" >> jdbctest.prop cp ../jdbctest.java . javac jdbctest.java export CLASSPATH=.:$JDBC_DRIVER ./startall wait_for_pgpool_startup $PSQL test < /dev/null || success=false grep "fetched from cache" log/pgpool.log | grep black_t > /dev/null && success=false grep "fetched from cache" log/pgpool.log | grep normal_v > /dev/null && success=false grep "fetched from cache" log/pgpool.log | grep white_v > /dev/null || success=false grep "fetched from cache" log/pgpool.log | grep with_modify > /dev/null && success=false grep "fetched from cache" log/pgpool.log | grep explain_analyze > /dev/null && success=false if [ $success = false ];then ./shutdownall exit 1 fi java jdbctest > result.txt 2>&1 cmp ../expected.txt result.txt if [ $? != 0 ];then ./shutdownall exit 1 fi ./shutdownall cd .. done exit 0 pgpool-II-4.1.4/src/test/regression/tests/007.memqcache-memcached/0000775000175000017500000000000013730350075021551 500000000000000pgpool-II-4.1.4/src/test/regression/tests/007.memqcache-memcached/.gitignore0000664000175000017500000000001113730350075023451 00000000000000testdir/ pgpool-II-4.1.4/src/test/regression/tests/007.memqcache-memcached/expected.txt0000664000175000017500000000000213730350075024023 000000000000002 pgpool-II-4.1.4/src/test/regression/tests/007.memqcache-memcached/jdbctest.java0000664000175000017500000000257413730350075024146 00000000000000import java.sql.*; import javax.sql.*; import java.util.*; import java.io.*; public class jdbctest { public static void main(String[] args) { try { Properties prop = new Properties(); prop.load(new FileInputStream("jdbctest.prop")); String url = prop.getProperty("jdbc.url"); String user = prop.getProperty("jdbc.user"); String pwd = prop.getProperty("jdbc.password"); Connection conn = DriverManager.getConnection(url, user, pwd); conn.setAutoCommit(true); String sql = "INSERT INTO t1 VALUES (1);"; Statement pst = conn.createStatement(); pst.executeUpdate(sql); pst.close(); PreparedStatement prest = conn.prepareStatement("SELECT * FROM t1"); ResultSet rs = prest.executeQuery(); rs.next(); rs.close(); prest.close(); /* * Cache test in a explicit transaction */ conn.setAutoCommit(false); // execute DML. This should prevent SELECTs from using query cache in the transaction. sql = "UPDATE t1 SET i = 2;"; pst = conn.createStatement(); pst.executeUpdate(sql); pst.close(); // should not use the cache and should return "2", rather than "1" prest = conn.prepareStatement("SELECT * FROM t1"); rs = prest.executeQuery(); rs.next(); System.out.println(rs.getInt(1)); rs.close(); prest.close(); conn.commit(); conn.close(); } catch (Exception e) { System.err.println("jdbctest: ERROR: " + e); System.exit(1); } } } pgpool-II-4.1.4/src/test/regression/tests/007.memqcache-memcached/test.sh0000775000175000017500000000216013730350075023006 00000000000000#!/usr/bin/env bash #------------------------------------------------------------------- # test script for memqcache with memcached. # need to configure --with-memcached=/usr. # requires Java PostgreSQL JDBC driver. PGBENCH=$PGBENCH_PATH WHOAMI=`whoami` source $TESTLIBS TESTDIR=testdir PSQL=$PGBIN/psql for mode in s r n do rm -fr $TESTDIR mkdir $TESTDIR cd $TESTDIR # create test environment echo -n "creating test environment..." $PGPOOL_SETUP -m $mode -n 2 || exit 1 echo "done." echo "memory_cache_enabled = on" >> etc/pgpool.conf echo "memqcache_method = 'memcached'" >> etc/pgpool.conf source ./bashrc.ports export PGPORT=$PGPOOL_PORT echo "jdbc.url=jdbc:postgresql://localhost:$PGPOOL_PORT/test" > jdbctest.prop echo "jdbc.user=$WHOAMI" >> jdbctest.prop echo "jdbc.password=" >> jdbctest.prop cp ../jdbctest.java . javac jdbctest.java export CLASSPATH=.:$JDBC_DRIVER ./startall wait_for_pgpool_startup $PSQL test < result.txt 2>&1 cmp ../expected.txt result.txt if [ $? != 0 ];then ./shutdownall exit 1 fi ./shutdownall cd .. done exit 0 pgpool-II-4.1.4/src/test/regression/tests/008.dbredirect/0000775000175000017500000000000013730350127020030 500000000000000pgpool-II-4.1.4/src/test/regression/tests/008.dbredirect/.gitignore0000664000175000017500000000001113730350075021732 00000000000000testdir/ pgpool-II-4.1.4/src/test/regression/tests/008.dbredirect/select.pgbench0000664000175000017500000000001713730350075022557 00000000000000SELECT 'test9' pgpool-II-4.1.4/src/test/regression/tests/008.dbredirect/select1.pgbench0000664000175000017500000000002013730350075022632 00000000000000SELECT 'test11' pgpool-II-4.1.4/src/test/regression/tests/008.dbredirect/test.sh0000775000175000017500000000652413730350127021275 00000000000000#!/usr/bin/env bash #------------------------------------------------------------------- # test script for database_redirect_preference_list and app_name_redirect_preference_list. # requires pgbench. # source $TESTLIBS TESTDIR=testdir PSQL=$PGBIN/psql CREATEDB=$PGBIN/createdb PGBENCH=$PGBENCH_PATH function getnode() { grep $1 log/pgpool.log | grep SELECT | grep LOG | awk '{print $9}' } rm -fr $TESTDIR mkdir $TESTDIR cd $TESTDIR # create test environment echo -n "creating test environment..." $PGPOOL_SETUP -m s -n 3 || exit 1 echo "done." source ./bashrc.ports echo "database_redirect_preference_list = 'postgres:primary,test:1,mydb[5-9]:2,test2:standby,test3:primary(0.0),test4:standby(0.0),test5:primary(1.0)'" >> etc/pgpool.conf # disable delay_threshold so that replication delay does not affect the tests. echo "delay_threshold = 0" >> etc/pgpool.conf ./startall export PGPORT=$PGPOOL_PORT wait_for_pgpool_startup $PSQL -c "show pool_nodes" postgres $CREATEDB mydb6 $CREATEDB test2 $CREATEDB test3 $CREATEDB test4 $CREATEDB test5 # check to see if all databases have been replicated for p in 3 4 do # set standby port myport=`expr $PGPOOL_PORT + $p` for r in 1 2 3 4 5 do ok=true for i in mydb6 test2 test3 test4 test5 do echo "try to connect to $i:$myport" $PSQL -p $myport -c "select 1" $i if [ $? != 0 ];then ok=false break fi done if [ $ok = "false" ];then sleep 1 else break fi done done $PGBENCH -i postgres ok=yes # should be redirect to primary (node 0) $PSQL -c "SELECT 'test1'" postgres test `getnode "'test1'"` -eq 0 || ok=ng echo $ok # should be redirect to node 1 $PSQL -c "SELECT 'test2'" test test `getnode "'test2'"` -eq 1 || ok=ng echo $ok # should be redirect to node 2 $PSQL -c "SELECT 'test3'" mydb6 test `getnode "'test3'"` -eq 2 || ok=ng echo $ok # should be redirect to either node 1 or 2 $PSQL -c "SELECT 'test4'" test2 test `getnode "'test4'"` -eq 1 -o `getnode "test4"` -eq 2 || ok=ng echo $ok # should be redirect to either node 1 or 2 $PSQL -c "SELECT 'test5'" test3 test `getnode "'test5'"` -eq 1 -o `getnode "test5"` -eq 2 || ok=ng echo $ok # should be redirect to primary (node 0) $PSQL -c "SELECT 'test6'" test4 test `getnode "'test6'"` -eq 0 || ok=ng echo $ok # should be redirect to primary (node 0) $PSQL -c "SELECT 'test7'" test5 test `getnode "'test7'"` -eq 0 || ok=ng echo $ok echo "app_name_redirect_preference_list = 'psql:primary,pgbench:standby'" >> etc/pgpool.conf ./pgpool_reload sleep 10 wait_for_pgpool_startup # should be redirect to node 0 because application name is psql $PSQL -c "SELECT 'test8'" mydb6 test `getnode "'test8'"` -eq 0 || ok=ng echo $ok # should be redirect to either node 1 or 2 $PGBENCH -t 1 -f ../select.pgbench postgres test `getnode "'test9'"` -eq 1 -o `getnode "test9"` -eq 2 || ok=ng echo $ok echo "app_name_redirect_preference_list = 'psql:primary(0.0),pgbench:standby(1.0)'" >> etc/pgpool.conf ./pgpool_reload sleep 10 wait_for_pgpool_startup # should be redirect to either node 1 or 2 $PSQL -c "SELECT 'test10'" mydb6 test `getnode "'test10'"` -eq 1 -o `getnode "test10"` -eq 2 || ok=ng echo $ok # should be redirect to either node 1 or 2 $PGBENCH -t 1 -f ../select1.pgbench postgres test `getnode "'test11'"` -eq 1 -o `getnode "test11"` -eq 2 || ok=ng echo $ok ./shutdownall if [ $ok = "yes" ];then exit 0 fi exit 1 pgpool-II-4.1.4/src/test/regression/tests/009.sql_comments/0000775000175000017500000000000013730350127020426 500000000000000pgpool-II-4.1.4/src/test/regression/tests/009.sql_comments/.gitignore0000664000175000017500000000001113730350075022330 00000000000000testdir/ pgpool-II-4.1.4/src/test/regression/tests/009.sql_comments/test.sh0000775000175000017500000000273613730350127021674 00000000000000#!/usr/bin/env bash #------------------------------------------------------------------- # test script for allow_sql_comments # source $TESTLIBS TESTDIR=testdir PSQL=$PGBIN/psql function getnode() { grep $1 log/pgpool.log | grep SELECT | grep LOG: |awk '{print $9}' } rm -fr $TESTDIR mkdir $TESTDIR cd $TESTDIR # create test environment echo -n "creating test environment..." $PGPOOL_SETUP -m s -n 2 || exit 1 echo "done." source ./bashrc.ports echo "backend_weight0 = 0" >> etc/pgpool.conf echo "backend_weight1 = 1" >> etc/pgpool.conf echo "allow_sql_comments = off" >> etc/pgpool.conf ./startall export PGPORT=$PGPOOL_PORT wait_for_pgpool_startup ok=yes # should be redirect to node 1 $PSQL -c "SELECT 'case1'" test test `getnode "case1"` -eq 1 || ok=ng # should be redirect to node 0 $PSQL -c "/* comment */SELECT 'case2'" test test `getnode "case2"` -eq 0 || ok=ng # should be redirect to node 0 $PSQL -c "/*No LOAD BALANCE*/SELECT 'case3'" test test `getnode "case3"` -eq 0 || ok=ng echo "allow_sql_comments = on" >> etc/pgpool.conf ./pgpool_reload sleep 1 wait_for_pgpool_startup # should be redirect to node 1 $PSQL -c "SELECT 'case4'" test test `getnode "case4"` -eq 1 || ok=ng # should be redirect to node 1 $PSQL -c "/* comment */SELECT 'case5'" test test `getnode "case5"` -eq 1 || ok=ng # should be redirect to node 0 $PSQL -c "/*No LOAD BALANCE*/SELECT 'case6'" test test `getnode "case6"` -eq 0 || ok=ng ./shutdownall if [ $ok = "yes" ];then exit 0 fi exit 1 pgpool-II-4.1.4/src/test/regression/tests/010.rewrite_timestamp/0000775000175000017500000000000013730350075021460 500000000000000pgpool-II-4.1.4/src/test/regression/tests/010.rewrite_timestamp/expected.txt0000664000175000017500000000012413730350075023737 00000000000000./run-test parse_schedule testcase insert: OK testcase update: OK testcase misc: OK pgpool-II-4.1.4/src/test/regression/tests/010.rewrite_timestamp/test.sh0000775000175000017500000000051013730350075022712 00000000000000#!/usr/bin/env bash #------------------------------------------------------------------- # test script for unit test of rewriting timestamp qeries. # requires Ruby cd timestamp make clean rm result.txt make make test > result.txt cmp ../expected.txt result.txt if [ $? != 0 ];then echo NG exit 1 fi cd .. echo OK exit 0 pgpool-II-4.1.4/src/test/regression/tests/010.rewrite_timestamp/timestamp/0000775000175000017500000000000013730350127023461 500000000000000pgpool-II-4.1.4/src/test/regression/tests/010.rewrite_timestamp/timestamp/.gitignore0000664000175000017500000000001313730350075025365 00000000000000result.txt pgpool-II-4.1.4/src/test/regression/tests/010.rewrite_timestamp/timestamp/expected/0000775000175000017500000000000013730350075025264 500000000000000pgpool-II-4.1.4/src/test/regression/tests/010.rewrite_timestamp/timestamp/expected/insert.out0000664000175000017500000000331413730350075027242 00000000000000INSERT INTO "rel1" VALUES (DEFAULT,'2009-01-01 23:59:59.123456+09',DEFAULT,'2009-01-01 23:59:59.123456+09') INSERT INTO rel2 DEFAULT VALUES INSERT INTO rel2(c1) VALUES(1) INSERT INTO "rel1" VALUES (1,"pg_catalog"."timestamptz"('2009-01-01 23:59:59.123456+09'::text),2,'2009-01-01 23:59:59.123456+09'::text::date) INSERT INTO "rel1" VALUES (3,'2009-01-01 23:59:59.123456+09'::text::timestamptz,4,'2009-01-01 23:59:59.123456+09'::text::timetz) INSERT INTO "rel1" VALUES (5,'2009-01-01 23:59:59.123456+09'::text::timestamptz(0),6,'2009-01-01 23:59:59.123456+09'::text::timetz(0)) INSERT INTO "rel1" VALUES (7,'2009-01-01 23:59:59.123456+09'::text::timestamp,8,'2009-01-01 23:59:59.123456+09'::text::time) INSERT INTO "rel1" VALUES (9,'2009-01-01 23:59:59.123456+09'::text::timestamp(0),10,'2009-01-01 23:59:59.123456+09'::text::time(0)) INSERT INTO "rel1" VALUES (11,'2009-01-01 23:59:59.123456+09',DEFAULT,'2009-01-01 23:59:59.123456+09') INSERT INTO "rel1"("c3", "c2", "c4") VALUES (1,'2009-01-01 23:59:59.123456+09','2009-01-01 23:59:59.123456+09') INSERT INTO "rel1"("c2", "c1", "c4") VALUES ('2000-1-1',1,'2009-01-01 23:59:59.123456+09') INSERT INTO "rel1"("c2", "c1", "c4") VALUES ('2009-01-01 23:59:59.123456+09',2,'2009-01-01 23:59:59.123456+09') INSERT INTO "rel1"("c2", "c1", "c4") VALUES ('2009-01-01 23:59:59.123456+09',3,'2009-01-01 23:59:59.123456+09'), ('2009-01-01 23:59:59.123456+09',4,'2009-01-01 23:59:59.123456+09'), ('2009-1-1',5,'2009-01-01 23:59:59.123456+09') INSERT INTO rel1(c1, c2, c4) VALUES(1, '2009-1-1', '2009-2-2') PREPARE "q" (timestamptz,timestamptz) AS INSERT INTO "rel1"("c3", "c2", "c4") VALUES (1,$1,$2) PREPARE "q" (int4,timestamptz,timestamptz) AS INSERT INTO "rel1"("c3", "c2", "c4") VALUES ($1,$2,$3) pgpool-II-4.1.4/src/test/regression/tests/010.rewrite_timestamp/timestamp/expected/misc.out0000664000175000017500000000040613730350075026670 00000000000000DELETE FROM "rel1" WHERE ("c1"='2009-01-01 23:59:59.123456+09'::text::date ) PREPARE "q" ("date",timestamptz) AS DELETE FROM "rel1" WHERE ( ("c1"=$1 ) AND ("c3"=$2::text::date )) EXECUTE "q" ("pg_catalog"."timestamptz"('2009-01-01 23:59:59.123456+09'::text)) pgpool-II-4.1.4/src/test/regression/tests/010.rewrite_timestamp/timestamp/expected/update.out0000664000175000017500000000113213730350075027214 00000000000000UPDATE "rel1" SET "c1" = DEFAULT, "c2" = '2009-01-01 23:59:59.123456+09' UPDATE rel2 SET c1 = DEFAULT, c2 = DEFAULT UPDATE "rel1" SET "c1" = "pg_catalog"."timestamptz"('2009-01-01 23:59:59.123456+09'::text), "c2" = '2009-01-01 23:59:59.123456+09'::text::date UPDATE "rel1" SET ("c3", "c4") = ('2009-01-01 23:59:59.123456+09'::text::timestamptz,'2009-01-01 23:59:59.123456+09'::text::timetz) UPDATE "rel1" SET "c1" = '2009-01-01 23:59:59.123456+09'::text::timestamp, "c2" = '2009-01-01 23:59:59.123456+09'::text::time PREPARE "q" (int4,timestamptz) AS UPDATE "rel1" SET "c1" = $1, "c2" = $2::text::date pgpool-II-4.1.4/src/test/regression/tests/010.rewrite_timestamp/timestamp/input/0000775000175000017500000000000013730350075024622 500000000000000pgpool-II-4.1.4/src/test/regression/tests/010.rewrite_timestamp/timestamp/input/insert.sql0000664000175000017500000000142713730350075026573 00000000000000INSERT INTO rel1 DEFAULT VALUES INSERT INTO rel2 DEFAULT VALUES INSERT INTO rel2(c1) VALUES(1) INSERT INTO rel1 VALUES(1, now(), 2, CURRENT_DATE) INSERT INTO rel1 VALUES(3, CURRENT_TIMESTAMP, 4, CURRENT_TIME) INSERT INTO rel1 VALUES(5, CURRENT_TIMESTAMP(0), 6, CURRENT_TIME(0)) INSERT INTO rel1 VALUES(7, LOCALTIMESTAMP, 8, LOCALTIME) INSERT INTO rel1 VALUES(9, LOCALTIMESTAMP(0), 10, LOCALTIME(0)) INSERT INTO rel1 VALUES(11, DEFAULT); INSERT INTO rel1(c3) VALUES(1) INSERT INTO rel1(c2, c1) VALUES('2000-1-1', 1) INSERT INTO rel1(c2, c1) VALUES(DEFAULT, 2) INSERT INTO rel1(c2, c1) VALUES(DEFAULT, 3), (DEFAULT, 4), ('2009-1-1', 5) INSERT INTO rel1(c1, c2, c4) VALUES(1, '2009-1-1', '2009-2-2') PREPARE q AS INSERT INTO rel1(c3) VALUES(1) PREPARE q(int) AS INSERT INTO rel1(c3) VALUES($1) pgpool-II-4.1.4/src/test/regression/tests/010.rewrite_timestamp/timestamp/input/misc.sql0000664000175000017500000000020213730350075026210 00000000000000DELETE FROM rel1 WHERE c1 = CURRENT_DATE PREPARE q(date) AS DELETE FROM rel1 WHERE c1 = $1 AND c3 = CURRENT_DATE EXECUTE q(now()) pgpool-II-4.1.4/src/test/regression/tests/010.rewrite_timestamp/timestamp/input/update.sql0000664000175000017500000000046213730350075026547 00000000000000UPDATE rel1 SET c1 = DEFAULT, c2 = DEFAULT UPDATE rel2 SET c1 = DEFAULT, c2 = DEFAULT UPDATE rel1 SET c1 = now(), c2 = CURRENT_DATE UPDATE rel1 SET (c3, c4) = (CURRENT_TIMESTAMP, CURRENT_TIME) UPDATE rel1 SET c1 = LOCALTIMESTAMP, c2 = LOCALTIME PREPARE q(int) AS UPDATE rel1 SET c1 = $1, c2 = CURRENT_DATE pgpool-II-4.1.4/src/test/regression/tests/010.rewrite_timestamp/timestamp/parse_schedule0000664000175000017500000000002313730350075026307 00000000000000insert update misc pgpool-II-4.1.4/src/test/regression/tests/010.rewrite_timestamp/timestamp/run-test0000775000175000017500000000251213730350075025112 00000000000000#! /usr/bin/env ruby # $Header$ # # Usage./run-test schedule # ignore a line at the beginning of '#' # INPUT_DIRECTORY="input" EXPECTED_DIRECTORY="expected" RESULT_DIRECTORY="result" TEST_PROGRAM="./timestamp-test" DIFF_FILE="test.diff" def escape_string str str.gsub(/([\$\"\\])/) { "\\" + $1 } end if ARGV.size != 1 STDERR.puts "run-test schedule_file" exit 1 end file = ARGV.shift if !(File.exists? file) STDERR.puts "run-test: file does not exist: #{file}" exit 1 end if !(File.exists? RESULT_DIRECTORY) Dir.mkdir RESULT_DIRECTORY else Dir["#{RESULT_DIRECTORY}/*.out"].each do |f| File.unlink f end end File.unlink DIFF_FILE if File.exists? DIFF_FILE begin IO.foreach(file) do |testcase| testcase.chomp! if (/^\#/ =~ testcase or testcase == "") next end print "testcase #{testcase}:\t" begin IO.foreach("#{INPUT_DIRECTORY}/#{testcase}.sql") do |test_sql| test_sql.chomp! system("#{TEST_PROGRAM} \"#{escape_string(test_sql)}\" >> #{RESULT_DIRECTORY}/#{testcase}.out\n") end system("diff -c #{EXPECTED_DIRECTORY}/#{testcase}.out #{RESULT_DIRECTORY}/#{testcase}.out >> #{DIFF_FILE}") if ($? == 0) print "OK\n" else print "FAILED\n" end rescue print "FAILED\n" end end rescue STDERR.puts "NG" end pgpool-II-4.1.4/src/test/regression/tests/010.rewrite_timestamp/timestamp/Makefile0000664000175000017500000000134213730350127025041 00000000000000PROGRAM=timestamp-test topsrc_dir=../../../../.. CPPFLAGS=-I$(topsrc_dir)/include -I$(shell pg_config --includedir) CFLAGS=-Wall -O0 -g CC=gcc OBJS=main.o \ $(topsrc_dir)/utils/strlcpy.o \ $(topsrc_dir)/utils/psprintf.o \ $(topsrc_dir)/rewrite/pool_timestamp.o \ $(topsrc_dir)/parser/libsql-parser.a all: all-pre $(PROGRAM) all-pre: $(MAKE) -C $(topsrc_dir)/utils strlcpy.o $(MAKE) -C $(topsrc_dir)/utils psprintf.o $(MAKE) -C $(topsrc_dir)/rewrite pool_timestamp.o $(MAKE) -C $(topsrc_dir)/parser $(PROGRAM): $(OBJS) $(CC) $(OBJS) -o $(PROGRAM) main.o: main.c test: $(PROGRAM) ./run-test parse_schedule clean: -rm *.o -rm $(PROGRAM) -rm result/*.out -rm result.txt -rm test.diff .PHONY: all all-pre test clean pgpool-II-4.1.4/src/test/regression/tests/010.rewrite_timestamp/timestamp/main.c0000664000175000017500000000703513730350127024476 00000000000000#include #include #include #include "pool.h" #include "pool_config.h" #include "utils/pool_relcache.h" #include "rewrite/pool_timestamp.h" #include "parser/parser.h" /* for get_current_timestamp() (MASTER() macro) */ POOL_REQUEST_INFO _req_info; POOL_REQUEST_INFO *Req_info = &_req_info; POOL_CONFIG _pool_config; POOL_CONFIG *pool_config = &_pool_config; ProcessType processType; typedef struct { char *attrname; /* attribute name */ char *adsrc; /* default value expression */ int use_timestamp; } TSAttr; typedef struct { int relnatts; TSAttr attr[4]; } TSRel; TSRel rc[2] = { {4, { {"c1", "", 0}, {"c2", "", 1}, {"c3", "", 0}, {"c4", "", 1} }}, {4, { {"c1", "", 0}, {"c2", "", 0}, {"c3", "", 0}, {"c4", "", 0} }} }; int pool_virtual_master_db_node_id(void) { return 0; } bool pool_has_pgpool_regclass(void) { return false; } bool pool_has_to_regclass(void) { return false; } char * remove_quotes_and_schema_from_relname(char *table) { return table; } int pool_get_major_version(void) { return PROTO_MAJOR_V3; } PGVersion * Pgversion(POOL_CONNECTION_POOL * backend) { #define VERSION_BUF_SIZE 10 static PGVersion pgversion; pgversion.major = 12; pgversion.minor = 0; return &pgversion; } POOL_RELCACHE * pool_create_relcache(int cachesize, char *sql, func_ptr register_func, func_ptr unregister_func, bool issessionlocal) { return (POOL_RELCACHE *) 1; } /* dummy result of relcache (attrname, adsrc, usetimestamp)*/ void * pool_search_relcache(POOL_RELCACHE * relcache, POOL_CONNECTION_POOL * backend, char *table) { if (strcmp(table, "\"rel1\"") == 0) return (void *) &(rc[0]); else return (void *) &(rc[1]); } /* dummy result of "SELECT now()" */ void do_query(POOL_CONNECTION * backend, char *query, POOL_SELECT_RESULT * *result, int major) { static POOL_SELECT_RESULT res; static char *data[1] = { "2009-01-01 23:59:59.123456+09" }; res.numrows = 1; res.data = data; *result = &res; } char * make_table_name_from_rangevar(RangeVar *rangevar) { /* XXX: alias (AS ...) is left */ return nodeToString(rangevar); } int main(int argc, char **argv) { char *query; List *tree; ListCell *l; StartupPacket sp; POOL_CONNECTION_POOL backend; POOL_CONNECTION_POOL_SLOT slot; POOL_SENT_MESSAGE msg; POOL_QUERY_CONTEXT ctx; backend.slots[0] = &slot; slot.sp = &sp; bool error; MemoryContextInit(); pool_config->replication_mode = 1; if (argc != 2) { fprintf(stderr, "./timestmp-test query\n"); exit(1); } tree = raw_parser(argv[1], strlen(argv[1]), &error, false); if (tree == NULL) { printf("syntax error: %s\n", argv[1]); } else { foreach(l, tree) { msg.num_tsparams = 0; msg.query_context = &ctx; Node *node = (Node *) lfirst(l); query = rewrite_timestamp(&backend, ((RawStmt *) node)->stmt, false, &msg); if (query) printf("%s\n", query); else printf("%s\n", argv[1]); } } return 0; } void free_select_result(POOL_SELECT_RESULT * result) { } POOL_SESSION_CONTEXT * pool_get_session_context(bool noerror) { return NULL; } int pg_frontend_exists(void) { return 0; } int get_frontend_protocol_version(void) { return 0; } int set_pg_frontend_blocking(bool blocking) { return 0; } int send_to_pg_frontend(char *data, int len, bool flush) { return 0; } int pool_send_to_frontend(char *data, int len, bool flush) { return 0; } int pool_frontend_exists(void) { return 0; } void ExceptionalCondition (const char *conditionName, const char *errorType, const char *fileName, int lineNumber) { } pgpool-II-4.1.4/src/test/regression/tests/011.watchdog_quorum_failover/0000775000175000017500000000000013730350127023012 500000000000000pgpool-II-4.1.4/src/test/regression/tests/011.watchdog_quorum_failover/.gitignore0000664000175000017500000000003313730350075024720 00000000000000master/ standby/ standby2/ pgpool-II-4.1.4/src/test/regression/tests/011.watchdog_quorum_failover/master.conf0000664000175000017500000000071313730350127025075 00000000000000# master watchdog use_watchdog = on wd_interval = 1 wd_priority = 5 wd_hostname = 'localhost' wd_port = 21004 wd_heartbeat_port = 21005 heartbeat_destination0 = 'localhost' heartbeat_destination_port0 = 21105 heartbeat_destination1 = 'localhost' heartbeat_destination_port1 = 21205 other_pgpool_hostname0 = 'localhost' other_pgpool_port0 = 11100 other_wd_port0 = 21104 other_pgpool_hostname1 = 'localhost' other_pgpool_port1 = 11200 other_wd_port1 = 21204 pgpool-II-4.1.4/src/test/regression/tests/011.watchdog_quorum_failover/standby.conf0000664000175000017500000000075213730350127025251 00000000000000# standby watchdog port = 11100 pcp_port = 11105 use_watchdog = on wd_interval = 1 wd_priority = 3 wd_hostname = 'localhost' wd_port = 21104 wd_heartbeat_port = 21105 heartbeat_destination0 = 'localhost' heartbeat_destination_port0 = 21005 heartbeat_destination1 = 'localhost' heartbeat_destination_port1 = 21205 other_pgpool_hostname0 = 'localhost' other_pgpool_port0 = 11000 other_wd_port0 = 21004 other_pgpool_hostname1 = 'localhost' other_pgpool_port1 = 11200 other_wd_port1 = 21204 pgpool-II-4.1.4/src/test/regression/tests/011.watchdog_quorum_failover/standby2.conf0000664000175000017500000000075313730350127025334 00000000000000# standby2 watchdog port = 11200 pcp_port = 11205 use_watchdog = on wd_interval = 1 wd_priority = 1 wd_hostname = 'localhost' wd_port = 21204 wd_heartbeat_port = 21205 heartbeat_destination0 = 'localhost' heartbeat_destination_port0 = 21005 heartbeat_destination1 = 'localhost' heartbeat_destination_port1 = 21105 other_pgpool_hostname0 = 'localhost' other_pgpool_port0 = 11000 other_wd_port0 = 21004 other_pgpool_hostname1 = 'localhost' other_pgpool_port1 = 11100 other_wd_port1 = 21104 pgpool-II-4.1.4/src/test/regression/tests/011.watchdog_quorum_failover/test.sh0000775000175000017500000001441513730350127024255 00000000000000#!/usr/bin/env bash #------------------------------------------------------------------- # test script for watchdog # # Please note that to successfully run the test, "HEALTHCHECK_DEBUG" # must be defined before compiling main/health_check.c. source $TESTLIBS MASTER_DIR=master STANDBY_DIR=standby STANDBY2_DIR=standby2 num_tests=9 success_count=0 PSQL=$PGBIN/psql PG_CTL=$PGBIN/pg_ctl rm -fr $MASTER_DIR rm -fr $STANDBY_DIR rm -fr $STANDBY2_DIR mkdir $MASTER_DIR mkdir $STANDBY_DIR mkdir $STANDBY2_DIR # dir in master directory cd $MASTER_DIR # create master environment echo -n "creating master pgpool and PostgreSQL clusters..." $PGPOOL_SETUP -m s -n 2 -p 11000|| exit 1 echo "master setup done." # copy the configurations from master to standby cp -r etc ../$STANDBY_DIR/ # copy the configurations from master to standby2 cp -r etc ../$STANDBY2_DIR/ source ./bashrc.ports cat ../master.conf >> etc/pgpool.conf ./startall wait_for_pgpool_startup # back to test root dir cd .. # create standby environment mkdir $STANDBY_DIR/log echo -n "creating standby pgpool..." cat standby.conf >> $STANDBY_DIR/etc/pgpool.conf # since we are using the same pgpool-II conf as of master. so change the pid file path in standby pgpool conf echo "pid_file_name = '$PWD/pgpool2.pid'" >> $STANDBY_DIR/etc/pgpool.conf echo "logdir = $STANDBY_DIR/log" >> $STANDBY_DIR/etc/pgpool.conf # start the stnadby pgpool-II by hand $PGPOOL_INSTALL_DIR/bin/pgpool -D -n -f $STANDBY_DIR/etc/pgpool.conf -F $STANDBY_DIR/etc/pcp.conf -a $STANDBY_DIR/etc/pool_hba.conf > $STANDBY_DIR/log/pgpool.log 2>&1 & # create standby2 environment mkdir $STANDBY2_DIR/log echo -n "creating standby2 pgpool..." cat standby2.conf >> $STANDBY2_DIR/etc/pgpool.conf # since we are using the same pgpool-II conf as of master. so change the pid file path in standby pgpool conf echo "pid_file_name = '$PWD/pgpool3.pid'" >> $STANDBY2_DIR/etc/pgpool.conf echo "logdir = $STANDBY2_DIR/log" >> $STANDBY2_DIR/etc/pgpool.conf # start the stnadby pgpool-II by hand $PGPOOL_INSTALL_DIR/bin/pgpool -D -n -f $STANDBY2_DIR/etc/pgpool.conf -F $STANDBY2_DIR/etc/pcp.conf -a $STANDBY2_DIR/etc/pool_hba.conf > $STANDBY2_DIR/log/pgpool.log 2>&1 & # First test check if both pgpool-II have found their correct place in watchdog cluster. echo "Waiting for the pgpool master..." for i in 1 2 3 4 5 6 7 8 9 10 do grep "I am the cluster leader node" $MASTER_DIR/log/pgpool.log > /dev/null 2>&1 if [ $? = 0 ];then success_count=$(( success_count + 1 )) echo "Master brought up successfully." break; fi echo "[check] $i times" sleep 2 done # now check if standby has successfully joined connected to the master. echo "Waiting for the standby to join cluster..." for i in 1 2 3 4 5 6 7 8 9 10 do grep "successfully joined the watchdog cluster as standby node" $STANDBY_DIR/log/pgpool.log > /dev/null 2>&1 if [ $? = 0 ];then success_count=$(( success_count + 1 )) echo "Standby2 successfully connected." break; fi echo "[check] $i times" sleep 2 done # now check if standby2 has successfully joined connected to the master. echo "Waiting for the standby2 to join cluster..." for i in 1 2 3 4 5 6 7 8 9 10 do grep "successfully joined the watchdog cluster as standby node" $STANDBY2_DIR/log/pgpool.log > /dev/null 2>&1 if [ $? = 0 ];then success_count=$(( success_count + 1 )) echo "Standby2 successfully connected." break; fi echo "[check] $i times" sleep 2 done # raise an artificial communication error on standby2 for DB node 1 echo "1 down" > $STANDBY2_DIR/log/backend_down_request echo "Checking if the Standby2 fooled by fake error..." for i in 1 2 3 4 5 6 7 8 9 10 do grep -i "failover" $STANDBY2_DIR/log/pgpool.log if [ $? = 0 ];then success_count=$(( success_count + 1 )) echo "Fake DB error detected." break; fi echo "[check] $i times" sleep 2 done # check to see if all Pgpool-II agrees that the failover request is # discarded. echo "Checking if all Pgpool-II agrees that the failover request is discarded." n=0 for p in 11000 11100 11200 do $PSQL -p $p -c "show pool_nodes" test|grep standby|grep up >/dev/null 2>&1 if [ $? = 0 ];then n=$(( n + 1)) fi done if [ $n -eq 3 ];then echo "All Pgpool-II agrees that the failover request is discarded." success_count=$(( success_count + 1 )) fi # raise an real DB node 1 error $PG_CTL -D master/data1 -m f stop echo "Checking if master detects the shutdown error" for i in 1 2 3 4 5 6 7 8 9 10 do grep -i "failover" $MASTER_DIR/log/pgpool.log if [ $? = 0 ];then success_count=$(( success_count + 1 )) echo "DB error detected." break; fi echo "[check] $i times" sleep 2 done # check to see if all Pgpool-II agrees that the failover request is # executed echo "Checking if all Pgpool-II agrees that the failover request is executed" for i in 1 2 3 4 5 6 7 8 9 10 do n=0 for p in 11000 11100 11200 do $PSQL -p $p -c "show pool_nodes" test|grep standby|grep down >/dev/null 2>&1 if [ $? = 0 ];then n=$(( n + 1)) fi done if [ $n -eq 3 ];then success_count=$(( success_count + 1 )) echo "All Pgpool-II agrees that the failover request is executed" break; fi echo "[check] $i times" sleep 2 done # stop master pgpool and see if standby takes over the roll $PGPOOL_INSTALL_DIR/bin/pgpool -f $MASTER_DIR/etc/pgpool.conf -m f stop echo "Checking if the Standby pgpool-II detected the master shutdown..." for i in 1 2 3 4 5 6 7 8 9 10 do grep " is shutting down" $STANDBY_DIR/log/pgpool.log > /dev/null 2>&1 if [ $? = 0 ];then success_count=$(( success_count + 1 )) echo "Master shutdown detected." break; fi echo "[check] $i times" sleep 2 done # Finally see if standby take over echo "Checking if the Standby pgpool-II takes over the master responsibility..." for i in 1 2 3 4 5 6 7 8 9 10 do grep "I am the cluster leader node" $STANDBY_DIR/log/pgpool.log > /dev/null 2>&1 if [ $? = 0 ];then success_count=$(( success_count + 1 )) echo "Standby successfully became the new master." break; fi echo "[check] $i times" sleep 2 done # we are done. Just stop the standby pgpool-II $PGPOOL_INSTALL_DIR/bin/pgpool -f $STANDBY_DIR/etc/pgpool.conf -m f stop $PGPOOL_INSTALL_DIR/bin/pgpool -f $STANDBY2_DIR/etc/pgpool.conf -m f stop cd master ./shutdownall echo "$success_count out of $num_tests successfull"; if test $success_count -eq $num_tests then exit 0 fi exit 1 pgpool-II-4.1.4/src/test/regression/tests/012.watchdog_failover_when_quorum_exists/0000775000175000017500000000000013730350127025433 500000000000000pgpool-II-4.1.4/src/test/regression/tests/012.watchdog_failover_when_quorum_exists/.gitignore0000664000175000017500000000003313730350075027341 00000000000000master/ standby/ standby2/ pgpool-II-4.1.4/src/test/regression/tests/012.watchdog_failover_when_quorum_exists/master.conf0000664000175000017500000000113213730350127027512 00000000000000# master watchdog num_init_children = 4 use_watchdog = on failover_when_quorum_exists = true failover_require_consensus = false allow_multiple_failover_requests_from_node = false wd_interval = 1 wd_priority = 5 wd_hostname = 'localhost' wd_port = 21004 wd_heartbeat_port = 21005 heartbeat_destination0 = 'localhost' heartbeat_destination_port0 = 21105 heartbeat_destination1 = 'localhost' heartbeat_destination_port1 = 21205 other_pgpool_hostname0 = 'localhost' other_pgpool_port0 = 11100 other_wd_port0 = 21104 other_pgpool_hostname1 = 'localhost' other_pgpool_port1 = 11200 other_wd_port1 = 21204 pgpool-II-4.1.4/src/test/regression/tests/012.watchdog_failover_when_quorum_exists/standby.conf0000664000175000017500000000117113730350127027666 00000000000000# standby watchdog num_init_children = 4 port = 11100 pcp_port = 11105 use_watchdog = on failover_when_quorum_exists = true failover_require_consensus = false allow_multiple_failover_requests_from_node = false wd_interval = 1 wd_priority = 3 wd_hostname = 'localhost' wd_port = 21104 wd_heartbeat_port = 21105 heartbeat_destination0 = 'localhost' heartbeat_destination_port0 = 21005 heartbeat_destination1 = 'localhost' heartbeat_destination_port1 = 21205 other_pgpool_hostname0 = 'localhost' other_pgpool_port0 = 11000 other_wd_port0 = 21004 other_pgpool_hostname1 = 'localhost' other_pgpool_port1 = 11200 other_wd_port1 = 21204 pgpool-II-4.1.4/src/test/regression/tests/012.watchdog_failover_when_quorum_exists/standby2.conf0000664000175000017500000000117213730350127027751 00000000000000# standby2 watchdog num_init_children = 4 port = 11200 pcp_port = 11205 use_watchdog = on failover_when_quorum_exists = true failover_require_consensus = false allow_multiple_failover_requests_from_node = false wd_interval = 1 wd_priority = 1 wd_hostname = 'localhost' wd_port = 21204 wd_heartbeat_port = 21205 heartbeat_destination0 = 'localhost' heartbeat_destination_port0 = 21005 heartbeat_destination1 = 'localhost' heartbeat_destination_port1 = 21105 other_pgpool_hostname0 = 'localhost' other_pgpool_port0 = 11000 other_wd_port0 = 21004 other_pgpool_hostname1 = 'localhost' other_pgpool_port1 = 11100 other_wd_port1 = 21104 pgpool-II-4.1.4/src/test/regression/tests/012.watchdog_failover_when_quorum_exists/test.sh0000775000175000017500000001275313730350127026701 00000000000000#!/usr/bin/env bash #------------------------------------------------------------------- # test script for watchdog # # Please note that to successfully run the test, "HEALTHCHECK_DEBUG" # must be defined before compiling main/health_check.c. # # test failover_when_quorum_exists # source $TESTLIBS MASTER_DIR=master STANDBY_DIR=standby STANDBY2_DIR=standby2 num_tests=5 success_count=0 PSQL=$PGBIN/psql PG_CTL=$PGBIN/pg_ctl rm -fr $MASTER_DIR rm -fr $STANDBY_DIR rm -fr $STANDBY2_DIR mkdir $MASTER_DIR mkdir $STANDBY_DIR mkdir $STANDBY2_DIR # dir in master directory cd $MASTER_DIR # create master environment echo -n "creating master pgpool and PostgreSQL clusters..." $PGPOOL_SETUP -m s -n 2 -p 11000|| exit 1 echo "master setup done." # copy the configurations from master to standby cp -r etc ../$STANDBY_DIR/ # copy the configurations from master to standby2 cp -r etc ../$STANDBY2_DIR/ source ./bashrc.ports cat ../master.conf >> etc/pgpool.conf ./startall wait_for_pgpool_startup # back to test root dir cd .. # create standby environment but do not start pgpool mkdir $STANDBY_DIR/log echo -n "creating standby pgpool..." cat standby.conf >> $STANDBY_DIR/etc/pgpool.conf # since we are using the same pgpool-II conf as of master. so change the pid file path in standby pgpool conf echo "pid_file_name = '$PWD/pgpool2.pid'" >> $STANDBY_DIR/etc/pgpool.conf echo "logdir = $STANDBY_DIR/log" >> $STANDBY_DIR/etc/pgpool.conf # start the stnadby pgpool-II by hand #$PGPOOL_INSTALL_DIR/bin/pgpool -D -n -f $STANDBY_DIR/etc/pgpool.conf -F $STANDBY_DIR/etc/pcp.conf -a $STANDBY_DIR/etc/pool_hba.conf > $STANDBY_DIR/log/pgpool.log 2>&1 & # create standby2 environment but do not start pgpool mkdir $STANDBY2_DIR/log echo -n "creating standby2 pgpool..." cat standby2.conf >> $STANDBY2_DIR/etc/pgpool.conf # since we are using the same pgpool-II conf as of master. so change the pid file path in standby pgpool conf echo "pid_file_name = '$PWD/pgpool3.pid'" >> $STANDBY2_DIR/etc/pgpool.conf echo "logdir = $STANDBY2_DIR/log" >> $STANDBY2_DIR/etc/pgpool.conf # start the stnadby pgpool-II by hand #$PGPOOL_INSTALL_DIR/bin/pgpool -D -n -f $STANDBY2_DIR/etc/pgpool.conf -F $STANDBY2_DIR/etc/pcp.conf -a $STANDBY2_DIR/etc/pool_hba.conf > $STANDBY2_DIR/log/pgpool.log 2>&1 & # First test check if both pgpool-II have found their correct place in watchdog cluster. echo "Waiting for the pgpool master..." for i in 1 2 3 4 5 6 7 8 9 10 do grep "I am the cluster leader node" $MASTER_DIR/log/pgpool.log > /dev/null 2>&1 if [ $? = 0 ];then success_count=$(( success_count + 1 )) echo "Master brought up successfully." break; fi echo "[check] $i times" sleep 2 done # raise an artificial communication error on master for DB node 1 echo "1 down" > $MASTER_DIR/log/backend_down_request echo "Checking if the Master rejects the failover because quorum is not present..." for i in 1 2 3 4 5 6 7 8 9 10 do grep -i "Rejecting the failover request" $MASTER_DIR/log/pgpool.log if [ $? = 0 ];then success_count=$(( success_count + 1 )) echo "Fake DB error detected. and Failover rejected because of absence of quorum" break; fi echo "[check] $i times" sleep 2 done # now start other Pgpool-II nodes to complete the quorum # start the stnadby pgpool-II by hand $PGPOOL_INSTALL_DIR/bin/pgpool -D -n -f $STANDBY_DIR/etc/pgpool.conf -F $STANDBY_DIR/etc/pcp.conf -a $STANDBY_DIR/etc/pool_hba.conf > $STANDBY_DIR/log/pgpool.log 2>&1 & # start the second stnadby pgpool-II by hand $PGPOOL_INSTALL_DIR/bin/pgpool -D -n -f $STANDBY2_DIR/etc/pgpool.conf -F $STANDBY2_DIR/etc/pcp.conf -a $STANDBY2_DIR/etc/pool_hba.conf > $STANDBY2_DIR/log/pgpool.log 2>&1 & # now check if standby1 has successfully joined connected to the master. echo "Waiting for the standby1 to join cluster..." for i in 1 2 3 4 5 6 7 8 9 10 do grep "successfully joined the watchdog cluster as standby node" $STANDBY_DIR/log/pgpool.log > /dev/null 2>&1 if [ $? = 0 ];then success_count=$(( success_count + 1 )) echo "Standby successfully connected." break; fi echo "[check] $i times" sleep 2 done # now check if standby2 has successfully joined connected to the master. echo "Waiting for the standby2 to join cluster..." for i in 1 2 3 4 5 6 7 8 9 10 do grep "successfully joined the watchdog cluster as standby node" $STANDBY2_DIR/log/pgpool.log > /dev/null 2>&1 if [ $? = 0 ];then success_count=$(( success_count + 1 )) echo "Standby2 successfully connected." break; fi echo "[check] $i times" sleep 2 done # raise an artificial communication again to check if failover is executed this time echo "1 down" > $MASTER_DIR/log/backend_down_request #give some time to pgpool-II to execute failover sleep 5 # check to see if all Pgpool-II agrees that the failover request is # executed echo "Checking if all Pgpool-II agrees that the failover request is executed" for i in 1 2 3 4 5 6 7 8 9 10 do n=0 for p in 11000 11100 11200 do $PSQL -p $p -c "show pool_nodes" test|grep standby|grep down >/dev/null 2>&1 if [ $? = 0 ];then n=$(( n + 1)) fi done if [ $n -eq 3 ];then success_count=$(( success_count + 1 )) echo "All Pgpool-II agrees that the failover request is executed" break; fi echo "[check] $i times" sleep 2 done # we are done. Just stop the standby pgpool-II $PGPOOL_INSTALL_DIR/bin/pgpool -f $STANDBY_DIR/etc/pgpool.conf -m f stop $PGPOOL_INSTALL_DIR/bin/pgpool -f $STANDBY2_DIR/etc/pgpool.conf -m f stop cd master ./shutdownall echo "$success_count out of $num_tests successfull"; if test $success_count -eq $num_tests then exit 0 fi exit 1 pgpool-II-4.1.4/src/test/regression/tests/013.watchdog_failover_require_consensus/0000775000175000017500000000000013730350127025240 500000000000000pgpool-II-4.1.4/src/test/regression/tests/013.watchdog_failover_require_consensus/.gitignore0000664000175000017500000000003313730350075027146 00000000000000master/ standby/ standby2/ pgpool-II-4.1.4/src/test/regression/tests/013.watchdog_failover_require_consensus/master.conf0000664000175000017500000000113113730350127027316 00000000000000# master watchdog num_init_children = 4 use_watchdog = on failover_when_quorum_exists = true failover_require_consensus = true allow_multiple_failover_requests_from_node = false wd_interval = 1 wd_priority = 5 wd_hostname = 'localhost' wd_port = 21004 wd_heartbeat_port = 21005 heartbeat_destination0 = 'localhost' heartbeat_destination_port0 = 21105 heartbeat_destination1 = 'localhost' heartbeat_destination_port1 = 21205 other_pgpool_hostname0 = 'localhost' other_pgpool_port0 = 11100 other_wd_port0 = 21104 other_pgpool_hostname1 = 'localhost' other_pgpool_port1 = 11200 other_wd_port1 = 21204 pgpool-II-4.1.4/src/test/regression/tests/013.watchdog_failover_require_consensus/standby.conf0000664000175000017500000000117013730350127027472 00000000000000# standby watchdog num_init_children = 4 port = 11100 pcp_port = 11105 use_watchdog = on failover_when_quorum_exists = true failover_require_consensus = true allow_multiple_failover_requests_from_node = false wd_interval = 1 wd_priority = 3 wd_hostname = 'localhost' wd_port = 21104 wd_heartbeat_port = 21105 heartbeat_destination0 = 'localhost' heartbeat_destination_port0 = 21005 heartbeat_destination1 = 'localhost' heartbeat_destination_port1 = 21205 other_pgpool_hostname0 = 'localhost' other_pgpool_port0 = 11000 other_wd_port0 = 21004 other_pgpool_hostname1 = 'localhost' other_pgpool_port1 = 11200 other_wd_port1 = 21204 pgpool-II-4.1.4/src/test/regression/tests/013.watchdog_failover_require_consensus/standby2.conf0000664000175000017500000000117113730350127027555 00000000000000# standby2 watchdog num_init_children = 4 port = 11200 pcp_port = 11205 use_watchdog = on failover_when_quorum_exists = true failover_require_consensus = true allow_multiple_failover_requests_from_node = false wd_interval = 1 wd_priority = 1 wd_hostname = 'localhost' wd_port = 21204 wd_heartbeat_port = 21205 heartbeat_destination0 = 'localhost' heartbeat_destination_port0 = 21005 heartbeat_destination1 = 'localhost' heartbeat_destination_port1 = 21105 other_pgpool_hostname0 = 'localhost' other_pgpool_port0 = 11000 other_wd_port0 = 21004 other_pgpool_hostname1 = 'localhost' other_pgpool_port1 = 11100 other_wd_port1 = 21104 pgpool-II-4.1.4/src/test/regression/tests/013.watchdog_failover_require_consensus/test.sh0000775000175000017500000001356613730350127026511 00000000000000#!/usr/bin/env bash #------------------------------------------------------------------- # test script for watchdog # # Please note that to successfully run the test, "HEALTHCHECK_DEBUG" # must be defined before compiling main/health_check.c. # # test failover_require_consensus # source $TESTLIBS MASTER_DIR=master STANDBY_DIR=standby STANDBY2_DIR=standby2 num_tests=7 success_count=0 PSQL=$PGBIN/psql PG_CTL=$PGBIN/pg_ctl rm -fr $MASTER_DIR rm -fr $STANDBY_DIR rm -fr $STANDBY2_DIR mkdir $MASTER_DIR mkdir $STANDBY_DIR mkdir $STANDBY2_DIR # dir in master directory cd $MASTER_DIR # create master environment echo -n "creating master pgpool and PostgreSQL clusters..." $PGPOOL_SETUP -m s -n 2 -p 11000|| exit 1 echo "master setup done." # copy the configurations from master to standby cp -r etc ../$STANDBY_DIR/ # copy the configurations from master to standby2 cp -r etc ../$STANDBY2_DIR/ source ./bashrc.ports cat ../master.conf >> etc/pgpool.conf ./startall wait_for_pgpool_startup # back to test root dir cd .. # create standby environment and start pgpool mkdir $STANDBY_DIR/log echo -n "creating standby pgpool..." cat standby.conf >> $STANDBY_DIR/etc/pgpool.conf # since we are using the same pgpool-II conf as of master. so change the pid file path in standby pgpool conf echo "pid_file_name = '$PWD/pgpool2.pid'" >> $STANDBY_DIR/etc/pgpool.conf echo "logdir = $STANDBY_DIR/log" >> $STANDBY_DIR/etc/pgpool.conf # start the stnadby pgpool-II by hand $PGPOOL_INSTALL_DIR/bin/pgpool -D -n -f $STANDBY_DIR/etc/pgpool.conf -F $STANDBY_DIR/etc/pcp.conf -a $STANDBY_DIR/etc/pool_hba.conf > $STANDBY_DIR/log/pgpool.log 2>&1 & # create standby2 environment but do not start pgpool mkdir $STANDBY2_DIR/log echo -n "creating standby2 pgpool..." cat standby2.conf >> $STANDBY2_DIR/etc/pgpool.conf # since we are using the same pgpool-II conf as of master. so change the pid file path in standby pgpool conf echo "pid_file_name = '$PWD/pgpool3.pid'" >> $STANDBY2_DIR/etc/pgpool.conf echo "logdir = $STANDBY2_DIR/log" >> $STANDBY2_DIR/etc/pgpool.conf # start the stnadby pgpool-II by hand $PGPOOL_INSTALL_DIR/bin/pgpool -D -n -f $STANDBY2_DIR/etc/pgpool.conf -F $STANDBY2_DIR/etc/pcp.conf -a $STANDBY2_DIR/etc/pool_hba.conf > $STANDBY2_DIR/log/pgpool.log 2>&1 & # First test check if both pgpool-II have found their correct place in watchdog cluster. echo "Waiting for the pgpool master..." for i in 1 2 3 4 5 6 7 8 9 10 do grep "I am the cluster leader node" $MASTER_DIR/log/pgpool.log > /dev/null 2>&1 if [ $? = 0 ];then success_count=$(( success_count + 1 )) echo "Master brought up successfully." break; fi echo "[check] $i times" sleep 2 done # now check if standby1 has successfully joined connected to the master. echo "Waiting for the standby1 to join cluster..." for i in 1 2 3 4 5 6 7 8 9 10 do grep "successfully joined the watchdog cluster as standby node" $STANDBY_DIR/log/pgpool.log > /dev/null 2>&1 if [ $? = 0 ];then success_count=$(( success_count + 1 )) echo "Standby successfully connected." break; fi echo "[check] $i times" sleep 2 done # now check if standby2 has successfully joined connected to the master. echo "Waiting for the standby2 to join cluster..." for i in 1 2 3 4 5 6 7 8 9 10 do grep "successfully joined the watchdog cluster as standby node" $STANDBY2_DIR/log/pgpool.log > /dev/null 2>&1 if [ $? = 0 ];then success_count=$(( success_count + 1 )) echo "Standby2 successfully connected." break; fi echo "[check] $i times" sleep 2 done # raise an artificial communication error on standby for DB node 1 echo "1 down" > $STANDBY_DIR/log/backend_down_request echo "Checking if the standby successfuly process the failover request..." for i in 1 2 3 4 5 6 7 8 9 10 do grep -i "building consensus for request" $STANDBY_DIR/log/pgpool.log if [ $? = 0 ];then success_count=$(( success_count + 1 )) echo "Fake DB error generated and master is waiting for consensus" break; fi echo "[check] $i times" sleep 2 done echo "Checking if the Master receives the failover request and waiting for consensus..." for i in 1 2 3 4 5 6 7 8 9 10 do grep -i "failover request noted" $MASTER_DIR/log/pgpool.log if [ $? = 0 ];then success_count=$(( success_count + 1 )) echo "Fake DB error delivered to master. and master is waiting for consensus" break; fi echo "[check] $i times" sleep 2 done # raise an artificial communication error again on the standby for DB node 1 echo "1 down" > $STANDBY_DIR/log/backend_down_request # standby should quarantine the node now echo "Checking if the node is quarantined on standby..." for i in 1 2 3 4 5 6 7 8 9 10 do grep -i "changed to quarantine node request" $STANDBY_DIR/log/pgpool.log if [ $? = 0 ];then success_count=$(( success_count + 1 )) echo "Node is quarantined because of second error but no consensus" break; fi echo "[check] $i times" sleep 2 done # raise an artificial communication on second standby to check if failover is executed this time echo "1 down" > $STANDBY2_DIR/log/backend_down_request #give some time to pgpool-II to execute failover sleep 5 # check to see if all Pgpool-II agrees that the failover request is # executed echo "Checking if all Pgpool-II agrees that the failover request is executed" for i in 1 2 3 4 5 6 7 8 9 10 do n=0 for p in 11000 11100 11200 do $PSQL -p $p -c "show pool_nodes" test|grep standby|grep down >/dev/null 2>&1 if [ $? = 0 ];then n=$(( n + 1)) fi done if [ $n -eq 3 ];then success_count=$(( success_count + 1 )) echo "All Pgpool-II agrees that the failover request is executed" break; fi echo "[check] $i times" sleep 2 done # we are done. Just stop the standby pgpool-II $PGPOOL_INSTALL_DIR/bin/pgpool -f $STANDBY_DIR/etc/pgpool.conf -m f stop $PGPOOL_INSTALL_DIR/bin/pgpool -f $STANDBY2_DIR/etc/pgpool.conf -m f stop cd master ./shutdownall echo "$success_count out of $num_tests successfull"; if test $success_count -eq $num_tests then exit 0 fi exit 1 pgpool-II-4.1.4/src/test/regression/tests/014.watchdog_test_quorum_bypass/0000775000175000017500000000000013730350127023546 500000000000000pgpool-II-4.1.4/src/test/regression/tests/014.watchdog_test_quorum_bypass/.gitignore0000664000175000017500000000001013730350075025447 00000000000000master/ pgpool-II-4.1.4/src/test/regression/tests/014.watchdog_test_quorum_bypass/master.conf0000664000175000017500000000113113730350127025624 00000000000000# master watchdog num_init_children = 4 use_watchdog = on failover_when_quorum_exists = true failover_require_consensus = true allow_multiple_failover_requests_from_node = false wd_interval = 1 wd_priority = 5 wd_hostname = 'localhost' wd_port = 21004 wd_heartbeat_port = 21005 heartbeat_destination0 = 'localhost' heartbeat_destination_port0 = 21105 heartbeat_destination1 = 'localhost' heartbeat_destination_port1 = 21205 other_pgpool_hostname0 = 'localhost' other_pgpool_port0 = 11100 other_wd_port0 = 21104 other_pgpool_hostname1 = 'localhost' other_pgpool_port1 = 11200 other_wd_port1 = 21204 pgpool-II-4.1.4/src/test/regression/tests/014.watchdog_test_quorum_bypass/test.sh0000775000175000017500000000336713730350127025015 00000000000000#!/usr/bin/env bash #------------------------------------------------------------------- # test script for watchdog # # Please note that to successfully run the test, "HEALTHCHECK_DEBUG" # must be defined before compiling main/health_check.c. # # test pcp_detach bypass failover_when_quorum_exists and failover_require_consensus # source $TESTLIBS MASTER_DIR=master num_tests=2 success_count=0 PSQL=$PGBIN/psql PG_CTL=$PGBIN/pg_ctl rm -fr $MASTER_DIR rm -fr $STANDBY_DIR rm -fr $STANDBY2_DIR mkdir $MASTER_DIR mkdir $STANDBY_DIR mkdir $STANDBY2_DIR # dir in master directory cd $MASTER_DIR # create master environment echo -n "creating master pgpool and PostgreSQL clusters..." $PGPOOL_SETUP -m s -n 2 -p 11000|| exit 1 echo "master setup done." source ./bashrc.ports cat ../master.conf >> etc/pgpool.conf ./startall wait_for_pgpool_startup # back to test root dir cd .. # First test check if pgpool-II became a master. echo "Waiting for the pgpool master..." for i in 1 2 3 4 5 6 7 8 9 10 do grep "I am the cluster leader node" $MASTER_DIR/log/pgpool.log > /dev/null 2>&1 if [ $? = 0 ];then success_count=$(( success_count + 1 )) echo "Master brought up successfully." break; fi echo "[check] $i times" sleep 2 done #export PCPPASSFILE=/home/usama/work/community/pgpool2/src/test/regression/tests/067.bug231/testdir/pcppass $PGPOOL_INSTALL_DIR/bin/pcp_detach_node -w -h localhost -p $PCP_PORT 1 2>&1 wait_for_pgpool_startup $PSQL -p 11000 -c "show pool_nodes" test|grep standby|grep down >/dev/null 2>&1 if [ $? = 0 ];then echo "Failover was successfuly executed" success_count=$(( success_count + 1 )) fi cd master ./shutdownall echo "$success_count out of $num_tests successfull"; if test $success_count -eq $num_tests then exit 0 fi exit 1 pgpool-II-4.1.4/src/test/regression/tests/015.watchdog_master_and_backend_fail/0000775000175000017500000000000013730350127024356 500000000000000pgpool-II-4.1.4/src/test/regression/tests/015.watchdog_master_and_backend_fail/.gitignore0000664000175000017500000000003313730350075026264 00000000000000master/ standby/ standby2/ pgpool-II-4.1.4/src/test/regression/tests/015.watchdog_master_and_backend_fail/master.conf0000664000175000017500000000113113730350127026434 00000000000000# master watchdog num_init_children = 4 use_watchdog = on failover_when_quorum_exists = true failover_require_consensus = true allow_multiple_failover_requests_from_node = false wd_interval = 1 wd_priority = 5 wd_hostname = 'localhost' wd_port = 21004 wd_heartbeat_port = 21005 heartbeat_destination0 = 'localhost' heartbeat_destination_port0 = 21105 heartbeat_destination1 = 'localhost' heartbeat_destination_port1 = 21205 other_pgpool_hostname0 = 'localhost' other_pgpool_port0 = 11100 other_wd_port0 = 21104 other_pgpool_hostname1 = 'localhost' other_pgpool_port1 = 11200 other_wd_port1 = 21204 pgpool-II-4.1.4/src/test/regression/tests/015.watchdog_master_and_backend_fail/standby.conf0000664000175000017500000000117013730350127026610 00000000000000# standby watchdog num_init_children = 4 port = 11100 pcp_port = 11105 use_watchdog = on failover_when_quorum_exists = true failover_require_consensus = true allow_multiple_failover_requests_from_node = false wd_interval = 1 wd_priority = 3 wd_hostname = 'localhost' wd_port = 21104 wd_heartbeat_port = 21105 heartbeat_destination0 = 'localhost' heartbeat_destination_port0 = 21005 heartbeat_destination1 = 'localhost' heartbeat_destination_port1 = 21205 other_pgpool_hostname0 = 'localhost' other_pgpool_port0 = 11000 other_wd_port0 = 21004 other_pgpool_hostname1 = 'localhost' other_pgpool_port1 = 11200 other_wd_port1 = 21204 pgpool-II-4.1.4/src/test/regression/tests/015.watchdog_master_and_backend_fail/standby2.conf0000664000175000017500000000117113730350127026673 00000000000000# standby2 watchdog num_init_children = 4 port = 11200 pcp_port = 11205 use_watchdog = on failover_when_quorum_exists = true failover_require_consensus = true allow_multiple_failover_requests_from_node = false wd_interval = 1 wd_priority = 1 wd_hostname = 'localhost' wd_port = 21204 wd_heartbeat_port = 21205 heartbeat_destination0 = 'localhost' heartbeat_destination_port0 = 21005 heartbeat_destination1 = 'localhost' heartbeat_destination_port1 = 21105 other_pgpool_hostname0 = 'localhost' other_pgpool_port0 = 11000 other_wd_port0 = 21004 other_pgpool_hostname1 = 'localhost' other_pgpool_port1 = 11100 other_wd_port1 = 21104 pgpool-II-4.1.4/src/test/regression/tests/015.watchdog_master_and_backend_fail/test.sh0000775000175000017500000001256613730350127025626 00000000000000#!/usr/bin/env bash #------------------------------------------------------------------- # test script for watchdog # # Please note that to successfully run the test, "HEALTHCHECK_DEBUG" # must be defined before compiling main/health_check.c. # # test if master and backend goes down at same time Pgpool-II behaves as expected # source $TESTLIBS MASTER_DIR=master STANDBY_DIR=standby STANDBY2_DIR=standby2 num_tests=6 success_count=0 PSQL=$PGBIN/psql PG_CTL=$PGBIN/pg_ctl rm -fr $MASTER_DIR rm -fr $STANDBY_DIR rm -fr $STANDBY2_DIR mkdir $MASTER_DIR mkdir $STANDBY_DIR mkdir $STANDBY2_DIR # dir in master directory cd $MASTER_DIR # create master environment echo -n "creating master pgpool and PostgreSQL clusters..." $PGPOOL_SETUP -m s -n 2 -p 11000|| exit 1 echo "master setup done." # copy the configurations from master to standby cp -r etc ../$STANDBY_DIR/ # copy the configurations from master to standby2 cp -r etc ../$STANDBY2_DIR/ source ./bashrc.ports cat ../master.conf >> etc/pgpool.conf ./startall wait_for_pgpool_startup # back to test root dir cd .. # create standby environment and start pgpool mkdir $STANDBY_DIR/log echo -n "creating standby pgpool..." cat standby.conf >> $STANDBY_DIR/etc/pgpool.conf # since we are using the same pgpool-II conf as of master. so change the pid file path in standby pgpool conf echo "pid_file_name = '$PWD/pgpool2.pid'" >> $STANDBY_DIR/etc/pgpool.conf echo "logdir = $STANDBY_DIR/log" >> $STANDBY_DIR/etc/pgpool.conf # start the stnadby pgpool-II by hand $PGPOOL_INSTALL_DIR/bin/pgpool -D -n -f $STANDBY_DIR/etc/pgpool.conf -F $STANDBY_DIR/etc/pcp.conf -a $STANDBY_DIR/etc/pool_hba.conf > $STANDBY_DIR/log/pgpool.log 2>&1 & # create standby2 environment but do not start pgpool mkdir $STANDBY2_DIR/log echo -n "creating standby2 pgpool..." cat standby2.conf >> $STANDBY2_DIR/etc/pgpool.conf # since we are using the same pgpool-II conf as of master. so change the pid file path in standby pgpool conf echo "pid_file_name = '$PWD/pgpool3.pid'" >> $STANDBY2_DIR/etc/pgpool.conf echo "logdir = $STANDBY2_DIR/log" >> $STANDBY2_DIR/etc/pgpool.conf # start the stnadby pgpool-II by hand $PGPOOL_INSTALL_DIR/bin/pgpool -D -n -f $STANDBY2_DIR/etc/pgpool.conf -F $STANDBY2_DIR/etc/pcp.conf -a $STANDBY2_DIR/etc/pool_hba.conf > $STANDBY2_DIR/log/pgpool.log 2>&1 & # First test check if both pgpool-II have found their correct place in watchdog cluster. echo "Waiting for the pgpool master..." for i in 1 2 3 4 5 6 7 8 9 10 do grep "I am the cluster leader node" $MASTER_DIR/log/pgpool.log > /dev/null 2>&1 if [ $? = 0 ];then success_count=$(( success_count + 1 )) echo "Master brought up successfully." break; fi echo "[check] $i times" sleep 2 done # now check if standby1 has successfully joined connected to the master. echo "Waiting for the standby1 to join cluster..." for i in 1 2 3 4 5 6 7 8 9 10 do grep "successfully joined the watchdog cluster as standby node" $STANDBY_DIR/log/pgpool.log > /dev/null 2>&1 if [ $? = 0 ];then success_count=$(( success_count + 1 )) echo "Standby successfully connected." break; fi echo "[check] $i times" sleep 2 done # now check if standby2 has successfully joined connected to the master. echo "Waiting for the standby2 to join cluster..." for i in 1 2 3 4 5 6 7 8 9 10 do grep "successfully joined the watchdog cluster as standby node" $STANDBY2_DIR/log/pgpool.log > /dev/null 2>&1 if [ $? = 0 ];then success_count=$(( success_count + 1 )) echo "Standby2 successfully connected." break; fi echo "[check] $i times" sleep 2 done #shutdown master and one PG server by hand $PGPOOL_INSTALL_DIR/bin/pgpool -D -n -f $MASTER_DIR/etc/pgpool.conf -m f stop $PG_CTL -D $MASTER_DIR/data1 -m f stop # First test check if both pgpool-II have found their correct place in watchdog cluster. echo "Waiting for the standby to become new master..." for i in 1 2 3 4 5 6 7 8 9 10 do grep "I am the cluster leader node" $STANDBY_DIR/log/pgpool.log > /dev/null 2>&1 if [ $? = 0 ];then success_count=$(( success_count + 1 )) echo "Standby became new master successfully." break; fi echo "[check] $i times" sleep 2 done #give some time to execute failover sleep 5 # First test check if both pgpool-II have found their correct place in watchdog cluster. echo "Waiting for the standby to execute failover..." for i in 1 2 3 4 5 6 7 8 9 10 do grep " failover done" $STANDBY_DIR/log/pgpool.log > /dev/null 2>&1 if [ $? = 0 ];then success_count=$(( success_count + 1 )) echo "Standby became new master successfully." break; fi echo "[check] $i times" sleep 2 done # check to see if all Pgpool-II agrees that the failover request is # executed echo "Checking if all Pgpool-II agrees that the failover request was executed" for i in 1 2 3 4 5 6 7 8 9 10 do n=0 for p in 11100 11200 do $PSQL -p $p -c "show pool_nodes" test|grep standby|grep down >/dev/null 2>&1 if [ $? = 0 ];then n=$(( n + 1)) fi done if [ $n -eq 2 ];then success_count=$(( success_count + 1 )) echo "All Pgpool-II agrees that the failover request is executed" break; fi echo "[check] $i times" sleep 2 done # we are done. Just stop the standby pgpool-II $PGPOOL_INSTALL_DIR/bin/pgpool -f $STANDBY_DIR/etc/pgpool.conf -m f stop $PGPOOL_INSTALL_DIR/bin/pgpool -f $STANDBY2_DIR/etc/pgpool.conf -m f stop cd master ./shutdownall echo "$success_count out of $num_tests successfull"; if test $success_count -eq $num_tests then exit 0 fi exit 1 pgpool-II-4.1.4/src/test/regression/tests/016.node_0_is_not_primary/0000775000175000017500000000000013730350075022204 500000000000000pgpool-II-4.1.4/src/test/regression/tests/016.node_0_is_not_primary/.gitignore0000664000175000017500000000001113730350075024104 00000000000000testdir/ pgpool-II-4.1.4/src/test/regression/tests/016.node_0_is_not_primary/test.sh0000775000175000017500000000250213730350075023441 00000000000000#!/usr/bin/env bash #------------------------------------------------------------------- # test script for the case when node 0 is not primary. # source $TESTLIBS TESTDIR=testdir PSQL=$PGBIN/psql PG_CTL=$PGBIN/pg_ctl export PGDATABASE=test for mode in s do rm -fr $TESTDIR mkdir $TESTDIR cd $TESTDIR echo "===== testing mode: $mode ======" # create test environment echo -n "creating test environment..." $PGPOOL_SETUP -m $mode -n 2 || exit 1 echo "done." source ./bashrc.ports ./startall export PGPORT=$PGPOOL_PORT wait_for_pgpool_startup echo "Swapping the role of node 0 and node 1..." $PG_CTL -D data0 -m f stop wait_for_pgpool_startup $PGPOOL_INSTALL_DIR/bin/pcp_recovery_node -w -h localhost -p $PCP_PORT 0 wait_for_pgpool_startup echo "Swapping the role of node 0 and node 1...done." $PSQL -c "show pool_nodes" # make sure that node 1 is master/primary test `$PSQL -c "show pool_nodes"|egrep "primary|master"|awk '{print $1}'` = 1 && test `$PSQL -c "show pool_nodes"|egrep "primary|master"|awk '{print $7}'` = "up" if [ $? != 0 ] then echo "node 1 is not primary or master" ./shutdownall exit 1 fi # try to issue write query $PSQL -c "create table t1(i int)" if [ $? != 0 ] then echo "write query failed" ./shutdownall exit 1 fi ./shutdownall cd .. done exit 0 pgpool-II-4.1.4/src/test/regression/tests/017.node_0_is_down/0000775000175000017500000000000013730350075020611 500000000000000pgpool-II-4.1.4/src/test/regression/tests/017.node_0_is_down/.gitignore0000664000175000017500000000001113730350075022511 00000000000000testdir/ pgpool-II-4.1.4/src/test/regression/tests/017.node_0_is_down/test.sh0000775000175000017500000000670513730350075022057 00000000000000#!/usr/bin/env bash #------------------------------------------------------------------- # test script for the case when node 0 is down (and DISALLOW_FAILOVER is being set). # source $TESTLIBS TESTDIR=testdir PSQL=$PGBIN/psql PG_CTL=$PGBIN/pg_ctl export PGDATABASE=test for mode in s r n do rm -fr $TESTDIR mkdir $TESTDIR cd $TESTDIR echo "===== testing mode: $mode ======" # create test environment echo -n "creating test environment..." $PGPOOL_SETUP -m $mode -n 2 || exit 1 echo "done." source ./bashrc.ports # # Test case 1: when pgpool starts node 0 is already down and # pool_status recorded the fact. # Only streaming replication mode failed with read-only transaction. # Other mode should succeed. # # edit startall so that it does not use "-D" with pgpool. sed -i 's/pgpool -D/pgpool/' startall # set down status for node 0. echo -e "down \nup" > log/pgpool_status ./startall export PGPORT=$PGPOOL_PORT wait_for_pgpool_startup $PSQL -c "show pool_nodes" postgres # try to issue write query $PSQL -c "create table t1(i int)" postgres > psql_status 2>&1 if [ $? != 0 ] then if [ $mode = "s" ] then grep -i read-only psql_status >/dev/null if [ $? != 0 ] then echo -n "Writing query in streamin replication mode failed due to other than read-only transaction in test case 1. reason: " cat psql_status ./shutdownall exit 1 fi else echo -n "Writing query in mode $mode failed in test case 1. reason: " cat psql_status ./shutdownall exit 1 fi else $PSQL -c "drop table t1" postgres fi echo "Writing query in mode $mode succeeded in test case 1" ./shutdownall # # Test case 2: server starts then node 0 is shutting down. # In all mode this test should succeed. # # remove pgpool_status to trigger failover. rm log/pgpool_status # set down request file ./startall wait_for_pgpool_startup # shutdown node 0 $PG_CTL -D data0 -m f stop wait_for_pgpool_startup $PSQL -c "show pool_nodes" postgres # try to issue write query $PSQL -c "create table t1(i int)" postgres > psql_status 2>&1 if [ $? != 0 ] then echo -n "Writing query in mode $mode failed in test case 2. reason: " cat psql_status else echo "Writing query in mode $mode succeeded in test case 2" fi ./shutdownall $PSQL -c "drop table t1" postgres # # Test case 3: in addition 2 set DISALLOW_TO_FAILOVER flag to node 0. # # Set DISALLOW_TO_FAILOVER flag to node 0 echo "backend_flag0 = DISALLOW_TO_FAILOVER" >> etc/pgpool.conf # remove pgpool_status to trigger failover. rm log/pgpool_status # set down request file ./startall wait_for_pgpool_startup # shutdown node 0 $PG_CTL -D data0 -m f stop wait_for_pgpool_startup $PSQL -c "show pool_nodes" postgres # try to issue write query expecting error: executing failover on backend. $PSQL -c "create table t1(i int)" postgres > psql_status 2>&1 if [ $? != 0 ] then grep -i "executing failover on backend" psql_status >/dev/null if [ $? != 0 ] then echo -n "Writing query in mode $mode failed due to other than \"executing failover on backend\" in test case 3. reason: " cat psql_status ./shutdownall exit 1 else echo "Writing query in mode $mode failed by \"executing failover on backend\" as expected in test case 3" fi else echo "Writing query succeeded in test case 3 mode $mode. Suspicious sccess." ./shutdownall exit 1 fi $PSQL -c "drop table t1" postgres ./shutdownall cd .. done exit 0 pgpool-II-4.1.4/src/test/regression/tests/018.detach_primary/0000775000175000017500000000000013730350075020717 500000000000000pgpool-II-4.1.4/src/test/regression/tests/018.detach_primary/.gitignore0000664000175000017500000000001113730350075022617 00000000000000testdir/ pgpool-II-4.1.4/src/test/regression/tests/018.detach_primary/test.sh0000775000175000017500000000241013730350075022152 00000000000000#!/usr/bin/env bash #------------------------------------------------------------------- # test script for testing the feature of detach_false_primary. # source $TESTLIBS TESTDIR=testdir PSQL=$PGBIN/psql PG_CTL=$PGBIN/pg_ctl export PGDATABASE=test rm -fr $TESTDIR mkdir $TESTDIR cd $TESTDIR version=`$PSQL --version|awk '{print $3}'` result=`echo "$version >= 9.6"|bc` if [ $result = 0 ];then echo "PostgreSQL version $version is 9.5 or before. Skipping test." exit 0 fi # create test environment echo -n "creating test environment..." $PGPOOL_SETUP -m s -n 3 -s || exit 1 echo "done." source ./bashrc.ports echo "detach_false_primary=on" >> etc/pgpool.conf echo "sr_check_period = 1" >> etc/pgpool.conf ./startall export PGPORT=$PGPOOL_PORT wait_for_pgpool_startup # promote #3 node to create false primary $PG_CTL -D data2 promote sleep 10 wait_for_pgpool_startup $PSQL -c "show pool_nodes" postgres > show_pool_nodes primary_node=`grep primary show_pool_nodes|awk '{print $1}'` if [ $primary_node != 0 ];then echo "primary node is not 0" ./shutdownall exit 1 fi false_primary_node=`grep down show_pool_nodes|awk '{print $1}'` if [ $false_primary_node != 2 ];then echo "false primary node is not 2" ./shutdownall exit 1 fi ./shutdownall exit 0 pgpool-II-4.1.4/src/test/regression/tests/019.log_client_messages/0000775000175000017500000000000013730350075021733 500000000000000pgpool-II-4.1.4/src/test/regression/tests/019.log_client_messages/.gitignore0000664000175000017500000000001113730350075023633 00000000000000testdir/ pgpool-II-4.1.4/src/test/regression/tests/019.log_client_messages/test.sh0000775000175000017500000001001113730350075023162 00000000000000#!/usr/bin/env bash #------------------------------------------------------------------- # test script for log_client_messages # source $TESTLIBS TESTDIR=`pwd`/testdir PSQL=$PGBIN/psql PGBENCH=$PGBENCH_PATH WHOAMI=`whoami` #test parameter timeout=30 num_tests=14 success_count=0 rm -fr $TESTDIR mkdir $TESTDIR cd $TESTDIR # create test environment echo -n "creating test environment..." $PGPOOL_SETUP -n 1 || exit 1 echo "done." source ./bashrc.ports export PGPORT=$PGPOOL_PORT # log_client_messages paramater change ./startall wait_for_pgpool_startup echo "log_client_messages = on" >> etc/pgpool.conf ./pgpool_reload sleep 1 wait_for_pgpool_startup $PSQL -c "PGPOOL SHOW log_client_messages" test > psql_status 2>&1 if [ !`cat psql_status |grep 'on'` ] then ./shutdownall exit 1 fi $PGBENCH -i test # pgproto test cp -r ../tests ./ tests=`(ls tests)` for i in $tests do echo -n "testing $i ..." timeout $timeout $PGPOOL_INSTALL_DIR/bin/pgproto -u $WHOAMI -p $PGPOOL_PORT -d test -f tests/$i done # send cancel request # executing long runing query $PSQL -c "select pg_sleep(30);" test & # get psql process pid psqlpid=$! sleep 2 # send CtrlC to psql to cancel the query kill -INT $psqlpid sleep 2 ./shutdownall #Bind grep -A 1 -e "Bind message from frontend." log/pgpool.log |grep -E "portal: \".*\", statement: \".*\"" >/dev/null 2>&1 if [ $? = 0 ];then echo "success: Bind log" success_count=$(( success_count + 1 )) fi #CancelRequest grep -A 1 -e "Cancel message from frontend." log/pgpool.log |grep -E "process id: .+" >/dev/null 2>&1 if [ $? = 0 ];then echo "success: CancelRequest log" success_count=$(( success_count + 1 )) fi #Close grep -A 1 -e "Close message from frontend." log/pgpool.log |grep -E "(portal|statement): \".*\"" >/dev/null 2>&1 if [ $? = 0 ];then echo "success: Close log" success_count=$(( success_count + 1 )) fi #CopyData grep -A 1 -e "CopyData message from frontend." log/pgpool.log |grep -E "count: [0-9]+" >/dev/null 2>&1 if [ $? = 0 ];then echo "success: CopyData log" success_count=$(( success_count + 1 )) fi #CopyDone grep -e "CopyDone message from frontend." log/pgpool.log >/dev/null 2>&1 if [ $? = 0 ];then echo "success: CopyDone log" success_count=$(( success_count + 1 )) fi #CopyFail grep -e "CopyFail message from frontend." log/pgpool.log >/dev/null 2>&1 if [ $? = 0 ];then echo "success: CopyFail log" success_count=$(( success_count + 1 )) fi #Describe grep -A 1 -e "Describe message from frontend." log/pgpool.log |grep -E "(portal|statement): \".*\"" >/dev/null 2>&1 if [ $? = 0 ];then echo "success: Describe log" success_count=$(( success_count + 1 )) fi #Execute grep -A 1 -e "Execute message from frontend." log/pgpool.log |grep -E "portal: \".*\"" >/dev/null 2>&1 if [ $? = 0 ];then echo "success: Execute log" success_count=$(( success_count + 1 )) fi #Flush grep -e "Flush message from frontend." log/pgpool.log >/dev/null 2>&1 if [ $? = 0 ];then echo "success: Flush log" success_count=$(( success_count + 1 )) fi #FunctionCall grep -A 1 -e "FunctionCall message from frontend." log/pgpool.log |grep -E "oid: \".+\"" >/dev/null 2>&1 if [ $? = 0 ];then echo "success: FunctionCall log" success_count=$(( success_count + 1 )) fi #Parse grep -A 1 -e "Parse message from frontend." log/pgpool.log |grep -E "statement: \".*\", query: \".*\"" >/dev/null 2>&1 if [ $? = 0 ];then echo "success: Parse log" success_count=$(( success_count + 1 )) fi #Query grep -A 1 -e "Query message from frontend." log/pgpool.log |grep -E "query: \".*\"" >/dev/null 2>&1 if [ $? = 0 ];then echo "success: Query log" success_count=$(( success_count + 1 )) fi #Sync grep -e "Sync message from frontend." log/pgpool.log >/dev/null 2>&1 if [ $? = 0 ];then echo "success: Sync log" success_count=$(( success_count + 1 )) fi #Terminate grep -e "Terminate message from frontend." log/pgpool.log >/dev/null 2>&1 if [ $? = 0 ];then echo "success: Terminate log" success_count=$(( success_count + 1 )) fi echo "$success_count out of $num_tests successfull"; if test $success_count -eq $num_tests then exit 0; fi exit 1; pgpool-II-4.1.4/src/test/regression/tests/019.log_client_messages/tests/0000775000175000017500000000000013730350075023075 500000000000000pgpool-II-4.1.4/src/test/regression/tests/019.log_client_messages/tests/copy.data0000664000175000017500000000047213730350075024625 00000000000000# Test for copy protocol # create test table 'Q' "CREATE TABLE t1(a text)" 'Y' # CopyIn # 'Q' "COPY t1 FROM STDIN" # CopyData 'd' "abc" # CopyDone 'c' 'Y' # CopyOut # 'Q' "COPY t1 TO STDOUT" 'Y' # # Copy fail case # 'Q' "COPY t1 FROM STDIN" # CopyData 'd' "abc" # CopyFail 'f' "pgproto copy fail test" 'Y' 'X' pgpool-II-4.1.4/src/test/regression/tests/019.log_client_messages/tests/describe.data0000664000175000017500000000026513730350075025433 00000000000000# Test for Describe Flush command protocol # SELECT 1 FROM pgbench_accounts 'P' "S4" "SELECT 1 FROM pgbench_accounts" 0 'B' "" "S4" 0 0 0 'D' 'S' "S4" 'E' "" 0 'H' 'y' 'S' 'Y' 'X' pgpool-II-4.1.4/src/test/regression/tests/019.log_client_messages/tests/extended_query.data0000664000175000017500000000047013730350075026676 00000000000000# Test for extended-query protocol # Start a transaction 'P' "S1" "BEGIN" 0 'B' "" "S1" 0 0 0 'E' "" 0 'C' 'S' "S1" # Issue SELECT 'P' "S2" "SELECT 1 FROM pgbench_accounts" 0 'B' "P1" "S2" 0 0 0 'E' "P1" 50000 'C' 'S' "S2" # Issue COMMIT 'P' "S3" "COMMIT" 0 'B' "" "S3" 0 0 0 'E' "" 0 'C' 'S' "S3" 'S' 'Y' 'X' pgpool-II-4.1.4/src/test/regression/tests/019.log_client_messages/tests/function.data0000664000175000017500000000055013730350075025475 00000000000000# Test for FunctionCall protocol # # Test data example # # Function call (lo_creat) # from PostgreSQL's src/include/catalog/pg_proc.data # { oid => '957', descr => 'large object create', # proname => 'lo_creat', provolatile => 'v', proparallel => 'u', # prorettype => 'oid', proargtypes => 'int4', prosrc => 'be_lo_creat' }, 'F' 957 1 0 1 1 "0" 0 'Y' 'X' pgpool-II-4.1.4/src/test/regression/tests/019.log_client_messages/tests/simple.data0000664000175000017500000000013213730350075025135 00000000000000# Test for simple-query protocol 'Q' 'Q' "SELECT * FROM pgbench_accounts LIMIT 1" 'Y' 'X' pgpool-II-4.1.4/src/test/regression/tests/020.allow_clear_text_frontend_auth/0000775000175000017500000000000013730350075024165 500000000000000pgpool-II-4.1.4/src/test/regression/tests/020.allow_clear_text_frontend_auth/test.sh0000775000175000017500000000644013730350075025427 00000000000000#!/usr/bin/env bash #------------------------------------------------------------------- # test script for scram and md5 authentication test # when allow_clear_text_frontend_auth is set # # This test is only valid with PostgreSQL 10 or later. if [ $PGVERSION -le 9 ];then exit 0 fi source $TESTLIBS TESTDIR=testdir PSQL=$PGBIN/psql CREATEUSER=$PGBIN/createuser rm -fr $TESTDIR mkdir $TESTDIR cd $TESTDIR # create test environment echo -n "creating test environment..." $PGPOOL_SETUP -m s -n 2 || exit 1 echo "done." source ./bashrc.ports #echo "enable_pool_hba = on" >> etc/pgpool.conf echo "allow_clear_text_frontend_auth = on" >> etc/pgpool.conf #set max_init_children to 1 to make sure we reuse the #connection to test wrong password rejection echo "num_init_children = 1" >> etc/pgpool.conf ./startall export PGPORT=$PGPOOL_PORT wait_for_pgpool_startup #set passwords $PSQL -c "SET password_encryption = 'scram-sha-256'; CREATE ROLE scram_user PASSWORD 'scram_password'; ALTER ROLE scram_user WITH LOGIN;" test $PSQL -c "SET password_encryption = 'md5'; CREATE ROLE md5_user PASSWORD 'md5_password'; ALTER ROLE md5_user WITH LOGIN" test $PSQL -c "CREATE ROLE trust_user PASSWORD 'trust_password';ALTER ROLE trust_user WITH LOGIN" test if $PSQL -c "SELECT rolname,substring(rolpassword, 1, 14) FROM pg_authid where rolname ='scram_user'" test|grep "SCRAM-SHA-256" >/dev/null 2>&1 then echo "scram_user authenticated setup successfuly" else echo "scram authentication setup failed" failed=1 fi if $PSQL -c "SELECT rolname,substring(rolpassword, 1, 4) FROM pg_authid where rolname ='md5_user'" test|grep "md5" >/dev/null 2>&1 then echo "md5 authenticated setup successfuly" else echo "md5 authentication setup failed" failed=1 fi #create pgpass file echo "127.0.0.1:$PGPORT:test:scram_user:scram_password" >> pgpass echo "127.0.0.1:$PGPORT:test:md5_user:md5_password" >> pgpass chmod 0600 pgpass echo "127.0.0.1:$PGPORT:test:scram_user:scram_wrong_password" >> pgpasswrong echo "127.0.0.1:$PGPORT:test:md5_user:md5_wrong_password" >> pgpasswrong chmod 0600 pgpasswrong export PGPASSFILE=$PWD/pgpass if $PSQL -h 127.0.0.1 -U scram_user -c "SELECT user, inet_client_addr();" test|grep "scram_user" >/dev/null 2>&1 then echo "scram_user authenticated successfuly" else echo "scram authentication failed" failed=1 fi if $PSQL -h 127.0.0.1 -U md5_user -c "SELECT user, inet_client_addr();" test|grep "md5_user" >/dev/null 2>&1 then echo "md5_user authenticated successfuly" else echo "md5 authentication failed" failed=1 fi #now try using the wrong passwords1: export PGPASSFILE=$PWD/pgpasswrong echo "Trying wrong passwords now" #try connect using scram_user and md5 user if $PSQL -h 127.0.0.1 -U scram_user -c "SELECT user, inet_client_addr();" test|grep "scram_user" >/dev/null 2>&1 then failed=1 echo "serious problem with scram authentication, password not verified by pgpool" else echo "wrong password rejected properly for scram auth" fi if $PSQL -h 127.0.0.1 -U md5_user -c "SELECT user, inet_client_addr();" test|grep "md5_user" >/dev/null 2>&1 then failed=1 echo "serious problem with md5 authentication, password not verified by pgpool" else echo "wrong password rejected properly for md5 auth" fi ./shutdownall if [ -z "$failed" ]; then exit 0 fi exit 1 pgpool-II-4.1.4/src/test/regression/tests/021.pool_passwd_auth/0000775000175000017500000000000013730350075021271 500000000000000pgpool-II-4.1.4/src/test/regression/tests/021.pool_passwd_auth/pool_hba.conf0000664000175000017500000000654613730350075023656 00000000000000# pgpool Client Authentication Configuration File # =============================================== # # The format rule in this file follows the rules in the PostgreSQL # Administrator's Guide. Refer to chapter "Client Authentication" for a # complete description. A short synopsis follows. # # This file controls: which hosts are allowed to connect, how clients # are authenticated, which user names they can use, which databases they # can access. Records take one of these forms: # # local DATABASE USER METHOD [OPTION] # host DATABASE USER CIDR-ADDRESS METHOD [OPTION] # # (The uppercase items must be replaced by actual values.) # # The first field is the connection type: "local" is a Unix-domain # socket, "host" is either a plain or SSL-encrypted TCP/IP socket. # # DATABASE can be "all", "sameuser", a database name, or a comma-separated # list thereof. Note that "samegroup" like in PostgreSQL's pg_hba.conf # file is not supported, since pgpool does not know which group a user # belongs to. Also note that the database specified here may not exist in # the backend PostgreSQL. pgpool will authenticate based on the database's # name, not based on whether it exists or not. # # USER can be "all", a user name, or a comma-separated list thereof. In # both the DATABASE and USER fields you can also write a file name prefixed # with "@" to include names from a separate file. Note that a group name # prefixed with "+" like in PostgreSQL's pg_hba.conf file is not supported # because of the same reason as "samegroup" token. Also note that a user # name specified here may not exist in the backend PostgreSQL. pgpool will # authenticate based on the user's name, not based on whether he/she exists. # # CIDR-ADDRESS specifies the set of hosts the record matches. # It is made up of an IP address and a CIDR mask that is an integer # (between 0 and 32 (IPv4) that specifies the number of significant bits in # the mask. Alternatively, you can write an IP address and netmask in # separate columns to specify the set of hosts. # # METHOD can be "trust", "reject", "md5" , "scram-sha-256" or "pam". # Note that "pam" sends passwords in clear text. # # OPTION is the name of the PAM service. Default service name is "pgpool" # # Database and user names containing spaces, commas, quotes and other special # characters must be quoted. Quoting one of the keywords "all" or "sameuser" # makes the name lose its special character, and just match a database or # username with that name. # # This file is read on pgpool startup. If you edit the file on a running # system, you have to restart the pgpool for the changes to take effect. # Put your actual configuration here # ---------------------------------- # # If you want to allow non-local connections, you need to add more # "host" records. In that case you will also need to make pgpool listen # on a non-local interface via the listen_addresses configuration parameter. # # TYPE DATABASE USER CIDR-ADDRESS METHOD # "local" is for Unix domain socket connections only local all all trust # IPv4 local connections: host all scram_user 127.0.0.1/32 scram-sha-256 host all scram_user ::1/128 scram-sha-256 host all md5_user 127.0.0.1/32 md5 host all md5_user ::1/128 md5 pgpool-II-4.1.4/src/test/regression/tests/021.pool_passwd_auth/test.sh0000775000175000017500000000750213730350075022533 00000000000000#!/usr/bin/env bash #------------------------------------------------------------------- # test script for scram and md5 authentication # where password is stored in pool_passwd file # # This test is only valid with PostgreSQL 10 or later. if [ $PGVERSION -le 9 ];then exit 0 fi source $TESTLIBS TESTDIR=testdir PSQL=$PGBIN/psql CREATEUSER=$PGBIN/createuser PG_ENC=$PGPOOL_INSTALL_DIR/bin/pg_enc rm -fr $TESTDIR mkdir $TESTDIR cd $TESTDIR # create test environment echo -n "creating test environment..." $PGPOOL_SETUP -m s -n 2 || exit 1 echo "done." source ./bashrc.ports #echo "enable_pool_hba = on" >> etc/pgpool.conf echo "allow_clear_text_frontend_auth = off" >> etc/pgpool.conf #set max_init_children to 1 to make sure we reuse the #connection to test wrong password rejection echo "num_init_children = 1" >> etc/pgpool.conf echo "enable_pool_hba = on" >> etc/pgpool.conf # create pgpoolkey file echo "pgpool secret key" > etc/pgpool_key chmod 0600 etc/pgpool_key export PGPOOLKEYFILE=$PWD/etc/pgpool_key #create pool_passwd file using AES256 encrypted password #echo "scram_user:scram_password" >> etc/pool_passwd #echo "md5_user:md5_password" >> etc/pool_passwd $PG_ENC -m -f etc/pgpool.conf -u scram_user scram_password $PG_ENC -m -f etc/pgpool.conf -u md5_user md5_password #copy the pool_hba to etc dir cp ../pool_hba.conf etc/ ./startall export PGPORT=$PGPOOL_PORT wait_for_pgpool_startup #set passwords $PSQL -c "SET password_encryption = 'scram-sha-256'; CREATE ROLE scram_user PASSWORD 'scram_password'; ALTER ROLE scram_user WITH LOGIN;" test $PSQL -c "SET password_encryption = 'md5'; CREATE ROLE md5_user PASSWORD 'md5_password'; ALTER ROLE md5_user WITH LOGIN" test $PSQL -c "CREATE ROLE trust_user PASSWORD 'trust_password';ALTER ROLE trust_user WITH LOGIN" test if $PSQL -c "SELECT rolname,substring(rolpassword, 1, 14) FROM pg_authid where rolname ='scram_user'" test|grep "SCRAM-SHA-256" >/dev/null 2>&1 then echo "scram_user authenticated setup successfuly" else echo "scram authentication setup failed" failed=1 fi if $PSQL -c "SELECT rolname,substring(rolpassword, 1, 4) FROM pg_authid where rolname ='md5_user'" test|grep "md5" >/dev/null 2>&1 then echo "md5 authenticated setup successfuly" else echo "md5 authentication setup failed" failed=1 fi #create pgpass file echo "127.0.0.1:$PGPORT:test:scram_user:scram_password" >> pgpass echo "127.0.0.1:$PGPORT:test:md5_user:md5_password" >> pgpass chmod 0600 pgpass echo "127.0.0.1:$PGPORT:test:scram_user:scram_wrong_password" >> pgpasswrong echo "127.0.0.1:$PGPORT:test:md5_user:md5_wrong_password" >> pgpasswrong chmod 0600 pgpasswrong export PGPASSFILE=$PWD/pgpass if $PSQL -h 127.0.0.1 -U scram_user -c "SELECT user, inet_client_addr();" test|grep "scram_user" >/dev/null 2>&1 then echo "scram_user authenticated successfuly" else echo "scram authentication failed" failed=1 fi if $PSQL -h 127.0.0.1 -U md5_user -c "SELECT user, inet_client_addr();" test|grep "md5_user" >/dev/null 2>&1 then echo "md5_user authenticated successfuly" else echo "md5 authentication failed" failed=1 fi #now try using the wrong passwords1: export PGPASSFILE=$PWD/pgpasswrong echo "Trying wrong passwords now" #try connect using scram_user and md5 user if $PSQL -h 127.0.0.1 -U scram_user -c "SELECT user, inet_client_addr();" test|grep "scram_user" >/dev/null 2>&1 then failed=1 echo "serious problem with scram authentication, password not verified by pgpool" else echo "wrong password rejected properly for scram auth" fi if $PSQL -h 127.0.0.1 -U md5_user -c "SELECT user, inet_client_addr();" test|grep "md5_user" >/dev/null 2>&1 then failed=1 echo "serious problem with md5 authentication, password not verified by pgpool" else echo "wrong password rejected properly for md5 auth" fi ./shutdownall if [ -z "$failed" ]; then exit 0 fi exit 1 pgpool-II-4.1.4/src/test/regression/tests/022.pool_passwd_alternative_auth/0000775000175000017500000000000013730350075023670 500000000000000pgpool-II-4.1.4/src/test/regression/tests/022.pool_passwd_alternative_auth/pool_hba.conf0000664000175000017500000000654613730350075026255 00000000000000# pgpool Client Authentication Configuration File # =============================================== # # The format rule in this file follows the rules in the PostgreSQL # Administrator's Guide. Refer to chapter "Client Authentication" for a # complete description. A short synopsis follows. # # This file controls: which hosts are allowed to connect, how clients # are authenticated, which user names they can use, which databases they # can access. Records take one of these forms: # # local DATABASE USER METHOD [OPTION] # host DATABASE USER CIDR-ADDRESS METHOD [OPTION] # # (The uppercase items must be replaced by actual values.) # # The first field is the connection type: "local" is a Unix-domain # socket, "host" is either a plain or SSL-encrypted TCP/IP socket. # # DATABASE can be "all", "sameuser", a database name, or a comma-separated # list thereof. Note that "samegroup" like in PostgreSQL's pg_hba.conf # file is not supported, since pgpool does not know which group a user # belongs to. Also note that the database specified here may not exist in # the backend PostgreSQL. pgpool will authenticate based on the database's # name, not based on whether it exists or not. # # USER can be "all", a user name, or a comma-separated list thereof. In # both the DATABASE and USER fields you can also write a file name prefixed # with "@" to include names from a separate file. Note that a group name # prefixed with "+" like in PostgreSQL's pg_hba.conf file is not supported # because of the same reason as "samegroup" token. Also note that a user # name specified here may not exist in the backend PostgreSQL. pgpool will # authenticate based on the user's name, not based on whether he/she exists. # # CIDR-ADDRESS specifies the set of hosts the record matches. # It is made up of an IP address and a CIDR mask that is an integer # (between 0 and 32 (IPv4) that specifies the number of significant bits in # the mask. Alternatively, you can write an IP address and netmask in # separate columns to specify the set of hosts. # # METHOD can be "trust", "reject", "md5" , "scram-sha-256" or "pam". # Note that "pam" sends passwords in clear text. # # OPTION is the name of the PAM service. Default service name is "pgpool" # # Database and user names containing spaces, commas, quotes and other special # characters must be quoted. Quoting one of the keywords "all" or "sameuser" # makes the name lose its special character, and just match a database or # username with that name. # # This file is read on pgpool startup. If you edit the file on a running # system, you have to restart the pgpool for the changes to take effect. # Put your actual configuration here # ---------------------------------- # # If you want to allow non-local connections, you need to add more # "host" records. In that case you will also need to make pgpool listen # on a non-local interface via the listen_addresses configuration parameter. # # TYPE DATABASE USER CIDR-ADDRESS METHOD # "local" is for Unix domain socket connections only local all all trust # IPv4 local connections: host all md5_user 127.0.0.1/32 scram-sha-256 host all md5_user ::1/128 scram-sha-256 host all scram_user 127.0.0.1/32 md5 host all scram_user ::1/128 md5 pgpool-II-4.1.4/src/test/regression/tests/022.pool_passwd_alternative_auth/test.sh0000775000175000017500000000706313730350075025134 00000000000000#!/usr/bin/env bash #------------------------------------------------------------------- # test script for scram and md5 authentication # where password is stored in pool_passwd file and # frontend uses different auth from backends # # This test is only valid with PostgreSQL 10 or later. if [ $PGVERSION -le 9 ];then exit 0 fi source $TESTLIBS TESTDIR=testdir PSQL=$PGBIN/psql CREATEUSER=$PGBIN/createuser rm -fr $TESTDIR mkdir $TESTDIR cd $TESTDIR # create test environment echo -n "creating test environment..." $PGPOOL_SETUP -m s -n 2 || exit 1 echo "done." source ./bashrc.ports #echo "enable_pool_hba = on" >> etc/pgpool.conf echo "allow_clear_text_frontend_auth = off" >> etc/pgpool.conf #set max_init_children to 1 to make sure we reuse the #connection to test wrong password rejection echo "num_init_children = 1" >> etc/pgpool.conf echo "enable_pool_hba = on" >> etc/pgpool.conf #create pool_passwd file echo "scram_user:scram_password" >> etc/pool_passwd echo "md5_user:md5_password" >> etc/pool_passwd #copy the pool_hba to etc dir cp ../pool_hba.conf etc/ ./startall export PGPORT=$PGPOOL_PORT wait_for_pgpool_startup #set passwords $PSQL -c "SET password_encryption = 'scram-sha-256'; CREATE ROLE scram_user PASSWORD 'scram_password'; ALTER ROLE scram_user WITH LOGIN;" test $PSQL -c "SET password_encryption = 'md5'; CREATE ROLE md5_user PASSWORD 'md5_password'; ALTER ROLE md5_user WITH LOGIN" test $PSQL -c "CREATE ROLE trust_user PASSWORD 'trust_password';ALTER ROLE trust_user WITH LOGIN" test if $PSQL -c "SELECT rolname,substring(rolpassword, 1, 14) FROM pg_authid where rolname ='scram_user'" test|grep "SCRAM-SHA-256" >/dev/null 2>&1 then echo "scram_user authenticated setup successfuly" else echo "scram authentication setup failed" failed=1 fi if $PSQL -c "SELECT rolname,substring(rolpassword, 1, 4) FROM pg_authid where rolname ='md5_user'" test|grep "md5" >/dev/null 2>&1 then echo "md5 authenticated setup successfuly" else echo "md5 authentication setup failed" failed=1 fi #create pgpass file echo "127.0.0.1:$PGPORT:test:scram_user:scram_password" >> pgpass echo "127.0.0.1:$PGPORT:test:md5_user:md5_password" >> pgpass chmod 0600 pgpass echo "127.0.0.1:$PGPORT:test:scram_user:scram_wrong_password" >> pgpasswrong echo "127.0.0.1:$PGPORT:test:md5_user:md5_wrong_password" >> pgpasswrong chmod 0600 pgpasswrong export PGPASSFILE=$PWD/pgpass if $PSQL -h 127.0.0.1 -U scram_user -c "SELECT user, inet_client_addr();" test|grep "scram_user" >/dev/null 2>&1 then echo "scram_user authenticated successfuly" else echo "scram authentication failed" failed=1 fi if $PSQL -h 127.0.0.1 -U md5_user -c "SELECT user, inet_client_addr();" test|grep "md5_user" >/dev/null 2>&1 then echo "md5_user authenticated successfuly" else echo "md5 authentication failed" failed=1 fi #now try using the wrong passwords1: export PGPASSFILE=$PWD/pgpasswrong echo "Trying wrong passwords now" #try connect using scram_user and md5 user if $PSQL -h 127.0.0.1 -U scram_user -c "SELECT user, inet_client_addr();" test|grep "scram_user" >/dev/null 2>&1 then failed=1 echo "serious problem with scram authentication, password not verified by pgpool" else echo "wrong password rejected properly for scram auth" fi if $PSQL -h 127.0.0.1 -U md5_user -c "SELECT user, inet_client_addr();" test|grep "md5_user" >/dev/null 2>&1 then failed=1 echo "serious problem with md5 authentication, password not verified by pgpool" else echo "wrong password rejected properly for md5 auth" fi ./shutdownall if [ -z "$failed" ]; then exit 0 fi exit 1 pgpool-II-4.1.4/src/test/regression/tests/023.ssl_connection/0000775000175000017500000000000013730350127020736 500000000000000pgpool-II-4.1.4/src/test/regression/tests/023.ssl_connection/README0000664000175000017500000000040313730350075021535 00000000000000The sample server.key and server.crt was created by using following commands: openssl req -new -text -out server.req openssl rsa -in privkey.pem -out server.key rm privkey.pem openssl req -x509 -days 3650 -in server.req -text -key server.key -out server.crt pgpool-II-4.1.4/src/test/regression/tests/023.ssl_connection/server.crt0000664000175000017500000001030513730350075022677 00000000000000Certificate: Data: Version: 3 (0x2) Serial Number: f4:86:4a:aa:50:42:63:dc Signature Algorithm: sha256WithRSAEncryption Issuer: C = AU, ST = Some-State, O = Internet Widgits Pty Ltd Validity Not Before: Aug 29 02:52:36 2018 GMT Not After : Aug 26 02:52:36 2028 GMT Subject: C = AU, ST = Some-State, O = Internet Widgits Pty Ltd Subject Public Key Info: Public Key Algorithm: rsaEncryption Public-Key: (2048 bit) Modulus: 00:f4:e3:30:f0:09:e2:43:0e:a1:67:2e:3b:ef:b5: 88:1e:4e:a9:06:fa:f2:94:8b:fa:4f:0a:9f:e0:57: 45:95:2c:c1:18:1d:21:6d:c8:5c:2a:05:94:0b:c6: 49:c5:97:88:ac:88:ba:73:fb:81:28:eb:e1:cd:7f: 9d:fb:e0:c5:0d:ef:35:cc:12:b8:74:0b:a1:e9:65: d4:19:38:9b:a8:e1:c5:ef:d5:f1:9c:cf:8a:de:bf: fa:d7:6c:f9:d7:85:10:db:9f:e9:03:e9:7e:f1:81: de:9d:f3:b3:a3:6f:19:31:c8:bb:31:c0:e7:7d:ea: 6b:02:98:21:7c:c2:f5:9d:0d:7c:85:2b:5d:81:7c: 71:74:42:89:ab:5c:31:ac:19:fd:c2:0b:fb:e5:c2: b2:54:15:64:40:9c:bf:ed:d2:b1:bb:75:f9:e9:d8: 67:b3:4e:63:c4:3e:f4:8a:2c:87:50:27:dd:22:97: f1:f7:26:49:87:03:55:08:a4:d2:44:21:e1:9a:33: 82:96:09:b3:08:65:bc:a8:3a:f4:64:f3:60:62:d0: 98:d9:82:0c:1b:be:b6:9c:22:e8:7f:e6:eb:20:d9: 71:67:2c:d5:14:83:aa:f1:37:75:98:4c:68:1d:95: fe:1f:ec:cb:9b:17:9c:f4:92:22:da:bb:78:46:f3: de:7d Exponent: 65537 (0x10001) X509v3 extensions: X509v3 Subject Key Identifier: 68:ED:A7:FE:1E:36:26:18:80:2B:C6:A2:07:23:1C:A4:00:57:16:68 X509v3 Authority Key Identifier: keyid:68:ED:A7:FE:1E:36:26:18:80:2B:C6:A2:07:23:1C:A4:00:57:16:68 X509v3 Basic Constraints: critical CA:TRUE Signature Algorithm: sha256WithRSAEncryption dd:61:62:83:6e:fa:e8:8a:1b:02:c6:9f:7f:f3:52:f8:04:5c: c9:35:f9:4c:1d:4f:0f:9f:6c:a2:18:95:f0:76:93:e5:99:58: 4a:88:7a:54:68:cf:28:64:8e:01:3f:fb:7e:28:6f:ad:c6:08: a2:09:77:4c:13:4b:1d:68:70:38:91:d4:dc:f7:c3:c8:81:36: 48:b9:01:46:f9:fa:e8:f7:ba:fe:23:4c:e3:27:a9:58:2d:a6: 3d:88:ac:b8:71:9b:84:ec:bd:82:c4:45:1d:ba:77:ed:73:54: a9:16:76:80:40:0b:80:42:47:60:84:cf:41:e0:0f:8e:85:d3: 28:36:fb:f6:8c:f8:c6:20:b3:c4:06:cc:2d:6d:37:78:b4:d5: 4d:14:db:f0:04:56:66:d8:5a:cc:ff:bd:0c:19:6d:39:bf:26: ac:17:0c:91:a4:68:4b:bc:86:4f:0a:10:81:b5:ac:1e:a6:78: b1:7f:e9:f3:9e:1b:32:92:b2:8f:f7:e2:a3:ae:44:e2:99:b0: 04:0a:15:eb:7a:37:10:b2:7b:ef:35:6c:a5:db:13:96:42:e9: 22:3c:72:6a:34:16:0d:b5:2c:49:f3:83:c7:ff:da:ec:57:14: ab:0d:8d:76:8f:f0:a2:21:4f:88:54:bc:2f:c6:b9:7b:8c:da: 42:9a:b1:12 -----BEGIN CERTIFICATE----- MIIDYDCCAkigAwIBAgIJAPSGSqpQQmPcMA0GCSqGSIb3DQEBCwUAMEUxCzAJBgNV BAYTAkFVMRMwEQYDVQQIDApTb21lLVN0YXRlMSEwHwYDVQQKDBhJbnRlcm5ldCBX aWRnaXRzIFB0eSBMdGQwHhcNMTgwODI5MDI1MjM2WhcNMjgwODI2MDI1MjM2WjBF MQswCQYDVQQGEwJBVTETMBEGA1UECAwKU29tZS1TdGF0ZTEhMB8GA1UECgwYSW50 ZXJuZXQgV2lkZ2l0cyBQdHkgTHRkMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB CgKCAQEA9OMw8AniQw6hZy4777WIHk6pBvrylIv6Twqf4FdFlSzBGB0hbchcKgWU C8ZJxZeIrIi6c/uBKOvhzX+d++DFDe81zBK4dAuh6WXUGTibqOHF79XxnM+K3r/6 12z514UQ25/pA+l+8YHenfOzo28ZMci7McDnfeprApghfML1nQ18hStdgXxxdEKJ q1wxrBn9wgv75cKyVBVkQJy/7dKxu3X56dhns05jxD70iiyHUCfdIpfx9yZJhwNV CKTSRCHhmjOClgmzCGW8qDr0ZPNgYtCY2YIMG762nCLof+brINlxZyzVFIOq8Td1 mExoHZX+H+zLmxec9JIi2rt4RvPefQIDAQABo1MwUTAdBgNVHQ4EFgQUaO2n/h42 JhiAK8aiByMcpABXFmgwHwYDVR0jBBgwFoAUaO2n/h42JhiAK8aiByMcpABXFmgw DwYDVR0TAQH/BAUwAwEB/zANBgkqhkiG9w0BAQsFAAOCAQEA3WFig2766IobAsaf f/NS+ARcyTX5TB1PD59sohiV8HaT5ZlYSoh6VGjPKGSOAT/7fihvrcYIogl3TBNL HWhwOJHU3PfDyIE2SLkBRvn66Pe6/iNM4yepWC2mPYisuHGbhOy9gsRFHbp37XNU qRZ2gEALgEJHYITPQeAPjoXTKDb79oz4xiCzxAbMLW03eLTVTRTb8ARWZthazP+9 DBltOb8mrBcMkaRoS7yGTwoQgbWsHqZ4sX/p854bMpKyj/fio65E4pmwBAoV63o3 ELJ77zVspdsTlkLpIjxyajQWDbUsSfODx//a7FcUqw2Ndo/woiFPiFS8L8a5e4za QpqxEg== -----END CERTIFICATE----- pgpool-II-4.1.4/src/test/regression/tests/023.ssl_connection/server.key0000664000175000017500000000321713730350075022703 00000000000000-----BEGIN RSA PRIVATE KEY----- MIIEpQIBAAKCAQEA9OMw8AniQw6hZy4777WIHk6pBvrylIv6Twqf4FdFlSzBGB0h bchcKgWUC8ZJxZeIrIi6c/uBKOvhzX+d++DFDe81zBK4dAuh6WXUGTibqOHF79Xx nM+K3r/612z514UQ25/pA+l+8YHenfOzo28ZMci7McDnfeprApghfML1nQ18hStd gXxxdEKJq1wxrBn9wgv75cKyVBVkQJy/7dKxu3X56dhns05jxD70iiyHUCfdIpfx 9yZJhwNVCKTSRCHhmjOClgmzCGW8qDr0ZPNgYtCY2YIMG762nCLof+brINlxZyzV FIOq8Td1mExoHZX+H+zLmxec9JIi2rt4RvPefQIDAQABAoIBAD6EfaraKxxJcOUh hYWlx3FNTZONnz5TGfzxzmz8erQhr84TKcSYIQdNU0VKQu0hyW+anFcdvxSOW6AV 02RJNqVfC1Hk+ZgOnDA0odgqfnq34MtgyATrax2Az24N0R63Rt16zocEJjdLm2Sh oZu4sirmfvutrquTm+wWoH30W7XTCrd17thq8+5VBumXLW4sr40PWXcfPC1Od7JH utYZ0lGxr89fhuPpnpLw7V67EdslwmYl8avhzrUlzkXPqufZ33XdWFi/IXoNjMZ2 MFgZFNKHv682nqjrrodyn4iXEzMSj4z4QLTNxoH79HWvCb2HjUpEWTNrfdu3LNCZ FahqHmECgYEA/5MmEEB2GNlhaMP+NMK/3x9RCfDfleqEdExf0KA6TuISNYUgeEeB dfczCN8WtxyDMor6fvwINxEAHX64/CompE/ya+Z25VdBQMcLpNVGS01aDdrqWN5B 4qG8OyK3+eAjCnvyCzWsvvpK1I5u65q6+Q+Cw1wQaxYzhsZkEazQ0OkCgYEA9Ut9 m74RMGudjkvJK7JIPLDLGEsko+yrh8IuoGn/wLpUJwmkZFQu8HRqdddMVjwQi4CN IDScbvyH0uE2yN+gg/BB0eBIyhfrI3xl6FJIQBnI0/7wmb2U82OT0LS18h9n8dAK +mONcR3zL7XDe8xy1qTS0jjd1QT1QS4YLGPCxHUCgYEAowftCgT00NkqaDhOWr24 w84oVd0P44QcRkvJ+z2atGNGFln74n5KuUOdjJUy2lAX6Q/6xzJi0y3HEwmZW1JQ IBTXobj8M0Q73eSbKuTZ2INZZOk3AMWW5ckiV97H2V//OlrihgARWCo1ve22GBk2 GFaqpZB+8LDS4bCAeT3yXrECgYEA5rZ3USonLry5d2JOt5u7F+JNU+8xakErYMhC ZLzuQY6/oewOxBLuB1nn3CiBc0aRZTSnCFiTnkxFUBJmHe9AIXiz37wtmm9+yWSy 0R27ORdHbiYGlQPcekP5fr7Jtw7VDHraKIHEQlWiKwix8dntVXe3luTHuRktuH2r XO0D/xUCgYEAlQtXyGSl/taUjKyfvfxlFDtpOwBAwUj2CsNzeUd2/5aWkqUrtYz8 JNCPgSLPKDhLpavH0vUEmftF3uDVPxvMQ4JG9MQ7meHgL7AZmtKdU0VI+Av9xiJe d7A1x6o88gv1TqvGRit2qRxNOT0mzhDcXuR2EIQqUav45NyBokSo9xw= -----END RSA PRIVATE KEY----- pgpool-II-4.1.4/src/test/regression/tests/023.ssl_connection/server.req0000664000175000017500000000653613730350075022711 00000000000000Certificate Request: Data: Version: 1 (0x0) Subject: C = AU, ST = Some-State, O = Internet Widgits Pty Ltd Subject Public Key Info: Public Key Algorithm: rsaEncryption Public-Key: (2048 bit) Modulus: 00:f4:e3:30:f0:09:e2:43:0e:a1:67:2e:3b:ef:b5: 88:1e:4e:a9:06:fa:f2:94:8b:fa:4f:0a:9f:e0:57: 45:95:2c:c1:18:1d:21:6d:c8:5c:2a:05:94:0b:c6: 49:c5:97:88:ac:88:ba:73:fb:81:28:eb:e1:cd:7f: 9d:fb:e0:c5:0d:ef:35:cc:12:b8:74:0b:a1:e9:65: d4:19:38:9b:a8:e1:c5:ef:d5:f1:9c:cf:8a:de:bf: fa:d7:6c:f9:d7:85:10:db:9f:e9:03:e9:7e:f1:81: de:9d:f3:b3:a3:6f:19:31:c8:bb:31:c0:e7:7d:ea: 6b:02:98:21:7c:c2:f5:9d:0d:7c:85:2b:5d:81:7c: 71:74:42:89:ab:5c:31:ac:19:fd:c2:0b:fb:e5:c2: b2:54:15:64:40:9c:bf:ed:d2:b1:bb:75:f9:e9:d8: 67:b3:4e:63:c4:3e:f4:8a:2c:87:50:27:dd:22:97: f1:f7:26:49:87:03:55:08:a4:d2:44:21:e1:9a:33: 82:96:09:b3:08:65:bc:a8:3a:f4:64:f3:60:62:d0: 98:d9:82:0c:1b:be:b6:9c:22:e8:7f:e6:eb:20:d9: 71:67:2c:d5:14:83:aa:f1:37:75:98:4c:68:1d:95: fe:1f:ec:cb:9b:17:9c:f4:92:22:da:bb:78:46:f3: de:7d Exponent: 65537 (0x10001) Attributes: a0:00 Signature Algorithm: sha256WithRSAEncryption 7a:30:69:6c:aa:30:6f:f3:bc:dc:85:78:04:ef:f6:0c:b2:04: e7:03:55:fd:4a:98:74:d6:fd:24:a1:e9:e8:3d:e3:a1:b0:dc: 12:b9:1f:38:fe:9e:42:5a:0c:06:b8:0c:f6:65:0b:78:95:73: 27:31:14:e5:4d:4f:e2:82:3f:52:24:45:ba:31:e7:87:b7:c8: b9:8a:db:5f:5e:fd:1a:f2:6c:7d:d6:d1:1d:19:77:5e:10:51: d3:24:7f:5a:7d:3f:eb:db:33:0b:27:97:72:b9:f0:ea:89:79: ca:b7:23:7c:c0:8a:e9:11:30:45:99:09:58:da:08:86:28:32: 21:c0:3f:2e:87:3e:a4:96:55:f1:65:72:4f:06:0b:b3:a1:97: 7d:54:6c:0d:96:b4:41:11:6e:28:45:cb:16:d7:1e:70:1e:a8: a2:4e:7f:65:8e:71:e9:05:e2:ad:cc:9a:79:1d:73:39:e8:f0: e8:f3:75:ab:bf:9d:44:7b:b7:76:3f:0d:50:e0:9c:ef:2c:d5: eb:c3:0d:4f:c1:77:af:56:7e:78:db:e8:a0:52:05:f6:49:89: ab:c0:ff:d6:97:9d:9d:84:14:12:73:ee:31:1d:12:ad:e7:91: 8d:ac:ff:ee:8d:18:07:be:c8:ec:57:9d:78:41:9c:1e:a1:75: 2b:99:f7:70 -----BEGIN CERTIFICATE REQUEST----- MIICijCCAXICAQAwRTELMAkGA1UEBhMCQVUxEzARBgNVBAgMClNvbWUtU3RhdGUx ITAfBgNVBAoMGEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZDCCASIwDQYJKoZIhvcN AQEBBQADggEPADCCAQoCggEBAPTjMPAJ4kMOoWcuO++1iB5OqQb68pSL+k8Kn+BX RZUswRgdIW3IXCoFlAvGScWXiKyIunP7gSjr4c1/nfvgxQ3vNcwSuHQLoell1Bk4 m6jhxe/V8ZzPit6/+tds+deFENuf6QPpfvGB3p3zs6NvGTHIuzHA533qawKYIXzC 9Z0NfIUrXYF8cXRCiatcMawZ/cIL++XCslQVZECcv+3Ssbt1+enYZ7NOY8Q+9Ios h1An3SKX8fcmSYcDVQik0kQh4ZozgpYJswhlvKg69GTzYGLQmNmCDBu+tpwi6H/m 6yDZcWcs1RSDqvE3dZhMaB2V/h/sy5sXnPSSItq7eEbz3n0CAwEAAaAAMA0GCSqG SIb3DQEBCwUAA4IBAQB6MGlsqjBv87zchXgE7/YMsgTnA1X9Sph01v0koenoPeOh sNwSuR84/p5CWgwGuAz2ZQt4lXMnMRTlTU/igj9SJEW6MeeHt8i5ittfXv0a8mx9 1tEdGXdeEFHTJH9afT/r2zMLJ5dyufDqiXnKtyN8wIrpETBFmQlY2giGKDIhwD8u hz6kllXxZXJPBguzoZd9VGwNlrRBEW4oRcsW1x5wHqiiTn9ljnHpBeKtzJp5HXM5 6PDo83Wrv51Ee7d2Pw1Q4JzvLNXrww1PwXevVn542+igUgX2SYmrwP/Wl52dhBQS c+4xHRKt55GNrP/ujRgHvsjsV514QZweoXUrmfdw -----END CERTIFICATE REQUEST----- pgpool-II-4.1.4/src/test/regression/tests/023.ssl_connection/test.sh0000775000175000017500000000506513730350127022202 00000000000000#!/usr/bin/env bash #------------------------------------------------------------------- # test script for SSL connection for: frontend <--> Pgpool-II and Pgpool-II and PostgreSQL. # source $TESTLIBS TESTDIR=testdir PSQL=$PGBIN/psql PG_CTL=$PGBIN/pg_ctl export PGDATABASE=test SSL_KEY=server.key SSL_CRT=server.crt rm -fr $TESTDIR mkdir $TESTDIR cd $TESTDIR # create test environment. Number of backend node is 1 is enough. echo -n "creating test environment..." $PGPOOL_SETUP -m s -n 1 || exit 1 echo "done." # setup SSL key and crt file cp -p ../$SSL_KEY etc/ chmod og-rwx etc/$SSL_KEY cp -p ../$SSL_CRT etc/ cp -p ../$SSL_KEY data0/ chmod og-rwx data0/$SSL_KEY cp -p ../$SSL_CRT data0/ # enable SSL support dir=`pwd` echo "ssl = on" >> etc/pgpool.conf echo "ssl_key = '$dir/etc/$SSL_KEY'" >> etc/pgpool.conf echo "ssl_cert = '$dir/etc/$SSL_CRT'" >> etc/pgpool.conf echo "ssl_prefer_server_ciphers = on" >> etc/pgpool.conf echo "ssl_ciphers = 'EECDH:HIGH:MEDIUM:+3DES:!aNULL'" >> etc/pgpool.conf echo "ssl = on" >> data0/postgresql.conf echo "ssl_cert_file = '$SSL_CRT'" >> data0/postgresql.conf echo "ssl_key_file = '$SSL_KEY'" >> data0/postgresql.conf # backend must be connected via TCP/IP echo "backend_hostname0 = 'localhost'" >> etc/pgpool.conf # produce debug message since the only way to confirm the SSL # connectins is being established is, look into the debug log. echo "log_min_messages = debug5" >> etc/pgpool.conf # allow to access IPv6 localhost echo "host all all ::1/128 trust" >> data0/pg_hba.conf source ./bashrc.ports ./startall export PGPORT=$PGPOOL_PORT wait_for_pgpool_startup # first, checking frontend<-->Pgpool-II... $PSQL -h localhost test < result \conninfo \q EOF grep SSL result if [ $? != 0 ];then echo "Checking SSL connection between frontend and Pgpool-II failed." ./shutdownall exit 1 fi echo "Checking SSL connection between frontend and Pgpool-II was ok." grep SSL result |grep TLSv1.2 # if SSl protocol version TLSv1.2 if [ $? = 0 ];then grep SSL result |grep ECDH if [ $? != 0 ];then echo "Checking SSL connection with ECDH between frontend and Pgpool-II failed." ./shutdownall exit 1 fi echo "Checking SSL connection with ECDH between frontend and Pgpool-II was ok." fi grep "client->server SSL response: S" log/pgpool.log >/dev/null if [ $? != 0 ];then echo "Checking SSL connection between Pgpool-II and backend failed." ./shutdownall exit 1 fi echo "Checking SSL connection between Pgpool-II and backend was ok." ./shutdownall exit 0 pgpool-II-4.1.4/src/test/regression/tests/024.cert_auth/0000775000175000017500000000000013730350127017675 500000000000000pgpool-II-4.1.4/src/test/regression/tests/024.cert_auth/cert.sh0000775000175000017500000000104613730350127021112 00000000000000#!/usr/bin/env bash # Create root cert openssl req -new -x509 -nodes -out root.crt -keyout root.key -days 365 -subj /CN=MyRootCA # PostgreSQL/Pgpool cert openssl req -new -out server.req -keyout server.key -nodes -subj "/CN=postgresql" openssl x509 -req -in server.req -CAkey root.key -CA root.crt -days 365 -CAcreateserial -out server.crt # Frontend Cert openssl req -new -out postgresql.req -keyout frontend.key -nodes -subj "/CN=$USER" openssl x509 -req -in postgresql.req -CAkey root.key -CA root.crt -days 365 -CAcreateserial -out frontend.crt pgpool-II-4.1.4/src/test/regression/tests/024.cert_auth/test.sh0000775000175000017500000000306713730350127021141 00000000000000#!/usr/bin/env bash #------------------------------------------------------------------- # test script for cert authentication for: frontend <--> Pgpool-II. # source $TESTLIBS TESTDIR=testdir PSQL=$PGBIN/psql PG_CTL=$PGBIN/pg_ctl export PGDATABASE=test # Generate certifications ./cert.sh dir=`pwd` SSL_KEY=$dir/server.key SSL_CRT=$dir/server.crt ROOT_CRT=$dir/root.crt FRONTEND_KEY=$dir/frontend.key FRONTEND_CRT=$dir/frontend.crt chmod 600 *.key rm -fr $TESTDIR mkdir $TESTDIR cd $TESTDIR # create test environment. Number of backend node is 1 is enough. echo -n "creating test environment..." $PGPOOL_SETUP -m s -n 1 || exit 1 echo "done." dir=`pwd` echo "ssl = on" >> etc/pgpool.conf echo "ssl_key = '$SSL_KEY'" >> etc/pgpool.conf echo "ssl_cert = '$SSL_CRT'" >> etc/pgpool.conf echo "ssl_ca_cert = '$ROOT_CRT'" >> etc/pgpool.conf echo "enable_pool_hba = on" >> etc/pgpool.conf # allow to access IPv6 localhost echo "hostssl all all 127.0.0.1/32 cert" >> etc/pool_hba.conf echo "hostssl all all ::1/128 cert" >> etc/pool_hba.conf sed -i "/^host.*trust$/d" etc/pool_hba.conf source ./bashrc.ports ./startall export PGPORT=$PGPOOL_PORT wait_for_pgpool_startup export PGSSLCERT=$FRONTEND_CRT export PGSSLKEY=$FRONTEND_KEY $PSQL -h localhost -c "select 1" test grep "SSL certificate authentication for user" log/pgpool.log|grep successful if [ $? != 0 ];then echo "Checking cert auth between Pgpool-II and frontend failed." ./shutdownall exit 1 fi echo "Checking cert auth between Pgpool-II and frontend was ok." ./shutdownall exit 0 pgpool-II-4.1.4/src/test/regression/tests/025.enable_shared_relcache/0000775000175000017500000000000013730350075022324 500000000000000pgpool-II-4.1.4/src/test/regression/tests/025.enable_shared_relcache/test.sh0000775000175000017500000000271713730350075023571 00000000000000#!/usr/bin/env bash #------------------------------------------------------------------- # test script for memqcache with memcached. # need to configure --with-memcached=/usr. # requires Java PostgreSQL JDBC driver. PGBENCH=$PGBENCH_PATH WHOAMI=`whoami` source $TESTLIBS TESTDIR=testdir PSQL=$PGBIN/psql rm -fr $TESTDIR mkdir $TESTDIR cd $TESTDIR # create test environment echo -n "creating test environment..." $PGPOOL_SETUP -n 2 || exit 1 echo "done." #echo "memory_cache_enabled = off" >> etc/pgpool.conf echo "log_min_messages = debug1" >> etc/pgpool.conf echo "enable_shared_relcache = on" >> etc/pgpool.conf echo "relcache_expire = 60" >> etc/pgpool.conf for mode in shmem memcached do if [ $mode = "shmem" ];then echo "memqcache_method = 'shmem'" >> etc/pgpool.conf elif [ $mode = "memcached" ];then echo "memqcache_method = 'memcached'" >> etc/pgpool.conf fi source ./bashrc.ports export PGPORT=$PGPOOL_PORT ./startall wait_for_pgpool_startup # initialize tables $PGBENCH -i test $PGBENCH -C -S -c 2 -t 10 test ./shutdownall echo "SELECT query don not use query cache" grep "commiting SELECT results to cache storage" log/pgpool.log > /dev/null 2>&1 if [ $? != 0 ];then echo "... ok." else echo "... failed." exit 1 fi echo "relation cache use query cache" grep "commiting relation cache to cache storage" log/pgpool.log > /dev/null 2>&1 if [ $? = 0 ];then echo "... ok." else echo "... failed." exit 1 fi done exit 0 pgpool-II-4.1.4/src/test/regression/tests/026.temp_table/0000775000175000017500000000000013730350075020037 500000000000000pgpool-II-4.1.4/src/test/regression/tests/026.temp_table/expected.txt0000664000175000017500000000240213730350075022317 00000000000000CREATE TABLE t1(i int); CREATE TABLE INSERT INTO T1 VALUES(1); INSERT 0 1 CREATE TEMP TABLE t1(i int); CREATE TABLE SELECT * FROM t1; -- should return 0 row i --- (0 rows) DROP TABLE t1; DROP TABLE SELECT * FROM t1; -- should return 1 row i --- 1 (1 row) BEGIN; BEGIN CREATE TEMP TABLE t1(i int); CREATE TABLE SELECT * FROM t1; -- should return 0 row i --- (0 rows) DROP TABLE t1; DROP TABLE SELECT * FROM t1; -- should return 1 row i --- 1 (1 row) END; COMMIT BEGIN; BEGIN CREATE TEMP TABLE t1(i int); CREATE TABLE SELECT * FROM t1; -- should return 0 row i --- (0 rows) aaa; ABORT; ROLLBACK SELECT * FROM t1; -- should return 1 row i --- 1 (1 row) CREATE TEMP TABLE t1(i int); CREATE TABLE CREATE TEMP TABLE t2(i int); CREATE TABLE CREATE TEMP TABLE t3(i int); CREATE TABLE SELECT * FROM t1; -- should return 0 row i --- (0 rows) DROP TABLE t1, t2, t3; DROP TABLE SELECT * FROM t1; -- should return 1 row i --- 1 (1 row) BEGIN; BEGIN CREATE TEMP TABLE t1(i int); CREATE TABLE CREATE TEMP TABLE t2(i int); CREATE TABLE CREATE TEMP TABLE t3(i int); CREATE TABLE SELECT * FROM t1; -- should return 0 row i --- (0 rows) DROP TABLE t1, t2, t3; DROP TABLE SELECT * FROM t1; -- should return 1 row i --- 1 (1 row) END; COMMIT DROP TABLE t1; DROP TABLE pgpool-II-4.1.4/src/test/regression/tests/026.temp_table/temp_table.sql0000664000175000017500000000153513730350075022620 00000000000000CREATE TABLE t1(i int); INSERT INTO T1 VALUES(1); CREATE TEMP TABLE t1(i int); SELECT * FROM t1; -- should return 0 row DROP TABLE t1; SELECT * FROM t1; -- should return 1 row BEGIN; CREATE TEMP TABLE t1(i int); SELECT * FROM t1; -- should return 0 row DROP TABLE t1; SELECT * FROM t1; -- should return 1 row END; BEGIN; CREATE TEMP TABLE t1(i int); SELECT * FROM t1; -- should return 0 row aaa; ABORT; SELECT * FROM t1; -- should return 1 row CREATE TEMP TABLE t1(i int); CREATE TEMP TABLE t2(i int); CREATE TEMP TABLE t3(i int); SELECT * FROM t1; -- should return 0 row DROP TABLE t1, t2, t3; SELECT * FROM t1; -- should return 1 row BEGIN; CREATE TEMP TABLE t1(i int); CREATE TEMP TABLE t2(i int); CREATE TEMP TABLE t3(i int); SELECT * FROM t1; -- should return 0 row DROP TABLE t1, t2, t3; SELECT * FROM t1; -- should return 1 row END; DROP TABLE t1; pgpool-II-4.1.4/src/test/regression/tests/026.temp_table/test.sh0000775000175000017500000000141013730350075021271 00000000000000#!/usr/bin/env bash #------------------------------------------------------------------- # test script for temporary table tracing. WHOAMI=`whoami` source $TESTLIBS TESTDIR=testdir PSQL=$PGBIN/psql rm -fr $TESTDIR mkdir $TESTDIR cd $TESTDIR # create test environment echo -n "creating test environment..." $PGPOOL_SETUP -n 2 || exit 1 echo "done." source ./bashrc.ports export PGPORT=$PGPOOL_PORT ./startall wait_for_pgpool_startup # test1: default (check_temp_table = catalog) $PSQL -a -f ../temp_table.sql test > results.txt cmp results.txt ../expected.txt || exit 1 # test2: trace echo "check_temp_table = trace" >> etc/pgpoo.conf ./pgpool_reload $PSQL -a -f ../temp_table.sql test > results.txt cmp results.txt ../expected.txt || exit 1 ./shutdownall exit 0 pgpool-II-4.1.4/src/test/regression/tests/027.auto_failback/0000775000175000017500000000000013730350075020510 500000000000000pgpool-II-4.1.4/src/test/regression/tests/027.auto_failback/.gitignore0000664000175000017500000000001113730350075022410 00000000000000testdir/ pgpool-II-4.1.4/src/test/regression/tests/027.auto_failback/test.sh0000775000175000017500000000370713730350075021755 00000000000000#!/usr/bin/env bash #------------------------------------------------------------------- # test script for auto failback # source $TESTLIBS TESTDIR=testdir PG_CTL=$PGBIN/pg_ctl PSQL="$PGBIN/psql" rm -fr $TESTDIR mkdir $TESTDIR cd $TESTDIR # create test environment echo -n "creating test environment..." $PGPOOL_SETUP -m s -n 2 || exit 1 echo "done." echo "auto_failback = on" >> etc/pgpool.conf echo "auto_failback_interval = 60" >> etc/pgpool.conf echo "sr_check_period = 2" >> etc/pgpool.conf echo "health_check_period = 2" >> etc/pgpool.conf source ./bashrc.ports export PGPORT=$PGPOOL_PORT ./startall wait_for_pgpool_startup $PSQL -c "show pool_nodes" test |grep down if [ $? = 0 ];then ./shutdownall exit 1 fi # trigger failover on node 1 $PG_CTL -D data1 -w -m f stop wait_for_pgpool_startup echo "backend node 1 is stopped" $PSQL -c "show pool_nodes" test |grep down if [ $? != 0 ];then ./shutdownall exit 1 fi # node 1 restart $PG_CTL -D data1 -w -m f start echo "backend node 1 is restarted" sleep 10; # check auto_failback is succuess $PSQL -c "show pool_nodes" test |grep down if [ $? = 0 ];then ./shutdownall exit 1 fi echo "auto_failback is success" # check auto_failback_interval echo `date` ":test auto_failback_interval" # trigger failover on node 1 $PG_CTL -D data1 -w -m f stop > /dev/null wait_for_pgpool_startup echo `date` ":backend node 1 is stopped" $PSQL -c "show pool_nodes" test |grep down if [ $? != 0 ];then ./shutdownall exit 1 fi $PG_CTL -D data1 -w -m f start > /dev/null echo `date` ":backend node 1 is restarted" echo `date` ":sleep 20[sec]" sleep 20; $PSQL -c "show pool_nodes" test |grep down if [ $? != 0 ];then ./shutdownall exit 1 fi echo `date` ":backend node staus is still detached" echo `date` ":sleep 40[sec]" sleep 40; $PSQL -c "show pool_nodes" test |grep down if [ $? != 0 ];then ./shutdownall exit 1 fi echo `date` ":the time of auto_failback_intervall passed and auto_failback is success." ./shutdownall exit 0 pgpool-II-4.1.4/src/test/regression/tests/028.watchdog_enable_consensus_with_half_votes/0000775000175000017500000000000013730350075026400 500000000000000pgpool-II-4.1.4/src/test/regression/tests/028.watchdog_enable_consensus_with_half_votes/test.sh0000775000175000017500000000631313730350075027641 00000000000000#!/usr/bin/env bash #------------------------------------------------------------------- # test script for enable_consensus_with_half_votes # source $TESTLIBS TESTDIR=testdir PSQL=$PGBIN/psql # set enable_consensus_with_half_votes to on or off depending on the $val arg. function set_param { n=0 while [ $n -lt $nodes ] do echo "enable_consensus_with_half_votes = $val" >> pgpool$n/etc/pgpool.conf n=`expr $n + 1` done } # wait for watchdog starting up by looking for "lifecheck started" in # the pgpool.log. argument: $log: absolute path to the pgpool.log. function wait_for_watchdog_startup { while : do grep "lifecheck started" $log >/dev/null if [ $? = 0 ];then break; fi sleep 1 done } # retun 0 if quorum exists. function quorum_exists { $PGPOOL_INSTALL_DIR/bin/pcp_watchdog_info -v -w -h localhost -p $PCP_PORT >/dev/null 2>&1 if [ $? != 0 ];then echo "pcp_watchdog_info is not still available" for i in 1 2 3 4 5 do $PGPOOL_INSTALL_DIR/bin/pcp_watchdog_info -v -w -h localhost -p $PCP_PORT >/dev/null 2>&1 if [ $? = 0 ];then break; fi echo "waiting for pcp_watchdog_info becomes available" sleep 1 done fi $PGPOOL_INSTALL_DIR/bin/pcp_watchdog_info -v -w -h localhost -p $PCP_PORT |grep QUORUM|egrep 'EXIST|EDGE'>/dev/null } # shutdown half of nodes for even total number of nodes. # shutdown (n + 1)/2 nodes for even number of total nodes n. # args: nodes: number of total nodes function shutdown_nodes { cdir=`pwd` n=`expr \( $nodes + 1 \) / 2` while [ $n -gt 0 ] do cd $dir/$TESTDIR/pgpool$n echo "shutdown node pgpool$n" ./shutdownall sleep 1 n=`expr $n - 1` done cd $cdir } # return 0 fi nodes is even function nodes_even { test `expr $nodes % 2` = 0 } #-----------------------------------------------------------------== dir=`pwd` failed=false #export CHECK_TIME_WAIT=true export PCPPASSFILE=$dir/$TESTDIR/pgpool0/pcppass for nodes in 2 3 4 do cd $dir rm -fr $TESTDIR mkdir $TESTDIR cd $TESTDIR $WATCHDOG_SETUP -wn $nodes || exit 1 val="off" set_param ./startall cd pgpool0 source ./bashrc.ports export PGPORT=$PGPOOL_PORT cd .. echo -n "waiting for watchdog node 0 starting up... " log=$dir/$TESTDIR/pgpool0/log/pgpool.log wait_for_watchdog_startup $log echo "done." echo "=== Testing total nodes: $nodes. enable_consensus_with_half_of_the_votes: $val ===" quorum_exists shutdown_nodes if quorum_exists then echo "Quorum exists. Test failed" failed=true else echo "Quorum does not exist. Test succeeded" fi ./shutdownall sleep 1 val="on" set_param ./startall wait_for_watchdog_startup $log echo "Testing total nodes: $nodes. enable_consensus_with_half_of_the_votes: $val" shutdown_nodes if quorum_exists then if nodes_even then echo "Quorum exists. Test succeeded" else echo "Quorum exists. Test failed" failed=true fi else if nodes_even then echo "Quorum does not exist. Test failed" failed=true else echo "Quorum does not exist. Test succeeded" fi fi ./shutdownall sleep 10 done if [ $failed = "true" ];then exit 1 fi exit 0 pgpool-II-4.1.4/src/test/regression/tests/031.connection_life_time/0000775000175000017500000000000013730350075022073 500000000000000pgpool-II-4.1.4/src/test/regression/tests/031.connection_life_time/test.sh0000775000175000017500000000233413730350075023333 00000000000000#!/usr/bin/env bash #------------------------------------------------------------------- # test script for connection_life_time # source $TESTLIBS TESTDIR=testdir PSQL=$PGBIN/psql PG_CTL=$PGBIN/pg_ctl PGBENCH=$PGBIN/pgbench export PGDATABASE=test rm -fr $TESTDIR mkdir $TESTDIR cd $TESTDIR # create test environment. echo -n "creating test environment..." $PGPOOL_SETUP || exit 1 echo "done." dir=`pwd` source ./bashrc.ports timeout=5 echo "connection_life_time = $timeout" >> etc/pgpool.conf ./startall export PGPORT=$PGPOOL_PORT wait_for_pgpool_startup # get backend pid pid=`$PSQL -t -p 11000 -c "select pg_backend_pid()" test` echo "backend pid is: $pid" sleep `expr $timeout + 1` ps $pid if [ $? = 0 ];then echo "backend pid $pid still exists" ./shutdownall exit 1 fi echo "ok with primary node = 0" # swap node 0 and node 1 pg_ctl -D data0 -m f stop wait_for_pgpool_startup $PGPOOL_INSTALL_DIR/bin/pcp_recovery_node -p $PCP_PORT -w 0 wait_for_pgpool_startup # get backend pid pid=`$PSQL -t -p 11000 -c "select pg_backend_pid()" test` echo "backend pid is: $pid" sleep `expr $timeout + 2` ps $pid if [ $? = 0 ];then echo "backend pid $pid still exists" ./shutdownall exit 1 fi ./shutdownall exit 0 pgpool-II-4.1.4/src/test/regression/tests/050.bug58/0000775000175000017500000000000013730350075016652 500000000000000pgpool-II-4.1.4/src/test/regression/tests/050.bug58/.gitignore0000664000175000017500000000001113730350075020552 00000000000000testdir/ pgpool-II-4.1.4/src/test/regression/tests/050.bug58/test.sh0000775000175000017500000000226213730350075020112 00000000000000#!/usr/bin/env bash #------------------------------------------------------------------- # test script for bug#58 # 0000058: query cache invalidation does not fire for multiple DML in transaction WHOAMI=`whoami` source $TESTLIBS TESTDIR=testdir PSQL=$PGBIN/psql rm -fr $TESTDIR mkdir $TESTDIR cd $TESTDIR # create test environment echo -n "creating test environment..." $PGPOOL_SETUP -m s -n 1 --no-stop|| exit 1 echo "done." source ./bashrc.ports echo "memory_cache_enabled = on" >> etc/pgpool.conf #./startall export PGPORT=$PGPOOL_PORT wait_for_pgpool_startup $PSQL test </dev/null 2>&1 if [ $? = 0 ];then # cache found! The bug reveals. exit 1 fi exit 0 pgpool-II-4.1.4/src/test/regression/tests/051.bug60/0000775000175000017500000000000013730350075016644 500000000000000pgpool-II-4.1.4/src/test/regression/tests/051.bug60/.gitignore0000664000175000017500000000001113730350075020544 00000000000000testdir/ pgpool-II-4.1.4/src/test/regression/tests/051.bug60/bug.sql0000664000175000017500000000073213730350075020064 00000000000000-- This script shows the problem. When run in a psql connected to -- pgpool with one master and one read-only replica, this will cause -- the pgpool process to exit because the exception found in the -- commit (in the master node) does not match the success code for the -- commit in the read-only replica. -- The expected behavior would be to continue execution normally -- without dropping the connection. begin; insert into my_table ( col1 ) values ( 'ouch' ); commit; pgpool-II-4.1.4/src/test/regression/tests/051.bug60/database-clean.sql0000664000175000017500000000027713730350075022137 00000000000000-- This is -*- sql -*- code that removes the test data from the -- database, to leave things as clean as we found them. drop trigger t1 on my_table; drop function p1(); drop table my_table; pgpool-II-4.1.4/src/test/regression/tests/051.bug60/database-setup.sql0000664000175000017500000000156513730350075022216 00000000000000-- This is a simple -*- sql -*- file that sets up a simple table to -- which inserts cannot happen. This is enforced by a deferred -- trigger, which allows for the easy reproduction of an issue -- observed with commit raises an exception. create table my_table ( col1 text not null primary key ); -- The p1() function simply takes the place of a trigger that would -- perform semantic or integrity validations that must occur at the -- end of the transaction. In our case, it simply raises an exception -- (ie, always fails). create function p1() returns trigger as $$ begin raise exception 'some integrity violation'; end; $$ language plpgsql; -- A simple delayed constraint that insures that the p1() function is -- invoked at the commit stage. create constraint trigger t1 after insert on my_table deferrable initially deferred for each row execute procedure p1(); pgpool-II-4.1.4/src/test/regression/tests/051.bug60/test.sh0000775000175000017500000000343413730350075020106 00000000000000#!/usr/bin/env bash #------------------------------------------------------------------- # test script for bug reported in bug track #60 # The bug occurs when all of conditions below are met: # # - streaming replication mode # - run in an explicit transaction # - primary fails on commit # # Note that pgpool disconnects the session as expected but the # reporter thinks pgpool should not disconnects the session, just # report an error. If the script is executed under native replication # mode, session is not disconnect. So I think the complain is fair # enough. # # Fixed in: http://git.postgresql.org/gitweb/?p=pgpool2.git;a=commit;h=e7e350465a6f33562322304b56f02cdbb1492641 # WHOAMI=`whoami` source $TESTLIBS TESTDIR=testdir PSQL=$PGBIN/psql rm -fr $TESTDIR mkdir $TESTDIR cd $TESTDIR # create test environment echo -n "creating test environment..." $PGPOOL_SETUP -m s -n 2 || exit 1 echo "done." source ./bashrc.ports ./startall wait_for_pgpool_startup export PGPORT=$PGPOOL_PORT # set up trigger $PSQL -f ../database-setup.sql test # trigger the bug $PSQL -f ../bug.sql test # trigger the bug in extended protocol mode perl <connect("DBI:Pg:dbname=test;host=localhost;port=$PGPOOL_PORT","$WHOAMI",''); if (\$dbh) { \$dbh->{AutoCommit} = 0; \$sth = \$dbh->prepare("insert into my_table ( col1 ) values (?)"); \$sth->execute('ouch'); # \$sth = \$dbh->prepare("insert into t1 ( i ) values (?)"); # \$sth->execute(1); \$sth->finish; \$dbh->commit; } \$dbh->disconnect(); EOF # clean up #psql -f ../database-clean.sql test ./shutdownall # # check if kind mismatch error occurs # grep "kind mismatch among backends." log/pgpool.log >/dev/null 2>&1 if [ $? = 0 ];then # kind mismatch message found! The bug reveals. exit 1 fi exit 0 pgpool-II-4.1.4/src/test/regression/tests/052.do_query/0000775000175000017500000000000013730350075017551 500000000000000pgpool-II-4.1.4/src/test/regression/tests/052.do_query/.gitignore0000664000175000017500000000001113730350075021451 00000000000000testdir/ pgpool-II-4.1.4/src/test/regression/tests/052.do_query/test.sh0000775000175000017500000000152513730350075021012 00000000000000#!/usr/bin/env bash #------------------------------------------------------------------- # test script for do_query. # # If do_query failed while executing in extended query mode, pgpool hangs. # precondition to trigger the error: remove pgpool_regclass.so or some such. # BUG="do_query" WHOAMI=`whoami` source $TESTLIBS TESTDIR=testdir PGBENCH=$PGBENCH_PATH rm -fr $TESTDIR mkdir $TESTDIR cd $TESTDIR # create test environment echo -n "creating test environment..." $PGPOOL_SETUP -m s -n 1 --no-stop|| exit 1 echo "done." source ./bashrc.ports #./startall export PGPORT=$PGPOOL_PORT wait_for_pgpool_startup echo "SELECT 1" > select.pgbench $PGBENCH -i test # run test. This will hung if the bug is remained. ($PGBENCH -c 10 -t 10 -M extended -f select.pgbench test)& sleep 5 kill $! if [ $? = 0 ];then ./shutdownall exit 1 fi ./shutdownall pgpool-II-4.1.4/src/test/regression/tests/053.insert_lock_hangs/0000775000175000017500000000000013730350075021417 500000000000000pgpool-II-4.1.4/src/test/regression/tests/053.insert_lock_hangs/.gitignore0000664000175000017500000000001113730350075023317 00000000000000testdir/ pgpool-II-4.1.4/src/test/regression/tests/053.insert_lock_hangs/test.sh0000775000175000017500000000372013730350075022657 00000000000000#!/usr/bin/env bash #------------------------------------------------------------------- # test script for bug reported in [pgpool-general: 1684]. # The bug occurs when all of conditions below are met: # - replication mode # - pgpool_catalog.insert_lock is created # - extended protocol is used # - number of DB nodes does not matter # # Fixed in: http://git.postgresql.org/gitweb/?p=pgpool2.git;a=commit;h=9dd90f45ef4194473c04099e6332af0a8c0d8411 # Note: to run the test DBD:Pg is required. WHOAMI=`whoami` source $TESTLIBS TESTDIR=testdir PSQL=$PGBIN/psql rm -fr $TESTDIR mkdir $TESTDIR cd $TESTDIR # create test environment echo -n "creating test environment..." $PGPOOL_SETUP -m r -n 1 --no-stop|| exit 1 echo "done." source ./bashrc.ports #./startall wait_for_pgpool_startup export PGPORT=$PGPOOL_PORT # create insert_lock table $PSQL test < test.perl <connect("DBI:Pg:dbname=test;host=localhost;port=$PGPOOL_PORT","$WHOAMI",''); if (\$dbh) { \$sth = \$dbh->prepare("insert into kd_test_serial_pgpool(content)values (?)"); # hangs \$sth->execute('perl lkhzfjktfjktf'); \$sth->finish; } \$dbh->disconnect(); EOF # run test. This will hung if the bug is remained. (perl test.perl)& sleep 5 kill $! if [ $? = 0 ];then ./shutdownall exit 1 fi ./shutdownall pgpool-II-4.1.4/src/test/regression/tests/054.postgres_fdw/0000775000175000017500000000000013730350075020432 500000000000000pgpool-II-4.1.4/src/test/regression/tests/054.postgres_fdw/.gitignore0000664000175000017500000000001113730350075022332 00000000000000testdir/ pgpool-II-4.1.4/src/test/regression/tests/054.postgres_fdw/test.sh0000775000175000017500000000344713730350075021700 00000000000000#!/usr/bin/env bash #------------------------------------------------------------------- # Check to see if postgres_fdw works with pgpool-II. Since # postres_fdw sets search_path to pg_catalog, pgpool_regclass() should # be registered as "pg_catalog.pgpool_regclass". # # Requires PostgreSQL 9.3 or later and contrib/postgres_fdw be # installed. # Fixed in: http://git.postgresql.org/gitweb/?p=pgpool2.git;a=commit;h=5e65429cd325ef2cbec22d114939cf07b3bcfa2e WHOAMI=`whoami` source $TESTLIBS TESTDIR=testdir PG_CTL=$PGBIN/pg_ctl PSQL=$PGBIN/psql rm -fr $TESTDIR mkdir $TESTDIR cd $TESTDIR # create test environment echo -n "creating test environment..." $PGPOOL_SETUP -m r -n 2 --no-stop|| exit 1 echo "done." source ./bashrc.ports export PGPORT=$PGPOOL_PORT wait_for_pgpool_startup # create foreign table $PSQL -p 11003 test <11000(pgpool)->11002(PostgreSQL) $PSQL -p 11003 test </dev/null 2>&1 if [ $? = 0 ];then ./shutdownall exit 1 fi ./shutdownall exit 0 pgpool-II-4.1.4/src/test/regression/tests/055.backend_all_down/0000775000175000017500000000000013730350075021173 500000000000000pgpool-II-4.1.4/src/test/regression/tests/055.backend_all_down/.gitignore0000664000175000017500000000001113730350075023073 00000000000000testdir/ pgpool-II-4.1.4/src/test/regression/tests/055.backend_all_down/test.sh0000775000175000017500000000235313730350075022434 00000000000000#!/usr/bin/env bash #------------------------------------------------------------------- # "pgpool -m f stop" hangs because unmanaged pgpool children remains. # Starting pgpool without starting PostgreSQL servers triggers the bug. # # Fixed in: http://git.postgresql.org/gitweb/?p=pgpool2.git;a=commit;h=fa6c3aa3233fd984a8b717f59e26b2ab9b7c8383 WHOAMI=`whoami` source $TESTLIBS TESTDIR=testdir rm -fr $TESTDIR mkdir $TESTDIR cd $TESTDIR # create test environment echo -n "creating test environment..." $PGPOOL_SETUP -m s -n 2 || exit 1 echo "done." echo "search_primary_node_timeout = 5" >> etc/pgpool.conf source ./bashrc.ports export PGPORT=$PGPOOL_PORT echo 'dir=`pwd`' >> pgpool.sh grep pgpool.conf startall >> pgpool.sh # start pgpool only. This causes immediate failover and may leave # orphan pgpool children. sh pgpool.sh while true do grep "failover done. shutdown host $PGSOCKET_DIR(11003)" log/pgpool.log > /dev/null 2>&1 if [ $? = 0 ];then break; fi grep "failover: no backends are degenerated" log/pgpool.log > /dev/null 2>&1 if [ $? = 0 ];then break; fi sleep 1 done sleep 5 # if that's the case, shutdownall will hang. (./shutdownall)& sleep 5 kill $! if [ $? = 0 ];then ./shutdownall exit 1 fi ./shutdownall exit 0 pgpool-II-4.1.4/src/test/regression/tests/056.bug63/0000775000175000017500000000000013730350075016654 500000000000000pgpool-II-4.1.4/src/test/regression/tests/056.bug63/.gitignore0000664000175000017500000000001113730350075020554 00000000000000testdir/ pgpool-II-4.1.4/src/test/regression/tests/056.bug63/jdbctest2.java0000664000175000017500000000271713730350075021332 00000000000000/* # su - postgres $ pgbench -i $ cat jdbctest.prop jdbc.url=jdbc:postgresql://localhost:9999/postgres jdbc.user=postgres jdbc.password=postgres $ cat run.sh java -Djdbc.drivers=org.postgresql.Driver \ -classpath .:./postgresql-9.0-802.jdbc4.jar \ "jdbctest2" */ import java.sql.*; import javax.sql.*; import java.util.*; import java.io.*; public class jdbctest2 { public static void main(String[] args) { try { Properties prop = new Properties(); prop.load(new FileInputStream("jdbctest.prop")); String url = prop.getProperty("jdbc.url"); String user = prop.getProperty("jdbc.user"); String pwd = prop.getProperty("jdbc.password"); Connection conn = DriverManager.getConnection(url, user, pwd); conn.setAutoCommit(false); String sql2 = "SELECT aid, bid, abalance, filler FROM pgbench_accounts WHERE aid != ? LIMIT ?"; PreparedStatement pst2 = conn.prepareStatement(sql2); int aid = 1, lim = 7000, c = 0; ResultSet rs; String tmp; for (c = 0; c < 200; ++c) { aid = (int) Math.floor(Math.random() * 50000) + 1; lim = 7500 + (int) Math.floor(Math.random() * 1000) + 1; System.out.println("aid:" + aid + " lim:" + lim); System.out.flush(); pst2.setInt(1, aid); pst2.setInt(2, lim); rs = pst2.executeQuery(); while (rs.next()) { tmp = rs.getString(4); } rs.close(); } pst2.close(); conn.close(); } catch (Exception e) { System.err.println("jdbctest: ERROR: " + e); System.exit(1); } } } pgpool-II-4.1.4/src/test/regression/tests/056.bug63/test.sh0000775000175000017500000000177613730350075020125 00000000000000#!/usr/bin/env bash #------------------------------------------------------------------- # test script for bug#63 # On memory query cache occasionally segfaults. # # Fixed in: http://git.postgresql.org/gitweb/?p=pgpool2.git;a=commit;h=d428c5c27600dd82161dda6a240737d88db78732 # requires Java PostgreSQL JDBC driver. PGBENCH=$PGBENCH_PATH WHOAMI=`whoami` source $TESTLIBS TESTDIR=testdir rm -fr $TESTDIR mkdir $TESTDIR cd $TESTDIR # create test environment echo -n "creating test environment..." $PGPOOL_SETUP -m s -n 1 || exit 1 echo "done." source ./bashrc.ports export PGPORT=$PGPOOL_PORT echo "memory_cache_enabled = on" >> etc/pgpool.conf echo "jdbc.url=jdbc:postgresql://localhost:$PGPOOL_PORT/test" > jdbctest.prop echo "jdbc.user=$WHOAMI" >> jdbctest.prop echo "jdbc.password=" >> jdbctest.prop cp ../jdbctest2.java . javac jdbctest2.java export CLASSPATH=.:$JDBC_DRIVER ./startall wait_for_pgpool_startup $PGBENCH -i test java jdbctest2 if [ $? != 0 ];then ./shutdownall exit 1 fi ./shutdownall exit 0 pgpool-II-4.1.4/src/test/regression/tests/057.bug61/0000775000175000017500000000000013730350075016653 500000000000000pgpool-II-4.1.4/src/test/regression/tests/057.bug61/.gitignore0000664000175000017500000000001113730350075020553 00000000000000testdir/ pgpool-II-4.1.4/src/test/regression/tests/057.bug61/test.sh0000775000175000017500000000216613730350075020116 00000000000000#!/usr/bin/env bash #------------------------------------------------------------------- # test script for bug#61 # Child process xxxx was terminated by segmentation fault # # Fixed in: http://git.postgresql.org/gitweb/?p=pgpool2.git;a=commit;h=d493dd2b7d2065fb554654b137ecd587564f0043 source $TESTLIBS TESTDIR=testdir PG_CTL=$PGBIN/pg_ctl PSQL=$PGBIN/psql PGBENCH=$PGBENCH_PATH rm -fr $TESTDIR mkdir $TESTDIR cd $TESTDIR # create test environment echo -n "creating test environment..." $PGPOOL_SETUP -m s -n 1 || exit 1 echo "done." source ./bashrc.ports export PGPORT=$PGPOOL_PORT ./startall wait_for_pgpool_startup $PGBENCH -i test # Pre 9.4 libpq does not allow to specify NULL username echo "psql: FATAL: no PostgreSQL user name specified in startup packet" > expected.txt echo "\\q"|$PSQL -p $PGPOOL_PORT -U '' test > psql.log 2>&1 psqlresult=$? cat psql.log diff -b psql.log expected.txt diffresult=$? ./shutdownall if [ $psqlresult -ne 0 ];then if [ $diffresult -eq 0 ]; then # must be pre 9.4 exit 0 else # pre 9.4 but does not work well or there's something wrong. exit 1 fi fi # other case is all good exit 0 pgpool-II-4.1.4/src/test/regression/tests/058.bug68/0000775000175000017500000000000013730350075016663 500000000000000pgpool-II-4.1.4/src/test/regression/tests/058.bug68/.gitignore0000664000175000017500000000001113730350075020563 00000000000000testdir/ pgpool-II-4.1.4/src/test/regression/tests/058.bug68/jdbctest3.java0000664000175000017500000000275013730350075021337 00000000000000import java.sql.*; import javax.sql.*; import java.util.*; import java.io.*; public class jdbctest3 { public static void main(String[] args) { try { Properties prop = new Properties(); prop.load(new FileInputStream("jdbctest.prop")); String url = prop.getProperty("jdbc.url"); String user = prop.getProperty("jdbc.user"); String pwd = prop.getProperty("jdbc.password"); Connection conn = DriverManager.getConnection(url, user, pwd); conn.setAutoCommit(false); String sql_u = "UPDATE pgbench_accounts SET filler = 'x' WHERE aid = ?"; String sql_s = "SELECT * FROM pgbench_accounts WHERE aid != ? LIMIT 100"; PreparedStatement pst_u, pst_s; int aid = 1, c1 = 0, c2 = 0; ResultSet rs; String tmp; for (c1 = 0; c1 < 10 ; ++c1) { pst_u = conn.prepareStatement(sql_u); pst_s = conn.prepareStatement(sql_s); aid = (int) Math.floor(Math.random() * 10) + 1; pst_u.setInt(1, aid); pst_u.executeUpdate(); for (c2 = 0; c2 < 10; ++c2) { aid = (int) Math.floor(Math.random() * 10) + 1; pst_s.setInt(1, aid); rs = pst_s.executeQuery(); while (rs.next()) { tmp = rs.getString(4); } rs.close(); } conn.commit(); pst_u.close(); pst_s.close(); } conn.close(); } catch (Exception e) { System.err.println("jdbctest: ERROR: " + e); e.printStackTrace(); System.exit(1); } } }pgpool-II-4.1.4/src/test/regression/tests/058.bug68/test.sh0000775000175000017500000000177613730350075020134 00000000000000#!/usr/bin/env bash #------------------------------------------------------------------- # test script for bug#68 # On memory query cache occasionally segfaults. # # Fixed in: http://git.postgresql.org/gitweb/?p=pgpool2.git;a=commit;h=d6592ea7a95ed48855332037bca285cc6f6a3547 # requires Java PostgreSQL JDBC driver. PGBENCH=$PGBENCH_PATH WHOAMI=`whoami` source $TESTLIBS TESTDIR=testdir rm -fr $TESTDIR mkdir $TESTDIR cd $TESTDIR # create test environment echo -n "creating test environment..." $PGPOOL_SETUP -m s -n 1 || exit 1 echo "done." source ./bashrc.ports export PGPORT=$PGPOOL_PORT echo "memory_cache_enabled = on" >> etc/pgpool.conf echo "jdbc.url=jdbc:postgresql://localhost:$PGPOOL_PORT/test" > jdbctest.prop echo "jdbc.user=$WHOAMI" >> jdbctest.prop echo "jdbc.password=" >> jdbctest.prop cp ../jdbctest3.java . javac jdbctest3.java export CLASSPATH=.:$JDBC_DRIVER ./startall wait_for_pgpool_startup $PGBENCH -i test java jdbctest3 if [ $? != 0 ];then ./shutdownall exit 1 fi ./shutdownall exit 0 pgpool-II-4.1.4/src/test/regression/tests/059.bug92/0000775000175000017500000000000013730350075016661 500000000000000pgpool-II-4.1.4/src/test/regression/tests/059.bug92/.gitignore0000664000175000017500000000001113730350075020561 00000000000000testdir/ pgpool-II-4.1.4/src/test/regression/tests/059.bug92/jdbctest.java0000664000175000017500000000134113730350075021245 00000000000000import java.sql.*; import javax.sql.*; import java.util.*; import java.io.*; public class jdbctest { public static void main(String[] args) { try { Properties prop = new Properties(); prop.load(new FileInputStream("jdbctest.prop")); String url = prop.getProperty("jdbc.url"); String user = prop.getProperty("jdbc.user"); String pwd = prop.getProperty("jdbc.password"); Connection conn = DriverManager.getConnection(url, user, pwd); conn.setAutoCommit(true); String sql = "INSERT INTO t VALUES ('1', 'a', 'X');"; Statement pst = conn.createStatement(); pst.executeUpdate(sql); pst.close(); conn.close(); } catch (Exception e) { System.err.println("jdbctest: ERROR: " + e); System.exit(1); } } } pgpool-II-4.1.4/src/test/regression/tests/059.bug92/test.sh0000775000175000017500000000226013730350075020117 00000000000000#!/usr/bin/env bash #------------------------------------------------------------------- # test script for bug#92 # JDBC DML fails under raw mode && autocommit mode. # For the completeness, this test executes on replication mode and # streaming replication mode as well. # # Fixed in: http://git.postgresql.org/gitweb/?p=pgpool2.git;a=commit;h=05a292286c240c56ca81c2cdb7b15249f77de53e # requires Java PostgreSQL JDBC driver. PGBENCH=$PGBENCH_PATH WHOAMI=`whoami` source $TESTLIBS TESTDIR=testdir PSQL=$PGBIN/psql for mode in s r n do rm -fr $TESTDIR mkdir $TESTDIR cd $TESTDIR # create test environment echo -n "creating test environment..." $PGPOOL_SETUP -m $mode -n 2 || exit 1 echo "done." source ./bashrc.ports export PGPORT=$PGPOOL_PORT echo "jdbc.url=jdbc:postgresql://localhost:$PGPOOL_PORT/test" > jdbctest.prop echo "jdbc.user=$WHOAMI" >> jdbctest.prop echo "jdbc.password=" >> jdbctest.prop cp ../jdbctest.java . javac jdbctest.java export CLASSPATH=.:$JDBC_DRIVER ./startall wait_for_pgpool_startup $PSQL test <> etc/pgpool.conf # start pgpool-II ./startall sleep 1 # initialize tables $PGBENCH -i test $PGBENCH -S -T 1 test # find pgpool-II child process id and grab initial process size (virtual size) foo=`ps x|grep "pgpool: wait for connection request"` pid=`echo $foo|awk '{print $1}'` init_size=`ps l $pid|tail -1|awk '{print $7}'` echo "init_size: $init_size" # run pgbench for a while $PGBENCH -S -T 30 test after_size=`ps l $pid|tail -1|awk '{print $7}'` delta=`expr $after_size - $init_size` echo "initial process size: $init_size after size: $after_size delta: $delta" test $delta -eq 0 if [ $? != 0 ];then echo "memory leak in $delta KB in mode:$mode" ./shutdownall exit 1 fi ./shutdownall cd .. done exit 0 pgpool-II-4.1.4/src/test/regression/tests/061.cancel_query/0000775000175000017500000000000013730350075020374 500000000000000pgpool-II-4.1.4/src/test/regression/tests/061.cancel_query/.gitignore0000664000175000017500000000001113730350075022274 00000000000000testdir/ pgpool-II-4.1.4/src/test/regression/tests/061.cancel_query/test.sh0000775000175000017500000000151413730350075021633 00000000000000#!/usr/bin/env bash #------------------------------------------------------------------- # Testing cancel query. # [pgpool-hackers: 694] pgpool-II 3.4 can't cancel query PSQL=$PGBIN/psql source $TESTLIBS TESTDIR=testdir rm -fr $TESTDIR mkdir $TESTDIR cd $TESTDIR # create test environment echo -n "creating test environment..." $PGPOOL_SETUP -m n -n 1 || exit 1 echo "done." source ./bashrc.ports export PGPORT=$PGPOOL_PORT # start pgpool-II ./startall sleep 1 # executing long runing query $PSQL -c "select pg_sleep(10000);" test & # get psql process pid psqlpid=$! sleep 2 # send CtrlC to psql to cancel the query kill -INT $psqlpid sleep 2 RESULT=`ps -p $psqlpid | grep psql` ./shutdownall if [ -z "$RESULT" ]; then echo -n "test passed." exit 0 fi echo -n "test failed. psql process still exists" echo -n "$RESULT" exit 1 pgpool-II-4.1.4/src/test/regression/tests/062.select_error_hangs/0000775000175000017500000000000013730350075021573 500000000000000pgpool-II-4.1.4/src/test/regression/tests/062.select_error_hangs/.gitignore0000664000175000017500000000001113730350075023473 00000000000000testdir/ pgpool-II-4.1.4/src/test/regression/tests/062.select_error_hangs/test.sh0000775000175000017500000000221113730350075023025 00000000000000#!/usr/bin/env bash #------------------------------------------------------------------- # test script for bug reported in [pgpool-general-jp: 1360]. # The bug occurs when all of conditions below are met: # - replication mode # - replicate_select = off # - a few backend nodes # - a SELECT error occurring in a transaction block source $TESTLIBS TESTDIR=testdir PSQL=$PGBIN/psql PGBENCH=$PGBENCH_PATH rm -fr $TESTDIR mkdir $TESTDIR cd $TESTDIR # create test environment echo -n "creating test environment..." $PGPOOL_SETUP -m r -n 2 --no-stop || exit 1 echo "done." source ./bashrc.ports export PGPORT=$PGPOOL_PORT wait_for_pgpool_startup # create test script cat > pgbench.sql < pgbench_loop.sh </dev/null 2>&1 done exit 0 EOF # run test. This will hung if the bug is remained. for mode in simple extended do echo -n "test $mode mode " timeout 30 sh pgbench_loop.sh $mode if [ ! $? -eq 0 ];then echo ...timed out. ./shutdownall exit 1 fi echo ...ok. done ./shutdownall pgpool-II-4.1.4/src/test/regression/tests/063.tables_with_space/0000775000175000017500000000000013730350075021404 500000000000000pgpool-II-4.1.4/src/test/regression/tests/063.tables_with_space/.gitignore0000664000175000017500000000001113730350075023304 00000000000000testdir/ pgpool-II-4.1.4/src/test/regression/tests/063.tables_with_space/test.sh0000775000175000017500000000210613730350075022641 00000000000000#!/usr/bin/env bash #------------------------------------------------------------------- # Test script for bug reported in bug#136. # Tables including spaces does not work with pgpool-II's internal queries # which are used to extract information from PostgreSQL system catalogs. # The table name in trouble is not only spaces but also mixed-case-table-name. source $TESTLIBS TESTDIR=testdir PSQL=$PGBIN/psql for mode in s r do rm -fr $TESTDIR mkdir $TESTDIR cd $TESTDIR # create test environment echo -n "creating test environment..." $PGPOOL_SETUP -m $mode -n 2 || exit 1 echo "done." echo "memory_cache_enabled = on" >> etc/pgpool.conf source ./bashrc.ports ./startall export PGPORT=$PGPOOL_PORT wait_for_pgpool_startup $PSQL test <> etc/pgpool.conf echo "backend_weight1 = 1" >> etc/pgpool.conf ./startall export PGPORT=$PGPOOL_PORT wait_for_pgpool_startup $PSQL test </dev/null 2>&1 if [ $? != 0 ];then # expected result not found echo 'fail: WITH s AS (SELECT 1) SELECT * FROM s;' ./shutdownall exit 1 fi if [ $mode = "r" ];then fgrep "SELECT 1" log/pgpool.log |grep "DB node id: 0">/dev/null 2>&1 if [ $? = 0 ];then # expected result not found echo 'fail: WITH s AS (SELECT 1) SELECT * FROM s;' ./shutdownall exit 1 fi fi echo ok: read query load balance works. # check if data modifying WITH worked fgrep "WITH r AS" log/pgpool.log |grep "DB node id: 0">/dev/null 2>&1 if [ $? != 0 ];then # expected result not found echo 'fail: data modifying WITH.' ./shutdownall exit 1 fi if [ $mode = "r" ];then fgrep "WITH r AS" log/pgpool.log |grep "DB node id: 1">/dev/null 2>&1 if [ $? != 0 ];then # expected result not found echo 'fail: data modifying WITH in replication mode.' ./shutdownall exit 1 fi fi # check if WITH SELECT including data modifying function call worked. fgrep "WITH t AS" log/pgpool.log |grep "DB node id: 0">/dev/null 2>&1 if [ $? != 0 ];then # expected result not found echo 'fail: WITH SELECT including data modifying function call.' ./shutdownall exit 1 fi if [ $mode = "r" ];then fgrep "WITH t AS" log/pgpool.log |grep "DB node id: 1">/dev/null 2>&1 if [ $? != 0 ];then # expected result not found echo 'fail: WITH SELECT including data modifying function call.' ./shutdownall exit 1 fi fi ./shutdownall cd .. done exit 0 pgpool-II-4.1.4/src/test/regression/tests/065.bug152/0000775000175000017500000000000013730350075016733 500000000000000pgpool-II-4.1.4/src/test/regression/tests/065.bug152/.gitignore0000664000175000017500000000001113730350075020633 00000000000000testdir/ pgpool-II-4.1.4/src/test/regression/tests/065.bug152/Main.java0000664000175000017500000000255413730350075020410 00000000000000import java.sql.Connection; import java.sql.DriverManager; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; public class Main { public static void main(String[] args) throws Exception { //org.postgresql.Driver.setLogLevel(org.postgresql.Driver.DEBUG); Class.forName("org.postgresql.Driver"); String url = "jdbc:postgresql://localhost:11000/test"; try (Connection con = DriverManager.getConnection(url)) { try (Statement stmt = con.createStatement()) { stmt.execute("DROP TABLE IF EXISTS test"); stmt.execute("CREATE TABLE test(id bigint NOT NULL PRIMARY KEY, description character varying)"); stmt.execute("INSERT INTO test SELECT generate_series(1, 10) AS id, md5(random()::text) AS description"); } StringBuilder sb = new StringBuilder(); try (PreparedStatement pstmt = con.prepareStatement("SELECT description FROM test WHERE id = ?")) { for (int i = 0; i < 100; i++) { System.out.println(1 + i % 10); pstmt.setInt(1, 1 + i % 10); try (ResultSet rs = pstmt.executeQuery()) { rs.next(); sb.append(rs.getString(1)); } } } } } } pgpool-II-4.1.4/src/test/regression/tests/065.bug152/run.sh0000664000175000017500000000007213730350075020012 00000000000000export CLASSPATH=.:$JDBC_DRIVER javac Main.java java Main pgpool-II-4.1.4/src/test/regression/tests/065.bug152/test.sh0000775000175000017500000000143513730350075020174 00000000000000#!/usr/bin/env bash #------------------------------------------------------------------- # Test script for bug reported in bug#152 # In memory query cache fails in extended query protocol. source $TESTLIBS TESTDIR=testdir PSQL=$PGBIN/psql export CLASSPATH=.:$JDBC_DRIVER for mode in s r do rm -fr $TESTDIR mkdir $TESTDIR cd $TESTDIR # create test environment echo -n "creating test environment..." $PGPOOL_SETUP -m $mode -n 1 || exit 1 echo "done." source ./bashrc.ports echo "memory_cache_enabled = on" >> etc/pgpool.conf echo "log_client_messages = on" >> etc/pgpool.conf ./startall export PGPORT=$PGPOOL_PORT wait_for_pgpool_startup cp ../run.sh . cp ../Main.java . sh run.sh if [ $? != 0 ];then ./shutdownall exit 1 fi ./shutdownall cd .. done exit 0 pgpool-II-4.1.4/src/test/regression/tests/066.bug230/0000775000175000017500000000000013730350075016731 500000000000000pgpool-II-4.1.4/src/test/regression/tests/066.bug230/.gitignore0000664000175000017500000000001113730350075020631 00000000000000testdir/ pgpool-II-4.1.4/src/test/regression/tests/066.bug230/Sample.java0000664000175000017500000000175413730350075020744 00000000000000import java.io.PrintWriter; import java.sql.Connection; import java.sql.DriverManager; import java.sql.ResultSet; import java.sql.Statement; import java.util.Properties; import org.postgresql.Driver; public class Sample { public Sample() { } public static void main(String[] args) throws Exception { Properties props = new Properties(); props.setProperty("user", System.getenv("USER")); props.setProperty("password", ""); DriverManager.setLogWriter(new PrintWriter(System.out)); // Driver.setLogLevel(2); Connection conn = DriverManager.getConnection( "jdbc:postgresql://localhost:11000/test", props); conn.setAutoCommit(false); Statement st = conn.createStatement(); st.setFetchSize(100); ResultSet rs = st.executeQuery("SELECT * from GENERATE_SERIES(1,1000)"); while (rs.next()) { System.out.println(rs.getString(1)); } rs.close(); conn.close(); } } pgpool-II-4.1.4/src/test/regression/tests/066.bug230/test.sh0000775000175000017500000000170013730350075020165 00000000000000#!/usr/bin/env bash #------------------------------------------------------------------- # test script for for bug 230 (pgpool does not return result set if # the statement fetchSize is smaller than the result row count.) # source $TESTLIBS TESTDIR=testdir PSQL=$PGBIN/psql export CLASSPATH=.:$JDBC_DRIVER for mode in s r n do echo "===== mode:$mode =====" rm -fr $TESTDIR mkdir $TESTDIR cd $TESTDIR # create test environment echo -n "creating test environment..." # to avoid repication lag problem when testing under streaming # replication mode, set number of cluster to 1 when in the mode if [ $mode = "s" ];then n=1 else n=2 fi $PGPOOL_SETUP -m $mode -n $n || exit 1 echo "done." source ./bashrc.ports ./startall export PGPORT=$PGPOOL_PORT wait_for_pgpool_startup cp ../Sample.java . javac Sample.java java Sample > sample.log 2>&1 if [ $? != 0 ];then ./shutdownall; exit 1; fi ./shutdownall cd .. done exit 0 pgpool-II-4.1.4/src/test/regression/tests/067.bug231/0000775000175000017500000000000013730350075016733 500000000000000pgpool-II-4.1.4/src/test/regression/tests/067.bug231/.gitignore0000664000175000017500000000001113730350075020633 00000000000000testdir/ pgpool-II-4.1.4/src/test/regression/tests/067.bug231/TestReplGap.java0000664000175000017500000000133413730350075021711 00000000000000import java.sql.*; public class TestReplGap { public static void main(String[] args) throws SQLException, InterruptedException { try (Connection conn = DriverManager.getConnection("jdbc:postgresql://localhost:11000/test?loglevel=2", "t-ishii", "")) { conn.setAutoCommit(false); // Note: It is supposed that the database postgres contains table "t1". try (PreparedStatement stmt = conn.prepareStatement("select * from t1 where id = ? ")) { for (int i = 0; i < 100; i++) { stmt.setInt(1, i); stmt.executeQuery().close(); System.out.println(i); } } conn.commit(); conn.close(); System.out.println("DONE"); } catch (SQLException ex) { ex.printStackTrace(); } } } pgpool-II-4.1.4/src/test/regression/tests/067.bug231/test.sh0000775000175000017500000000167013730350075020175 00000000000000#!/usr/bin/env bash #------------------------------------------------------------------- # test script for for bug 231 (packet kind of backend 1 ['3'] does not # match with master/majority nodes packet kind ['2']). # source $TESTLIBS TESTDIR=testdir PSQL=$PGBIN/psql export CLASSPATH=.:$JDBC_DRIVER rm -fr $TESTDIR mkdir $TESTDIR cd $TESTDIR # create test environment echo -n "creating test environment..." $PGPOOL_SETUP -m s -n 2 || exit 1 echo "done." echo "backend_weight0 = 0" >> etc/pgpool.conf echo "backend_weight1 = 1" >> etc/pgpool.conf source ./bashrc.ports ./startall export PGPORT=$PGPOOL_PORT wait_for_pgpool_startup export PGPORT=11000 $PSQL -c "DROP TABLE IF EXISTS t1" test $PSQL -c "CREATE TABLE t1 (id int);" test $PSQL -c "INSERT INTO t1 VALUES(1)" test TestProg=TestReplGap cp ../$TestProg.java . javac $TestProg.java java $TestProg > $TestProg.log 2>&1 if [ $? != 0 ];then ./shutdownall; exit 1; fi ./shutdownall exit 0 pgpool-II-4.1.4/src/test/regression/tests/068.memqcache_bug/0000775000175000017500000000000013730350075020511 500000000000000pgpool-II-4.1.4/src/test/regression/tests/068.memqcache_bug/.gitignore0000664000175000017500000000001113730350075022411 00000000000000testdir/ pgpool-II-4.1.4/src/test/regression/tests/068.memqcache_bug/Sample.java0000664000175000017500000000262513730350075022522 00000000000000import java.io.PrintWriter; import java.io.FileInputStream; import java.sql.Connection; import java.sql.DriverManager; import java.sql.ResultSet; import java.sql.Statement; import java.util.Properties; import org.postgresql.Driver; public class Sample { public Sample() { } public static void main(String[] args) throws Exception { ResultSet rs; Properties props = new Properties(); props.load(new FileInputStream("javatest.prop")); String url = props.getProperty("jdbc.url"); String user = props.getProperty("jdbc.user"); String pwd = props.getProperty("jdbc.password"); DriverManager.setLogWriter(new PrintWriter(System.out)); Connection conn = DriverManager.getConnection(url, user, pwd); conn.setAutoCommit(true); Statement st = conn.createStatement(); st.setFetchSize(100); // Does not hit cache rs = st.executeQuery("SELECT 1"); while (rs.next()) { System.out.println(rs.getString(1)); } rs.close(); // Does hit cache rs = st.executeQuery("SELECT 1"); while (rs.next()) { System.out.println(rs.getString(1)); } rs.close(); // To call do_query() rs = st.executeQuery("SELECT * FROM t1"); while (rs.next()) { System.out.println(rs.getString(1)); } rs.close(); conn.close(); } } pgpool-II-4.1.4/src/test/regression/tests/068.memqcache_bug/test.sh0000775000175000017500000000172213730350075021751 00000000000000#!/usr/bin/env bash #------------------------------------------------------------------- # test script for a memqcache bug reported in pgpool-general-jp:1441. # (do_query() hangs in certain condition) # requires Java PostgreSQL JDBC driver. source $TESTLIBS WHOAMI=`whoami` TESTDIR=testdir PSQL=$PGBIN/psql export CLASSPATH=.:$JDBC_DRIVER rm -fr $TESTDIR mkdir $TESTDIR cd $TESTDIR # create test environment echo -n "creating test environment..." $PGPOOL_SETUP -m s -n 2 || exit 1 echo "done." source ./bashrc.ports export PGPORT=$PGPOOL_PORT echo "jdbc.url=jdbc:postgresql://localhost:$PGPOOL_PORT/test" > javatest.prop echo "jdbc.user=$WHOAMI" >> javatest.prop echo "jdbc.password=" >> javatest.prop echo "memory_cache_enabled = on" >> etc/pgpool.conf sh startall wait_for_pgpool_startup cp ../Sample.java . $PSQL test <> etc/pgpool.conf # start pgpool-II ./startall sleep 1 # initialize tables $PGBENCH -i test $PGBENCH -S -T 1 test # find pgpool-II child process id and grab initial process size (virtual size) foo=`ps x|grep "pgpool: wait for connection request"` pid=`echo $foo|awk '{print $1}'` init_size=`ps l $pid|tail -1|awk '{print $7}'` echo "init_size: $init_size" # run pgbench for a while $PGBENCH -M extended -S -T 30 test after_size=`ps l $pid|tail -1|awk '{print $7}'` delta=`expr $after_size - $init_size` echo "initial process size: $init_size after size: $after_size delta: $delta" test $delta -eq 0 if [ $? != 0 ];then echo "memory leak in $delta KB in mode:$mode" ./shutdownall exit 1 fi ./shutdownall cd .. done exit 0 pgpool-II-4.1.4/src/test/regression/tests/070.memory_leak_extended_memqcache/0000775000175000017500000000000013730350075024111 500000000000000pgpool-II-4.1.4/src/test/regression/tests/070.memory_leak_extended_memqcache/.gitignore0000664000175000017500000000001113730350075026011 00000000000000testdir/ pgpool-II-4.1.4/src/test/regression/tests/070.memory_leak_extended_memqcache/test.sh0000775000175000017500000000301213730350075025343 00000000000000#!/usr/bin/env bash #------------------------------------------------------------------- # Testing memory leak in extended query protocol case with query cache # enabled. To detect the memory leak, we perform pgbench -S for # sometime and see how much the pgpool child process is growing by # using ps command. PGBENCH=$PGBENCH_PATH WHOAMI=`whoami` source $TESTLIBS TESTDIR=testdir #for mode in s r n for mode in s do rm -fr $TESTDIR mkdir $TESTDIR cd $TESTDIR # create test environment echo -n "creating test environment..." $PGPOOL_SETUP -m $mode -n 2 || exit 1 echo "done." source ./bashrc.ports export PGPORT=$PGPOOL_PORT # set pgpool number of child to 1 echo "num_init_children = 1" >> etc/pgpool.conf # enable query cache echo "memory_cache_enabled = on" >> etc/pgpool.conf # start pgpool-II ./startall sleep 1 # initialize tables $PGBENCH -i test $PGBENCH -S -T 1 test # find pgpool-II child process id and grab initial process size (virtual size) foo=`ps x|grep "pgpool: wait for connection request"` pid=`echo $foo|awk '{print $1}'` init_size=`ps l $pid|tail -1|awk '{print $7}'` echo "init_size: $init_size" # run pgbench for a while $PGBENCH -M extended -S -T 30 test after_size=`ps l $pid|tail -1|awk '{print $7}'` delta=`expr $after_size - $init_size` echo "initial process size: $init_size after size: $after_size delta: $delta" test $delta -eq 0 if [ $? != 0 ];then echo "memory leak in $delta KB in mode:$mode" ./shutdownall exit 1 fi ./shutdownall cd .. done exit 0 pgpool-II-4.1.4/src/test/regression/tests/071.execute_and_deallocate/0000775000175000017500000000000013730350075022364 500000000000000pgpool-II-4.1.4/src/test/regression/tests/071.execute_and_deallocate/.gitignore0000664000175000017500000000001113730350075024264 00000000000000testdir/ pgpool-II-4.1.4/src/test/regression/tests/071.execute_and_deallocate/test.sh0000775000175000017500000000546713730350075023636 00000000000000#!/usr/bin/env bash #------------------------------------------------------------------- # Testing loadbalance failure using DEALLOCATE and EXECUTE command # case with streaming replication mode. WHOAMI=`whoami` source $TESTLIBS TESTDIR=testdir num_tests=6 success_count=0 #for mode in s r n for mode in s do rm -fr $TESTDIR mkdir $TESTDIR cd $TESTDIR # create test environment echo -n "creating test environment..." $PGPOOL_SETUP -m $mode -n 2 || exit 1 echo "done." source ./bashrc.ports export PGPORT=$PGPOOL_PORT # set backend_weight , loadbalance to slave only echo "backend_weight0 = 0" >> etc/pgpool.conf echo "backend_weight1 = 1" >> etc/pgpool.conf # start pgpool-II ./startall sleep 1 # run test1 select query psql -p 11000 test <> etc/pgpool.conf sh startall wait_for_pgpool_startup $PGPROTO -d test -f ../extended_query_test.data # hang here if the bug bites you... sh shutdownall exit 0 pgpool-II-4.1.4/src/test/regression/tests/073.pg_terminate_backend/0000775000175000017500000000000013730350075022052 500000000000000pgpool-II-4.1.4/src/test/regression/tests/073.pg_terminate_backend/test.sh0000775000175000017500000000273213730350075023314 00000000000000#!/usr/bin/env bash #------------------------------------------------------------------- # test script for pg_terminate_backend command. WHOAMI=`whoami` source $TESTLIBS TESTDIR=testdir PSQL=$PGBIN/psql for mode in s r n do rm -fr $TESTDIR mkdir $TESTDIR cd $TESTDIR # create test environment echo -n "creating test environment..." $PGPOOL_SETUP -m $mode -n 2 || exit 1 echo "done." source ./bashrc.ports export PGPORT=$PGPOOL_PORT echo "log_min_messages = 'debug5'" >> etc/pgpool.conf # start pgpool-II ./startall sleep 1 $PSQL test -p $PGPORT -c "SELECT pg_sleep(10);" & sleep 2 # get process id which query is executed PID=`ps -ef |grep "postgres:" |grep SELECT | awk 'NR==1 {print $2}'` $PSQL test -p $PGPORT -c "SELECT pg_terminate_backend($PID)" grep "found the pg_terminate_backend request" log/pgpool.log if [ $? -ne 0 ];then echo "pgpool cannot recognize a node which is executing pg_terminate_backend command." ./shutdownall exit 1 fi sleep 5 grep "failover" log/pgpool.log if [ $? -eq 0 ];then echo "Failed pg_terminate_backend. failover is executing." ./shutdownall exit 1 fi sleep 10 COUNT_UP=`grep "connection_count_up" log/pgpool.log |wc -l` COUNT_DOWN=`grep "connection_count_down" log/pgpool.log |wc -l` date echo "count_up: ${COUNT_UP}" echo "count_down: ${COUNT_DOWN}" if [ ${COUNT_UP} != ${COUNT_DOWN} ];then echo "connection count is not matched." ./shutdownall exit 1 fi ./shutdownall cd .. done exit 0 pgpool-II-4.1.4/src/utils/0000775000175000017500000000000013730350747012262 500000000000000pgpool-II-4.1.4/src/utils/error/0000775000175000017500000000000013730350746013412 500000000000000pgpool-II-4.1.4/src/utils/error/elog.c0000664000175000017500000022235613730350127014427 00000000000000/*------------------------------------------------------------------------- * * elog.c * error logging and reporting * * Because of the extremely high rate at which log messages can be generated, * we need to be mindful of the performance cost of obtaining any information * that may be logged. Also, it's important to keep in mind that this code may * get called from within an aborted transaction, in which case operations * such as syscache lookups are unsafe. * * Some notes about recursion and errors during error processing: * * We need to be robust about recursive-error scenarios --- for example, * if we run out of memory, it's important to be able to report that fact. * There are a number of considerations that go into this. * * First, distinguish between re-entrant use and actual recursion. It * is possible for an error or warning message to be emitted while the * parameters for an error message are being computed. In this case * errstart has been called for the outer message, and some field values * may have already been saved, but we are not actually recursing. We handle * this by providing a (small) stack of ErrorData records. The inner message * can be computed and sent without disturbing the state of the outer message. * (If the inner message is actually an error, this isn't very interesting * because control won't come back to the outer message generator ... but * if the inner message is only debug or log data, this is critical.) * * Second, actual recursion will occur if an error is reported by one of * the elog.c routines or something they call. By far the most probable * scenario of this sort is "out of memory"; and it's also the nastiest * to handle because we'd likely also run out of memory while trying to * report this error! Our escape hatch for this case is to reset the * ErrorContext to empty before trying to process the inner error. Since * ErrorContext is guaranteed to have at least 8K of space in it (see mcxt.c), * we should be able to process an "out of memory" message successfully. * Since we lose the prior error state due to the reset, we won't be able * to return to processing the original error, but we wouldn't have anyway. * (NOTE: the escape hatch is not used for recursive situations where the * inner message is of less than ERROR severity; in that case we just * try to process it and return normally. Usually this will work, but if * it ends up in infinite recursion, we will PANIC due to error stack * overflow.) * * * Portions Copyright (c) 2003-2018, PgPool Global Development Group * Portions Copyright (c) 1996-2015, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * * IDENTIFICATION * src/utils/error/elog.c * *------------------------------------------------------------------------- */ #include "pool.h" #include "pool_type.h" #include "utils/palloc.h" #include #include #include #include #include #include #ifdef HAVE_SYSLOG #include #endif #include #include #include #include #include "utils/elog.h" #include "utils/memutils.h" #include "pool_config.h" #include "utils/pool_stream.h" #include "context/pool_session_context.h" #include "pool.h" #define MAX_ON_EXITS 64 static struct ONEXIT { void (*function) (int code, Datum arg); Datum arg; } on_proc_exit_list[MAX_ON_EXITS], on_shmem_exit_list[MAX_ON_EXITS]; static int on_proc_exit_index, on_shmem_exit_index; struct ONEXIT on_exit_prepare = {NULL, 0L}; /* * This flag tracks whether we've called atexit() in the current process * (or in the parent postmaster). */ static bool atexit_callback_setup = false; /* * This flag is set during proc_exit() to change ereport()'s behavior, * so that an ereport() from an on_proc_exit routine cannot get us out * of the exit procedure. We do NOT want to go back to the idle loop... */ bool proc_exit_inprogress = false; /* local functions */ static void proc_exit_prepare(int code); /* Note: whereToSendOutput is initialized for the bootstrap/standalone case */ CommandDest whereToSendOutput = DestDebug; char OutputFileName[1024]; /* debugging output file */ /* Global variables */ ErrorContextCallback *error_context_stack = NULL; sigjmp_buf *PG_exception_stack = NULL; extern bool redirection_done; /* * Hook for intercepting messages before they are sent to the server log. * Note that the hook will not get called for messages that are suppressed * by log_min_messages. Also note that logging hooks implemented in preload * libraries will miss any log messages that are generated before the * library is loaded. */ emit_log_hook_type emit_log_hook = NULL; #ifdef HAVE_SYSLOG /* * Max string length to send to syslog(). Note that this doesn't count the * sequence-number prefix we add, and of course it doesn't count the prefix * added by syslog itself. Solaris and sysklogd truncate the final message * at 1024 bytes, so this value leaves 124 bytes for those prefixes. (Most * other syslog implementations seem to have limits of 2KB or so.) */ #ifndef PG_SYSLOG_LIMIT #define PG_SYSLOG_LIMIT 900 #endif static bool openlog_done = false; static char *syslog_ident = NULL; static int syslog_facility = LOG_LOCAL0; static void write_syslog(int level, const char *line); #endif static void send_message_to_server_log(ErrorData *edata); static void send_message_to_frontend(ErrorData *edata); static void write_console(const char *line, int len); static void log_line_prefix(StringInfo buf, const char *line_prefix, ErrorData *edata); static const char *process_log_prefix_padding(const char *p, int *ppadding); #ifdef WIN32 extern char *event_source; static void write_eventlog(int level, const char *line, int len); #endif /* We provide a small stack of ErrorData records for re-entrant cases */ #define ERRORDATA_STACK_SIZE 5 static ErrorData errordata[ERRORDATA_STACK_SIZE]; static int errordata_stack_depth = -1; /* index of topmost active frame */ static int recursion_depth = 0; /* to detect actual recursion */ static int frontend_error_recursion_depth = 0; /* to detect recursion in * delivering error to * frontend clients */ /* Macro for checking errordata_stack_depth is reasonable */ #define CHECK_STACK_DEPTH() \ do { \ if (errordata_stack_depth < 0) \ { \ errordata_stack_depth = -1; \ ereport(ERROR, (errmsg_internal("errstart was not called"))); \ } \ } while (0) static char *expand_fmt_string(const char *fmt, ErrorData *edata); static const char *useful_strerror(int errnum); static const char *error_severity(int elevel, bool for_frontend); static const char *process_name(void); static void append_with_tabs(StringInfo buf, const char *str); static bool is_log_level_output(int elevel, int log_min_level); /* * in_error_recursion_trouble --- are we at risk of infinite error recursion? * * This function exists to provide common control of various fallback steps * that we take if we think we are facing infinite error recursion. See the * callers for details. */ bool in_error_recursion_trouble(void) { /* Pull the plug if recurse more than once */ return (recursion_depth > 2); } /* * errstart --- begin an error-reporting cycle * * Create a stack entry and store the given parameters in it. Subsequently, * errmsg() and perhaps other routines will be called to further populate * the stack entry. Finally, errfinish() will be called to actually process * the error report. * * Returns TRUE in normal case. Returns FALSE to short-circuit the error * report (if it's a warning or lower and not to be reported anywhere). */ bool errstart(int elevel, const char *filename, int lineno, const char *funcname, const char *domain) { ErrorData *edata; bool output_to_server; bool output_to_client = false; int i; int frontend_invalid = false; /* * Check some cases in which we want to promote an error into a more * severe error. None of this logic applies for non-error messages. */ if (elevel == FRONTEND_ERROR) { frontend_invalid = true; elevel = ERROR; } if (elevel >= ERROR && elevel != FRONTEND_ONLY_ERROR) { /* * Check reasons for treating ERROR as FATAL: * * 1. we have no handler to pass the error to (implies we are in the * postmaster or in backend startup). * * 2. ExitOnAnyError mode switch is set (initdb uses this). * * 3. the error occurred after proc_exit has begun to run. (It's * proc_exit's responsibility to see that this doesn't turn into * infinite recursion!) */ if (elevel == ERROR) { if (PG_exception_stack == NULL || proc_exit_inprogress) elevel = FATAL; } /* * If the error level is ERROR or more, errfinish is not going to * return to caller; therefore, if there is any stacked error already * in progress it will be lost. This is more or less okay, except we * do not want to have a FATAL or PANIC error downgraded because the * reporting process was interrupted by a lower-grade error. So check * the stack and make sure we panic if panic is warranted. */ for (i = 0; i <= errordata_stack_depth; i++) elevel = Max(elevel, errordata[i].elevel); } /* * Now decide whether we need to process this report at all; if it's * warning or less and not enabled for logging, just return FALSE without * starting up any error logging machinery. */ /* Determine whether message is enabled for server log output */ output_to_server = is_log_level_output(elevel, pool_config->log_min_messages); /* Determine whether message is enabled for client output */ if (elevel != COMMERROR) { /* * client_min_messages is honored only after we complete the * authentication handshake. This is required both for security * reasons and because many clients can't handle NOTICE messages * during authentication. */ output_to_client = (elevel >= pool_config->client_min_messages || elevel == INFO || elevel == FRONTEND_ONLY_ERROR); } /* Skip processing effort if non-error message will not be output */ if (elevel < ERROR && !output_to_server && !output_to_client) return false; /* * Okay, crank up a stack entry to store the info in. */ if (recursion_depth++ > 0 && elevel >= ERROR && elevel != FRONTEND_ONLY_ERROR) { /* * Ooops, error during error processing. Clear ErrorContext as * discussed at top of file. We will not return to the original * error's reporter or handler, so we don't need it. */ MemoryContextReset(ErrorContext); /* * Infinite error recursion might be due to something broken in a * context traceback routine. Abandon them too. We also abandon * attempting to print the error statement (which, if long, could * itself be the source of the recursive failure). */ if (in_error_recursion_trouble()) { error_context_stack = NULL; output_to_client = false; } } if (++errordata_stack_depth >= ERRORDATA_STACK_SIZE) { /* * Wups, stack not big enough. We treat this as a PANIC condition * because it suggests an infinite loop of errors during error * recovery. */ errordata_stack_depth = -1; /* make room on stack */ ereport(PANIC, (errmsg_internal("ERRORDATA_STACK_SIZE exceeded"))); } /* Initialize data for this error frame */ edata = &errordata[errordata_stack_depth]; MemSet(edata, 0, sizeof(ErrorData)); edata->elevel = elevel; edata->frontend_invalid = frontend_invalid; edata->output_to_server = output_to_server; edata->output_to_client = output_to_client; if (elevel == FATAL && PG_exception_stack == NULL) /* This is startup * failure. Take down * main process with it */ edata->retcode = POOL_EXIT_FATAL; else edata->retcode = POOL_EXIT_AND_RESTART; if (filename) { const char *slash; /* keep only base name, useful especially for vpath builds */ slash = strrchr(filename, '/'); if (slash) filename = slash + 1; } edata->filename = filename; edata->lineno = lineno; edata->funcname = funcname; /* the default text domain is the backend's */ edata->domain = domain ? domain : PG_TEXTDOMAIN("pgpool"); edata->saved_errno = errno; /* * Any allocations for this error state level should go into ErrorContext */ edata->assoc_context = ErrorContext; recursion_depth--; return true; } /* * errfinish --- end an error-reporting cycle * * Produce the appropriate error report(s) and pop the error stack. * * If elevel is ERROR or worse, control does not return to the caller. * See elog.h for the error level definitions. */ void errfinish(int dummy,...) { ErrorData *edata = &errordata[errordata_stack_depth]; int elevel = edata->elevel; int retcode = edata->retcode; MemoryContext oldcontext; ErrorContextCallback *econtext; recursion_depth++; CHECK_STACK_DEPTH(); /* * Do processing in ErrorContext, which we hope has enough reserved space * to report an error. */ oldcontext = MemoryContextSwitchTo(ErrorContext); /* * Call any context callback functions. Errors occurring in callback * functions will be treated as recursive errors --- this ensures we will * avoid infinite recursion (see errstart). */ for (econtext = error_context_stack; econtext != NULL; econtext = econtext->previous) (*econtext->callback) (econtext->arg); /* * If ERROR (not more nor less) we pass it off to the current handler. * Printing it and popping the stack is the responsibility of the handler. */ if (elevel == ERROR) { /* * We do some minimal cleanup before longjmp'ing so that handlers can * execute in a reasonably sane state. */ /* * Note that we leave CurrentMemoryContext set to ErrorContext. The * handler should reset it to something else soon. */ recursion_depth--; PG_RE_THROW(); } /* * If we are doing FATAL or PANIC, abort any old-style COPY OUT in * progress, so that we can report the message before dying. (Without * this, pq_putmessage will refuse to send the message at all, which is * what we want for NOTICE messages, but not for fatal exits.) This hack * is necessary because of poor design of old-style copy protocol. Note * we must do this even if client is fool enough to have set * client_min_messages above FATAL, so don't look at output_to_client. */ /* Emit the message to the right places */ EmitErrorReport(); /* Now free up subsidiary data attached to stack entry, and release it */ if (edata->message) pfree(edata->message); if (edata->detail) pfree(edata->detail); if (edata->detail_log) pfree(edata->detail_log); if (edata->hint) pfree(edata->hint); if (edata->context) pfree(edata->context); if (edata->schema_name) pfree(edata->schema_name); if (edata->table_name) pfree(edata->table_name); if (edata->column_name) pfree(edata->column_name); if (edata->datatype_name) pfree(edata->datatype_name); if (edata->constraint_name) pfree(edata->constraint_name); if (edata->internalquery) pfree(edata->internalquery); errordata_stack_depth--; /* Exit error-handling context */ MemoryContextSwitchTo(oldcontext); recursion_depth--; /* * Perform error recovery action as specified by elevel. */ if (elevel == FATAL) { /* * If we just reported a startup failure, the client will disconnect * on receiving it, so don't send any more to the client. */ if (PG_exception_stack == NULL && whereToSendOutput == DestRemote) whereToSendOutput = DestNone; /* * fflush here is just to improve the odds that we get to see the * error message, in case things are so hosed that proc_exit crashes. * Any other code you might be tempted to add here should probably be * in an on_proc_exit or on_shmem_exit callback instead. */ fflush(stdout); fflush(stderr); /* * Do normal process-exit cleanup, then return exit code 1 to indicate * FATAL termination. The postmaster may or may not consider this * worthy of panic, depending on which subprocess returns it. */ proc_exit(retcode); } if (elevel >= PANIC && elevel != FRONTEND_ONLY_ERROR) { /* * Serious crash time. Postmaster will observe SIGABRT process exit * status and kill the other backends too. * * XXX: what if we are *in* the postmaster? abort() won't kill our * children... */ fflush(stdout); fflush(stderr); abort(); } /* * We reach here if elevel <= WARNING. OK to return to caller. * * But check for cancel/die interrupt first --- this is so that the user * can stop a query emitting tons of notice or warning messages, even if * it's in a loop that otherwise fails to check for interrupts. */ } /* * errcode --- add SQLSTATE error code to the current error * * The code is expected to be represented as per MAKE_SQLSTATE(). */ int errcode_ign(int sqlerrcode) { return 0; /* return value does not matter */ } int pool_error_code(const char *errcode) { ErrorData *edata = &errordata[errordata_stack_depth]; MemoryContext oldcontext; recursion_depth++; CHECK_STACK_DEPTH(); oldcontext = MemoryContextSwitchTo(edata->assoc_context); edata->pgpool_errcode = pstrdup(errcode); MemoryContextSwitchTo(oldcontext); recursion_depth--; return 0; /* return value does not matter */ } /* * This macro handles expansion of a format string and associated parameters; * it's common code for errmsg(), errdetail(), etc. Must be called inside * a routine that is declared like "const char *fmt, ..." and has an edata * pointer set up. The message is assigned to edata->targetfield, or * appended to it if appendval is true. The message is subject to translation * if translateit is true. * * Note: we pstrdup the buffer rather than just transferring its storage * to the edata field because the buffer might be considerably larger than * really necessary. */ #define EVALUATE_MESSAGE(domain, targetfield, appendval, translateit) \ { \ char *fmtbuf; \ StringInfoData buf; \ /* Internationalize the error format string */ \ if (translateit && !in_error_recursion_trouble()) \ fmt = dgettext((domain), fmt); \ /* Expand %m in format string */ \ fmtbuf = expand_fmt_string(fmt, edata); \ initStringInfo(&buf); \ if ((appendval) && edata->targetfield) { \ appendStringInfoString(&buf, edata->targetfield); \ appendStringInfoChar(&buf, '\n'); \ } \ /* Generate actual output --- have to use appendStringInfoVA */ \ for (;;) \ { \ va_list args; \ int needed; \ va_start(args, fmt); \ needed = appendStringInfoVA(&buf, fmtbuf, args); \ va_end(args); \ if (needed == 0) \ break; \ enlargeStringInfo(&buf, needed); \ } \ /* Done with expanded fmt */ \ pfree(fmtbuf); \ /* Save the completed message into the stack item */ \ if (edata->targetfield) \ pfree(edata->targetfield); \ edata->targetfield = pstrdup(buf.data); \ pfree(buf.data); \ } /* * Same as above, except for pluralized error messages. The calling routine * must be declared like "const char *fmt_singular, const char *fmt_plural, * unsigned long n, ...". Translation is assumed always wanted. */ #define EVALUATE_MESSAGE_PLURAL(domain, targetfield, appendval) \ { \ const char *fmt; \ char *fmtbuf; \ StringInfoData buf; \ /* Internationalize the error format string */ \ if (!in_error_recursion_trouble()) \ fmt = dngettext((domain), fmt_singular, fmt_plural, n); \ else \ fmt = (n == 1 ? fmt_singular : fmt_plural); \ /* Expand %m in format string */ \ fmtbuf = expand_fmt_string(fmt, edata); \ initStringInfo(&buf); \ if ((appendval) && edata->targetfield) { \ appendStringInfoString(&buf, edata->targetfield); \ appendStringInfoChar(&buf, '\n'); \ } \ /* Generate actual output --- have to use appendStringInfoVA */ \ for (;;) \ { \ va_list args; \ int needed; \ va_start(args, n); \ needed = appendStringInfoVA(&buf, fmtbuf, args); \ va_end(args); \ if (needed == 0) \ break; \ enlargeStringInfo(&buf, needed); \ } \ /* Done with expanded fmt */ \ pfree(fmtbuf); \ /* Save the completed message into the stack item */ \ if (edata->targetfield) \ pfree(edata->targetfield); \ edata->targetfield = pstrdup(buf.data); \ pfree(buf.data); \ } /* * errmsg --- add a primary error message text to the current error * * In addition to the usual %-escapes recognized by printf, "%m" in * fmt is replaced by the error message for the caller's value of errno. * * Note: no newline is needed at the end of the fmt string, since * ereport will provide one for the output methods that need it. */ int errmsg(const char *fmt,...) { ErrorData *edata = &errordata[errordata_stack_depth]; MemoryContext oldcontext; recursion_depth++; CHECK_STACK_DEPTH(); oldcontext = MemoryContextSwitchTo(edata->assoc_context); EVALUATE_MESSAGE(edata->domain, message, false, true); MemoryContextSwitchTo(oldcontext); recursion_depth--; return 0; /* return value does not matter */ } /* * errmsg_internal --- add a primary error message text to the current error * * This is exactly like errmsg() except that strings passed to errmsg_internal * are not translated, and are customarily left out of the * internationalization message dictionary. This should be used for "can't * happen" cases that are probably not worth spending translation effort on. * We also use this for certain cases where we *must* not try to translate * the message because the translation would fail and result in infinite * error recursion. */ int errmsg_internal(const char *fmt,...) { ErrorData *edata = &errordata[errordata_stack_depth]; MemoryContext oldcontext; recursion_depth++; CHECK_STACK_DEPTH(); oldcontext = MemoryContextSwitchTo(edata->assoc_context); EVALUATE_MESSAGE(edata->domain, message, false, false); MemoryContextSwitchTo(oldcontext); recursion_depth--; return 0; /* return value does not matter */ } /* * errmsg_plural --- add a primary error message text to the current error, * with support for pluralization of the message text */ int errmsg_plural(const char *fmt_singular, const char *fmt_plural, unsigned long n,...) { ErrorData *edata = &errordata[errordata_stack_depth]; MemoryContext oldcontext; recursion_depth++; CHECK_STACK_DEPTH(); oldcontext = MemoryContextSwitchTo(edata->assoc_context); EVALUATE_MESSAGE_PLURAL(edata->domain, message, false); MemoryContextSwitchTo(oldcontext); recursion_depth--; return 0; /* return value does not matter */ } /* * errdetail --- add a detail error message text to the current error */ int errdetail(const char *fmt,...) { ErrorData *edata = &errordata[errordata_stack_depth]; MemoryContext oldcontext; recursion_depth++; CHECK_STACK_DEPTH(); oldcontext = MemoryContextSwitchTo(edata->assoc_context); EVALUATE_MESSAGE(edata->domain, detail, false, true); MemoryContextSwitchTo(oldcontext); recursion_depth--; return 0; /* return value does not matter */ } /* * errdetail_internal --- add a detail error message text to the current error * * This is exactly like errdetail() except that strings passed to * errdetail_internal are not translated, and are customarily left out of the * internationalization message dictionary. This should be used for detail * messages that seem not worth translating for one reason or another * (typically, that they don't seem to be useful to average users). */ int errdetail_internal(const char *fmt,...) { ErrorData *edata = &errordata[errordata_stack_depth]; MemoryContext oldcontext; recursion_depth++; CHECK_STACK_DEPTH(); oldcontext = MemoryContextSwitchTo(edata->assoc_context); EVALUATE_MESSAGE(edata->domain, detail, false, false); MemoryContextSwitchTo(oldcontext); recursion_depth--; return 0; /* return value does not matter */ } /* * errdetail_log --- add a detail_log error message text to the current error */ int errdetail_log(const char *fmt,...) { ErrorData *edata = &errordata[errordata_stack_depth]; MemoryContext oldcontext; recursion_depth++; CHECK_STACK_DEPTH(); oldcontext = MemoryContextSwitchTo(edata->assoc_context); EVALUATE_MESSAGE(edata->domain, detail_log, false, true); MemoryContextSwitchTo(oldcontext); recursion_depth--; return 0; /* return value does not matter */ } /* * errdetail_plural --- add a detail error message text to the current error, * with support for pluralization of the message text */ int errdetail_plural(const char *fmt_singular, const char *fmt_plural, unsigned long n,...) { ErrorData *edata = &errordata[errordata_stack_depth]; MemoryContext oldcontext; recursion_depth++; CHECK_STACK_DEPTH(); oldcontext = MemoryContextSwitchTo(edata->assoc_context); EVALUATE_MESSAGE_PLURAL(edata->domain, detail, false); MemoryContextSwitchTo(oldcontext); recursion_depth--; return 0; /* return value does not matter */ } /* * errhint --- add a hint error message text to the current error */ int errhint(const char *fmt,...) { ErrorData *edata = &errordata[errordata_stack_depth]; MemoryContext oldcontext; recursion_depth++; CHECK_STACK_DEPTH(); oldcontext = MemoryContextSwitchTo(edata->assoc_context); EVALUATE_MESSAGE(edata->domain, hint, false, true); MemoryContextSwitchTo(oldcontext); recursion_depth--; return 0; /* return value does not matter */ } /* * errcontext_msg --- add a context error message text to the current error * * Unlike other cases, multiple calls are allowed to build up a stack of * context information. We assume earlier calls represent more-closely-nested * states. */ int errcontext_msg(const char *fmt,...) { ErrorData *edata = &errordata[errordata_stack_depth]; MemoryContext oldcontext; recursion_depth++; CHECK_STACK_DEPTH(); oldcontext = MemoryContextSwitchTo(edata->assoc_context); EVALUATE_MESSAGE(edata->context_domain, context, true, true); MemoryContextSwitchTo(oldcontext); recursion_depth--; return 0; /* return value does not matter */ } /* * set_errcontext_domain --- set message domain to be used by errcontext() * * errcontext_msg() can be called from a different module than the original * ereport(), so we cannot use the message domain passed in errstart() to * translate it. Instead, each errcontext_msg() call should be preceded by * a set_errcontext_domain() call to specify the domain. This is usually * done transparently by the errcontext() macro. */ int set_errcontext_domain(const char *domain) { ErrorData *edata = &errordata[errordata_stack_depth]; /* we don't bother incrementing recursion_depth */ CHECK_STACK_DEPTH(); edata->context_domain = domain; return 0; /* return value does not matter */ } /* * errhidestmt --- optionally suppress STATEMENT: field of log entry * * This should be called if the message text already includes the statement. */ int errhidestmt(bool hide_stmt) { ErrorData *edata = &errordata[errordata_stack_depth]; /* we don't bother incrementing recursion_depth */ CHECK_STACK_DEPTH(); edata->hide_stmt = hide_stmt; return 0; /* return value does not matter */ } /* * errfunction --- add reporting function name to the current error * * This is used when backwards compatibility demands that the function * name appear in messages sent to old-protocol clients. Note that the * passed string is expected to be a non-freeable constant string. */ int errfunction(const char *funcname) { ErrorData *edata = &errordata[errordata_stack_depth]; /* we don't bother incrementing recursion_depth */ CHECK_STACK_DEPTH(); edata->funcname = funcname; edata->show_funcname = true; return 0; /* return value does not matter */ } /* * errposition --- add cursor position to the current error */ int errposition(int cursorpos) { ErrorData *edata = &errordata[errordata_stack_depth]; /* we don't bother incrementing recursion_depth */ CHECK_STACK_DEPTH(); edata->cursorpos = cursorpos; return 0; /* return value does not matter */ } int return_code(int retcode) { ErrorData *edata = &errordata[errordata_stack_depth]; /* we don't bother incrementing recursion_depth */ CHECK_STACK_DEPTH(); edata->retcode = retcode; return retcode; /* return value does not matter */ } int get_return_code(void) { ErrorData *edata = &errordata[errordata_stack_depth]; /* we don't bother incrementing recursion_depth */ CHECK_STACK_DEPTH(); return edata->retcode; } /* * geterrcode --- return the currently set SQLSTATE error code * * This is only intended for use in error callback subroutines, since there * is no other place outside elog.c where the concept is meaningful. */ int geterrcode(void) { ErrorData *edata = &errordata[errordata_stack_depth]; /* we don't bother incrementing recursion_depth */ CHECK_STACK_DEPTH(); return edata->sqlerrcode; } /* * getfrontendinvalid --- return the currently frontend_invalid value * * This is only intended for use in error callback subroutines, since there * is no other place outside elog.c where the concept is meaningful. */ bool getfrontendinvalid(void) { ErrorData *edata = &errordata[errordata_stack_depth]; /* we don't bother incrementing recursion_depth */ CHECK_STACK_DEPTH(); return edata->frontend_invalid; } /* * geterrposition --- return the currently set error position (0 if none) * * This is only intended for use in error callback subroutines, since there * is no other place outside elog.c where the concept is meaningful. */ int geterrposition(void) { ErrorData *edata = &errordata[errordata_stack_depth]; /* we don't bother incrementing recursion_depth */ CHECK_STACK_DEPTH(); return edata->cursorpos; } /* * elog_start --- startup for old-style API * * All that we do here is stash the hidden filename/lineno/funcname * arguments into a stack entry, along with the current value of errno. * * We need this to be separate from elog_finish because there's no other * C89-compliant way to deal with inserting extra arguments into the elog * call. (When using C99's __VA_ARGS__, we could possibly merge this with * elog_finish, but there doesn't seem to be a good way to save errno before * evaluating the format arguments if we do that.) */ void elog_start(const char *filename, int lineno, const char *funcname) { ErrorData *edata; if (++errordata_stack_depth >= ERRORDATA_STACK_SIZE) { /* * Wups, stack not big enough. We treat this as a PANIC condition * because it suggests an infinite loop of errors during error * recovery. Note that the message is intentionally not localized, * else failure to convert it to client encoding could cause further * recursion. */ errordata_stack_depth = -1; /* make room on stack */ ereport(PANIC, (errmsg_internal("ERRORDATA_STACK_SIZE exceeded"))); } edata = &errordata[errordata_stack_depth]; if (filename) { const char *slash; /* keep only base name, useful especially for vpath builds */ slash = strrchr(filename, '/'); if (slash) filename = slash + 1; } edata->filename = filename; edata->lineno = lineno; edata->funcname = funcname; /* errno is saved now so that error parameter eval can't change it */ edata->saved_errno = errno; /* Use ErrorContext for any allocations done at this level. */ edata->assoc_context = ErrorContext; } /* * elog_finish --- finish up for old-style API */ void elog_finish(int elevel, const char *fmt,...) { ErrorData *edata = &errordata[errordata_stack_depth]; MemoryContext oldcontext; CHECK_STACK_DEPTH(); /* * Do errstart() to see if we actually want to report the message. */ errordata_stack_depth--; errno = edata->saved_errno; if (!errstart(elevel, edata->filename, edata->lineno, edata->funcname, NULL)) return; /* nothing to do */ /* * Format error message just like errmsg_internal(). */ recursion_depth++; oldcontext = MemoryContextSwitchTo(edata->assoc_context); EVALUATE_MESSAGE(edata->domain, message, false, false); MemoryContextSwitchTo(oldcontext); recursion_depth--; /* * And let errfinish() finish up. */ errfinish(0); } /* * Actual output of the top-of-stack error message * * In the ereport(ERROR) case this is called from PostgresMain (or not at all, * if the error is caught by somebody). For all other severity levels this * is called by errfinish. */ void EmitErrorReport(void) { ErrorData *edata = &errordata[errordata_stack_depth]; MemoryContext oldcontext; recursion_depth++; CHECK_STACK_DEPTH(); oldcontext = MemoryContextSwitchTo(edata->assoc_context); /* * Call hook before sending message to log. The hook function is allowed * to turn off edata->output_to_server, so we must recheck that afterward. * Making any other change in the content of edata is not considered * supported. * * Note: the reason why the hook can only turn off output_to_server, and * not turn it on, is that it'd be unreliable: we will never get here at * all if errstart() deems the message uninteresting. A hook that could * make decisions in that direction would have to hook into errstart(), * where it would have much less information available. emit_log_hook is * intended for custom log filtering and custom log message transmission * mechanisms. */ if (edata->output_to_server && emit_log_hook) (*emit_log_hook) (edata); /* Send to server log, if enabled */ if (edata->output_to_server) send_message_to_server_log(edata); /* Send to client, if enabled */ if (edata->output_to_client) send_message_to_frontend(edata); MemoryContextSwitchTo(oldcontext); recursion_depth--; } /* * CopyErrorData --- obtain a copy of the topmost error stack entry * * This is only for use in error handler code. The data is copied into the * current memory context, so callers should always switch away from * ErrorContext first; otherwise it will be lost when FlushErrorState is done. */ ErrorData * CopyErrorData(void) { ErrorData *edata = &errordata[errordata_stack_depth]; ErrorData *newedata; /* * we don't increment recursion_depth because out-of-memory here does not * indicate a problem within the error subsystem. */ CHECK_STACK_DEPTH(); Assert(CurrentMemoryContext != ErrorContext); /* Copy the struct itself */ newedata = (ErrorData *) palloc(sizeof(ErrorData)); memcpy(newedata, edata, sizeof(ErrorData)); /* Make copies of separately-allocated fields */ if (newedata->message) newedata->message = pstrdup(newedata->message); if (newedata->detail) newedata->detail = pstrdup(newedata->detail); if (newedata->detail_log) newedata->detail_log = pstrdup(newedata->detail_log); if (newedata->hint) newedata->hint = pstrdup(newedata->hint); if (newedata->context) newedata->context = pstrdup(newedata->context); if (newedata->schema_name) newedata->schema_name = pstrdup(newedata->schema_name); if (newedata->table_name) newedata->table_name = pstrdup(newedata->table_name); if (newedata->column_name) newedata->column_name = pstrdup(newedata->column_name); if (newedata->datatype_name) newedata->datatype_name = pstrdup(newedata->datatype_name); if (newedata->constraint_name) newedata->constraint_name = pstrdup(newedata->constraint_name); if (newedata->internalquery) newedata->internalquery = pstrdup(newedata->internalquery); /* Use the calling context for string allocation */ newedata->assoc_context = CurrentMemoryContext; return newedata; } /* * FreeErrorData --- free the structure returned by CopyErrorData. * * Error handlers should use this in preference to assuming they know all * the separately-allocated fields. */ void FreeErrorData(ErrorData *edata) { if (edata->message) pfree(edata->message); if (edata->detail) pfree(edata->detail); if (edata->detail_log) pfree(edata->detail_log); if (edata->hint) pfree(edata->hint); if (edata->context) pfree(edata->context); if (edata->schema_name) pfree(edata->schema_name); if (edata->table_name) pfree(edata->table_name); if (edata->column_name) pfree(edata->column_name); if (edata->datatype_name) pfree(edata->datatype_name); if (edata->constraint_name) pfree(edata->constraint_name); if (edata->internalquery) pfree(edata->internalquery); pfree(edata); } /* * FlushErrorState --- flush the error state after error recovery * * This should be called by an error handler after it's done processing * the error; or as soon as it's done CopyErrorData, if it intends to * do stuff that is likely to provoke another error. You are not "out" of * the error subsystem until you have done this. */ void FlushErrorState(void) { /* * Reset stack to empty. The only case where it would be more than one * deep is if we serviced an error that interrupted construction of * another message. We assume control escaped out of that message * construction and won't ever go back. */ errordata_stack_depth = -1; recursion_depth = 0; frontend_error_recursion_depth = 0; /* Delete all data in ErrorContext */ MemoryContextResetAndDeleteChildren(ErrorContext); } /* * ReThrowError --- re-throw a previously copied error * * A handler can do CopyErrorData/FlushErrorState to get out of the error * subsystem, then do some processing, and finally ReThrowError to re-throw * the original error. This is slower than just PG_RE_THROW() but should * be used if the "some processing" is likely to incur another error. */ void ReThrowError(ErrorData *edata) { ErrorData *newedata; Assert(edata->elevel == ERROR); /* Push the data back into the error context */ recursion_depth++; MemoryContextSwitchTo(ErrorContext); if (++errordata_stack_depth >= ERRORDATA_STACK_SIZE) { /* * Wups, stack not big enough. We treat this as a PANIC condition * because it suggests an infinite loop of errors during error * recovery. */ errordata_stack_depth = -1; /* make room on stack */ ereport(PANIC, (errmsg_internal("ERRORDATA_STACK_SIZE exceeded"))); } newedata = &errordata[errordata_stack_depth]; memcpy(newedata, edata, sizeof(ErrorData)); /* Make copies of separately-allocated fields */ if (newedata->message) newedata->message = pstrdup(newedata->message); if (newedata->detail) newedata->detail = pstrdup(newedata->detail); if (newedata->detail_log) newedata->detail_log = pstrdup(newedata->detail_log); if (newedata->hint) newedata->hint = pstrdup(newedata->hint); if (newedata->context) newedata->context = pstrdup(newedata->context); if (newedata->schema_name) newedata->schema_name = pstrdup(newedata->schema_name); if (newedata->table_name) newedata->table_name = pstrdup(newedata->table_name); if (newedata->column_name) newedata->column_name = pstrdup(newedata->column_name); if (newedata->datatype_name) newedata->datatype_name = pstrdup(newedata->datatype_name); if (newedata->constraint_name) newedata->constraint_name = pstrdup(newedata->constraint_name); if (newedata->internalquery) newedata->internalquery = pstrdup(newedata->internalquery); /* Reset the assoc_context to be ErrorContext */ newedata->assoc_context = ErrorContext; recursion_depth--; PG_RE_THROW(); } /* * pg_re_throw --- out-of-line implementation of PG_RE_THROW() macro */ void pg_re_throw(void) { /* If possible, throw the error to the next outer setjmp handler */ if (PG_exception_stack != NULL) siglongjmp(*PG_exception_stack, 1); else { /* * If we get here, elog(ERROR) was thrown inside a PG_TRY block, which * we have now exited only to discover that there is no outer setjmp * handler to pass the error to. Had the error been thrown outside * the block to begin with, we'd have promoted the error to FATAL, so * the correct behavior is to make it FATAL now; that is, emit it and * then call proc_exit. */ ErrorData *edata = &errordata[errordata_stack_depth]; Assert(errordata_stack_depth >= 0); Assert(edata->elevel == ERROR); edata->elevel = FATAL; edata->output_to_server = (FATAL >= pool_config->log_min_messages); edata->output_to_client = (FATAL >= pool_config->client_min_messages); /* * We can use errfinish() for the rest, but we don't want it to call * any error context routines a second time. Since we know we are * about to exit, it should be OK to just clear the context stack. */ error_context_stack = NULL; errfinish(0); } /* Doesn't return ... */ ExceptionalCondition("pg_re_throw tried to return", "FailedAssertion", __FILE__, __LINE__); } /* * GetErrorContextStack - Return the context stack, for display/diags * * Returns a pstrdup'd string in the caller's context which includes the PG * error call stack. It is the caller's responsibility to ensure this string * is pfree'd (or its context cleaned up) when done. * * This information is collected by traversing the error contexts and calling * each context's callback function, each of which is expected to call * errcontext() to return a string which can be presented to the user. */ char * GetErrorContextStack(void) { ErrorData *edata; ErrorContextCallback *econtext; /* * Okay, crank up a stack entry to store the info in. */ recursion_depth++; if (++errordata_stack_depth >= ERRORDATA_STACK_SIZE) { /* * Wups, stack not big enough. We treat this as a PANIC condition * because it suggests an infinite loop of errors during error * recovery. */ errordata_stack_depth = -1; /* make room on stack */ ereport(PANIC, (errmsg_internal("ERRORDATA_STACK_SIZE exceeded"))); } /* * Things look good so far, so initialize our error frame */ edata = &errordata[errordata_stack_depth]; MemSet(edata, 0, sizeof(ErrorData)); /* * Set up assoc_context to be the caller's context, so any allocations * done (which will include edata->context) will use their context. */ edata->assoc_context = CurrentMemoryContext; /* * Call any context callback functions to collect the context information * into edata->context. * * Errors occurring in callback functions should go through the regular * error handling code which should handle any recursive errors, though we * double-check above, just in case. */ for (econtext = error_context_stack; econtext != NULL; econtext = econtext->previous) (*econtext->callback) (econtext->arg); /* * Clean ourselves off the stack, any allocations done should have been * using edata->assoc_context, which we set up earlier to be the caller's * context, so we're free to just remove our entry off the stack and * decrement recursion depth and exit. */ errordata_stack_depth--; recursion_depth--; /* * Return a pointer to the string the caller asked for, which should have * been allocated in their context. */ return edata->context; } #ifdef HAVE_SYSLOG /* * Set or update the parameters for syslog logging */ void set_syslog_parameters(const char *ident, int facility) { /* * guc.c is likely to call us repeatedly with same parameters, so don't * thrash the syslog connection unnecessarily. Also, we do not re-open * the connection until needed, since this routine will get called whether * or not Log_destination actually mentions syslog. * * Note that we make our own copy of the ident string rather than relying * on guc.c's. This may be overly paranoid, but it ensures that we cannot * accidentally free a string that syslog is still using. */ if (syslog_ident == NULL || strcmp(syslog_ident, ident) != 0 || syslog_facility != facility) { if (openlog_done) { closelog(); openlog_done = false; } if (syslog_ident) free(syslog_ident); syslog_ident = strdup(ident); /* if the strdup fails, we will cope in write_syslog() */ syslog_facility = facility; } } /* * Write a message line to syslog */ static void write_syslog(int level, const char *line) { static unsigned long seq = 0; int len; const char *nlpos; /* Open syslog connection if not done yet */ if (!openlog_done) { openlog(pool_config->syslog_ident ? pool_config->syslog_ident : "pgpool", LOG_PID | LOG_NDELAY | LOG_NOWAIT, pool_config->syslog_facility); openlog_done = true; } /* * We add a sequence number to each log message to suppress "same" * messages. */ seq++; /* * Our problem here is that many syslog implementations don't handle long * messages in an acceptable manner. While this function doesn't help that * fact, it does work around by splitting up messages into smaller pieces. * * We divide into multiple syslog() calls if message is too long or if the * message contains embedded newline(s). */ len = strlen(line); nlpos = strchr(line, '\n'); if (len > PG_SYSLOG_LIMIT || nlpos != NULL) { int chunk_nr = 0; while (len > 0) { char buf[PG_SYSLOG_LIMIT + 1]; int buflen; int i; /* if we start at a newline, move ahead one char */ if (line[0] == '\n') { line++; len--; /* we need to recompute the next newline's position, too */ nlpos = strchr(line, '\n'); continue; } /* copy one line, or as much as will fit, to buf */ if (nlpos != NULL) buflen = nlpos - line; else buflen = len; buflen = Min(buflen, PG_SYSLOG_LIMIT); memcpy(buf, line, buflen); buf[buflen] = '\0'; /* * trim to multibyte letter boundary buflen = pg_mbcliplen(buf, * buflen, buflen); if (buflen <= 0) return; buf[buflen] = '\0'; */ /* already word boundary? */ if (line[buflen] != '\0' && !isspace((unsigned char) line[buflen])) { /* try to divide at word boundary */ i = buflen - 1; while (i > 0 && !isspace((unsigned char) buf[i])) i--; if (i > 0) /* else couldn't divide word boundary */ { buflen = i; buf[i] = '\0'; } } chunk_nr++; syslog(level, "[%lu-%d] %s", seq, chunk_nr, buf); line += buflen; len -= buflen; } } else { /* message short enough */ syslog(level, "[%lu] %s", seq, line); } } #endif /* HAVE_SYSLOG */ #ifdef WIN32 /* * Get the PostgreSQL equivalent of the Windows ANSI code page. "ANSI" system * interfaces (e.g. CreateFileA()) expect string arguments in this encoding. * Every process in a given system will find the same value at all times. */ static int GetACPEncoding(void) { static int encoding = -2; if (encoding == -2) encoding = pg_codepage_to_encoding(GetACP()); return encoding; } /* * Write a message line to the windows event log */ static void write_eventlog(int level, const char *line, int len) { WCHAR *utf16; int eventlevel = EVENTLOG_ERROR_TYPE; static HANDLE evtHandle = INVALID_HANDLE_VALUE; if (evtHandle == INVALID_HANDLE_VALUE) { evtHandle = RegisterEventSource(NULL, event_source ? event_source : "pgpool"); if (evtHandle == NULL) { evtHandle = INVALID_HANDLE_VALUE; return; } } switch (level) { case DEBUG5: case DEBUG4: case DEBUG3: case DEBUG2: case DEBUG1: case LOG: case COMMERROR: case INFO: case NOTICE: eventlevel = EVENTLOG_INFORMATION_TYPE; break; case WARNING: eventlevel = EVENTLOG_WARNING_TYPE; break; case ERROR: case FATAL: case PANIC: default: eventlevel = EVENTLOG_ERROR_TYPE; break; } /* * If message character encoding matches the encoding expected by * ReportEventA(), call it to avoid the hazards of conversion. Otherwise, * try to convert the message to UTF16 and write it with ReportEventW(). * Fall back on ReportEventA() if conversion failed. * * Also verify that we are not on our way into error recursion trouble due * to error messages thrown deep inside pgwin32_message_to_UTF16(). */ if (!in_error_recursion_trouble() && GetMessageEncoding() != GetACPEncoding()) { utf16 = pgwin32_message_to_UTF16(line, len, NULL); if (utf16) { ReportEventW(evtHandle, eventlevel, 0, 0, /* All events are Id 0 */ NULL, 1, 0, (LPCWSTR *) &utf16, NULL); /* XXX Try ReportEventA() when ReportEventW() fails? */ pfree(utf16); return; } } ReportEventA(evtHandle, eventlevel, 0, 0, /* All events are Id 0 */ NULL, 1, 0, &line, NULL); } #endif /* WIN32 */ static void write_console(const char *line, int len) { int rc; #ifdef WIN32 /* * Try to convert the message to UTF16 and write it with WriteConsoleW(). * Fall back on write() if anything fails. * * In contrast to write_eventlog(), don't skip straight to write() based * on the applicable encodings. Unlike WriteConsoleW(), write() depends * on the suitability of the console output code page. Since we put * stderr into binary mode in SubPostmasterMain(), write() skips the * necessary translation anyway. * * WriteConsoleW() will fail if stderr is redirected, so just fall through * to writing unconverted to the logfile in this case. * * Since we palloc the structure required for conversion, also fall * through to writing unconverted if we have not yet set up * CurrentMemoryContext. */ if (!in_error_recursion_trouble() && !redirection_done && CurrentMemoryContext != NULL) { WCHAR *utf16; int utf16len; utf16 = pgwin32_message_to_UTF16(line, len, &utf16len); if (utf16 != NULL) { HANDLE stdHandle; DWORD written; stdHandle = GetStdHandle(STD_ERROR_HANDLE); if (WriteConsoleW(stdHandle, utf16, utf16len, &written, NULL)) { pfree(utf16); return; } /* * In case WriteConsoleW() failed, fall back to writing the * message unconverted. */ pfree(utf16); } } #else /* * Conversion on non-win32 platforms is not implemented yet. It requires * non-throw version of pg_do_encoding_conversion(), that converts * unconvertable characters to '?' without errors. */ #endif /* * We ignore any error from write() here. We have no useful way to report * it ... certainly whining on stderr isn't likely to be productive. */ rc = write(fileno(stderr), line, len); (void) rc; } /* * Write error report to frontend log */ static void send_message_to_frontend(ErrorData *edata) { int protoVersion = PROTO_MAJOR_V3; /* default protocol version is * V3 also used by pcp lib */ if (pool_frontend_exists() < 0) return; /* * Leave if we are failing on sending the message to frontend. */ if (++frontend_error_recursion_depth > 2) return; if (processType == PT_CHILD) { /* * Do not forward the debug messages to client before session is * initialized */ if (edata->elevel < ERROR && pool_get_session_context(true) == NULL) { frontend_error_recursion_depth--; return; } protoVersion = get_frontend_protocol_version(); set_pg_frontend_blocking(false); } if (protoVersion == PROTO_MAJOR_V2) { char *message = edata->message ? edata->message : "missing error text"; pool_send_to_frontend((edata->elevel < ERROR) ? "N" : "E", 1, false); pool_send_to_frontend(message, strlen(message), false); pool_send_to_frontend("\n", 1, true); } else if (protoVersion == PROTO_MAJOR_V3) { /* * Buffer length for each message part */ #define MAXMSGBUF 256 /* * Buffer length for result message buffer. Since msg is consisted of * 7 parts, msg buffer should be large enough to hold those message * parts */ #define MAXDATA (MAXMSGBUF+1)*7+1 char data[MAXDATA]; char msgbuf[MAXMSGBUF + 1]; int len; int thislen; int sendlen; len = 0; memset(data, 0, MAXDATA); pool_send_to_frontend((edata->elevel < ERROR) ? "N" : "E", 1, false); /* error level */ thislen = snprintf(msgbuf, MAXMSGBUF, "S%s", error_severity(edata->elevel, true)); thislen = Min(thislen, MAXMSGBUF); memcpy(data + len, msgbuf, thislen + 1); len += thislen + 1; /* code */ thislen = snprintf(msgbuf, MAXMSGBUF, "C%s", edata->pgpool_errcode ? edata->pgpool_errcode : "XX000"); thislen = Min(thislen, MAXMSGBUF); memcpy(data + len, msgbuf, thislen + 1); len += thislen + 1; /* message */ thislen = snprintf(msgbuf, MAXMSGBUF, "M%s", edata->message ? edata->message : "missing error text"); thislen = Min(thislen, MAXMSGBUF); memcpy(data + len, msgbuf, thislen + 1); len += thislen + 1; /* detail */ if (edata->detail) { thislen = snprintf(msgbuf, MAXMSGBUF, "D%s", edata->detail); thislen = Min(thislen, MAXMSGBUF); memcpy(data + len, msgbuf, thislen + 1); len += thislen + 1; } /* hint */ if (edata->hint) { thislen = snprintf(msgbuf, MAXMSGBUF, "H%s", edata->hint); thislen = Min(thislen, MAXMSGBUF); memcpy(data + len, msgbuf, thislen + 1); len += thislen + 1; } /* file */ thislen = snprintf(msgbuf, MAXMSGBUF, "F%s", edata->filename); thislen = Min(thislen, MAXMSGBUF); memcpy(data + len, msgbuf, thislen + 1); len += thislen + 1; /* line */ thislen = snprintf(msgbuf, MAXMSGBUF, "L%d", edata->lineno); thislen = Min(thislen, MAXMSGBUF); memcpy(data + len, msgbuf, thislen + 1); len += thislen + 1; /* stop null */ len++; *(data + len - 1) = '\0'; sendlen = len; len = htonl(len + 4); pool_send_to_frontend((char *) &len, sizeof(len), false); pool_send_to_frontend(data, sendlen, true); } if (edata->elevel == FRONTEND_ONLY_ERROR) { /* * send the ready for query to complete the frontend error cycle */ /* ready for query */ pool_send_to_frontend((char *) "Z", 1, true); if (protoVersion == PROTO_MAJOR_V3) { int len = htonl(5); pool_send_to_frontend((char *) &len, sizeof(len), false); pool_send_to_frontend((char *) "I", 1, true); } } if (processType == PT_CHILD) set_pg_frontend_blocking(true); frontend_error_recursion_depth--; } /* * process_log_prefix_padding --- helper function for processing the format * string in log_line_prefix * * Note: This function returns NULL if it finds something which * it deems invalid in the format string. */ static const char * process_log_prefix_padding(const char *p, int *ppadding) { int paddingsign = 1; int padding = 0; if (*p == '-') { p++; if (*p == '\0') /* Did the buf end in %- ? */ return NULL; paddingsign = -1; } /* generate an int version of the numerical string */ while (*p >= '0' && *p <= '9') padding = padding * 10 + (*p++ - '0'); /* format is invalid if it ends with the padding number */ if (*p == '\0') return NULL; padding *= paddingsign; *ppadding = padding; return p; } /* * Format tag info for log lines; append to the provided buffer. */ static void log_line_prefix(StringInfo buf, const char *line_prefix, ErrorData *edata) { /* static counter for line numbers */ static long log_line_number = 0; /* has counter been reset in current process? */ static int log_my_pid = 0; int padding; const char *p; int MyProcPid = getpid(); POOL_CONNECTION *frontend = NULL; POOL_SESSION_CONTEXT *session = pool_get_session_context(true); if (session) frontend = session->frontend; /* * This is one of the few places where we'd rather not inherit a static * variable's value from the postmaster. But since we will, reset it when * MyProcPid changes. MyStartTime also changes when MyProcPid does, so * reset the formatted start timestamp too. */ if (log_my_pid != MyProcPid) { log_line_number = 0; log_my_pid = MyProcPid; } log_line_number++; if (line_prefix == NULL) return; /* in case guc hasn't run yet */ for (p = line_prefix; *p != '\0'; p++) { if (*p != '%') { /* literal char, just copy */ appendStringInfoChar(buf, *p); continue; } /* must be a '%', so skip to the next char */ p++; if (*p == '\0') break; /* format error - ignore it */ else if (*p == '%') { /* string contains %% */ appendStringInfoChar(buf, '%'); continue; } /* * Process any formatting which may exist after the '%'. Note that * process_log_prefix_padding moves p past the padding number if it * exists. * * Note: Since only '-', '0' to '9' are valid formatting characters we * can do a quick check here to pre-check for formatting. If the char * is not formatting then we can skip a useless function call. * * Further note: At least on some platforms, passing %*s rather than * %s to appendStringInfo() is substantially slower, so many of the * cases below avoid doing that unless non-zero padding is in fact * specified. */ if (*p > '9') padding = 0; else if ((p = process_log_prefix_padding(p, &padding)) == NULL) break; /* process the option */ switch (*p) { case 'a': /* application name */ { /* * Do not use MASTER_CONNECTION macro here since it calls * pool_virtual_master_db_node_id() which eventually calls * ereport() if operated in DEBUG mode. */ StartupPacket *sp = (session && session->backend && (session->backend->slots[REAL_MASTER_NODE_ID]))? \ (session->backend->slots[REAL_MASTER_NODE_ID])->sp: NULL; const char *appname = sp ? sp->application_name : "[No Connection]"; if (appname == NULL || *appname == '\0') appname = "[unknown]"; if (padding != 0) appendStringInfo(buf, "%*s", padding, appname); else appendStringInfoString(buf, appname); } break; case 'P': /* process name */ { if (padding != 0) appendStringInfo(buf, "%*s", padding, process_name()); else appendStringInfoString(buf, process_name()); } break; case 'u': { const char *username = frontend ? frontend->username : "[No Connection]"; if (username == NULL || *username == '\0') username = "[unknown]"; if (padding != 0) appendStringInfo(buf, "%*s", padding, username); else appendStringInfoString(buf, username); } break; case 'd': { const char *dbname = frontend ? frontend->database : "[No Connection]"; if (dbname == NULL || *dbname == '\0') dbname = "[unknown]"; if (padding != 0) appendStringInfo(buf, "%*s", padding, dbname); else appendStringInfoString(buf, dbname); } break; case 'p': if (padding != 0) appendStringInfo(buf, "%*d", padding, MyProcPid); else appendStringInfo(buf, "%d", MyProcPid); break; case 'l': if (padding != 0) appendStringInfo(buf, "%*ld", padding, log_line_number); else appendStringInfo(buf, "%ld", log_line_number); break; case 't': { char strbuf[129]; time_t now = time(NULL); strftime(strbuf, 128, "%Y-%m-%d %H:%M:%S", localtime(&now)); if (padding != 0) appendStringInfo(buf, "%*s", padding, strbuf); else appendStringInfoString(buf, strbuf); } break; default: /* format error - ignore it */ break; } } } /* * Write error report to server's log */ static void send_message_to_server_log(ErrorData *edata) { StringInfoData buf; initStringInfo(&buf); log_line_prefix(&buf, pool_config->log_line_prefix, edata); appendStringInfo(&buf, "%s: ", error_severity(edata->elevel, false)); if (edata->message) append_with_tabs(&buf, edata->message); else append_with_tabs(&buf, _("missing error text")); if (edata->cursorpos > 0) appendStringInfo(&buf, _(" at character %d"), edata->cursorpos); else if (edata->internalpos > 0) appendStringInfo(&buf, _(" at character %d"), edata->internalpos); appendStringInfoChar(&buf, '\n'); if (pool_config->log_error_verbosity >= PGERROR_DEFAULT) { if (edata->detail_log) { log_line_prefix(&buf, pool_config->log_line_prefix, edata); appendStringInfoString(&buf, _("DETAIL: ")); append_with_tabs(&buf, edata->detail_log); appendStringInfoChar(&buf, '\n'); } else if (edata->detail) { log_line_prefix(&buf, pool_config->log_line_prefix, edata); appendStringInfoString(&buf, _("DETAIL: ")); append_with_tabs(&buf, edata->detail); appendStringInfoChar(&buf, '\n'); } if (edata->hint) { log_line_prefix(&buf, pool_config->log_line_prefix, edata); appendStringInfoString(&buf, _("HINT: ")); append_with_tabs(&buf, edata->hint); appendStringInfoChar(&buf, '\n'); } if (edata->internalquery) { log_line_prefix(&buf, pool_config->log_line_prefix, edata); appendStringInfoString(&buf, _("QUERY: ")); append_with_tabs(&buf, edata->internalquery); appendStringInfoChar(&buf, '\n'); } if (edata->context) { log_line_prefix(&buf, pool_config->log_line_prefix, edata); appendStringInfoString(&buf, _("CONTEXT: ")); append_with_tabs(&buf, edata->context); appendStringInfoChar(&buf, '\n'); } if (pool_config->log_error_verbosity >= PGERROR_VERBOSE) { /* assume no newlines in funcname or filename... */ if (edata->funcname && edata->filename) { log_line_prefix(&buf, pool_config->log_line_prefix, edata); appendStringInfo(&buf, _("LOCATION: %s, %s:%d\n"), edata->funcname, edata->filename, edata->lineno); } else if (edata->filename) { log_line_prefix(&buf, pool_config->log_line_prefix, edata); appendStringInfo(&buf, _("LOCATION: %s:%d\n"), edata->filename, edata->lineno); } } } #ifdef HAVE_SYSLOG /* Write to syslog, if enabled */ if (pool_config->log_destination & LOG_DESTINATION_SYSLOG) { int syslog_level; switch (edata->elevel) { case DEBUG5: case DEBUG4: case DEBUG3: case DEBUG2: case DEBUG1: syslog_level = LOG_DEBUG; break; case LOG: case COMMERROR: case INFO: syslog_level = LOG_INFO; break; case NOTICE: case WARNING: syslog_level = LOG_NOTICE; break; case ERROR: case FRONTEND_ONLY_ERROR: syslog_level = LOG_WARNING; break; case FATAL: syslog_level = LOG_ERR; break; case PANIC: default: syslog_level = LOG_CRIT; break; } write_syslog(syslog_level, buf.data); } #endif /* HAVE_SYSLOG */ if (pool_config->log_destination & LOG_DESTINATION_STDERR) { write_console(buf.data, buf.len); } pfree(buf.data); } /* * expand_fmt_string --- process special format codes in a format string * * We must replace %m with the appropriate strerror string, since vsnprintf * won't know what to do with it. * * The result is a palloc'd string. */ static char * expand_fmt_string(const char *fmt, ErrorData *edata) { StringInfoData buf; const char *cp; initStringInfo(&buf); for (cp = fmt; *cp; cp++) { if (cp[0] == '%' && cp[1] != '\0') { cp++; if (*cp == 'm') { /* * Replace %m by system error string. If there are any %'s in * the string, we'd better double them so that vsnprintf won't * misinterpret. */ const char *cp2; cp2 = useful_strerror(edata->saved_errno); for (; *cp2; cp2++) { if (*cp2 == '%') appendStringInfoCharMacro(&buf, '%'); appendStringInfoCharMacro(&buf, *cp2); } } else { /* copy % and next char --- this avoids trouble with %%m */ appendStringInfoCharMacro(&buf, '%'); appendStringInfoCharMacro(&buf, *cp); } } else appendStringInfoCharMacro(&buf, *cp); } return buf.data; } /* * A slightly cleaned-up version of strerror() */ static const char * useful_strerror(int errnum) { /* this buffer is only used if errno has a bogus value */ static char errorstr_buf[48]; const char *str; #ifdef WIN32 /* Winsock error code range, per WinError.h */ if (errnum >= 10000 && errnum <= 11999) return pgwin32_socket_strerror(errnum); #endif str = strerror(errnum); /* * Some strerror()s return an empty string for out-of-range errno. This is * ANSI C spec compliant, but not exactly useful. */ if (str == NULL || *str == '\0') { snprintf(errorstr_buf, sizeof(errorstr_buf), /*------ translator: This string will be truncated at 47 characters expanded. */ _("operating system error %d"), errnum); str = errorstr_buf; } return str; } /* * error_severity --- get localized string representing elevel */ static const char * error_severity(int elevel, bool for_frontend) { 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 FRONTEND_ONLY_ERROR: if (for_frontend == false) prefix = _("FRONTEND_ERROR"); else prefix = _("ERROR"); break; case ERROR: prefix = _("ERROR"); break; case FATAL: prefix = _("FATAL"); break; case PANIC: prefix = _("PANIC"); break; default: prefix = "???"; break; } return prefix; } /* * append_with_tabs * * Append the string to the StringInfo buffer, inserting a tab after any * newline. */ static void append_with_tabs(StringInfo buf, const char *str) { char ch; while ((ch = *str++) != '\0') { appendStringInfoCharMacro(buf, ch); if (ch == '\n') appendStringInfoCharMacro(buf, '\t'); } } /* * process_name --- get process name string of current process */ static const char * process_name(void) { const char *prefix; switch (processType) { case PT_CHILD: prefix = _("CHILD"); break; case PT_MAIN: prefix = _("MAIN"); break; case PT_WORKER: prefix = _("WORKER"); break; case PT_PCP: prefix = _("PCP CHILD"); break; case PT_PCP_WORKER: prefix = _("PCP WORKER"); break; case PT_HB_SENDER: prefix = _("WD HB SENDER"); break; case PT_HB_RECEIVER: prefix = _("WD HB RECEIVER"); break; case PT_WATCHDOG: prefix = _("WATCHDOG"); break; case PT_LIFECHECK: prefix = _("LIFECHECK"); break; case PT_WATCHDOG_UTILITY: prefix = _("WD UTILITY"); break; case PT_FOLLOWCHILD: prefix = _("UTILITY"); break; default: prefix = ""; break; } return prefix; } /* * Write errors to stderr (or by equal means when stderr is * not available). Used before ereport/elog can be used * safely (memory context, GUC load etc) */ void write_stderr(const char *fmt,...) { va_list ap; #ifdef WIN32 char errbuf[2048]; /* Arbitrary size? */ #endif fmt = _(fmt); va_start(ap, fmt); #ifndef WIN32 /* On Unix, we just fprintf to stderr */ vfprintf(stderr, fmt, ap); fflush(stderr); #else vsnprintf(errbuf, sizeof(errbuf), fmt, ap); /* * On Win32, we print to stderr if running on a console, or write to * eventlog if running as a service */ if (pgwin32_is_service()) /* Running as a service */ { write_eventlog(ERROR, errbuf, strlen(errbuf)); } else { /* Not running as service, write to stderr */ write_console(errbuf, strlen(errbuf)); fflush(stderr); } #endif va_end(ap); } /* * is_log_level_output -- is elevel logically >= log_min_level? * * We use this for tests that should consider LOG to sort out-of-order, * between ERROR and FATAL. Generally this is the right thing for testing * whether a message should go to the pgpool log, whereas a simple >= * test is correct for testing whether the message should go to the client. */ static bool is_log_level_output(int elevel, int log_min_level) { if (elevel == LOG || elevel == COMMERROR || elevel == FRONTEND_ONLY_ERROR) { if (log_min_level == LOG || log_min_level <= ERROR) return true; } else if (log_min_level == LOG) { /* elevel != LOG */ if (elevel >= FATAL) return true; } /* Neither is LOG */ else if (elevel >= log_min_level) return true; return false; } /* error cleanup routines */ /* ---------------------------------------------------------------- * proc_exit * * this function calls all the callbacks registered * for it (to free resources) and then calls exit. * * This should be the only function to call exit(). * -cim 2/6/90 * * Unfortunately, we can't really guarantee that add-on code * obeys the rule of not calling exit() directly. So, while * this is the preferred way out of the system, we also register * an atexit callback that will make sure cleanup happens. * ---------------------------------------------------------------- */ void proc_exit(int code) { /* Clean up everything that must be cleaned up */ proc_exit_prepare(code); elog(DEBUG3, "exit(%d)", code); exit(code); } /* * Code shared between proc_exit and the atexit handler. Note that in * normal exit through proc_exit, this will actually be called twice ... * but the second call will have nothing to do. */ static void proc_exit_prepare(int code) { /* * Once we set this flag, we are committed to exit. Any ereport() will * NOT send control back to the main loop, but right back here. */ proc_exit_inprogress = true; /* * Forget any pending cancel or die requests; we're doing our best to * close up shop already. Note that the signal handlers will not set * these flags again, now that proc_exit_inprogress is set. */ /* * Also clear the error context stack, to prevent error callbacks from * being invoked by any elog/ereport calls made during proc_exit. Whatever * context they might want to offer is probably not relevant, and in any * case they are likely to fail outright after we've done things like * aborting any open transaction. (In normal exit scenarios the context * stack should be empty anyway, but it might not be in the case of * elog(FATAL) for example.) */ error_context_stack = NULL; /* * call on exit prepare if some function is specified this extention is * added by pgpool */ if (on_exit_prepare.function) { (*on_exit_prepare.function) (code, on_exit_prepare.arg); on_exit_prepare.function = NULL; } /* do our shared memory exits first */ shmem_exit(code); elog(DEBUG3, "proc_exit(%d): %d callbacks to make", code, on_proc_exit_index); /* * call all the registered callbacks. * * Note that since we decrement on_proc_exit_index each time, if a * callback calls ereport(ERROR) or ereport(FATAL) then it won't be * invoked again when control comes back here (nor will the * previously-completed callbacks). So, an infinite loop should not be * possible. */ while (--on_proc_exit_index >= 0) (*on_proc_exit_list[on_proc_exit_index].function) (code, on_proc_exit_list[on_proc_exit_index].arg); on_proc_exit_index = 0; } /* ------------------ * Run all of the on_shmem_exit routines --- but don't actually exit. * This is used by the postmaster to re-initialize shared memory and * semaphores after a backend dies horribly. * ------------------ */ void shmem_exit(int code) { elog(DEBUG3, "shmem_exit(%d): %d callbacks to make", code, on_shmem_exit_index); /* * call all the registered callbacks. * * As with proc_exit(), we remove each callback from the list before * calling it, to avoid infinite loop in case of error. */ while (--on_shmem_exit_index >= 0) (*on_shmem_exit_list[on_shmem_exit_index].function) (code, on_shmem_exit_list[on_shmem_exit_index].arg); on_shmem_exit_index = 0; } /* ---------------------------------------------------------------- * atexit_callback * * Backstop to ensure that direct calls of exit() don't mess us up. * * Somebody who was being really uncooperative could call _exit(), * but for that case we have a "dead man switch" that will make the * postmaster treat it as a crash --- see pmsignal.c. * ---------------------------------------------------------------- */ static void atexit_callback(void) { /* Clean up everything that must be cleaned up */ /* ... too bad we don't know the real exit code ... */ proc_exit_prepare(-1); } /* ---------------------------------------------------------------- * on_proc_exit * * this function adds a callback function to the list of * functions invoked by proc_exit(). -cim 2/6/90 * ---------------------------------------------------------------- */ void on_proc_exit(pg_on_exit_callback function, Datum arg) { if (on_proc_exit_index >= MAX_ON_EXITS) ereport(FATAL, (errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg_internal("out of on_proc_exit slots"))); on_proc_exit_list[on_proc_exit_index].function = function; on_proc_exit_list[on_proc_exit_index].arg = arg; ++on_proc_exit_index; if (!atexit_callback_setup) { atexit(atexit_callback); atexit_callback_setup = true; } } /* ---------------------------------------------------------------- * on_shmem_exit * * this function adds a callback function to the list of * functions invoked by shmem_exit(). -cim 2/6/90 * ---------------------------------------------------------------- */ void on_shmem_exit(pg_on_exit_callback function, Datum arg) { if (on_shmem_exit_index >= MAX_ON_EXITS) ereport(FATAL, (errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg_internal("out of on_shmem_exit slots"))); on_shmem_exit_list[on_shmem_exit_index].function = function; on_shmem_exit_list[on_shmem_exit_index].arg = arg; ++on_shmem_exit_index; if (!atexit_callback_setup) { atexit(atexit_callback); atexit_callback_setup = true; } } /* ---------------------------------------------------------------- * on_system_exit * * this function adds a callback function which is invoked * just before calling shmem_exit callbacks at process exit * ---------------------------------------------------------------- */ void on_system_exit(pg_on_exit_callback function, Datum arg) { on_exit_prepare.function = function; on_exit_prepare.arg = arg; } /* ---------------------------------------------------------------- * cancel_shmem_exit * * this function removes an entry, if present, from the list of * functions to be invoked by shmem_exit(). For simplicity, * only the latest entry can be removed. (We could work harder * but there is no need for current uses.) * ---------------------------------------------------------------- */ void cancel_shmem_exit(pg_on_exit_callback function, Datum arg) { if (on_shmem_exit_index > 0 && on_shmem_exit_list[on_shmem_exit_index - 1].function == function && on_shmem_exit_list[on_shmem_exit_index - 1].arg == arg) --on_shmem_exit_index; } /* ---------------------------------------------------------------- * on_exit_reset * * this function clears all on_proc_exit() and on_shmem_exit() * registered functions. This is used just after forking a backend, * so that the backend doesn't believe it should call the postmaster's * on-exit routines when it exits... * ---------------------------------------------------------------- */ void on_exit_reset(void) { on_shmem_exit_index = 0; on_proc_exit_index = 0; on_exit_prepare.function = NULL; on_exit_prepare.arg = (Datum) NULL; } pgpool-II-4.1.4/src/utils/error/assert.c0000664000175000017500000000237313730350075014777 00000000000000/*------------------------------------------------------------------------- * * assert.c * Assert code. * * Portions Copyright (c) 1996-2013, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * * IDENTIFICATION * src/backend/utils/error/assert.c * * NOTE * This should eventually work with elog() * *------------------------------------------------------------------------- */ #include "utils/elog.h" #include /* * ExceptionalCondition - Handles the failure of an Assert() */ void ExceptionalCondition(const char *conditionName, const char *errorType, const char *fileName, int lineNumber) { if (!PointerIsValid(conditionName) || !PointerIsValid(fileName) || !PointerIsValid(errorType)) write_stderr("TRAP: ExceptionalCondition: bad arguments\n"); else { write_stderr("TRAP: %s(\"%s\", File: \"%s\", Line: %d)\n", errorType, conditionName, fileName, lineNumber); } /* Usually this shouldn't be needed, but make sure the msg went out */ fflush(stderr); #ifdef SLEEP_ON_ASSERT /* * It would be nice to use pg_usleep() here, but only does 2000 sec or 33 * minutes, which seems too short. */ sleep(1000000); #endif abort(); } pgpool-II-4.1.4/src/utils/mmgr/0000775000175000017500000000000013730350746013223 500000000000000pgpool-II-4.1.4/src/utils/mmgr/mcxt.c0000664000175000017500000007514713730350075014273 00000000000000/*------------------------------------------------------------------------- * * mcxt.c * POSTGRES memory context management code. * * This module handles context management operations that are independent * of the particular kind of context being operated on. It calls * context-type-specific operations via the function pointers in a * context's MemoryContextMethods struct. * * * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * * IDENTIFICATION * src/backend/utils/mmgr/mcxt.c * *------------------------------------------------------------------------- */ #include #include #include "pool_type.h" #include "utils/palloc.h" #include "utils/memutils.h" #include "utils/memdebug.h" #include "utils/memutils.h" #include "utils/elog.h" /***************************************************************************** * GLOBAL MEMORY * *****************************************************************************/ /* * CurrentMemoryContext * Default memory context for allocations. */ MemoryContext CurrentMemoryContext = NULL; /* * Standard top-level contexts. For a description of the purpose of each * of these contexts, refer to src/backend/utils/mmgr/README */ MemoryContext TopMemoryContext = NULL; MemoryContext ErrorContext = NULL; MemoryContext ProcessLoopContext = NULL; /* This context resets at every * main loop iteration of a * process */ MemoryContext CacheMemoryContext = NULL; MemoryContext MessageContext = NULL; MemoryContext QueryContext = NULL; static void MemoryContextCallResetCallbacks(MemoryContext context); static void MemoryContextStatsInternal(MemoryContext context, int level, bool print, int max_children, MemoryContextCounters *totals); /* * You should not do memory allocations within a critical section, because * an out-of-memory error will be escalated to a PANIC. To enforce that * rule, the allocation functions Assert that. */ #define AssertNotInCriticalSection(context) \ Assert(CritSectionCount == 0 || (context)->allowInCritSection) /***************************************************************************** * EXPORTED ROUTINES * *****************************************************************************/ /* * MemoryContextInit * Start up the memory-context subsystem. * * This must be called before creating contexts or allocating memory in * contexts. TopMemoryContext and ErrorContext are initialized here; * other contexts must be created afterwards. * * In normal multi-backend operation, this is called once during * postmaster startup, and not at all by individual backend startup * (since the backends inherit an already-initialized context subsystem * by virtue of being forked off the postmaster). But in an EXEC_BACKEND * build, each process must do this for itself. * * In a standalone backend this must be called during backend startup. */ void MemoryContextInit(void) { AssertState(TopMemoryContext == NULL); /* * First, initialize TopMemoryContext, which will hold the MemoryContext * nodes for all other contexts. (There is special-case code in * MemoryContextCreate() to handle this call.) */ TopMemoryContext = AllocSetContextCreate((MemoryContext) NULL, "TopMemoryContext", ALLOCSET_DEFAULT_SIZES); /* * Not having any other place to point CurrentMemoryContext, make it point * to TopMemoryContext. Caller should change this soon! */ CurrentMemoryContext = TopMemoryContext; /* * Initialize ErrorContext as an AllocSetContext with slow growth rate --- * we don't really expect much to be allocated in it. More to the point, * require it to contain at least 8K at all times. This is the only case * where retained memory in a context is *essential* --- we want to be * sure ErrorContext still has some memory even if we've run out * elsewhere! Also, allow allocations in ErrorContext within a critical * section. Otherwise a PANIC will cause an assertion failure in the error * reporting code, before printing out the real cause of the failure. * * This should be the last step in this function, as elog.c assumes memory * management works once ErrorContext is non-null. */ ErrorContext = AllocSetContextCreate(TopMemoryContext, "ErrorContext", 8 * 1024, 8 * 1024, 8 * 1024); MemoryContextAllowInCriticalSection(ErrorContext, true); } /* * MemoryContextReset * Release all space allocated within a context and delete all its * descendant contexts (but not the named context itself). */ void MemoryContextReset(MemoryContext context) { AssertArg(MemoryContextIsValid(context)); /* save a function call in common case where there are no children */ if (context->firstchild != NULL) MemoryContextDeleteChildren(context); /* save a function call if no pallocs since startup or last reset */ if (!context->isReset) MemoryContextResetOnly(context); } /* * MemoryContextResetOnly * Release all space allocated within a context. * Nothing is done to the context's descendant contexts. */ void MemoryContextResetOnly(MemoryContext context) { AssertArg(MemoryContextIsValid(context)); /* Nothing to do if no pallocs since startup or last reset */ if (!context->isReset) { MemoryContextCallResetCallbacks(context); (*context->methods->reset) (context); context->isReset = true; VALGRIND_DESTROY_MEMPOOL(context); VALGRIND_CREATE_MEMPOOL(context, 0, false); } } /* * MemoryContextResetChildren * Release all space allocated within a context's descendants, * but don't delete the contexts themselves. The named context * itself is not touched. */ void MemoryContextResetChildren(MemoryContext context) { MemoryContext child; AssertArg(MemoryContextIsValid(context)); for (child = context->firstchild; child != NULL; child = child->nextchild) { MemoryContextResetChildren(child); MemoryContextResetOnly(child); } } /* * MemoryContextDelete * Delete a context and its descendants, and release all space * allocated therein. * * The type-specific delete routine removes all subsidiary storage * for the context, but we have to delete the context node itself, * as well as recurse to get the children. We must also delink the * node from its parent, if it has one. */ void MemoryContextDelete(MemoryContext context) { AssertArg(MemoryContextIsValid(context)); /* We had better not be deleting TopMemoryContext ... */ Assert(context != TopMemoryContext); /* And not CurrentMemoryContext, either */ Assert(context != CurrentMemoryContext); MemoryContextDeleteChildren(context); /* * It's not entirely clear whether 'tis better to do this before or after * delinking the context; but an error in a callback will likely result in * leaking the whole context (if it's not a root context) if we do it * after, so let's do it before. */ MemoryContextCallResetCallbacks(context); /* * We delink the context from its parent before deleting it, so that if * there's an error we won't have deleted/busted contexts still attached * to the context tree. Better a leak than a crash. */ MemoryContextSetParent(context, NULL); (*context->methods->delete_context) (context); VALGRIND_DESTROY_MEMPOOL(context); pfree(context); } /* * MemoryContextDeleteChildren * Delete all the descendants of the named context and release all * space allocated therein. The named context itself is not touched. */ void MemoryContextDeleteChildren(MemoryContext context) { AssertArg(MemoryContextIsValid(context)); /* * MemoryContextDelete will delink the child from me, so just iterate as * long as there is a child. */ while (context->firstchild != NULL) MemoryContextDelete(context->firstchild); } /* * MemoryContextRegisterResetCallback * Register a function to be called before next context reset/delete. * Such callbacks will be called in reverse order of registration. * * The caller is responsible for allocating a MemoryContextCallback struct * to hold the info about this callback request, and for filling in the * "func" and "arg" fields in the struct to show what function to call with * what argument. Typically the callback struct should be allocated within * the specified context, since that means it will automatically be freed * when no longer needed. * * There is no API for deregistering a callback once registered. If you * want it to not do anything anymore, adjust the state pointed to by its * "arg" to indicate that. */ void MemoryContextRegisterResetCallback(MemoryContext context, MemoryContextCallback *cb) { AssertArg(MemoryContextIsValid(context)); /* Push onto head so this will be called before older registrants. */ cb->next = context->reset_cbs; context->reset_cbs = cb; /* Mark the context as non-reset (it probably is already). */ context->isReset = false; } /* * MemoryContextCallResetCallbacks * Internal function to call all registered callbacks for context. */ static void MemoryContextCallResetCallbacks(MemoryContext context) { MemoryContextCallback *cb; /* * We pop each callback from the list before calling. That way, if an * error occurs inside the callback, we won't try to call it a second time * in the likely event that we reset or delete the context later. */ while ((cb = context->reset_cbs) != NULL) { context->reset_cbs = cb->next; (*cb->func) (cb->arg); } } /* * MemoryContextSetParent * Change a context to belong to a new parent (or no parent). * * We provide this as an API function because it is sometimes useful to * change a context's lifespan after creation. For example, a context * might be created underneath a transient context, filled with data, * and then reparented underneath CacheMemoryContext to make it long-lived. * In this way no special effort is needed to get rid of the context in case * a failure occurs before its contents are completely set up. * * Callers often assume that this function cannot fail, so don't put any * elog(ERROR) calls in it. * * A possible caller error is to reparent a context under itself, creating * a loop in the context graph. We assert here that context != new_parent, * but checking for multi-level loops seems more trouble than it's worth. */ void MemoryContextSetParent(MemoryContext context, MemoryContext new_parent) { AssertArg(MemoryContextIsValid(context)); AssertArg(context != new_parent); /* Fast path if it's got correct parent already */ if (new_parent == context->parent) return; /* Delink from existing parent, if any */ if (context->parent) { MemoryContext parent = context->parent; if (context->prevchild != NULL) context->prevchild->nextchild = context->nextchild; else { Assert(parent->firstchild == context); parent->firstchild = context->nextchild; } if (context->nextchild != NULL) context->nextchild->prevchild = context->prevchild; } /* And relink */ if (new_parent) { AssertArg(MemoryContextIsValid(new_parent)); context->parent = new_parent; context->prevchild = NULL; context->nextchild = new_parent->firstchild; if (new_parent->firstchild != NULL) new_parent->firstchild->prevchild = context; new_parent->firstchild = context; } else { context->parent = NULL; context->prevchild = NULL; context->nextchild = NULL; } } /* * MemoryContextAllowInCriticalSection * Allow/disallow allocations in this memory context within a critical * section. * * Normally, memory allocations are not allowed within a critical section, * because a failure would lead to PANIC. There are a few exceptions to * that, like allocations related to debugging code that is not supposed to * be enabled in production. This function can be used to exempt specific * memory contexts from the assertion in palloc(). */ void MemoryContextAllowInCriticalSection(MemoryContext context, bool allow) { AssertArg(MemoryContextIsValid(context)); context->allowInCritSection = allow; } /* * GetMemoryChunkSpace * Given a currently-allocated chunk, determine the total space * it occupies (including all memory-allocation overhead). * * This is useful for measuring the total space occupied by a set of * allocated chunks. */ Size GetMemoryChunkSpace(void *pointer) { MemoryContext context = GetMemoryChunkContext(pointer); return (context->methods->get_chunk_space) (context, pointer); } /* * MemoryContextGetParent * Get the parent context (if any) of the specified context */ MemoryContext MemoryContextGetParent(MemoryContext context) { AssertArg(MemoryContextIsValid(context)); return context->parent; } /* * MemoryContextIsEmpty * Is a memory context empty of any allocated space? */ bool MemoryContextIsEmpty(MemoryContext context) { AssertArg(MemoryContextIsValid(context)); /* * For now, we consider a memory context nonempty if it has any children; * perhaps this should be changed later. */ if (context->firstchild != NULL) return false; /* Otherwise use the type-specific inquiry */ return (*context->methods->is_empty) (context); } /* * MemoryContextStats * Print statistics about the named context and all its descendants. * * This is just a debugging utility, so it's not very fancy. However, we do * make some effort to summarize when the output would otherwise be very long. * The statistics are sent to stderr. */ void MemoryContextStats(MemoryContext context) { /* A hard-wired limit on the number of children is usually good enough */ MemoryContextStatsDetail(context, 100); } /* * MemoryContextStatsDetail * * Entry point for use if you want to vary the number of child contexts shown. */ void MemoryContextStatsDetail(MemoryContext context, int max_children) { MemoryContextCounters grand_totals; memset(&grand_totals, 0, sizeof(grand_totals)); MemoryContextStatsInternal(context, 0, true, max_children, &grand_totals); fprintf(stderr, "Grand total: %zu bytes in %zd blocks; %zu free (%zd chunks); %zu used\n", grand_totals.totalspace, grand_totals.nblocks, grand_totals.freespace, grand_totals.freechunks, grand_totals.totalspace - grand_totals.freespace); } /* * MemoryContextStatsInternal * One recursion level for MemoryContextStats * * Print this context if print is true, but in any case accumulate counts into * *totals (if given). */ static void MemoryContextStatsInternal(MemoryContext context, int level, bool print, int max_children, MemoryContextCounters *totals) { MemoryContextCounters local_totals; MemoryContext child; int ichild; AssertArg(MemoryContextIsValid(context)); /* Examine the context itself */ (*context->methods->stats) (context, level, print, totals); /* * Examine children. If there are more than max_children of them, we do * not print the rest explicitly, but just summarize them. */ memset(&local_totals, 0, sizeof(local_totals)); for (child = context->firstchild, ichild = 0; child != NULL; child = child->nextchild, ichild++) { if (ichild < max_children) MemoryContextStatsInternal(child, level + 1, print, max_children, totals); else MemoryContextStatsInternal(child, level + 1, false, max_children, &local_totals); } /* Deal with excess children */ if (ichild > max_children) { if (print) { int i; for (i = 0; i <= level; i++) fprintf(stderr, " "); fprintf(stderr, "%d more child contexts containing %zu total in %zd blocks; %zu free (%zd chunks); %zu used\n", ichild - max_children, local_totals.totalspace, local_totals.nblocks, local_totals.freespace, local_totals.freechunks, local_totals.totalspace - local_totals.freespace); } if (totals) { totals->nblocks += local_totals.nblocks; totals->freechunks += local_totals.freechunks; totals->totalspace += local_totals.totalspace; totals->freespace += local_totals.freespace; } } } /* * MemoryContextCheck * Check all chunks in the named context. * * This is just a debugging utility, so it's not fancy. */ #ifdef MEMORY_CONTEXT_CHECKING void MemoryContextCheck(MemoryContext context) { MemoryContext child; AssertArg(MemoryContextIsValid(context)); (*context->methods->check) (context); for (child = context->firstchild; child != NULL; child = child->nextchild) MemoryContextCheck(child); } #endif /* * MemoryContextContains * Detect whether an allocated chunk of memory belongs to a given * context or not. * * Caution: this test is reliable as long as 'pointer' does point to * a chunk of memory allocated from *some* context. If 'pointer' points * at memory obtained in some other way, there is a small chance of a * false-positive result, since the bits right before it might look like * a valid chunk header by chance. */ bool MemoryContextContains(MemoryContext context, void *pointer) { MemoryContext ptr_context; /* * NB: Can't use GetMemoryChunkContext() here - that performs assertions * that aren't acceptable here since we might be passed memory not * allocated by any memory context. * * Try to detect bogus pointers handed to us, poorly though we can. * Presumably, a pointer that isn't MAXALIGNED isn't pointing at an * allocated chunk. */ if (pointer == NULL || pointer != (void *) MAXALIGN(pointer)) return false; /* * OK, it's probably safe to look at the context. */ ptr_context = *(MemoryContext *) (((char *) pointer) - sizeof(void *)); return ptr_context == context; } /*-------------------- * MemoryContextCreate * Context-type-independent part of context creation. * * This is only intended to be called by context-type-specific * context creation routines, not by the unwashed masses. * * The context creation procedure is a little bit tricky because * we want to be sure that we don't leave the context tree invalid * in case of failure (such as insufficient memory to allocate the * context node itself). The procedure goes like this: * 1. Context-type-specific routine first calls MemoryContextCreate(), * passing the appropriate tag/size/methods values (the methods * pointer will ordinarily point to statically allocated data). * The parent and name parameters usually come from the caller. * 2. MemoryContextCreate() attempts to allocate the context node, * plus space for the name. If this fails we can ereport() with no * damage done. * 3. We fill in all of the type-independent MemoryContext fields. * 4. We call the type-specific init routine (using the methods pointer). * The init routine is required to make the node minimally valid * with zero chance of failure --- it can't allocate more memory, * for example. * 5. Now we have a minimally valid node that can behave correctly * when told to reset or delete itself. We link the node to its * parent (if any), making the node part of the context tree. * 6. We return to the context-type-specific routine, which finishes * up type-specific initialization. This routine can now do things * that might fail (like allocate more memory), so long as it's * sure the node is left in a state that delete will handle. * * This protocol doesn't prevent us from leaking memory if step 6 fails * during creation of a top-level context, since there's no parent link * in that case. However, if you run out of memory while you're building * a top-level context, you might as well go home anyway... * * Normally, the context node and the name are allocated from * TopMemoryContext (NOT from the parent context, since the node must * survive resets of its parent context!). However, this routine is itself * used to create TopMemoryContext! If we see that TopMemoryContext is NULL, * we assume we are creating TopMemoryContext and use malloc() to allocate * the node. * * Note that the name field of a MemoryContext does not point to * separately-allocated storage, so it should not be freed at context * deletion. *-------------------- */ MemoryContext MemoryContextCreate(NodeTag tag, Size size, MemoryContextMethods *methods, MemoryContext parent, const char *name) { MemoryContext node; Size needed = size + strlen(name) + 1; /* creating new memory contexts is not allowed in a critical section */ Assert(CritSectionCount == 0); /* Get space for node and name */ if (TopMemoryContext != NULL) { /* Normal case: allocate the node in TopMemoryContext */ node = (MemoryContext) MemoryContextAlloc(TopMemoryContext, needed); } else { /* Special case for startup: use good ol' malloc */ node = (MemoryContext) malloc(needed); Assert(node != NULL); } /* Initialize the node as best we can */ MemSet(node, 0, size); node->type = tag; node->methods = methods; node->parent = NULL; /* for the moment */ node->firstchild = NULL; node->prevchild = NULL; node->nextchild = NULL; node->isReset = true; node->name = ((char *) node) + size; strcpy(node->name, name); /* Type-specific routine finishes any other essential initialization */ (*node->methods->init) (node); /* OK to link node to parent (if any) */ /* Could use MemoryContextSetParent here, but doesn't seem worthwhile */ if (parent) { node->parent = parent; node->nextchild = parent->firstchild; if (parent->firstchild != NULL) parent->firstchild->prevchild = node; parent->firstchild = node; /* inherit allowInCritSection flag from parent */ node->allowInCritSection = parent->allowInCritSection; } VALGRIND_CREATE_MEMPOOL(node, 0, false); /* Return to type-specific creation routine to finish up */ return node; } /* * MemoryContextAlloc * Allocate space within the specified context. * * This could be turned into a macro, but we'd have to import * nodes/memnodes.h into postgres.h which seems a bad idea. */ void * MemoryContextAlloc(MemoryContext context, Size size) { void *ret; AssertArg(MemoryContextIsValid(context)); AssertNotInCriticalSection(context); if (!AllocSizeIsValid(size)) elog(ERROR, "invalid memory alloc request size %zu", size); context->isReset = false; ret = (*context->methods->alloc) (context, size); if (ret == NULL) { MemoryContextStats(TopMemoryContext); ereport(ERROR, (errcode(ERRCODE_OUT_OF_MEMORY), errmsg("out of memory"), errdetail("Failed on request of size %zu.", size))); } VALGRIND_MEMPOOL_ALLOC(context, ret, size); return ret; } /* * MemoryContextAllocZero * Like MemoryContextAlloc, but clears allocated memory * * We could just call MemoryContextAlloc then clear the memory, but this * is a very common combination, so we provide the combined operation. */ void * MemoryContextAllocZero(MemoryContext context, Size size) { void *ret; AssertArg(MemoryContextIsValid(context)); AssertNotInCriticalSection(context); if (!AllocSizeIsValid(size)) elog(ERROR, "invalid memory alloc request size %zu", size); context->isReset = false; ret = (*context->methods->alloc) (context, size); if (ret == NULL) { MemoryContextStats(TopMemoryContext); ereport(ERROR, (errcode(ERRCODE_OUT_OF_MEMORY), errmsg("out of memory"), errdetail("Failed on request of size %zu.", size))); } VALGRIND_MEMPOOL_ALLOC(context, ret, size); MemSetAligned(ret, 0, size); return ret; } /* * MemoryContextAllocZeroAligned * MemoryContextAllocZero where length is suitable for MemSetLoop * * This might seem overly specialized, but it's not because newNode() * is so often called with compile-time-constant sizes. */ void * MemoryContextAllocZeroAligned(MemoryContext context, Size size) { void *ret; AssertArg(MemoryContextIsValid(context)); AssertNotInCriticalSection(context); if (!AllocSizeIsValid(size)) elog(ERROR, "invalid memory alloc request size %zu", size); context->isReset = false; ret = (*context->methods->alloc) (context, size); if (ret == NULL) { MemoryContextStats(TopMemoryContext); ereport(ERROR, (errcode(ERRCODE_OUT_OF_MEMORY), errmsg("out of memory"), errdetail("Failed on request of size %zu.", size))); } VALGRIND_MEMPOOL_ALLOC(context, ret, size); MemSetLoop(ret, 0, size); return ret; } /* * MemoryContextAllocExtended * Allocate space within the specified context using the given flags. */ void * MemoryContextAllocExtended(MemoryContext context, Size size, int flags) { void *ret; AssertArg(MemoryContextIsValid(context)); AssertNotInCriticalSection(context); if (((flags & MCXT_ALLOC_HUGE) != 0 && !AllocHugeSizeIsValid(size)) || ((flags & MCXT_ALLOC_HUGE) == 0 && !AllocSizeIsValid(size))) elog(ERROR, "invalid memory alloc request size %zu", size); context->isReset = false; ret = (*context->methods->alloc) (context, size); if (ret == NULL) { if ((flags & MCXT_ALLOC_NO_OOM) == 0) { MemoryContextStats(TopMemoryContext); ereport(ERROR, (errcode(ERRCODE_OUT_OF_MEMORY), errmsg("out of memory"), errdetail("Failed on request of size %zu.", size))); } return NULL; } VALGRIND_MEMPOOL_ALLOC(context, ret, size); if ((flags & MCXT_ALLOC_ZERO) != 0) MemSetAligned(ret, 0, size); return ret; } void * palloc(Size size) { /* duplicates MemoryContextAlloc to avoid increased overhead */ void *ret; AssertArg(MemoryContextIsValid(CurrentMemoryContext)); AssertNotInCriticalSection(CurrentMemoryContext); if (!AllocSizeIsValid(size)) elog(ERROR, "invalid memory alloc request size %zu", size); CurrentMemoryContext->isReset = false; ret = (*CurrentMemoryContext->methods->alloc) (CurrentMemoryContext, size); if (ret == NULL) { MemoryContextStats(TopMemoryContext); ereport(ERROR, (errcode(ERRCODE_OUT_OF_MEMORY), errmsg("out of memory"), errdetail("Failed on request of size %zu.", size))); } VALGRIND_MEMPOOL_ALLOC(CurrentMemoryContext, ret, size); return ret; } void * palloc0(Size size) { /* duplicates MemoryContextAllocZero to avoid increased overhead */ void *ret; AssertArg(MemoryContextIsValid(CurrentMemoryContext)); AssertNotInCriticalSection(CurrentMemoryContext); if (!AllocSizeIsValid(size)) elog(ERROR, "invalid memory alloc request size %zu", size); CurrentMemoryContext->isReset = false; ret = (*CurrentMemoryContext->methods->alloc) (CurrentMemoryContext, size); if (ret == NULL) { MemoryContextStats(TopMemoryContext); ereport(ERROR, (errcode(ERRCODE_OUT_OF_MEMORY), errmsg("out of memory"), errdetail("Failed on request of size %zu.", size))); } VALGRIND_MEMPOOL_ALLOC(CurrentMemoryContext, ret, size); MemSetAligned(ret, 0, size); return ret; } void * palloc_extended(Size size, int flags) { /* duplicates MemoryContextAllocExtended to avoid increased overhead */ void *ret; AssertArg(MemoryContextIsValid(CurrentMemoryContext)); AssertNotInCriticalSection(CurrentMemoryContext); if (((flags & MCXT_ALLOC_HUGE) != 0 && !AllocHugeSizeIsValid(size)) || ((flags & MCXT_ALLOC_HUGE) == 0 && !AllocSizeIsValid(size))) elog(ERROR, "invalid memory alloc request size %zu", size); CurrentMemoryContext->isReset = false; ret = (*CurrentMemoryContext->methods->alloc) (CurrentMemoryContext, size); if (ret == NULL) { if ((flags & MCXT_ALLOC_NO_OOM) == 0) { MemoryContextStats(TopMemoryContext); ereport(ERROR, (errcode(ERRCODE_OUT_OF_MEMORY), errmsg("out of memory"), errdetail("Failed on request of size %zu.", size))); } return NULL; } VALGRIND_MEMPOOL_ALLOC(CurrentMemoryContext, ret, size); if ((flags & MCXT_ALLOC_ZERO) != 0) MemSetAligned(ret, 0, size); return ret; } /* * pfree * Release an allocated chunk. */ void pfree(void *pointer) { MemoryContext context = GetMemoryChunkContext(pointer); (*context->methods->free_p) (context, pointer); VALGRIND_MEMPOOL_FREE(context, pointer); } /* * repalloc * Adjust the size of a previously allocated chunk. */ void * repalloc(void *pointer, Size size) { MemoryContext context; void *ret; if (!AllocSizeIsValid(size)) elog(ERROR, "invalid memory alloc request size %zu", size); /* pgpool hack by Muhammad Usama */ if (pointer == NULL) return palloc(size); context = GetMemoryChunkContext(pointer); AssertNotInCriticalSection(context); /* isReset must be false already */ Assert(!context->isReset); ret = (*context->methods->realloc) (context, pointer, size); if (ret == NULL) { MemoryContextStats(TopMemoryContext); ereport(ERROR, (errcode(ERRCODE_OUT_OF_MEMORY), errmsg("out of memory"), errdetail("Failed on request of size %zu.", size))); } VALGRIND_MEMPOOL_CHANGE(context, pointer, ret, size); return ret; } /* * MemoryContextAllocHuge * Allocate (possibly-expansive) space within the specified context. * * See considerations in comment at MaxAllocHugeSize. */ void * MemoryContextAllocHuge(MemoryContext context, Size size) { void *ret; AssertArg(MemoryContextIsValid(context)); AssertNotInCriticalSection(context); if (!AllocHugeSizeIsValid(size)) elog(ERROR, "invalid memory alloc request size %zu", size); context->isReset = false; ret = (*context->methods->alloc) (context, size); if (ret == NULL) { MemoryContextStats(TopMemoryContext); ereport(ERROR, (errcode(ERRCODE_OUT_OF_MEMORY), errmsg("out of memory"), errdetail("Failed on request of size %zu.", size))); } VALGRIND_MEMPOOL_ALLOC(context, ret, size); return ret; } /* * repalloc_huge * Adjust the size of a previously allocated chunk, permitting a large * value. The previous allocation need not have been "huge". */ void * repalloc_huge(void *pointer, Size size) { MemoryContext context = GetMemoryChunkContext(pointer); void *ret; if (!AllocHugeSizeIsValid(size)) elog(ERROR, "invalid memory alloc request size %zu", size); AssertNotInCriticalSection(context); /* isReset must be false already */ Assert(!context->isReset); ret = (*context->methods->realloc) (context, pointer, size); if (ret == NULL) { MemoryContextStats(TopMemoryContext); ereport(ERROR, (errcode(ERRCODE_OUT_OF_MEMORY), errmsg("out of memory"), errdetail("Failed on request of size %zu.", size))); } VALGRIND_MEMPOOL_CHANGE(context, pointer, ret, size); return ret; } /* * MemoryContextStrdup * Like strdup(), but allocate from the specified context */ char * MemoryContextStrdup(MemoryContext context, const char *string) { char *nstr; Size len = strlen(string) + 1; nstr = (char *) MemoryContextAlloc(context, len); memcpy(nstr, string, len); return nstr; } char * pstrdup(const char *in) { return MemoryContextStrdup(CurrentMemoryContext, in); } /* * pnstrdup * Like pstrdup(), but append null byte to a * not-necessarily-null-terminated input string. */ char * pnstrdup(const char *in, Size len) { char *out = palloc(len + 1); memcpy(out, in, len); out[len] = '\0'; return out; } /* * Make copy of string with all trailing newline characters removed. */ char * pchomp(const char *in) { size_t n; n = strlen(in); while (n > 0 && in[n - 1] == '\n') n--; return pnstrdup(in, n); } pgpool-II-4.1.4/src/utils/mmgr/aset.c0000664000175000017500000011644713730350075014253 00000000000000/*------------------------------------------------------------------------- * * aset.c * Allocation set definitions. * * AllocSet is our standard implementation of the abstract MemoryContext * type. * * * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * IDENTIFICATION * src/backend/utils/mmgr/aset.c * * NOTE: * This is a new (Feb. 05, 1999) implementation of the allocation set * routines. AllocSet...() does not use OrderedSet...() any more. * Instead it manages allocations in a block pool by itself, combining * many small allocations in a few bigger blocks. AllocSetFree() normally * doesn't free() memory really. It just add's the free'd area to some * list for later reuse by AllocSetAlloc(). All memory blocks are free()'d * at once on AllocSetReset(), which happens when the memory context gets * destroyed. * Jan Wieck * * Performance improvement from Tom Lane, 8/99: for extremely large request * sizes, we do want to be able to give the memory back to free() as soon * as it is pfree()'d. Otherwise we risk tying up a lot of memory in * freelist entries that might never be usable. This is specially needed * when the caller is repeatedly repalloc()'ing a block bigger and bigger; * the previous instances of the block were guaranteed to be wasted until * AllocSetReset() under the old way. * * Further improvement 12/00: as the code stood, request sizes in the * midrange between "small" and "large" were handled very inefficiently, * because any sufficiently large free chunk would be used to satisfy a * request, even if it was much larger than necessary. This led to more * and more wasted space in allocated chunks over time. To fix, get rid * of the midrange behavior: we now handle only "small" power-of-2-size * chunks as chunks. Anything "large" is passed off to malloc(). Change * the number of freelists to change the small/large boundary. * *------------------------------------------------------------------------- */ #include "pool_type.h" #include "utils/palloc.h" #include "utils/memdebug.h" #include "utils/memutils.h" #include "utils/elog.h" #include #include /* Define this to detail debug alloc information */ /* #define HAVE_ALLOCINFO */ /*-------------------- * Chunk freelist k holds chunks of size 1 << (k + ALLOC_MINBITS), * for k = 0 .. ALLOCSET_NUM_FREELISTS-1. * * Note that all chunks in the freelists have power-of-2 sizes. This * improves recyclability: we may waste some space, but the wasted space * should stay pretty constant as requests are made and released. * * A request too large for the last freelist is handled by allocating a * dedicated block from malloc(). The block still has a block header and * chunk header, but when the chunk is freed we'll return the whole block * to malloc(), not put it on our freelists. * * CAUTION: ALLOC_MINBITS must be large enough so that * 1< 4 && SIZEOF_VOID_P == 4 Size padding; #endif #endif /* MEMORY_CONTEXT_CHECKING */ /* aset is the owning aset if allocated, or the freelist link if free */ void *aset; /* there must not be any padding to reach a MAXALIGN boundary here! */ } AllocChunkData; /* * AllocPointerIsValid * True iff pointer is valid allocation pointer. */ #define AllocPointerIsValid(pointer) PointerIsValid(pointer) /* * AllocSetIsValid * True iff set is valid allocation set. */ #define AllocSetIsValid(set) PointerIsValid(set) #define AllocPointerGetChunk(ptr) \ ((AllocChunk)(((char *)(ptr)) - ALLOC_CHUNKHDRSZ)) #define AllocChunkGetPointer(chk) \ ((AllocPointer)(((char *)(chk)) + ALLOC_CHUNKHDRSZ)) /* * These functions implement the MemoryContext API for AllocSet contexts. */ static void *AllocSetAlloc(MemoryContext context, Size size); static void AllocSetFree(MemoryContext context, void *pointer); static void *AllocSetRealloc(MemoryContext context, void *pointer, Size size); static void AllocSetInit(MemoryContext context); static void AllocSetReset(MemoryContext context); static void AllocSetDelete(MemoryContext context); static Size AllocSetGetChunkSpace(MemoryContext context, void *pointer); static bool AllocSetIsEmpty(MemoryContext context); static void AllocSetStats(MemoryContext context, int level, bool print, MemoryContextCounters *totals); #ifdef MEMORY_CONTEXT_CHECKING static void AllocSetCheck(MemoryContext context); #endif /* * This is the virtual function table for AllocSet contexts. */ static MemoryContextMethods AllocSetMethods = { AllocSetAlloc, AllocSetFree, AllocSetRealloc, AllocSetInit, AllocSetReset, AllocSetDelete, AllocSetGetChunkSpace, AllocSetIsEmpty, AllocSetStats #ifdef MEMORY_CONTEXT_CHECKING ,AllocSetCheck #endif }; /* * Table for AllocSetFreeIndex */ #define LT16(n) n, n, n, n, n, n, n, n, n, n, n, n, n, n, n, n static const unsigned char LogTable256[256] = { 0, 1, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, LT16(5), LT16(6), LT16(6), LT16(7), LT16(7), LT16(7), LT16(7), LT16(8), LT16(8), LT16(8), LT16(8), LT16(8), LT16(8), LT16(8), LT16(8) }; /* ---------- * Debug macros * ---------- */ #ifdef HAVE_ALLOCINFO #define AllocFreeInfo(_cxt, _chunk) \ fprintf(stderr, "AllocFree: %s: %p, %zu\n", \ (_cxt)->header.name, (_chunk), (_chunk)->size) #define AllocAllocInfo(_cxt, _chunk) \ fprintf(stderr, "AllocAlloc: %s: %p, %zu\n", \ (_cxt)->header.name, (_chunk), (_chunk)->size) #else #define AllocFreeInfo(_cxt, _chunk) #define AllocAllocInfo(_cxt, _chunk) #endif /* ---------- * AllocSetFreeIndex - * * Depending on the size of an allocation compute which freechunk * list of the alloc set it belongs to. Caller must have verified * that size <= ALLOC_CHUNK_LIMIT. * ---------- */ static inline int AllocSetFreeIndex(Size size) { int idx; unsigned int t, tsize; if (size > (1 << ALLOC_MINBITS)) { tsize = (size - 1) >> ALLOC_MINBITS; /* * At this point we need to obtain log2(tsize)+1, ie, the number of * not-all-zero bits at the right. We used to do this with a * shift-and-count loop, but this function is enough of a hotspot to * justify micro-optimization effort. The best approach seems to be * to use a lookup table. Note that this code assumes that * ALLOCSET_NUM_FREELISTS <= 17, since we only cope with two bytes of * the tsize value. */ t = tsize >> 8; idx = t ? LogTable256[t] + 8 : LogTable256[tsize]; Assert(idx < ALLOCSET_NUM_FREELISTS); } else idx = 0; return idx; } /* * Public routines */ /* * AllocSetContextCreate * Create a new AllocSet context. * * parent: parent context, or NULL if top-level context * name: name of context (for debugging only, need not be unique) * minContextSize: minimum context size * initBlockSize: initial allocation block size * maxBlockSize: maximum allocation block size * * Notes: the name string will be copied into context-lifespan storage. * Most callers should abstract the context size parameters using a macro * such as ALLOCSET_DEFAULT_SIZES. */ MemoryContext AllocSetContextCreate(MemoryContext parent, const char *name, Size minContextSize, Size initBlockSize, Size maxBlockSize) { AllocSet set; StaticAssertStmt(offsetof(AllocChunkData, aset) + sizeof(MemoryContext) == MAXALIGN(sizeof(AllocChunkData)), "padding calculation in AllocChunkData is wrong"); /* * First, validate allocation parameters. (If we're going to throw an * error, we should do so before the context is created, not after.) We * somewhat arbitrarily enforce a minimum 1K block size. */ if (initBlockSize != MAXALIGN(initBlockSize) || initBlockSize < 1024) elog(ERROR, "invalid initBlockSize for memory context: %zu", initBlockSize); if (maxBlockSize != MAXALIGN(maxBlockSize) || maxBlockSize < initBlockSize || !AllocHugeSizeIsValid(maxBlockSize)) /* must be safe to double */ elog(ERROR, "invalid maxBlockSize for memory context: %zu", maxBlockSize); if (minContextSize != 0 && (minContextSize != MAXALIGN(minContextSize) || minContextSize <= ALLOC_BLOCKHDRSZ + ALLOC_CHUNKHDRSZ)) elog(ERROR, "invalid minContextSize for memory context: %zu", minContextSize); /* Do the type-independent part of context creation */ set = (AllocSet) MemoryContextCreate(T_AllocSetContext, sizeof(AllocSetContext), &AllocSetMethods, parent, name); /* Save allocation parameters */ set->initBlockSize = initBlockSize; set->maxBlockSize = maxBlockSize; set->nextBlockSize = initBlockSize; /* * Compute the allocation chunk size limit for this context. It can't be * more than ALLOC_CHUNK_LIMIT because of the fixed number of freelists. * If maxBlockSize is small then requests exceeding the maxBlockSize, or * even a significant fraction of it, should be treated as large chunks * too. For the typical case of maxBlockSize a power of 2, the chunk size * limit will be at most 1/8th maxBlockSize, so that given a stream of * requests that are all the maximum chunk size we will waste at most * 1/8th of the allocated space. * * We have to have allocChunkLimit a power of two, because the requested * and actually-allocated sizes of any chunk must be on the same side of * the limit, else we get confused about whether the chunk is "big". * * Also, allocChunkLimit must not exceed ALLOCSET_SEPARATE_THRESHOLD. */ StaticAssertStmt(ALLOC_CHUNK_LIMIT == ALLOCSET_SEPARATE_THRESHOLD, "ALLOC_CHUNK_LIMIT != ALLOCSET_SEPARATE_THRESHOLD"); set->allocChunkLimit = ALLOC_CHUNK_LIMIT; while ((Size) (set->allocChunkLimit + ALLOC_CHUNKHDRSZ) > (Size) ((maxBlockSize - ALLOC_BLOCKHDRSZ) / ALLOC_CHUNK_FRACTION)) set->allocChunkLimit >>= 1; /* * Grab always-allocated space, if requested */ if (minContextSize > 0) { Size blksize = minContextSize; AllocBlock block; block = (AllocBlock) malloc(blksize); if (block == NULL) { MemoryContextStats(TopMemoryContext); ereport(ERROR, (errcode(ERRCODE_OUT_OF_MEMORY), errmsg("out of memory"), errdetail("Failed while creating memory context \"%s\".", name))); } block->aset = set; block->freeptr = ((char *) block) + ALLOC_BLOCKHDRSZ; block->endptr = ((char *) block) + blksize; block->prev = NULL; block->next = set->blocks; if (block->next) block->next->prev = block; set->blocks = block; /* Mark block as not to be released at reset time */ set->keeper = block; /* Mark unallocated space NOACCESS; leave the block header alone. */ VALGRIND_MAKE_MEM_NOACCESS(block->freeptr, blksize - ALLOC_BLOCKHDRSZ); } return (MemoryContext) set; } /* * AllocSetInit * Context-type-specific initialization routine. * * This is called by MemoryContextCreate() after setting up the * generic MemoryContext fields and before linking the new context * into the context tree. We must do whatever is needed to make the * new context minimally valid for deletion. We must *not* risk * failure --- thus, for example, allocating more memory is not cool. * (AllocSetContextCreate can allocate memory when it gets control * back, however.) */ static void AllocSetInit(MemoryContext context) { /* * Since MemoryContextCreate already zeroed the context node, we don't * have to do anything here: it's already OK. */ } /* * AllocSetReset * Frees all memory which is allocated in the given set. * * Actually, this routine has some discretion about what to do. * It should mark all allocated chunks freed, but it need not necessarily * give back all the resources the set owns. Our actual implementation is * that we hang onto any "keeper" block specified for the set. In this way, * we don't thrash malloc() when a context is repeatedly reset after small * allocations, which is typical behavior for per-tuple contexts. */ static void AllocSetReset(MemoryContext context) { AllocSet set = (AllocSet) context; AllocBlock block; AssertArg(AllocSetIsValid(set)); #ifdef MEMORY_CONTEXT_CHECKING /* Check for corruption and leaks before freeing */ AllocSetCheck(context); #endif /* Clear chunk freelists */ MemSetAligned(set->freelist, 0, sizeof(set->freelist)); block = set->blocks; /* New blocks list is either empty or just the keeper block */ set->blocks = set->keeper; while (block != NULL) { AllocBlock next = block->next; if (block == set->keeper) { /* Reset the block, but don't return it to malloc */ char *datastart = ((char *) block) + ALLOC_BLOCKHDRSZ; #ifdef CLOBBER_FREED_MEMORY wipe_mem(datastart, block->freeptr - datastart); #else /* wipe_mem() would have done this */ VALGRIND_MAKE_MEM_NOACCESS(datastart, block->freeptr - datastart); #endif block->freeptr = datastart; block->prev = NULL; block->next = NULL; } else { /* Normal case, release the block */ #ifdef CLOBBER_FREED_MEMORY wipe_mem(block, block->freeptr - ((char *) block)); #endif free(block); } block = next; } /* Reset block size allocation sequence, too */ set->nextBlockSize = set->initBlockSize; } /* * AllocSetDelete * Frees all memory which is allocated in the given set, * in preparation for deletion of the set. * * Unlike AllocSetReset, this *must* free all resources of the set. * But note we are not responsible for deleting the context node itself. */ static void AllocSetDelete(MemoryContext context) { AllocSet set = (AllocSet) context; AllocBlock block = set->blocks; AssertArg(AllocSetIsValid(set)); #ifdef MEMORY_CONTEXT_CHECKING /* Check for corruption and leaks before freeing */ AllocSetCheck(context); #endif /* Make it look empty, just in case... */ MemSetAligned(set->freelist, 0, sizeof(set->freelist)); set->blocks = NULL; set->keeper = NULL; while (block != NULL) { AllocBlock next = block->next; #ifdef CLOBBER_FREED_MEMORY wipe_mem(block, block->freeptr - ((char *) block)); #endif free(block); block = next; } } /* * AllocSetAlloc * Returns pointer to allocated memory of given size or NULL if * request could not be completed; memory is added to the set. * * No request may exceed: * MAXALIGN_DOWN(SIZE_MAX) - ALLOC_BLOCKHDRSZ - ALLOC_CHUNKHDRSZ * All callers use a much-lower limit. */ static void * AllocSetAlloc(MemoryContext context, Size size) { AllocSet set = (AllocSet) context; AllocBlock block; AllocChunk chunk; int fidx; Size chunk_size; Size blksize; AssertArg(AllocSetIsValid(set)); /* * If requested size exceeds maximum for chunks, allocate an entire block * for this request. */ if (size > set->allocChunkLimit) { chunk_size = MAXALIGN(size); blksize = chunk_size + ALLOC_BLOCKHDRSZ + ALLOC_CHUNKHDRSZ; block = (AllocBlock) malloc(blksize); if (block == NULL) return NULL; block->aset = set; block->freeptr = block->endptr = ((char *) block) + blksize; chunk = (AllocChunk) (((char *) block) + ALLOC_BLOCKHDRSZ); chunk->aset = set; chunk->size = chunk_size; #ifdef MEMORY_CONTEXT_CHECKING /* Valgrind: Will be made NOACCESS below. */ chunk->requested_size = size; /* set mark to catch clobber of "unused" space */ if (size < chunk_size) set_sentinel(AllocChunkGetPointer(chunk), size); #endif #ifdef RANDOMIZE_ALLOCATED_MEMORY /* fill the allocated space with junk */ randomize_mem((char *) AllocChunkGetPointer(chunk), size); #endif /* * Stick the new block underneath the active allocation block, if any, * so that we don't lose the use of the space remaining therein. */ if (set->blocks != NULL) { block->prev = set->blocks; block->next = set->blocks->next; if (block->next) block->next->prev = block; set->blocks->next = block; } else { block->prev = NULL; block->next = NULL; set->blocks = block; } AllocAllocInfo(set, chunk); /* * Chunk's metadata fields remain DEFINED. The requested allocation * itself can be NOACCESS or UNDEFINED; our caller will soon make it * UNDEFINED. Make extra space at the end of the chunk, if any, * NOACCESS. */ VALGRIND_MAKE_MEM_NOACCESS((char *) chunk + ALLOC_CHUNKHDRSZ, chunk_size - ALLOC_CHUNKHDRSZ); return AllocChunkGetPointer(chunk); } /* * Request is small enough to be treated as a chunk. Look in the * corresponding free list to see if there is a free chunk we could reuse. * If one is found, remove it from the free list, make it again a member * of the alloc set and return its data address. */ fidx = AllocSetFreeIndex(size); chunk = set->freelist[fidx]; if (chunk != NULL) { Assert(chunk->size >= size); set->freelist[fidx] = (AllocChunk) chunk->aset; chunk->aset = (void *) set; #ifdef MEMORY_CONTEXT_CHECKING /* Valgrind: Free list requested_size should be DEFINED. */ chunk->requested_size = size; VALGRIND_MAKE_MEM_NOACCESS(&chunk->requested_size, sizeof(chunk->requested_size)); /* set mark to catch clobber of "unused" space */ if (size < chunk->size) set_sentinel(AllocChunkGetPointer(chunk), size); #endif #ifdef RANDOMIZE_ALLOCATED_MEMORY /* fill the allocated space with junk */ randomize_mem((char *) AllocChunkGetPointer(chunk), size); #endif AllocAllocInfo(set, chunk); return AllocChunkGetPointer(chunk); } /* * Choose the actual chunk size to allocate. */ chunk_size = (1 << ALLOC_MINBITS) << fidx; Assert(chunk_size >= size); /* * If there is enough room in the active allocation block, we will put the * chunk into that block. Else must start a new one. */ if ((block = set->blocks) != NULL) { Size availspace = block->endptr - block->freeptr; if (availspace < (chunk_size + ALLOC_CHUNKHDRSZ)) { /* * The existing active (top) block does not have enough room for * the requested allocation, but it might still have a useful * amount of space in it. Once we push it down in the block list, * we'll never try to allocate more space from it. So, before we * do that, carve up its free space into chunks that we can put on * the set's freelists. * * Because we can only get here when there's less than * ALLOC_CHUNK_LIMIT left in the block, this loop cannot iterate * more than ALLOCSET_NUM_FREELISTS-1 times. */ while (availspace >= ((1 << ALLOC_MINBITS) + ALLOC_CHUNKHDRSZ)) { Size availchunk = availspace - ALLOC_CHUNKHDRSZ; int a_fidx = AllocSetFreeIndex(availchunk); /* * In most cases, we'll get back the index of the next larger * freelist than the one we need to put this chunk on. The * exception is when availchunk is exactly a power of 2. */ if (availchunk != ((Size) 1 << (a_fidx + ALLOC_MINBITS))) { a_fidx--; Assert(a_fidx >= 0); availchunk = ((Size) 1 << (a_fidx + ALLOC_MINBITS)); } chunk = (AllocChunk) (block->freeptr); /* Prepare to initialize the chunk header. */ VALGRIND_MAKE_MEM_UNDEFINED(chunk, ALLOC_CHUNKHDRSZ); block->freeptr += (availchunk + ALLOC_CHUNKHDRSZ); availspace -= (availchunk + ALLOC_CHUNKHDRSZ); chunk->size = availchunk; #ifdef MEMORY_CONTEXT_CHECKING chunk->requested_size = 0; /* mark it free */ #endif chunk->aset = (void *) set->freelist[a_fidx]; set->freelist[a_fidx] = chunk; } /* Mark that we need to create a new block */ block = NULL; } } /* * Time to create a new regular (multi-chunk) block? */ if (block == NULL) { Size required_size; /* * The first such block has size initBlockSize, and we double the * space in each succeeding block, but not more than maxBlockSize. */ blksize = set->nextBlockSize; set->nextBlockSize <<= 1; if (set->nextBlockSize > set->maxBlockSize) set->nextBlockSize = set->maxBlockSize; /* * If initBlockSize is less than ALLOC_CHUNK_LIMIT, we could need more * space... but try to keep it a power of 2. */ required_size = chunk_size + ALLOC_BLOCKHDRSZ + ALLOC_CHUNKHDRSZ; while (blksize < required_size) blksize <<= 1; /* Try to allocate it */ block = (AllocBlock) malloc(blksize); /* * We could be asking for pretty big blocks here, so cope if malloc * fails. But give up if there's less than a meg or so available... */ while (block == NULL && blksize > 1024 * 1024) { blksize >>= 1; if (blksize < required_size) break; block = (AllocBlock) malloc(blksize); } if (block == NULL) return NULL; block->aset = set; block->freeptr = ((char *) block) + ALLOC_BLOCKHDRSZ; block->endptr = ((char *) block) + blksize; /* * If this is the first block of the set, make it the "keeper" block. * Formerly, a keeper block could only be created during context * creation, but allowing it to happen here lets us have fast reset * cycling even for contexts created with minContextSize = 0; that way * we don't have to force space to be allocated in contexts that might * never need any space. Don't mark an oversize block as a keeper, * however. */ if (set->keeper == NULL && blksize == set->initBlockSize) set->keeper = block; /* Mark unallocated space NOACCESS. */ VALGRIND_MAKE_MEM_NOACCESS(block->freeptr, blksize - ALLOC_BLOCKHDRSZ); block->prev = NULL; block->next = set->blocks; if (block->next) block->next->prev = block; set->blocks = block; } /* * OK, do the allocation */ chunk = (AllocChunk) (block->freeptr); /* Prepare to initialize the chunk header. */ VALGRIND_MAKE_MEM_UNDEFINED(chunk, ALLOC_CHUNKHDRSZ); block->freeptr += (chunk_size + ALLOC_CHUNKHDRSZ); Assert(block->freeptr <= block->endptr); chunk->aset = (void *) set; chunk->size = chunk_size; #ifdef MEMORY_CONTEXT_CHECKING chunk->requested_size = size; VALGRIND_MAKE_MEM_NOACCESS(&chunk->requested_size, sizeof(chunk->requested_size)); /* set mark to catch clobber of "unused" space */ if (size < chunk->size) set_sentinel(AllocChunkGetPointer(chunk), size); #endif #ifdef RANDOMIZE_ALLOCATED_MEMORY /* fill the allocated space with junk */ randomize_mem((char *) AllocChunkGetPointer(chunk), size); #endif AllocAllocInfo(set, chunk); return AllocChunkGetPointer(chunk); } /* * AllocSetFree * Frees allocated memory; memory is removed from the set. */ static void AllocSetFree(MemoryContext context, void *pointer) { AllocSet set = (AllocSet) context; AllocChunk chunk = AllocPointerGetChunk(pointer); AllocFreeInfo(set, chunk); #ifdef MEMORY_CONTEXT_CHECKING VALGRIND_MAKE_MEM_DEFINED(&chunk->requested_size, sizeof(chunk->requested_size)); /* Test for someone scribbling on unused space in chunk */ if (chunk->requested_size < chunk->size) if (!sentinel_ok(pointer, chunk->requested_size)) elog(WARNING, "detected write past chunk end in %s %p", set->header.name, chunk); #endif if (chunk->size > set->allocChunkLimit) { /* * Big chunks are certain to have been allocated as single-chunk * blocks. Just unlink that block and return it to malloc(). */ AllocBlock block = (AllocBlock) (((char *) chunk) - ALLOC_BLOCKHDRSZ); /* * Try to verify that we have a sane block pointer: it should * reference the correct aset, and freeptr and endptr should point * just past the chunk. */ if (block->aset != set || block->freeptr != block->endptr || block->freeptr != ((char *) block) + (chunk->size + ALLOC_BLOCKHDRSZ + ALLOC_CHUNKHDRSZ)) elog(ERROR, "could not find block containing chunk %p", chunk); /* OK, remove block from aset's list and free it */ if (block->prev) block->prev->next = block->next; else set->blocks = block->next; if (block->next) block->next->prev = block->prev; #ifdef CLOBBER_FREED_MEMORY wipe_mem(block, block->freeptr - ((char *) block)); #endif free(block); } else { /* Normal case, put the chunk into appropriate freelist */ int fidx = AllocSetFreeIndex(chunk->size); chunk->aset = (void *) set->freelist[fidx]; #ifdef CLOBBER_FREED_MEMORY wipe_mem(pointer, chunk->size); #endif #ifdef MEMORY_CONTEXT_CHECKING /* Reset requested_size to 0 in chunks that are on freelist */ chunk->requested_size = 0; #endif set->freelist[fidx] = chunk; } } /* * AllocSetRealloc * Returns new pointer to allocated memory of given size or NULL if * request could not be completed; this memory is added to the set. * Memory associated with given pointer is copied into the new memory, * and the old memory is freed. * * Without MEMORY_CONTEXT_CHECKING, we don't know the old request size. This * makes our Valgrind client requests less-precise, hazarding false negatives. * (In principle, we could use VALGRIND_GET_VBITS() to rediscover the old * request size.) */ static void * AllocSetRealloc(MemoryContext context, void *pointer, Size size) { AllocSet set = (AllocSet) context; AllocChunk chunk = AllocPointerGetChunk(pointer); Size oldsize = chunk->size; #ifdef MEMORY_CONTEXT_CHECKING VALGRIND_MAKE_MEM_DEFINED(&chunk->requested_size, sizeof(chunk->requested_size)); /* Test for someone scribbling on unused space in chunk */ if (chunk->requested_size < oldsize) if (!sentinel_ok(pointer, chunk->requested_size)) elog(WARNING, "detected write past chunk end in %s %p", set->header.name, chunk); #endif /* * Chunk sizes are aligned to power of 2 in AllocSetAlloc(). Maybe the * allocated area already is >= the new size. (In particular, we always * fall out here if the requested size is a decrease.) */ if (oldsize >= size) { #ifdef MEMORY_CONTEXT_CHECKING Size oldrequest = chunk->requested_size; #ifdef RANDOMIZE_ALLOCATED_MEMORY /* We can only fill the extra space if we know the prior request */ if (size > oldrequest) randomize_mem((char *) pointer + oldrequest, size - oldrequest); #endif chunk->requested_size = size; VALGRIND_MAKE_MEM_NOACCESS(&chunk->requested_size, sizeof(chunk->requested_size)); /* * If this is an increase, mark any newly-available part UNDEFINED. * Otherwise, mark the obsolete part NOACCESS. */ if (size > oldrequest) VALGRIND_MAKE_MEM_UNDEFINED((char *) pointer + oldrequest, size - oldrequest); else VALGRIND_MAKE_MEM_NOACCESS((char *) pointer + size, oldsize - size); /* set mark to catch clobber of "unused" space */ if (size < oldsize) set_sentinel(pointer, size); #else /* !MEMORY_CONTEXT_CHECKING */ /* * We don't have the information to determine whether we're growing * the old request or shrinking it, so we conservatively mark the * entire new allocation DEFINED. */ VALGRIND_MAKE_MEM_NOACCESS(pointer, oldsize); VALGRIND_MAKE_MEM_DEFINED(pointer, size); #endif return pointer; } if (oldsize > set->allocChunkLimit) { /* * The chunk must have been allocated as a single-chunk block. Use * realloc() to make the containing block bigger with minimum space * wastage. */ AllocBlock block = (AllocBlock) (((char *) chunk) - ALLOC_BLOCKHDRSZ); Size chksize; Size blksize; /* * Try to verify that we have a sane block pointer: it should * reference the correct aset, and freeptr and endptr should point * just past the chunk. */ if (block->aset != set || block->freeptr != block->endptr || block->freeptr != ((char *) block) + (chunk->size + ALLOC_BLOCKHDRSZ + ALLOC_CHUNKHDRSZ)) elog(ERROR, "could not find block containing chunk %p", chunk); /* Do the realloc */ chksize = MAXALIGN(size); blksize = chksize + ALLOC_BLOCKHDRSZ + ALLOC_CHUNKHDRSZ; block = (AllocBlock) realloc(block, blksize); if (block == NULL) return NULL; block->freeptr = block->endptr = ((char *) block) + blksize; /* Update pointers since block has likely been moved */ chunk = (AllocChunk) (((char *) block) + ALLOC_BLOCKHDRSZ); pointer = AllocChunkGetPointer(chunk); if (block->prev) block->prev->next = block; else set->blocks = block; if (block->next) block->next->prev = block; chunk->size = chksize; #ifdef MEMORY_CONTEXT_CHECKING #ifdef RANDOMIZE_ALLOCATED_MEMORY /* We can only fill the extra space if we know the prior request */ randomize_mem((char *) pointer + chunk->requested_size, size - chunk->requested_size); #endif /* * realloc() (or randomize_mem()) will have left the newly-allocated * part UNDEFINED, but we may need to adjust trailing bytes from the * old allocation. */ VALGRIND_MAKE_MEM_UNDEFINED((char *) pointer + chunk->requested_size, oldsize - chunk->requested_size); chunk->requested_size = size; VALGRIND_MAKE_MEM_NOACCESS(&chunk->requested_size, sizeof(chunk->requested_size)); /* set mark to catch clobber of "unused" space */ if (size < chunk->size) set_sentinel(pointer, size); #else /* !MEMORY_CONTEXT_CHECKING */ /* * We don't know how much of the old chunk size was the actual * allocation; it could have been as small as one byte. We have to be * conservative and just mark the entire old portion DEFINED. */ VALGRIND_MAKE_MEM_DEFINED(pointer, oldsize); #endif /* Make any trailing alignment padding NOACCESS. */ VALGRIND_MAKE_MEM_NOACCESS((char *) pointer + size, chksize - size); return pointer; } else { /* * Small-chunk case. We just do this by brute force, ie, allocate a * new chunk and copy the data. Since we know the existing data isn't * huge, this won't involve any great memcpy expense, so it's not * worth being smarter. (At one time we tried to avoid memcpy when it * was possible to enlarge the chunk in-place, but that turns out to * misbehave unpleasantly for repeated cycles of * palloc/repalloc/pfree: the eventually freed chunks go into the * wrong freelist for the next initial palloc request, and so we leak * memory indefinitely. See pgsql-hackers archives for 2007-08-11.) */ AllocPointer newPointer; /* allocate new chunk */ newPointer = AllocSetAlloc((MemoryContext) set, size); /* leave immediately if request was not completed */ if (newPointer == NULL) return NULL; /* * AllocSetAlloc() just made the region NOACCESS. Change it to * UNDEFINED for the moment; memcpy() will then transfer definedness * from the old allocation to the new. If we know the old allocation, * copy just that much. Otherwise, make the entire old chunk defined * to avoid errors as we copy the currently-NOACCESS trailing bytes. */ VALGRIND_MAKE_MEM_UNDEFINED(newPointer, size); #ifdef MEMORY_CONTEXT_CHECKING oldsize = chunk->requested_size; #else VALGRIND_MAKE_MEM_DEFINED(pointer, oldsize); #endif /* transfer existing data (certain to fit) */ memcpy(newPointer, pointer, oldsize); /* free old chunk */ AllocSetFree((MemoryContext) set, pointer); return newPointer; } } /* * AllocSetGetChunkSpace * Given a currently-allocated chunk, determine the total space * it occupies (including all memory-allocation overhead). */ static Size AllocSetGetChunkSpace(MemoryContext context, void *pointer) { AllocChunk chunk = AllocPointerGetChunk(pointer); return chunk->size + ALLOC_CHUNKHDRSZ; } /* * AllocSetIsEmpty * Is an allocset empty of any allocated space? */ static bool AllocSetIsEmpty(MemoryContext context) { /* * For now, we say "empty" only if the context is new or just reset. We * could examine the freelists to determine if all space has been freed, * but it's not really worth the trouble for present uses of this * functionality. */ if (context->isReset) return true; return false; } /* * AllocSetStats * Compute stats about memory consumption of an allocset. * * level: recursion level (0 at top level); used for print indentation. * print: true to print stats to stderr. * totals: if not NULL, add stats about this allocset into *totals. */ static void AllocSetStats(MemoryContext context, int level, bool print, MemoryContextCounters *totals) { AllocSet set = (AllocSet) context; Size nblocks = 0; Size freechunks = 0; Size totalspace = 0; Size freespace = 0; AllocBlock block; int fidx; for (block = set->blocks; block != NULL; block = block->next) { nblocks++; totalspace += block->endptr - ((char *) block); freespace += block->endptr - block->freeptr; } for (fidx = 0; fidx < ALLOCSET_NUM_FREELISTS; fidx++) { AllocChunk chunk; for (chunk = set->freelist[fidx]; chunk != NULL; chunk = (AllocChunk) chunk->aset) { freechunks++; freespace += chunk->size + ALLOC_CHUNKHDRSZ; } } if (print) { int i; for (i = 0; i < level; i++) fprintf(stderr, " "); fprintf(stderr, "%s: %zu total in %zd blocks; %zu free (%zd chunks); %zu used\n", set->header.name, totalspace, nblocks, freespace, freechunks, totalspace - freespace); } if (totals) { totals->nblocks += nblocks; totals->freechunks += freechunks; totals->totalspace += totalspace; totals->freespace += freespace; } } #ifdef MEMORY_CONTEXT_CHECKING /* * AllocSetCheck * Walk through chunks and check consistency of memory. * * NOTE: report errors as WARNING, *not* ERROR or FATAL. Otherwise you'll * find yourself in an infinite loop when trouble occurs, because this * routine will be entered again when elog cleanup tries to release memory! */ static void AllocSetCheck(MemoryContext context) { AllocSet set = (AllocSet) context; char *name = set->header.name; AllocBlock prevblock; AllocBlock block; for (prevblock = NULL, block = set->blocks; block != NULL; prevblock = block, block = block->next) { char *bpoz = ((char *) block) + ALLOC_BLOCKHDRSZ; long blk_used = block->freeptr - bpoz; long blk_data = 0; long nchunks = 0; /* * Empty block - empty can be keeper-block only */ if (!blk_used) { if (set->keeper != block) elog(WARNING, "problem in alloc set %s: empty block %p", name, block); } /* * Check block header fields */ if (block->aset != set || block->prev != prevblock || block->freeptr < bpoz || block->freeptr > block->endptr) elog(WARNING, "problem in alloc set %s: corrupt header in block %p", name, block); /* * Chunk walker */ while (bpoz < block->freeptr) { AllocChunk chunk = (AllocChunk) bpoz; Size chsize, dsize; chsize = chunk->size; /* aligned chunk size */ VALGRIND_MAKE_MEM_DEFINED(&chunk->requested_size, sizeof(chunk->requested_size)); dsize = chunk->requested_size; /* real data */ if (dsize > 0) /* not on a free list */ VALGRIND_MAKE_MEM_NOACCESS(&chunk->requested_size, sizeof(chunk->requested_size)); /* * Check chunk size */ if (dsize > chsize) elog(WARNING, "problem in alloc set %s: req size > alloc size for chunk %p in block %p", name, chunk, block); if (chsize < (1 << ALLOC_MINBITS)) elog(WARNING, "problem in alloc set %s: bad size %zu for chunk %p in block %p", name, chsize, chunk, block); /* single-chunk block? */ if (chsize > set->allocChunkLimit && chsize + ALLOC_CHUNKHDRSZ != blk_used) elog(WARNING, "problem in alloc set %s: bad single-chunk %p in block %p", name, chunk, block); /* * If chunk is allocated, check for correct aset pointer. (If it's * free, the aset is the freelist pointer, which we can't check as * easily...) */ if (dsize > 0 && chunk->aset != (void *) set) elog(WARNING, "problem in alloc set %s: bogus aset link in block %p, chunk %p", name, block, chunk); /* * Check for overwrite of "unallocated" space in chunk */ if (dsize > 0 && dsize < chsize && !sentinel_ok(chunk, ALLOC_CHUNKHDRSZ + dsize)) elog(WARNING, "problem in alloc set %s: detected write past chunk end in block %p, chunk %p", name, block, chunk); blk_data += chsize; nchunks++; bpoz += ALLOC_CHUNKHDRSZ + chsize; } if ((blk_data + (nchunks * ALLOC_CHUNKHDRSZ)) != blk_used) elog(WARNING, "problem in alloc set %s: found inconsistent memory block %p", name, block); } } #endif /* MEMORY_CONTEXT_CHECKING */ pgpool-II-4.1.4/src/utils/pcp/0000775000175000017500000000000013730350746013043 500000000000000pgpool-II-4.1.4/src/utils/pcp/pcp_stream.c0000664000175000017500000001530313730350075015261 00000000000000/* * $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. * * PCP buffer management module. */ #include #include #include #include #include #include #include #include #include "pcp/pcp.h" #include "pcp/pcp_stream.h" #ifndef POOL_PRIVATE #include "utils/palloc.h" #include "utils/memutils.h" #else #include "utils/fe_ports.h" #endif static int consume_pending_data(PCP_CONNECTION * pc, void *data, int len); static int save_pending_data(PCP_CONNECTION * pc, void *data, int len); static int pcp_check_fd(PCP_CONNECTION * pc); /* -------------------------------- * pcp_open - allocate read & write buffers for PCP_CONNECTION * * return newly allocated PCP_CONNECTION on success, NULL if malloc() fails * -------------------------------- */ PCP_CONNECTION * pcp_open(int fd) { PCP_CONNECTION *pc; #ifndef POOL_PRIVATE MemoryContext oldContext = MemoryContextSwitchTo(TopMemoryContext); #endif pc = (PCP_CONNECTION *) palloc0(sizeof(PCP_CONNECTION)); /* initialize write buffer */ pc->wbuf = palloc(WRITEBUFSZ); pc->wbufsz = WRITEBUFSZ; pc->wbufpo = 0; /* initialize pending data buffer */ pc->hp = palloc(READBUFSZ); pc->bufsz = READBUFSZ; pc->po = 0; pc->len = 0; #ifndef POOL_PRIVATE MemoryContextSwitchTo(oldContext); #endif pc->fd = fd; return pc; } /* -------------------------------- * pcp_close - deallocate read & write buffers for PCP_CONNECTION * -------------------------------- */ void pcp_close(PCP_CONNECTION * pc) { close(pc->fd); pfree(pc->wbuf); pfree(pc->hp); pfree(pc); } /* -------------------------------- * pcp_read - read 'len' bytes from 'pc' * * return 0 on success, -1 otherwise * -------------------------------- */ int pcp_read(PCP_CONNECTION * pc, void *buf, int len) { static char readbuf[READBUFSZ]; int consume_size; int readlen; consume_size = consume_pending_data(pc, buf, len); len -= consume_size; buf += consume_size; while (len > 0) { if (pcp_check_fd(pc)) return -1; readlen = read(pc->fd, readbuf, READBUFSZ); if (readlen == -1) { if (errno == EAGAIN || errno == EINTR) continue; return -1; } else if (readlen == 0) { return -1; } if (len < readlen) { /* overrun. we need to save remaining data to pending buffer */ if (save_pending_data(pc, readbuf + len, readlen - len)) return -1; memmove(buf, readbuf, len); break; } memmove(buf, readbuf, readlen); buf += readlen; len -= readlen; } return 0; } /* -------------------------------- * pcp_write - write 'len' bytes to 'pc' buffer * * return 0 on success, -1 otherwise * -------------------------------- */ int pcp_write(PCP_CONNECTION * pc, void *buf, int len) { int reqlen; if (len < 0) { return -1; } /* check buffer size */ reqlen = pc->wbufpo + len; if (reqlen > pc->wbufsz) { char *p; reqlen = (reqlen / WRITEBUFSZ + 1) * WRITEBUFSZ; #ifndef POOL_PRIVATE MemoryContext oldContext = MemoryContextSwitchTo(TopMemoryContext); #endif p = repalloc(pc->wbuf, reqlen); #ifndef POOL_PRIVATE MemoryContextSwitchTo(oldContext); #endif pc->wbuf = p; pc->wbufsz = reqlen; } memcpy(pc->wbuf + pc->wbufpo, buf, len); pc->wbufpo += len; return 0; } /* -------------------------------- * pcp_flush - send pending data in buffer to 'pc' * * return 0 on success, -1 otherwise * -------------------------------- */ int pcp_flush(PCP_CONNECTION * pc) { int sts; int wlen; int offset; wlen = pc->wbufpo; if (wlen == 0) { return 0; } offset = 0; for (;;) { errno = 0; sts = write(pc->fd, pc->wbuf + offset, wlen); if (sts > 0) { wlen -= sts; if (wlen == 0) { /* write completed */ break; } else if (wlen < 0) { return -1; } else { /* need to write remaining data */ offset += sts; continue; } } else if (errno == EAGAIN || errno == EINTR) continue; else return -1; } pc->wbufpo = 0; return 0; } /* -------------------------------- * consume_pending_data - read pending data from 'pc' buffer * * return the size of data read in * -------------------------------- */ static int consume_pending_data(PCP_CONNECTION * pc, void *data, int len) { int consume_size; if (pc->len <= 0) return 0; consume_size = Min(len, pc->len); memmove(data, pc->hp + pc->po, consume_size); pc->len -= consume_size; if (pc->len <= 0) pc->po = 0; else pc->po += consume_size; return consume_size; } /* -------------------------------- * save_pending_data - save excessively read data into 'pc' buffer * * return 0 on success, -1 otherwise * -------------------------------- */ static int save_pending_data(PCP_CONNECTION * pc, void *data, int len) { int reqlen; size_t realloc_size; char *p; /* to be safe */ if (pc->len == 0) pc->po = 0; reqlen = pc->po + pc->len + len; /* pending buffer is enough? */ if (reqlen > pc->bufsz) { /* too small, enlarge it */ realloc_size = (reqlen / READBUFSZ + 1) * READBUFSZ; #ifndef POOL_PRIVATE MemoryContext oldContext = MemoryContextSwitchTo(TopMemoryContext); #endif p = repalloc(pc->hp, realloc_size); #ifndef POOL_PRIVATE MemoryContextSwitchTo(oldContext); #endif pc->bufsz = realloc_size; pc->hp = p; } memmove(pc->hp + pc->po + pc->len, data, len); pc->len += len; return 0; } /* -------------------------------- * pcp_check_fd - watch for fd which is ready to be read * * return 0 on success, -1 otherwise * -------------------------------- */ static int pcp_check_fd(PCP_CONNECTION * pc) { fd_set readmask; fd_set exceptmask; int fd; int fds; fd = pc->fd; for (;;) { FD_ZERO(&readmask); FD_ZERO(&exceptmask); FD_SET(fd, &readmask); FD_SET(fd, &exceptmask); fds = select(fd + 1, &readmask, NULL, &exceptmask, NULL); if (fds == -1) { if (errno == EAGAIN || errno == EINTR) continue; break; } if (FD_ISSET(fd, &exceptmask)) break; if (fds == 0) break; return 0; } return -1; } pgpool-II-4.1.4/src/utils/pool_select_walker.c0000664000175000017500000007555113730350127016230 00000000000000/* -*-pgsql-c-*- */ /* * pgpool: a language independent connection pool server for PostgreSQL * written by Tatsuo Ishii * * Copyright (c) 2003-2019 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/elog.h" #include "pool_config.h" #include "utils/pool_select_walker.h" #include "utils/pool_relcache.h" #include "parser/parsenodes.h" #include "context/pool_session_context.h" #include "rewrite/pool_timestamp.h" static bool function_call_walker(Node *node, void *context); static bool system_catalog_walker(Node *node, void *context); static bool is_system_catalog(char *table_name); static bool temp_table_walker(Node *node, void *context); static bool unlogged_table_walker(Node *node, void *context); static bool view_walker(Node *node, void *context); static bool is_temp_table(char *table_name); static bool insertinto_or_locking_clause_walker(Node *node, void *context); static bool is_immutable_function(char *fname); static bool select_table_walker(Node *node, void *context); static bool non_immutable_function_call_walker(Node *node, void *context); static char *strip_quote(char *str); /* * Return true if this SELECT has function calls *and* supposed to * modify database. We check black/white function list to determine * whether the function modifies database. */ bool pool_has_function_call(Node *node) { SelectContext ctx; if (!IsA(node, SelectStmt)) return false; ctx.has_function_call = false; ctx.pg_terminate_backend_pid = -1; raw_expression_tree_walker(node, function_call_walker, &ctx); return ctx.has_function_call; } /* * Search the pg_terminate_backend() call in the query */ int pool_get_terminate_backend_pid(Node *node) { SelectContext ctx; if (!IsA(node, SelectStmt)) return false; ctx.has_function_call = false; ctx.pg_terminate_backend_pid = 0; raw_expression_tree_walker(node, function_call_walker, &ctx); return ctx.pg_terminate_backend_pid; } /* * Return true if this SELECT has system catalog table. */ bool pool_has_system_catalog(Node *node) { SelectContext ctx; if (!IsA(node, SelectStmt)) return false; ctx.has_system_catalog = false; raw_expression_tree_walker(node, system_catalog_walker, &ctx); return ctx.has_system_catalog; } /* * Return true if this SELECT has temporary table. */ bool pool_has_temp_table(Node *node) { SelectContext ctx; if (!IsA(node, SelectStmt)) return false; ctx.has_temp_table = false; raw_expression_tree_walker(node, temp_table_walker, &ctx); return ctx.has_temp_table; } /* * Return true if this SELECT has unlogged table. */ bool pool_has_unlogged_table(Node *node) { SelectContext ctx; if (!IsA(node, SelectStmt)) return false; ctx.has_unlogged_table = false; raw_expression_tree_walker(node, unlogged_table_walker, &ctx); return ctx.has_unlogged_table; } /* * Return true if this SELECT has a view. */ bool pool_has_view(Node *node) { SelectContext ctx; if (!IsA(node, SelectStmt)) return false; ctx.has_view = false; raw_expression_tree_walker(node, view_walker, &ctx); return ctx.has_view; } /* * Return true if this SELECT has INSERT INTO or FOR SHARE or FOR UPDATE. */ bool pool_has_insertinto_or_locking_clause(Node *node) { SelectContext ctx; if (!IsA(node, SelectStmt)) return false; ctx.has_insertinto_or_locking_clause = false; raw_expression_tree_walker(node, insertinto_or_locking_clause_walker, &ctx); ereport(DEBUG1, (errmsg("checking if query has INSERT INTO, FOR SHARE or FOR UPDATE"), errdetail("result = %d", ctx.has_insertinto_or_locking_clause))); return ctx.has_insertinto_or_locking_clause; } /* * Search function name in whilelist or blacklist regex array * Return 1 on success (found in list) * Return 0 when not found in list * Return -1 if the given search type doesn't exist. * Search type supported are: WHITELIST and BLACKLIST */ int pattern_compare(char *str, const int type, const char *param_name) { int i = 0; char *s; int result = 0; RegPattern *lists_patterns; int *pattc; if (strcmp(param_name, "white_function_list") == 0 || strcmp(param_name, "black_function_list") == 0) { lists_patterns = pool_config->lists_patterns; pattc = &pool_config->pattc; } else if (strcmp(param_name, "white_memqcache_table_list") == 0 || strcmp(param_name, "black_memqcache_table_list") == 0) { lists_patterns = pool_config->lists_memqcache_table_patterns; pattc = &pool_config->memqcache_table_pattc; } else if (strcmp(param_name, "black_query_pattern_list") == 0) { lists_patterns = pool_config->lists_query_patterns; pattc = &pool_config->query_pattc; } else { ereport(WARNING, (errmsg("pattern_compare: unknown paramname %s", param_name))); return -1; } s = strip_quote(str); if (!s) { elog(WARNING, "pattern_compare: strip_quote() returns error"); return -1; } for (i = 0; i < *pattc; i++) { if (lists_patterns[i].type != type) continue; if (regexec(&lists_patterns[i].regexv, s, 0, 0, 0) == 0) { switch (type) { /* return 1 if string matches whitelist pattern */ case WHITELIST: ereport(DEBUG2, (errmsg("comparing function name in whitelist regex array"), errdetail("pattern_compare: %s (%s) matched: %s", param_name, lists_patterns[i].pattern, s))); result = 1; break; /* return 1 if string matches blacklist pattern */ case BLACKLIST: ereport(DEBUG2, (errmsg("comparing function name in blacklist regex array"), errdetail("pattern_compare: %s (%s) matched: %s", param_name, lists_patterns[i].pattern, s))); result = 1; break; default: ereport(WARNING, (errmsg("pattern_compare: \"%s\" unknown pattern match type: \"%s\"", param_name, s))); result = -1; break; } /* return the result */ break; } ereport(DEBUG2, (errmsg("comparing function name in blacklist/whitelist regex array"), errdetail("pattern_compare: %s (%s) not matched: %s", param_name, lists_patterns[i].pattern, s))); } free(s); return result; } /* * Returns double quotes stripped version of malloced string. * Callers must free() after using it. * Returns NULL on error. */ static char * strip_quote(char *str) { char *after; int len; int i = 0; len = strlen(str); after = malloc(sizeof(char) * len + 1); if (!after) { return NULL; } if (len == 0) { /* empty string case */ *after = '\0'; return after; } do { if (*str != '"') { after[i] = *str; i++; } str++; } while (*str != '\0'); after[i] = '\0'; return after; } /* * Walker function to find a function call which is supposed to write * database. */ static bool function_call_walker(Node *node, void *context) { SelectContext *ctx = (SelectContext *) context; if (node == NULL) return false; if (IsA(node, FuncCall)) { FuncCall *fcall = (FuncCall *) node; char *fname; int length = list_length(fcall->funcname); if (length > 0) { if (length == 1) /* no schema qualification? */ { fname = strVal(linitial(fcall->funcname)); } else { fname = strVal(lsecond(fcall->funcname)); /* with schema * qualification */ } ereport(DEBUG1, (errmsg("function call walker, function name: \"%s\"", fname))); if (ctx->pg_terminate_backend_pid == 0 && strcmp("pg_terminate_backend", fname) == 0) { if (list_length(fcall->args) == 1) { Node *arg = linitial(fcall->args); if (IsA(arg, A_Const) && ((A_Const *) arg)->val.type == T_Integer) { ctx->pg_terminate_backend_pid = ((A_Const *) arg)->val.val.ival; ereport(DEBUG1, (errmsg("pg_terminate_backend pid = %d", ctx->pg_terminate_backend_pid))); } } } /* * Check white list if any. */ if (pool_config->num_white_function_list > 0) { /* Search function in the white list regex patterns */ if (pattern_compare(fname, WHITELIST, "white_function_list") == 1) { /* * If the function is found in the white list, we can * ignore it */ return raw_expression_tree_walker(node, function_call_walker, context); } /* * Since the function was not found in white list, we have * found a writing function. */ ctx->has_function_call = true; return false; } /* * Check black list if any. */ if (pool_config->num_black_function_list > 0) { /* Search function in the black list regex patterns */ if (pattern_compare(fname, BLACKLIST, "black_function_list") == 1) { /* Found. */ ctx->has_function_call = true; return false; } } } } return raw_expression_tree_walker(node, function_call_walker, context); } /* * Walker function to find a system catalog */ static bool system_catalog_walker(Node *node, void *context) { SelectContext *ctx = (SelectContext *) context; if (node == NULL) return false; if (IsA(node, RangeVar)) { RangeVar *rgv = (RangeVar *) node; ereport(DEBUG1, (errmsg("system catalog walker, checking relation \"%s\"", rgv->relname))); if (is_system_catalog(rgv->relname)) { ctx->has_system_catalog = true; return false; } } return raw_expression_tree_walker(node, system_catalog_walker, context); } /* * Walker function to find a temp table */ static bool temp_table_walker(Node *node, void *context) { SelectContext *ctx = (SelectContext *) context; if (node == NULL) return false; if (IsA(node, RangeVar)) { RangeVar *rgv = (RangeVar *) node; ereport(DEBUG1, (errmsg("temporary table walker. checking relation \"%s\"", rgv->relname))); if (is_temp_table(rgv->relname)) { ctx->has_temp_table = true; return false; } } return raw_expression_tree_walker(node, temp_table_walker, context); } /* * Walker function to find a unlogged table */ static bool unlogged_table_walker(Node *node, void *context) { SelectContext *ctx = (SelectContext *) context; char *relname; if (node == NULL) return false; if (IsA(node, RangeVar)) { RangeVar *rgv = (RangeVar *) node; relname = make_table_name_from_rangevar(rgv); ereport(DEBUG1, (errmsg("unlogged table walker. checking relation \"%s\"", relname))); if (is_unlogged_table(relname)) { ctx->has_unlogged_table = true; return false; } } return raw_expression_tree_walker(node, unlogged_table_walker, context); } /* * Walker function to find a view */ static bool view_walker(Node *node, void *context) { SelectContext *ctx = (SelectContext *) context; char *relname; if (node == NULL) return false; if (IsA(node, RangeVar)) { RangeVar *rgv = (RangeVar *) node; relname = make_table_name_from_rangevar(rgv); ereport(DEBUG1, (errmsg("view walker. checking relation \"%s\"", relname))); if (is_view(relname)) { ctx->has_view = true; return false; } } return raw_expression_tree_walker(node, view_walker, context); } /* * Determine whether table_name is a system catalog or not. */ static bool is_system_catalog(char *table_name) { /* * Query to know if pg_namespace exists. PostgreSQL 7.2 or before doesn't have. */ #define HASPGNAMESPACEQUERY "SELECT count(*) FROM pg_catalog.pg_class AS c WHERE c.relname = '%s'" /* * Query to know if the target table belongs pg_catalog schema. */ #define ISBELONGTOPGCATALOGQUERY "SELECT count(*) FROM pg_class AS c, pg_namespace AS n WHERE c.relname = '%s' AND c.relnamespace = n.oid AND n.nspname = 'pg_catalog'" #define ISBELONGTOPGCATALOGQUERY2 "SELECT count(*) FROM pg_class AS c, pg_namespace AS n WHERE c.oid = pgpool_regclass('\"%s\"') AND c.relnamespace = n.oid AND n.nspname = 'pg_catalog'" #define ISBELONGTOPGCATALOGQUERY3 "SELECT count(*) FROM pg_class AS c, pg_namespace AS n WHERE c.oid = pg_catalog.to_regclass('\"%s\"') AND c.relnamespace = n.oid AND n.nspname = 'pg_catalog'" bool result; static POOL_RELCACHE * relcache; POOL_CONNECTION_POOL *backend; if (table_name == NULL) { return false; } if (!pool_has_to_regclass() && !pool_has_pgpool_regclass()) table_name = remove_quotes_and_schema_from_relname(table_name); backend = pool_get_session_context(false)->backend; /* * Check if pg_namespace exists. PostgreSQL 7.3 or later has it. */ if (Pgversion(backend)->major >= 73) { /* * If relcache does not exist, create it. */ if (!relcache) { char *query; /* PostgreSQL 9.4 or later has to_regclass() */ if (pool_has_to_regclass()) { query = ISBELONGTOPGCATALOGQUERY3; } /* pgpool_regclass has been installed */ else if (pool_has_pgpool_regclass()) { query = ISBELONGTOPGCATALOGQUERY2; } else { query = ISBELONGTOPGCATALOGQUERY; } relcache = pool_create_relcache(pool_config->relcache_size, query, int_register_func, int_unregister_func, false); if (relcache == NULL) { ereport(WARNING, (errmsg("unable to create relcache, while checking for system catalog"))); return false; } } /* * Search relcache. */ result = pool_search_relcache(relcache, backend, table_name) == 0 ? false : true; return result; } /* * Pre 7.3. Just check whether the table starts with "pg_". */ return (strcasecmp(table_name, "pg_") == 0); } /* * Returns true if table_name is a temporary table. */ static POOL_RELCACHE * is_temp_table_relcache; static bool is_temp_table(char *table_name) { /* * Query to know if pg_class has relistemp column or not. * PostgreSQL 8.4 and 9.0 have this. */ #define HASRELITEMPPQUERY "SELECT count(*) FROM pg_catalog.pg_class AS c, pg_attribute AS a WHERE c.relname = 'pg_class' AND a.attrelid = c.oid AND a.attname = 'relistemp'" /* * Query to know if the target table is a temporary one. This query * is valid in PostgreSQL 7.3 to 8.3 and 9.1 or later. We do not use * regclass (or its variant) here, because temporary tables never have * schema qualified name. */ #define ISTEMPQUERY83 "SELECT count(*) FROM pg_catalog.pg_class AS c, pg_namespace AS n WHERE c.relname = '%s' AND c.relnamespace = n.oid AND n.nspname ~ '^pg_temp_'" /* * Query to know if the target table is a temporary one. This query * is valid in PostgreSQL 8.4 and 9.0. We do not use regclass (or its * variant) here, because temporary tables never have schema qualified * name. */ #define ISTEMPQUERY84 "SELECT count(*) FROM pg_catalog.pg_class AS c WHERE c.relname = '%s' AND c.relistemp" bool result; char *query; POOL_CONNECTION_POOL *backend; int major; if (table_name == NULL || pool_config->check_temp_table == CHECK_TEMP_NONE || pool_config->check_temp_table == CHECK_TEMP_OFF) { return false; } backend = pool_get_session_context(false)->backend; if (pool_config->check_temp_table == CHECK_TEMP_TRACE) { POOL_TEMP_TABLE *temp_table; temp_table = pool_temp_tables_find(table_name); if (temp_table && (temp_table->state == TEMP_TABLE_CREATE_COMMITTED || temp_table->state == TEMP_TABLE_CREATING)) { ereport(DEBUG1, (errmsg("is_temp_table: %s is a temp table", table_name))); return true; } else { ereport(DEBUG1, (errmsg("is_temp_table: %s is not a temp table", table_name))); return false; } } /* * Below is check_temp_table == CHECK_TEMP_CATALOG or CHECK_TEMP_ON case. */ /* * Check backend version. */ major = Pgversion(backend)->major; if (major == 73 || major == 83 || major >= 91) query = ISTEMPQUERY83; else if (major == 84 || major == 90) query = ISTEMPQUERY84; else { ereport(WARNING, (errmsg("is_temp_table: unexpected PostgreSQL version: %s", Pgversion(backend)->version_string))); return false; /* fall back to assume that the table is not a temporary table. */ } /* * If relcache does not exist, create it. */ if (!is_temp_table_relcache) { is_temp_table_relcache = pool_create_relcache(pool_config->relcache_size, query, int_register_func, int_unregister_func, true); if (is_temp_table_relcache == NULL) { ereport(WARNING, (errmsg("unable to create relcache, while checking for temporary table"))); return false; } } /* * Search relcache. */ result = pool_search_relcache(is_temp_table_relcache, backend, table_name) == 0 ? false : true; return result; } /* * Discard relcache used by is_temp_table_relcache(). */ void discard_temp_table_relcache(void) { if (is_temp_table_relcache) { pool_discard_relcache(is_temp_table_relcache); is_temp_table_relcache = NULL; } } /* * Returns true if table_name is an unlogged table. */ bool is_unlogged_table(char *table_name) { /* * Query to know if pg_class has relpersistence column or not. * PostgreSQL 9.1 or later has this. */ #define HASRELPERSISTENCEQUERY "SELECT count(*) FROM pg_catalog.pg_class AS c, pg_catalog.pg_attribute AS a WHERE c.relname = 'pg_class' AND a.attrelid = c.oid AND a.attname = 'relpersistence'" /* * Query to know if the target table is a unlogged one. This query * is valid in PostgreSQL 9.1 or later. */ #define ISUNLOGGEDQUERY "SELECT count(*) FROM pg_catalog.pg_class AS c WHERE c.relname = '%s' AND c.relpersistence = 'u'" #define ISUNLOGGEDQUERY2 "SELECT count(*) FROM pg_catalog.pg_class AS c WHERE c.oid = pgpool_regclass('%s') AND c.relpersistence = 'u'" #define ISUNLOGGEDQUERY3 "SELECT count(*) FROM pg_catalog.pg_class AS c WHERE c.oid = pg_catalog.to_regclass('%s') AND c.relpersistence = 'u'" static POOL_RELCACHE * relcache; POOL_CONNECTION_POOL *backend; int major; if (table_name == NULL) { return false; } if (!pool_has_to_regclass() && !pool_has_pgpool_regclass()) table_name = remove_quotes_and_schema_from_relname(table_name); backend = pool_get_session_context(false)->backend; /* * Check backend version. */ major = Pgversion(backend)->major; if (major >= 91) { bool result; char *query; /* PostgreSQL 9.4 or later has to_regclass() */ if (pool_has_to_regclass()) { query = ISUNLOGGEDQUERY3; } /* pgpool_regclass has been installed */ else if (pool_has_pgpool_regclass()) { query = ISUNLOGGEDQUERY2; } else { query = ISUNLOGGEDQUERY; } /* * If relcache does not exist, create it. */ if (!relcache) { relcache = pool_create_relcache(pool_config->relcache_size, query, int_register_func, int_unregister_func, false); if (relcache == NULL) { ereport(WARNING, (errmsg("unable to create relcache, while checking for unlogged table"))); return false; } } /* * Search relcache. */ result = pool_search_relcache(relcache, backend, table_name) == 0 ? false : true; return result; } else { return false; } } /* * Returns true if table_name is a view. * This function is called by query cache module. */ bool is_view(char *table_name) { /* * Query to know if the target table is a view (including a materialized view). */ #define ISVIEWQUERY "SELECT count(*) FROM pg_catalog.pg_class AS c WHERE c.relname = '%s' AND (c.relkind = 'v' OR c.relkind = 'm')" #define ISVIEWQUERY2 "SELECT count(*) FROM pg_catalog.pg_class AS c WHERE c.oid = pgpool_regclass('%s') AND (c.relkind = 'v' OR c.relkind = 'm')" #define ISVIEWQUERY3 "SELECT count(*) FROM pg_catalog.pg_class AS c WHERE c.oid = pg_catalog.to_regclass('%s') AND (c.relkind = 'v' OR c.relkind = 'm')" static POOL_RELCACHE * relcache; POOL_CONNECTION_POOL *backend; bool result; char *query; if (table_name == NULL) { return false; } if (!pool_has_to_regclass() && !pool_has_pgpool_regclass()) table_name = remove_quotes_and_schema_from_relname(table_name); backend = pool_get_session_context(false)->backend; /* PostgreSQL 9.4 or later has to_regclass() */ if (pool_has_to_regclass()) { query = ISVIEWQUERY3; } /* pgpool_regclass has been installed */ else if (pool_has_pgpool_regclass()) { query = ISVIEWQUERY2; } else { query = ISVIEWQUERY; } if (!relcache) { relcache = pool_create_relcache(pool_config->relcache_size, query, int_register_func, int_unregister_func, false); if (relcache == NULL) { ereport(WARNING, (errmsg("unable to create relcache, while checking for view"))); return false; } } /* * Search relcache. */ result = pool_search_relcache(relcache, backend, table_name) == 0 ? false : true; return result; } /* * Judge if we have pgpool_regclass or not. */ bool pool_has_pgpool_regclass(void) { /* * Query to know if pgpool_regclass exists. */ #define HASPGPOOL_REGCLASSQUERY "SELECT count(*) from (SELECT has_function_privilege('%s', 'pgpool_regclass(cstring)', 'execute') WHERE EXISTS(SELECT * FROM pg_catalog.pg_proc AS p WHERE p.proname = 'pgpool_regclass')) AS s" bool result; static POOL_RELCACHE * relcache; POOL_CONNECTION_POOL *backend; char *user; backend = pool_get_session_context(false)->backend; user = MASTER_CONNECTION(backend)->sp->user; if (!relcache) { relcache = pool_create_relcache(pool_config->relcache_size, HASPGPOOL_REGCLASSQUERY, int_register_func, int_unregister_func, false); if (relcache == NULL) { ereport(WARNING, (errmsg("unable to create relcache, while checking pgpool regclass presence"))); return false; } } result = pool_search_relcache(relcache, backend, user) == 0 ? 0 : 1; return result; } /* * Returns true if we have to_regclass(). */ bool pool_has_to_regclass(void) { POOL_CONNECTION_POOL *backend; PGVersion *pgversion; backend = pool_get_session_context(false)->backend; pgversion = Pgversion(backend); /* PostgreSQL 9.4 or above has to_regclass() */ if (pgversion->major >= 94) return true; return false; } /* * Walker function to find intoClause or lockingClause. */ static bool insertinto_or_locking_clause_walker(Node *node, void *context) { SelectContext *ctx = (SelectContext *) context; if (node == NULL) return false; if (IsA(node, IntoClause) ||IsA(node, LockingClause)) { ctx->has_insertinto_or_locking_clause = true; return false; } return raw_expression_tree_walker(node, insertinto_or_locking_clause_walker, ctx); } /* * Return true if this SELECT has non immutable function calls. */ bool pool_has_non_immutable_function_call(Node *node) { SelectContext ctx; if (!IsA(node, SelectStmt)) return false; ctx.has_non_immutable_function_call = false; raw_expression_tree_walker(node, non_immutable_function_call_walker, &ctx); ereport(DEBUG1, (errmsg("checking if SELECT statement contains the IMMUTABLE function call"), errdetail("result = %d", ctx.has_non_immutable_function_call))); return ctx.has_non_immutable_function_call; } /* * Walker function to find non immutable function call. */ static bool non_immutable_function_call_walker(Node *node, void *context) { SelectContext *ctx = (SelectContext *) context; if (node == NULL) return false; if (IsA(node, FuncCall)) { FuncCall *fcall = (FuncCall *) node; char *fname; int length = list_length(fcall->funcname); if (length > 0) { if (length == 1) /* no schema qualification? */ { fname = strVal(linitial(fcall->funcname)); } else { fname = strVal(lsecond(fcall->funcname)); /* with schema * qualification */ } ereport(DEBUG1, (errmsg("non immutable function walker. checking function \"%s\"", fname))); /* Check system catalog if the function is immutable */ if (is_immutable_function(fname) == false) { /* Non immutable function call found */ ctx->has_non_immutable_function_call = true; return false; } } } else if (IsA(node, TypeCast)) { /* CURRENT_DATE, CURRENT_TIME, LOCALTIMESTAMP, LOCALTIME etc. */ TypeCast *tc = (TypeCast *) node; if ((isSystemType((Node *) tc->typeName, "date") || isSystemType((Node *) tc->typeName, "timestamp") || isSystemType((Node *) tc->typeName, "timestamptz") || isSystemType((Node *) tc->typeName, "time") || isSystemType((Node *) tc->typeName, "timetz"))) { ctx->has_non_immutable_function_call = true; return false; } } return raw_expression_tree_walker(node, non_immutable_function_call_walker, context); } /* * Check if the function is stable. */ static bool is_immutable_function(char *fname) { /* * Query to know if the function is IMMUTABLE */ #define IS_STABLE_FUNCTION_QUERY "SELECT count(*) FROM pg_catalog.pg_proc AS p WHERE p.proname = '%s' AND p.provolatile = 'i'" bool result; static POOL_RELCACHE * relcache; POOL_CONNECTION_POOL *backend; backend = pool_get_session_context(false)->backend; if (!relcache) { relcache = pool_create_relcache(pool_config->relcache_size, IS_STABLE_FUNCTION_QUERY, int_register_func, int_unregister_func, false); if (relcache == NULL) { ereport(WARNING, (errmsg("unable to create relcache, while checking if the function is immutable"))); return false; } ereport(DEBUG1, (errmsg("checking if the function is IMMUTABLE"), errdetail("relcache created"))); } result = (pool_search_relcache(relcache, backend, fname) == 0) ? 0 : 1; ereport(DEBUG1, (errmsg("checking if the function is IMMUTABLE"), errdetail("search result = %d", result))); return result; } /* * Convert table_name(possibly including schema name) to oid */ int pool_table_name_to_oid(char *table_name) { /* * Query to convert table name to oid */ #define TABLE_TO_OID_QUERY "SELECT pgpool_regclass('%s')" #define TABLE_TO_OID_QUERY2 "SELECT oid FROM pg_class WHERE relname = '%s'" #define TABLE_TO_OID_QUERY3 "SELECT COALESCE(pg_catalog.to_regclass('%s')::oid, 0)" int oid = 0; static POOL_RELCACHE * relcache; POOL_CONNECTION_POOL *backend; char *query; if (table_name == NULL) { return oid; } if (!pool_has_to_regclass() && !pool_has_pgpool_regclass()) table_name = remove_quotes_and_schema_from_relname(table_name); backend = pool_get_session_context(false)->backend; if (pool_has_to_regclass()) { query = TABLE_TO_OID_QUERY3; } else if (pool_has_pgpool_regclass()) { query = TABLE_TO_OID_QUERY; } else { query = TABLE_TO_OID_QUERY2; } /* * If relcache does not exist, create it. */ if (!relcache) { relcache = pool_create_relcache(pool_config->relcache_size, query, int_register_func, int_unregister_func, true); if (relcache == NULL) { ereport(WARNING, (errmsg("unable to create relcache, getting OID from table name"))); return oid; } /* * Se do not cache if pgpool_regclass() returns 0, which indicates * there's no such a table. In this case we do not want to cache the * state because the table might be created later in this session. */ relcache->no_cache_if_zero = true; } /* * Search relcache. */ oid = (int) (intptr_t) pool_search_relcache(relcache, backend, table_name); return oid; } /* * Extract table oids from SELECT statement. Returns number of oids. * Oids are returned as an int array. The contents of oid array are * discarded by next call to this function. */ int pool_extract_table_oids_from_select_stmt(Node *node, SelectContext * ctx) { if (!node) return 0; if (!IsA(node, SelectStmt)) return 0; ctx->num_oids = 0; raw_expression_tree_walker(node, select_table_walker, ctx); return ctx->num_oids; } /* * Walker function to extract table oids from SELECT statement. */ static bool select_table_walker(Node *node, void *context) { SelectContext *ctx = (SelectContext *) context; int num_oids; if (node == NULL) return false; if (IsA(node, RangeVar)) { RangeVar *rgv = (RangeVar *) node; char *table; int oid; table = make_table_name_from_rangevar(rgv); oid = pool_table_name_to_oid(table); if (oid) { if (POOL_MAX_SELECT_OIDS <= ctx->num_oids) { ereport(DEBUG1, (errmsg("extracting table oids from SELECT statement"), errdetail("number of oids = %d exceeds the maximum limit = %d", ctx->num_oids, POOL_MAX_SELECT_OIDS))); return false; } num_oids = ctx->num_oids++; ctx->table_oids[num_oids] = oid; strlcpy(ctx->table_names[num_oids], table, POOL_NAMEDATALEN); ereport(DEBUG1, (errmsg("extracting table oids from SELECT statement"), errdetail("ctx->table_names[%d] = \"%s\"", num_oids, ctx->table_names[num_oids]))); } } /* Skip Data-Modifying Statements in SELECT. */ else if (IsA(node, InsertStmt) || IsA(node, DeleteStmt) || IsA(node, UpdateStmt)) { return false; } return raw_expression_tree_walker(node, select_table_walker, context); } /* * makeRangeVarFromNameList * Utility routine to convert a qualified-name list into RangeVar form. * * Copied from backend/catalog/namespace.c */ RangeVar * makeRangeVarFromNameList(List *names) { RangeVar *rel = makeRangeVar(NULL, NULL, -1); switch (list_length(names)) { case 1: rel->relname = strVal(linitial(names)); break; case 2: rel->schemaname = strVal(linitial(names)); rel->relname = strVal(lsecond(names)); break; case 3: rel->catalogname = strVal(linitial(names)); rel->schemaname = strVal(lsecond(names)); rel->relname = strVal(lthird(names)); break; default: ereport(WARNING, (errmsg("invalid relation name, too many indirections, while converting from table name to RangeVar"))); break; } return rel; } /* * Extract table name from RageVar. Make schema qualification name if * necessary. The returned table name is in static area. So next * call to this function will break previous result. */ char * make_table_name_from_rangevar(RangeVar *rangevar) { /* * Table name. Max size is calculated as follows: schema * name(POOL_NAMEDATALEN byte) + quotation marks for schmea name(2 byte) + * period(1 byte) + table name (POOL_NAMEDATALEN byte) + quotation marks * for table name(2 byte) + NULL(1 byte) */ static char tablename[POOL_NAMEDATALEN * 2 + 1 + 2 * 2 + 1]; if (rangevar == NULL) { ereport(WARNING, (errmsg("RangeVar argument is NULL, while getting table name from RangeVar"))); return ""; } if (!IsA(rangevar, RangeVar)) { ereport(WARNING, (errmsg("invalid argument, while getting table name from RangeVar"))); return ""; } *tablename = '\0'; if (rangevar->schemaname) { strcat(tablename, "\""); strncat(tablename, rangevar->schemaname, POOL_NAMEDATALEN); strcat(tablename, "\""); strcat(tablename, "."); } if (!rangevar->relname) { ereport(WARNING, (errmsg("relname is NULL in RangeVar, while getting table name from RangeVar"))); return ""; } strcat(tablename, "\""); strncat(tablename, rangevar->relname, POOL_NAMEDATALEN); strcat(tablename, "\""); ereport(DEBUG1, (errmsg("make table name from rangevar: tablename:\"%s\"", tablename))); return tablename; } pgpool-II-4.1.4/src/utils/strlcpy.c0000664000175000017500000000466313730350075014051 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-4.1.4/src/utils/psprintf.c0000664000175000017500000001302013730350127014177 00000000000000/*------------------------------------------------------------------------- * * psprintf.c * sprintf into an allocated-on-demand buffer * * 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/common/psprintf.c * *------------------------------------------------------------------------- */ #ifndef POOL_PRIVATE #include #include #include "pool.h" #include "utils/elog.h" #include "utils/palloc.h" #include "utils/memutils.h" #else #include #include "utils/fe_ports.h" /* It's possible we could use a different value for this in frontend code */ #define MaxAllocSize ((Size) 0x3fffffff) /* 1 gigabyte - 1 */ #endif /* * psprintf * * Format text data under the control of fmt (an sprintf-style format string) * and return it in an allocated-on-demand buffer. The buffer is allocated * with palloc in the backend, or malloc in frontend builds. Caller is * responsible to free the buffer when no longer needed, if appropriate. * * Errors are not returned to the caller, but are reported via elog(ERROR) * in the backend, or printf-to-stderr-and-exit() in frontend builds. * One should therefore think twice about using this in libpq. */ char * psprintf(const char *fmt,...) { size_t len = 128; /* initial assumption about buffer size */ for (;;) { char *result; va_list args; size_t newlen; /* * Allocate result buffer. Note that in frontend this maps to malloc * with exit-on-error. */ result = (char *) palloc(len); /* Try to format the data. */ va_start(args, fmt); newlen = pvsnprintf(result, len, fmt, args); va_end(args); if (newlen < len) return result; /* success */ /* Release buffer and loop around to try again with larger len. */ pfree(result); len = newlen; } } /* * pvsnprintf * * Attempt to format text data under the control of fmt (an sprintf-style * format string) and insert it into buf (which has length len, len > 0). * * If successful, return the number of bytes emitted, not counting the * trailing zero byte. This will always be strictly less than len. * * If there's not enough space in buf, return an estimate of the buffer size * needed to succeed (this *must* be more than the given len, else callers * might loop infinitely). * * Other error cases do not return, but exit via elog(ERROR) or exit(). * Hence, this shouldn't be used inside libpq. * * This function exists mainly to centralize our workarounds for * non-C99-compliant vsnprintf implementations. Generally, any call that * pays any attention to the return value should go through here rather * than calling snprintf or vsnprintf directly. * * Note that the semantics of the return value are not exactly C99's. * First, we don't promise that the estimated buffer size is exactly right; * callers must be prepared to loop multiple times to get the right size. * Second, we return the recommended buffer size, not one less than that; * this lets overflow concerns be handled here rather than in the callers. */ size_t pvsnprintf(char *buf, size_t len, const char *fmt, va_list args) { int nprinted; Assert(len > 0); errno = 0; /* * 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 buf[len - 1] = '\0'; #endif nprinted = vsnprintf(buf, len, fmt, args); Assert(buf[len - 1] == '\0'); /* * If vsnprintf reports an error other than ENOMEM, fail. The possible * causes of this are not user-facing errors, so elog should be enough. */ if (nprinted < 0 && errno != 0 && errno != ENOMEM) { #ifndef POOL_PRIVATE elog(ERROR, "vsnprintf failed: %m"); #else fprintf(stderr, "vsnprintf failed: %s\n", strerror(errno)); exit(EXIT_FAILURE); #endif } /* * Note: some versions of vsnprintf return the number of chars actually * stored, not the total space needed as C99 specifies. And at least one * returns -1 on failure. Be conservative about believing whether the * print worked. */ if (nprinted >= 0 && (size_t) nprinted < len - 1) { /* Success. Note nprinted does not include trailing null. */ return (size_t) nprinted; } if (nprinted >= 0 && (size_t) nprinted > len) { /* * This appears to be a C99-compliant vsnprintf, so believe its * estimate of the required space. (If it's wrong, the logic will * still work, but we may loop multiple times.) Note that the space * needed should be only nprinted+1 bytes, but we'd better allocate * one more than that so that the test above will succeed next time. * * In the corner case where the required space just barely overflows, * fall through so that we'll error out below (possibly after * looping). */ if ((size_t) nprinted <= MaxAllocSize - 2) return nprinted + 2; } /* * Buffer overrun, and we don't know how much space is needed. Estimate * twice the previous buffer size, but not more than MaxAllocSize; if we * are already at MaxAllocSize, choke. Note we use this palloc-oriented * overflow limit even when in frontend. */ if (len >= MaxAllocSize) { #ifndef POOL_PRIVATE ereport(ERROR, (errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED), errmsg("out of memory"))); #else fprintf(stderr, _("out of memory\n")); exit(EXIT_FAILURE); #endif } if (len >= MaxAllocSize / 2) return MaxAllocSize; return len * 2; } pgpool-II-4.1.4/src/utils/pool_params.c0000664000175000017500000000660313730350127014657 00000000000000/* -*-pgsql-c-*- */ /* * $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. * * params.c: Parameter Status handling routines * */ #include "config.h" #include #include #include "utils/elog.h" #include "pool.h" #include "parser/parser.h" #include "utils/palloc.h" #include "utils/memutils.h" #define MAX_PARAM_ITEMS 128 /* * initialize parameter structure */ int pool_init_params(ParamStatus * params) { MemoryContext oldContext = MemoryContextSwitchTo(TopMemoryContext); params->num = 0; params->names = palloc(MAX_PARAM_ITEMS * sizeof(char *)); params->values = palloc(MAX_PARAM_ITEMS * sizeof(char *)); MemoryContextSwitchTo(oldContext); return 0; } /* * discard parameter structure */ void pool_discard_params(ParamStatus * params) { int i; for (i = 0; i < params->num; i++) { pfree(params->names[i]); pfree(params->values[i]); } if (params->names) pfree(params->names); if (params->values) pfree(params->values); params->num = 0; params->names = NULL; params->values = NULL; } /* * find param value by name. if found, its value is returned * also, pos is set * if not found, NULL is returned */ char * pool_find_name(ParamStatus * params, char *name, int *pos) { int i; for (i = 0; i < params->num; i++) { if (!strcmp(name, params->names[i])) { *pos = i; return params->values[i]; } } return NULL; } /* * return name and value by index. */ int pool_get_param(ParamStatus * params, int index, char **name, char **value) { if (index < 0 || index >= params->num) return -1; *name = params->names[index]; *value = params->values[index]; return 0; } /* * add or replace name/value pair */ int pool_add_param(ParamStatus * params, char *name, char *value) { int pos; MemoryContext oldContext = MemoryContextSwitchTo(TopMemoryContext); if (pool_find_name(params, name, &pos)) { /* name already exists */ if (strlen(params->values[pos]) < strlen(value)) { params->values[pos] = repalloc(params->values[pos], strlen(value) + 1); } strcpy(params->values[pos], value); } else { int num; /* add name/value pair */ if (params->num >= MAX_PARAM_ITEMS) { ereport(ERROR, (errmsg("add parameter failed"), errdetail("no more room for num"))); } num = params->num; params->names[num] = pstrdup(name); params->values[num] = pstrdup(value); params->num++; } parser_set_param(name, value); MemoryContextSwitchTo(oldContext); return 0; } void pool_param_debug_print(ParamStatus * params) { int i; for (i = 0; i < params->num; i++) { ereport(DEBUG2, (errmsg("No.%d: name: %s value: %s", i, params->names[i], params->values[i]))); } } pgpool-II-4.1.4/src/utils/ps_status.c0000664000175000017500000002420313730350127014364 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-2012 PgPool Global Development Group * */ /*-------------------------------------------------------------------- * ps_status.c * * Routines to support changing the ps display of PostgreSQL backends * to contain some useful information. Mechanism differs wildly across * platforms. * * $PostgreSQL: pgsql/src/backend/utils/misc/ps_status.c,v 1.33 2006/10/04 00:30:04 momjian Exp $ * * Copyright (c) 2000-2006, PostgreSQL Global Development Group * various details abducted from various places *-------------------------------------------------------------------- */ #include #ifdef HAVE_SYS_PSTAT_H #include /* for HP-UX */ #endif #ifdef HAVE_PS_STRINGS #include /* for old BSD */ #include #endif #if defined(__darwin__) #include #endif #include "pool.h" #include #include extern char **environ; bool update_process_title = true; /* * Alternative ways of updating ps display: * * PS_USE_SETPROCTITLE * use the function setproctitle(const char *, ...) * (newer BSD systems) * PS_USE_PSTAT * use the pstat(PSTAT_SETCMD, ) * (HPUX) * PS_USE_PS_STRINGS * assign PS_STRINGS->ps_argvstr = "string" * (some BSD systems) * PS_USE_CHANGE_ARGV * assign argv[0] = "string" * (some other BSD systems) * PS_USE_CLOBBER_ARGV * write over the argv and environment area * (most SysV-like systems) * PS_USE_WIN32 * push the string out as the name of a Windows event * PS_USE_NONE * don't update ps display * (This is the default, as it is safest.) */ #if defined(HAVE_SETPROCTITLE) #define PS_USE_SETPROCTITLE #elif defined(HAVE_PSTAT) && defined(PSTAT_SETCMD) #define PS_USE_PSTAT #elif defined(HAVE_PS_STRINGS) #define PS_USE_PS_STRINGS #elif (defined(BSD) || defined(__bsdi__) || defined(__hurd__)) && !defined(__darwin__) #define PS_USE_CHANGE_ARGV #elif defined(__linux__) || defined(_AIX) || defined(__sgi) || (defined(sun) && !defined(BSD)) || defined(ultrix) || defined(__ksr__) || defined(__osf__) || defined(__svr4__) || defined(__svr5__) || defined(__darwin__) #define PS_USE_CLOBBER_ARGV #elif defined(WIN32) #define PS_USE_WIN32 #else #define PS_USE_NONE #endif /* Different systems want the buffer padded differently */ #if defined(_AIX) || defined(__linux__) || defined(__svr4__) #define PS_PADDING '\0' #else #define PS_PADDING ' ' #endif #ifndef PS_USE_CLOBBER_ARGV /* all but one options need a buffer to write their ps line in */ #define PS_BUFFER_SIZE 256 static char ps_buffer[PS_BUFFER_SIZE]; static const size_t ps_buffer_size = PS_BUFFER_SIZE; #else /* PS_USE_CLOBBER_ARGV */ static char *ps_buffer; /* will point to argv area */ static size_t ps_buffer_size; /* space determined at run time */ #endif /* PS_USE_CLOBBER_ARGV */ static size_t ps_buffer_fixed_size; /* size of the constant prefix */ /* save the original argv[] location here */ static int save_argc; static char **save_argv; /* * Call this early in startup to save the original argc/argv values. * If needed, we make a copy of the original argv[] array to preserve it * from being clobbered by subsequent ps_display actions. * * (The original argv[] will not be overwritten by this routine, but may be * overwritten during init_ps_display. Also, the physical location of the * environment strings may be moved, so this should be called before any code * that might try to hang onto a getenv() result.) */ char ** save_ps_display_args(int argc, char **argv) { save_argc = argc; save_argv = argv; #if defined(PS_USE_CLOBBER_ARGV) /* * If we're going to overwrite the argv area, count the available space. * Also move the environment to make additional room. */ { char *end_of_area = NULL; char **new_environ; int i; /* * check for contiguous argv strings */ for (i = 0; i < argc; i++) { if (i == 0 || end_of_area + 1 == argv[i]) end_of_area = argv[i] + strlen(argv[i]); } if (end_of_area == NULL) /* probably can't happen? */ { ps_buffer = NULL; ps_buffer_size = 0; return argv; } /* * check for contiguous environ strings following argv */ for (i = 0; environ[i] != NULL; i++) { if (end_of_area + 1 == environ[i]) end_of_area = environ[i] + strlen(environ[i]); } ps_buffer = argv[0]; ps_buffer_size = end_of_area - argv[0]; /* * move the environment out of the way */ new_environ = (char **) malloc((i + 1) * sizeof(char *)); for (i = 0; environ[i] != NULL; i++) new_environ[i] = strdup(environ[i]); new_environ[i] = NULL; environ = new_environ; } #endif /* PS_USE_CLOBBER_ARGV */ #if defined(PS_USE_CHANGE_ARGV) || defined(PS_USE_CLOBBER_ARGV) /* * If we're going to change the original argv[] then make a copy for * argument parsing purposes. * * (NB: do NOT think to remove the copying of argv[], even though * postmaster.c finishes looking at argv[] long before we ever consider * changing the ps display. On some platforms, getopt() keeps pointers * into the argv array, and will get horribly confused when it is * re-called to analyze a subprocess' argument string if the argv storage * has been clobbered meanwhile. Other platforms have other dependencies * on argv[]. */ { char **new_argv; int i; new_argv = (char **) malloc((argc + 1) * sizeof(char *)); for (i = 0; i < argc; i++) new_argv[i] = strdup(argv[i]); new_argv[argc] = NULL; #if defined(__darwin__) /* * Darwin (and perhaps other NeXT-derived platforms?) has a static * copy of the argv pointer, which we may fix like so: */ *_NSGetArgv() = new_argv; #endif argv = new_argv; } #endif /* PS_USE_CHANGE_ARGV or PS_USE_CLOBBER_ARGV */ return argv; } /* * Call this once during subprocess startup to set the identification * values. At this point, the original argv[] array may be overwritten. */ void init_ps_display(const char *username, const char *dbname, const char *host_info, const char *initial_str) { #ifndef PS_USE_NONE /* no ps display if you didn't call save_ps_display_args() */ if (!save_argv) return; #ifdef PS_USE_CLOBBER_ARGV /* If ps_buffer is a pointer, it might still be null */ if (!ps_buffer) return; #endif /* * Overwrite argv[] to point at appropriate space, if needed */ #ifdef PS_USE_CHANGE_ARGV save_argv[0] = ps_buffer; save_argv[1] = NULL; #endif /* PS_USE_CHANGE_ARGV */ #ifdef PS_USE_CLOBBER_ARGV { int i; /* make extra argv slots point at end_of_area (a NUL) */ for (i = 1; i < save_argc; i++) save_argv[i] = ps_buffer + ps_buffer_size; } #endif /* PS_USE_CLOBBER_ARGV */ /* * Make fixed prefix of ps display. */ #ifdef PS_USE_SETPROCTITLE /* * apparently setproctitle() already adds a `progname: ' prefix to the ps * line */ snprintf(ps_buffer, ps_buffer_size, ""); #else snprintf(ps_buffer, ps_buffer_size, "pgpool: "); #endif ps_buffer_fixed_size = strlen(ps_buffer); set_ps_display(initial_str, true); #endif /* not PS_USE_NONE */ } /* * Call this to update the ps status display to a fixed prefix plus an * indication of what you're currently doing passed in the argument. */ void set_ps_display(const char *activity, bool force) { if (!force && !update_process_title) return; #ifndef PS_USE_NONE #ifdef PS_USE_CLOBBER_ARGV /* If ps_buffer is a pointer, it might still be null */ if (!ps_buffer) return; #endif /* Update ps_buffer to contain both fixed part and activity */ strlcpy(ps_buffer + ps_buffer_fixed_size, activity, ps_buffer_size - ps_buffer_fixed_size); /* Transmit new setting to kernel, if necessary */ #ifdef PS_USE_SETPROCTITLE setproctitle("%s", ps_buffer); #endif #ifdef PS_USE_PSTAT { union pstun pst; pst.pst_command = ps_buffer; pstat(PSTAT_SETCMD, pst, strlen(ps_buffer), 0, 0); } #endif /* PS_USE_PSTAT */ #ifdef PS_USE_PS_STRINGS PS_STRINGS->ps_nargvstr = 1; PS_STRINGS->ps_argvstr = ps_buffer; #endif /* PS_USE_PS_STRINGS */ #ifdef PS_USE_CLOBBER_ARGV { int buflen; /* pad unused memory */ buflen = strlen(ps_buffer); memset(ps_buffer + buflen, PS_PADDING, ps_buffer_size - buflen); } #endif /* PS_USE_CLOBBER_ARGV */ #ifdef PS_USE_WIN32 { /* * Win32 does not support showing any changed arguments. To make it at * all possible to track which backend is doing what, we create a * named object that can be viewed with for example Process Explorer. */ static HANDLE ident_handle = INVALID_HANDLE_VALUE; char name[PS_BUFFER_SIZE + 32]; if (ident_handle != INVALID_HANDLE_VALUE) CloseHandle(ident_handle); sprintf(name, "pgident: %s", ps_buffer); ident_handle = CreateEvent(NULL, TRUE, FALSE, name); } #endif /* PS_USE_WIN32 */ #endif /* not PS_USE_NONE */ } /* * Returns what's currently in the ps display, in case someone needs * it. Note that only the activity part is returned. On some platforms * the string will not be null-terminated, so return the effective * length into *displen. */ const char * get_ps_display(int *displen) { #ifdef PS_USE_CLOBBER_ARGV size_t offset; /* If ps_buffer is a pointer, it might still be null */ if (!ps_buffer) { *displen = 0; return ""; } /* Remove any trailing spaces to offset the effect of PS_PADDING */ offset = ps_buffer_size; while (offset > ps_buffer_fixed_size && ps_buffer[offset - 1] == PS_PADDING) offset--; *displen = offset - ps_buffer_fixed_size; #else *displen = strlen(ps_buffer + ps_buffer_fixed_size); #endif return ps_buffer + ps_buffer_fixed_size; } /* * Show ps idle status */ void pool_ps_idle_display(POOL_CONNECTION_POOL * backend) { StartupPacket *sp; char psbuf[1024]; sp = MASTER_CONNECTION(backend)->sp; if (MASTER(backend)->tstate == 'T') snprintf(psbuf, sizeof(psbuf), "%s %s %s idle in transaction", sp->user, sp->database, remote_ps_data); else snprintf(psbuf, sizeof(psbuf), "%s %s %s idle", sp->user, sp->database, remote_ps_data); set_ps_display(psbuf, false); } pgpool-II-4.1.4/src/utils/pool_shmem.c0000664000175000017500000000700313730350075014502 00000000000000/* -*-pgsql-c-*- */ /* * $Header$ * * pgpool: a language independent connection pool server for PostgreSQL * written by Tatsuo Ishii * * Portions Copyright (c) 2003-2011, 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. * */ #include "pool.h" #include "utils/elog.h" #include #include #include #include "utils/pool_ipc.h" #ifdef SHM_SHARE_MMU /* use intimate shared memory on Solaris */ #define PG_SHMAT_FLAGS SHM_SHARE_MMU #else #define PG_SHMAT_FLAGS 0 #endif static void IpcMemoryDetach(int status, Datum shmaddr); static void IpcMemoryDelete(int status, Datum shmId); /* * Create a shared memory segment of the given size and initialize. Also, * register an on_shmem_exit callback to release the storage. */ void * pool_shared_memory_create(size_t size) { int shmid; void *memAddress; /* Try to create new segment */ shmid = shmget(IPC_PRIVATE, size, IPC_CREAT | IPC_EXCL | IPCProtection); if (shmid < 0) ereport(FATAL, (errmsg("could not create shared memory for request size: %ld", size), errdetail("shared memory creation failed with error \"%s\"", strerror(errno)))); /* Register on-exit routine to delete the new segment */ on_shmem_exit(IpcMemoryDelete, shmid); /* OK, should be able to attach to the segment */ memAddress = shmat(shmid, NULL, PG_SHMAT_FLAGS); if (memAddress == (void *) -1) ereport(FATAL, (errmsg("could not create shared memory for request size: %ld", size), errdetail("attach to shared memory [id:%d] failed with reason: \"%s\"", shmid, strerror(errno)))); /* Register on-exit routine to detach new segment before deleting */ on_shmem_exit(IpcMemoryDetach, (Datum) memAddress); return memAddress; } /* * Removes a shared memory segment from process' address spaceq (called as * an on_shmem_exit callback, hence funny argument list) */ static void IpcMemoryDetach(int status, Datum shmaddr) { if (shmdt((void *) shmaddr) < 0) ereport(LOG, (errmsg("removing shared memory segments"), errdetail("shmdt(%p) failed: %s", (void *) shmaddr, strerror(errno)))); } /* * Deletes a shared memory segment (called as an on_shmem_exit callback, * hence funny argument list) */ static void IpcMemoryDelete(int status, Datum shmId) { struct shmid_ds shmStat; /* * Is a previously-existing shmem segment still existing and in use? */ if (shmctl(shmId, IPC_STAT, &shmStat) < 0 && (errno == EINVAL || errno == EACCES)) return; #ifdef NOT_USED else if (shmStat.shm_nattch != 0) return; #endif if (shmctl(shmId, IPC_RMID, NULL) < 0) ereport(LOG, (errmsg("deleting shared memory segments"), errdetail("shmctl(%lu, %d, 0) failed: %s", shmId, IPC_RMID, strerror(errno)))); } void pool_shmem_exit(int code) { shmem_exit(code); /* Close syslog connection here as this function is always called on exit */ closelog(); } pgpool-II-4.1.4/src/utils/pool_sema.c0000664000175000017500000001117713730350075014325 00000000000000/* -*-pgsql-c-*- */ /* * $Header$ * * pgpool: a language independent connection pool server for PostgreSQL * written by Tatsuo Ishii * * Portions Copyright (c) 2003-2014, 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. * */ #include "pool.h" #include #include #include #include "utils/elog.h" #include "utils/pool_ipc.h" #ifndef HAVE_UNION_SEMUN union semun { int val; struct semid_ds *buf; unsigned short *array; }; #endif static int semId; /* * Removes a semaphore set. */ static void IpcSemaphoreKill(int status, Datum semId) { union semun semun; struct semid_ds seminfo; /* * Is a previously-existing sema segment still existing and in use? */ semun.buf = &seminfo; if (semctl(semId, 0, IPC_STAT, semun) < 0 && (errno == EINVAL || errno == EACCES #ifdef EIDRM || errno == EIDRM #endif )) return; semun.val = 0; /* unused, but keep compiler quiet */ if (semctl(semId, 0, IPC_RMID) < 0) ereport(LOG, (errmsg("removing semaphore set"), errdetail("semctl(%lu, 0, IPC_RMID, ...) failed: %s", semId, strerror(errno)))); } /* * Create a semaphore set and initialize. */ void pool_semaphore_create(int numSems) { int i; /* Try to create new semaphore set */ semId = semget(IPC_PRIVATE, numSems, IPC_CREAT | IPC_EXCL | IPCProtection); if (semId < 0) ereport(FATAL, (errmsg("Unable to create semaphores:%d error:\"%s\"", numSems, strerror(errno)))); on_shmem_exit(IpcSemaphoreKill, semId); /* Initialize it to count 1 */ for (i = 0; i < numSems; i++) { union semun semun; semun.val = 1; if (semctl(semId, i, SETVAL, semun) < 0) ereport(FATAL, (errmsg("Unable to create semaphores:%d error:\"%s\"", numSems, strerror(errno)), errdetail("semctl(%d, %d, SETVAL, %d) failed", semId, i, semun.val))); } } /* * Lock a semaphore (decrement count), blocking if count would be < 0 */ void pool_semaphore_lock(int semNum) { int errStatus; struct sembuf sops; sops.sem_op = -1; /* decrement */ sops.sem_flg = SEM_UNDO; sops.sem_num = semNum; /* * Note: if errStatus is -1 and errno == EINTR then it means we returned * from the operation prematurely because we were sent a signal. So we * try and lock the semaphore again. */ do { errStatus = semop(semId, &sops, 1); } while (errStatus < 0 && errno == EINTR); if (errStatus < 0) ereport(WARNING, (errmsg("failed to lock semaphore error:\"%s\"", strerror(errno)))); } /* * Lock a semaphore (decrement count), blocking if count would be < 0. * Unlike pool_semaphore_lock, this returns if interrupted. * Return values: * 0: succeeded in acquiring lock. * -1: error. * -2: interrupted. */ int pool_semaphore_lock_allow_interrupt(int semNum) { int errStatus; struct sembuf sops; sops.sem_op = -1; /* decrement */ sops.sem_flg = SEM_UNDO; sops.sem_num = semNum; /* * Note: if errStatus is -1 and errno == EINTR then it means we returned * from the operation prematurely because we were sent a signal. */ errStatus = semop(semId, &sops, 1); if (errStatus < 0) { if (errno == EINTR) { ereport(DEBUG1, (errmsg("interrupted while trying to lock semaphore"))); return -2; } else { ereport(WARNING, (errmsg("failed to lock semaphore error:\"%s\"", strerror(errno)))); return -1; } } return 0; } /* * Unlock a semaphore (increment count) */ void pool_semaphore_unlock(int semNum) { int errStatus; struct sembuf sops; sops.sem_op = 1; /* increment */ sops.sem_flg = SEM_UNDO; sops.sem_num = semNum; /* * Note: if errStatus is -1 and errno == EINTR then it means we returned * from the operation prematurely because we were sent a signal. So we * try and unlock the semaphore again. Not clear this can really happen, * but might as well cope. */ do { errStatus = semop(semId, &sops, 1); } while (errStatus < 0 && errno == EINTR); if (errStatus < 0) ereport(WARNING, (errmsg("failed to unlock semaphore error:\"%s\"", strerror(errno)))); } pgpool-II-4.1.4/src/utils/pool_signal.c0000664000175000017500000001137513730350127014653 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. we make a little exception * for pcp process children, since their they want to signal the main * pgpool-II process but main process is not the direct parent */ if (processType != PT_PCP_WORKER && 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 signal:%d to the parent process with PID:%d", sig, mypid))); return kill(mypid, sig); } #endif /* WIN32 */ pgpool-II-4.1.4/src/utils/pool_path.c0000664000175000017500000001705113730350075014331 00000000000000/* -*-pgsql-c-*- */ /* * * $Header$ * * pgpool: a language independent connection pool server for PostgreSQL * written by Tatsuo Ishii * * Portions Copyright (c) 2003-2017, PgPool Global Development Group * Portions Copyright (c) 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. * * pool_path.c.: small functions to manipulate paths * */ #include "pool.h" #include "utils/pool_path.h" #include #include #include #include #include #include "utils/elog.h" #include "utils/palloc.h" #include "utils/memutils.h" static void trim_directory(char *path); static void trim_trailing_separator(char *path); static int pqGetpwuid(uid_t uid, struct passwd *resultbuf, char *buffer, size_t buflen, struct passwd **result); /* * get_parent_directory * * Modify the given string in-place to name the parent directory of the * named file. */ void get_parent_directory(char *path) { trim_directory(path); } /* * Obtain user's home directory, return in given buffer */ bool get_home_directory(char *buf, int bufsize) { char pwdbuf[BUFSIZ]; struct passwd pwdstr; struct passwd *pwd = NULL; if (pqGetpwuid(geteuid(), &pwdstr, pwdbuf, sizeof(pwdbuf), &pwd) != 0) return false; strlcpy(buf, pwd->pw_dir, bufsize); return true; } /* * Obtain user name, return in given buffer */ bool get_os_username(char *buf, int bufsize) { char pwdbuf[BUFSIZ]; struct passwd pwdstr; struct passwd *pwd = NULL; if (pqGetpwuid(geteuid(), &pwdstr, pwdbuf, sizeof(pwdbuf), &pwd) != 0) return false; strlcpy(buf, pwd->pw_name, bufsize); return true; } /* stolen from PostgreSQL src/port/thread.c * XXX: This is from 9.4 but the latest pgsql have changed this. */ /* * Wrapper around getpwuid() or getpwuid_r() to mimic POSIX getpwuid_r() * behaviour, if it is not available or required. */ static int pqGetpwuid(uid_t uid, struct passwd *resultbuf, char *buffer, size_t buflen, struct passwd **result) { #if defined(HAVE_GETPWUID_R) #ifdef GETPWUID_R_5ARG /* POSIX version */ getpwuid_r(uid, resultbuf, buffer, buflen, result); #else /* * Early POSIX draft of getpwuid_r() returns 'struct passwd *'. * getpwuid_r(uid, resultbuf, buffer, buflen) */ *result = getpwuid_r(uid, resultbuf, buffer, buflen); #endif #else /* no getpwuid_r() available, just use getpwuid() */ *result = getpwuid(uid); #endif return (*result == NULL) ? -1 : 0; } /* * trim_directory * * Trim trailing directory from path, that is, remove any trailing slashes, * the last pathname component, and the slash just ahead of it --- but never * remove a leading slash. */ static void trim_directory(char *path) { char *p; if (path[0] == '\0') return; /* back up over trailing slash(es) */ for (p = path + strlen(path) - 1; IS_DIR_SEP(*p) && p > path; p--); /* back up over directory name */ for (; !IS_DIR_SEP(*p) && p > path; p--); /* if multiple slashes before directory name, remove 'em all */ for (; p > path && IS_DIR_SEP(*(p - 1)); p--); /* don't erase a leading slash */ if (p == path && IS_DIR_SEP(*p)) p++; *p = '\0'; } /* * join_path_components - join two path components, inserting a slash * * ret_path is the output area (must be of size MAXPGPATH) * * ret_path can be the same as head, but not the same as tail. */ void join_path_components(char *ret_path, const char *head, const char *tail) { if (ret_path != head) StrNCpy(ret_path, head, MAXPGPATH); /* * Remove any leading "." and ".." in the tail component, adjusting head * as needed. */ for (;;) { if (tail[0] == '.' && IS_DIR_SEP(tail[1])) { tail += 2; } else if (tail[0] == '.' && tail[1] == '\0') { tail += 1; break; } else if (tail[0] == '.' && tail[1] == '.' && IS_DIR_SEP(tail[2])) { trim_directory(ret_path); tail += 3; } else if (tail[0] == '.' && tail[1] == '.' && tail[2] == '\0') { trim_directory(ret_path); tail += 2; break; } else break; } if (*tail) snprintf(ret_path + strlen(ret_path), MAXPGPATH - strlen(ret_path), "/%s", tail); } /* * Clean up path by: * o remove trailing slash * o remove duplicate adjacent separators * o remove trailing '.' * o process trailing '..' ourselves */ void canonicalize_path(char *path) { char *p, *to_p; bool was_sep = false; /* * Removing the trailing slash on a path means we never get ugly double * trailing slashes. */ trim_trailing_separator(path); /* * Remove duplicate adjacent separators */ p = path; to_p = p; for (; *p; p++, to_p++) { /* Handle many adjacent slashes, like "/a///b" */ while (*p == '/' && was_sep) p++; if (to_p != p) *to_p = *p; was_sep = (*p == '/'); } *to_p = '\0'; /* * Remove any trailing uses of "." and process ".." ourselves */ for (;;) { int len = strlen(path); if (len > 2 && strcmp(path + len - 2, "/.") == 0) trim_directory(path); else if (len > 3 && strcmp(path + len - 3, "/..") == 0) { trim_directory(path); trim_directory(path); /* remove directory above */ } else break; } } /* * last_dir_separator * * Find the location of the last directory separator, return * NULL if not found. */ char * last_dir_separator(const char *filename) { const char *p, *ret = NULL; for (p = filename; *p; p++) if (IS_DIR_SEP(*p)) ret = p; return (char *) ret; } /* * trim_trailing_separator * * trim off trailing slashes, but not a leading slash */ static void trim_trailing_separator(char *path) { char *p; p = path + strlen(path); if (p > path) for (p--; p > path && IS_DIR_SEP(*p); p--) *p = '\0'; } char * get_current_working_dir(void) { char *buf = NULL; size_t buflen = MAXPGPATH; for (;;) { buf = palloc(buflen); if (getcwd(buf, buflen)) break; else if (errno == ERANGE) { pfree(buf); buflen *= 2; continue; } else { int save_errno = errno; pfree(buf); errno = save_errno; ereport(ERROR, (errmsg("could not get current working directory: %m"))); return NULL; } } return buf; } /* * make_absolute_path * * If the given pathname isn't already absolute, make it so, interpreting * it relative to the current working directory. * * if arg base_dir is NULL, The function gets the current cwd * Also canonicalizes the path. The result is always a palloc'd copy. * * Logic borrowed from PostgreSQL source */ char * make_absolute_path(const char *path, const char *base_dir) { char *new; /* Returning null for null input is convenient for some callers */ if (path == NULL) return NULL; if (!is_absolute_path(path)) { const char *cwd = NULL; if (base_dir == NULL) { cwd = get_current_working_dir(); if (!cwd) return NULL; } else cwd = base_dir; new = palloc(strlen(cwd) + strlen(path) + 2); sprintf(new, "%s/%s", cwd, path); if (!base_dir) pfree((void *) cwd); } else { new = pstrdup(path); } /* Make sure punctuation is canonical, too */ canonicalize_path(new); return new; } pgpool-II-4.1.4/src/utils/pool_ip.c0000664000175000017500000003570313730350075014011 00000000000000/* -*-pgsql-c-*- */ /* * * $Header$ * * This file was imported from PostgreSQL 8.0.8 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-2019 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 and the IPV6 implementation were initially provided by * Nigel Kukard , Linux Based Systems Design * http://www.lbsd.net. * * pool_ip.c.: IPv6-aware network access. * */ #include #include #include #include #include #include #include #include #include #include #include #include #include "pool.h" #include "utils/pool_ip.h" #include "pool_config.h" #include "utils/elog.h" static int rangeSockAddrAF_INET(const struct sockaddr_in *addr, const struct sockaddr_in *netaddr, const struct sockaddr_in *netmask); static int rangeSockAddrAF_INET6(const struct sockaddr_in6 *addr, const struct sockaddr_in6 *netaddr, const struct sockaddr_in6 *netmask); static int getaddrinfo_unix(const char *path, const struct addrinfo *hintsp, struct addrinfo **result); static int getnameinfo_unix(const struct sockaddr_un *sa, int salen, char *node, int nodelen, char *service, int servicelen, int flags); /* * pool_getnameinfo_all - get name info for Unix, IPv4 and IPv6 sockets * caller MUST allocate NI_MAXHOST, NI_MAXSERV bytes for remote_host and remote_port */ void pool_getnameinfo_all(SockAddr *saddr, char *remote_host, char *remote_port) { remote_host[0] = '\0'; remote_port[0] = '\0'; if (getnameinfo_all(&saddr->addr, saddr->salen, remote_host, NI_MAXHOST, remote_port, NI_MAXSERV, (pool_config->log_hostname ? 0 : NI_NUMERICHOST) | NI_NUMERICSERV)) { int ret = getnameinfo_all(&saddr->addr, saddr->salen, remote_host, NI_MAXHOST, remote_port, NI_MAXSERV, NI_NUMERICHOST | NI_NUMERICSERV); if (ret) ereport(WARNING, (errmsg("getnameinfo failed with error: \"%s\"", gai_strerror(ret)))); } } /* * getaddrinfo_all - get address info for Unix, IPv4 and IPv6 sockets */ int getaddrinfo_all(const char *hostname, const char *servname, const struct addrinfo *hintp, struct addrinfo **result) { /* not all versions of getaddrinfo() zero *result on failure */ *result = NULL; if (hintp->ai_family == AF_UNIX) return getaddrinfo_unix(servname, hintp, result); /* NULL has special meaning to getaddrinfo(). */ return getaddrinfo((!hostname || hostname[0] == '\0') ? NULL : hostname, servname, hintp, result); } /* * freeaddrinfo_all - free addrinfo structures for IPv4, IPv6, or Unix * * Note: the ai_family field of the original hint structure must be passed * so that we can tell whether the addrinfo struct was built by the system's * getaddrinfo() routine or our own getaddrinfo_unix() routine. Some versions * of getaddrinfo() might be willing to return AF_UNIX addresses, so it's * not safe to look at ai_family in the addrinfo itself. */ void freeaddrinfo_all(int hint_ai_family, struct addrinfo *ai) { if (hint_ai_family == AF_UNIX) { /* struct was built by getaddrinfo_unix (see getaddrinfo_all) */ while (ai != NULL) { struct addrinfo *p = ai; ai = ai->ai_next; free(p->ai_addr); free(p); } } else { /* struct was built by getaddrinfo() */ if (ai != NULL) freeaddrinfo(ai); } } /* * getnameinfo_all - get name info for Unix, IPv4 and IPv6 sockets * * The API of this routine differs from the standard getnameinfo() definition * in two ways: first, the addr parameter is declared as sockaddr_storage * rather than struct sockaddr, and second, the node and service fields are * guaranteed to be filled with something even on failure return. */ int getnameinfo_all(const struct sockaddr_storage *addr, int salen, char *node, int nodelen, char *service, int servicelen, int flags) { int rc; if (addr && addr->ss_family == AF_UNIX) { rc = getnameinfo_unix((const struct sockaddr_un *) addr, salen, node, nodelen, service, servicelen, flags); } else { rc = getnameinfo((const struct sockaddr *) addr, salen, node, nodelen, service, servicelen, flags); } if (rc != 0) { if (node) strncpy(node, "???", nodelen); if (service) strncpy(service, "???", servicelen); } return rc; } #ifndef HAVE_GAI_STRERROR const char * gai_strerror(int errcode) { #ifdef HAVE_HSTRERROR int hcode; switch (errcode) { case EAI_NONAME: hcode = HOST_NOT_FOUND; break; case EAI_AGAIN: hcode = TRY_AGAIN; break; case EAI_FAIL: default: hcode = NO_RECOVERY; break; } return hstrerror(hcode); #else /* !HAVE_HSTRERROR */ switch (errcode) { case EAI_NONAME: return "Unknown host"; case EAI_AGAIN: return "Host name lookup failure"; /* Errors below are probably WIN32 only */ #ifdef EAI_BADFLAGS case EAI_BADFLAGS: return "Invalid argument"; #endif #ifdef EAI_FAMILY case EAI_FAMILY: return "Address family not supported"; #endif #ifdef EAI_MEMORY case EAI_MEMORY: return "Not enough memory"; #endif #ifdef EAI_NODATA #ifndef WIN32_ONLY_COMPILER /* MSVC complains because another case has the * same value */ case EAI_NODATA: return "No host data of that type was found"; #endif #endif #ifdef EAI_SERVICE case EAI_SERVICE: return "Class type not found"; #endif #ifdef EAI_SOCKTYPE case EAI_SOCKTYPE: return "Socket type not supported"; #endif default: return "Unknown server error"; } #endif /* HAVE_HSTRERROR */ } #endif /* HAVE_GAI_STRERROR */ /* * getaddrinfo_unix - get unix socket info using IPv6-compatible API * * Bugs: only one addrinfo is set even though hintsp is NULL or * ai_socktype is 0 * AI_CANONNAME is not supported. * */ static int getaddrinfo_unix(const char *path, const struct addrinfo *hintsp, struct addrinfo **result) { struct addrinfo hints; struct addrinfo *aip; struct sockaddr_un *unp; *result = NULL; memset(&hints, 0, sizeof(hints)); if (strlen(path) >= sizeof(unp->sun_path)) return EAI_FAIL; if (hintsp == NULL) { hints.ai_family = AF_UNIX; hints.ai_socktype = SOCK_STREAM; } else memcpy(&hints, hintsp, sizeof(hints)); if (hints.ai_socktype == 0) hints.ai_socktype = SOCK_STREAM; if (hints.ai_family != AF_UNIX) { /* shouldn't have been called */ return EAI_FAIL; } aip = calloc(1, sizeof(struct addrinfo)); if (aip == NULL) return EAI_MEMORY; unp = calloc(1, sizeof(struct sockaddr_un)); if (unp == NULL) { free(aip); return EAI_MEMORY; } aip->ai_family = AF_UNIX; aip->ai_socktype = hints.ai_socktype; aip->ai_protocol = hints.ai_protocol; aip->ai_next = NULL; aip->ai_canonname = NULL; *result = aip; unp->sun_family = AF_UNIX; aip->ai_addr = (struct sockaddr *) unp; aip->ai_addrlen = sizeof(struct sockaddr_un); strcpy(unp->sun_path, path); #ifdef HAVE_STRUCT_SOCKADDR_STORAGE_SS_LEN unp->sun_len = sizeof(struct sockaddr_un); #endif return 0; } /* * Convert an address to a hostname. */ static int getnameinfo_unix(const struct sockaddr_un *sa, int salen, char *node, int nodelen, char *service, int servicelen, int flags) { int ret = -1; /* Invalid arguments. */ if (sa == NULL || sa->sun_family != AF_UNIX || (node == NULL && service == NULL)) return EAI_FAIL; /* We don't support those. */ if ((node && !(flags & NI_NUMERICHOST)) || (service && !(flags & NI_NUMERICSERV))) return EAI_FAIL; if (node) { ret = snprintf(node, nodelen, "%s", "[local]"); if (ret == -1 || ret > nodelen) return EAI_MEMORY; } if (service) { ret = snprintf(service, servicelen, "%s", sa->sun_path); if (ret == -1 || ret > servicelen) return EAI_MEMORY; } return 0; } static int rangeSockAddrAF_INET(const struct sockaddr_in *addr, const struct sockaddr_in *netaddr, const struct sockaddr_in *netmask) { if (((addr->sin_addr.s_addr ^ netaddr->sin_addr.s_addr) & netmask->sin_addr.s_addr) == 0) return 1; else return 0; } static int rangeSockAddrAF_INET6(const struct sockaddr_in6 *addr, const struct sockaddr_in6 *netaddr, const struct sockaddr_in6 *netmask) { int i; for (i = 0; i < 16; i++) { if (((addr->sin6_addr.s6_addr[i] ^ netaddr->sin6_addr.s6_addr[i]) & netmask->sin6_addr.s6_addr[i]) != 0) return 0; } return 1; } /* * SockAddr_cidr_mask - make a network mask of the appropriate family * and required number of significant bits * * numbits can be null, in which case the mask is fully set. * * The resulting mask is placed in *mask, which had better be big enough. * * Return value is 0 if okay, -1 if not. */ int SockAddr_cidr_mask(struct sockaddr_storage *mask, char *numbits, int family) { long bits; char *endptr; if (numbits == NULL) { bits = (family == AF_INET) ? 32 : 128; } else { bits = strtol(numbits, &endptr, 10); if (*numbits == '\0' || *endptr != '\0') return -1; } switch (family) { case AF_INET: { struct sockaddr_in mask4; long maskl; if (bits < 0 || bits > 32) return -1; /* avoid "x << 32", which is not portable */ if (bits > 0) maskl = (0xffffffffUL << (32 - (int) bits)) & 0xffffffffUL; else maskl = 0; memset(&mask4, 0, sizeof(mask4)); mask4.sin_addr.s_addr = htonl(maskl); memcpy(mask, &mask4, sizeof(mask4)); break; } case AF_INET6: { struct sockaddr_in6 mask6; int i; memset(&mask6, 0, sizeof(mask6)); if (bits < 0 || bits > 128) return -1; for (i = 0; i < 16; i++) { if (bits <= 0) mask6.sin6_addr.s6_addr[i] = 0; else if (bits >= 8) mask6.sin6_addr.s6_addr[i] = 0xff; else { mask6.sin6_addr.s6_addr[i] = (0xff << (8 - (int) bits)) & 0xff; } bits -= 8; } memcpy(mask, &mask6, sizeof(mask6)); break; } default: return -1; } mask->ss_family = family; return 0; } /* * promote_v4_to_v6_addr --- convert an AF_INET addr to AF_INET6, using * the standard convention for IPv4 addresses mapped into IPv6 world * * The passed addr is modified in place; be sure it is large enough to * hold the result! Note that we only worry about setting the fields * that rangeSockAddr will look at. */ void promote_v4_to_v6_addr(struct sockaddr_storage *addr) { struct sockaddr_in addr4; struct sockaddr_in6 addr6; uint32 ip4addr; memcpy(&addr4, addr, sizeof(addr4)); ip4addr = ntohl(addr4.sin_addr.s_addr); memset(&addr6, 0, sizeof(addr6)); addr6.sin6_family = AF_INET6; addr6.sin6_addr.s6_addr[10] = 0xff; addr6.sin6_addr.s6_addr[11] = 0xff; addr6.sin6_addr.s6_addr[12] = (ip4addr >> 24) & 0xFF; addr6.sin6_addr.s6_addr[13] = (ip4addr >> 16) & 0xFF; addr6.sin6_addr.s6_addr[14] = (ip4addr >> 8) & 0xFF; addr6.sin6_addr.s6_addr[15] = (ip4addr) & 0xFF; memcpy(addr, &addr6, sizeof(addr6)); } /* * promote_v4_to_v6_mask --- convert an AF_INET netmask to AF_INET6, using * the standard convention for IPv4 addresses mapped into IPv6 world * * This must be different from promote_v4_to_v6_addr because we want to * set the high-order bits to 1's not 0's. * * The passed addr is modified in place; be sure it is large enough to * hold the result! Note that we only worry about setting the fields * that rangeSockAddr will look at. */ void promote_v4_to_v6_mask(struct sockaddr_storage *addr) { struct sockaddr_in addr4; struct sockaddr_in6 addr6; uint32 ip4addr; int i; memcpy(&addr4, addr, sizeof(addr4)); ip4addr = ntohl(addr4.sin_addr.s_addr); memset(&addr6, 0, sizeof(addr6)); addr6.sin6_family = AF_INET6; for (i = 0; i < 12; i++) addr6.sin6_addr.s6_addr[i] = 0xff; addr6.sin6_addr.s6_addr[12] = (ip4addr >> 24) & 0xFF; addr6.sin6_addr.s6_addr[13] = (ip4addr >> 16) & 0xFF; addr6.sin6_addr.s6_addr[14] = (ip4addr >> 8) & 0xFF; addr6.sin6_addr.s6_addr[15] = (ip4addr) & 0xFF; memcpy(addr, &addr6, sizeof(addr6)); } /* * range_sockaddr - is addr within the subnet specified by netaddr/netmask ? * * Note: caller must already have verified that all three addresses are * in the same address family; and AF_UNIX addresses are not supported. */ int rangeSockAddr(const struct sockaddr_storage *addr, const struct sockaddr_storage *netaddr, const struct sockaddr_storage *netmask) { if (addr->ss_family == AF_INET) return rangeSockAddrAF_INET((const struct sockaddr_in *) addr, (const struct sockaddr_in *) netaddr, (const struct sockaddr_in *) netmask); else if (addr->ss_family == AF_INET6) return rangeSockAddrAF_INET6((const struct sockaddr_in6 *) addr, (const struct sockaddr_in6 *) netaddr, (const struct sockaddr_in6 *) netmask); else return 0; } /* * Run the callback function for the addr/mask, after making sure the * mask is sane for the addr. */ static void run_ifaddr_callback(PgIfAddrCallback callback, void *cb_data, struct sockaddr *addr, struct sockaddr *mask) { struct sockaddr_storage fullmask; if (!addr) return; /* Check that the mask is valid */ if (mask) { if (mask->sa_family != addr->sa_family) { mask = NULL; } else if (mask->sa_family == AF_INET) { if (((struct sockaddr_in *) mask)->sin_addr.s_addr == INADDR_ANY) mask = NULL; } else if (mask->sa_family == AF_INET6) { if (IN6_IS_ADDR_UNSPECIFIED(&((struct sockaddr_in6 *) mask)->sin6_addr)) mask = NULL; } } /* If mask is invalid, generate our own fully-set mask */ if (!mask) { SockAddr_cidr_mask(&fullmask, NULL, addr->sa_family); mask = (struct sockaddr *) &fullmask; } (*callback) (addr, mask, cb_data); } /* * Enumerate the system's network interface addresses and call the callback * for each one. Returns 0 if successful, -1 if trouble. * * This version uses the getifaddrs() interface, which is available on * BSDs, AIX, and modern Linux. */ int pg_foreach_ifaddr(PgIfAddrCallback callback, void *cb_data) { struct ifaddrs *ifa, *l; if (getifaddrs(&ifa) < 0) return -1; for (l = ifa; l; l = l->ifa_next) run_ifaddr_callback(callback, cb_data, l->ifa_addr, l->ifa_netmask); freeifaddrs(ifa); return 0; } pgpool-II-4.1.4/src/utils/pool_relcache.c0000664000175000017500000002765413730350127015153 00000000000000/* -*-pgsql-c-*- */ /* * $Header$ * * pgpool: a language independent connection pool server for PostgreSQL * written by Tatsuo Ishii * * Copyright (c) 2003-2020 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_relcache.c: Per process relation cache modules */ #include "config.h" #include #include #include #include "pool.h" #include "utils/pool_relcache.h" #include "context/pool_session_context.h" #include "query_cache/pool_memqcache.h" #include "pool_config.h" #include "utils/palloc.h" #include "utils/memutils.h" #include "utils/elog.h" static void SearchRelCacheErrorCb(void *arg); static POOL_SELECT_RESULT *query_cache_to_relation_cache(char *data, size_t size); static char *relation_cache_to_query_cache(POOL_SELECT_RESULT *res,size_t *size); /* * Create relation cache */ POOL_RELCACHE * pool_create_relcache(int cachesize, char *sql, func_ptr register_func, func_ptr unregister_func, bool issessionlocal) { POOL_RELCACHE *p; PoolRelCache *ip; MemoryContext old_context; if (cachesize < 0) { ereport(WARNING, (errmsg("failed to create relcache: wrong cache size: %d", cachesize))); return NULL; } /* * Create the relcache in session context if the cache is session local, * otherwise make home in TopMemoryContext */ old_context = MemoryContextSwitchTo(TopMemoryContext); ip = (PoolRelCache *) palloc0(sizeof(PoolRelCache) * cachesize); p = (POOL_RELCACHE *) palloc(sizeof(POOL_RELCACHE)); MemoryContextSwitchTo(old_context); p->num = cachesize; strlcpy(p->sql, sql, sizeof(p->sql)); p->register_func = register_func; p->unregister_func = unregister_func; p->cache_is_session_local = issessionlocal; p->no_cache_if_zero = false; p->cache = ip; return p; } /* * Discard relation cache. */ void pool_discard_relcache(POOL_RELCACHE * relcache) { int i; for (i = 0; i < relcache->num; i++) { (*relcache->unregister_func) (relcache->cache[i].data); } pfree(relcache->cache); pfree(relcache); } /* * Search relcache. If found, return user data. Otherwise return 0. * If not found in cache, do the query and store the result into cache and return it. */ void * pool_search_relcache(POOL_RELCACHE * relcache, POOL_CONNECTION_POOL * backend, char *table) { char *dbname; int i; int maxrefcnt = INT_MAX; char query[1024]; POOL_SELECT_RESULT *res = NULL; int index = 0; int local_session_id; time_t now; void *result; ErrorContextCallback callback; pool_sigset_t oldmask; bool locked; int query_cache_not_found = 1; char *query_cache_data = NULL; size_t query_cache_len; POOL_SESSION_CONTEXT *session_context; int node_id; session_context = pool_get_session_context(false); local_session_id = pool_get_local_session_id(); if (local_session_id < 0) return NULL; /* * Obtain database name and node id to be sent query. If * relcache_query_target is RELQTARGET_LOADL_BALANCE_NODE, we consider * load balance node id to be used to send queries. * * Note that we need to use VALID_BACKEND_RAW, rather than VALID_BACKEND * since pool_is_node_to_be_sent_in_current_query(being called by * VALID_BACKEND) assumes that if query context exists, where_to_send map * is already setup but it's not always the case because * pool_search_relcache is mostly called *before* the where_to_send map is * established. */ if (pool_config->relcache_query_target == RELQTARGET_LOAD_BALANCE_NODE && session_context && VALID_BACKEND_RAW(session_context->load_balance_node_id) && backend->slots[session_context->load_balance_node_id]) { dbname = backend->slots[session_context->load_balance_node_id]->sp->database; node_id = session_context->load_balance_node_id; } else { dbname = MASTER_CONNECTION(backend)->sp->database; /* * If in streaming replication mode, prefer to send query to the * primary node if it exists. */ if (STREAM && PRIMARY_NODE_ID >= 0) node_id = PRIMARY_NODE_ID; else node_id = MASTER_NODE_ID; } now = time(NULL); /* Look for cache first */ for (i = 0; i < relcache->num; i++) { /* * If cache is session local, we need to check session id */ if (relcache->cache_is_session_local) { if (relcache->cache[i].session_id != local_session_id) continue; } if (strcasecmp(relcache->cache[i].dbname, dbname) == 0 && strcasecmp(relcache->cache[i].relname, table) == 0) { if (relcache->cache[i].expire > 0) { if (now > relcache->cache[i].expire) { ereport(DEBUG1, (errmsg("searching relcache"), errdetail("relcache for database:%s table:%s expired. now:%ld expiration time:%ld", dbname, table, now, relcache->cache[i].expire))); relcache->cache[i].refcnt = 0; break; } } /* Found */ if (relcache->cache[i].refcnt < INT_MAX) relcache->cache[i].refcnt++; ereport(DEBUG1, (errmsg("hit local relation cache"), errdetail("query:%s", relcache->sql))); return relcache->cache[i].data; } } /* Not in cache. Check the system catalog */ snprintf(query, sizeof(query), relcache->sql, table); per_node_statement_log(backend, node_id, query); /* * Register a error context callback to throw proper context message */ callback.callback = SearchRelCacheErrorCb; callback.arg = NULL; callback.previous = error_context_stack; error_context_stack = &callback; locked = pool_is_shmem_lock(); /* * if enable_shared_relcache is true, search query cache. */ if (pool_config->enable_shared_relcache) { /* if shmem is not locked by this process, get the lock */ if (!locked) { POOL_SETMASK2(&BlockSig, &oldmask); pool_shmem_lock(); } PG_TRY(); { /* search catalog cache in query cache */ query_cache_not_found = pool_fetch_cache(backend, query, &query_cache_data, &query_cache_len); } PG_CATCH(); { pool_shmem_unlock(); POOL_SETMASK(&oldmask); PG_RE_THROW(); } PG_END_TRY(); } /* If not in query cache or not used, send query for backend. */ if (query_cache_not_found) { ereport(DEBUG1, (errmsg("not hit local relation cache and query cache"), errdetail("query:%s", query))); do_query(CONNECTION(backend, node_id), query, &res, MAJOR(backend)); /* Register cache */ result = (*relcache->register_func) (res); /* save local catalog cache in query cache */ if (pool_config->enable_shared_relcache) { query_cache_data = relation_cache_to_query_cache(res, &query_cache_len); pool_catalog_commit_cache(backend, query, query_cache_data, query_cache_len); } } else { ereport(DEBUG1, (errmsg("hit query cache"), errdetail("query:%s", query))); /* catalog cache found in query_cache, copy local relation cache */ res = query_cache_to_relation_cache(query_cache_data,query_cache_len); result = (*relcache->register_func) (res); } /* if shmem is locked by this function, unlock it */ if (pool_config->enable_shared_relcache && !locked) { pool_shmem_unlock(); POOL_SETMASK(&oldmask); } error_context_stack = callback.previous; /* * Look for replacement in cache */ for (i = 0; i < relcache->num; i++) { /* * If cache is session local, we can discard old cache immediately */ if (relcache->cache_is_session_local) { if (relcache->cache[i].session_id != local_session_id) { index = i; relcache->cache[i].refcnt = 0; break; } } if (relcache->cache[i].refcnt == 0) { /* Found empty slot */ index = i; break; } else if (relcache->cache[i].refcnt < maxrefcnt) { maxrefcnt = relcache->cache[i].refcnt; index = i; } } if (relcache->cache[index].refcnt != 0) { ereport(LOG, (errmsg("searching relcache. cache replacement occured"))); } if (!pool_is_ignore_till_sync() && (!relcache->no_cache_if_zero || result)) { strlcpy(relcache->cache[index].dbname, dbname, MAX_ITEM_LENGTH); strlcpy(relcache->cache[index].relname, table, MAX_ITEM_LENGTH); relcache->cache[index].refcnt = 1; relcache->cache[index].session_id = local_session_id; if (pool_config->relcache_expire > 0) { relcache->cache[index].expire = now + pool_config->relcache_expire; } else { relcache->cache[index].expire = 0; } /* * Call user defined unregister/register function. */ (*relcache->unregister_func) (relcache->cache[index].data); relcache->cache[index].data = result; } free_select_result(res); if (query_cache_data) pfree(query_cache_data); return result; } static void SearchRelCacheErrorCb(void *arg) { errcontext("while searching system catalog, When relcache is missed"); } char * remove_quotes_and_schema_from_relname(char *table) { static char rel[MAX_ITEM_LENGTH]; char *p; int i = 0; /* get rid of schema name */ p = strchr(table, '.'); if (p) table = p + 1; /* get rid of quotation marks */ for (i = 0; *table; table++) { if (*table != '"') rel[i++] = *table; } rel[i] = '\0'; return rel; } /* * Standard register/unregister function for "SELECT count(*)" type * query. Returns row count. */ void * int_register_func(POOL_SELECT_RESULT * res) { if (res->numrows >= 1) return (void *) atol(res->data[0]); return (void *) 0; } void * int_unregister_func(void *data) { /* Nothing to do since no memory was allocated */ return NULL; } void * string_register_func(POOL_SELECT_RESULT * res) { return (res->numrows > 0) ? strdup(res->data[0]) : NULL; } void * string_unregister_func(void *data) { if (data) free(data); return (void *) 0; } static POOL_SELECT_RESULT * query_cache_to_relation_cache(char *data, size_t size) { POOL_SELECT_RESULT *res; char *p; int i; int len; p = data; res = palloc0(sizeof(*res)); res->rowdesc = palloc0(sizeof(RowDesc)); /* rowdesc */ res->rowdesc->num_attrs = *((int *)p); p += sizeof(int); /* numrows */ res->numrows = *((int *)p); p += sizeof(int); len = res->rowdesc->num_attrs * res->numrows; res->nullflags = palloc(len * sizeof(int)); res->data = palloc0(len * sizeof(char *)); /* nullflags */ for (i = 0; i < len; i++) { res->nullflags[i] = *((int *)p); p += sizeof(int); } /* data */ for (i = 0; i < len; i++) { if ( res->nullflags[i] > 0) { res->data[i] = palloc(res->nullflags[i] + 1); memcpy(res->data[i], p, res->nullflags[i]); *(res->data[i] + res->nullflags[i]) = '\0'; p += res->nullflags[i]; } } return res; } static char * relation_cache_to_query_cache(POOL_SELECT_RESULT *res,size_t *size) { char * data; char * p; int i; int array_size; int mysize; mysize = 0; /* RoeDesc *rowdesc */ /* int res->rowdesc->num_attrs;*/ mysize += sizeof(int); /* only rodesc->num_attrs */ /* int numrows */ mysize += sizeof(int); /* int *nullflags */ mysize += sizeof(int) * res->rowdesc->num_attrs * res->numrows; /* char **data */ /* res->rowdesc->num_attrs * res->numrows */ for (i = 0; i < res->rowdesc->num_attrs * res->numrows; i++) { if(res->nullflags[i] > 0) { mysize += res->nullflags[i]; } } /* init array */ *size = mysize; data = palloc(mysize + 1); /* data copy */ p = data; memcpy(p, &res->rowdesc->num_attrs, sizeof(int)); p += sizeof(int); memcpy(p, &res->numrows, sizeof(int)); p += sizeof(int); array_size = res->rowdesc->num_attrs * res->numrows; memcpy(p, res->nullflags, sizeof(int) * array_size); p += sizeof(int) * array_size; for (i = 0; i < array_size; i++) { if( res->nullflags[i] > 0) /* NOT NULL? */ { memcpy(p, res->data[i], res->nullflags[i]); p += res->nullflags[i]; } } return data; } pgpool-II-4.1.4/src/utils/pool_process_reporting.c0000664000175000017500000022432013730350127017141 00000000000000/* -*-pgsql-c-*- */ /* * $Header$ * * pgpool: a language independent connection pool server for PostgreSQL * written by Tatsuo Ishii * * Copyright (c) 2003-2019 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. * * Process pgPool-II "SHOW" queries. */ #include "pool.h" #include "protocol/pool_proto_modules.h" #include "utils/elog.h" #include "utils/pool_stream.h" #include "pool_config.h" #include "query_cache/pool_memqcache.h" #include "version.h" #include #include #include void send_row_description(POOL_CONNECTION * frontend, POOL_CONNECTION_POOL * backend, short num_fields, char **field_names) { static char *cursorname = "blank"; static int oid = 0; static short fsize = -1; static int mod = 0; short n; int i; short s; int len; short colnum; if (MAJOR(backend) == PROTO_MAJOR_V2) { /* cursor response */ pool_write(frontend, "P", 1); pool_write(frontend, cursorname, strlen(cursorname) + 1); } /* row description */ pool_write(frontend, "T", 1); if (MAJOR(backend) == PROTO_MAJOR_V3) { /* * information about computed byte in section "RowDescription (B)" * here: * http://www.postgresql.org/docs/current/static/protocol-message-formats.html */ len = 6; /* int32 + int16 */ for (i = 0; i < num_fields; i++) { /* String + '\0' + 3* int32 + 3* int16 */ len += strlen(field_names[i]) + 1 + 18; } len = htonl(len); pool_write(frontend, &len, sizeof(len)); } n = htons(num_fields); pool_write(frontend, &n, sizeof(short)); for (i = 0; i < num_fields; i++) { pool_write(frontend, field_names[i], strlen(field_names[i]) + 1); /* field name */ if (MAJOR(backend) == PROTO_MAJOR_V3) { pool_write(frontend, &oid, sizeof(oid)); /* table oid */ colnum = htons(i); pool_write(frontend, &colnum, sizeof(colnum)); /* column number */ } pool_write(frontend, &oid, sizeof(oid)); /* data type oid */ s = htons(fsize); pool_write(frontend, &s, sizeof(fsize)); /* field size */ pool_write(frontend, &mod, sizeof(mod)); /* modifier */ if (MAJOR(backend) == PROTO_MAJOR_V3) { s = htons(0); pool_write(frontend, &s, sizeof(fsize)); /* field format (text) */ } } pool_flush(frontend); } /* * Send the command complete and ready for query message * to frontend. * If the num_row is lower than 0, it is not included * to the command complete message. */ void send_complete_and_ready(POOL_CONNECTION * frontend, POOL_CONNECTION_POOL * backend, const char *message, const int num_rows) { int len; int msg_len; char msg[64]; if (num_rows >= 0) msg_len = snprintf(msg, sizeof(msg), "%s %d", message, num_rows); else msg_len = snprintf(msg, sizeof(msg), "%s", message); /* complete command response */ pool_write(frontend, "C", 1); if (MAJOR(backend) == PROTO_MAJOR_V3) { len = htonl(4 + msg_len + 1); pool_write(frontend, &len, sizeof(len)); } pool_write(frontend, msg, msg_len + 1); /* ready for query */ pool_write(frontend, "Z", 1); if (MAJOR(backend) == PROTO_MAJOR_V3) { len = htonl(5); pool_write(frontend, &len, sizeof(len)); pool_write(frontend, "I", 1); } pool_flush(frontend); } POOL_REPORT_CONFIG * get_config(int *nrows) { int i, j; int len; /* * Report data buffer. * 128 is the max number of configuration items. * In addition, we need MAX_NUM_BACKENDS*4 * for backend descriptions. */ #define MAXITEMS (256 + MAX_NUM_BACKENDS*4) POOL_REPORT_CONFIG *status = palloc0(MAXITEMS * sizeof(POOL_REPORT_CONFIG)); /* * we initialize the array with NULL values so when looping on it, we can * use it as stop condition */ i = 0; /* CONNECTIONS */ /* - pgpool Connection Settings - */ StrNCpy(status[i].name, "listen_addresses", POOLCONFIG_MAXNAMELEN); snprintf(status[i].value, POOLCONFIG_MAXVALLEN, "%s", pool_config->listen_addresses); StrNCpy(status[i].desc, "host name(s) or IP address(es) to listen on", POOLCONFIG_MAXDESCLEN); i++; StrNCpy(status[i].name, "port", POOLCONFIG_MAXNAMELEN); snprintf(status[i].value, POOLCONFIG_MAXVALLEN, "%d", pool_config->port); StrNCpy(status[i].desc, "pgpool accepting port number", POOLCONFIG_MAXDESCLEN); i++; /* - pgpool Communication Manager Connection Settings - */ StrNCpy(status[i].name, "socket_dir", POOLCONFIG_MAXNAMELEN); snprintf(status[i].value, POOLCONFIG_MAXVALLEN, "%s", pool_config->socket_dir); StrNCpy(status[i].desc, "pgpool socket directory", POOLCONFIG_MAXDESCLEN); i++; StrNCpy(status[i].name, "pcp_listen_addresses", POOLCONFIG_MAXNAMELEN); snprintf(status[i].value, POOLCONFIG_MAXVALLEN, "%s", pool_config->pcp_listen_addresses); StrNCpy(status[i].desc, "host name(s) or IP address(es) for pcp process to listen on", POOLCONFIG_MAXDESCLEN); i++; StrNCpy(status[i].name, "pcp_port", POOLCONFIG_MAXNAMELEN); snprintf(status[i].value, POOLCONFIG_MAXVALLEN, "%d", pool_config->pcp_port); StrNCpy(status[i].desc, "PCP port # to bind", POOLCONFIG_MAXDESCLEN); i++; StrNCpy(status[i].name, "pcp_socket_dir", POOLCONFIG_MAXNAMELEN); snprintf(status[i].value, POOLCONFIG_MAXVALLEN, "%s", pool_config->pcp_socket_dir); StrNCpy(status[i].desc, "PCP socket directory", POOLCONFIG_MAXDESCLEN); i++; /* # - Authentication - */ StrNCpy(status[i].name, "enable_pool_hba", POOLCONFIG_MAXNAMELEN); snprintf(status[i].value, POOLCONFIG_MAXVALLEN, "%d", pool_config->enable_pool_hba); StrNCpy(status[i].desc, "if true, use pool_hba.conf for client authentication", POOLCONFIG_MAXDESCLEN); i++; StrNCpy(status[i].name, "pool_passwd", POOLCONFIG_MAXNAMELEN); snprintf(status[i].value, POOLCONFIG_MAXVALLEN, "%s", pool_config->pool_passwd); StrNCpy(status[i].desc, "file name of pool_passwd for md5 authentication", POOLCONFIG_MAXDESCLEN); i++; StrNCpy(status[i].name, "authentication_timeout", POOLCONFIG_MAXNAMELEN); snprintf(status[i].value, POOLCONFIG_MAXVALLEN, "%d", pool_config->authentication_timeout); StrNCpy(status[i].desc, "maximum time in seconds to complete client authentication", POOLCONFIG_MAXNAMELEN); i++; StrNCpy(status[i].name, "allow_clear_text_frontend_auth", POOLCONFIG_MAXNAMELEN); snprintf(status[i].value, POOLCONFIG_MAXVALLEN, "%d", pool_config->allow_clear_text_frontend_auth); StrNCpy(status[i].desc, "allow to use clear text password auth when pool_passwd does not contain password", POOLCONFIG_MAXDESCLEN); i++; /* - SSL Connections - */ StrNCpy(status[i].name, "ssl", POOLCONFIG_MAXNAMELEN); snprintf(status[i].value, POOLCONFIG_MAXVALLEN, "%d", pool_config->ssl); StrNCpy(status[i].desc, "SSL support", POOLCONFIG_MAXDESCLEN); i++; StrNCpy(status[i].name, "ssl_key", POOLCONFIG_MAXNAMELEN); snprintf(status[i].value, POOLCONFIG_MAXVALLEN, "%s", pool_config->ssl_key); StrNCpy(status[i].desc, "path to the SSL private key file", POOLCONFIG_MAXDESCLEN); i++; StrNCpy(status[i].name, "ssl_cert", POOLCONFIG_MAXNAMELEN); snprintf(status[i].value, POOLCONFIG_MAXVALLEN, "%s", pool_config->ssl_cert); StrNCpy(status[i].desc, "path to the SSL public certificate file", POOLCONFIG_MAXDESCLEN); i++; StrNCpy(status[i].name, "ssl_ca_cert", POOLCONFIG_MAXNAMELEN); snprintf(status[i].value, POOLCONFIG_MAXVALLEN, "%s", pool_config->ssl_ca_cert); StrNCpy(status[i].desc, "path to a single PEM format file", POOLCONFIG_MAXDESCLEN); i++; StrNCpy(status[i].name, "ssl_ca_cert_dir", POOLCONFIG_MAXNAMELEN); snprintf(status[i].value, POOLCONFIG_MAXVALLEN, "%s", pool_config->ssl_ca_cert_dir); StrNCpy(status[i].desc, "directory containing CA root certificate(s)", POOLCONFIG_MAXDESCLEN); i++; StrNCpy(status[i].name, "ssl_ciphers", POOLCONFIG_MAXNAMELEN); snprintf(status[i].value, POOLCONFIG_MAXVALLEN, "%s", pool_config->ssl_ciphers); StrNCpy(status[i].desc, "allowed SSL ciphers", POOLCONFIG_MAXDESCLEN); i++; StrNCpy(status[i].name, "ssl_prefer_server_ciphers", POOLCONFIG_MAXNAMELEN); snprintf(status[i].value, POOLCONFIG_MAXVALLEN, "%d", pool_config->ssl_prefer_server_ciphers); StrNCpy(status[i].desc, "Use server's SSL cipher preferences", POOLCONFIG_MAXDESCLEN); i++; StrNCpy(status[i].name, "ssl_ecdh_curve", POOLCONFIG_MAXNAMELEN); snprintf(status[i].value, POOLCONFIG_MAXVALLEN, "%s", pool_config->ssl_ecdh_curve); StrNCpy(status[i].desc, "the curve to use in ECDH key exchange", POOLCONFIG_MAXDESCLEN); i++; StrNCpy(status[i].name, "ssl_dh_params_file", POOLCONFIG_MAXNAMELEN); snprintf(status[i].value, POOLCONFIG_MAXVALLEN, "%s", pool_config->ssl_dh_params_file); StrNCpy(status[i].desc, "path to the Diffie-Hellman parameters contained file", POOLCONFIG_MAXDESCLEN); i++; /* POOLS */ /* - Pool size - */ StrNCpy(status[i].name, "num_init_children", POOLCONFIG_MAXNAMELEN); snprintf(status[i].value, POOLCONFIG_MAXVALLEN, "%d", pool_config->num_init_children); StrNCpy(status[i].desc, "# of children initially pre-forked", POOLCONFIG_MAXDESCLEN); i++; StrNCpy(status[i].name, "listen_backlog_multiplier", POOLCONFIG_MAXNAMELEN); snprintf(status[i].value, POOLCONFIG_MAXVALLEN, "%d", pool_config->listen_backlog_multiplier); StrNCpy(status[i].desc, "determines the size of the queue for pending connections", POOLCONFIG_MAXDESCLEN); i++; StrNCpy(status[i].name, "serialize_accept", POOLCONFIG_MAXNAMELEN); snprintf(status[i].value, POOLCONFIG_MAXVALLEN, "%d", pool_config->serialize_accept); StrNCpy(status[i].desc, "whether to serialize accept() call", POOLCONFIG_MAXDESCLEN); i++; StrNCpy(status[i].name, "reserved_connections", POOLCONFIG_MAXNAMELEN); snprintf(status[i].value, POOLCONFIG_MAXVALLEN, "%d", pool_config->reserved_connections); StrNCpy(status[i].desc, "number of reserved connections", POOLCONFIG_MAXDESCLEN); i++; StrNCpy(status[i].name, "max_pool", POOLCONFIG_MAXNAMELEN); snprintf(status[i].value, POOLCONFIG_MAXVALLEN, "%d", pool_config->max_pool); StrNCpy(status[i].desc, "max # of connection pool per child", POOLCONFIG_MAXDESCLEN); i++; /* - Life time - */ StrNCpy(status[i].name, "child_life_time", POOLCONFIG_MAXNAMELEN); snprintf(status[i].value, POOLCONFIG_MAXVALLEN, "%d", pool_config->child_life_time); StrNCpy(status[i].desc, "if idle for this seconds, child exits", POOLCONFIG_MAXDESCLEN); i++; StrNCpy(status[i].name, "child_max_connections", POOLCONFIG_MAXNAMELEN); snprintf(status[i].value, POOLCONFIG_MAXVALLEN, "%d", pool_config->child_max_connections); StrNCpy(status[i].desc, "if max_connections received, child exits", POOLCONFIG_MAXDESCLEN); i++; StrNCpy(status[i].name, "connection_life_time", POOLCONFIG_MAXNAMELEN); snprintf(status[i].value, POOLCONFIG_MAXVALLEN, "%d", pool_config->connection_life_time); StrNCpy(status[i].desc, "if idle for this seconds, connection closes", POOLCONFIG_MAXDESCLEN); i++; StrNCpy(status[i].name, "client_idle_limit", POOLCONFIG_MAXNAMELEN); snprintf(status[i].value, POOLCONFIG_MAXVALLEN, "%d", pool_config->client_idle_limit); StrNCpy(status[i].desc, "if idle for this seconds, child connection closes", POOLCONFIG_MAXDESCLEN); i++; /* LOGS */ /* - Where to log - */ StrNCpy(status[i].name, "log_destination", POOLCONFIG_MAXNAMELEN); snprintf(status[i].value, POOLCONFIG_MAXVALLEN, "%s", pool_config->log_destination_str); StrNCpy(status[i].desc, "logging destination", POOLCONFIG_MAXDESCLEN); i++; /* - What to log - */ StrNCpy(status[i].name, "log_line_prefix", POOLCONFIG_MAXNAMELEN); snprintf(status[i].value, POOLCONFIG_MAXVALLEN, "%s", pool_config->log_line_prefix); StrNCpy(status[i].desc, "printf-style string to output at beginning of each log line", POOLCONFIG_MAXDESCLEN); i++; StrNCpy(status[i].name, "log_error_verbosity", POOLCONFIG_MAXNAMELEN); snprintf(status[i].value, POOLCONFIG_MAXVALLEN, "%d", pool_config->log_error_verbosity); StrNCpy(status[i].desc, "controls how much detail about error should be emitted", POOLCONFIG_MAXDESCLEN); i++; StrNCpy(status[i].name, "client_min_messages", POOLCONFIG_MAXNAMELEN); snprintf(status[i].value, POOLCONFIG_MAXVALLEN, "%d", pool_config->client_min_messages); StrNCpy(status[i].desc, "controls which message should be sent to client", POOLCONFIG_MAXDESCLEN); i++; StrNCpy(status[i].name, "log_min_messages", POOLCONFIG_MAXNAMELEN); snprintf(status[i].value, POOLCONFIG_MAXVALLEN, "%d", pool_config->log_min_messages); StrNCpy(status[i].desc, "controls which message should be emitted to server log", POOLCONFIG_MAXDESCLEN); i++; StrNCpy(status[i].name, "log_connections", POOLCONFIG_MAXNAMELEN); snprintf(status[i].value, POOLCONFIG_MAXVALLEN, "%d", pool_config->log_connections); StrNCpy(status[i].desc, "if true, print incoming connections to the log", POOLCONFIG_MAXDESCLEN); i++; StrNCpy(status[i].name, "log_hostname", POOLCONFIG_MAXNAMELEN); snprintf(status[i].value, POOLCONFIG_MAXVALLEN, "%d", pool_config->log_hostname); StrNCpy(status[i].desc, "if true, resolve hostname for ps and log print", POOLCONFIG_MAXDESCLEN); i++; StrNCpy(status[i].name, "log_statement", POOLCONFIG_MAXNAMELEN); snprintf(status[i].value, POOLCONFIG_MAXVALLEN, "%d", pool_config->log_statement); StrNCpy(status[i].desc, "if non 0, logs all SQL statements", POOLCONFIG_MAXDESCLEN); i++; StrNCpy(status[i].name, "log_per_node_statement", POOLCONFIG_MAXNAMELEN); snprintf(status[i].value, POOLCONFIG_MAXVALLEN, "%d", pool_config->log_per_node_statement); StrNCpy(status[i].desc, "if non 0, logs all SQL statements on each node", POOLCONFIG_MAXDESCLEN); i++; StrNCpy(status[i].name, "log_client_messages", POOLCONFIG_MAXNAMELEN); snprintf(status[i].value, POOLCONFIG_MAXVALLEN, "%d", pool_config->log_client_messages); StrNCpy(status[i].desc, "if non 0, logs any client messages", POOLCONFIG_MAXDESCLEN); i++; StrNCpy(status[i].name, "log_standby_delay", POOLCONFIG_MAXNAMELEN); snprintf(status[i].value, POOLCONFIG_MAXVALLEN, "%d", pool_config->log_standby_delay); StrNCpy(status[i].desc, "how to log standby delay", POOLCONFIG_MAXDESCLEN); i++; /* - Syslog specific - */ StrNCpy(status[i].name, "syslog_facility", POOLCONFIG_MAXNAMELEN); snprintf(status[i].value, POOLCONFIG_MAXVALLEN, "LOCAL%d", (pool_config->syslog_facility / 8) - 16); StrNCpy(status[i].desc, "syslog local faclity", POOLCONFIG_MAXDESCLEN); i++; StrNCpy(status[i].name, "syslog_ident", POOLCONFIG_MAXNAMELEN); snprintf(status[i].value, POOLCONFIG_MAXVALLEN, "%s", pool_config->syslog_ident); StrNCpy(status[i].desc, "syslog program ident string", POOLCONFIG_MAXDESCLEN); i++; /* FILE LOCATIONS */ StrNCpy(status[i].name, "pid_file_name", POOLCONFIG_MAXNAMELEN); snprintf(status[i].value, POOLCONFIG_MAXVALLEN, "%s", pool_config->pid_file_name); StrNCpy(status[i].desc, "path to pid file", POOLCONFIG_MAXDESCLEN); i++; StrNCpy(status[i].name, "logdir", POOLCONFIG_MAXNAMELEN); snprintf(status[i].value, POOLCONFIG_MAXVALLEN, "%s", pool_config->logdir); StrNCpy(status[i].desc, "PgPool status file logging directory", POOLCONFIG_MAXDESCLEN); i++; /* CONNECTION POOLING */ StrNCpy(status[i].name, "connection_cache", POOLCONFIG_MAXNAMELEN); snprintf(status[i].value, POOLCONFIG_MAXVALLEN, "%d", pool_config->connection_cache); StrNCpy(status[i].desc, "if true, cache connection pool", POOLCONFIG_MAXDESCLEN); i++; StrNCpy(status[i].name, "reset_query_list", POOLCONFIG_MAXNAMELEN); *(status[i].value) = '\0'; for (j = 0; j < pool_config->num_reset_queries; j++) { len = POOLCONFIG_MAXVALLEN - strlen(status[i].value); strncat(status[i].value, pool_config->reset_query_list[j], len); len = POOLCONFIG_MAXVALLEN - strlen(status[i].value); if (j != pool_config->num_reset_queries - 1) strncat(status[i].value, ";", len); } StrNCpy(status[i].desc, "queries issued at the end of session", POOLCONFIG_MAXDESCLEN); i++; /* REPLICATION MODE */ StrNCpy(status[i].name, "replication_mode", POOLCONFIG_MAXNAMELEN); snprintf(status[i].value, POOLCONFIG_MAXVALLEN, "%d", pool_config->replication_mode); StrNCpy(status[i].desc, "non 0 if operating in replication mode", POOLCONFIG_MAXDESCLEN); i++; StrNCpy(status[i].name, "replicate_select", POOLCONFIG_MAXNAMELEN); snprintf(status[i].value, POOLCONFIG_MAXVALLEN, "%d", pool_config->replicate_select); StrNCpy(status[i].desc, "non 0 if SELECT statement is replicated", POOLCONFIG_MAXDESCLEN); i++; StrNCpy(status[i].name, "insert_lock", POOLCONFIG_MAXNAMELEN); snprintf(status[i].value, POOLCONFIG_MAXVALLEN, "%d", pool_config->insert_lock); StrNCpy(status[i].desc, "insert lock", POOLCONFIG_MAXDESCLEN); i++; StrNCpy(status[i].name, "lobj_lock_table", POOLCONFIG_MAXNAMELEN); snprintf(status[i].value, POOLCONFIG_MAXVALLEN, "%s", pool_config->lobj_lock_table); StrNCpy(status[i].desc, "table name used for large object replication control", POOLCONFIG_MAXDESCLEN); i++; /* - Degenerate handling - */ StrNCpy(status[i].name, "replication_stop_on_mismatch", POOLCONFIG_MAXNAMELEN); snprintf(status[i].value, POOLCONFIG_MAXVALLEN, "%d", pool_config->replication_stop_on_mismatch); StrNCpy(status[i].desc, "stop replication mode on fatal error", POOLCONFIG_MAXDESCLEN); i++; StrNCpy(status[i].name, "failover_if_affected_tuples_mismatch", POOLCONFIG_MAXNAMELEN); snprintf(status[i].value, POOLCONFIG_MAXVALLEN, "%d", pool_config->failover_if_affected_tuples_mismatch); StrNCpy(status[i].desc, "failover if affected tuples are mismatch", POOLCONFIG_MAXDESCLEN); i++; /* LOAD BALANCING MODE */ StrNCpy(status[i].name, "load_balance_mode", POOLCONFIG_MAXNAMELEN); snprintf(status[i].value, POOLCONFIG_MAXVALLEN, "%d", pool_config->load_balance_mode); StrNCpy(status[i].desc, "non 0 if operating in load balancing mode", POOLCONFIG_MAXDESCLEN); i++; StrNCpy(status[i].name, "ignore_leading_white_space", POOLCONFIG_MAXNAMELEN); snprintf(status[i].value, POOLCONFIG_MAXVALLEN, "%d", pool_config->ignore_leading_white_space); StrNCpy(status[i].desc, "ignore leading white spaces", POOLCONFIG_MAXDESCLEN); i++; StrNCpy(status[i].name, "white_function_list", POOLCONFIG_MAXNAMELEN); *(status[i].value) = '\0'; for (j = 0; j < pool_config->num_white_function_list; j++) { len = POOLCONFIG_MAXVALLEN - strlen(status[i].value); strncat(status[i].value, pool_config->white_function_list[j], len); len = POOLCONFIG_MAXVALLEN - strlen(status[i].value); if (j != pool_config->num_white_function_list - 1) strncat(status[i].value, ",", len); } StrNCpy(status[i].desc, "functions those do not write to database", POOLCONFIG_MAXDESCLEN); i++; StrNCpy(status[i].name, "black_function_list", POOLCONFIG_MAXNAMELEN); *(status[i].value) = '\0'; for (j = 0; j < pool_config->num_black_function_list; j++) { len = POOLCONFIG_MAXVALLEN - strlen(status[i].value); strncat(status[i].value, pool_config->black_function_list[j], len); len = POOLCONFIG_MAXVALLEN - strlen(status[i].value); if (j != pool_config->num_black_function_list - 1) strncat(status[i].value, ",", len); } StrNCpy(status[i].desc, "functions those write to database", POOLCONFIG_MAXDESCLEN); i++; StrNCpy(status[i].name, "black_query_pattern_list", POOLCONFIG_MAXNAMELEN); *(status[i].value) = '\0'; for (j = 0; j < pool_config->num_black_query_pattern_list; j++) { len = POOLCONFIG_MAXVALLEN - strlen(status[i].value); strncat(status[i].value, pool_config->black_query_pattern_list[j], len); len = POOLCONFIG_MAXVALLEN - strlen(status[i].value); if (j != pool_config->num_black_query_pattern_list - 1) strncat(status[i].value, ";", len); } StrNCpy(status[i].desc, "query patterns that should be sent to primary node", POOLCONFIG_MAXDESCLEN); i++; StrNCpy(status[i].name, "disable_load_balance_on_write", POOLCONFIG_MAXNAMELEN); snprintf(status[i].value, POOLCONFIG_MAXVALLEN, "%d", pool_config->disable_load_balance_on_write); StrNCpy(status[i].desc, "Load balance behavior when write query is received", POOLCONFIG_MAXDESCLEN); i++; StrNCpy(status[i].name, "statement_level_load_balance", POOLCONFIG_MAXNAMELEN); snprintf(status[i].value, POOLCONFIG_MAXVALLEN, "%d", pool_config->statement_level_load_balance); StrNCpy(status[i].desc, "statement level load balancing", POOLCONFIG_MAXDESCLEN); i++; /* MASTER/SLAVE MODE */ StrNCpy(status[i].name, "master_slave_mode", POOLCONFIG_MAXNAMELEN); snprintf(status[i].value, POOLCONFIG_MAXVALLEN, "%d", pool_config->master_slave_mode); StrNCpy(status[i].desc, "if true, operate in master/slave mode", POOLCONFIG_MAXDESCLEN); i++; StrNCpy(status[i].name, "master_slave_sub_mode", POOLCONFIG_MAXNAMELEN); snprintf(status[i].value, POOLCONFIG_MAXVALLEN, "%d", pool_config->master_slave_sub_mode); StrNCpy(status[i].desc, "master/slave sub mode", POOLCONFIG_MAXDESCLEN); i++; /* - Streaming - */ StrNCpy(status[i].name, "sr_check_period", POOLCONFIG_MAXNAMELEN); snprintf(status[i].value, POOLCONFIG_MAXVALLEN, "%d", pool_config->sr_check_period); StrNCpy(status[i].desc, "sr check period", POOLCONFIG_MAXDESCLEN); i++; StrNCpy(status[i].name, "sr_check_user", POOLCONFIG_MAXNAMELEN); snprintf(status[i].value, POOLCONFIG_MAXVALLEN, "%s", pool_config->sr_check_user); StrNCpy(status[i].desc, "sr check user", POOLCONFIG_MAXDESCLEN); i++; #ifdef NOT_USED /* for security reason */ StrNCpy(status[i].name, "sr_check_password", POOLCONFIG_MAXNAMELEN); snprintf(status[i].value, POOLCONFIG_MAXVALLEN, "%s", pool_config->sr_check_password); StrNCpy(status[i].desc, "sr check password", POOLCONFIG_MAXDESCLEN); i++; #endif StrNCpy(status[i].name, "sr_check_database", POOLCONFIG_MAXNAMELEN); snprintf(status[i].value, POOLCONFIG_MAXVALLEN, "%s", pool_config->sr_check_database); StrNCpy(status[i].desc, "sr check database", POOLCONFIG_MAXDESCLEN); i++; StrNCpy(status[i].name, "delay_threshold", POOLCONFIG_MAXNAMELEN); snprintf(status[i].value, POOLCONFIG_MAXVALLEN, INT64_FORMAT, pool_config->delay_threshold); StrNCpy(status[i].desc, "standby delay threshold", POOLCONFIG_MAXDESCLEN); i++; /* - Special commands - */ StrNCpy(status[i].name, "follow_master_command", POOLCONFIG_MAXNAMELEN); snprintf(status[i].value, POOLCONFIG_MAXVALLEN, "%s", pool_config->follow_master_command); StrNCpy(status[i].desc, "follow master command", POOLCONFIG_MAXDESCLEN); i++; StrNCpy(status[i].name, "database_redirect_preference_list", POOLCONFIG_MAXNAMELEN); snprintf(status[i].value, POOLCONFIG_MAXVALLEN, "%s", pool_config->database_redirect_preference_list); StrNCpy(status[i].desc, "redirect by database name", POOLCONFIG_MAXDESCLEN); i++; StrNCpy(status[i].name, "app_name_redirect_preference_list", POOLCONFIG_MAXNAMELEN); snprintf(status[i].value, POOLCONFIG_MAXVALLEN, "%s", pool_config->app_name_redirect_preference_list); StrNCpy(status[i].desc, "redirect by application name", POOLCONFIG_MAXDESCLEN); i++; StrNCpy(status[i].name, "allow_sql_comments", POOLCONFIG_MAXNAMELEN); snprintf(status[i].value, POOLCONFIG_MAXVALLEN, "%d", pool_config->allow_sql_comments); StrNCpy(status[i].desc, "allow SQL comments", POOLCONFIG_MAXDESCLEN); i++; /* HEALTH CHECK */ StrNCpy(status[i].name, "health_check_period", POOLCONFIG_MAXNAMELEN); snprintf(status[i].value, POOLCONFIG_MAXVALLEN, "%d", pool_config->health_check_period); StrNCpy(status[i].desc, "health check period", POOLCONFIG_MAXDESCLEN); i++; StrNCpy(status[i].name, "health_check_timeout", POOLCONFIG_MAXNAMELEN); snprintf(status[i].value, POOLCONFIG_MAXVALLEN, "%d", pool_config->health_check_timeout); StrNCpy(status[i].desc, "health check timeout", POOLCONFIG_MAXDESCLEN); i++; StrNCpy(status[i].name, "health_check_user", POOLCONFIG_MAXNAMELEN); snprintf(status[i].value, POOLCONFIG_MAXVALLEN, "%s", pool_config->health_check_user); StrNCpy(status[i].desc, "health check user", POOLCONFIG_MAXDESCLEN); i++; #ifdef NOT_USED /* for security reason */ StrNCpy(status[i].name, "health_check_password", POOLCONFIG_MAXNAMELEN); snprintf(status[i].value, POOLCONFIG_MAXVALLEN, "%s", pool_config->health_check_password); StrNCpy(status[i].desc, "health check password", POOLCONFIG_MAXDESCLEN); i++; #endif StrNCpy(status[i].name, "health_check_database", POOLCONFIG_MAXNAMELEN); snprintf(status[i].value, POOLCONFIG_MAXVALLEN, "%s", pool_config->health_check_database); StrNCpy(status[i].desc, "health check database", POOLCONFIG_MAXDESCLEN); i++; StrNCpy(status[i].name, "health_check_max_retries", POOLCONFIG_MAXNAMELEN); snprintf(status[i].value, POOLCONFIG_MAXVALLEN, "%d", pool_config->health_check_max_retries); StrNCpy(status[i].desc, "health check max retries", POOLCONFIG_MAXDESCLEN); i++; StrNCpy(status[i].name, "health_check_retry_delay", POOLCONFIG_MAXNAMELEN); snprintf(status[i].value, POOLCONFIG_MAXVALLEN, "%d", pool_config->health_check_retry_delay); StrNCpy(status[i].desc, "health check retry delay", POOLCONFIG_MAXDESCLEN); i++; StrNCpy(status[i].name, "connect_timeout", POOLCONFIG_MAXNAMELEN); snprintf(status[i].value, POOLCONFIG_MAXVALLEN, "%d", pool_config->connect_timeout); StrNCpy(status[i].desc, "connect timeout", POOLCONFIG_MAXDESCLEN); i++; /* FAILOVER AND FAILBACK */ StrNCpy(status[i].name, "failover_command", POOLCONFIG_MAXNAMELEN); snprintf(status[i].value, POOLCONFIG_MAXVALLEN, "%s", pool_config->failover_command); StrNCpy(status[i].desc, "failover command", POOLCONFIG_MAXDESCLEN); i++; StrNCpy(status[i].name, "failback_command", POOLCONFIG_MAXNAMELEN); snprintf(status[i].value, POOLCONFIG_MAXVALLEN, "%s", pool_config->failback_command); StrNCpy(status[i].desc, "failback command", POOLCONFIG_MAXDESCLEN); i++; StrNCpy(status[i].name, "failover_on_backend_error", POOLCONFIG_MAXNAMELEN); snprintf(status[i].value, POOLCONFIG_MAXVALLEN, "%d", pool_config->failover_on_backend_error); StrNCpy(status[i].desc, "failover on backend error", POOLCONFIG_MAXDESCLEN); i++; StrNCpy(status[i].name, "detach_false_primary", POOLCONFIG_MAXNAMELEN); snprintf(status[i].value, POOLCONFIG_MAXVALLEN, "%d", pool_config->detach_false_primary); StrNCpy(status[i].desc, "detach false primary", POOLCONFIG_MAXDESCLEN); i++; StrNCpy(status[i].name, "auto_failback", POOLCONFIG_MAXNAMELEN); snprintf(status[i].value, POOLCONFIG_MAXVALLEN, "%d", pool_config->auto_failback); StrNCpy(status[i].desc, "auto_failback", POOLCONFIG_MAXDESCLEN); i++; StrNCpy(status[i].name, "auto_failback_interval", POOLCONFIG_MAXNAMELEN); snprintf(status[i].value, POOLCONFIG_MAXVALLEN, "%d", pool_config->auto_failback_interval); StrNCpy(status[i].desc, "auto_failback_interval", POOLCONFIG_MAXDESCLEN); i++; /* ONLINE RECOVERY */ StrNCpy(status[i].name, "recovery_user", POOLCONFIG_MAXNAMELEN); snprintf(status[i].value, POOLCONFIG_MAXVALLEN, "%s", pool_config->recovery_user); StrNCpy(status[i].desc, "online recovery user", POOLCONFIG_MAXDESCLEN); i++; StrNCpy(status[i].name, "recovery_1st_stage_command", POOLCONFIG_MAXNAMELEN); snprintf(status[i].value, POOLCONFIG_MAXVALLEN, "%s", pool_config->recovery_1st_stage_command); StrNCpy(status[i].desc, "execute a command in first stage.", POOLCONFIG_MAXDESCLEN); i++; StrNCpy(status[i].name, "recovery_2nd_stage_command", POOLCONFIG_MAXNAMELEN); snprintf(status[i].value, POOLCONFIG_MAXVALLEN, "%s", pool_config->recovery_2nd_stage_command); StrNCpy(status[i].desc, "execute a command in second stage.", POOLCONFIG_MAXDESCLEN); i++; StrNCpy(status[i].name, "recovery_timeout", POOLCONFIG_MAXNAMELEN); snprintf(status[i].value, POOLCONFIG_MAXVALLEN, "%d", pool_config->recovery_timeout); StrNCpy(status[i].desc, "max time in seconds to wait for the recovering node's postmaster", POOLCONFIG_MAXDESCLEN); i++; StrNCpy(status[i].name, "search_primary_node_timeout", POOLCONFIG_MAXNAMELEN); snprintf(status[i].value, POOLCONFIG_MAXVALLEN, "%d", pool_config->search_primary_node_timeout); StrNCpy(status[i].desc, "max time in seconds to search for primary node after failover", POOLCONFIG_MAXDESCLEN); i++; StrNCpy(status[i].name, "client_idle_limit_in_recovery", POOLCONFIG_MAXNAMELEN); snprintf(status[i].value, POOLCONFIG_MAXVALLEN, "%d", pool_config->client_idle_limit_in_recovery); StrNCpy(status[i].desc, "if idle for this seconds, child connection closes in recovery 2nd statge", POOLCONFIG_MAXDESCLEN); i++; /* OTHERS */ StrNCpy(status[i].name, "relcache_expire", POOLCONFIG_MAXNAMELEN); snprintf(status[i].value, POOLCONFIG_MAXVALLEN, "%ld", pool_config->relcache_expire); StrNCpy(status[i].desc, "relation cache expiration time in seconds", POOLCONFIG_MAXDESCLEN); i++; StrNCpy(status[i].name, "relcache_size", POOLCONFIG_MAXNAMELEN); snprintf(status[i].value, POOLCONFIG_MAXVALLEN, "%d", pool_config->relcache_size); StrNCpy(status[i].desc, "number of relation cache entry", POOLCONFIG_MAXDESCLEN); i++; StrNCpy(status[i].name, "check_temp_table", POOLCONFIG_MAXNAMELEN); snprintf(status[i].value, POOLCONFIG_MAXVALLEN, "%d", pool_config->check_temp_table); StrNCpy(status[i].desc, "enable temporary table check", POOLCONFIG_MAXDESCLEN); i++; StrNCpy(status[i].name, "check_unlogged_table", POOLCONFIG_MAXNAMELEN); snprintf(status[i].value, POOLCONFIG_MAXVALLEN, "%d", pool_config->check_unlogged_table); StrNCpy(status[i].desc, "enable unlogged table check", POOLCONFIG_MAXDESCLEN); i++; StrNCpy(status[i].name, "enable_shared_relcache", POOLCONFIG_MAXNAMELEN); snprintf(status[i].value, POOLCONFIG_MAXVALLEN, "%d", pool_config->enable_shared_relcache); StrNCpy(status[i].desc, "If true, relation cache stored in memory cache", POOLCONFIG_MAXDESCLEN); i++; StrNCpy(status[i].name, "relcache_query_target", POOLCONFIG_MAXNAMELEN); snprintf(status[i].value, POOLCONFIG_MAXVALLEN, "%d", pool_config->relcache_query_target); StrNCpy(status[i].desc, "Target node to send relcache queries", POOLCONFIG_MAXDESCLEN); i++; /* * add for watchdog */ StrNCpy(status[i].name, "use_watchdog", POOLCONFIG_MAXNAMELEN); snprintf(status[i].value, POOLCONFIG_MAXVALLEN, "%d", pool_config->use_watchdog); StrNCpy(status[i].desc, "non 0 if operating in use_watchdog", POOLCONFIG_MAXDESCLEN); i++; StrNCpy(status[i].name, "wd_ipc_socket_dir", POOLCONFIG_MAXNAMELEN); snprintf(status[i].value, POOLCONFIG_MAXVALLEN, "%s", pool_config->wd_ipc_socket_dir); StrNCpy(status[i].desc, "watchdog ipc socket directory", POOLCONFIG_MAXDESCLEN); i++; StrNCpy(status[i].name, "wd_lifecheck_method", POOLCONFIG_MAXNAMELEN); snprintf(status[i].value, POOLCONFIG_MAXVALLEN, "%d", pool_config->wd_lifecheck_method); StrNCpy(status[i].desc, "method of watchdog lifecheck", POOLCONFIG_MAXDESCLEN); i++; StrNCpy(status[i].name, "clear_memqcache_on_escalation", POOLCONFIG_MAXNAMELEN); snprintf(status[i].value, POOLCONFIG_MAXVALLEN, "%d", pool_config->clear_memqcache_on_escalation); StrNCpy(status[i].desc, "If true, clear all the query caches in shared memory when escalation occurs", POOLCONFIG_MAXDESCLEN); i++; StrNCpy(status[i].name, "wd_escalation_command", POOLCONFIG_MAXNAMELEN); snprintf(status[i].value, POOLCONFIG_MAXVALLEN, "%s", pool_config->wd_escalation_command); StrNCpy(status[i].desc, "command executed when escalation occurs", POOLCONFIG_MAXDESCLEN); i++; StrNCpy(status[i].name, "wd_de_escalation_command", POOLCONFIG_MAXNAMELEN); snprintf(status[i].value, POOLCONFIG_MAXVALLEN, "%s", pool_config->wd_de_escalation_command); StrNCpy(status[i].desc, "command executed when master pgpool resigns occurs", POOLCONFIG_MAXDESCLEN); i++; StrNCpy(status[i].name, "trusted_servers", POOLCONFIG_MAXNAMELEN); snprintf(status[i].value, POOLCONFIG_MAXVALLEN, "%s", pool_config->trusted_servers); StrNCpy(status[i].desc, "upper server list to observe connection", POOLCONFIG_MAXDESCLEN); i++; StrNCpy(status[i].name, "delegate_IP", POOLCONFIG_MAXNAMELEN); snprintf(status[i].value, POOLCONFIG_MAXVALLEN, "%s", pool_config->delegate_IP); StrNCpy(status[i].desc, "delegate IP address of master pgpool", POOLCONFIG_MAXDESCLEN); i++; StrNCpy(status[i].name, "wd_hostname", POOLCONFIG_MAXNAMELEN); snprintf(status[i].value, POOLCONFIG_MAXVALLEN, "%s", pool_config->wd_hostname); StrNCpy(status[i].desc, "Host name or IP address of this watchdog", POOLCONFIG_MAXDESCLEN); i++; StrNCpy(status[i].name, "wd_port", POOLCONFIG_MAXNAMELEN); snprintf(status[i].value, POOLCONFIG_MAXVALLEN, "%d", pool_config->wd_port); StrNCpy(status[i].desc, "watchdog port number", POOLCONFIG_MAXDESCLEN); i++; StrNCpy(status[i].name, "wd_priority", POOLCONFIG_MAXNAMELEN); snprintf(status[i].value, POOLCONFIG_MAXVALLEN, "%d", pool_config->wd_priority); StrNCpy(status[i].desc, "watchdog priority", POOLCONFIG_MAXDESCLEN); i++; StrNCpy(status[i].name, "wd_interval", POOLCONFIG_MAXNAMELEN); snprintf(status[i].value, POOLCONFIG_MAXVALLEN, "%d", pool_config->wd_interval); StrNCpy(status[i].desc, "life check interval (second)", POOLCONFIG_MAXDESCLEN); i++; StrNCpy(status[i].name, "ping_path", POOLCONFIG_MAXNAMELEN); snprintf(status[i].value, POOLCONFIG_MAXVALLEN, "%s", pool_config->ping_path); StrNCpy(status[i].desc, "path to ping command", POOLCONFIG_MAXDESCLEN); i++; StrNCpy(status[i].name, "if_cmd_path", POOLCONFIG_MAXNAMELEN); snprintf(status[i].value, POOLCONFIG_MAXVALLEN, "%s", pool_config->if_cmd_path); StrNCpy(status[i].desc, "path to interface up/down command", POOLCONFIG_MAXDESCLEN); i++; StrNCpy(status[i].name, "if_up_cmd", POOLCONFIG_MAXNAMELEN); snprintf(status[i].value, POOLCONFIG_MAXVALLEN, "%s", pool_config->if_up_cmd); StrNCpy(status[i].desc, "virtual interface up command with full parameters", POOLCONFIG_MAXDESCLEN); i++; StrNCpy(status[i].name, "if_down_cmd", POOLCONFIG_MAXNAMELEN); snprintf(status[i].value, POOLCONFIG_MAXVALLEN, "%s", pool_config->if_down_cmd); StrNCpy(status[i].desc, "virtual interface down command with full parameters", POOLCONFIG_MAXDESCLEN); i++; StrNCpy(status[i].name, "arping_path", POOLCONFIG_MAXNAMELEN); snprintf(status[i].value, POOLCONFIG_MAXVALLEN, "%s", pool_config->arping_path); StrNCpy(status[i].desc, "path to arping command", POOLCONFIG_MAXDESCLEN); i++; StrNCpy(status[i].name, "arping_cmd", POOLCONFIG_MAXNAMELEN); snprintf(status[i].value, POOLCONFIG_MAXVALLEN, "%s", pool_config->arping_cmd); StrNCpy(status[i].desc, "send ARP REQUESTi to neighbour host", POOLCONFIG_MAXDESCLEN); i++; StrNCpy(status[i].name, "wd_heartbeat_port", POOLCONFIG_MAXNAMELEN); snprintf(status[i].value, POOLCONFIG_MAXVALLEN, "%d", pool_config->wd_heartbeat_port); StrNCpy(status[i].desc, "port number for receiving heartbeat signal", POOLCONFIG_MAXDESCLEN); i++; StrNCpy(status[i].name, "wd_heartbeat_keepalive", POOLCONFIG_MAXNAMELEN); snprintf(status[i].value, POOLCONFIG_MAXVALLEN, "%d", pool_config->wd_heartbeat_keepalive); StrNCpy(status[i].desc, "interval time of sending heartbeat siganl (sec)", POOLCONFIG_MAXDESCLEN); i++; StrNCpy(status[i].name, "wd_heartbeat_deadtime", POOLCONFIG_MAXNAMELEN); snprintf(status[i].value, POOLCONFIG_MAXVALLEN, "%d", pool_config->wd_heartbeat_deadtime); StrNCpy(status[i].desc, "deadtime interval for heartbeat siganl (sec)", POOLCONFIG_MAXDESCLEN); i++; StrNCpy(status[i].name, "wd_life_point", POOLCONFIG_MAXNAMELEN); snprintf(status[i].value, POOLCONFIG_MAXVALLEN, "%d", pool_config->wd_life_point); StrNCpy(status[i].desc, "retry times of life check", POOLCONFIG_MAXDESCLEN); i++; StrNCpy(status[i].name, "wd_lifecheck_query", POOLCONFIG_MAXNAMELEN); snprintf(status[i].value, POOLCONFIG_MAXVALLEN, "%s", pool_config->wd_lifecheck_query); StrNCpy(status[i].desc, "lifecheck query to pgpool from watchdog", POOLCONFIG_MAXDESCLEN); i++; StrNCpy(status[i].name, "wd_lifecheck_dbname", POOLCONFIG_MAXNAMELEN); snprintf(status[i].value, POOLCONFIG_MAXVALLEN, "%s", pool_config->wd_lifecheck_dbname); StrNCpy(status[i].desc, "database name connected for lifecheck", POOLCONFIG_MAXDESCLEN); i++; StrNCpy(status[i].name, "wd_lifecheck_user", POOLCONFIG_MAXNAMELEN); snprintf(status[i].value, POOLCONFIG_MAXVALLEN, "%s", pool_config->wd_lifecheck_user); StrNCpy(status[i].desc, "watchdog user monitoring pgpools in lifecheck", POOLCONFIG_MAXDESCLEN); i++; StrNCpy(status[i].name, "wd_lifecheck_password", POOLCONFIG_MAXNAMELEN); snprintf(status[i].value, POOLCONFIG_MAXVALLEN, "%s", pool_config->wd_lifecheck_password); StrNCpy(status[i].desc, "password for watchdog user in lifecheck", POOLCONFIG_MAXDESCLEN); i++; StrNCpy(status[i].name, "wd_monitoring_interfaces_list", POOLCONFIG_MAXNAMELEN); *(status[i].value) = '\0'; for (j = 0; j < pool_config->num_wd_monitoring_interfaces_list; j++) { len = POOLCONFIG_MAXVALLEN - strlen(status[i].value); strncat(status[i].value, pool_config->wd_monitoring_interfaces_list[j], len); len = POOLCONFIG_MAXVALLEN - strlen(status[i].value); if (j != pool_config->num_wd_monitoring_interfaces_list - 1) strncat(status[i].value, ",", len); } StrNCpy(status[i].desc, "interfaces to monitor by watchdog", POOLCONFIG_MAXDESCLEN); i++; /* * end of watchdog */ StrNCpy(status[i].name, "memory_cache_enabled", POOLCONFIG_MAXNAMELEN); snprintf(status[i].value, POOLCONFIG_MAXVALLEN, "%d", pool_config->memory_cache_enabled); StrNCpy(status[i].desc, "If true, use the memory cache functionality, false by default", POOLCONFIG_MAXDESCLEN); i++; StrNCpy(status[i].name, "memqcache_method", POOLCONFIG_MAXNAMELEN); snprintf(status[i].value, POOLCONFIG_MAXVALLEN, "%d", pool_config->memqcache_method); StrNCpy(status[i].desc, "Cache store method. either shmem(shared memory) or Memcached. shmem by default", POOLCONFIG_MAXDESCLEN); i++; StrNCpy(status[i].name, "memqcache_memcached_host", POOLCONFIG_MAXNAMELEN); snprintf(status[i].value, POOLCONFIG_MAXVALLEN, "%s", pool_config->memqcache_memcached_host); StrNCpy(status[i].desc, "Memcached host name. Mandatory if memqcache_method=memcached", POOLCONFIG_MAXDESCLEN); i++; StrNCpy(status[i].name, "memqcache_memcached_port", POOLCONFIG_MAXNAMELEN); snprintf(status[i].value, POOLCONFIG_MAXVALLEN, "%d", pool_config->memqcache_memcached_port); StrNCpy(status[i].desc, "Memcached port number. Mondatory if memqcache_method=memcached", POOLCONFIG_MAXDESCLEN); i++; StrNCpy(status[i].name, "memqcache_total_size", POOLCONFIG_MAXNAMELEN); snprintf(status[i].value, POOLCONFIG_MAXVALLEN, "%ld", pool_config->memqcache_total_size); StrNCpy(status[i].desc, "Total memory size in bytes for storing memory cache. Mandatory if memqcache_method=shmem", POOLCONFIG_MAXDESCLEN); i++; StrNCpy(status[i].name, "memqcache_max_num_cache", POOLCONFIG_MAXNAMELEN); snprintf(status[i].value, POOLCONFIG_MAXVALLEN, "%d", pool_config->memqcache_max_num_cache); StrNCpy(status[i].desc, "Total number of cache entries", POOLCONFIG_MAXDESCLEN); i++; StrNCpy(status[i].name, "memqcache_expire", POOLCONFIG_MAXNAMELEN); snprintf(status[i].value, POOLCONFIG_MAXVALLEN, "%d", pool_config->memqcache_expire); StrNCpy(status[i].desc, "Memory cache entry life time specified in seconds. 60 by default", POOLCONFIG_MAXDESCLEN); i++; StrNCpy(status[i].name, "memqcache_auto_cache_invalidation", POOLCONFIG_MAXNAMELEN); snprintf(status[i].value, POOLCONFIG_MAXVALLEN, "%d", pool_config->memqcache_auto_cache_invalidation); StrNCpy(status[i].desc, "If true, invalidation of query cache is triggered by corresponding DDL/DML/DCL(and memqcache_expire). If false, it is only triggered by memqcache_expire. True by default.", POOLCONFIG_MAXDESCLEN); i++; StrNCpy(status[i].name, "memqcache_maxcache", POOLCONFIG_MAXNAMELEN); snprintf(status[i].value, POOLCONFIG_MAXVALLEN, "%d", pool_config->memqcache_maxcache); StrNCpy(status[i].desc, "Maximum SELECT result size in bytes", POOLCONFIG_MAXDESCLEN); i++; StrNCpy(status[i].name, "memqcache_cache_block_size", POOLCONFIG_MAXNAMELEN); snprintf(status[i].value, POOLCONFIG_MAXVALLEN, "%d", pool_config->memqcache_cache_block_size); StrNCpy(status[i].desc, "Cache block size in bytes. 8192 by default", POOLCONFIG_MAXDESCLEN); i++; StrNCpy(status[i].name, "memqcache_cache_oiddir", POOLCONFIG_MAXNAMELEN); snprintf(status[i].value, POOLCONFIG_MAXVALLEN, "%s", pool_config->memqcache_oiddir); StrNCpy(status[i].desc, "Tempory work directory to record table oids", POOLCONFIG_MAXDESCLEN); i++; StrNCpy(status[i].name, "memqcache_stats_start_time", POOLCONFIG_MAXNAMELEN); snprintf(status[i].value, POOLCONFIG_MAXVALLEN, "%s", ctime(&pool_get_memqcache_stats()->start_time)); StrNCpy(status[i].desc, "Start time of query cache stats", POOLCONFIG_MAXDESCLEN); i++; StrNCpy(status[i].name, "memqcache_no_cache_hits", POOLCONFIG_MAXNAMELEN); snprintf(status[i].value, POOLCONFIG_MAXVALLEN, "%lld", pool_get_memqcache_stats()->num_selects); StrNCpy(status[i].desc, "Number of SELECTs not hitting query cache", POOLCONFIG_MAXDESCLEN); i++; StrNCpy(status[i].name, "memqcache_cache_hits", POOLCONFIG_MAXNAMELEN); snprintf(status[i].value, POOLCONFIG_MAXVALLEN, "%lld", pool_get_memqcache_stats()->num_cache_hits); StrNCpy(status[i].desc, "Number of SELECTs hitting query cache", POOLCONFIG_MAXDESCLEN); i++; StrNCpy(status[i].name, "white_memqcache_table_list", POOLCONFIG_MAXNAMELEN); *(status[i].value) = '\0'; for (j = 0; j < pool_config->num_white_memqcache_table_list; j++) { len = POOLCONFIG_MAXVALLEN - strlen(status[i].value); strncat(status[i].value, pool_config->white_memqcache_table_list[j], len); len = POOLCONFIG_MAXVALLEN - strlen(status[i].value); if (j != pool_config->num_white_memqcache_table_list - 1) strncat(status[i].value, ",", len); } StrNCpy(status[i].desc, "tables to memqcache", POOLCONFIG_MAXDESCLEN); i++; StrNCpy(status[i].name, "black_memqcache_table_list", POOLCONFIG_MAXNAMELEN); *(status[i].value) = '\0'; for (j = 0; j < pool_config->num_black_memqcache_table_list; j++) { len = POOLCONFIG_MAXVALLEN - strlen(status[i].value); strncat(status[i].value, pool_config->black_memqcache_table_list[j], len); len = POOLCONFIG_MAXVALLEN - strlen(status[i].value); if (j != pool_config->num_black_memqcache_table_list - 1) strncat(status[i].value, ",", len); } StrNCpy(status[i].desc, "tables not to memqcache", POOLCONFIG_MAXDESCLEN); i++; /* BACKENDS */ for (j = 0; j < NUM_BACKENDS; j++) { if (BACKEND_INFO(j).backend_port == 0) continue; snprintf(status[i].name, POOLCONFIG_MAXNAMELEN, "backend_hostname%d", j); snprintf(status[i].value, POOLCONFIG_MAXVALLEN, "%s", BACKEND_INFO(j).backend_hostname); snprintf(status[i].desc, POOLCONFIG_MAXDESCLEN, "backend #%d hostname", j); i++; snprintf(status[i].name, POOLCONFIG_MAXNAMELEN, "backend_port%d", j); snprintf(status[i].value, POOLCONFIG_MAXVALLEN, "%d", BACKEND_INFO(j).backend_port); snprintf(status[i].desc, POOLCONFIG_MAXDESCLEN, "backend #%d port number", j); i++; snprintf(status[i].name, POOLCONFIG_MAXNAMELEN, "backend_weight%d", j); snprintf(status[i].value, POOLCONFIG_MAXVALLEN, "%f", BACKEND_INFO(j).backend_weight / RAND_MAX); snprintf(status[i].desc, POOLCONFIG_MAXDESCLEN, "weight of backend #%d", j); i++; snprintf(status[i].name, POOLCONFIG_MAXNAMELEN, "backend_data_directory%d", j); snprintf(status[i].value, POOLCONFIG_MAXVALLEN, "%s", BACKEND_INFO(j).backend_data_directory); snprintf(status[i].desc, POOLCONFIG_MAXDESCLEN, "data directory for backend #%d", j); i++; snprintf(status[i].name, POOLCONFIG_MAXNAMELEN, "backend_status%d", j); snprintf(status[i].value, POOLCONFIG_MAXVALLEN, "%s", backend_status_to_str(&BACKEND_INFO(j))); snprintf(status[i].desc, POOLCONFIG_MAXDESCLEN, "status of backend #%d", j); i++; snprintf(status[i].name, POOLCONFIG_MAXNAMELEN, "standby_delay%d", j); snprintf(status[i].value, POOLCONFIG_MAXVALLEN, UINT64_FORMAT, BACKEND_INFO(j).standby_delay); snprintf(status[i].desc, POOLCONFIG_MAXDESCLEN, "standby delay of backend #%d", j); i++; snprintf(status[i].name, POOLCONFIG_MAXNAMELEN, "backend_flag%d", j); snprintf(status[i].value, POOLCONFIG_MAXVALLEN, "%s", pool_flag_to_str(BACKEND_INFO(j).flag)); snprintf(status[i].desc, POOLCONFIG_MAXDESCLEN, "backend #%d flag", j); i++; snprintf(status[i].name, POOLCONFIG_MAXNAMELEN, "backend_application_name%d", j); snprintf(status[i].value, POOLCONFIG_MAXVALLEN, "%s", BACKEND_INFO(j).backend_application_name); snprintf(status[i].desc, POOLCONFIG_MAXDESCLEN, "application_name for backend #%d", j); i++; } for (j = 0; j < MAX_WATCHDOG_NUM; j++) { if (WD_INFO(j).pgpool_port == 0) continue; snprintf(status[i].name, POOLCONFIG_MAXNAMELEN, "other_pgpool_hostname%d", j); snprintf(status[i].value, POOLCONFIG_MAXVALLEN, "%s", WD_INFO(j).hostname); snprintf(status[i].desc, POOLCONFIG_MAXDESCLEN, "pgpool #%d hostname", j); i++; snprintf(status[i].name, POOLCONFIG_MAXNAMELEN, "other_pgpool_port%d", j); snprintf(status[i].value, POOLCONFIG_MAXVALLEN, "%d", WD_INFO(j).pgpool_port); snprintf(status[i].desc, POOLCONFIG_MAXDESCLEN, "pgpool #%d port number", j); i++; snprintf(status[i].name, POOLCONFIG_MAXNAMELEN, "other_pgpool_wd_port%d", j); snprintf(status[i].value, POOLCONFIG_MAXVALLEN, "%d", WD_INFO(j).wd_port); snprintf(status[i].desc, POOLCONFIG_MAXDESCLEN, "pgpool #%d watchdog port number", j); i++; } for (j = 0; j < pool_config->num_hb_if; j++) { snprintf(status[i].name, POOLCONFIG_MAXNAMELEN, "heartbeat_device%d", j); snprintf(status[i].value, POOLCONFIG_MAXVALLEN, "%s", WD_HB_IF(j).if_name); snprintf(status[i].desc, POOLCONFIG_MAXDESCLEN, "name of NIC device #%d for sending hearbeat", j); i++; snprintf(status[i].name, POOLCONFIG_MAXNAMELEN, "heartbeat_destination%d", j); snprintf(status[i].value, POOLCONFIG_MAXVALLEN, "%s", WD_HB_IF(j).addr); snprintf(status[i].desc, POOLCONFIG_MAXDESCLEN, "destination host for sending heartbeat using NIC device %d", j); i++; snprintf(status[i].name, POOLCONFIG_MAXNAMELEN, "heartbeat_destination_port%d", j); snprintf(status[i].value, POOLCONFIG_MAXVALLEN, "%d", WD_HB_IF(j).dest_port); snprintf(status[i].desc, POOLCONFIG_MAXDESCLEN, "destination port for sending heartbeat using NIC device %d", j); i++; } *nrows = i; return status; } void send_config_var_detail_row(POOL_CONNECTION * frontend, POOL_CONNECTION_POOL * backend, const char *name, const char *value, const char *description) { int size; int hsize; static short num_fields = 3; if (MAJOR(backend) == PROTO_MAJOR_V2) { int nbytes = (num_fields + 7) / 8; static unsigned char nullmap[2] = {0xff, 0xff}; /* ascii row */ pool_write(frontend, "D", 1); pool_write_and_flush(frontend, nullmap, nbytes); size = strlen(name); hsize = htonl(size + 4); pool_write(frontend, &hsize, sizeof(hsize)); pool_write(frontend, (void *) name, size); size = strlen(value); hsize = htonl(size + 4); pool_write(frontend, &hsize, sizeof(hsize)); pool_write(frontend, (void *) value, size); size = strlen(description); hsize = htonl(size + 4); pool_write(frontend, &hsize, sizeof(hsize)); pool_write(frontend, (void *) description, size); } else { short s; pool_write(frontend, "D", 1); size = 6; /* int32 + int16; */ size += 4 + strlen(name); /* int32 + data; */ size += 4 + strlen(value); /* int32 + data; */ size += 4 + strlen(description); /* int32 + data; */ hsize = htonl(size); pool_write(frontend, &hsize, sizeof(hsize)); s = htons(num_fields); pool_write(frontend, &s, sizeof(s)); size = strlen(name); hsize = htonl(size); pool_write(frontend, &hsize, sizeof(hsize)); pool_write(frontend, (void *) name, size); size = strlen(value); hsize = htonl(size); pool_write(frontend, &hsize, sizeof(hsize)); pool_write(frontend, (void *) value, size); size = strlen(description); hsize = htonl(size); pool_write(frontend, &hsize, sizeof(hsize)); pool_write(frontend, (void *) description, size); } } void send_config_var_value_only_row(POOL_CONNECTION * frontend, POOL_CONNECTION_POOL * backend, const char *value) { int size; int hsize; static short num_fields = 1; if (MAJOR(backend) == PROTO_MAJOR_V2) { int nbytes = (num_fields + 7) / 8; static unsigned char nullmap[2] = {0xff, 0xff}; /* ascii row */ pool_write(frontend, "D", 1); pool_write_and_flush(frontend, nullmap, nbytes); size = strlen(value); hsize = htonl(size + 4); pool_write(frontend, &hsize, sizeof(hsize)); pool_write(frontend, (void *) value, size); } else { short s; pool_write(frontend, "D", 1); size = 6; /* int32 + int16; */ size += 4 + strlen(value); /* int32 + data; */ hsize = htonl(size); pool_write(frontend, &hsize, sizeof(hsize)); s = htons(num_fields); pool_write(frontend, &s, sizeof(s)); size = strlen(value); hsize = htonl(size); pool_write(frontend, &hsize, sizeof(hsize)); pool_write(frontend, (void *) value, size); } } void config_reporting(POOL_CONNECTION * frontend, POOL_CONNECTION_POOL * backend) { static char *field_names[] = {"item", "value", "description"}; static unsigned char nullmap[2] = {0xff, 0xff}; static short num_fields = 3; short s; int nbytes = (num_fields + 7) / 8; int len; int nrows; int size; int hsize; int i; POOL_REPORT_CONFIG *status = get_config(&nrows); send_row_description(frontend, backend, num_fields, field_names); if (MAJOR(backend) == PROTO_MAJOR_V2) { /* ascii row */ for (i = 0; i < nrows; i++) { pool_write(frontend, "D", 1); pool_write_and_flush(frontend, nullmap, nbytes); size = strlen(status[i].name); hsize = htonl(size + 4); pool_write(frontend, &hsize, sizeof(hsize)); pool_write(frontend, status[i].name, size); size = strlen(status[i].value); hsize = htonl(size + 4); pool_write(frontend, &hsize, sizeof(hsize)); pool_write(frontend, status[i].value, size); size = strlen(status[i].desc); hsize = htonl(size + 4); pool_write(frontend, &hsize, sizeof(hsize)); pool_write(frontend, status[i].desc, size); } } else { /* data row */ for (i = 0; i < nrows; i++) { pool_write(frontend, "D", 1); len = 6; /* int32 + int16; */ len += 4 + strlen(status[i].name); /* int32 + data; */ len += 4 + strlen(status[i].value); /* int32 + data; */ len += 4 + strlen(status[i].desc); /* int32 + data; */ len = htonl(len); pool_write(frontend, &len, sizeof(len)); s = htons(num_fields); pool_write(frontend, &s, sizeof(s)); len = htonl(strlen(status[i].name)); pool_write(frontend, &len, sizeof(len)); pool_write(frontend, status[i].name, strlen(status[i].name)); len = htonl(strlen(status[i].value)); pool_write(frontend, &len, sizeof(len)); pool_write(frontend, status[i].value, strlen(status[i].value)); len = htonl(strlen(status[i].desc)); pool_write(frontend, &len, sizeof(len)); pool_write(frontend, status[i].desc, strlen(status[i].desc)); } } send_complete_and_ready(frontend, backend, "SELECT", nrows); pfree(status); } /* * for SHOW pool_nodes */ POOL_REPORT_NODES * get_nodes(int *nrows) { int i; POOL_REPORT_NODES *nodes = palloc(NUM_BACKENDS * sizeof(POOL_REPORT_NODES)); BackendInfo *bi = NULL; POOL_SESSION_CONTEXT *session_context = pool_get_session_context(false); struct tm tm; for (i = 0; i < NUM_BACKENDS; i++) { bi = pool_get_node_info(i); snprintf(nodes[i].node_id, POOLCONFIG_MAXIDLEN, "%d", i); StrNCpy(nodes[i].hostname, bi->backend_hostname, strlen(bi->backend_hostname) + 1); snprintf(nodes[i].port, POOLCONFIG_MAXPORTLEN, "%d", bi->backend_port); snprintf(nodes[i].status, POOLCONFIG_MAXSTATLEN, "%s", backend_status_to_str(bi)); snprintf(nodes[i].lb_weight, POOLCONFIG_MAXWEIGHTLEN, "%f", bi->backend_weight / RAND_MAX); snprintf(nodes[i].select, POOLCONFIG_MAXWEIGHTLEN, UINT64_FORMAT, stat_get_select_count(i)); snprintf(nodes[i].load_balance_node, POOLCONFIG_MAXWEIGHTLEN, "%s", (session_context->load_balance_node_id == i) ? "true" : "false"); snprintf(nodes[i].delay, POOLCONFIG_MAXWEIGHTLEN, "%d", 0); if (STREAM) { if (i == REAL_PRIMARY_NODE_ID) { snprintf(nodes[i].role, POOLCONFIG_MAXWEIGHTLEN, "%s", "primary"); } else { snprintf(nodes[i].role, POOLCONFIG_MAXWEIGHTLEN, "%s", "standby"); snprintf(nodes[i].delay, POOLCONFIG_MAXWEIGHTLEN, UINT64_FORMAT, bi->standby_delay); } } else { if (i == REAL_MASTER_NODE_ID) snprintf(nodes[i].role, POOLCONFIG_MAXWEIGHTLEN, "%s", "master"); else snprintf(nodes[i].role, POOLCONFIG_MAXWEIGHTLEN, "%s", "slave"); } /* status last changed */ localtime_r(&bi->status_changed_time, &tm); strftime(nodes[i].last_status_change, POOLCONFIG_MAXDATELEN, "%F %T", &tm); /* from pg_stat_replication */ snprintf(nodes[i].rep_state, POOLCONFIG_MAXWEIGHTLEN, "%s", bi->replication_state); snprintf(nodes[i].rep_sync_state, POOLCONFIG_MAXWEIGHTLEN, "%s", bi->replication_sync_state); } *nrows = i; return nodes; } /* * SHOW pool_nodes; */ void nodes_reporting(POOL_CONNECTION * frontend, POOL_CONNECTION_POOL * backend) { static char *field_names[] = {"node_id", "hostname", "port", "status", "lb_weight", "role", "select_cnt", "load_balance_node", "replication_delay", "replication_state", "replication_sync_state", "last_status_change"}; short num_fields = sizeof(field_names) / sizeof(char *); int i; short s; int len; int nrows; int size; int hsize; static unsigned char nullmap[2] = {0xff, 0xff}; int nbytes = (num_fields + 7) / 8; POOL_REPORT_NODES *nodes = get_nodes(&nrows); send_row_description(frontend, backend, num_fields, field_names); if (MAJOR(backend) == PROTO_MAJOR_V2) { /* ascii row */ for (i = 0; i < nrows; i++) { pool_write(frontend, "D", 1); pool_write_and_flush(frontend, nullmap, nbytes); size = strlen(nodes[i].node_id); hsize = htonl(size + 4); pool_write(frontend, &hsize, sizeof(hsize)); pool_write(frontend, nodes[i].node_id, size); size = strlen(nodes[i].hostname); hsize = htonl(size + 4); pool_write(frontend, &hsize, sizeof(hsize)); pool_write(frontend, nodes[i].hostname, size); size = strlen(nodes[i].port); hsize = htonl(size + 4); pool_write(frontend, &hsize, sizeof(hsize)); pool_write(frontend, nodes[i].port, size); size = strlen(nodes[i].status); hsize = htonl(size + 4); pool_write(frontend, &hsize, sizeof(hsize)); pool_write(frontend, nodes[i].status, size); size = strlen(nodes[i].lb_weight); hsize = htonl(size + 4); pool_write(frontend, &hsize, sizeof(hsize)); pool_write(frontend, nodes[i].lb_weight, size); size = strlen(nodes[i].role); hsize = htonl(size + 4); pool_write(frontend, &hsize, sizeof(hsize)); pool_write(frontend, nodes[i].role, size); size = strlen(nodes[i].select); hsize = htonl(size + 4); pool_write(frontend, &hsize, sizeof(hsize)); pool_write(frontend, nodes[i].select, size); size = strlen(nodes[i].load_balance_node); hsize = htonl(size + 4); pool_write(frontend, &hsize, sizeof(hsize)); pool_write(frontend, nodes[i].load_balance_node, size); size = strlen(nodes[i].delay); hsize = htonl(size + 4); pool_write(frontend, &hsize, sizeof(hsize)); pool_write(frontend, nodes[i].delay, size); size = strlen(nodes[i].rep_state); hsize = htonl(size + 4); pool_write(frontend, &hsize, sizeof(hsize)); pool_write(frontend, nodes[i].rep_state, size); size = strlen(nodes[i].rep_sync_state); hsize = htonl(size + 4); pool_write(frontend, &hsize, sizeof(hsize)); pool_write(frontend, nodes[i].rep_sync_state, size); size = strlen(nodes[i].last_status_change); hsize = htonl(size + 4); pool_write(frontend, &hsize, sizeof(hsize)); pool_write(frontend, nodes[i].last_status_change, size); } } else { /* data row */ for (i = 0; i < nrows; i++) { pool_write(frontend, "D", 1); len = 6; /* int32 + int16; */ len += 4 + strlen(nodes[i].node_id); /* int32 + data; */ len += 4 + strlen(nodes[i].hostname); /* int32 + data; */ len += 4 + strlen(nodes[i].port); /* int32 + data; */ len += 4 + strlen(nodes[i].status); /* int32 + data; */ len += 4 + strlen(nodes[i].lb_weight); /* int32 + data; */ len += 4 + strlen(nodes[i].role); /* int32 + data; */ len += 4 + strlen(nodes[i].select); /* int32 + data; */ len += 4 + strlen(nodes[i].load_balance_node); /* int32 + data; */ len += 4 + strlen(nodes[i].delay); /* int32 + data; */ len += 4 + strlen(nodes[i].rep_state); /* int32 + data; */ len += 4 + strlen(nodes[i].rep_sync_state); /* int32 + data; */ len += 4 + strlen(nodes[i].last_status_change); /* int32 + data; */ len = htonl(len); pool_write(frontend, &len, sizeof(len)); s = htons(num_fields); pool_write(frontend, &s, sizeof(s)); len = htonl(strlen(nodes[i].node_id)); pool_write(frontend, &len, sizeof(len)); pool_write(frontend, nodes[i].node_id, strlen(nodes[i].node_id)); len = htonl(strlen(nodes[i].hostname)); pool_write(frontend, &len, sizeof(len)); pool_write(frontend, nodes[i].hostname, strlen(nodes[i].hostname)); len = htonl(strlen(nodes[i].port)); pool_write(frontend, &len, sizeof(len)); pool_write(frontend, nodes[i].port, strlen(nodes[i].port)); len = htonl(strlen(nodes[i].status)); pool_write(frontend, &len, sizeof(len)); pool_write(frontend, nodes[i].status, strlen(nodes[i].status)); len = htonl(strlen(nodes[i].lb_weight)); pool_write(frontend, &len, sizeof(len)); pool_write(frontend, nodes[i].lb_weight, strlen(nodes[i].lb_weight)); len = htonl(strlen(nodes[i].role)); pool_write(frontend, &len, sizeof(len)); pool_write(frontend, nodes[i].role, strlen(nodes[i].role)); len = htonl(strlen(nodes[i].select)); pool_write(frontend, &len, sizeof(len)); pool_write(frontend, nodes[i].select, strlen(nodes[i].select)); len = htonl(strlen(nodes[i].load_balance_node)); pool_write(frontend, &len, sizeof(len)); pool_write(frontend, nodes[i].load_balance_node, strlen(nodes[i].load_balance_node)); len = htonl(strlen(nodes[i].delay)); pool_write(frontend, &len, sizeof(len)); pool_write(frontend, nodes[i].delay, strlen(nodes[i].delay)); len = htonl(strlen(nodes[i].rep_state)); pool_write(frontend, &len, sizeof(len)); pool_write(frontend, nodes[i].rep_state, strlen(nodes[i].rep_state)); len = htonl(strlen(nodes[i].rep_sync_state)); pool_write(frontend, &len, sizeof(len)); pool_write(frontend, nodes[i].rep_sync_state, strlen(nodes[i].rep_sync_state)); len = htonl(strlen(nodes[i].last_status_change)); pool_write(frontend, &len, sizeof(len)); pool_write(frontend, nodes[i].last_status_change, strlen(nodes[i].last_status_change)); } } send_complete_and_ready(frontend, backend, "SELECT", nrows); pfree(nodes); } POOL_REPORT_POOLS * get_pools(int *nrows) { int child, pool, poolBE, backend_id; ProcessInfo *pi = NULL; int proc_id; int lines = 0; POOL_REPORT_POOLS *pools = palloc( pool_config->num_init_children * pool_config->max_pool * NUM_BACKENDS * sizeof(POOL_REPORT_POOLS) ); for (child = 0; child < pool_config->num_init_children; child++) { proc_id = process_info[child].pid; pi = pool_get_process_info(proc_id); for (pool = 0; pool < pool_config->max_pool; pool++) { for (backend_id = 0; backend_id < NUM_BACKENDS; backend_id++) { poolBE = pool * MAX_NUM_BACKENDS + backend_id; pools[lines].pool_pid = proc_id; pools[lines].start_time = pi->start_time; pools[lines].pool_id = pool; pools[lines].backend_id = backend_id; if (strlen(pi->connection_info[poolBE].database) == 0) { StrNCpy(pools[lines].database, "", POOLCONFIG_MAXIDENTLEN); StrNCpy(pools[lines].username, "", POOLCONFIG_MAXIDENTLEN); pools[lines].create_time = 0; pools[lines].pool_majorversion = 0; pools[lines].pool_minorversion = 0; } else { StrNCpy(pools[lines].database, pi->connection_info[poolBE].database, POOLCONFIG_MAXIDENTLEN); StrNCpy(pools[lines].username, pi->connection_info[poolBE].user, POOLCONFIG_MAXIDENTLEN); pools[lines].create_time = pi->connection_info[poolBE].create_time; pools[lines].pool_majorversion = pi->connection_info[poolBE].major; pools[lines].pool_minorversion = pi->connection_info[poolBE].minor; } pools[lines].pool_counter = pi->connection_info[poolBE].counter; pools[lines].pool_backendpid = ntohl(pi->connection_info[poolBE].pid); pools[lines].pool_connected = pi->connection_info[poolBE].connected; lines++; } } } *nrows = lines; return pools; } void pools_reporting(POOL_CONNECTION * frontend, POOL_CONNECTION_POOL * backend) { static short num_fields = 12; static char *field_names[] = {"pool_pid", "start_time", "pool_id", "backend_id", "database", "username", "create_time", "majorversion", "minorversion", "pool_counter", "pool_backendpid", "pool_connected"}; short s; int len; int i; static unsigned char nullmap[2] = {0xff, 0xff}; int nbytes = (num_fields + 7) / 8; int nrows; int size; int hsize; char proc_pid[16]; char pool_id[16]; char proc_start_time[20]; char proc_create_time[20]; char majorversion[5]; char minorversion[5]; char pool_counter[16]; char backend_id[16]; char backend_pid[16]; char connected[2]; POOL_REPORT_POOLS *pools = get_pools(&nrows); send_row_description(frontend, backend, num_fields, field_names); if (MAJOR(backend) == PROTO_MAJOR_V2) hsize = 4; else hsize = 0; /* ascii row */ for (i = 0; i < nrows; i++) { snprintf(proc_pid, sizeof(proc_pid), "%d", pools[i].pool_pid); snprintf(pool_id, sizeof(pool_id), "%d", pools[i].pool_id); if (pools[i].start_time) strftime(proc_start_time, sizeof(proc_start_time), "%Y-%m-%d %H:%M:%S", localtime(&pools[i].start_time)); else *proc_start_time = '\0'; if (pools[i].create_time) strftime(proc_create_time, sizeof(proc_create_time), "%Y-%m-%d %H:%M:%S", localtime(&pools[i].create_time)); else *proc_create_time = '\0'; snprintf(majorversion, sizeof(majorversion), "%d", pools[i].pool_majorversion); snprintf(minorversion, sizeof(minorversion), "%d", pools[i].pool_minorversion); snprintf(pool_counter, sizeof(pool_counter), "%d", pools[i].pool_counter); snprintf(backend_id, sizeof(backend_pid), "%d", pools[i].backend_id); snprintf(backend_pid, sizeof(backend_pid), "%d", pools[i].pool_backendpid); snprintf(connected, sizeof(connected), "%d", pools[i].pool_connected); if (MAJOR(backend) == PROTO_MAJOR_V2) { pool_write(frontend, "D", 1); pool_write_and_flush(frontend, nullmap, nbytes); } else { pool_write(frontend, "D", 1); len = 6; /* int32 + int16; */ len += 4 + strlen(proc_pid); /* int32 + data */ len += 4 + strlen(proc_start_time); /* int32 + data */ len += 4 + strlen(pool_id); /* int32 + data */ len += 4 + strlen(backend_id); /* int32 + data */ len += 4 + strlen(pools[i].database); /* int32 + data */ len += 4 + strlen(pools[i].username); /* int32 + data */ len += 4 + strlen(proc_create_time); /* int32 + data */ len += 4 + strlen(majorversion); /* int32 + data */ len += 4 + strlen(minorversion); /* int32 + data */ len += 4 + strlen(pool_counter); /* int32 + data */ len += 4 + strlen(backend_pid); /* int32 + data */ len += 4 + strlen(connected); /* int32 + data */ len = htonl(len); pool_write(frontend, &len, sizeof(len)); s = htons(num_fields); pool_write(frontend, &s, sizeof(s)); } len = strlen(proc_pid); size = htonl(len + hsize); pool_write(frontend, &size, sizeof(size)); pool_write(frontend, proc_pid, len); len = strlen(proc_start_time); size = htonl(len + hsize); pool_write(frontend, &size, sizeof(size)); pool_write(frontend, proc_start_time, len); len = strlen(pool_id); size = htonl(len + hsize); pool_write(frontend, &size, sizeof(size)); pool_write(frontend, pool_id, len); len = strlen(backend_id); size = htonl(len + hsize); pool_write(frontend, &size, sizeof(size)); pool_write(frontend, backend_id, len); len = strlen(pools[i].database); size = htonl(len + hsize); pool_write(frontend, &size, sizeof(size)); pool_write(frontend, pools[i].database, len); len = strlen(pools[i].username); size = htonl(len + hsize); pool_write(frontend, &size, sizeof(size)); pool_write(frontend, pools[i].username, len); len = strlen(proc_create_time); size = htonl(len + hsize); pool_write(frontend, &size, sizeof(size)); pool_write(frontend, proc_create_time, len); len = strlen(majorversion); size = htonl(len + hsize); pool_write(frontend, &size, sizeof(size)); pool_write(frontend, majorversion, len); len = strlen(minorversion); size = htonl(len + hsize); pool_write(frontend, &size, sizeof(size)); pool_write(frontend, minorversion, len); len = strlen(pool_counter); size = htonl(len + hsize); pool_write(frontend, &size, sizeof(size)); pool_write(frontend, pool_counter, len); len = strlen(backend_pid); size = htonl(len + hsize); pool_write(frontend, &size, sizeof(size)); pool_write(frontend, backend_pid, len); len = strlen(connected); size = htonl(len + hsize); pool_write(frontend, &size, sizeof(size)); pool_write(frontend, connected, len); } send_complete_and_ready(frontend, backend, "SELECT", nrows); pfree(pools); } POOL_REPORT_PROCESSES * get_processes(int *nrows) { int child; int pool; int poolBE; ProcessInfo *pi = NULL; int proc_id; POOL_REPORT_PROCESSES *processes = palloc(pool_config->num_init_children * sizeof(POOL_REPORT_PROCESSES)); for (child = 0; child < pool_config->num_init_children; child++) { proc_id = process_info[child].pid; pi = pool_get_process_info(proc_id); snprintf(processes[child].pool_pid, POOLCONFIG_MAXCOUNTLEN, "%d", proc_id); strftime(processes[child].start_time, POOLCONFIG_MAXDATELEN, "%Y-%m-%d %H:%M:%S", localtime(&pi->start_time)); StrNCpy(processes[child].database, "", POOLCONFIG_MAXIDENTLEN); StrNCpy(processes[child].username, "", POOLCONFIG_MAXIDENTLEN); StrNCpy(processes[child].create_time, "", POOLCONFIG_MAXDATELEN); StrNCpy(processes[child].pool_counter, "", POOLCONFIG_MAXCOUNTLEN); for (pool = 0; pool < pool_config->max_pool; pool++) { poolBE = pool * MAX_NUM_BACKENDS; if (pi->connection_info[poolBE].connected && strlen(pi->connection_info[poolBE].database) > 0 && strlen(pi->connection_info[poolBE].user) > 0) { StrNCpy(processes[child].database, pi->connection_info[poolBE].database, POOLCONFIG_MAXIDENTLEN); StrNCpy(processes[child].username, pi->connection_info[poolBE].user, POOLCONFIG_MAXIDENTLEN); strftime(processes[child].create_time, POOLCONFIG_MAXDATELEN, "%Y-%m-%d %H:%M:%S", localtime(&pi->connection_info[poolBE].create_time)); snprintf(processes[child].pool_counter, POOLCONFIG_MAXCOUNTLEN, "%d", pi->connection_info[poolBE].counter); } } } *nrows = child; return processes; } void processes_reporting(POOL_CONNECTION * frontend, POOL_CONNECTION_POOL * backend) { static short num_fields = 6; static char *field_names[] = {"pool_pid", "start_time", "database", "username", "create_time", "pool_counter"}; short s; int len; int nrows; int size; int hsize; int i; static unsigned char nullmap[2] = {0xff, 0xff}; int nbytes = (num_fields + 7) / 8; POOL_REPORT_PROCESSES *processes = get_processes(&nrows); send_row_description(frontend, backend, num_fields, field_names); if (MAJOR(backend) == PROTO_MAJOR_V2) { /* ascii row */ for (i = 0; i < nrows; i++) { pool_write(frontend, "D", 1); pool_write_and_flush(frontend, nullmap, nbytes); size = strlen(processes[i].pool_pid); hsize = htonl(size + 4); pool_write(frontend, &hsize, sizeof(hsize)); pool_write(frontend, processes[i].pool_pid, size); size = strlen(processes[i].start_time); hsize = htonl(size + 4); pool_write(frontend, &hsize, sizeof(hsize)); pool_write(frontend, processes[i].start_time, size); size = strlen(processes[i].database); hsize = htonl(size + 4); pool_write(frontend, &hsize, sizeof(hsize)); pool_write(frontend, processes[i].database, size); size = strlen(processes[i].username); hsize = htonl(size + 4); pool_write(frontend, &hsize, sizeof(hsize)); pool_write(frontend, processes[i].username, size); size = strlen(processes[i].create_time); hsize = htonl(size + 4); pool_write(frontend, &hsize, sizeof(hsize)); pool_write(frontend, processes[i].create_time, size); size = strlen(processes[i].pool_counter); hsize = htonl(size + 4); pool_write(frontend, &hsize, sizeof(hsize)); pool_write(frontend, processes[i].pool_counter, size); } } else { /* data row */ for (i = 0; i < nrows; i++) { pool_write(frontend, "D", 1); len = 6; /* int32 + int16; */ len += 4 + strlen(processes[i].pool_pid); /* int32 + data */ len += 4 + strlen(processes[i].start_time); /* int32 + data */ len += 4 + strlen(processes[i].database); /* int32 + data */ len += 4 + strlen(processes[i].username); /* int32 + data */ len += 4 + strlen(processes[i].create_time); /* int32 + data */ len += 4 + strlen(processes[i].pool_counter); /* int32 + data */ len = htonl(len); pool_write(frontend, &len, sizeof(len)); s = htons(num_fields); pool_write(frontend, &s, sizeof(s)); len = htonl(strlen(processes[i].pool_pid)); pool_write(frontend, &len, sizeof(len)); pool_write(frontend, processes[i].pool_pid, strlen(processes[i].pool_pid)); len = htonl(strlen(processes[i].start_time)); pool_write(frontend, &len, sizeof(len)); pool_write(frontend, processes[i].start_time, strlen(processes[i].start_time)); len = htonl(strlen(processes[i].database)); pool_write(frontend, &len, sizeof(len)); pool_write(frontend, processes[i].database, strlen(processes[i].database)); len = htonl(strlen(processes[i].username)); pool_write(frontend, &len, sizeof(len)); pool_write(frontend, processes[i].username, strlen(processes[i].username)); len = htonl(strlen(processes[i].create_time)); pool_write(frontend, &len, sizeof(len)); pool_write(frontend, processes[i].create_time, strlen(processes[i].create_time)); len = htonl(strlen(processes[i].pool_counter)); pool_write(frontend, &len, sizeof(len)); pool_write(frontend, processes[i].pool_counter, strlen(processes[i].pool_counter)); } } send_complete_and_ready(frontend, backend, "SELECT", nrows); pfree(processes); } POOL_REPORT_VERSION * get_version(void) { POOL_REPORT_VERSION *version = palloc(sizeof(POOL_REPORT_VERSION)); snprintf(version[0].version, POOLCONFIG_MAXVALLEN, "%s (%s)", VERSION, PGPOOLVERSION); return version; } void version_reporting(POOL_CONNECTION * frontend, POOL_CONNECTION_POOL * backend) { static short num_fields = 1; static char *field_names[] = {"pool_version"}; short s; int len; int size; int hsize; static unsigned char nullmap[2] = {0xff, 0xff}; int nbytes = (num_fields + 7) / 8; POOL_REPORT_VERSION *version = get_version(); send_row_description(frontend, backend, num_fields, field_names); if (MAJOR(backend) == PROTO_MAJOR_V2) { /* ascii row */ pool_write(frontend, "D", 1); pool_write_and_flush(frontend, nullmap, nbytes); size = strlen(version[0].version); hsize = htonl(size + 4); pool_write(frontend, &hsize, sizeof(hsize)); pool_write(frontend, version[0].version, size); } else { /* data row */ pool_write(frontend, "D", 1); len = 6; /* int32 + int16; */ len += 4 + strlen(version[0].version); /* int32 + data */ len = htonl(len); pool_write(frontend, &len, sizeof(len)); s = htons(num_fields); pool_write(frontend, &s, sizeof(s)); len = htonl(strlen(version[0].version)); pool_write(frontend, &len, sizeof(len)); pool_write(frontend, version[0].version, strlen(version[0].version)); } send_complete_and_ready(frontend, backend, "SELECT", 1); pfree(version); } /* * Show in memory cache reporting */ void cache_reporting(POOL_CONNECTION * frontend, POOL_CONNECTION_POOL * backend) { static char *field_names[] = {"num_cache_hits", "num_selects", "cache_hit_ratio", "num_hash_entries", "used_hash_entries", "num_cache_entries", "used_cache_entries_size", "free_cache_entries_size", "fragment_cache_entries_size"}; short num_fields = sizeof(field_names) / sizeof(char *); int i; short s; int len; int size; int hsize; static unsigned char nullmap[2] = {0xff, 0xff}; int nbytes = (num_fields + 7) / 8; volatile POOL_SHMEM_STATS *mystats; pool_sigset_t oldmask; double ratio; #define POOL_CACHE_STATS_MAX_STRING_LEN 32 typedef struct { int len; /* length of string excluding null terminate */ char string[POOL_CACHE_STATS_MAX_STRING_LEN + 1]; } MY_STRING_CACHE_STATS; MY_STRING_CACHE_STATS *strp; strp = palloc(num_fields * sizeof(MY_STRING_CACHE_STATS)); /* * Get raw cache stat data */ POOL_SETMASK2(&BlockSig, &oldmask); pool_shmem_lock(); PG_TRY(); { mystats = pool_get_shmem_storage_stats(); } PG_CATCH(); { pool_shmem_unlock(); POOL_SETMASK(&oldmask); PG_RE_THROW(); } PG_END_TRY(); pool_shmem_unlock(); POOL_SETMASK(&oldmask); /* * Convert to string */ i = 0; snprintf(strp[i++].string, POOL_CACHE_STATS_MAX_STRING_LEN + 1, "%lld", mystats->cache_stats.num_cache_hits); snprintf(strp[i++].string, POOL_CACHE_STATS_MAX_STRING_LEN + 1, "%lld", mystats->cache_stats.num_selects); if ((mystats->cache_stats.num_cache_hits + mystats->cache_stats.num_selects) == 0) { ratio = 0.0; } else { ratio = (double) mystats->cache_stats.num_cache_hits / (mystats->cache_stats.num_selects + mystats->cache_stats.num_cache_hits); } snprintf(strp[i++].string, POOL_CACHE_STATS_MAX_STRING_LEN + 1, "%.2f", ratio); snprintf(strp[i++].string, POOL_CACHE_STATS_MAX_STRING_LEN + 1, "%d", mystats->num_hash_entries); snprintf(strp[i++].string, POOL_CACHE_STATS_MAX_STRING_LEN + 1, "%d", mystats->used_hash_entries); snprintf(strp[i++].string, POOL_CACHE_STATS_MAX_STRING_LEN + 1, "%d", mystats->num_cache_entries); snprintf(strp[i++].string, POOL_CACHE_STATS_MAX_STRING_LEN + 1, "%ld", mystats->used_cache_entries_size); snprintf(strp[i++].string, POOL_CACHE_STATS_MAX_STRING_LEN + 1, "%ld", mystats->free_cache_entries_size); snprintf(strp[i++].string, POOL_CACHE_STATS_MAX_STRING_LEN + 1, "%ld", mystats->fragment_cache_entries_size); /* * Calculate total data length */ len = 2; /* number of fields (int16) */ for (i = 0; i < num_fields; i++) { strp[i].len = strlen(strp[i].string); len += 4 /* length of string (int32) */ + strp[i].len; } /* Send row description */ send_row_description(frontend, backend, num_fields, field_names); /* Send each field */ if (MAJOR(backend) == PROTO_MAJOR_V2) { pool_write(frontend, "D", 1); pool_write(frontend, nullmap, nbytes); for (i = 0; i < num_fields; i++) { size = strp[i].len + 1; hsize = htonl(size + 4); pool_write(frontend, &hsize, sizeof(hsize)); pool_write(frontend, strp[i].string, size); } } else { /* Kind */ pool_write(frontend, "D", 1); /* Packet length */ len = htonl(len + sizeof(int32)); pool_write(frontend, &len, sizeof(len)); /* Number of fields */ s = htons(num_fields); pool_write(frontend, &s, sizeof(s)); for (i = 0; i < num_fields; i++) { hsize = htonl(strp[i].len); pool_write(frontend, &hsize, sizeof(hsize)); pool_write(frontend, strp[i].string, strp[i].len); } } send_complete_and_ready(frontend, backend, "SELECT", 1); pfree(strp); } pgpool-II-4.1.4/src/utils/pool_ssl.c0000664000175000017500000005335713730350127014205 00000000000000/* -*-pgsql-c-*- */ /* * $Header$ * * pgpool: a language independent connection pool server for PostgreSQL * written by Tatsuo Ishii * * Copyright (c) 2003-2016 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_ssl.c: ssl negotiation functions * */ #include #include "config.h" #include "pool.h" #include "utils/elog.h" #include "utils/palloc.h" #include "utils/memutils.h" #include "utils/pool_stream.h" #include "pool_config.h" #include #include #include #ifdef USE_SSL static SSL_CTX *SSL_frontend_context = NULL; static bool SSL_initialized = false; static bool ssl_passwd_cb_called = false; static int ssl_passwd_cb(char *buf, int size, int rwflag, void *userdata); static int verify_cb(int ok, X509_STORE_CTX *ctx); static const char *SSLerrmessage(unsigned long ecode); static void fetch_pool_ssl_cert(POOL_CONNECTION * cp); static DH *load_dh_file(char *filename); static DH *load_dh_buffer(const char *, size_t); static bool initialize_dh(SSL_CTX *context); static bool initialize_ecdh(SSL_CTX *context); #define SSL_RETURN_VOID_IF(cond, msg) \ do { \ if ( (cond) ) { \ perror_ssl( (msg) ); \ return; \ } \ } while (0); #define SSL_RETURN_ERROR_IF(cond, msg) \ do { \ if ( (cond) ) { \ perror_ssl( (msg) ); \ return -1; \ } \ } while (0); #include /* for htonl() */ /* Major/minor codes to negotiate SSL prior to startup packet */ #define NEGOTIATE_SSL_CODE ( 1234<<16 | 5679 ) /* enum flag for differentiating server->client vs client->server SSL */ enum ssl_conn_type { ssl_conn_clientserver, ssl_conn_serverclient }; /* perform per-connection ssl initialization. returns nonzero on error */ static int init_ssl_ctx(POOL_CONNECTION * cp, enum ssl_conn_type conntype); /* OpenSSL error message */ static void perror_ssl(const char *context); /* Attempt to negotiate a secure connection * between pgpool-II and PostgreSQL backends */ void pool_ssl_negotiate_clientserver(POOL_CONNECTION * cp) { int ssl_packet[2] = {htonl(sizeof(int) * 2), htonl(NEGOTIATE_SSL_CODE)}; char server_response; cp->ssl_active = -1; if ((!pool_config->ssl) || init_ssl_ctx(cp, ssl_conn_clientserver)) return; ereport(DEBUG1, (errmsg("attempting to negotiate a secure connection"), errdetail("sending client->server SSL request"))); pool_write_and_flush(cp, ssl_packet, sizeof(int) * 2); if (pool_read(cp, &server_response, 1) < 0) { ereport(WARNING, (errmsg("error while attempting to negotiate a secure connection, pool_read failed"))); return; } ereport(DEBUG1, (errmsg("attempting to negotiate a secure connection"), errdetail("client->server SSL response: %c", server_response))); switch (server_response) { case 'S': SSL_set_fd(cp->ssl, cp->fd); SSL_RETURN_VOID_IF((SSL_connect(cp->ssl) < 0), "SSL_connect"); cp->ssl_active = 1; break; case 'N': /* * If backend does not support SSL but pgpool does, we get this. * i.e. This is normal. */ ereport(DEBUG1, (errmsg("attempting to negotiate a secure connection"), errdetail("server doesn't want to talk SSL"))); break; default: ereport(WARNING, (errmsg("error while attempting to negotiate a secure connection, unhandled response: %c", server_response))); break; } } /* attempt to negotiate a secure connection * between frontend and Pgpool-II */ void pool_ssl_negotiate_serverclient(POOL_CONNECTION * cp) { cp->ssl_active = -1; if ((!pool_config->ssl) || !SSL_frontend_context) { pool_write_and_flush(cp, "N", 1); } else { cp->ssl = SSL_new(SSL_frontend_context); /* write back an "SSL accept" response */ pool_write_and_flush(cp, "S", 1); SSL_set_fd(cp->ssl, cp->fd); SSL_RETURN_VOID_IF((SSL_accept(cp->ssl) < 0), "SSL_accept"); cp->ssl_active = 1; fetch_pool_ssl_cert(cp); } } void pool_ssl_close(POOL_CONNECTION * cp) { if (cp->ssl) { SSL_shutdown(cp->ssl); SSL_free(cp->ssl); } if (cp->ssl_ctx) SSL_CTX_free(cp->ssl_ctx); } int pool_ssl_read(POOL_CONNECTION * cp, void *buf, int size) { int n; int err; retry: errno = 0; n = SSL_read(cp->ssl, buf, size); err = SSL_get_error(cp->ssl, n); switch (err) { case SSL_ERROR_NONE: break; case SSL_ERROR_WANT_READ: case SSL_ERROR_WANT_WRITE: /* * Returning 0 here would cause caller to wait for read-ready, * which is not correct since what SSL wants is wait for * write-ready. The former could get us stuck in an infinite * wait, so don't risk it; busy-loop instead. */ goto retry; case SSL_ERROR_SYSCALL: if (n == -1) { ereport(WARNING, (errmsg("ssl read: error: %d", err))); } else { ereport(WARNING, (errmsg("ssl read: EOF detected"))); n = -1; } break; case SSL_ERROR_SSL: case SSL_ERROR_ZERO_RETURN: perror_ssl("SSL_read"); n = -1; break; default: ereport(WARNING, (errmsg("ssl read: unrecognized error code: %d", err))); /* * We assume that the connection is broken. Returns 0 rather than * -1 in this case because -1 triggers unwanted failover in the * caller (pool_read). */ n = 0; break; } return n; } int pool_ssl_write(POOL_CONNECTION * cp, const void *buf, int size) { int n; int err; retry: errno = 0; n = SSL_write(cp->ssl, buf, size); err = SSL_get_error(cp->ssl, n); switch (err) { case SSL_ERROR_NONE: break; case SSL_ERROR_WANT_READ: case SSL_ERROR_WANT_WRITE: goto retry; case SSL_ERROR_SYSCALL: if (n == -1) { ereport(WARNING, (errmsg("ssl write: error: %d", err))); } else { ereport(WARNING, (errmsg("ssl write: EOF detected"))); n = -1; } break; case SSL_ERROR_SSL: case SSL_ERROR_ZERO_RETURN: perror_ssl("SSL_write"); n = -1; break; default: ereport(WARNING, (errmsg("ssl write: unrecognized error code: %d", err))); /* * We assume that the connection is broken. */ n = -1; break; } return n; } static int init_ssl_ctx(POOL_CONNECTION * cp, enum ssl_conn_type conntype) { int error = 0; char *cacert = NULL, *cacert_dir = NULL; /* initialize SSL members */ #if (OPENSSL_VERSION_NUMBER >= 0x10100000L && !defined (LIBRESSL_VERSION_NUMBER)) cp->ssl_ctx = SSL_CTX_new(TLS_method()); #else cp->ssl_ctx = SSL_CTX_new(SSLv23_method()); #endif SSL_RETURN_ERROR_IF((!cp->ssl_ctx), "SSL_CTX_new"); /* * Disable OpenSSL's moving-write-buffer sanity check, because it causes * unnecessary failures in nonblocking send cases. */ SSL_CTX_set_mode(cp->ssl_ctx, SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER); if (conntype == ssl_conn_serverclient) { /* between frontend and pgpool */ error = SSL_CTX_use_certificate_chain_file(cp->ssl_ctx, pool_config->ssl_cert); SSL_RETURN_ERROR_IF((error != 1), "Loading SSL certificate"); error = SSL_CTX_use_PrivateKey_file(cp->ssl_ctx, pool_config->ssl_key, SSL_FILETYPE_PEM); SSL_RETURN_ERROR_IF((error != 1), "Loading SSL private key"); } else { /* between pgpool and backend */ /* set extra verification if ssl_ca_cert or ssl_ca_cert_dir are set */ if (strlen(pool_config->ssl_ca_cert)) cacert = pool_config->ssl_ca_cert; if (strlen(pool_config->ssl_ca_cert_dir)) cacert_dir = pool_config->ssl_ca_cert_dir; if (cacert || cacert_dir) { error = SSL_CTX_load_verify_locations(cp->ssl_ctx, cacert, cacert_dir); SSL_RETURN_ERROR_IF((error != 1), "SSL verification setup"); SSL_CTX_set_verify(cp->ssl_ctx, SSL_VERIFY_PEER, NULL); } } cp->ssl = SSL_new(cp->ssl_ctx); SSL_RETURN_ERROR_IF((!cp->ssl), "SSL_new"); return 0; } static void perror_ssl(const char *context) { unsigned long err; static const char *no_err_reason = "no SSL error reported"; const char *reason; err = ERR_get_error(); if (!err) { reason = no_err_reason; } else { reason = ERR_reason_error_string(err); } if (reason != NULL) { ereport(LOG, (errmsg("pool_ssl: \"%s\": \"%s\"", context, reason))); } else { ereport(LOG, (errmsg("pool_ssl: \"%s\": Unknown SSL error %lu", context, err))); } } /* * Obtain reason string for passed SSL errcode * * ERR_get_error() is used by caller to get errcode to pass here. * * Some caution is needed here since ERR_reason_error_string will * return NULL if it doesn't recognize the error code. We don't * want to return NULL ever. */ static const char * SSLerrmessage(unsigned long ecode) { const char *errreason; static char errbuf[32]; if (ecode == 0) return _("no SSL error reported"); errreason = ERR_reason_error_string(ecode); if (errreason != NULL) return errreason; snprintf(errbuf, sizeof(errbuf), _("SSL error code %lu"), ecode); return errbuf; } /* * Return true if SSL layer has any pending data in buffer */ bool pool_ssl_pending(POOL_CONNECTION * cp) { if (cp->ssl_active > 0 && SSL_pending(cp->ssl) > 0) return true; return false; } static void fetch_pool_ssl_cert(POOL_CONNECTION * cp) { int len; X509 *peer = SSL_get_peer_certificate(cp->ssl); cp->peer = peer; if (peer) { ereport(DEBUG1, (errmsg("got the SSL certificate"))); len = X509_NAME_get_text_by_NID(X509_get_subject_name(peer), NID_commonName, NULL, 0); if (len != -1) { char *peer_cn; peer_cn = palloc(len + 1); int r = X509_NAME_get_text_by_NID(X509_get_subject_name(peer), NID_commonName, peer_cn, len + 1); peer_cn[len] = '\0'; if (r != len) { /* shouldn't happen */ pfree(peer_cn); return; } cp->client_cert_loaded = true; cp->cert_cn = MemoryContextStrdup(TopMemoryContext, peer_cn); pfree(peer_cn); } else { cp->client_cert_loaded = false; } } else { cp->client_cert_loaded = false; } } /* * Passphrase collection callback * * If OpenSSL is told to use a passphrase-protected server key, by default * it will issue a prompt on /dev/tty and try to read a key from there. * That's no good during a postmaster SIGHUP cycle, not to mention SSL context * reload in an EXEC_BACKEND postmaster child. So override it with this dummy * function that just returns an empty passphrase, guaranteeing failure. */ static int ssl_passwd_cb(char *buf, int size, int rwflag, void *userdata) { /* Set flag to change the error message we'll report */ ssl_passwd_cb_called = true; /* And return empty string */ Assert(size > 0); buf[0] = '\0'; return 0; } /* * Certificate verification callback * * This callback allows us to log intermediate problems during * verification, but for now we'll see if the final error message * contains enough information. * * This callback also allows us to override the default acceptance * criteria (e.g., accepting self-signed or expired certs), but * for now we accept the default checks. */ static int verify_cb(int ok, X509_STORE_CTX *ctx) { return ok; } /* * Initialize global SSL context. * */ int SSL_ServerSide_init(void) { STACK_OF(X509_NAME) *root_cert_list = NULL; SSL_CTX *context; struct stat buf; /* This stuff need be done only once. */ if (!SSL_initialized) { #if (OPENSSL_VERSION_NUMBER >= 0x10100000L && !defined (LIBRESSL_VERSION_NUMBER)) OPENSSL_init_ssl(0, NULL); #else SSL_library_init(); #endif SSL_load_error_strings(); SSL_initialized = true; } /* * We use SSLv23_method() because it can negotiate use of the highest * mutually supported protocol version, while alternatives like * TLSv1_2_method() permit only one specific version. Note that we don't * actually allow SSL v2 or v3, only TLS protocols (see below). */ #if (OPENSSL_VERSION_NUMBER >= 0x10100000L && !defined (LIBRESSL_VERSION_NUMBER)) context = SSL_CTX_new(TLS_method()); #else context = SSL_CTX_new(SSLv23_method()); #endif if (!context) { ereport(WARNING, (errmsg("could not create SSL context: %s", SSLerrmessage(ERR_get_error())))); goto error; } /* * Disable OpenSSL's moving-write-buffer sanity check, because it causes * unnecessary failures in nonblocking send cases. */ SSL_CTX_set_mode(context, SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER); /* * prompt for password for passphrase-protected files */ SSL_CTX_set_default_passwd_cb(context, ssl_passwd_cb); /* * Load and verify server's certificate and private key */ if (SSL_CTX_use_certificate_chain_file(context, pool_config->ssl_cert) != 1) { ereport(WARNING, (errmsg("could not load server certificate file \"%s\": %s", pool_config->ssl_cert, SSLerrmessage(ERR_get_error())))); goto error; } if (stat(pool_config->ssl_key, &buf) != 0) { ereport(WARNING, (errmsg("could not access private key file \"%s\": %m", pool_config->ssl_key))); goto error; } if (!S_ISREG(buf.st_mode)) { ereport(WARNING, (errmsg("private key file \"%s\" is not a regular file", pool_config->ssl_key))); goto error; } /* * Require no public access to key file. If the file is owned by us, * require mode 0600 or less. If owned by root, require 0640 or less to * allow read access through our gid, or a supplementary gid that allows * to read system-wide certificates. * * XXX temporarily suppress check when on Windows, because there may not * be proper support for Unix-y file permissions. Need to think of a * reasonable check to apply on Windows. (See also the data directory * permission check in postmaster.c) */ #if !defined(WIN32) && !defined(__CYGWIN__) if ((buf.st_uid == geteuid() && buf.st_mode & (S_IRWXG | S_IRWXO)) || (buf.st_uid == 0 && buf.st_mode & (S_IWGRP | S_IXGRP | S_IRWXO))) { ereport(WARNING, (errmsg("private key file \"%s\" has group or world access", pool_config->ssl_key), errdetail("File must have permissions u=rw (0600) or less if owned by the Pgpool-II user, or permissions u=rw,g=r (0640) or less if owned by root."))); } #endif /* * OK, try to load the private key file. */ ssl_passwd_cb_called = false; if (SSL_CTX_use_PrivateKey_file(context, pool_config->ssl_key, SSL_FILETYPE_PEM) != 1) { if (ssl_passwd_cb_called) ereport(WARNING, (errmsg("private key file \"%s\" cannot be reloaded because it requires a passphrase", pool_config->ssl_key))); else ereport(WARNING, (errmsg("could not load private key file \"%s\": %s", pool_config->ssl_key, SSLerrmessage(ERR_get_error())))); goto error; } if (SSL_CTX_check_private_key(context) != 1) { ereport(WARNING, (errmsg("check of private key failed: %s", SSLerrmessage(ERR_get_error())))); goto error; } /* disallow SSL v2/v3 */ SSL_CTX_set_options(context, SSL_OP_NO_SSLv2 | SSL_OP_NO_SSLv3); /* disallow SSL session tickets */ #ifdef SSL_OP_NO_TICKET /* added in openssl 0.9.8f */ SSL_CTX_set_options(context, SSL_OP_NO_TICKET); #endif /* disallow SSL session caching, too */ SSL_CTX_set_session_cache_mode(context, SSL_SESS_CACHE_OFF); /* set up ephemeral DH and ECDH keys */ /* only isServerStart = true */ if (!initialize_dh(context)) goto error; if (!initialize_ecdh(context)) goto error; /* set up the allowed cipher list */ if (SSL_CTX_set_cipher_list(context, pool_config->ssl_ciphers) != 1) goto error; /* Let server choose order */ if (pool_config->ssl_prefer_server_ciphers) SSL_CTX_set_options(context, SSL_OP_CIPHER_SERVER_PREFERENCE); /* * Load CA store, so we can verify client certificates if needed. */ if (pool_config->ssl_ca_cert && strlen(pool_config->ssl_ca_cert)) { char *cacert = NULL, *cacert_dir = NULL; if (strlen(pool_config->ssl_ca_cert)) cacert = pool_config->ssl_ca_cert; if (strlen(pool_config->ssl_ca_cert_dir)) cacert_dir = pool_config->ssl_ca_cert_dir; if (SSL_CTX_load_verify_locations(context, cacert, cacert_dir) != 1 || (root_cert_list = SSL_load_client_CA_file(cacert)) == NULL) { ereport(WARNING, (errmsg("could not load root certificate file \"%s\": %s", pool_config->ssl_ca_cert, SSLerrmessage(ERR_get_error())))); goto error; } /* * Always ask for SSL client cert, but don't fail if it's not * presented. We might fail such connections later, depending on what * we find in pg_hba.conf. */ SSL_CTX_set_verify(context, (SSL_VERIFY_PEER | SSL_VERIFY_CLIENT_ONCE), verify_cb); /* * Tell OpenSSL to send the list of root certs we trust to clients in * CertificateRequests. This lets a client with a keystore select the * appropriate client certificate to send to us. */ SSL_CTX_set_client_CA_list(context, root_cert_list); } /* * Success! Replace any existing SSL_context. */ if (SSL_frontend_context) SSL_CTX_free(SSL_frontend_context); SSL_frontend_context = context; return 0; error: if (context) SSL_CTX_free(context); return -1; } /* * Set DH parameters for generating ephemeral DH keys. The * DH parameters can take a long time to compute, so they must be * precomputed. * * Since few sites will bother to create a parameter file, we also * provide a fallback to the parameters provided by the OpenSSL * project. * * These values can be static (once loaded or computed) since the * OpenSSL library can efficiently generate random keys from the * information provided. */ static bool initialize_dh(SSL_CTX *context) { DH *dh = NULL; SSL_CTX_set_options(context, SSL_OP_SINGLE_DH_USE); if (pool_config->ssl_dh_params_file[0]) dh = load_dh_file(pool_config->ssl_dh_params_file); if (!dh) dh = load_dh_buffer(FILE_DH2048, sizeof(FILE_DH2048)); if (!dh) { ereport(WARNING, (errmsg("DH: could not load DH parameters"))); return false; } return true; } /* * Set ECDH parameters for generating ephemeral Elliptic Curve DH * keys. This is much simpler than the DH parameters, as we just * need to provide the name of the curve to OpenSSL. */ static bool initialize_ecdh(SSL_CTX *context) { #ifndef OPENSSL_NO_ECDH EC_KEY *ecdh; int nid; nid = OBJ_sn2nid(pool_config->ssl_ecdh_curve); if (!nid) { ereport(WARNING, (errmsg("ECDH: unrecognized curve name: %s", pool_config->ssl_ecdh_curve))); return false; } ecdh = EC_KEY_new_by_curve_name(nid); if (!ecdh) { ereport(WARNING, (errmsg("ECDH: could not create key"))); return false; } SSL_CTX_set_options(context, SSL_OP_SINGLE_ECDH_USE); SSL_CTX_set_tmp_ecdh(context, ecdh); EC_KEY_free(ecdh); #endif return true; } /* * Load precomputed DH parameters. * * To prevent "downgrade" attacks, we perform a number of checks * to verify that the DBA-generated DH parameters file contains * what we expect it to contain. */ static DH * load_dh_file(char *filename) { FILE *fp; DH *dh = NULL; int codes; /* attempt to open file. It's not an error if it doesn't exist. */ if ((fp = fopen(filename, "r")) == NULL) { ereport(WARNING, (errmsg("could not open DH parameters file \"%s\": %m", filename))); return NULL; } dh = PEM_read_DHparams(fp, NULL, NULL, NULL); fclose(fp); if (dh == NULL) { ereport(WARNING, (errmsg("could not load DH parameters file: %s", SSLerrmessage(ERR_get_error())))); return NULL; } /* make sure the DH parameters are usable */ if (DH_check(dh, &codes) == 0) { ereport(WARNING, (errmsg("invalid DH parameters: %s", SSLerrmessage(ERR_get_error())))); return NULL; } if (codes & DH_CHECK_P_NOT_PRIME) { ereport(WARNING, (errmsg("invalid DH parameters: p is not prime"))); return NULL; } if ((codes & DH_NOT_SUITABLE_GENERATOR) && (codes & DH_CHECK_P_NOT_SAFE_PRIME)) { ereport(WARNING, (errmsg("invalid DH parameters: neither suitable generator or safe prime"))); return NULL; } return dh; } /* * Load hardcoded DH parameters. * * To prevent problems if the DH parameters files don't even * exist, we can load DH parameters hardcoded into this file. */ static DH * load_dh_buffer(const char *buffer, size_t len) { BIO *bio; DH *dh = NULL; bio = BIO_new_mem_buf(unconstify(char *, buffer), len); if (bio == NULL) return NULL; dh = PEM_read_bio_DHparams(bio, NULL, NULL, NULL); if (dh == NULL) ereport(DEBUG2, (errmsg_internal("DH load buffer: %s", SSLerrmessage(ERR_get_error())))); BIO_free(bio); return dh; } #else /* USE_SSL: wrap / no-op ssl functionality if * it's not available */ void pool_ssl_negotiate_serverclient(POOL_CONNECTION * cp) { ereport(DEBUG1, (errmsg("SSL is requested but SSL support is not available"))); pool_write_and_flush(cp, "N", 1); cp->ssl_active = -1; } void pool_ssl_negotiate_clientserver(POOL_CONNECTION * cp) { ereport(DEBUG1, (errmsg("SSL is requested but SSL support is not available"))); cp->ssl_active = -1; } void pool_ssl_close(POOL_CONNECTION * cp) { return; } int pool_ssl_read(POOL_CONNECTION * cp, void *buf, int size) { ereport(WARNING, (errmsg("pool_ssl: SSL i/o called but SSL support is not available"))); notice_backend_error(cp->db_node_id, REQ_DETAIL_SWITCHOVER); child_exit(POOL_EXIT_AND_RESTART); return -1; /* never reached */ } int pool_ssl_write(POOL_CONNECTION * cp, const void *buf, int size) { ereport(WARNING, (errmsg("pool_ssl: SSL i/o called but SSL support is not available"))); notice_backend_error(cp->db_node_id, REQ_DETAIL_SWITCHOVER); child_exit(POOL_EXIT_AND_RESTART); return -1; /* never reached */ } int SSL_ServerSide_init(void) { return 0; } bool pool_ssl_pending(POOL_CONNECTION * cp) { return false; } #endif /* USE_SSL */ pgpool-II-4.1.4/src/utils/pool_stream.c0000664000175000017500000007767213730350127014705 00000000000000/* -*-pgsql-c-*- */ /* * pgpool: a language independent connection pool server for PostgreSQL * written by Tatsuo Ishii * * Copyright (c) 2003-2019 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_stream.c: stream I/O modules * */ #include "config.h" #ifdef HAVE_SYS_SELECT_H #include #endif #include #include #include #include #include #ifdef HAVE_FCNTL_H #include #endif #include "pool.h" #include "utils/elog.h" #include "utils/palloc.h" #include "utils/memutils.h" #include "utils/pool_stream.h" #include "pool_config.h" static int mystrlen(char *str, int upper, int *flag); static int mystrlinelen(char *str, int upper, int *flag); static int save_pending_data(POOL_CONNECTION * cp, void *data, int len); static int consume_pending_data(POOL_CONNECTION * cp, void *data, int len); static MemoryContext SwitchToConnectionContext(bool backend_connection); #ifdef DEBUG static void dump_buffer(char *buf, int len); #endif static int pool_write_flush(POOL_CONNECTION * cp, void *buf, int len); /* timeout sec for pool_check_fd */ static int timeoutsec = -1; static MemoryContext SwitchToConnectionContext(bool backend_connection) { /* * backend connection can live as long as process life, while the frontend * connection is only for one session life. So we create backend * connection in long living memory context */ if (backend_connection) return MemoryContextSwitchTo(TopMemoryContext); else return MemoryContextSwitchTo(ProcessLoopContext); } /* * open read/write file descriptors. * returns POOL_CONNECTION on success otherwise NULL. */ POOL_CONNECTION * pool_open(int fd, bool backend_connection) { POOL_CONNECTION *cp; MemoryContext oldContext = SwitchToConnectionContext(backend_connection); cp = (POOL_CONNECTION *) palloc0(sizeof(POOL_CONNECTION)); /* initialize write buffer */ cp->wbuf = palloc(WRITEBUFSZ); cp->wbufsz = WRITEBUFSZ; cp->wbufpo = 0; /* initialize pending data buffer */ cp->hp = palloc(READBUFSZ); cp->bufsz = READBUFSZ; cp->po = 0; cp->len = 0; cp->sbuf = NULL; cp->sbufsz = 0; cp->buf2 = NULL; cp->bufsz2 = 0; cp->buf3 = NULL; cp->bufsz3 = 0; cp->fd = fd; cp->socket_state = POOL_SOCKET_VALID; MemoryContextSwitchTo(oldContext); return cp; } /* * close read/write file descriptors. */ void pool_close(POOL_CONNECTION * cp) { /* * shutdown connection to the client so that pgpool is not blocked */ if (!cp->isbackend) shutdown(cp->fd, 1); close(cp->fd); cp->socket_state = POOL_SOCKET_CLOSED; pfree(cp->wbuf); pfree(cp->hp); if (cp->sbuf) pfree(cp->sbuf); if (cp->buf2) pfree(cp->buf2); if (cp->buf3) pfree(cp->buf3); pool_discard_params(&cp->params); pool_ssl_close(cp); pfree(cp); } void pool_read_with_error(POOL_CONNECTION * cp, void *buf, int len, const char *err_context) { if (pool_read(cp, buf, len) < 0) { ereport(ERROR, (errmsg("failed to read data of length %d from DB node: %d", len, cp->db_node_id), errdetail("error occurred when reading: %s", err_context ? err_context : ""))); } } /* * read len bytes from cp * returns 0 on success otherwise throws an ereport. */ int pool_read(POOL_CONNECTION * cp, void *buf, int len) { static char readbuf[READBUFSZ]; int consume_size; int readlen; consume_size = consume_pending_data(cp, buf, len); len -= consume_size; buf += consume_size; while (len > 0) { /* * If select(2) timeout is disabled, there's no need to call * pool_check_fd(). */ if (pool_get_timeout() >= 0 && pool_check_fd(cp)) { if (!IS_MASTER_NODE_ID(cp->db_node_id) && (getpid() != mypid)) { ereport(FATAL, (errmsg("unable to read data from DB node %d", cp->db_node_id), errdetail("data is not ready in DB node"))); } else { ereport(ERROR, (errmsg("unable to read data from DB node %d", cp->db_node_id), errdetail("pool_check_fd call failed with an error \"%s\"", strerror(errno)))); } } if (cp->ssl_active > 0) { readlen = pool_ssl_read(cp, readbuf, READBUFSZ); } else { readlen = read(cp->fd, readbuf, READBUFSZ); if (cp->isbackend) { ereport(DEBUG5, (errmsg("pool_read: read %d bytes from backend %d", readlen, cp->db_node_id))); #ifdef DEBUG dump_buffer(readbuf, readlen); #endif } } if (readlen == -1) { if (processType == PT_HEALTH_CHECK && health_check_timer_expired && errno == EINTR) { ereport(ERROR, (errmsg("health check timed out while waiting for reading data"))); return -1; } if (errno == EINTR || errno == EAGAIN) { ereport(DEBUG5, (errmsg("read on socket failed with error :\"%s\"", strerror(errno)), errdetail("retrying..."))); continue; } cp->socket_state = POOL_SOCKET_ERROR; if (cp->isbackend) { if (cp->con_info && cp->con_info->swallow_termination == 1) { cp->con_info->swallow_termination = 0; ereport(FATAL, (errmsg("unable to read data from DB node %d", cp->db_node_id), errdetail("pg_terminate_backend was called on the backend"))); } /* * if failover_on_backend_error is true, then trigger * failover */ if (pool_config->failover_on_backend_error) { notice_backend_error(cp->db_node_id, REQ_DETAIL_SWITCHOVER); /* If we are in the main process, we will not exit */ child_exit(POOL_EXIT_AND_RESTART); ereport(ERROR, (errmsg("unable to read data from DB node %d", cp->db_node_id), errdetail("socket read failed with an error \"%s\"", strerror(errno)))); } else { ereport(ERROR, (errmsg("unable to read data from DB node %d", cp->db_node_id), errdetail("socket read failed with an error \"%s\"", strerror(errno)))); } } else { ereport(FRONTEND_ERROR, (errmsg("unable to read data from frontend"), errdetail("socket read failed with an error \"%s\"", strerror(errno)))); } } else if (readlen == 0) { cp->socket_state = POOL_SOCKET_EOF; if (cp->isbackend) { if (processType == PT_MAIN || processType == PT_HEALTH_CHECK) ereport(ERROR, (errmsg("unable to read data from DB node %d", cp->db_node_id), errdetail("EOF encountered with backend"))); ereport(FATAL, (errmsg("unable to read data from DB node %d", cp->db_node_id), errdetail("EOF encountered with backend"))); } else { /* * if backend offers authentication method, frontend could * close connection */ ereport(FRONTEND_ERROR, (errmsg("unable to read data from frontend"), errdetail("EOF encountered with frontend"))); } } if (len < readlen) { /* overrun. we need to save remaining data to pending buffer */ save_pending_data(cp, readbuf + len, readlen - len); memmove(buf, readbuf, len); break; } memmove(buf, readbuf, readlen); buf += readlen; len -= readlen; } return 0; } /* * read exactly len bytes from cp * returns buffer address on success otherwise NULL. */ char * pool_read2(POOL_CONNECTION * cp, int len) { char *buf; int req_size; int alloc_size; int consume_size; int readlen; MemoryContext oldContext = SwitchToConnectionContext(cp->isbackend); req_size = cp->len + len; if (req_size > cp->bufsz2) { alloc_size = ((req_size + 1) / READBUFSZ + 1) * READBUFSZ; cp->buf2 = repalloc(cp->buf2, alloc_size); cp->bufsz2 = alloc_size; } buf = cp->buf2; consume_size = consume_pending_data(cp, buf, len); len -= consume_size; buf += consume_size; while (len > 0) { /* * If select(2) timeout is disabled, there's no need to call * pool_check_fd(). */ if (pool_get_timeout() >= 0 && pool_check_fd(cp)) { if (!IS_MASTER_NODE_ID(cp->db_node_id)) { ereport(FATAL, (errmsg("unable to read data from DB node %d", cp->db_node_id), errdetail("data is not ready in DB node"))); } else { ereport(ERROR, (errmsg("unable to read data from DB node %d", cp->db_node_id), errdetail("pool_check_fd call failed with an error \"%s\"", strerror(errno)))); } } if (cp->ssl_active > 0) { readlen = pool_ssl_read(cp, buf, len); } else { readlen = read(cp->fd, buf, len); if (cp->isbackend) ereport(DEBUG5, (errmsg("pool_read2: read %d bytes from backend %d", readlen, cp->db_node_id))); } if (readlen == -1) { if (errno == EINTR || errno == EAGAIN) { ereport(DEBUG5, (errmsg("read on socket failed with error :\"%s\"", strerror(errno)), errdetail("retrying..."))); continue; } cp->socket_state = POOL_SOCKET_ERROR; if (cp->isbackend) { if (cp->con_info && cp->con_info->swallow_termination == 1) { cp->con_info->swallow_termination = 0; ereport(FATAL, (errmsg("unable to read data from DB node %d", cp->db_node_id), errdetail("pg_terminate_backend was called on the backend"))); } /* * if failover_on_backend_error is true, then trigger * failover */ if (pool_config->failover_on_backend_error) { notice_backend_error(cp->db_node_id, REQ_DETAIL_SWITCHOVER); child_exit(POOL_EXIT_AND_RESTART); /* we are in main process */ ereport(ERROR, (errmsg("unable to read data from DB node %d", cp->db_node_id), errdetail("socket read failed with an error \"%s\"", strerror(errno)))); } else { ereport(ERROR, (errmsg("unable to read data from DB node %d", cp->db_node_id), errdetail("do not failover because failover_on_backend_error is off"))); } } else { ereport(ERROR, (errmsg("unable to read data from frontend"), errdetail("socket read function returned -1"))); } } else if (readlen == 0) { cp->socket_state = POOL_SOCKET_EOF; if (cp->isbackend) { ereport(ERROR, (errmsg("unable to read data from backend"), errdetail("EOF read on socket"))); } else { /* * if backend offers authentication method, frontend could * close connection */ ereport(ERROR, (errmsg("unable to read data from frontend"), errdetail("EOF read on socket"))); } } buf += readlen; len -= readlen; } MemoryContextSwitchTo(oldContext); return cp->buf2; } /* * write len bytes to cp the write buffer. * returns 0 on success otherwise -1. */ int pool_write_noerror(POOL_CONNECTION * cp, void *buf, int len) { if (len < 0) return -1; if (cp->no_forward) return 0; if (len == 1 && cp->isbackend) { char c; c = ((char *) buf)[0]; ereport(DEBUG5, (errmsg("pool_write: to backend: %d kind:%c", cp->db_node_id, c))); } if (!cp->isbackend) { char c; c = ((char *) buf)[0]; if (len == 1) ereport(DEBUG5, (errmsg("pool_write: to frontend: kind:%c po:%d", c, cp->wbufpo))); else ereport(DEBUG5, (errmsg("pool_write: to frontend: length:%d po:%d", len, cp->wbufpo))); } while (len > 0) { int remainder = WRITEBUFSZ - cp->wbufpo; /* * If requested data cannot be added to the write buffer, flush the * buffer and directly write the requested data. This could avoid * unwanted write in the middle of message boundary. */ if (remainder < len) { if (pool_flush_it(cp) == -1) return -1; if (pool_write_flush(cp, buf, len) < 0) return -1; return 0; } if (cp->wbufpo >= WRITEBUFSZ) { /* * Write buffer is full. so flush buffer. wbufpo is reset in * pool_flush_it(). */ if (pool_flush_it(cp) == -1) return -1; remainder = WRITEBUFSZ; } /* check buffer size */ remainder = Min(remainder, len); memcpy(cp->wbuf + cp->wbufpo, buf, remainder); cp->wbufpo += remainder; buf += remainder; len -= remainder; } return 0; } /* * write len bytes to cp the write buffer. * returns 0 on success otherwise ereport. */ int pool_write(POOL_CONNECTION * cp, void *buf, int len) { if (len < 0) ereport(ERROR, (errmsg("unable to write data to %s", cp->isbackend ? "backend" : "frontend"), errdetail("invalid data size: %d", len))); if (pool_write_noerror(cp, buf, len)) ereport(ERROR, (errmsg("unable to write data to %s", cp->isbackend ? "backend" : "frontend"), errdetail("pool_flush failed"))); return 0; } /* * Direct write. * This function does not throws an ereport in case of an error */ static int pool_write_flush(POOL_CONNECTION * cp, void *buf, int len) { int sts; int wlen; int offset; wlen = len; ereport(DEBUG5, (errmsg("pool_write_flush: write size: %d", wlen))); if (wlen == 0) { return 0; } offset = 0; for (;;) { errno = 0; if (cp->ssl_active > 0) { sts = pool_ssl_write(cp, buf + offset, wlen); } else { sts = write(cp->fd, buf + offset, wlen); } if (sts >= 0) { wlen -= sts; if (wlen == 0) { /* write completed */ break; } else if (wlen < 0) { ereport(WARNING, (errmsg("pool_write_flush: invalid write size %d", sts))); return -1; } else { /* need to write remaining data */ ereport(DEBUG5, (errmsg("pool_write_flush: write retry: %d", wlen))); offset += sts; continue; } } else if (errno == EAGAIN || errno == EINTR) { continue; } else { /* * If this is the backend stream, report error. Otherwise just * report debug message. */ if (cp->isbackend) ereport(WARNING, (errmsg("write on backend %d failed with error :\"%s\"", cp->db_node_id, strerror(errno)), errdetail("while trying to write data from offset: %d wlen: %d", offset, wlen))); else ereport(DEBUG5, (errmsg("write on frontend failed with error :\"%s\"", strerror(errno)), errdetail("while trying to write data from offset: %d wlen: %d", offset, wlen))); return -1; } } return 0; } /* * flush write buffer * This function does not throws an ereport in case of an error */ int pool_flush_it(POOL_CONNECTION * cp) { int sts; int wlen; int offset; wlen = cp->wbufpo; ereport(DEBUG5, (errmsg("pool_flush_it: flush size: %d", wlen))); if (wlen == 0) { return 0; } offset = 0; for (;;) { errno = 0; if (cp->ssl_active > 0) { sts = pool_ssl_write(cp, cp->wbuf + offset, wlen); } else { sts = write(cp->fd, cp->wbuf + offset, wlen); } if (sts >= 0) { wlen -= sts; if (wlen == 0) { /* write completed */ break; } else if (wlen < 0) { ereport(WARNING, (errmsg("pool_flush_it: invalid write size %d", sts))); cp->wbufpo = 0; return -1; } else { /* need to write remaining data */ ereport(DEBUG5, (errmsg("pool_flush_it: write retry: %d", wlen))); offset += sts; continue; } } else if (errno == EAGAIN || errno == EINTR) { continue; } else { /* * If this is the backend stream, report error. Otherwise just * report debug message. */ if (cp->isbackend) ereport(WARNING, (errmsg("write on backend %d failed with error :\"%s\"", cp->db_node_id, strerror(errno)), errdetail("while trying to write data from offset: %d wlen: %d", offset, wlen))); else ereport(DEBUG5, (errmsg("write on frontend failed with error :\"%s\"", strerror(errno)), errdetail("while trying to write data from offset: %d wlen: %d", offset, wlen))); cp->wbufpo = 0; return -1; } } cp->wbufpo = 0; return 0; } /* * flush write buffer and degenerate/failover if error occurs */ int pool_flush(POOL_CONNECTION * cp) { if (pool_flush_it(cp) == -1) { if (cp->isbackend) { if (cp->con_info && cp->con_info->swallow_termination == 1) { cp->con_info->swallow_termination = 0; ereport(FATAL, (errmsg("unable to read data from DB node %d", cp->db_node_id), errdetail("pg_terminate_backend was called on the backend"))); } /* if failover_on_backend_error is true, then trigger failover */ if (pool_config->failover_on_backend_error) { notice_backend_error(cp->db_node_id, REQ_DETAIL_SWITCHOVER); ereport(LOG, (errmsg("unable to flush data to backend"), errdetail("do not failover because I am the main process"))); child_exit(POOL_EXIT_AND_RESTART); return -1; } else { ereport(ERROR, (errmsg("unable to flush data to backend"), errdetail("do not failover because failover_on_backend_error is off"))); } } else { /* * If we are in replication mode, we need to continue the * processing with backends to keep consistency among backends, * thus ignore error. */ if (REPLICATION) ereport(NOTICE, (errmsg("unable to flush data to frontend"), errdetail("pgpool is in replication mode, ignoring error to keep consistency among backends"))); else ereport(FRONTEND_ERROR, (errmsg("unable to flush data to frontend"))); } } return 0; } /* * same as pool_flush() but returns -ve value instead of ereport in case of failure */ int pool_flush_noerror(POOL_CONNECTION * cp) { if (pool_flush_it(cp) == -1) { if (cp->isbackend) { if (cp->con_info && cp->con_info->swallow_termination == 1) { cp->con_info->swallow_termination = 0; ereport(FATAL, (errmsg("unable to read data from DB node %d", cp->db_node_id), errdetail("pg_terminate_backend was called on the backend"))); } /* if fail_over_on_backend_erro is true, then trigger failover */ if (pool_config->failover_on_backend_error) { notice_backend_error(cp->db_node_id, REQ_DETAIL_SWITCHOVER); child_exit(POOL_EXIT_AND_RESTART); ereport(LOG, (errmsg("unable to flush data to backend"), errdetail("do not failover because I am the main process"))); return -1; } else { ereport(LOG, (errmsg("unable to flush data to backend"), errdetail("do not failover because failover_on_backend_error is off"))); return -1; } } else { /* * If we are in replication mode, we need to continue the * processing with backends to keep consistency among backends, * thus ignore error. */ if (REPLICATION) return 0; else return -1; } } return 0; } /* * combo of pool_write and pool_flush */ void pool_write_and_flush(POOL_CONNECTION * cp, void *buf, int len) { pool_write(cp, buf, len); pool_flush(cp); } /* * same as pool_write_and_flush() but does not throws ereport when error occures */ int pool_write_and_flush_noerror(POOL_CONNECTION * cp, void *buf, int len) { int ret; ret = pool_write_noerror(cp, buf, len); if (ret == 0) return pool_flush_noerror(cp); return ret; } /* * read a string until EOF or NULL is encountered. * if line is not 0, read until new line is encountered. */ char * pool_read_string(POOL_CONNECTION * cp, int *len, int line) { int readp; int readsize; int readlen; int strlength; int flag; int consume_size; #ifdef DEBUG static char pbuf[READBUFSZ]; #endif *len = 0; readp = 0; /* initialize read buffer */ if (cp->sbufsz == 0) { MemoryContext oldContext = SwitchToConnectionContext(cp->isbackend); cp->sbuf = palloc(READBUFSZ); MemoryContextSwitchTo(oldContext); cp->sbufsz = READBUFSZ; *cp->sbuf = '\0'; } /* any pending data? */ if (cp->len) { if (line) strlength = mystrlinelen(cp->hp + cp->po, cp->len, &flag); else strlength = mystrlen(cp->hp + cp->po, cp->len, &flag); /* buffer is too small? */ if ((strlength + 1) > cp->sbufsz) { MemoryContext oldContext = SwitchToConnectionContext(cp->isbackend); cp->sbufsz = ((strlength + 1) / READBUFSZ + 1) * READBUFSZ; cp->sbuf = repalloc(cp->sbuf, cp->sbufsz); MemoryContextSwitchTo(oldContext); } /* consume pending and save to read string buffer */ consume_size = consume_pending_data(cp, cp->sbuf, strlength); *len = strlength; /* is the string null terminated? */ if (consume_size == strlength && !flag) { /* * not null or line terminated. we need to read more since we have * not encountered NULL or new line yet */ readsize = cp->sbufsz - strlength; readp = strlength; } else { ereport(DEBUG5, (errmsg("reading string data"), errdetail("read all from pending data. po:%d len:%d", cp->po, cp->len))); return cp->sbuf; } } else { readsize = cp->sbufsz; } for (;;) { if (pool_check_fd(cp)) { if (!IS_MASTER_NODE_ID(cp->db_node_id)) { ereport(FATAL, (errmsg("unable to read data from DB node %d", cp->db_node_id), errdetail("data is not ready in DB node"))); } else { ereport(ERROR, (errmsg("unable to read data from DB node %d", cp->db_node_id), errdetail("pool_check_fd call failed with an error \"%s\"", strerror(errno)))); } } if (cp->ssl_active > 0) { readlen = pool_ssl_read(cp, cp->sbuf + readp, readsize); } else { readlen = read(cp->fd, cp->sbuf + readp, readsize); } if (readlen == -1) { cp->socket_state = POOL_SOCKET_ERROR; if (cp->isbackend) { if (cp->con_info && cp->con_info->swallow_termination == 1) { cp->con_info->swallow_termination = 0; ereport(FATAL, (errmsg("unable to read data from DB node %d", cp->db_node_id), errdetail("pg_terminate_backend was called on the backend"))); } notice_backend_error(cp->db_node_id, REQ_DETAIL_SWITCHOVER); child_exit(POOL_EXIT_AND_RESTART); ereport(ERROR, (errmsg("unable to read data from frontend"), errdetail("socket read function returned -1"))); } else { ereport(ERROR, (errmsg("unable to read data from frontend"), errdetail("socket read function returned -1"))); } } else if (readlen == 0) /* EOF detected */ { /* * just returns an error, not trigger failover or degeneration */ cp->socket_state = POOL_SOCKET_EOF; ereport(ERROR, (errmsg("unable to read data from %s", cp->isbackend ? "backend" : "frontend"), errdetail("EOF read on socket"))); } /* check overrun */ if (line) strlength = mystrlinelen(cp->sbuf + readp, readlen, &flag); else strlength = mystrlen(cp->sbuf + readp, readlen, &flag); if (strlength < readlen) { save_pending_data(cp, cp->sbuf + readp + strlength, readlen - strlength); *len += strlength; ereport(DEBUG5, (errmsg("reading string data"), errdetail("total read %d with pending data po:%d len:%d", *len, cp->po, cp->len))); return cp->sbuf; } *len += readlen; /* encountered null or newline? */ if (flag) { /* ok we have read all data */ ereport(DEBUG5, (errmsg("reading string data"), errdetail("all data read: total read %d", *len))); break; } readp += readlen; readsize = READBUFSZ; if ((*len + readsize) > cp->sbufsz) { cp->sbufsz += READBUFSZ; MemoryContext oldContext = SwitchToConnectionContext(cp->isbackend); cp->sbuf = repalloc(cp->sbuf, cp->sbufsz); MemoryContextSwitchTo(oldContext); } } return cp->sbuf; } /* * Set db node id to connection. */ void pool_set_db_node_id(POOL_CONNECTION * con, int db_node_id) { if (!con) return; con->db_node_id = db_node_id; } /* * returns the byte length of str, including \0, no more than upper. * if encountered \0, flag is set to non 0. * example: * mystrlen("abc", 2) returns 2 * mystrlen("abc", 3) returns 3 * mystrlen("abc", 4) returns 4 * mystrlen("abc", 5) returns 4 */ static int mystrlen(char *str, int upper, int *flag) { int len; *flag = 0; for (len = 0; len < upper; len++, str++) { if (!*str) { len++; *flag = 1; break; } } return len; } /* * returns the byte length of str terminated by \n or \0 (including \n or \0), no more than upper. * if encountered \0 or \n, flag is set to non 0. * example: * mystrlinelen("abc", 2) returns 2 * mystrlinelen("abc", 3) returns 3 * mystrlinelen("abc", 4) returns 4 * mystrlinelen("abc", 5) returns 4 * mystrlinelen("abcd\nefg", 4) returns 4 * mystrlinelen("abcd\nefg", 5) returns 5 * mystrlinelen("abcd\nefg", 6) returns 5 */ static int mystrlinelen(char *str, int upper, int *flag) { int len; *flag = 0; for (len = 0; len < upper; len++, str++) { if (!*str || *str == '\n') { len++; *flag = 1; break; } } return len; } /* * save pending data */ static int save_pending_data(POOL_CONNECTION * cp, void *data, int len) { int reqlen; size_t realloc_size; char *p; /* to be safe */ if (cp->len == 0) cp->po = 0; reqlen = cp->po + cp->len + len; /* pending buffer is enough? */ if (reqlen > cp->bufsz) { /* too small, enlarge it */ realloc_size = (reqlen / READBUFSZ + 1) * READBUFSZ; MemoryContext oldContext = SwitchToConnectionContext(cp->isbackend); p = repalloc(cp->hp, realloc_size); MemoryContextSwitchTo(oldContext); cp->bufsz = realloc_size; cp->hp = p; } memmove(cp->hp + cp->po + cp->len, data, len); cp->len += len; return 0; } /* * consume pending data. returns actually consumed data length. */ static int consume_pending_data(POOL_CONNECTION * cp, void *data, int len) { int consume_size; if (cp->len <= 0) return 0; consume_size = Min(len, cp->len); memmove(data, cp->hp + cp->po, consume_size); cp->len -= consume_size; if (cp->len <= 0) cp->po = 0; else cp->po += consume_size; return consume_size; } /* * pool_unread: Put back data to input buffer */ int pool_unread(POOL_CONNECTION * cp, void *data, int len) { void *p = cp->hp; int n = cp->len + len; int realloc_size; /* * Optimization to avoid mmove. If there's enough space in front of * existing data, we can use it. */ if (cp->po >= len) { memmove(cp->hp + cp->po - len, data, len); cp->po -= len; cp->len = n; return 0; } if (cp->bufsz < n) { realloc_size = (n / READBUFSZ + 1) * READBUFSZ; MemoryContext oldContext = SwitchToConnectionContext(cp->isbackend); p = repalloc(cp->hp, realloc_size); MemoryContextSwitchTo(oldContext); cp->hp = p; cp->bufsz = realloc_size; } if (cp->len != 0) memmove(p + len, cp->hp + cp->po, cp->len); memmove(p, data, len); cp->len = n; cp->po = 0; return 0; } /* * pool_push: Push data into buffer stack. */ int pool_push(POOL_CONNECTION * cp, void *data, int len) { char *p; ereport(DEBUG5, (errmsg("pushing data of len: %d", len))); MemoryContext oldContext = SwitchToConnectionContext(cp->isbackend); if (cp->bufsz3 == 0) { p = cp->buf3 = palloc(len); } else { cp->buf3 = repalloc(cp->buf3, cp->bufsz3 + len); p = cp->buf3 + cp->bufsz3; } memcpy(p, data, len); cp->bufsz3 += len; MemoryContextSwitchTo(oldContext); return 0; } /* * pool_pop: Pop data from buffer stack and put back data using * pool_unread. */ void pool_pop(POOL_CONNECTION * cp, int *len) { if (cp->bufsz3 == 0) { *len = 0; ereport(DEBUG5, (errmsg("pop data of len: %d", *len))); return; } pool_unread(cp, cp->buf3, cp->bufsz3); *len = cp->bufsz3; pfree(cp->buf3); cp->bufsz3 = 0; cp->buf3 = NULL; ereport(DEBUG5, (errmsg("pop data of len: %d", *len))); } /* * pool_stacklen: Returns buffer stack length * pool_unread. */ int pool_stacklen(POOL_CONNECTION * cp) { return cp->bufsz3; } /* * set non-block flag */ void pool_set_nonblock(int fd) { int var; /* set fd to none blocking */ var = fcntl(fd, F_GETFL, 0); if (var == -1) { ereport(FATAL, (errmsg("unable to set options on socket"), errdetail("fcntl system call failed with error \"%s\"", strerror(errno)))); } if (fcntl(fd, F_SETFL, var | O_NONBLOCK) == -1) { ereport(FATAL, (errmsg("unable to set options on socket"), errdetail("fcntl system call failed with error \"%s\"", strerror(errno)))); } } /* * unset non-block flag */ void pool_unset_nonblock(int fd) { int var; /* set fd to none blocking */ var = fcntl(fd, F_GETFL, 0); if (var == -1) { ereport(FATAL, (errmsg("unable to set options on socket"), errdetail("fcntl system call failed with error \"%s\"", strerror(errno)))); } if (fcntl(fd, F_SETFL, var & ~O_NONBLOCK) == -1) { ereport(FATAL, (errmsg("unable to set options on socket"), errdetail("fcntl system call failed with error \"%s\"", strerror(errno)))); } } #ifdef DEBUG /* * Debug aid */ static void dump_buffer(char *buf, int len) { while (--len) { ereport(DEBUG5, (errmsg("%02x", *buf++))); } } #endif int socket_write(int fd, void *buf, size_t len) { int bytes_send = 0; do { int ret; ret = write(fd, buf + bytes_send, (len - bytes_send)); if (ret <= 0) { if (errno == EINTR || errno == EAGAIN) { ereport(DEBUG5, (errmsg("write on socket failed with error :\"%s\"", strerror(errno)), errdetail("retrying..."))); continue; } ereport(LOG, (errmsg("write on socket failed with error :\"%s\"", strerror(errno)))); return -1; } bytes_send += ret; } while (bytes_send < len); return bytes_send; } int socket_read(int fd, void *buf, size_t len, int timeout) { int ret, read_len; read_len = 0; struct timeval timeoutval; fd_set readmask; int fds; while (read_len < len) { FD_ZERO(&readmask); FD_SET(fd, &readmask); timeoutval.tv_sec = timeout; timeoutval.tv_usec = 0; fds = select(fd + 1, &readmask, NULL, NULL, timeout ? &timeoutval : NULL); if (fds == -1) { if (errno == EAGAIN || errno == EINTR) continue; ereport(WARNING, (errmsg("select failed with error: \"%s\"", strerror(errno)))); return -1; } else if (fds == 0) { return -2; } ret = read(fd, buf + read_len, (len - read_len)); if (ret < 0) { if (errno == EINTR || errno == EAGAIN) { ereport(DEBUG5, (errmsg("read from socket failed with error :\"%s\"", strerror(errno)), errdetail("retrying..."))); continue; } ereport(LOG, (errmsg("read from socket failed with error :\"%s\"", strerror(errno)))); return -1; } if (ret == 0) { ereport(LOG, (errmsg("read from socket failed, remote end closed the connection"))); return 0; } read_len += ret; } return read_len; } /* * Set timeout in seconds for pool_check_fd * if timeoutval < 0, we assume no timeout (wait forever). */ void pool_set_timeout(int timeoutval) { if (timeoutval >= 0) timeoutsec = timeoutval; else timeoutsec = -1; } /* * Get timeout in seconds for pool_check_fd */ int pool_get_timeout(void) { return timeoutsec; } /* * Wait until read data is ready. * return values: 0: normal 1: data is not ready -1: error */ int pool_check_fd(POOL_CONNECTION * cp) { fd_set readmask; fd_set exceptmask; int fd; int fds; struct timeval timeout; struct timeval *timeoutp; int save_errno; /* * If SSL is enabled, we need to check SSL internal buffer is empty or not * first. Otherwise select(2) will stuck. */ if (pool_ssl_pending(cp)) { return 0; } fd = cp->fd; if (timeoutsec >= 0) { timeout.tv_sec = timeoutsec; timeout.tv_usec = 0; timeoutp = &timeout; } else timeoutp = NULL; for (;;) { FD_ZERO(&readmask); FD_ZERO(&exceptmask); FD_SET(fd, &readmask); FD_SET(fd, &exceptmask); fds = select(fd + 1, &readmask, NULL, &exceptmask, timeoutp); save_errno = errno; if (fds == -1) { if (processType == PT_HEALTH_CHECK && errno == EINTR && health_check_timer_expired) { ereport(WARNING, (errmsg("health check timed out while waiting for reading data"))); errno = save_errno; return 1; } if (errno == EAGAIN || errno == EINTR) continue; ereport(WARNING, (errmsg("waiting for reading data. select failed with error: \"%s\"", strerror(errno)))); break; } else if (fds == 0) /* timeout */ return 1; if (FD_ISSET(fd, &exceptmask)) { ereport(WARNING, (errmsg("waiting for reading data. exception occurred in select "))); break; } errno = save_errno; return 0; } return -1; } pgpool-II-4.1.4/src/utils/getopt_long.c0000664000175000017500000001121013730350075014654 00000000000000/* * getopt_long() -- long options parser * * Portions Copyright (c) 1987, 1993, 1994 * The Regents of the University of California. All rights reserved. * * Portions Copyright (c) 2003 * PostgreSQL Global Development Group * * 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. * * $PostgreSQL: pgsql/src/port/getopt_long.c,v 1.8 2009-06-11 14:49:15 momjian Exp $ */ #include #include #include "utils/getopt_long.h" #ifndef HAVE_INT_OPTRESET int optreset; /* else the "extern" was provided by getopt_long.h */ #endif #define BADCH '?' #define BADARG ':' #define EMSG "" int getopt_long(int argc, char *const argv[], const char *optstring, const struct option *longopts, int *longindex) { static char *place = EMSG; /* option letter processing */ char *oli; /* option letter list index */ if (optreset || !*place) { /* update scanning pointer */ optreset = 0; if (optind >= argc) { place = EMSG; return -1; } place = argv[optind]; if (place[0] != '-') { place = EMSG; return -1; } place++; if (place[0] && place[0] == '-' && place[1] == '\0') { /* found "--" */ ++optind; place = EMSG; return -1; } if (place[0] && place[0] == '-' && place[1]) { /* long option */ size_t namelen; int i; place++; namelen = strcspn(place, "="); for (i = 0; longopts[i].name != NULL; i++) { if (strlen(longopts[i].name) == namelen && strncmp(place, longopts[i].name, namelen) == 0) { if (longopts[i].has_arg) { if (place[namelen] == '=') optarg = place + namelen + 1; else if (optind < argc - 1) { optind++; optarg = argv[optind]; } else { if (optstring[0] == ':') return BADARG; if (opterr) fprintf(stderr, "%s: option requires an argument -- %s\n", argv[0], place); place = EMSG; optind++; return BADCH; } } else { optarg = NULL; if (place[namelen] != 0) { /* XXX error? */ } } optind++; if (longindex) *longindex = i; place = EMSG; if (longopts[i].flag == NULL) return longopts[i].val; else { *longopts[i].flag = longopts[i].val; return 0; } } } if (opterr && optstring[0] != ':') fprintf(stderr, "%s: illegal option -- %s\n", argv[0], place); place = EMSG; optind++; return BADCH; } } /* short option */ optopt = (int) *place++; oli = strchr(optstring, optopt); if (!oli) { if (!*place) ++optind; if (opterr && *optstring != ':') fprintf(stderr, "%s: illegal option -- %c\n", argv[0], optopt); return BADCH; } if (oli[1] != ':') { /* don't need argument */ optarg = NULL; if (!*place) ++optind; } else { /* need an argument */ if (*place) /* no white space */ optarg = place; else if (argc <= ++optind) { /* no arg */ place = EMSG; if (*optstring == ':') return BADARG; if (opterr) fprintf(stderr, "%s: option requires an argument -- %c\n", argv[0], optopt); return BADCH; } else /* white space */ optarg = argv[optind]; place = EMSG; ++optind; } return optopt; } pgpool-II-4.1.4/src/utils/regex_array.c0000664000175000017500000001233613730350075014655 00000000000000/* -*-pgsql-c-*- */ /* * $Header$ * * pgpool: a language independent connection pool server for PostgreSQL * written by Tatsuo Ishii * * Copyright (c) 2003-2016 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; i < ar->pos; 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; char *weight_token = NULL; int i, j; len = strlen(token) + 1; left_token = palloc(len); right_token = palloc(len); weight_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(left_token); pfree(right_token); pfree(mystr); pfree(weight_token); return; } /* Skip delimiter 2 */ i++; j = 0; for (; token[i] && token[i] != '('; i++) right_token[j++] = token[i]; right_token[j] = '\0'; /* delimiter 3 */ int k = 0; if (token[i] == '(') { i++; for (; token[i] && token[i] != ')'; i++) weight_token[k++] = token[i]; } weight_token[k] = '\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; if (weight_token[0] != '\0') lrtokens->token[lrtokens->pos].weight_token = atof(weight_token); else lrtokens->token[lrtokens->pos].weight_token = 1.0; lrtokens->pos++; pfree(weight_token); } pfree(mystr); } pgpool-II-4.1.4/src/utils/json_writer.c0000664000175000017500000001637013730350075014714 00000000000000/* * * json_writer.c * * 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 #include "parser/stringinfo.h" #include "utils/palloc.h" #include "utils/json_writer.h" static inline int jw_get_current_element_count(JsonNode * jNode); static inline void jw_inc_current_element_count(JsonNode * jNode); static inline JWElementType jw_get_current_element_type(JsonNode * jNode); JsonNode * jw_create(JWElementType rootElement, bool pretty_output) { JsonNode *jNode = palloc(sizeof(JsonNode)); jNode->buf = makeStringInfo(); jNode->stack_ptr = 0; jNode->pretty = pretty_output; jw_start_element(jNode, rootElement, NULL); return jNode; } JsonNode * jw_create_with_array(bool pretty_output) { return jw_create(JWARRAY, pretty_output); } JsonNode * jw_create_with_object(bool pretty_output) { return jw_create(JWOBJECT, pretty_output); } bool jw_put_string(JsonNode * jNode, char *key, char *value) { if (key == NULL || value == NULL) return false; if (jw_get_current_element_count(jNode) < 0) return false; if (jw_get_current_element_type(jNode) != JWOBJECT) return false; if (jw_get_current_element_count(jNode) > 0) appendStringInfoChar(jNode->buf, ','); appendStringInfo(jNode->buf, "\"%s\":\"%s\"", key, value); jw_inc_current_element_count(jNode); return true; } /* for compatibility reasons we pack bool in int*/ bool jw_put_bool(JsonNode * jNode, char *key, bool value) { return jw_put_int(jNode, key, value ? 1 : 0); } bool jw_put_int(JsonNode * jNode, char *key, int value) { if (key == NULL) return false; if (jw_get_current_element_count(jNode) < 0) return false; if (jw_get_current_element_type(jNode) != JWOBJECT) return false; if (jw_get_current_element_count(jNode) > 0) appendStringInfoChar(jNode->buf, ','); appendStringInfo(jNode->buf, "\"%s\":%d", key, value); jw_inc_current_element_count(jNode); return true; } bool jw_put_long(JsonNode * jNode, char *key, long value) { if (key == NULL) return false; if (jw_get_current_element_count(jNode) < 0) return false; if (jw_get_current_element_type(jNode) != JWOBJECT) return false; if (jw_get_current_element_count(jNode) > 0) appendStringInfoChar(jNode->buf, ','); appendStringInfo(jNode->buf, "\"%s\":%ld", key, value); jw_inc_current_element_count(jNode); return true; } bool jw_put_null(JsonNode * jNode, char *key) { if (key == NULL) return false; if (jw_get_current_element_count(jNode) < 0) return false; if (jw_get_current_element_type(jNode) != JWOBJECT) return false; if (jw_get_current_element_count(jNode) > 0) appendStringInfoChar(jNode->buf, ','); appendStringInfo(jNode->buf, "\"%s\":null", key); jw_inc_current_element_count(jNode); return true; } bool jw_put_string_value(JsonNode * jNode, char *value) { if (value == NULL) return false; if (jw_get_current_element_count(jNode) < 0) return false; if (jw_get_current_element_type(jNode) != JWARRAY) return false; if (jw_get_current_element_count(jNode) > 0) appendStringInfoChar(jNode->buf, ','); appendStringInfo(jNode->buf, "\"%s\"", value); jw_inc_current_element_count(jNode); return true; } bool jw_put_bool_value(JsonNode * jNode, bool value) { return jw_put_int_value(jNode, value ? 1 : 0); } bool jw_put_int_value(JsonNode * jNode, int value) { if (jw_get_current_element_count(jNode) < 0) return false; if (jw_get_current_element_type(jNode) != JWARRAY) return false; if (jw_get_current_element_count(jNode) > 0) appendStringInfoChar(jNode->buf, ','); appendStringInfo(jNode->buf, "%d", value); jw_inc_current_element_count(jNode); return true; } bool jw_put_long_value(JsonNode * jNode, long value) { if (jw_get_current_element_count(jNode) < 0) return false; if (jw_get_current_element_type(jNode) != JWARRAY) return false; if (jw_get_current_element_count(jNode) > 0) appendStringInfoChar(jNode->buf, ','); appendStringInfo(jNode->buf, "%ld", value); jw_inc_current_element_count(jNode); return true; } bool jw_put_null_value(JsonNode * jNode) { if (jw_get_current_element_count(jNode) < 0) return false; if (jw_get_current_element_type(jNode) != JWARRAY) return false; if (jw_get_current_element_count(jNode) > 0) appendStringInfoChar(jNode->buf, ','); appendStringInfoString(jNode->buf, "null"); jw_inc_current_element_count(jNode); return true; } bool jw_start_element(JsonNode * jNode, JWElementType element, char *key) { char ch; if (jNode->stack_ptr >= MAX_STACK_DEPTH) return false; if (jw_get_current_element_count(jNode) > 0) appendStringInfoChar(jNode->buf, ','); if (element == JWOBJECT) { ch = '{'; } else if (element == JWARRAY) { ch = '['; } else return false; if (key == NULL) appendStringInfoChar(jNode->buf, ch); else appendStringInfo(jNode->buf, "\"%s\": %c", key, ch); jw_inc_current_element_count(jNode); jNode->stack[jNode->stack_ptr].elementCount = 0; jNode->stack[jNode->stack_ptr++].elementType = element; return true; } bool jw_start_array(JsonNode * jNode, char *key) { if (jw_get_current_element_type(jNode) == JWARRAY) return jw_start_element(jNode, JWARRAY, NULL); return jw_start_element(jNode, JWARRAY, key); } bool jw_start_object(JsonNode * jNode, char *key) { if (jw_get_current_element_type(jNode) == JWARRAY) return jw_start_element(jNode, JWOBJECT, NULL); return jw_start_element(jNode, JWOBJECT, key); } bool jw_end_element(JsonNode * jNode) { char ch; JWElementType element; if (jNode->stack_ptr <= 0) return false; /* pop the element from stack */ element = jNode->stack[--jNode->stack_ptr].elementType; if (element == JWOBJECT) ch = '}'; else if (element == JWARRAY) ch = ']'; else return false; appendStringInfoChar(jNode->buf, ch); return true; } bool jw_finish_document(JsonNode * jNode) { while (jNode->stack_ptr > 0) { if (!jw_end_element(jNode)) return false; } return true; } char * jw_get_json_string(JsonNode * jNode) { return jNode->buf->data; } int jw_get_json_length(JsonNode * jNode) { return jNode->buf->len; } void jw_destroy(JsonNode * jNode) { pfree(jNode->buf->data); pfree(jNode->buf); pfree(jNode); } static inline int jw_get_current_element_count(JsonNode * jNode) { if (jNode->stack_ptr <= 0) return -1; return jNode->stack[jNode->stack_ptr - 1].elementCount; } static inline void jw_inc_current_element_count(JsonNode * jNode) { if (jNode->stack_ptr <= 0) return; jNode->stack[jNode->stack_ptr - 1].elementCount++; } static inline JWElementType jw_get_current_element_type(JsonNode * jNode) { if (jNode->stack_ptr <= 0) return -1; return jNode->stack[jNode->stack_ptr - 1].elementType; } pgpool-II-4.1.4/src/utils/json.c0000664000175000017500000006171513730350075013323 00000000000000/* * * json.c * * 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. * * * portion copyright * vim: set et ts=3 sw=3 sts=3 ft=c: * * Copyright (C) 2012, 2013, 2014 James McLaughlin et al. All rights reserved. * https://github.com/udp/json-parser * * 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. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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. */ #include "utils/json.h" #ifdef _MSC_VER #ifndef _CRT_SECURE_NO_WARNINGS #define _CRT_SECURE_NO_WARNINGS #endif #endif const struct _json_value json_value_none; #include "pool.h" #include #include #include #include #ifndef POOL_PRIVATE #include "utils/palloc.h" #include "utils/memutils.h" #include "utils/elog.h" #else #include "utils/fe_ports.h" #endif typedef unsigned int json_uchar; static unsigned char hex_value(json_char c) { if (isdigit(c)) return c - '0'; switch (c) { case 'a': case 'A': return 0x0A; case 'b': case 'B': return 0x0B; case 'c': case 'C': return 0x0C; case 'd': case 'D': return 0x0D; case 'e': case 'E': return 0x0E; case 'f': case 'F': return 0x0F; default: return 0xFF; } } typedef struct { unsigned long used_memory; unsigned int uint_max; unsigned long ulong_max; json_settings settings; int first_pass; const json_char *ptr; unsigned int cur_line, cur_col; } json_state; static void * default_alloc(size_t size, int zero, void *user_data) { return zero ? palloc0(size) : palloc(size); } static void default_free(void *ptr, void *user_data) { pfree(ptr); } static void * json_alloc(json_state * state, unsigned long size, int zero) { if ((state->ulong_max - state->used_memory) < size) return 0; if (state->settings.max_memory && (state->used_memory += size) > state->settings.max_memory) { return 0; } return state->settings.mem_alloc(size, zero, state->settings.user_data); } static int new_value(json_state * state, json_value * *top, json_value * *root, json_value * *alloc, json_type type) { json_value *value; int values_size; if (!state->first_pass) { value = *top = *alloc; *alloc = (*alloc)->_reserved.next_alloc; if (!*root) *root = value; switch (value->type) { case json_array: if (value->u.array.length == 0) break; if (!(value->u.array.values = (json_value * *) json_alloc (state, value->u.array.length * sizeof(json_value *), 0))) { return 0; } value->u.array.length = 0; break; case json_object: if (value->u.object.length == 0) break; values_size = sizeof(*value->u.object.values) * value->u.object.length; if (!(value->u.object.values = (json_object_entry *) json_alloc (state, values_size + ((unsigned long) value->u.object.values), 0))) { return 0; } value->_reserved.object_mem = (*(char **) &value->u.object.values) + values_size; value->u.object.length = 0; break; case json_string: if (!(value->u.string.ptr = (json_char *) json_alloc (state, (value->u.string.length + 1) * sizeof(json_char), 0))) { return 0; } value->u.string.length = 0; break; default: break; }; return 1; } if (!(value = (json_value *) json_alloc (state, sizeof(json_value) + state->settings.value_extra, 1))) { return 0; } if (!*root) *root = value; value->type = type; value->parent = *top; #ifdef JSON_TRACK_SOURCE value->line = state->cur_line; value->col = state->cur_col; #endif if (*alloc) (*alloc)->_reserved.next_alloc = value; *alloc = *top = value; return 1; } #define whitespace \ case '\n': ++ state.cur_line; state.cur_col = 0; \ case ' ': case '\t': case '\r' #define string_add(b) \ do { if (!state.first_pass) string [string_length] = b; ++ string_length; } while (0); #define line_and_col \ state.cur_line, state.cur_col static const long flag_next = 1 << 0, flag_reproc = 1 << 1, flag_need_comma = 1 << 2, flag_seek_value = 1 << 3, flag_escaped = 1 << 4, flag_string = 1 << 5, flag_need_colon = 1 << 6, flag_done = 1 << 7, flag_num_negative = 1 << 8, flag_num_zero = 1 << 9, flag_num_e = 1 << 10, flag_num_e_got_sign = 1 << 11, flag_num_e_negative = 1 << 12, flag_line_comment = 1 << 13, flag_block_comment = 1 << 14; json_value * json_parse_ex(json_settings * settings, const json_char * json, size_t length, char *error_buf) { json_char error[json_error_max]; const json_char *end; json_value *top, *root, *alloc = 0; json_state state = {0}; long flags; long num_digits = 0, num_e = 0; json_int_t num_fraction = 0; /* * Skip UTF-8 BOM */ if (length >= 3 && ((unsigned char) json[0]) == 0xEF && ((unsigned char) json[1]) == 0xBB && ((unsigned char) json[2]) == 0xBF) { json += 3; length -= 3; } error[0] = '\0'; end = (json + length); memcpy(&state.settings, settings, sizeof(json_settings)); if (!state.settings.mem_alloc) state.settings.mem_alloc = default_alloc; if (!state.settings.mem_free) state.settings.mem_free = default_free; memset(&state.uint_max, 0xFF, sizeof(state.uint_max)); memset(&state.ulong_max, 0xFF, sizeof(state.ulong_max)); state.uint_max -= 8; /* limit of how much can be added before next * check */ state.ulong_max -= 8; for (state.first_pass = 1; state.first_pass >= 0; --state.first_pass) { json_uchar uchar; unsigned char uc_b1, uc_b2, uc_b3, uc_b4; json_char *string = 0; unsigned int string_length = 0; top = root = 0; flags = flag_seek_value; state.cur_line = 1; for (state.ptr = json;; ++state.ptr) { json_char b = (state.ptr == end ? 0 : *state.ptr); if (flags & flag_string) { if (!b) { ereport(DEBUG1, (errmsg("Unexpected EOF in JSON string (at %d:%d)", line_and_col))); goto e_failed; } if (string_length > state.uint_max) goto e_overflow; if (flags & flag_escaped) { flags &= ~flag_escaped; switch (b) { case 'b': string_add('\b'); break; case 'f': string_add('\f'); break; case 'n': string_add('\n'); break; case 'r': string_add('\r'); break; case 't': string_add('\t'); break; case 'u': if (end - state.ptr < 4 || (uc_b1 = hex_value(*++state.ptr)) == 0xFF || (uc_b2 = hex_value(*++state.ptr)) == 0xFF || (uc_b3 = hex_value(*++state.ptr)) == 0xFF || (uc_b4 = hex_value(*++state.ptr)) == 0xFF) { ereport(DEBUG1, (errmsg("JSON ERROR, invalid character value `%c` (at %d:%d)", b, line_and_col))); goto e_failed; } uc_b1 = (uc_b1 << 4) | uc_b2; uc_b2 = (uc_b3 << 4) | uc_b4; uchar = (uc_b1 << 8) | uc_b2; if ((uchar & 0xF800) == 0xD800) { json_uchar uchar2; if (end - state.ptr < 6 || (*++state.ptr) != '\\' || (*++state.ptr) != 'u' || (uc_b1 = hex_value(*++state.ptr)) == 0xFF || (uc_b2 = hex_value(*++state.ptr)) == 0xFF || (uc_b3 = hex_value(*++state.ptr)) == 0xFF || (uc_b4 = hex_value(*++state.ptr)) == 0xFF) { ereport(DEBUG1, (errmsg("JSON ERROR, Invalid character value `%c` (at %d:%d)", b, line_and_col))); goto e_failed; } uc_b1 = (uc_b1 << 4) | uc_b2; uc_b2 = (uc_b3 << 4) | uc_b4; uchar2 = (uc_b1 << 8) | uc_b2; uchar = 0x010000 | ((uchar & 0x3FF) << 10) | (uchar2 & 0x3FF); } if (sizeof(json_char) >= sizeof(json_uchar) || (uchar <= 0x7F)) { string_add((json_char) uchar); break; } if (uchar <= 0x7FF) { if (state.first_pass) string_length += 2; else { string[string_length++] = 0xC0 | (uchar >> 6); string[string_length++] = 0x80 | (uchar & 0x3F); } break; } if (uchar <= 0xFFFF) { if (state.first_pass) string_length += 3; else { string[string_length++] = 0xE0 | (uchar >> 12); string[string_length++] = 0x80 | ((uchar >> 6) & 0x3F); string[string_length++] = 0x80 | (uchar & 0x3F); } break; } if (state.first_pass) string_length += 4; else { string[string_length++] = 0xF0 | (uchar >> 18); string[string_length++] = 0x80 | ((uchar >> 12) & 0x3F); string[string_length++] = 0x80 | ((uchar >> 6) & 0x3F); string[string_length++] = 0x80 | (uchar & 0x3F); } break; default: string_add(b); }; continue; } if (b == '\\') { flags |= flag_escaped; continue; } if (b == '"') { if (!state.first_pass) string[string_length] = 0; flags &= ~flag_string; string = 0; switch (top->type) { case json_string: top->u.string.length = string_length; flags |= flag_next; break; case json_object: if (state.first_pass) (*(json_char * *) & top->u.object.values) += string_length + 1; else { top->u.object.values[top->u.object.length].name = (json_char *) top->_reserved.object_mem; top->u.object.values[top->u.object.length].name_length = string_length; (*(json_char * *) & top->_reserved.object_mem) += string_length + 1; } flags |= flag_seek_value | flag_need_colon; continue; default: break; }; } else { string_add(b); continue; } } if (state.settings.settings & json_enable_comments) { if (flags & (flag_line_comment | flag_block_comment)) { if (flags & flag_line_comment) { if (b == '\r' || b == '\n' || !b) { flags &= ~flag_line_comment; --state.ptr; /* so null can be reproc'd */ } continue; } if (flags & flag_block_comment) { if (!b) { ereport(DEBUG1, (errmsg("JSON ERROR, %d:%d: Unexpected EOF in block comment", line_and_col))); goto e_failed; } if (b == '*' && state.ptr < (end - 1) && state.ptr[1] == '/') { flags &= ~flag_block_comment; ++state.ptr; /* skip closing sequence */ } continue; } } else if (b == '/') { if (!(flags & (flag_seek_value | flag_done)) && top->type != json_object) { ereport(DEBUG1, (errmsg("JSON ERROR, %d:%d: Comment not allowed here", line_and_col))); goto e_failed; } if (++state.ptr == end) { ereport(DEBUG1, (errmsg("JSON ERROR, %d:%d: EOF unexpected", line_and_col))); goto e_failed; } switch (b = *state.ptr) { case '/': flags |= flag_line_comment; continue; case '*': flags |= flag_block_comment; continue; default: ereport(DEBUG1, (errmsg("JSON ERROR, %d:%d: Unexpected `%c` in comment opening sequence", line_and_col, b))); goto e_failed; }; } } if (flags & flag_done) { if (!b) break; switch (b) { whitespace: continue; default: ereport(DEBUG1, (errmsg("JSON ERROR, %d:%d: Trailing garbage: ", state.cur_line, state.cur_col))); goto e_failed; }; } if (flags & flag_seek_value) { switch (b) { whitespace: continue; case ']': if (top && top->type == json_array) flags = (flags & ~(flag_need_comma | flag_seek_value)) | flag_next; else { ereport(DEBUG1, (errmsg("%d:%d: Unexpected ]", line_and_col))); goto e_failed; } break; default: if (flags & flag_need_comma) { if (b == ',') { flags &= ~flag_need_comma; continue; } else { ereport(DEBUG1, (errmsg("%d:%d: Expected , before %c", state.cur_line, state.cur_col, b))); goto e_failed; } } if (flags & flag_need_colon) { if (b == ':') { flags &= ~flag_need_colon; continue; } else { ereport(DEBUG1, (errmsg("%d:%d: Expected : before %c", state.cur_line, state.cur_col, b))); goto e_failed; } } flags &= ~flag_seek_value; switch (b) { case '{': if (!new_value(&state, &top, &root, &alloc, json_object)) goto e_alloc_failure; continue; case '[': if (!new_value(&state, &top, &root, &alloc, json_array)) goto e_alloc_failure; flags |= flag_seek_value; continue; case '"': if (!new_value(&state, &top, &root, &alloc, json_string)) goto e_alloc_failure; flags |= flag_string; string = top->u.string.ptr; string_length = 0; continue; case 't': if ((end - state.ptr) < 3 || *(++state.ptr) != 'r' || *(++state.ptr) != 'u' || *(++state.ptr) != 'e') { goto e_unknown_value; } if (!new_value(&state, &top, &root, &alloc, json_boolean)) goto e_alloc_failure; top->u.boolean = 1; flags |= flag_next; break; case 'f': if ((end - state.ptr) < 4 || *(++state.ptr) != 'a' || *(++state.ptr) != 'l' || *(++state.ptr) != 's' || *(++state.ptr) != 'e') { goto e_unknown_value; } if (!new_value(&state, &top, &root, &alloc, json_boolean)) goto e_alloc_failure; flags |= flag_next; break; case 'n': if ((end - state.ptr) < 3 || *(++state.ptr) != 'u' || *(++state.ptr) != 'l' || *(++state.ptr) != 'l') { goto e_unknown_value; } if (!new_value(&state, &top, &root, &alloc, json_null)) goto e_alloc_failure; flags |= flag_next; break; default: if (isdigit(b) || b == '-') { if (!new_value(&state, &top, &root, &alloc, json_integer)) goto e_alloc_failure; if (!state.first_pass) { while (isdigit(b) || b == '+' || b == '-' || b == 'e' || b == 'E' || b == '.') { if ((++state.ptr) == end) { b = 0; break; } b = *state.ptr; } flags |= flag_next | flag_reproc; break; } flags &= ~(flag_num_negative | flag_num_e | flag_num_e_got_sign | flag_num_e_negative | flag_num_zero); num_digits = 0; num_fraction = 0; num_e = 0; if (b != '-') { flags |= flag_reproc; break; } flags |= flag_num_negative; continue; } else { ereport(DEBUG1, (errmsg("%d:%d: Unexpected %c when seeking value", line_and_col, b))); goto e_failed; } }; }; } else { switch (top->type) { case json_object: switch (b) { whitespace: continue; case '"': if (flags & flag_need_comma) { ereport(DEBUG1, (errmsg("JSON ERROR: %d:%d: Expected , before \"", line_and_col))); goto e_failed; } flags |= flag_string; string = (json_char *) top->_reserved.object_mem; string_length = 0; break; case '}': flags = (flags & ~flag_need_comma) | flag_next; break; case ',': if (flags & flag_need_comma) { flags &= ~flag_need_comma; break; } default: ereport(DEBUG1, (errmsg("JSON ERROR: %d:%d: Unexpected `%c` in object", line_and_col, b))); goto e_failed; }; break; case json_integer: case json_double: if (isdigit(b)) { ++num_digits; if (top->type == json_integer || flags & flag_num_e) { if (!(flags & flag_num_e)) { if (flags & flag_num_zero) { ereport(DEBUG1, (errmsg("JSON ERROR: %d:%d: Unexpected `0` before `%c`", line_and_col, b))); goto e_failed; } if (num_digits == 1 && b == '0') flags |= flag_num_zero; } else { flags |= flag_num_e_got_sign; num_e = (num_e * 10) + (b - '0'); continue; } top->u.integer = (top->u.integer * 10) + (b - '0'); continue; } num_fraction = (num_fraction * 10) + (b - '0'); continue; } if (b == '+' || b == '-') { if ((flags & flag_num_e) && !(flags & flag_num_e_got_sign)) { flags |= flag_num_e_got_sign; if (b == '-') flags |= flag_num_e_negative; continue; } } else if (b == '.' && top->type == json_integer) { if (!num_digits) { ereport(DEBUG1, (errmsg("JSON ERROR: %d:%d: Expected digit before `.`", line_and_col))); goto e_failed; } top->type = json_double; top->u.dbl = (double) top->u.integer; num_digits = 0; continue; } if (!(flags & flag_num_e)) { if (top->type == json_double) { if (!num_digits) { ereport(DEBUG1, (errmsg("JSON ERROR: %d:%d: Expected digit after `.`", line_and_col))); goto e_failed; } top->u.dbl += ((double) num_fraction) / (pow(10.0, (double) num_digits)); } if (b == 'e' || b == 'E') { flags |= flag_num_e; if (top->type == json_integer) { top->type = json_double; top->u.dbl = (double) top->u.integer; } num_digits = 0; flags &= ~flag_num_zero; continue; } } else { if (!num_digits) { ereport(DEBUG1, (errmsg("JSON ERROR: %d:%d: Expected digit after `e`", line_and_col))); goto e_failed; } top->u.dbl *= pow(10.0, (double) (flags & flag_num_e_negative ? -num_e : num_e)); } if (flags & flag_num_negative) { if (top->type == json_integer) top->u.integer = -top->u.integer; else top->u.dbl = -top->u.dbl; } flags |= flag_next | flag_reproc; break; default: break; }; } if (flags & flag_reproc) { flags &= ~flag_reproc; --state.ptr; } if (flags & flag_next) { flags = (flags & ~flag_next) | flag_need_comma; if (!top->parent) { /* root value done */ flags |= flag_done; continue; } if (top->parent->type == json_array) flags |= flag_seek_value; if (!state.first_pass) { json_value *parent = top->parent; switch (parent->type) { case json_object: parent->u.object.values [parent->u.object.length].value = top; break; case json_array: parent->u.array.values [parent->u.array.length] = top; break; default: break; }; } if ((++top->parent->u.array.length) > state.uint_max) goto e_overflow; top = top->parent; continue; } } alloc = root; } return root; e_unknown_value: ereport(DEBUG1, (errmsg("JSON ERROR: %d:%d: Unknown value", line_and_col))); goto e_failed; e_alloc_failure: strcpy(error, "Memory allocation failure"); goto e_failed; e_overflow: ereport(DEBUG1, (errmsg("JSON ERROR: %d:%d: Too long (caught overflow)", line_and_col))); goto e_failed; e_failed: if (error_buf) { if (*error) strcpy(error_buf, error); else strcpy(error_buf, "Unknown error"); } if (state.first_pass) alloc = root; while (alloc) { top = alloc->_reserved.next_alloc; state.settings.mem_free(alloc, state.settings.user_data); alloc = top; } if (!state.first_pass) json_value_free_ex(&state.settings, root); return 0; } json_value * json_parse(const json_char * json, size_t length) { json_settings settings = {0}; return json_parse_ex(&settings, json, length, 0); } void json_value_free_ex(json_settings * settings, json_value * value) { json_value *cur_value; if (!value) return; value->parent = 0; while (value) { switch (value->type) { case json_array: if (!value->u.array.length) { settings->mem_free(value->u.array.values, settings->user_data); break; } value = value->u.array.values[--value->u.array.length]; continue; case json_object: if (!value->u.object.length) { settings->mem_free(value->u.object.values, settings->user_data); break; } value = value->u.object.values[--value->u.object.length].value; continue; case json_string: settings->mem_free(value->u.string.ptr, settings->user_data); break; default: break; }; cur_value = value; value = value->parent; settings->mem_free(cur_value, settings->user_data); } } void json_value_free(json_value * value) { json_settings settings = {0}; settings.mem_free = default_free; json_value_free_ex(&settings, value); } /********* pgpool extension:********/ /* * pgpool extension: * search node with key from json object */ json_value * json_get_value_for_key(json_value * source, const char *key) { if (source->type == json_object) { int x; for (x = 0; x < source->u.object.length; x++) { if (strcasecmp(source->u.object.values[x].name, key) == 0) return source->u.object.values[x].value; } } else ereport(DEBUG1, (errmsg("JSON ERROR, Passed in json is not object node"))); return NULL; } /* * pgpool extension: * returns 0 if the integer value is found for the key. * for all other cases when key or integer value is not found * function returns -1 */ int json_get_bool_value_for_key(json_value * source, const char *key, bool *value) { json_value *jNode; jNode = json_get_value_for_key(source, key); if (jNode == NULL) return -1; /* for older version compatibility, We use int for encoding bool values */ if (jNode->type == json_integer || jNode->type == json_boolean) { *value = jNode->u.integer ? true : false; } else return -1; return 0; } int json_get_int_value_for_key(json_value * source, const char *key, int *value) { json_value *jNode; jNode = json_get_value_for_key(source, key); if (jNode == NULL) return -1; if (jNode->type != json_integer) return -1; *value = jNode->u.integer; return 0; } int json_get_long_value_for_key(json_value * source, const char *key, long *value) { json_value *jNode; jNode = json_get_value_for_key(source, key); if (jNode == NULL) return -1; if (jNode->type != json_integer) return -1; *value = jNode->u.integer; return 0; } /* * pgpool extension: * returns string value if found for the key. * for all other cases when key or string value is not found * function returns NULL */ char * json_get_string_value_for_key(json_value * source, const char *key) { json_value *jNode; jNode = json_get_value_for_key(source, key); if (jNode == NULL) return NULL; if (jNode->type != json_string) return NULL; return jNode->u.string.ptr; } pgpool-II-4.1.4/src/utils/scram-common.c0000664000175000017500000001352513730350075014741 00000000000000/*------------------------------------------------------------------------- * scram-common.c * Shared frontend/backend code for SCRAM authentication * * This contains the common low-level functions needed in both frontend and * backend, for implement the Salted Challenge Response Authentication * Mechanism (SCRAM), per IETF's RFC 5802. * * Portions Copyright (c) 2017, PostgreSQL Global Development Group * * IDENTIFICATION * src/common/scram-common.c * *------------------------------------------------------------------------- */ /* for htonl */ #include #include #include #include "utils/elog.h" #include "utils/palloc.h" #include "utils/base64.h" #include "auth/scram-common.h" #define HMAC_IPAD 0x36 #define HMAC_OPAD 0x5C /* * Calculate HMAC per RFC2104. * * The hash function used is SHA-256. */ void scram_HMAC_init(scram_HMAC_ctx *ctx, const uint8 *key, int keylen) { uint8 k_ipad[SHA256_HMAC_B]; int i; uint8 keybuf[SCRAM_KEY_LEN]; /* * If the key is longer than the block size (64 bytes for SHA-256), pass * it through SHA-256 once to shrink it down. */ if (keylen > SHA256_HMAC_B) { pg_sha256_ctx sha256_ctx; pg_sha256_init(&sha256_ctx); pg_sha256_update(&sha256_ctx, key, keylen); pg_sha256_final(&sha256_ctx, keybuf); key = keybuf; keylen = SCRAM_KEY_LEN; } memset(k_ipad, HMAC_IPAD, SHA256_HMAC_B); memset(ctx->k_opad, HMAC_OPAD, SHA256_HMAC_B); for (i = 0; i < keylen; i++) { k_ipad[i] ^= key[i]; ctx->k_opad[i] ^= key[i]; } /* tmp = H(K XOR ipad, text) */ pg_sha256_init(&ctx->sha256ctx); pg_sha256_update(&ctx->sha256ctx, k_ipad, SHA256_HMAC_B); } /* * Update HMAC calculation * The hash function used is SHA-256. */ void scram_HMAC_update(scram_HMAC_ctx *ctx, const char *str, int slen) { pg_sha256_update(&ctx->sha256ctx, (const uint8 *) str, slen); } /* * Finalize HMAC calculation. * The hash function used is SHA-256. */ void scram_HMAC_final(uint8 *result, scram_HMAC_ctx *ctx) { uint8 h[SCRAM_KEY_LEN]; pg_sha256_final(&ctx->sha256ctx, h); /* H(K XOR opad, tmp) */ pg_sha256_init(&ctx->sha256ctx); pg_sha256_update(&ctx->sha256ctx, ctx->k_opad, SHA256_HMAC_B); pg_sha256_update(&ctx->sha256ctx, h, SCRAM_KEY_LEN); pg_sha256_final(&ctx->sha256ctx, result); } /* * Calculate SaltedPassword. * * The password should already be normalized by SASLprep. */ void scram_SaltedPassword(const char *password, const char *salt, int saltlen, int iterations, uint8 *result) { int password_len = strlen(password); uint32 one = htonl(1); int i, j; uint8 Ui[SCRAM_KEY_LEN]; uint8 Ui_prev[SCRAM_KEY_LEN]; scram_HMAC_ctx hmac_ctx; /* * Iterate hash calculation of HMAC entry using given salt. This is * essentially PBKDF2 (see RFC2898) with HMAC() as the pseudorandom * function. */ /* First iteration */ scram_HMAC_init(&hmac_ctx, (uint8 *) password, password_len); scram_HMAC_update(&hmac_ctx, salt, saltlen); scram_HMAC_update(&hmac_ctx, (char *) &one, sizeof(uint32)); scram_HMAC_final(Ui_prev, &hmac_ctx); memcpy(result, Ui_prev, SCRAM_KEY_LEN); /* Subsequent iterations */ for (i = 2; i <= iterations; i++) { scram_HMAC_init(&hmac_ctx, (uint8 *) password, password_len); scram_HMAC_update(&hmac_ctx, (const char *) Ui_prev, SCRAM_KEY_LEN); scram_HMAC_final(Ui, &hmac_ctx); for (j = 0; j < SCRAM_KEY_LEN; j++) result[j] ^= Ui[j]; memcpy(Ui_prev, Ui, SCRAM_KEY_LEN); } } /* * Calculate SHA-256 hash for a NULL-terminated string. (The NULL terminator is * not included in the hash). */ void scram_H(const uint8 *input, int len, uint8 *result) { pg_sha256_ctx ctx; pg_sha256_init(&ctx); pg_sha256_update(&ctx, input, len); pg_sha256_final(&ctx, result); } /* * Calculate ClientKey. */ void scram_ClientKey(const uint8 *salted_password, uint8 *result) { scram_HMAC_ctx ctx; scram_HMAC_init(&ctx, salted_password, SCRAM_KEY_LEN); scram_HMAC_update(&ctx, "Client Key", strlen("Client Key")); scram_HMAC_final(result, &ctx); } /* * Calculate ServerKey. */ void scram_ServerKey(const uint8 *salted_password, uint8 *result) { scram_HMAC_ctx ctx; scram_HMAC_init(&ctx, salted_password, SCRAM_KEY_LEN); scram_HMAC_update(&ctx, "Server Key", strlen("Server Key")); scram_HMAC_final(result, &ctx); } /* * Construct a verifier string for SCRAM, stored in pg_authid.rolpassword. * * The password should already have been processed with SASLprep, if necessary! * * If iterations is 0, default number of iterations is used. The result is * palloc'd or malloc'd, so caller is responsible for freeing it. */ char * scram_build_verifier(const char *salt, int saltlen, int iterations, const char *password) { uint8 salted_password[SCRAM_KEY_LEN]; uint8 stored_key[SCRAM_KEY_LEN]; uint8 server_key[SCRAM_KEY_LEN]; char *result; char *p; int maxlen; if (iterations <= 0) iterations = SCRAM_DEFAULT_ITERATIONS; /* Calculate StoredKey and ServerKey */ scram_SaltedPassword(password, salt, saltlen, iterations, salted_password); scram_ClientKey(salted_password, stored_key); scram_H(stored_key, SCRAM_KEY_LEN, stored_key); scram_ServerKey(salted_password, server_key); /*---------- * The format is: * SCRAM-SHA-256$:$: *---------- */ maxlen = strlen("SCRAM-SHA-256") + 1 + 10 + 1 /* iteration count */ + pg_b64_enc_len(saltlen) + 1 /* Base64-encoded salt */ + pg_b64_enc_len(SCRAM_KEY_LEN) + 1 /* Base64-encoded StoredKey */ + pg_b64_enc_len(SCRAM_KEY_LEN) + 1; /* Base64-encoded ServerKey */ result = palloc(maxlen); p = result + sprintf(result, "SCRAM-SHA-256$%d:", iterations); p += pg_b64_encode(salt, saltlen, p); *(p++) = '$'; p += pg_b64_encode((char *) stored_key, SCRAM_KEY_LEN, p); *(p++) = ':'; p += pg_b64_encode((char *) server_key, SCRAM_KEY_LEN, p); *(p++) = '\0'; Assert(p - result <= maxlen); return result; } pgpool-II-4.1.4/src/utils/base64.c0000664000175000017500000000747413730350075013440 00000000000000/*------------------------------------------------------------------------- * * base64.c * Encoding and decoding routines for base64 without whitespace. * * Copyright (c) 2001-2017, PostgreSQL Global Development Group * * * IDENTIFICATION * src/common/base64.c * *------------------------------------------------------------------------- */ #include "pool_type.h" #include "utils/base64.h" /* * BASE64 */ static const char _base64[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; static const int8 b64lookup[128] = { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 62, -1, -1, -1, 63, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, -1, -1, -1, -1, -1, -1, -1, 0, 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, -1, -1, -1, -1, -1, -1, 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, -1, -1, -1, -1, -1, }; /* * pg_b64_encode * * Encode into base64 the given string. Returns the length of the encoded * string. */ int pg_b64_encode(const char *src, int len, char *dst) { char *p; const char *s, *end = src + len; int pos = 2; uint32 buf = 0; s = src; p = dst; while (s < end) { buf |= (unsigned char) *s << (pos << 3); pos--; s++; /* write it out */ if (pos < 0) { *p++ = _base64[(buf >> 18) & 0x3f]; *p++ = _base64[(buf >> 12) & 0x3f]; *p++ = _base64[(buf >> 6) & 0x3f]; *p++ = _base64[buf & 0x3f]; pos = 2; buf = 0; } } if (pos != 2) { *p++ = _base64[(buf >> 18) & 0x3f]; *p++ = _base64[(buf >> 12) & 0x3f]; *p++ = (pos == 0) ? _base64[(buf >> 6) & 0x3f] : '='; *p++ = '='; } return p - dst; } /* * pg_b64_decode * * Decode the given base64 string. Returns the length of the decoded * string on success, and -1 in the event of an error. */ int pg_b64_decode(const char *src, int len, char *dst) { const char *srcend = src + len, *s = src; char *p = dst; char c; int b = 0; uint32 buf = 0; int pos = 0, end = 0; while (s < srcend) { c = *s++; /* Leave if a whitespace is found */ if (c == ' ' || c == '\t' || c == '\n' || c == '\r') return -1; if (c == '=') { /* end sequence */ if (!end) { if (pos == 2) end = 1; else if (pos == 3) end = 2; else { /* * Unexpected "=" character found while decoding base64 * sequence. */ return -1; } } b = 0; } else { b = -1; if (c > 0 && c < 127) b = b64lookup[(unsigned char) c]; if (b < 0) { /* invalid symbol found */ return -1; } } /* add it to buffer */ buf = (buf << 6) + b; pos++; if (pos == 4) { *p++ = (buf >> 16) & 255; if (end == 0 || end > 1) *p++ = (buf >> 8) & 255; if (end == 0 || end > 2) *p++ = buf & 255; buf = 0; pos = 0; } } if (pos != 0) { /* * base64 end sequence is invalid. Input data is missing padding, is * truncated or is otherwise corrupted. */ return -1; } return p - dst; } /* * pg_b64_enc_len * * Returns to caller the length of the string if it were encoded with * base64 based on the length provided by caller. This is useful to * estimate how large a buffer allocation needs to be done before doing * the actual encoding. */ int pg_b64_enc_len(int srclen) { /* 3 bytes will be converted to 4 */ return (srclen + 2) * 4 / 3; } /* * pg_b64_dec_len * * Returns to caller the length of the string if it were to be decoded * with base64, based on the length given by caller. This is useful to * estimate how large a buffer allocation needs to be done before doing * the actual decoding. */ int pg_b64_dec_len(int srclen) { return (srclen * 3) >> 2; } pgpool-II-4.1.4/src/utils/sha2.c0000664000175000017500000006506013730350075013204 00000000000000/*------------------------------------------------------------------------- * * sha2.c * Set of SHA functions for SHA-224, SHA-256, SHA-384 and SHA-512. * * This is the set of in-core functions used when there are no other * alternative options like OpenSSL. * * Portions Copyright (c) 2016-2017, PostgreSQL Global Development Group * * IDENTIFICATION * src/common/sha2.c * *------------------------------------------------------------------------- */ /* $OpenBSD: sha2.c,v 1.6 2004/05/03 02:57:36 millert Exp $ */ /* * FILE: sha2.c * AUTHOR: Aaron D. Gifford * * Copyright (c) 2000-2001, Aaron D. Gifford * 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 copyright holder nor the names of contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTOR(S) ``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 AUTHOR OR CONTRIBUTOR(S) 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. * * $From: sha2.c,v 1.1 2001/11/08 00:01:51 adg Exp adg $ */ #include #include #include "utils/sha2.h" /* * UNROLLED TRANSFORM LOOP NOTE: * You can define SHA2_UNROLL_TRANSFORM to use the unrolled transform * loop version for the hash transform rounds (defined using macros * later in this file). Either define on the command line, for example: * * cc -DSHA2_UNROLL_TRANSFORM -o sha2 sha2.c sha2prog.c * * or define below: * * #define SHA2_UNROLL_TRANSFORM * */ /*** SHA-256/384/512 Various Length Definitions ***********************/ #define PG_SHA256_SHORT_BLOCK_LENGTH (PG_SHA256_BLOCK_LENGTH - 8) #define PG_SHA384_SHORT_BLOCK_LENGTH (PG_SHA384_BLOCK_LENGTH - 16) #define PG_SHA512_SHORT_BLOCK_LENGTH (PG_SHA512_BLOCK_LENGTH - 16) /*** ENDIAN REVERSAL MACROS *******************************************/ #ifndef WORDS_BIGENDIAN #define REVERSE32(w,x) { \ uint32 tmp = (w); \ tmp = (tmp >> 16) | (tmp << 16); \ (x) = ((tmp & 0xff00ff00UL) >> 8) | ((tmp & 0x00ff00ffUL) << 8); \ } #define REVERSE64(w,x) { \ uint64 tmp = (w); \ tmp = (tmp >> 32) | (tmp << 32); \ tmp = ((tmp & 0xff00ff00ff00ff00ULL) >> 8) | \ ((tmp & 0x00ff00ff00ff00ffULL) << 8); \ (x) = ((tmp & 0xffff0000ffff0000ULL) >> 16) | \ ((tmp & 0x0000ffff0000ffffULL) << 16); \ } #endif /* not bigendian */ /* * Macro for incrementally adding the unsigned 64-bit integer n to the * unsigned 128-bit integer (represented using a two-element array of * 64-bit words): */ #define ADDINC128(w,n) { \ (w)[0] += (uint64)(n); \ if ((w)[0] < (n)) { \ (w)[1]++; \ } \ } /*** THE SIX LOGICAL FUNCTIONS ****************************************/ /* * Bit shifting and rotation (used by the six SHA-XYZ logical functions: * * NOTE: The naming of R and S appears backwards here (R is a SHIFT and * S is a ROTATION) because the SHA-256/384/512 description document * (see http://www.iwar.org.uk/comsec/resources/cipher/sha256-384-512.pdf) * uses this same "backwards" definition. */ /* Shift-right (used in SHA-256, SHA-384, and SHA-512): */ #define R(b,x) ((x) >> (b)) /* 32-bit Rotate-right (used in SHA-256): */ #define S32(b,x) (((x) >> (b)) | ((x) << (32 - (b)))) /* 64-bit Rotate-right (used in SHA-384 and SHA-512): */ #define S64(b,x) (((x) >> (b)) | ((x) << (64 - (b)))) /* Two of six logical functions used in SHA-256, SHA-384, and SHA-512: */ #define Ch(x,y,z) (((x) & (y)) ^ ((~(x)) & (z))) #define Maj(x,y,z) (((x) & (y)) ^ ((x) & (z)) ^ ((y) & (z))) /* Four of six logical functions used in SHA-256: */ #define Sigma0_256(x) (S32(2, (x)) ^ S32(13, (x)) ^ S32(22, (x))) #define Sigma1_256(x) (S32(6, (x)) ^ S32(11, (x)) ^ S32(25, (x))) #define sigma0_256(x) (S32(7, (x)) ^ S32(18, (x)) ^ R(3 , (x))) #define sigma1_256(x) (S32(17, (x)) ^ S32(19, (x)) ^ R(10, (x))) /* Four of six logical functions used in SHA-384 and SHA-512: */ #define Sigma0_512(x) (S64(28, (x)) ^ S64(34, (x)) ^ S64(39, (x))) #define Sigma1_512(x) (S64(14, (x)) ^ S64(18, (x)) ^ S64(41, (x))) #define sigma0_512(x) (S64( 1, (x)) ^ S64( 8, (x)) ^ R( 7, (x))) #define sigma1_512(x) (S64(19, (x)) ^ S64(61, (x)) ^ R( 6, (x))) /*** INTERNAL FUNCTION PROTOTYPES *************************************/ /* NOTE: These should not be accessed directly from outside this * library -- they are intended for private internal visibility/use * only. */ static void SHA512_Last(pg_sha512_ctx *context); static void SHA256_Transform(pg_sha256_ctx *context, const uint8 *data); static void SHA512_Transform(pg_sha512_ctx *context, const uint8 *data); /*** SHA-XYZ INITIAL HASH VALUES AND CONSTANTS ************************/ /* Hash constant words K for SHA-256: */ static const uint32 K256[64] = { 0x428a2f98UL, 0x71374491UL, 0xb5c0fbcfUL, 0xe9b5dba5UL, 0x3956c25bUL, 0x59f111f1UL, 0x923f82a4UL, 0xab1c5ed5UL, 0xd807aa98UL, 0x12835b01UL, 0x243185beUL, 0x550c7dc3UL, 0x72be5d74UL, 0x80deb1feUL, 0x9bdc06a7UL, 0xc19bf174UL, 0xe49b69c1UL, 0xefbe4786UL, 0x0fc19dc6UL, 0x240ca1ccUL, 0x2de92c6fUL, 0x4a7484aaUL, 0x5cb0a9dcUL, 0x76f988daUL, 0x983e5152UL, 0xa831c66dUL, 0xb00327c8UL, 0xbf597fc7UL, 0xc6e00bf3UL, 0xd5a79147UL, 0x06ca6351UL, 0x14292967UL, 0x27b70a85UL, 0x2e1b2138UL, 0x4d2c6dfcUL, 0x53380d13UL, 0x650a7354UL, 0x766a0abbUL, 0x81c2c92eUL, 0x92722c85UL, 0xa2bfe8a1UL, 0xa81a664bUL, 0xc24b8b70UL, 0xc76c51a3UL, 0xd192e819UL, 0xd6990624UL, 0xf40e3585UL, 0x106aa070UL, 0x19a4c116UL, 0x1e376c08UL, 0x2748774cUL, 0x34b0bcb5UL, 0x391c0cb3UL, 0x4ed8aa4aUL, 0x5b9cca4fUL, 0x682e6ff3UL, 0x748f82eeUL, 0x78a5636fUL, 0x84c87814UL, 0x8cc70208UL, 0x90befffaUL, 0xa4506cebUL, 0xbef9a3f7UL, 0xc67178f2UL }; /* Initial hash value H for SHA-224: */ static const uint32 sha224_initial_hash_value[8] = { 0xc1059ed8UL, 0x367cd507UL, 0x3070dd17UL, 0xf70e5939UL, 0xffc00b31UL, 0x68581511UL, 0x64f98fa7UL, 0xbefa4fa4UL }; /* Initial hash value H for SHA-256: */ static const uint32 sha256_initial_hash_value[8] = { 0x6a09e667UL, 0xbb67ae85UL, 0x3c6ef372UL, 0xa54ff53aUL, 0x510e527fUL, 0x9b05688cUL, 0x1f83d9abUL, 0x5be0cd19UL }; /* Hash constant words K for SHA-384 and SHA-512: */ static const uint64 K512[80] = { 0x428a2f98d728ae22ULL, 0x7137449123ef65cdULL, 0xb5c0fbcfec4d3b2fULL, 0xe9b5dba58189dbbcULL, 0x3956c25bf348b538ULL, 0x59f111f1b605d019ULL, 0x923f82a4af194f9bULL, 0xab1c5ed5da6d8118ULL, 0xd807aa98a3030242ULL, 0x12835b0145706fbeULL, 0x243185be4ee4b28cULL, 0x550c7dc3d5ffb4e2ULL, 0x72be5d74f27b896fULL, 0x80deb1fe3b1696b1ULL, 0x9bdc06a725c71235ULL, 0xc19bf174cf692694ULL, 0xe49b69c19ef14ad2ULL, 0xefbe4786384f25e3ULL, 0x0fc19dc68b8cd5b5ULL, 0x240ca1cc77ac9c65ULL, 0x2de92c6f592b0275ULL, 0x4a7484aa6ea6e483ULL, 0x5cb0a9dcbd41fbd4ULL, 0x76f988da831153b5ULL, 0x983e5152ee66dfabULL, 0xa831c66d2db43210ULL, 0xb00327c898fb213fULL, 0xbf597fc7beef0ee4ULL, 0xc6e00bf33da88fc2ULL, 0xd5a79147930aa725ULL, 0x06ca6351e003826fULL, 0x142929670a0e6e70ULL, 0x27b70a8546d22ffcULL, 0x2e1b21385c26c926ULL, 0x4d2c6dfc5ac42aedULL, 0x53380d139d95b3dfULL, 0x650a73548baf63deULL, 0x766a0abb3c77b2a8ULL, 0x81c2c92e47edaee6ULL, 0x92722c851482353bULL, 0xa2bfe8a14cf10364ULL, 0xa81a664bbc423001ULL, 0xc24b8b70d0f89791ULL, 0xc76c51a30654be30ULL, 0xd192e819d6ef5218ULL, 0xd69906245565a910ULL, 0xf40e35855771202aULL, 0x106aa07032bbd1b8ULL, 0x19a4c116b8d2d0c8ULL, 0x1e376c085141ab53ULL, 0x2748774cdf8eeb99ULL, 0x34b0bcb5e19b48a8ULL, 0x391c0cb3c5c95a63ULL, 0x4ed8aa4ae3418acbULL, 0x5b9cca4f7763e373ULL, 0x682e6ff3d6b2b8a3ULL, 0x748f82ee5defb2fcULL, 0x78a5636f43172f60ULL, 0x84c87814a1f0ab72ULL, 0x8cc702081a6439ecULL, 0x90befffa23631e28ULL, 0xa4506cebde82bde9ULL, 0xbef9a3f7b2c67915ULL, 0xc67178f2e372532bULL, 0xca273eceea26619cULL, 0xd186b8c721c0c207ULL, 0xeada7dd6cde0eb1eULL, 0xf57d4f7fee6ed178ULL, 0x06f067aa72176fbaULL, 0x0a637dc5a2c898a6ULL, 0x113f9804bef90daeULL, 0x1b710b35131c471bULL, 0x28db77f523047d84ULL, 0x32caab7b40c72493ULL, 0x3c9ebe0a15c9bebcULL, 0x431d67c49c100d4cULL, 0x4cc5d4becb3e42b6ULL, 0x597f299cfc657e2aULL, 0x5fcb6fab3ad6faecULL, 0x6c44198c4a475817ULL }; /* Initial hash value H for SHA-384 */ static const uint64 sha384_initial_hash_value[8] = { 0xcbbb9d5dc1059ed8ULL, 0x629a292a367cd507ULL, 0x9159015a3070dd17ULL, 0x152fecd8f70e5939ULL, 0x67332667ffc00b31ULL, 0x8eb44a8768581511ULL, 0xdb0c2e0d64f98fa7ULL, 0x47b5481dbefa4fa4ULL }; /* Initial hash value H for SHA-512 */ static const uint64 sha512_initial_hash_value[8] = { 0x6a09e667f3bcc908ULL, 0xbb67ae8584caa73bULL, 0x3c6ef372fe94f82bULL, 0xa54ff53a5f1d36f1ULL, 0x510e527fade682d1ULL, 0x9b05688c2b3e6c1fULL, 0x1f83d9abfb41bd6bULL, 0x5be0cd19137e2179ULL }; /*** SHA-256: *********************************************************/ void pg_sha256_init(pg_sha256_ctx *context) { if (context == NULL) return; memcpy(context->state, sha256_initial_hash_value, PG_SHA256_DIGEST_LENGTH); memset(context->buffer, 0, PG_SHA256_BLOCK_LENGTH); context->bitcount = 0; } #ifdef SHA2_UNROLL_TRANSFORM /* Unrolled SHA-256 round macros: */ #define ROUND256_0_TO_15(a,b,c,d,e,f,g,h) do { \ W256[j] = (uint32)data[3] | ((uint32)data[2] << 8) | \ ((uint32)data[1] << 16) | ((uint32)data[0] << 24); \ data += 4; \ T1 = (h) + Sigma1_256((e)) + Ch((e), (f), (g)) + K256[j] + W256[j]; \ (d) += T1; \ (h) = T1 + Sigma0_256((a)) + Maj((a), (b), (c)); \ j++; \ } while(0) #define ROUND256(a,b,c,d,e,f,g,h) do { \ s0 = W256[(j+1)&0x0f]; \ s0 = sigma0_256(s0); \ s1 = W256[(j+14)&0x0f]; \ s1 = sigma1_256(s1); \ T1 = (h) + Sigma1_256((e)) + Ch((e), (f), (g)) + K256[j] + \ (W256[j&0x0f] += s1 + W256[(j+9)&0x0f] + s0); \ (d) += T1; \ (h) = T1 + Sigma0_256((a)) + Maj((a), (b), (c)); \ j++; \ } while(0) static void SHA256_Transform(pg_sha256_ctx *context, const uint8 *data) { uint32 a, b, c, d, e, f, g, h, s0, s1; uint32 T1, *W256; int j; W256 = (uint32 *) context->buffer; /* Initialize registers with the prev. intermediate value */ a = context->state[0]; b = context->state[1]; c = context->state[2]; d = context->state[3]; e = context->state[4]; f = context->state[5]; g = context->state[6]; h = context->state[7]; j = 0; do { /* Rounds 0 to 15 (unrolled): */ ROUND256_0_TO_15(a, b, c, d, e, f, g, h); ROUND256_0_TO_15(h, a, b, c, d, e, f, g); ROUND256_0_TO_15(g, h, a, b, c, d, e, f); ROUND256_0_TO_15(f, g, h, a, b, c, d, e); ROUND256_0_TO_15(e, f, g, h, a, b, c, d); ROUND256_0_TO_15(d, e, f, g, h, a, b, c); ROUND256_0_TO_15(c, d, e, f, g, h, a, b); ROUND256_0_TO_15(b, c, d, e, f, g, h, a); } while (j < 16); /* Now for the remaining rounds to 64: */ do { ROUND256(a, b, c, d, e, f, g, h); ROUND256(h, a, b, c, d, e, f, g); ROUND256(g, h, a, b, c, d, e, f); ROUND256(f, g, h, a, b, c, d, e); ROUND256(e, f, g, h, a, b, c, d); ROUND256(d, e, f, g, h, a, b, c); ROUND256(c, d, e, f, g, h, a, b); ROUND256(b, c, d, e, f, g, h, a); } while (j < 64); /* Compute the current intermediate hash value */ context->state[0] += a; context->state[1] += b; context->state[2] += c; context->state[3] += d; context->state[4] += e; context->state[5] += f; context->state[6] += g; context->state[7] += h; /* Clean up */ a = b = c = d = e = f = g = h = T1 = 0; } #else /* SHA2_UNROLL_TRANSFORM */ static void SHA256_Transform(pg_sha256_ctx *context, const uint8 *data) { uint32 a, b, c, d, e, f, g, h, s0, s1; uint32 T1, T2, *W256; int j; W256 = (uint32 *) context->buffer; /* Initialize registers with the prev. intermediate value */ a = context->state[0]; b = context->state[1]; c = context->state[2]; d = context->state[3]; e = context->state[4]; f = context->state[5]; g = context->state[6]; h = context->state[7]; j = 0; do { W256[j] = (uint32) data[3] | ((uint32) data[2] << 8) | ((uint32) data[1] << 16) | ((uint32) data[0] << 24); data += 4; /* Apply the SHA-256 compression function to update a..h */ T1 = h + Sigma1_256(e) + Ch(e, f, g) + K256[j] + W256[j]; T2 = Sigma0_256(a) + Maj(a, b, c); h = g; g = f; f = e; e = d + T1; d = c; c = b; b = a; a = T1 + T2; j++; } while (j < 16); do { /* Part of the message block expansion: */ s0 = W256[(j + 1) & 0x0f]; s0 = sigma0_256(s0); s1 = W256[(j + 14) & 0x0f]; s1 = sigma1_256(s1); /* Apply the SHA-256 compression function to update a..h */ T1 = h + Sigma1_256(e) + Ch(e, f, g) + K256[j] + (W256[j & 0x0f] += s1 + W256[(j + 9) & 0x0f] + s0); T2 = Sigma0_256(a) + Maj(a, b, c); h = g; g = f; f = e; e = d + T1; d = c; c = b; b = a; a = T1 + T2; j++; } while (j < 64); /* Compute the current intermediate hash value */ context->state[0] += a; context->state[1] += b; context->state[2] += c; context->state[3] += d; context->state[4] += e; context->state[5] += f; context->state[6] += g; context->state[7] += h; /* Clean up */ a = b = c = d = e = f = g = h = T1 = T2 = 0; } #endif /* SHA2_UNROLL_TRANSFORM */ void pg_sha256_update(pg_sha256_ctx *context, const uint8 *data, size_t len) { size_t freespace, usedspace; /* Calling with no data is valid (we do nothing) */ if (len == 0) return; usedspace = (context->bitcount >> 3) % PG_SHA256_BLOCK_LENGTH; if (usedspace > 0) { /* Calculate how much free space is available in the buffer */ freespace = PG_SHA256_BLOCK_LENGTH - usedspace; if (len >= freespace) { /* Fill the buffer completely and process it */ memcpy(&context->buffer[usedspace], data, freespace); context->bitcount += freespace << 3; len -= freespace; data += freespace; SHA256_Transform(context, context->buffer); } else { /* The buffer is not yet full */ memcpy(&context->buffer[usedspace], data, len); context->bitcount += len << 3; /* Clean up: */ usedspace = freespace = 0; return; } } while (len >= PG_SHA256_BLOCK_LENGTH) { /* Process as many complete blocks as we can */ SHA256_Transform(context, data); context->bitcount += PG_SHA256_BLOCK_LENGTH << 3; len -= PG_SHA256_BLOCK_LENGTH; data += PG_SHA256_BLOCK_LENGTH; } if (len > 0) { /* There's left-overs, so save 'em */ memcpy(context->buffer, data, len); context->bitcount += len << 3; } /* Clean up: */ usedspace = freespace = 0; } static void SHA256_Last(pg_sha256_ctx *context) { unsigned int usedspace; usedspace = (context->bitcount >> 3) % PG_SHA256_BLOCK_LENGTH; #ifndef WORDS_BIGENDIAN /* Convert FROM host byte order */ REVERSE64(context->bitcount, context->bitcount); #endif if (usedspace > 0) { /* Begin padding with a 1 bit: */ context->buffer[usedspace++] = 0x80; if (usedspace <= PG_SHA256_SHORT_BLOCK_LENGTH) { /* Set-up for the last transform: */ memset(&context->buffer[usedspace], 0, PG_SHA256_SHORT_BLOCK_LENGTH - usedspace); } else { if (usedspace < PG_SHA256_BLOCK_LENGTH) { memset(&context->buffer[usedspace], 0, PG_SHA256_BLOCK_LENGTH - usedspace); } /* Do second-to-last transform: */ SHA256_Transform(context, context->buffer); /* And set-up for the last transform: */ memset(context->buffer, 0, PG_SHA256_SHORT_BLOCK_LENGTH); } } else { /* Set-up for the last transform: */ memset(context->buffer, 0, PG_SHA256_SHORT_BLOCK_LENGTH); /* Begin padding with a 1 bit: */ *context->buffer = 0x80; } /* Set the bit count: */ *(uint64 *) &context->buffer[PG_SHA256_SHORT_BLOCK_LENGTH] = context->bitcount; /* Final transform: */ SHA256_Transform(context, context->buffer); } void pg_sha256_final(pg_sha256_ctx *context, uint8 *digest) { /* If no digest buffer is passed, we don't bother doing this: */ if (digest != NULL) { SHA256_Last(context); #ifndef WORDS_BIGENDIAN { /* Convert TO host byte order */ int j; for (j = 0; j < 8; j++) { REVERSE32(context->state[j], context->state[j]); } } #endif memcpy(digest, context->state, PG_SHA256_DIGEST_LENGTH); } /* Clean up state data: */ memset(context, 0, sizeof(pg_sha256_ctx)); } /*** SHA-512: *********************************************************/ void pg_sha512_init(pg_sha512_ctx *context) { if (context == NULL) return; memcpy(context->state, sha512_initial_hash_value, PG_SHA512_DIGEST_LENGTH); memset(context->buffer, 0, PG_SHA512_BLOCK_LENGTH); context->bitcount[0] = context->bitcount[1] = 0; } #ifdef SHA2_UNROLL_TRANSFORM /* Unrolled SHA-512 round macros: */ #define ROUND512_0_TO_15(a,b,c,d,e,f,g,h) do { \ W512[j] = (uint64)data[7] | ((uint64)data[6] << 8) | \ ((uint64)data[5] << 16) | ((uint64)data[4] << 24) | \ ((uint64)data[3] << 32) | ((uint64)data[2] << 40) | \ ((uint64)data[1] << 48) | ((uint64)data[0] << 56); \ data += 8; \ T1 = (h) + Sigma1_512((e)) + Ch((e), (f), (g)) + K512[j] + W512[j]; \ (d) += T1; \ (h) = T1 + Sigma0_512((a)) + Maj((a), (b), (c)); \ j++; \ } while(0) #define ROUND512(a,b,c,d,e,f,g,h) do { \ s0 = W512[(j+1)&0x0f]; \ s0 = sigma0_512(s0); \ s1 = W512[(j+14)&0x0f]; \ s1 = sigma1_512(s1); \ T1 = (h) + Sigma1_512((e)) + Ch((e), (f), (g)) + K512[j] + \ (W512[j&0x0f] += s1 + W512[(j+9)&0x0f] + s0); \ (d) += T1; \ (h) = T1 + Sigma0_512((a)) + Maj((a), (b), (c)); \ j++; \ } while(0) static void SHA512_Transform(pg_sha512_ctx *context, const uint8 *data) { uint64 a, b, c, d, e, f, g, h, s0, s1; uint64 T1, *W512 = (uint64 *) context->buffer; int j; /* Initialize registers with the prev. intermediate value */ a = context->state[0]; b = context->state[1]; c = context->state[2]; d = context->state[3]; e = context->state[4]; f = context->state[5]; g = context->state[6]; h = context->state[7]; j = 0; do { ROUND512_0_TO_15(a, b, c, d, e, f, g, h); ROUND512_0_TO_15(h, a, b, c, d, e, f, g); ROUND512_0_TO_15(g, h, a, b, c, d, e, f); ROUND512_0_TO_15(f, g, h, a, b, c, d, e); ROUND512_0_TO_15(e, f, g, h, a, b, c, d); ROUND512_0_TO_15(d, e, f, g, h, a, b, c); ROUND512_0_TO_15(c, d, e, f, g, h, a, b); ROUND512_0_TO_15(b, c, d, e, f, g, h, a); } while (j < 16); /* Now for the remaining rounds up to 79: */ do { ROUND512(a, b, c, d, e, f, g, h); ROUND512(h, a, b, c, d, e, f, g); ROUND512(g, h, a, b, c, d, e, f); ROUND512(f, g, h, a, b, c, d, e); ROUND512(e, f, g, h, a, b, c, d); ROUND512(d, e, f, g, h, a, b, c); ROUND512(c, d, e, f, g, h, a, b); ROUND512(b, c, d, e, f, g, h, a); } while (j < 80); /* Compute the current intermediate hash value */ context->state[0] += a; context->state[1] += b; context->state[2] += c; context->state[3] += d; context->state[4] += e; context->state[5] += f; context->state[6] += g; context->state[7] += h; /* Clean up */ a = b = c = d = e = f = g = h = T1 = 0; } #else /* SHA2_UNROLL_TRANSFORM */ static void SHA512_Transform(pg_sha512_ctx *context, const uint8 *data) { uint64 a, b, c, d, e, f, g, h, s0, s1; uint64 T1, T2, *W512 = (uint64 *) context->buffer; int j; /* Initialize registers with the prev. intermediate value */ a = context->state[0]; b = context->state[1]; c = context->state[2]; d = context->state[3]; e = context->state[4]; f = context->state[5]; g = context->state[6]; h = context->state[7]; j = 0; do { W512[j] = (uint64) data[7] | ((uint64) data[6] << 8) | ((uint64) data[5] << 16) | ((uint64) data[4] << 24) | ((uint64) data[3] << 32) | ((uint64) data[2] << 40) | ((uint64) data[1] << 48) | ((uint64) data[0] << 56); data += 8; /* Apply the SHA-512 compression function to update a..h */ T1 = h + Sigma1_512(e) + Ch(e, f, g) + K512[j] + W512[j]; T2 = Sigma0_512(a) + Maj(a, b, c); h = g; g = f; f = e; e = d + T1; d = c; c = b; b = a; a = T1 + T2; j++; } while (j < 16); do { /* Part of the message block expansion: */ s0 = W512[(j + 1) & 0x0f]; s0 = sigma0_512(s0); s1 = W512[(j + 14) & 0x0f]; s1 = sigma1_512(s1); /* Apply the SHA-512 compression function to update a..h */ T1 = h + Sigma1_512(e) + Ch(e, f, g) + K512[j] + (W512[j & 0x0f] += s1 + W512[(j + 9) & 0x0f] + s0); T2 = Sigma0_512(a) + Maj(a, b, c); h = g; g = f; f = e; e = d + T1; d = c; c = b; b = a; a = T1 + T2; j++; } while (j < 80); /* Compute the current intermediate hash value */ context->state[0] += a; context->state[1] += b; context->state[2] += c; context->state[3] += d; context->state[4] += e; context->state[5] += f; context->state[6] += g; context->state[7] += h; /* Clean up */ a = b = c = d = e = f = g = h = T1 = T2 = 0; } #endif /* SHA2_UNROLL_TRANSFORM */ void pg_sha512_update(pg_sha512_ctx *context, const uint8 *data, size_t len) { size_t freespace, usedspace; /* Calling with no data is valid (we do nothing) */ if (len == 0) return; usedspace = (context->bitcount[0] >> 3) % PG_SHA512_BLOCK_LENGTH; if (usedspace > 0) { /* Calculate how much free space is available in the buffer */ freespace = PG_SHA512_BLOCK_LENGTH - usedspace; if (len >= freespace) { /* Fill the buffer completely and process it */ memcpy(&context->buffer[usedspace], data, freespace); ADDINC128(context->bitcount, freespace << 3); len -= freespace; data += freespace; SHA512_Transform(context, context->buffer); } else { /* The buffer is not yet full */ memcpy(&context->buffer[usedspace], data, len); ADDINC128(context->bitcount, len << 3); /* Clean up: */ usedspace = freespace = 0; return; } } while (len >= PG_SHA512_BLOCK_LENGTH) { /* Process as many complete blocks as we can */ SHA512_Transform(context, data); ADDINC128(context->bitcount, PG_SHA512_BLOCK_LENGTH << 3); len -= PG_SHA512_BLOCK_LENGTH; data += PG_SHA512_BLOCK_LENGTH; } if (len > 0) { /* There's left-overs, so save 'em */ memcpy(context->buffer, data, len); ADDINC128(context->bitcount, len << 3); } /* Clean up: */ usedspace = freespace = 0; } static void SHA512_Last(pg_sha512_ctx *context) { unsigned int usedspace; usedspace = (context->bitcount[0] >> 3) % PG_SHA512_BLOCK_LENGTH; #ifndef WORDS_BIGENDIAN /* Convert FROM host byte order */ REVERSE64(context->bitcount[0], context->bitcount[0]); REVERSE64(context->bitcount[1], context->bitcount[1]); #endif if (usedspace > 0) { /* Begin padding with a 1 bit: */ context->buffer[usedspace++] = 0x80; if (usedspace <= PG_SHA512_SHORT_BLOCK_LENGTH) { /* Set-up for the last transform: */ memset(&context->buffer[usedspace], 0, PG_SHA512_SHORT_BLOCK_LENGTH - usedspace); } else { if (usedspace < PG_SHA512_BLOCK_LENGTH) { memset(&context->buffer[usedspace], 0, PG_SHA512_BLOCK_LENGTH - usedspace); } /* Do second-to-last transform: */ SHA512_Transform(context, context->buffer); /* And set-up for the last transform: */ memset(context->buffer, 0, PG_SHA512_BLOCK_LENGTH - 2); } } else { /* Prepare for final transform: */ memset(context->buffer, 0, PG_SHA512_SHORT_BLOCK_LENGTH); /* Begin padding with a 1 bit: */ *context->buffer = 0x80; } /* Store the length of input data (in bits): */ *(uint64 *) &context->buffer[PG_SHA512_SHORT_BLOCK_LENGTH] = context->bitcount[1]; *(uint64 *) &context->buffer[PG_SHA512_SHORT_BLOCK_LENGTH + 8] = context->bitcount[0]; /* Final transform: */ SHA512_Transform(context, context->buffer); } void pg_sha512_final(pg_sha512_ctx *context, uint8 *digest) { /* If no digest buffer is passed, we don't bother doing this: */ if (digest != NULL) { SHA512_Last(context); /* Save the hash data for output: */ #ifndef WORDS_BIGENDIAN { /* Convert TO host byte order */ int j; for (j = 0; j < 8; j++) { REVERSE64(context->state[j], context->state[j]); } } #endif memcpy(digest, context->state, PG_SHA512_DIGEST_LENGTH); } /* Zero out state data */ memset(context, 0, sizeof(pg_sha512_ctx)); } /*** SHA-384: *********************************************************/ void pg_sha384_init(pg_sha384_ctx *context) { if (context == NULL) return; memcpy(context->state, sha384_initial_hash_value, PG_SHA512_DIGEST_LENGTH); memset(context->buffer, 0, PG_SHA384_BLOCK_LENGTH); context->bitcount[0] = context->bitcount[1] = 0; } void pg_sha384_update(pg_sha384_ctx *context, const uint8 *data, size_t len) { pg_sha512_update((pg_sha512_ctx *) context, data, len); } void pg_sha384_final(pg_sha384_ctx *context, uint8 *digest) { /* If no digest buffer is passed, we don't bother doing this: */ if (digest != NULL) { SHA512_Last((pg_sha512_ctx *) context); /* Save the hash data for output: */ #ifndef WORDS_BIGENDIAN { /* Convert TO host byte order */ int j; for (j = 0; j < 6; j++) { REVERSE64(context->state[j], context->state[j]); } } #endif memcpy(digest, context->state, PG_SHA384_DIGEST_LENGTH); } /* Zero out state data */ memset(context, 0, sizeof(pg_sha384_ctx)); } /*** SHA-224: *********************************************************/ void pg_sha224_init(pg_sha224_ctx *context) { if (context == NULL) return; memcpy(context->state, sha224_initial_hash_value, PG_SHA256_DIGEST_LENGTH); memset(context->buffer, 0, PG_SHA256_BLOCK_LENGTH); context->bitcount = 0; } void pg_sha224_update(pg_sha224_ctx *context, const uint8 *data, size_t len) { pg_sha256_update((pg_sha256_ctx *) context, data, len); } void pg_sha224_final(pg_sha224_ctx *context, uint8 *digest) { /* If no digest buffer is passed, we don't bother doing this: */ if (digest != NULL) { SHA256_Last(context); #ifndef WORDS_BIGENDIAN { /* Convert TO host byte order */ int j; for (j = 0; j < 8; j++) { REVERSE32(context->state[j], context->state[j]); } } #endif memcpy(digest, context->state, PG_SHA224_DIGEST_LENGTH); } /* Clean up state data: */ memset(context, 0, sizeof(pg_sha224_ctx)); } pgpool-II-4.1.4/src/utils/ssl_utils.c0000664000175000017500000001650513730350075014370 00000000000000/* * $Header$ * * Handles watchdog connection, and protocol communication with pgpool-II * * pgpool: a language independent connection pool server for PostgreSQL * written by Tatsuo Ishii * * Copyright (c) 2003-2018 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 #include #include #include #include #include #include #include "pool.h" #include "auth/md5.h" #include "utils/elog.h" #include "utils/palloc.h" #include "utils/memutils.h" #include "pool_config.h" #include "utils/ssl_utils.h" #ifdef USE_SSL static int aes_get_key(const char *password, unsigned char *key, unsigned char *iv); static int aes_encrypt(unsigned char *plaintext, int plaintext_len, unsigned char *key, unsigned char *iv, unsigned char *ciphertext); static int aes_decrypt(unsigned char *ciphertext, int ciphertext_len, unsigned char *key, unsigned char *iv, unsigned char *plaintext); #endif #ifdef USE_SSL int aes_encrypt_with_password(unsigned char *plaintext, int plaintext_len, const char *password, unsigned char *ciphertext) { unsigned char key[EVP_MAX_KEY_LENGTH], iv[EVP_MAX_IV_LENGTH]; /* First get the key and iv using the password */ if (aes_get_key(password, key, iv) != 0) return -1; return aes_encrypt(plaintext, plaintext_len, key, iv, ciphertext); } int aes_decrypt_with_password(unsigned char *ciphertext, int ciphertext_len, const char *password, unsigned char *plaintext) { unsigned char key[EVP_MAX_KEY_LENGTH], iv[EVP_MAX_IV_LENGTH]; /* First get the key and iv using the password */ if (aes_get_key(password, key, iv) != 0) return -1; return aes_decrypt(ciphertext, ciphertext_len, key, iv, plaintext); } /* * key must be EVP_MAX_KEY_LENGTH length * iv must be EVP_MAX_IV_LENGTH length */ static int aes_get_key(const char *password, unsigned char *key, unsigned char *iv) { const unsigned char *salt = NULL; OpenSSL_add_all_algorithms(); if (!EVP_BytesToKey(EVP_aes_256_cbc(), EVP_sha1(), salt, (unsigned char *) password, strlen(password), 1, key, iv)) { ereport(ERROR, (errmsg("unable to generate AES key from password"), errdetail("EVP_BytesToKey failed"))); return 1; } #ifdef DEBUG_ENCRYPT printf("Key: "); for (i = 0; i < EVP_aes_256_cbc()->key_len; ++i) { printf("%02x", key[i]); } printf("\n"); printf("IV: "); for (i = 0; i < EVP_aes_256_cbc()->iv_len; ++i) { printf("%02x", iv[i]); } printf("\n"); #endif return 0; } /* * from: https://wiki.openssl.org/index.php/EVP_Symmetric_Encryption_and_Decryption */ static int aes_encrypt(unsigned char *plaintext, int plaintext_len, unsigned char *key, unsigned char *iv, unsigned char *ciphertext) { EVP_CIPHER_CTX *ctx = NULL; int len; int ciphertext_len; /* Create and initialise the context */ if (!(ctx = EVP_CIPHER_CTX_new())) goto encrypt_error; /* * Initialise the encryption operation. IMPORTANT - ensure you use a key * and IV size appropriate for your cipher In this example we are using * 256 bit AES (i.e. a 256 bit key). The IV size for *most* modes is the * same as the block size. For AES this is 128 bits */ if (EVP_EncryptInit_ex(ctx, EVP_aes_256_cbc(), NULL, key, iv) != 1) goto encrypt_error; /* * Provide the message to be encrypted, and obtain the encrypted output. * EVP_EncryptUpdate can be called multiple times if necessary */ if (EVP_EncryptUpdate(ctx, ciphertext, &len, plaintext, plaintext_len) != 1) goto encrypt_error; ciphertext_len = len; /* * Finalise the encryption. Further ciphertext bytes may be written at * this stage. */ if (EVP_EncryptFinal_ex(ctx, ciphertext + len, &len) != 1) goto encrypt_error; ciphertext_len += len; /* Clean up */ EVP_CIPHER_CTX_free(ctx); return ciphertext_len; encrypt_error: if (ctx) EVP_CIPHER_CTX_free(ctx); return -1; } static int aes_decrypt(unsigned char *ciphertext, int ciphertext_len, unsigned char *key, unsigned char *iv, unsigned char *plaintext) { EVP_CIPHER_CTX *ctx = NULL; int len; int plaintext_len; /* Create and initialise the context */ if (!(ctx = EVP_CIPHER_CTX_new())) goto decrypt_error; /* * Initialise the decryption operation. IMPORTANT - ensure you use a key * and IV size appropriate for your cipher In this example we are using * 256 bit AES (i.e. a 256 bit key). The IV size for *most* modes is the * same as the block size. For AES this is 128 bits */ if (EVP_DecryptInit_ex(ctx, EVP_aes_256_cbc(), NULL, key, iv) != 1) goto decrypt_error; /* * Provide the message to be decrypted, and obtain the plaintext output. * EVP_DecryptUpdate can be called multiple times if necessary */ if (EVP_DecryptUpdate(ctx, plaintext, &len, ciphertext, ciphertext_len) != 1) goto decrypt_error; plaintext_len = len; /* * Finalise the decryption. Further plaintext bytes may be written at this * stage. */ if (EVP_DecryptFinal_ex(ctx, plaintext + len, &len) != 1) goto decrypt_error; plaintext_len += len; /* Clean up */ EVP_CIPHER_CTX_free(ctx); return plaintext_len; decrypt_error: if (ctx) EVP_CIPHER_CTX_free(ctx); return -1; } /* HMAC SHA-256*/ void calculate_hmac_sha256(const char *data, int len, char *buf) { char *key = pool_config->wd_authkey; char str[WD_AUTH_HASH_LEN / 2]; unsigned int res_len = WD_AUTH_HASH_LEN; HMAC_CTX *ctx = NULL; #if (OPENSSL_VERSION_NUMBER >= 0x10100000L && !defined (LIBRESSL_VERSION_NUMBER)) ctx = HMAC_CTX_new(); HMAC_CTX_reset(ctx); #else HMAC_CTX ctx_obj; ctx = &ctx_obj; HMAC_CTX_init(ctx); #endif HMAC_Init_ex(ctx, key, strlen(key), EVP_sha256(), NULL); HMAC_Update(ctx, (unsigned char *) data, len); HMAC_Final(ctx, (unsigned char *) str, &res_len); #if (OPENSSL_VERSION_NUMBER >= 0x10100000L && !defined (LIBRESSL_VERSION_NUMBER)) HMAC_CTX_reset(ctx); HMAC_CTX_free(ctx); #else HMAC_CTX_cleanup(ctx); #endif bytesToHex(str, 32, buf); buf[WD_AUTH_HASH_LEN] = '\0'; } #else int aes_decrypt_with_password(unsigned char *ciphertext, int ciphertext_len, const char *password, unsigned char *plaintext) { ereport(ERROR, (errmsg("AES decryption is not supported by this build"), errhint("Compile with --with-openssl to use AES."))); return -1; } int aes_encrypt_with_password(unsigned char *plaintext, int plaintext_len, const char *password, unsigned char *ciphertext) { ereport(ERROR, (errmsg("AES encryption is not supported by this build"), errhint("Compile with --with-openssl to use AES."))); return -1; } void calculate_hmac_sha256(const char *data, int len, char *buf) { ereport(ERROR, (errmsg("HMAC SHA256 encryption is not supported by this build"), errhint("Compile with --with-openssl to use AES."))); } #endif pgpool-II-4.1.4/src/utils/statistics.c0000664000175000017500000000422713730350127014535 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 * */ /*-------------------------------------------------------------------- * statistics.c * * Various statistics related functions. *-------------------------------------------------------------------- */ #include #include #include "pool.h" #include "parser/nodes.h" /* * Per backend node stat area in shared memory */ typedef struct { uint64 select_cnt; /* number of read SELECT queries issued */ uint64 insert_cnt; /* number of INSERT queries issued */ uint64 update_cnt; /* number of UPDATE queries issued */ uint64 delete_cnt; /* number of DELETE queries issued */ uint64 ddl_cnt; /* number of DDL queries issued */ uint64 other_cnt; /* number of any other queries issued */ } PER_NODE_STAT; static volatile PER_NODE_STAT *per_node_stat; /* * Return shared memory size necessary for this module */ size_t stat_shared_memory_size(void) { size_t size; /* query counter area */ size = MAXALIGN(MAX_NUM_BACKENDS * sizeof(PER_NODE_STAT)); return size; } /* * Set PER_NODE_STAT address in the shared memory area to global variable. * This should be called from pgpool main process upon startup. */ void stat_set_stat_area(void *address) { per_node_stat = (PER_NODE_STAT *) address; } /* * Initialize shared memory stat area */ void stat_init_stat_area(void) { memset((void *) per_node_stat, 0, stat_shared_memory_size()); } /* * Update stat counter */ void stat_count_up(int backend_node_id, Node *parse_tree) { if (parse_tree == NULL) { /* * No parse tree. does not worth to gather statistics (internal * queries). If we want to gather statistics for queries without * parse tree, we could call the parser but I don't think it's worth * the trouble. */ return; } if (IsA(parse_tree, SelectStmt)) { per_node_stat[backend_node_id].select_cnt++; } } /* * Stat counter read functions */ uint64 stat_get_select_count(int backend_node_id) { return per_node_stat[backend_node_id].select_cnt; } pgpool-II-4.1.4/src/utils/sprompt.c0000664000175000017500000001127013730350075014045 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-2015 PgPool Global Development Group * */ /*------------------------------------------------------------------------- * * sprompt.c * simple_prompt() routine * * Portions Copyright (c) 1996-2013, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * * IDENTIFICATION * src/port/sprompt.c * *------------------------------------------------------------------------- */ /* * simple_prompt * * Generalized function especially intended for reading in usernames and * password interactively. Reads from /dev/tty or stdin/stderr. * * prompt: The prompt to print * maxlen: How many characters to accept * echo: Set to false if you want to hide what is entered (for passwords) * * Returns a malloc()'ed string with the input (w/o trailing newline). */ #include #include #include "pool_type.h" #ifdef HAVE_TERMIOS_H #include #endif extern char *simple_prompt(const char *prompt, int maxlen, bool echo); char * simple_prompt(const char *prompt, int maxlen, bool echo) { int length; char *destination; FILE *termin, *termout; #ifdef HAVE_TERMIOS_H struct termios t_orig, t; #else #ifdef WIN32 HANDLE t = NULL; LPDWORD t_orig = NULL; #endif #endif destination = (char *) malloc(maxlen + 1); if (!destination) return NULL; #ifdef WIN32 /* * A Windows console has an "input code page" and an "output code page"; * these usually match each other, but they rarely match the "Windows ANSI * code page" defined at system boot and expected of "char *" arguments to * Windows API functions. The Microsoft CRT write() implementation * automatically converts text between these code pages when writing to a * console. To identify such file descriptors, it calls GetConsoleMode() * on the underlying HANDLE, which in turn requires GENERIC_READ access on * the HANDLE. Opening termout in mode "w+" allows that detection to * succeed. Otherwise, write() would not recognize the descriptor as a * console, and non-ASCII characters would display incorrectly. * * XXX fgets() still receives text in the console's input code page. This * makes non-ASCII credentials unportable. */ termin = fopen("CONIN$", "r"); termout = fopen("CONOUT$", "w+"); #else /* * Do not try to collapse these into one "w+" mode file. Doesn't work on * some platforms (eg, HPUX 10.20). */ termin = fopen("/dev/tty", "r"); termout = fopen("/dev/tty", "w"); #endif if (!termin || !termout #ifdef WIN32 /* * Direct console I/O does not work from the MSYS 1.0.10 console. Writes * reach nowhere user-visible; reads block indefinitely. XXX This affects * most Windows terminal environments, including rxvt, mintty, Cygwin * xterm, Cygwin sshd, and PowerShell ISE. Switch to a more-generic test. */ || (getenv("OSTYPE") && strcmp(getenv("OSTYPE"), "msys") == 0) #endif ) { if (termin) fclose(termin); if (termout) fclose(termout); termin = stdin; termout = stderr; } #ifdef HAVE_TERMIOS_H if (!echo) { tcgetattr(fileno(termin), &t); t_orig = t; t.c_lflag &= ~ECHO; tcsetattr(fileno(termin), TCSAFLUSH, &t); } #else #ifdef WIN32 if (!echo) { /* get a new handle to turn echo off */ t_orig = (LPDWORD) malloc(sizeof(DWORD)); t = GetStdHandle(STD_INPUT_HANDLE); /* save the old configuration first */ GetConsoleMode(t, t_orig); /* set to the new mode */ SetConsoleMode(t, ENABLE_LINE_INPUT | ENABLE_PROCESSED_INPUT); } #endif #endif if (prompt) { fputs(prompt, termout); fflush(termout); } if (fgets(destination, maxlen + 1, termin) == NULL) destination[0] = '\0'; length = strlen(destination); if (length > 0 && destination[length - 1] != '\n') { /* eat rest of the line */ char buf[128]; int buflen; do { if (fgets(buf, sizeof(buf), termin) == NULL) break; buflen = strlen(buf); } while (buflen > 0 && buf[buflen - 1] != '\n'); } if (length > 0 && destination[length - 1] == '\n') /* remove trailing newline */ destination[length - 1] = '\0'; #ifdef HAVE_TERMIOS_H if (!echo) { tcsetattr(fileno(termin), TCSAFLUSH, &t_orig); fputs("\n", termout); fflush(termout); } #else #ifdef WIN32 if (!echo) { /* reset to the original console mode */ SetConsoleMode(t, *t_orig); fputs("\n", termout); fflush(termout); free(t_orig); } #endif #endif if (termin != stdin) { fclose(termin); fclose(termout); } return destination; } pgpool-II-4.1.4/src/Makefile.in0000664000175000017500000012026013730350127013100 00000000000000# Makefile.in generated by automake 1.13.4 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 = pgpool$(EXEEXT) subdir = src DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(top_srcdir)/mkinstalldirs config/pool_config.c \ $(top_srcdir)/ylwrap ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/docbook.m4 \ $(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)" "$(DESTDIR)$(bindir)" \ "$(DESTDIR)$(pkgdatadir)" "$(DESTDIR)$(sysconfdir)" PROGRAMS = $(bin_PROGRAMS) am__dirstamp = $(am__leading_dot)dirstamp am_pgpool_OBJECTS = main/main.$(OBJEXT) main/pool_globals.$(OBJEXT) \ main/pgpool_main.$(OBJEXT) main/health_check.$(OBJEXT) \ config/pool_config.$(OBJEXT) \ config/pool_config_variables.$(OBJEXT) \ pcp_con/pcp_child.$(OBJEXT) pcp_con/pcp_worker.$(OBJEXT) \ pcp_con/recovery.$(OBJEXT) auth/md5.$(OBJEXT) \ auth/pool_auth.$(OBJEXT) auth/pool_passwd.$(OBJEXT) \ auth/pool_hba.$(OBJEXT) auth/auth-scram.$(OBJEXT) \ protocol/pool_proto2.$(OBJEXT) protocol/child.$(OBJEXT) \ protocol/pool_process_query.$(OBJEXT) \ protocol/pool_connection_pool.$(OBJEXT) \ protocol/pool_proto_modules.$(OBJEXT) \ query_cache/pool_memqcache.$(OBJEXT) \ protocol/CommandComplete.$(OBJEXT) \ context/pool_session_context.$(OBJEXT) \ context/pool_process_context.$(OBJEXT) \ context/pool_query_context.$(OBJEXT) \ streaming_replication/pool_worker_child.$(OBJEXT) \ rewrite/pool_timestamp.$(OBJEXT) rewrite/pool_lobj.$(OBJEXT) \ utils/pool_select_walker.$(OBJEXT) utils/strlcpy.$(OBJEXT) \ utils/psprintf.$(OBJEXT) utils/pool_params.$(OBJEXT) \ utils/ps_status.$(OBJEXT) utils/pool_shmem.$(OBJEXT) \ utils/pool_sema.$(OBJEXT) utils/pool_signal.$(OBJEXT) \ utils/pool_path.$(OBJEXT) utils/pool_ip.$(OBJEXT) \ utils/pool_relcache.$(OBJEXT) \ utils/pool_process_reporting.$(OBJEXT) \ utils/pool_ssl.$(OBJEXT) utils/pool_stream.$(OBJEXT) \ utils/getopt_long.$(OBJEXT) utils/mmgr/mcxt.$(OBJEXT) \ utils/mmgr/aset.$(OBJEXT) utils/error/elog.$(OBJEXT) \ utils/error/assert.$(OBJEXT) utils/pcp/pcp_stream.$(OBJEXT) \ utils/regex_array.$(OBJEXT) utils/json_writer.$(OBJEXT) \ utils/json.$(OBJEXT) utils/scram-common.$(OBJEXT) \ utils/base64.$(OBJEXT) utils/sha2.$(OBJEXT) \ utils/ssl_utils.$(OBJEXT) utils/statistics.$(OBJEXT) pgpool_OBJECTS = $(am_pgpool_OBJECTS) pgpool_DEPENDENCIES = parser/libsql-parser.a parser/nodes.o \ watchdog/lib-watchdog.a 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 = pgpool_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(pgpool_LDFLAGS) $(LDFLAGS) -o $@ am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } SCRIPTS = $(bin_SCRIPTS) 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 = am__depfiles_maybe = 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 = $(pgpool_SOURCES) DIST_SOURCES = $(pgpool_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 DATA = $(pkgdata_DATA) $(sysconf_DATA) 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@ CATALOG = @CATALOG@ CC = @CC@ CFLAGS = @CFLAGS@ COLLATEINDEX = @COLLATEINDEX@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ \ -DDEFAULT_CONFIGDIR=\"$(sysconfdir)\" \ -DHEALTHCHECK_OPTS=$(HEALTHCHECK_DEBUG) DLLTOOL = @DLLTOOL@ DOCBOOKSTYLE = @DOCBOOKSTYLE@ 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@ JADE = @JADE@ 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@ LYNX = @LYNX@ 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@ NSGMLS = @NSGMLS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OSX = @OSX@ 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@ PERL = @PERL@ PGCONFIG = @PGCONFIG@ PGSQL_BIN_DIR = @PGSQL_BIN_DIR@ PGSQL_INCLUDE_DIR = @PGSQL_INCLUDE_DIR@ PGSQL_LIB_DIR = @PGSQL_LIB_DIR@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ STYLE = @STYLE@ SUNIFDEF = @SUNIFDEF@ VERSION = @VERSION@ XMLLINT = @XMLLINT@ XSLTPROC = @XSLTPROC@ XSLTPROC_HTML_FLAGS = @XSLTPROC_HTML_FLAGS@ 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__leading_dot = @am__leading_dot@ 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@ have_docbook = @have_docbook@ 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@ AUTOMAKE_OPTIONS = subdir-objects libs_dir = $(top_srcdir)/src/libs AM_CPPFLAGS = -D_GNU_SOURCE -I @PGSQL_INCLUDE_DIR@ HEALTHCHECK_DEBUG = 0 pgpool_SOURCES = main/main.c \ main/pool_globals.c \ main/pgpool_main.c \ main/health_check.c \ config/pool_config.l \ config/pool_config_variables.c \ pcp_con/pcp_child.c \ pcp_con/pcp_worker.c \ pcp_con/recovery.c \ auth/md5.c \ auth/pool_auth.c \ auth/pool_passwd.c \ auth/pool_hba.c \ auth/auth-scram.c \ protocol/pool_proto2.c \ protocol/child.c \ protocol/pool_process_query.c \ protocol/pool_connection_pool.c \ protocol/pool_proto_modules.c \ query_cache/pool_memqcache.c \ protocol/CommandComplete.c \ context/pool_session_context.c \ context/pool_process_context.c \ context/pool_query_context.c \ streaming_replication/pool_worker_child.c \ rewrite/pool_timestamp.c \ rewrite/pool_lobj.c \ utils/pool_select_walker.c \ utils/strlcpy.c \ utils/psprintf.c \ utils/pool_params.c \ utils/ps_status.c \ utils/pool_shmem.c \ utils/pool_sema.c \ utils/pool_signal.c \ utils/pool_path.c \ utils/pool_ip.c \ utils/pool_relcache.c \ utils/pool_process_reporting.c \ utils/pool_ssl.c \ utils/pool_stream.c \ utils/getopt_long.c \ utils/mmgr/mcxt.c \ utils/mmgr/aset.c \ utils/error/elog.c \ utils/error/assert.c \ utils/pcp/pcp_stream.c \ utils/regex_array.c \ utils/json_writer.c \ utils/json.c \ utils/scram-common.c \ utils/base64.c \ utils/sha2.c \ utils/ssl_utils.c \ utils/statistics.c sysconf_DATA = sample/pgpool.conf.sample \ sample/pcp.conf.sample \ sample/pool_hba.conf.sample \ sample/pgpool.conf.sample-replication \ sample/pgpool.conf.sample-master-slave \ sample/pgpool.conf.sample-stream \ sample/pgpool.conf.sample-logical \ sample/scripts/failover.sh.sample \ sample/scripts/follow_master.sh.sample \ sample/scripts/pgpool_remote_start.sample \ sample/scripts/recovery_1st_stage.sample \ sample/scripts/recovery_2nd_stage.sample pkgdata_DATA = sql/insert_lock.sql \ sample/pgpool.pam # suggested by libtoolize #ACLOCAL_AMFLAGS = -I m4 pgpool_LDADD = -L@PGSQL_LIB_DIR@ -lpq parser/libsql-parser.a \ parser/nodes.o \ watchdog/lib-watchdog.a \ -lpthread @enable_rpath_FALSE@pgpool_LDFLAGS = @enable_rpath_TRUE@pgpool_LDFLAGS = -rpath @PGSQL_LIB_DIR@ -rpath $(libdir) AM_YFLAGS = -d EXTRA_DIST = sample/pgpool.pam \ sample/scripts/failover.sh.sample \ sample/scripts/follow_master.sh.sample \ sample/scripts/pgpool_remote_start.sample \ sample/scripts/recovery_1st_stage.sample \ sample/scripts/recovery_2nd_stage.sample \ sample/pgpool.conf.sample sample/pool_hba.conf.sample \ sample/pgpool.conf.sample-replication sample/pgpool.conf.sample-master-slave \ sample/pgpool.conf.sample-stream sample/pgpool.conf.sample-logical sample/pcp.conf.sample \ sql/Makefile \ sql/insert_lock.sql \ sql/pgpool-recovery/pgpool-recovery.c \ sql/pgpool-recovery/pgpool-recovery.sql.in \ sql/pgpool-recovery/uninstall_pgpool-recovery.sql \ sql/pgpool-recovery/pgpool_recovery--1.3.sql \ sql/pgpool-recovery/pgpool_recovery--1.2--1.3.sql \ sql/pgpool-recovery/pgpool_recovery--1.2.sql \ sql/pgpool-recovery/pgpool_recovery--1.1--1.2.sql \ sql/pgpool-recovery/pgpool_recovery--1.1.sql \ sql/pgpool-recovery/pgpool_recovery.control \ sql/pgpool-recovery/Makefile \ sql/pgpool-regclass/pgpool-regclass.c \ sql/pgpool-regclass/pgpool-regclass.sql.in \ sql/pgpool-regclass/uninstall_pgpool-regclass.sql \ sql/pgpool-regclass/pgpool_regclass--1.0.sql \ sql/pgpool-regclass/pgpool_regclass.control \ sql/pgpool-regclass/Makefile \ sql/pgpool_adm/pgpool_adm.c \ sql/pgpool_adm/pgpool_adm.h \ sql/pgpool_adm/pgpool_adm.control \ sql/pgpool_adm/pgpool_adm--1.1.sql \ sql/pgpool_adm/pgpool_adm--1.0--1.1.sql \ sql/pgpool_adm/pgpool_adm--1.0.sql \ sql/pgpool_adm/pgpool_adm--1.2.sql \ sql/pgpool_adm/pgpool_adm--1.1--1.2.sql \ sql/pgpool_adm/Makefile \ test/parser/expected/copy.out test/parser/expected/create.out \ test/parser/expected/cursor.out test/parser/expected/delete.out \ test/parser/expected/drop.out test/parser/expected/insert.out \ test/parser/expected/misc.out test/parser/expected/prepare.out \ test/parser/expected/privileges.out test/parser/expected/scanner.out \ test/parser/expected/select.out \ test/parser/expected/transaction.out test/parser/expected/update.out \ test/parser/expected/v84.out test/parser/expected/v90.out \ test/parser/expected/var.out \ test/parser/input/alter.sql \ test/parser/input/copy.sql test/parser/input/create.sql \ test/parser/input/cursor.sql test/parser/input/delete.sql \ test/parser/input/drop.sql test/parser/input/insert.sql \ test/parser/input/misc.sql test/parser/input/prepare.sql \ test/parser/input/privileges.sql test/parser/input/scanner.sql \ test/parser/input/select.sql \ test/parser/input/transaction.sql test/parser/input/update.sql \ test/parser/input/v84.sql test/parser/input/v90.sql \ test/parser/input/var.sql \ test/parser/.cvsignore test/parser/Makefile \ test/parser/README test/parser/main.c \ test/parser/pool.h test/parser/run-test \ test/parser/parse_schedule \ test/C/Makefile test/C/test_extended.c \ test/pdo-test/README.euc_jp test/pdo-test/collections.inc test/pdo-test/def.inc \ test/pdo-test/pdotest.php test/pdo-test/regsql.inc \ test/pdo-test/SQLlist/test1.sql test/pdo-test/SQLlist/test2.sql \ test/pdo-test/mod/database.inc test/pdo-test/mod/errorhandler.inc \ test/pgpool_setup.in test/watchdog_setup.in test/regression \ redhat/pgpool.init \ redhat/pgpool_rhel.sysconfig redhat/pgpool_rhel6.sysconfig \ redhat/pgpool.conf.sample.patch \ redhat/pgpool.service \ pgpool.spec bin_SCRIPTS = test/pgpool_setup test/watchdog_setup SUBDIRS = parser libs watchdog . tools include all: all-recursive .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) --foreign --ignore-deps src/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign --ignore-deps src/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 main/$(am__dirstamp): @$(MKDIR_P) main @: > main/$(am__dirstamp) main/main.$(OBJEXT): main/$(am__dirstamp) main/pool_globals.$(OBJEXT): main/$(am__dirstamp) main/pgpool_main.$(OBJEXT): main/$(am__dirstamp) main/health_check.$(OBJEXT): main/$(am__dirstamp) config/$(am__dirstamp): @$(MKDIR_P) config @: > config/$(am__dirstamp) config/pool_config.$(OBJEXT): config/$(am__dirstamp) config/pool_config_variables.$(OBJEXT): config/$(am__dirstamp) pcp_con/$(am__dirstamp): @$(MKDIR_P) pcp_con @: > pcp_con/$(am__dirstamp) pcp_con/pcp_child.$(OBJEXT): pcp_con/$(am__dirstamp) pcp_con/pcp_worker.$(OBJEXT): pcp_con/$(am__dirstamp) pcp_con/recovery.$(OBJEXT): pcp_con/$(am__dirstamp) auth/$(am__dirstamp): @$(MKDIR_P) auth @: > auth/$(am__dirstamp) auth/md5.$(OBJEXT): auth/$(am__dirstamp) auth/pool_auth.$(OBJEXT): auth/$(am__dirstamp) auth/pool_passwd.$(OBJEXT): auth/$(am__dirstamp) auth/pool_hba.$(OBJEXT): auth/$(am__dirstamp) auth/auth-scram.$(OBJEXT): auth/$(am__dirstamp) protocol/$(am__dirstamp): @$(MKDIR_P) protocol @: > protocol/$(am__dirstamp) protocol/pool_proto2.$(OBJEXT): protocol/$(am__dirstamp) protocol/child.$(OBJEXT): protocol/$(am__dirstamp) protocol/pool_process_query.$(OBJEXT): protocol/$(am__dirstamp) protocol/pool_connection_pool.$(OBJEXT): protocol/$(am__dirstamp) protocol/pool_proto_modules.$(OBJEXT): protocol/$(am__dirstamp) query_cache/$(am__dirstamp): @$(MKDIR_P) query_cache @: > query_cache/$(am__dirstamp) query_cache/pool_memqcache.$(OBJEXT): query_cache/$(am__dirstamp) protocol/CommandComplete.$(OBJEXT): protocol/$(am__dirstamp) context/$(am__dirstamp): @$(MKDIR_P) context @: > context/$(am__dirstamp) context/pool_session_context.$(OBJEXT): context/$(am__dirstamp) context/pool_process_context.$(OBJEXT): context/$(am__dirstamp) context/pool_query_context.$(OBJEXT): context/$(am__dirstamp) streaming_replication/$(am__dirstamp): @$(MKDIR_P) streaming_replication @: > streaming_replication/$(am__dirstamp) streaming_replication/pool_worker_child.$(OBJEXT): \ streaming_replication/$(am__dirstamp) rewrite/$(am__dirstamp): @$(MKDIR_P) rewrite @: > rewrite/$(am__dirstamp) rewrite/pool_timestamp.$(OBJEXT): rewrite/$(am__dirstamp) rewrite/pool_lobj.$(OBJEXT): rewrite/$(am__dirstamp) utils/$(am__dirstamp): @$(MKDIR_P) utils @: > utils/$(am__dirstamp) utils/pool_select_walker.$(OBJEXT): utils/$(am__dirstamp) utils/strlcpy.$(OBJEXT): utils/$(am__dirstamp) utils/psprintf.$(OBJEXT): utils/$(am__dirstamp) utils/pool_params.$(OBJEXT): utils/$(am__dirstamp) utils/ps_status.$(OBJEXT): utils/$(am__dirstamp) utils/pool_shmem.$(OBJEXT): utils/$(am__dirstamp) utils/pool_sema.$(OBJEXT): utils/$(am__dirstamp) utils/pool_signal.$(OBJEXT): utils/$(am__dirstamp) utils/pool_path.$(OBJEXT): utils/$(am__dirstamp) utils/pool_ip.$(OBJEXT): utils/$(am__dirstamp) utils/pool_relcache.$(OBJEXT): utils/$(am__dirstamp) utils/pool_process_reporting.$(OBJEXT): utils/$(am__dirstamp) utils/pool_ssl.$(OBJEXT): utils/$(am__dirstamp) utils/pool_stream.$(OBJEXT): utils/$(am__dirstamp) utils/getopt_long.$(OBJEXT): utils/$(am__dirstamp) utils/mmgr/$(am__dirstamp): @$(MKDIR_P) utils/mmgr @: > utils/mmgr/$(am__dirstamp) utils/mmgr/mcxt.$(OBJEXT): utils/mmgr/$(am__dirstamp) utils/mmgr/aset.$(OBJEXT): utils/mmgr/$(am__dirstamp) utils/error/$(am__dirstamp): @$(MKDIR_P) utils/error @: > utils/error/$(am__dirstamp) utils/error/elog.$(OBJEXT): utils/error/$(am__dirstamp) utils/error/assert.$(OBJEXT): utils/error/$(am__dirstamp) utils/pcp/$(am__dirstamp): @$(MKDIR_P) utils/pcp @: > utils/pcp/$(am__dirstamp) utils/pcp/pcp_stream.$(OBJEXT): utils/pcp/$(am__dirstamp) utils/regex_array.$(OBJEXT): utils/$(am__dirstamp) utils/json_writer.$(OBJEXT): utils/$(am__dirstamp) utils/json.$(OBJEXT): utils/$(am__dirstamp) utils/scram-common.$(OBJEXT): utils/$(am__dirstamp) utils/base64.$(OBJEXT): utils/$(am__dirstamp) utils/sha2.$(OBJEXT): utils/$(am__dirstamp) utils/ssl_utils.$(OBJEXT): utils/$(am__dirstamp) utils/statistics.$(OBJEXT): utils/$(am__dirstamp) pgpool$(EXEEXT): $(pgpool_OBJECTS) $(pgpool_DEPENDENCIES) $(EXTRA_pgpool_DEPENDENCIES) @rm -f pgpool$(EXEEXT) $(AM_V_CCLD)$(pgpool_LINK) $(pgpool_OBJECTS) $(pgpool_LDADD) $(LIBS) install-binSCRIPTS: $(bin_SCRIPTS) @$(NORMAL_INSTALL) @list='$(bin_SCRIPTS)'; 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 \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n' \ -e 'h;s|.*|.|' \ -e 'p;x;s,.*/,,;$(transform)' | 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; \ if (++n[d] == $(am__install_max)) { \ print "f", d, files[d]; n[d] = 0; files[d] = "" } } \ else { print "f", d "/" $$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_SCRIPT) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binSCRIPTS: @$(NORMAL_UNINSTALL) @list='$(bin_SCRIPTS)'; test -n "$(bindir)" || exit 0; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 's,.*/,,;$(transform)'`; \ dir='$(DESTDIR)$(bindir)'; $(am__uninstall_files_from_dir) mostlyclean-compile: -rm -f *.$(OBJEXT) -rm -f auth/*.$(OBJEXT) -rm -f config/*.$(OBJEXT) -rm -f context/*.$(OBJEXT) -rm -f main/*.$(OBJEXT) -rm -f pcp_con/*.$(OBJEXT) -rm -f protocol/*.$(OBJEXT) -rm -f query_cache/*.$(OBJEXT) -rm -f rewrite/*.$(OBJEXT) -rm -f streaming_replication/*.$(OBJEXT) -rm -f utils/*.$(OBJEXT) -rm -f utils/error/*.$(OBJEXT) -rm -f utils/mmgr/*.$(OBJEXT) -rm -f utils/pcp/*.$(OBJEXT) distclean-compile: -rm -f *.tab.c .c.o: $(AM_V_CC)$(COMPILE) -c -o $@ $< .c.obj: $(AM_V_CC)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: $(AM_V_CC)$(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 install-pkgdataDATA: $(pkgdata_DATA) @$(NORMAL_INSTALL) @list='$(pkgdata_DATA)'; test -n "$(pkgdatadir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(pkgdatadir)'"; \ $(MKDIR_P) "$(DESTDIR)$(pkgdatadir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pkgdatadir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(pkgdatadir)" || exit $$?; \ done uninstall-pkgdataDATA: @$(NORMAL_UNINSTALL) @list='$(pkgdata_DATA)'; test -n "$(pkgdatadir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(pkgdatadir)'; $(am__uninstall_files_from_dir) install-sysconfDATA: $(sysconf_DATA) @$(NORMAL_INSTALL) @list='$(sysconf_DATA)'; test -n "$(sysconfdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(sysconfdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(sysconfdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(sysconfdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(sysconfdir)" || exit $$?; \ done uninstall-sysconfDATA: @$(NORMAL_UNINSTALL) @list='$(sysconf_DATA)'; test -n "$(sysconfdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(sysconfdir)'; $(am__uninstall_files_from_dir) # 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 $(PROGRAMS) $(SCRIPTS) $(DATA) installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(pkgdatadir)" "$(DESTDIR)$(sysconfdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done 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) -rm -f auth/$(am__dirstamp) -rm -f config/$(am__dirstamp) -rm -f context/$(am__dirstamp) -rm -f main/$(am__dirstamp) -rm -f pcp_con/$(am__dirstamp) -rm -f protocol/$(am__dirstamp) -rm -f query_cache/$(am__dirstamp) -rm -f rewrite/$(am__dirstamp) -rm -f streaming_replication/$(am__dirstamp) -rm -f utils/$(am__dirstamp) -rm -f utils/error/$(am__dirstamp) -rm -f utils/mmgr/$(am__dirstamp) -rm -f utils/pcp/$(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 config/pool_config.c clean: clean-recursive clean-am: clean-binPROGRAMS clean-generic clean-libtool clean-local \ mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-pkgdataDATA install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-binPROGRAMS install-binSCRIPTS \ install-sysconfDATA 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-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-binPROGRAMS uninstall-binSCRIPTS \ uninstall-pkgdataDATA uninstall-sysconfDATA .MAKE: $(am__recursive_targets) install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ check-am clean clean-binPROGRAMS clean-generic clean-libtool \ clean-local 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-binSCRIPTS \ 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-pkgdataDATA install-ps install-ps-am \ install-strip install-sysconfDATA installcheck installcheck-am \ installdirs installdirs-am 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 \ uninstall-binSCRIPTS uninstall-pkgdataDATA \ uninstall-sysconfDATA %: %.in sed -e 's#[@][@]PGPOOL_INSTALL_DIR[@][@]#$(prefix)#g' \ -e 's#[@][@]PGPOOL_CONFIG_DIR[@][@]#$(sysconfdir)#g' \ -e 's#[@][@]PGSQL_BIN_DIR[@][@]#$(PGSQL_BIN_DIR)#g' \ -e 's#[@][@]PGSQL_LIB_DIR[@][@]#$(PGSQL_LIB_DIR)#g' $^ > $@ chmod +x $@ clean-local: -rm -f test/pgpool_setup test/watchdog_setup # 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-4.1.4/src/Makefile.am0000664000175000017500000001426013730350127013071 00000000000000AUTOMAKE_OPTIONS = subdir-objects libs_dir = $(top_srcdir)/src/libs AM_CPPFLAGS = -D_GNU_SOURCE -I @PGSQL_INCLUDE_DIR@ bin_PROGRAMS = pgpool HEALTHCHECK_DEBUG=0 pgpool_SOURCES = main/main.c \ main/pool_globals.c \ main/pgpool_main.c \ main/health_check.c \ config/pool_config.l \ config/pool_config_variables.c \ pcp_con/pcp_child.c \ pcp_con/pcp_worker.c \ pcp_con/recovery.c \ auth/md5.c \ auth/pool_auth.c \ auth/pool_passwd.c \ auth/pool_hba.c \ auth/auth-scram.c \ protocol/pool_proto2.c \ protocol/child.c \ protocol/pool_process_query.c \ protocol/pool_connection_pool.c \ protocol/pool_proto_modules.c \ query_cache/pool_memqcache.c \ protocol/CommandComplete.c \ context/pool_session_context.c \ context/pool_process_context.c \ context/pool_query_context.c \ streaming_replication/pool_worker_child.c \ rewrite/pool_timestamp.c \ rewrite/pool_lobj.c \ utils/pool_select_walker.c \ utils/strlcpy.c \ utils/psprintf.c \ utils/pool_params.c \ utils/ps_status.c \ utils/pool_shmem.c \ utils/pool_sema.c \ utils/pool_signal.c \ utils/pool_path.c \ utils/pool_ip.c \ utils/pool_relcache.c \ utils/pool_process_reporting.c \ utils/pool_ssl.c \ utils/pool_stream.c \ utils/getopt_long.c \ utils/mmgr/mcxt.c \ utils/mmgr/aset.c \ utils/error/elog.c \ utils/error/assert.c \ utils/pcp/pcp_stream.c \ utils/regex_array.c \ utils/json_writer.c \ utils/json.c \ utils/scram-common.c \ utils/base64.c \ utils/sha2.c \ utils/ssl_utils.c \ utils/statistics.c DEFS = @DEFS@ \ -DDEFAULT_CONFIGDIR=\"$(sysconfdir)\" \ -DHEALTHCHECK_OPTS=$(HEALTHCHECK_DEBUG) sysconf_DATA = sample/pgpool.conf.sample \ sample/pcp.conf.sample \ sample/pool_hba.conf.sample \ sample/pgpool.conf.sample-replication \ sample/pgpool.conf.sample-master-slave \ sample/pgpool.conf.sample-stream \ sample/pgpool.conf.sample-logical \ sample/scripts/failover.sh.sample \ sample/scripts/follow_master.sh.sample \ sample/scripts/pgpool_remote_start.sample \ sample/scripts/recovery_1st_stage.sample \ sample/scripts/recovery_2nd_stage.sample pkgdata_DATA = sql/insert_lock.sql \ sample/pgpool.pam # suggested by libtoolize #ACLOCAL_AMFLAGS = -I m4 pgpool_LDADD = -L@PGSQL_LIB_DIR@ -lpq parser/libsql-parser.a \ parser/nodes.o \ watchdog/lib-watchdog.a \ -lpthread if enable_rpath pgpool_LDFLAGS = -rpath @PGSQL_LIB_DIR@ -rpath $(libdir) else pgpool_LDFLAGS = endif AM_YFLAGS = -d EXTRA_DIST = sample/pgpool.pam \ sample/scripts/failover.sh.sample \ sample/scripts/follow_master.sh.sample \ sample/scripts/pgpool_remote_start.sample \ sample/scripts/recovery_1st_stage.sample \ sample/scripts/recovery_2nd_stage.sample \ sample/pgpool.conf.sample sample/pool_hba.conf.sample \ sample/pgpool.conf.sample-replication sample/pgpool.conf.sample-master-slave \ sample/pgpool.conf.sample-stream sample/pgpool.conf.sample-logical sample/pcp.conf.sample \ sql/Makefile \ sql/insert_lock.sql \ sql/pgpool-recovery/pgpool-recovery.c \ sql/pgpool-recovery/pgpool-recovery.sql.in \ sql/pgpool-recovery/uninstall_pgpool-recovery.sql \ sql/pgpool-recovery/pgpool_recovery--1.3.sql \ sql/pgpool-recovery/pgpool_recovery--1.2--1.3.sql \ sql/pgpool-recovery/pgpool_recovery--1.2.sql \ sql/pgpool-recovery/pgpool_recovery--1.1--1.2.sql \ sql/pgpool-recovery/pgpool_recovery--1.1.sql \ sql/pgpool-recovery/pgpool_recovery.control \ sql/pgpool-recovery/Makefile \ sql/pgpool-regclass/pgpool-regclass.c \ sql/pgpool-regclass/pgpool-regclass.sql.in \ sql/pgpool-regclass/uninstall_pgpool-regclass.sql \ sql/pgpool-regclass/pgpool_regclass--1.0.sql \ sql/pgpool-regclass/pgpool_regclass.control \ sql/pgpool-regclass/Makefile \ sql/pgpool_adm/pgpool_adm.c \ sql/pgpool_adm/pgpool_adm.h \ sql/pgpool_adm/pgpool_adm.control \ sql/pgpool_adm/pgpool_adm--1.1.sql \ sql/pgpool_adm/pgpool_adm--1.0--1.1.sql \ sql/pgpool_adm/pgpool_adm--1.0.sql \ sql/pgpool_adm/pgpool_adm--1.2.sql \ sql/pgpool_adm/pgpool_adm--1.1--1.2.sql \ sql/pgpool_adm/Makefile \ test/parser/expected/copy.out test/parser/expected/create.out \ test/parser/expected/cursor.out test/parser/expected/delete.out \ test/parser/expected/drop.out test/parser/expected/insert.out \ test/parser/expected/misc.out test/parser/expected/prepare.out \ test/parser/expected/privileges.out test/parser/expected/scanner.out \ test/parser/expected/select.out \ test/parser/expected/transaction.out test/parser/expected/update.out \ test/parser/expected/v84.out test/parser/expected/v90.out \ test/parser/expected/var.out \ test/parser/input/alter.sql \ test/parser/input/copy.sql test/parser/input/create.sql \ test/parser/input/cursor.sql test/parser/input/delete.sql \ test/parser/input/drop.sql test/parser/input/insert.sql \ test/parser/input/misc.sql test/parser/input/prepare.sql \ test/parser/input/privileges.sql test/parser/input/scanner.sql \ test/parser/input/select.sql \ test/parser/input/transaction.sql test/parser/input/update.sql \ test/parser/input/v84.sql test/parser/input/v90.sql \ test/parser/input/var.sql \ test/parser/.cvsignore test/parser/Makefile \ test/parser/README test/parser/main.c \ test/parser/pool.h test/parser/run-test \ test/parser/parse_schedule \ test/C/Makefile test/C/test_extended.c \ test/pdo-test/README.euc_jp test/pdo-test/collections.inc test/pdo-test/def.inc \ test/pdo-test/pdotest.php test/pdo-test/regsql.inc \ test/pdo-test/SQLlist/test1.sql test/pdo-test/SQLlist/test2.sql \ test/pdo-test/mod/database.inc test/pdo-test/mod/errorhandler.inc \ test/pgpool_setup.in test/watchdog_setup.in test/regression \ redhat/pgpool.init \ redhat/pgpool_rhel.sysconfig redhat/pgpool_rhel6.sysconfig \ redhat/pgpool.conf.sample.patch \ redhat/pgpool.service \ pgpool.spec bin_SCRIPTS = test/pgpool_setup test/watchdog_setup %: %.in sed -e 's#[@][@]PGPOOL_INSTALL_DIR[@][@]#$(prefix)#g' \ -e 's#[@][@]PGPOOL_CONFIG_DIR[@][@]#$(sysconfdir)#g' \ -e 's#[@][@]PGSQL_BIN_DIR[@][@]#$(PGSQL_BIN_DIR)#g' \ -e 's#[@][@]PGSQL_LIB_DIR[@][@]#$(PGSQL_LIB_DIR)#g' $^ > $@ chmod +x $@ clean-local: -rm -f test/pgpool_setup test/watchdog_setup SUBDIRS = parser libs watchdog . tools include pgpool-II-4.1.4/src/pgpool.spec0000664000175000017500000004014513730350127013212 00000000000000# How to build RPM: # # rpmbuild -ba pgpool.spec --define="pgpool_version 3.4.0" --define="pg_version 93" --define="pghome /usr/pgsql-9.3" --define="dist .rhel6" --define="pgsql_ver 93" # # OR # # rpmbuild -ba pgpool.spec --define="pgpool_version 3.4.0" --define="pg_version 11" --define="pghome /usr/pgsql-11" --define="dist .rhel6" --define="pgsql_ver 110" # # expecting RPM name are: # pgpool-II-pg{pg_version}-{pgpool_version}-{rel}pgdg.rhel{v}.{arch}.rpm # pgpool-II-pg{pg_version}-devel-{pgpool_version}-{rel}pgdg.rhel{v}.{arch}.rpm # pgpool-II-pg{pg_version}-extensions-{pgpool_version}-{rel}pgdg.rhel{v}.{arch}.rpm # pgpool-II-pg{pg_version}-{pgpool_version}-{rel}pgdg.rhel{v}.src.rpm %global short_name pgpool-II %if 0%{rhel} && 0%{rhel} <= 6 %global systemd_enabled 0 %else %global systemd_enabled 1 %endif %global _varrundir %{_localstatedir}/run/pgpool Summary: Pgpool is a connection pooling/replication server for PostgreSQL Name: pgpool-II-pg%{pg_version} Version: %{pgpool_version} Release: 1pgdg%{?dist} License: BSD Group: Applications/Databases Vendor: Pgpool Global Development Group URL: http://www.pgppol.net/ Source0: pgpool-II-%{version}.tar.gz Source1: pgpool.init Source2: pgpool_rhel6.sysconfig %if %{systemd_enabled} Source3: pgpool.service %endif Source4: pgpool_rhel.sysconfig Patch1: pgpool-II-head.patch %if %{pgsql_ver} >=94 && %{rhel} >= 7 Patch2: pgpool_socket_dir.patch Patch3: pcp_unix_domain_path.patch %endif BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: postgresql%{pg_version}-devel pam-devel openssl-devel libmemcached-devel jade libxslt docbook-dtds docbook-style-xsl docbook-style-dsssl %if %{pgsql_ver} >= 110 && %{rhel} == 7 BuildRequires: llvm-toolset-7 llvm-toolset-7-llvm-devel llvm5.0 %endif %if %{pgsql_ver} >= 110 && %{rhel} >= 8 BuildRequires: llvm-devel >= 6.0.0 clang-devel >= 6.0.0 %endif %if %{systemd_enabled} BuildRequires: systemd Requires: systemd Requires(post): systemd-sysv Requires(post): systemd Requires(preun): systemd Requires(postun): systemd %else Requires(post): chkconfig Requires(preun): chkconfig Requires(preun): initscripts Requires(postun): initscripts %endif Obsoletes: postgresql-pgpool # original pgpool archive name %define archive_name pgpool-II-%{version} %description pgpool-II is a inherited project of pgpool (to classify from pgpool-II, it is sometimes called as pgpool-I). For those of you not familiar with pgpool-I, it is a multi-functional middle ware for PostgreSQL that features connection pooling, replication and load balancing functions. pgpool-I allows a user to connect at most two PostgreSQL servers for higher availability or for higher search performance compared to a single PostgreSQL server. %package devel Summary: The development files for pgpool-II Group: Development/Libraries Requires: %{name} = %{version} %description devel Development headers and libraries for pgpool-II. %package extensions Summary: Postgersql extensions for pgpool-II Group: Applications/Databases %description extensions Postgresql extensions libraries and sql files for pgpool-II. %prep %setup -q -n %{archive_name} %patch1 -p1 %if %{pgsql_ver} >=94 && %{rhel} >= 7 %patch2 -p0 %patch3 -p0 %endif %build %configure --with-pgsql=%{pghome} \ --disable-static \ --with-pam \ --with-openssl \ --with-memcached=%{_usr} \ --disable-rpath \ --sysconfdir=%{_sysconfdir}/%{short_name}/ make %{?_smp_mflags} make %{?_smp_mflags} -C doc %install rm -rf %{buildroot} # make pgpool-II export PATH=%{pghome}/bin:$PATH make %{?_smp_mflags} DESTDIR=%{buildroot} install # install to PostgreSQL make %{?_smp_mflags} DESTDIR=%{buildroot} install -C src/sql/pgpool-recovery %if %{pgsql_ver} <= 93 # From PostgreSQL 9.4 pgpool-regclass.so is not needed anymore # because 9.4 or later has to_regclass. make %{?_smp_mflags} DESTDIR=%{buildroot} install -C src/sql/pgpool-regclass %endif make %{?_smp_mflags} DESTDIR=%{buildroot} install -C src/sql/pgpool_adm install -d %{buildroot}%{_datadir}/%{short_name} install -d %{buildroot}%{_sysconfdir}/%{short_name} cp %{buildroot}%{_sysconfdir}/%{short_name}/pcp.conf.sample %{buildroot}%{_sysconfdir}/%{short_name}/pcp.conf cp %{buildroot}%{_sysconfdir}/%{short_name}/pgpool.conf.sample %{buildroot}%{_sysconfdir}/%{short_name}/pgpool.conf cp %{buildroot}%{_sysconfdir}/%{short_name}/pool_hba.conf.sample %{buildroot}%{_sysconfdir}/%{short_name}/pool_hba.conf touch %{buildroot}%{_sysconfdir}/%{short_name}/pool_passwd %if %{systemd_enabled} install -d %{buildroot}%{_unitdir} install -m 644 %{SOURCE3} %{buildroot}%{_unitdir}/pgpool.service mkdir -p %{buildroot}%{_tmpfilesdir} cat > %{buildroot}%{_tmpfilesdir}/%{name}.conf </dev/null 2>&1 || : useradd -M -g postgres -o -r -d /var/lib/pgsql -s /bin/bash \ -c "PostgreSQL Server" -u 26 postgres >/dev/null 2>&1 || : %post /sbin/ldconfig echo 'postgres ALL=NOPASSWD: /sbin/ip' | sudo EDITOR='tee -a' visudo >/dev/null 2>&1 || : echo 'postgres ALL=NOPASSWD: /usr/sbin/arping' | sudo EDITOR='tee -a' visudo >/dev/null 2>&1 || : %if %{systemd_enabled} %systemd_post pgpool.service %tmpfiles_create %else /sbin/chkconfig --add pgpool %endif %preun %if %{systemd_enabled} %systemd_preun pgpool.service %else if [ $1 = 0 ] ; then /sbin/service pgpool condstop >/dev/null 2>&1 chkconfig --del pgpool fi %endif %postun /sbin/ldconfig %if %{systemd_enabled} %systemd_postun_with_restart pgpool.service %triggerun -- pgpool < 3.1-1 # Save the current service runlevel info # User must manually run systemd-sysv-convert --apply pgpool # to migrate them to systemd targets /usr/bin/systemd-sysv-convert --save pgpool >/dev/null 2>&1 ||: # Run these because the SysV package being removed won't do them /sbin/chkconfig --del pgpool >/dev/null 2>&1 || : /bin/systemctl try-restart pgpool.service >/dev/null 2>&1 || : %else if [ $1 -ge 1 ] ; then /sbin/service pgpool condrestart >/dev/null 2>&1 || : fi %endif %files %defattr(-,root,root,-) %dir %{_datadir}/%{short_name} %doc README TODO COPYING INSTALL AUTHORS ChangeLog html %{_bindir}/pgpool %{_bindir}/pcp_attach_node %{_bindir}/pcp_detach_node %{_bindir}/pcp_node_count %{_bindir}/pcp_node_info %{_bindir}/pcp_pool_status %{_bindir}/pcp_proc_count %{_bindir}/pcp_proc_info %{_bindir}/pcp_promote_node %{_bindir}/pcp_stop_pgpool %{_bindir}/pcp_recovery_node %{_bindir}/pcp_watchdog_info %{_bindir}/pg_md5 %{_bindir}/pg_enc %{_bindir}/pgpool_setup %{_bindir}/watchdog_setup %{_bindir}/pgproto %{_mandir}/man8/*.8.gz %{_mandir}/man1/*.1.gz %{_datadir}/%{short_name}/insert_lock.sql %{_datadir}/%{short_name}/pgpool.pam %{_libdir}/libpcp.so.* %if %{systemd_enabled} %ghost %{_varrundir} %{_tmpfilesdir}/%{name}.conf %{_unitdir}/pgpool.service %else %{_initrddir}/pgpool %endif %defattr(600,postgres,postgres,-) %{_sysconfdir}/%{short_name}/pgpool.conf.sample %{_sysconfdir}/%{short_name}/pgpool.conf.sample-master-slave %{_sysconfdir}/%{short_name}/pgpool.conf.sample-replication %{_sysconfdir}/%{short_name}/pgpool.conf.sample-stream %{_sysconfdir}/%{short_name}/pgpool.conf.sample-logical %{_sysconfdir}/%{short_name}/pcp.conf.sample %{_sysconfdir}/%{short_name}/pool_hba.conf.sample %defattr(755,postgres,postgres,-) %{_sysconfdir}/%{short_name}/failover.sh.sample %{_sysconfdir}/%{short_name}/follow_master.sh.sample %{_sysconfdir}/%{short_name}/pgpool_remote_start.sample %{_sysconfdir}/%{short_name}/recovery_1st_stage.sample %{_sysconfdir}/%{short_name}/recovery_2nd_stage.sample %attr(600,postgres,postgres) %config(noreplace) %{_sysconfdir}/%{short_name}/*.conf %attr(600,postgres,postgres) %config(noreplace) %{_sysconfdir}/%{short_name}/pool_passwd %config(noreplace) %{_sysconfdir}/sysconfig/pgpool %files devel %defattr(-,root,root,-) %{_includedir}/libpcp_ext.h %{_includedir}/pcp.h %{_includedir}/pool_process_reporting.h %{_includedir}/pool_type.h %{_libdir}/libpcp.so %files extensions %defattr(-,root,root,-) %{pghome}/share/extension/pgpool-recovery.sql %{pghome}/share/extension/pgpool_recovery--1.1.sql %{pghome}/share/extension/pgpool_recovery--1.2.sql %{pghome}/share/extension/pgpool_recovery--1.1--1.2.sql %{pghome}/share/extension/pgpool_recovery--1.3.sql %{pghome}/share/extension/pgpool_recovery--1.2--1.3.sql %{pghome}/share/extension/pgpool_recovery.control %{pghome}/lib/pgpool-recovery.so %{pghome}/share/extension/pgpool_adm--1.0.sql %{pghome}/share/extension/pgpool_adm--1.1.sql %{pghome}/share/extension/pgpool_adm--1.0--1.1.sql %{pghome}/share/extension/pgpool_adm--1.2.sql %{pghome}/share/extension/pgpool_adm--1.1--1.2.sql %{pghome}/share/extension/pgpool_adm.control %{pghome}/lib/pgpool_adm.so # From PostgreSQL 9.4 pgpool-regclass.so is not needed anymore # because 9.4 or later has to_regclass. %if %{pgsql_ver} <= 93 %{pghome}/share/extension/pgpool_regclass--1.0.sql %{pghome}/share/extension/pgpool_regclass.control %{pghome}/share/extension/pgpool-regclass.sql %{pghome}/lib/pgpool-regclass.so %endif # From PostgerSQL 11 the relevant files have to be installed # into $pkglibdir/bitcode/ %if %{pgsql_ver} >= 110 && %{rhel} >= 7 %{pghome}/lib/bitcode/pgpool-recovery.index.bc %{pghome}/lib/bitcode/pgpool-recovery/pgpool-recovery.bc %{pghome}/lib/bitcode/pgpool_adm.index.bc %{pghome}/lib/bitcode/pgpool_adm/pgpool_adm.bc %endif %changelog * Mon Jul 27 2020 Bo Peng 4.1.3 - Rename src/redhat/pgpool_rhel7.sysconfig to src/redhat/pgpool_rhel.sysconfig. * Thu Oct 10 2019 Bo Peng 4.1.0 - Update to support PostgreSQL 12 * Thu Sep 5 2019 Bo Peng 4.1.0 - Add sample scripts * Wed Sep 19 2018 Bo Peng 4.0.0 - Update to 4.0 * Tue Oct 17 2017 Bo Peng 3.7.0 - Update to 4.0 * Tue Nov 22 2016 Bo Peng 3.6.0 - Update to 3.6.0 * Mon Dec 28 2015 Yugo Nagata 3.5.0 - Add Chinese document * Mon Aug 24 2015 Yugo Nagata 3.5.0 - Remove system database * Tue Feb 10 2015 Nozomi Anzai 3.4.1-2 - Fix %tmpfiles_create to not be executed in RHEL/CentOS 6 * Wed Jan 28 2015 Nozomi Anzai 3.4.1 - Fix typo of %{_smp_mflags} - Change to use systemd if it is available * Sat Dec 20 2014 Tatsuo Ishii 3.4.0-3 - Fix "error: Installed (but unpackaged) file(s) found" * Fri Nov 21 2014 Tatsuo Ishii 3.4.0-2 - Re-enable to apply difference from HEAD patch. * Tue Nov 18 2014 Yugo Nagata 3.4.0-2 - Rename RPM filename to include RHEL version no. * Tue Nov 11 2014 Tatsuo Ishii 3.4.0-2 - Add memcached support to configure. * Tue Oct 21 2014 Tatsuo Ishii 3.4beta2 - Adopt to PostgreSQL 9.4 * Thu Sep 25 2014 Tatsuo Ishii 3.3.4-2 - Split pgpool_regclass and pgpool_recovery as a separate extention package. - Fix wrong OpenSSL build option. * Fri Sep 5 2014 Yugo Nagata 3.3.4-1 - Update to 3.3.4 * Wed Jul 30 2014 Tatsuo Ishii 3.3.3-4 - Add PATCH2 which is diff between 3.3.3 and 3.3-stable tree head. - RPM expert said this is the better way. * Sat May 10 2014 Tatsuo Ishii 3.3.3-3 - Use 3.3-stable tree head * Sun May 4 2014 Tatsuo Ishii 3.3.3-2 - Fix configure option - Add openssl support * Tue Nov 26 2013 Nozomi Anzai 3.3.1-1 - Improved to specify the versions of pgool-II and PostgreSQL * Mon May 13 2013 Nozomi Anzai 3.3.0-1 - Update to 3.3.0 - Change to install pgpool-recovery, pgpool-regclass to PostgreSQL * Tue Nov 3 2009 Devrim Gunduz 2.2.5-3 - Remove init script from all runlevels before uninstall. Per #RH Bugzilla 532177 * Mon Oct 5 2009 Devrim Gunduz 2.2.5-2 - Add 2 new docs, per Tatsuo. * Sun Oct 4 2009 Devrim Gunduz 2.2.5-1 - Update to 2.2.5, for various fixes described at http://lists.pgfoundry.org/pipermail/pgpool-general/2009-October/002188.html - Re-apply a fix for Red Hat Bugzilla #442372 * Wed Sep 9 2009 Devrim Gunduz 2.2.4-1 - Update to 2.2.4 * Wed May 6 2009 Devrim Gunduz 2.2.2-1 - Update to 2.2.2 * Sun Mar 1 2009 Devrim Gunduz 2.2-1 - Update to 2.2 - Fix URL - Own /usr/share/pgpool-II directory. - Fix pid file path in init script, per pgcore #81. - Fix spec file -- we don't use short_name macro in pgcore spec file. - Create pgpool pid file directory, per pgcore #81. - Fix stop/start routines, also improve init script a bit. - Install conf files to a new directory (/etc/pgpool-II), and get rid of sample conf files. * Fri Aug 8 2008 Devrim Gunduz 2.1-1 - Update to 2.1 - Removed temp patch #4. * Sun Jan 13 2008 Devrim Gunduz 2.0.1-1 - Update to 2.0.1 - Add a temp patch that will disappear in 2.0.2 * Fri Oct 5 2007 Devrim Gunduz 1.2.1-1 - Update to 1.2.1 * Wed Aug 29 2007 Devrim Gunduz 1.2-5 - Chmod sysconfig/pgpool to 644, not 755. Per BZ review. - Run chkconfig --add pgpool during %%post. * Thu Aug 16 2007 Devrim Gunduz 1.2-4 - Fixed the directory name where sample conf files and sql files are installed. * Sun Aug 5 2007 Devrim Gunduz 1.2-3 - Added a patch for sample conf file to use Fedora defaults * Sun Aug 5 2007 Devrim Gunduz 1.2-2 - Added an init script for pgpool - Added /etc/sysconfig/pgpool * Wed Aug 1 2007 Devrim Gunduz 1.2-1 - Update to 1.2 * Fri Jun 15 2007 Devrim Gunduz 1.1.1-1 - Update to 1.1.1 * Sat Jun 2 2007 Devrim Gunduz 1.1-1 - Update to 1.1 - added --disable-rpath configure parameter. - Chowned sample conf files, so that they can work with pgpoolAdmin. * Sun Apr 22 2007 Devrim Gunduz 1.0.2-4 - Added postgresql-devel as BR, per bugzilla review. - Added --disable-static flan, per bugzilla review. - Removed superfluous manual file installs, per bugzilla review. * Sun Apr 22 2007 Devrim Gunduz 1.0.2-3 - Rebuilt for the correct tarball - Fixed man8 file ownership, per bugzilla review #229321 * Tue Feb 20 2007 Jarod Wilson 1.0.2-2 - Create proper devel package, drop -libs package - Nuke rpath - Don't install libtool archive and static lib - Clean up %%configure line - Use proper %%_smp_mflags - Install config files properly, without .sample on the end - Preserve timestamps on header files * Tue Feb 20 2007 Devrim Gunduz 1.0.2-1 - Update to 1.0.2-1 * Mon Oct 02 2006 Devrim Gunduz 1.0.1-5 - Rebuilt * Mon Oct 02 2006 Devrim Gunduz 1.0.1-4 - Added -libs and RPM - Fix .so link problem - Cosmetic changes to spec file * Wed Sep 27 2006 - Devrim GUNDUZ 1.0.1-3 - Fix spec, per Yoshiyuki Asaba * Tue Sep 26 2006 - Devrim GUNDUZ 1.0.1-2 - Fixed rpmlint errors - Fixed download url - Added ldconfig for .so files * Thu Sep 21 2006 - David Fetter 1.0.1-1 - Initial build pgpool-II 1.0.1 for PgPool Global Development Group pgpool-II-4.1.4/src/parser/0000775000175000017500000000000013730350746012415 500000000000000pgpool-II-4.1.4/src/parser/Makefile.in0000664000175000017500000004775413730350075014416 00000000000000# Makefile.in generated by automake 1.13.4 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@ @use_repl_snprintf_TRUE@am__append_1 = snprintf.c subdir = src/parser DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(top_srcdir)/mkinstalldirs gram.h gram.c gram_minimal.h \ gram_minimal.c $(top_srcdir)/ylwrap README ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/docbook.m4 \ $(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 = LIBRARIES = $(noinst_LIBRARIES) AM_V_AR = $(am__v_AR_@AM_V@) am__v_AR_ = $(am__v_AR_@AM_DEFAULT_V@) am__v_AR_0 = @echo " AR " $@; am__v_AR_1 = libsql_parser_a_AR = $(AR) $(ARFLAGS) libsql_parser_a_LIBADD = am__libsql_parser_a_SOURCES_DIST = copyfuncs.c gram.y gram_minimal.y \ keywords.c kwlookup.c list.c makefuncs.c nodes.c outfuncs.c \ parser.c pool_string.c scansup.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 scan.c snprintf.c am__dirstamp = $(am__leading_dot)dirstamp @use_repl_snprintf_TRUE@am__objects_1 = snprintf.$(OBJEXT) am_libsql_parser_a_OBJECTS = copyfuncs.$(OBJEXT) gram.$(OBJEXT) \ gram_minimal.$(OBJEXT) keywords.$(OBJEXT) kwlookup.$(OBJEXT) \ list.$(OBJEXT) makefuncs.$(OBJEXT) nodes.$(OBJEXT) \ outfuncs.$(OBJEXT) parser.$(OBJEXT) pool_string.$(OBJEXT) \ scansup.$(OBJEXT) stringinfo.$(OBJEXT) value.$(OBJEXT) \ $(top_srcdir)/src/utils/mmgr/mcxt.$(OBJEXT) \ $(top_srcdir)/src/utils/mmgr/aset.$(OBJEXT) \ $(top_srcdir)/src/utils/error/elog.$(OBJEXT) wchar.$(OBJEXT) \ scan.$(OBJEXT) $(am__objects_1) libsql_parser_a_OBJECTS = $(am_libsql_parser_a_OBJECTS) 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 = am__depfiles_maybe = COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) 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 = 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__skipyacc = test -f $@ || am__yacc_c2h = sed -e s/cc$$/hh/ -e s/cpp$$/hpp/ -e s/cxx$$/hxx/ \ -e s/c++$$/h++/ -e s/c$$/h/ YACCCOMPILE = $(YACC) $(AM_YFLAGS) $(YFLAGS) LTYACCCOMPILE = $(LIBTOOL) $(AM_V_lt) $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(YACC) $(AM_YFLAGS) $(YFLAGS) AM_V_YACC = $(am__v_YACC_@AM_V@) am__v_YACC_ = $(am__v_YACC_@AM_DEFAULT_V@) am__v_YACC_0 = @echo " YACC " $@; am__v_YACC_1 = YLWRAP = $(top_srcdir)/ylwrap SOURCES = $(libsql_parser_a_SOURCES) DIST_SOURCES = $(am__libsql_parser_a_SOURCES_DIST) 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@ CATALOG = @CATALOG@ CC = @CC@ CFLAGS = @CFLAGS@ COLLATEINDEX = @COLLATEINDEX@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DLLTOOL = @DLLTOOL@ DOCBOOKSTYLE = @DOCBOOKSTYLE@ 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@ JADE = @JADE@ 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@ LYNX = @LYNX@ 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@ NSGMLS = @NSGMLS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OSX = @OSX@ 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@ PERL = @PERL@ PGCONFIG = @PGCONFIG@ PGSQL_BIN_DIR = @PGSQL_BIN_DIR@ PGSQL_INCLUDE_DIR = @PGSQL_INCLUDE_DIR@ PGSQL_LIB_DIR = @PGSQL_LIB_DIR@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ STYLE = @STYLE@ SUNIFDEF = @SUNIFDEF@ VERSION = @VERSION@ XMLLINT = @XMLLINT@ XSLTPROC = @XSLTPROC@ XSLTPROC_HTML_FLAGS = @XSLTPROC_HTML_FLAGS@ 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__leading_dot = @am__leading_dot@ 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@ have_docbook = @have_docbook@ 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@ parser_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 gram_minimal.y keywords.c \ kwlookup.c list.c makefuncs.c nodes.c outfuncs.c parser.c \ pool_string.c scansup.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 scan.c \ $(am__append_1) EXTRA_DIST = scan.c scan.l ARFLAGS = cr AM_YFLAGS = -d all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj .y $(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) --foreign --ignore-deps src/parser/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign --ignore-deps src/parser/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): clean-noinstLIBRARIES: -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) gram.h: gram.c @if test ! -f $@; then rm -f gram.c; else :; fi @if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) gram.c; else :; fi gram_minimal.h: gram_minimal.c @if test ! -f $@; then rm -f gram_minimal.c; else :; fi @if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) gram_minimal.c; else :; fi $(top_srcdir)/src/utils/mmgr/$(am__dirstamp): @$(MKDIR_P) $(top_srcdir)/src/utils/mmgr @: > $(top_srcdir)/src/utils/mmgr/$(am__dirstamp) $(top_srcdir)/src/utils/mmgr/mcxt.$(OBJEXT): \ $(top_srcdir)/src/utils/mmgr/$(am__dirstamp) $(top_srcdir)/src/utils/mmgr/aset.$(OBJEXT): \ $(top_srcdir)/src/utils/mmgr/$(am__dirstamp) $(top_srcdir)/src/utils/error/$(am__dirstamp): @$(MKDIR_P) $(top_srcdir)/src/utils/error @: > $(top_srcdir)/src/utils/error/$(am__dirstamp) $(top_srcdir)/src/utils/error/elog.$(OBJEXT): \ $(top_srcdir)/src/utils/error/$(am__dirstamp) libsql-parser.a: $(libsql_parser_a_OBJECTS) $(libsql_parser_a_DEPENDENCIES) $(EXTRA_libsql_parser_a_DEPENDENCIES) $(AM_V_at)-rm -f libsql-parser.a $(AM_V_AR)$(libsql_parser_a_AR) libsql-parser.a $(libsql_parser_a_OBJECTS) $(libsql_parser_a_LIBADD) $(AM_V_at)$(RANLIB) libsql-parser.a mostlyclean-compile: -rm -f *.$(OBJEXT) -rm -f $(top_srcdir)/src/utils/error/*.$(OBJEXT) -rm -f $(top_srcdir)/src/utils/mmgr/*.$(OBJEXT) distclean-compile: -rm -f *.tab.c .c.o: $(AM_V_CC)$(COMPILE) -c -o $@ $< .c.obj: $(AM_V_CC)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: $(AM_V_CC)$(LTCOMPILE) -c -o $@ $< .y.c: $(AM_V_YACC)$(am__skipyacc) $(SHELL) $(YLWRAP) $< y.tab.c $@ y.tab.h `echo $@ | $(am__yacc_c2h)` y.output $*.output -- $(YACCCOMPILE) 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 $(LIBRARIES) installdirs: 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) -test -z "$(top_srcdir)/src/utils/error/$(am__dirstamp)" || rm -f $(top_srcdir)/src/utils/error/$(am__dirstamp) -test -z "$(top_srcdir)/src/utils/mmgr/$(am__dirstamp)" || rm -f $(top_srcdir)/src/utils/mmgr/$(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 gram.c -rm -f gram.h -rm -f gram_minimal.c -rm -f gram_minimal.h clean: clean-am clean-am: clean-generic clean-libtool clean-noinstLIBRARIES \ mostlyclean-am distclean: distclean-am -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-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 -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: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLIBRARIES 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-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 gram.c: gram.y scan.c gram_minimal.c: gram_minimal.y scan.c scan.c: scan.l $(LEX) -o'scan.c' $< generate_parsers: gram_template.y $(SUNIFDEF) --undef pgpool_minimal_parser gram_template.y > gram.y||: $(SUNIFDEF) --define pgpool_minimal_parser gram_template.y > gram_minimal.y||: .PHONY: generate_parsers # 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-4.1.4/src/parser/Makefile.am0000664000175000017500000000166313730350075014372 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 \ gram_minimal.y \ keywords.c \ kwlookup.c \ list.c \ makefuncs.c \ nodes.c \ outfuncs.c \ parser.c \ pool_string.c \ scansup.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 scan.c if use_repl_snprintf libsql_parser_a_SOURCES += snprintf.c endif EXTRA_DIST = scan.c scan.l ARFLAGS = cr AM_YFLAGS = -d gram.c: gram.y scan.c gram_minimal.c: gram_minimal.y scan.c scan.c: scan.l $(LEX) -o'scan.c' $< generate_parsers: gram_template.y $(SUNIFDEF) --undef pgpool_minimal_parser gram_template.y > gram.y||: $(SUNIFDEF) --define pgpool_minimal_parser gram_template.y > gram_minimal.y||: .PHONY: generate_parsers pgpool-II-4.1.4/src/parser/gram.h0000664000175000017500000005161213730350127013432 00000000000000/* A Bison parser, made by GNU Bison 3.0.4. */ /* Bison interface for Yacc-like parsers in C Copyright (C) 1984, 1989-1990, 2000-2015 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, EQUALS_GREATER = 269, LESS_EQUALS = 270, GREATER_EQUALS = 271, NOT_EQUALS = 272, ABORT_P = 273, ABSOLUTE_P = 274, ACCESS = 275, ACTION = 276, ADD_P = 277, ADMIN = 278, AFTER = 279, AGGREGATE = 280, ALL = 281, ALSO = 282, ALTER = 283, ALWAYS = 284, ANALYSE = 285, ANALYZE = 286, AND = 287, ANY = 288, ARRAY = 289, AS = 290, ASC = 291, ASSERTION = 292, ASSIGNMENT = 293, ASYMMETRIC = 294, AT = 295, ATTACH = 296, ATTRIBUTE = 297, AUTHORIZATION = 298, BACKWARD = 299, BEFORE = 300, BEGIN_P = 301, BETWEEN = 302, BIGINT = 303, BINARY = 304, BIT = 305, BOOLEAN_P = 306, BOTH = 307, BY = 308, CACHE = 309, CALL = 310, CALLED = 311, CASCADE = 312, CASCADED = 313, CASE = 314, CAST = 315, CATALOG_P = 316, CHAIN = 317, CHAR_P = 318, CHARACTER = 319, CHARACTERISTICS = 320, CHECK = 321, CHECKPOINT = 322, CLASS = 323, CLOSE = 324, CLUSTER = 325, COALESCE = 326, COLLATE = 327, COLLATION = 328, COLUMN = 329, COLUMNS = 330, COMMENT = 331, COMMENTS = 332, COMMIT = 333, COMMITTED = 334, CONCURRENTLY = 335, CONFIGURATION = 336, CONFLICT = 337, CONNECTION = 338, CONSTRAINT = 339, CONSTRAINTS = 340, CONTENT_P = 341, CONTINUE_P = 342, CONVERSION_P = 343, COPY = 344, COST = 345, CREATE = 346, CROSS = 347, CSV = 348, CUBE = 349, CURRENT_P = 350, CURRENT_CATALOG = 351, CURRENT_DATE = 352, CURRENT_ROLE = 353, CURRENT_SCHEMA = 354, CURRENT_TIME = 355, CURRENT_TIMESTAMP = 356, CURRENT_USER = 357, CURSOR = 358, CYCLE = 359, DATA_P = 360, DATABASE = 361, DAY_P = 362, DEALLOCATE = 363, DEC = 364, DECIMAL_P = 365, DECLARE = 366, DEFAULT = 367, DEFAULTS = 368, DEFERRABLE = 369, DEFERRED = 370, DEFINER = 371, DELETE_P = 372, DELIMITER = 373, DELIMITERS = 374, DEPENDS = 375, DESC = 376, DETACH = 377, DICTIONARY = 378, DISABLE_P = 379, DISCARD = 380, DISTINCT = 381, DO = 382, DOCUMENT_P = 383, DOMAIN_P = 384, DOUBLE_P = 385, DROP = 386, EACH = 387, ELSE = 388, ENABLE_P = 389, ENCODING = 390, ENCRYPTED = 391, END_P = 392, ENUM_P = 393, ESCAPE = 394, EVENT = 395, EXCEPT = 396, EXCLUDE = 397, EXCLUDING = 398, EXCLUSIVE = 399, EXECUTE = 400, EXISTS = 401, EXPLAIN = 402, EXTENSION = 403, EXTERNAL = 404, EXTRACT = 405, FALSE_P = 406, FAMILY = 407, FETCH = 408, FILTER = 409, FIRST_P = 410, FLOAT_P = 411, FOLLOWING = 412, FOR = 413, FORCE = 414, FOREIGN = 415, FORWARD = 416, FREEZE = 417, FROM = 418, FULL = 419, FUNCTION = 420, FUNCTIONS = 421, GENERATED = 422, GLOBAL = 423, GRANT = 424, GRANTED = 425, GREATEST = 426, GROUP_P = 427, GROUPING = 428, GROUPS = 429, HANDLER = 430, HAVING = 431, HEADER_P = 432, HOLD = 433, HOUR_P = 434, IDENTITY_P = 435, IF_P = 436, ILIKE = 437, IMMEDIATE = 438, IMMUTABLE = 439, IMPLICIT_P = 440, IMPORT_P = 441, IN_P = 442, INCLUDE = 443, INCLUDING = 444, INCREMENT = 445, INDEX = 446, INDEXES = 447, INHERIT = 448, INHERITS = 449, INITIALLY = 450, INLINE_P = 451, INNER_P = 452, INOUT = 453, INPUT_P = 454, INSENSITIVE = 455, INSERT = 456, INSTEAD = 457, INT_P = 458, INTEGER = 459, INTERSECT = 460, INTERVAL = 461, INTO = 462, INVOKER = 463, IS = 464, ISNULL = 465, ISOLATION = 466, JOIN = 467, KEY = 468, LABEL = 469, LANGUAGE = 470, LARGE_P = 471, LAST_P = 472, LATERAL_P = 473, LEADING = 474, LEAKPROOF = 475, LEAST = 476, LEFT = 477, LEVEL = 478, LIKE = 479, LIMIT = 480, LISTEN = 481, LOAD = 482, LOCAL = 483, LOCALTIME = 484, LOCALTIMESTAMP = 485, LOCATION = 486, LOCK_P = 487, LOCKED = 488, LOGGED = 489, MAPPING = 490, MATCH = 491, MATERIALIZED = 492, MAXVALUE = 493, METHOD = 494, MINUTE_P = 495, MINVALUE = 496, MODE = 497, MONTH_P = 498, MOVE = 499, NAME_P = 500, NAMES = 501, NATIONAL = 502, NATURAL = 503, NCHAR = 504, NEW = 505, NEXT = 506, NO = 507, NONE = 508, NOT = 509, NOTHING = 510, NOTIFY = 511, NOTNULL = 512, NOWAIT = 513, NULL_P = 514, NULLIF = 515, NULLS_P = 516, NUMERIC = 517, OBJECT_P = 518, OF = 519, OFF = 520, OFFSET = 521, OIDS = 522, OLD = 523, ON = 524, ONLY = 525, OPERATOR = 526, OPTION = 527, OPTIONS = 528, OR = 529, ORDER = 530, ORDINALITY = 531, OTHERS = 532, OUT_P = 533, OUTER_P = 534, OVER = 535, OVERLAPS = 536, OVERLAY = 537, OVERRIDING = 538, OWNED = 539, OWNER = 540, PARALLEL = 541, PARSER = 542, PARTIAL = 543, PARTITION = 544, PASSING = 545, PASSWORD = 546, PGPOOL = 547, PLACING = 548, PLANS = 549, POLICY = 550, POSITION = 551, PRECEDING = 552, PRECISION = 553, PRESERVE = 554, PREPARE = 555, PREPARED = 556, PRIMARY = 557, PRIOR = 558, PRIVILEGES = 559, PROCEDURAL = 560, PROCEDURE = 561, PROCEDURES = 562, PROGRAM = 563, PUBLICATION = 564, QUOTE = 565, RANGE = 566, READ = 567, REAL = 568, REASSIGN = 569, RECHECK = 570, RECURSIVE = 571, REF = 572, REFERENCES = 573, REFERENCING = 574, REFRESH = 575, REINDEX = 576, RELATIVE_P = 577, RELEASE = 578, RENAME = 579, REPEATABLE = 580, REPLACE = 581, REPLICA = 582, RESET = 583, RESTART = 584, RESTRICT = 585, RETURNING = 586, RETURNS = 587, REVOKE = 588, RIGHT = 589, ROLE = 590, ROLLBACK = 591, ROLLUP = 592, ROUTINE = 593, ROUTINES = 594, ROW = 595, ROWS = 596, RULE = 597, SAVEPOINT = 598, SCHEMA = 599, SCHEMAS = 600, SCROLL = 601, SEARCH = 602, SECOND_P = 603, SECURITY = 604, SELECT = 605, SEQUENCE = 606, SEQUENCES = 607, SERIALIZABLE = 608, SERVER = 609, SESSION = 610, SESSION_USER = 611, SET = 612, SETS = 613, SETOF = 614, SHARE = 615, SHOW = 616, SIMILAR = 617, SIMPLE = 618, SKIP = 619, SMALLINT = 620, SNAPSHOT = 621, SOME = 622, SQL_P = 623, STABLE = 624, STANDALONE_P = 625, START = 626, STATEMENT = 627, STATISTICS = 628, STDIN = 629, STDOUT = 630, STORAGE = 631, STORED = 632, STRICT_P = 633, STRIP_P = 634, SUBSCRIPTION = 635, SUBSTRING = 636, SUPPORT = 637, SYMMETRIC = 638, SYSID = 639, SYSTEM_P = 640, TABLE = 641, TABLES = 642, TABLESAMPLE = 643, TABLESPACE = 644, TEMP = 645, TEMPLATE = 646, TEMPORARY = 647, TEXT_P = 648, THEN = 649, TIES = 650, TIME = 651, TIMESTAMP = 652, TO = 653, TRAILING = 654, TRANSACTION = 655, TRANSFORM = 656, TREAT = 657, TRIGGER = 658, TRIM = 659, TRUE_P = 660, TRUNCATE = 661, TRUSTED = 662, TYPE_P = 663, TYPES_P = 664, UNBOUNDED = 665, UNCOMMITTED = 666, UNENCRYPTED = 667, UNION = 668, UNIQUE = 669, UNKNOWN = 670, UNLISTEN = 671, UNLOGGED = 672, UNTIL = 673, UPDATE = 674, USER = 675, USING = 676, VACUUM = 677, VALID = 678, VALIDATE = 679, VALIDATOR = 680, VALUE_P = 681, VALUES = 682, VARCHAR = 683, VARIADIC = 684, VARYING = 685, VERBOSE = 686, VERSION_P = 687, VIEW = 688, VIEWS = 689, VOLATILE = 690, WHEN = 691, WHERE = 692, WHITESPACE_P = 693, WINDOW = 694, WITH = 695, WITHIN = 696, WITHOUT = 697, WORK = 698, WRAPPER = 699, WRITE = 700, XML_P = 701, XMLATTRIBUTES = 702, XMLCONCAT = 703, XMLELEMENT = 704, XMLEXISTS = 705, XMLFOREST = 706, XMLNAMESPACES = 707, XMLPARSE = 708, XMLPI = 709, XMLROOT = 710, XMLSERIALIZE = 711, XMLTABLE = 712, YEAR_P = 713, YES_P = 714, ZONE = 715, NOT_LA = 716, NULLS_LA = 717, WITH_LA = 718, POSTFIXOP = 719, UMINUS = 720 }; #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 EQUALS_GREATER 269 #define LESS_EQUALS 270 #define GREATER_EQUALS 271 #define NOT_EQUALS 272 #define ABORT_P 273 #define ABSOLUTE_P 274 #define ACCESS 275 #define ACTION 276 #define ADD_P 277 #define ADMIN 278 #define AFTER 279 #define AGGREGATE 280 #define ALL 281 #define ALSO 282 #define ALTER 283 #define ALWAYS 284 #define ANALYSE 285 #define ANALYZE 286 #define AND 287 #define ANY 288 #define ARRAY 289 #define AS 290 #define ASC 291 #define ASSERTION 292 #define ASSIGNMENT 293 #define ASYMMETRIC 294 #define AT 295 #define ATTACH 296 #define ATTRIBUTE 297 #define AUTHORIZATION 298 #define BACKWARD 299 #define BEFORE 300 #define BEGIN_P 301 #define BETWEEN 302 #define BIGINT 303 #define BINARY 304 #define BIT 305 #define BOOLEAN_P 306 #define BOTH 307 #define BY 308 #define CACHE 309 #define CALL 310 #define CALLED 311 #define CASCADE 312 #define CASCADED 313 #define CASE 314 #define CAST 315 #define CATALOG_P 316 #define CHAIN 317 #define CHAR_P 318 #define CHARACTER 319 #define CHARACTERISTICS 320 #define CHECK 321 #define CHECKPOINT 322 #define CLASS 323 #define CLOSE 324 #define CLUSTER 325 #define COALESCE 326 #define COLLATE 327 #define COLLATION 328 #define COLUMN 329 #define COLUMNS 330 #define COMMENT 331 #define COMMENTS 332 #define COMMIT 333 #define COMMITTED 334 #define CONCURRENTLY 335 #define CONFIGURATION 336 #define CONFLICT 337 #define CONNECTION 338 #define CONSTRAINT 339 #define CONSTRAINTS 340 #define CONTENT_P 341 #define CONTINUE_P 342 #define CONVERSION_P 343 #define COPY 344 #define COST 345 #define CREATE 346 #define CROSS 347 #define CSV 348 #define CUBE 349 #define CURRENT_P 350 #define CURRENT_CATALOG 351 #define CURRENT_DATE 352 #define CURRENT_ROLE 353 #define CURRENT_SCHEMA 354 #define CURRENT_TIME 355 #define CURRENT_TIMESTAMP 356 #define CURRENT_USER 357 #define CURSOR 358 #define CYCLE 359 #define DATA_P 360 #define DATABASE 361 #define DAY_P 362 #define DEALLOCATE 363 #define DEC 364 #define DECIMAL_P 365 #define DECLARE 366 #define DEFAULT 367 #define DEFAULTS 368 #define DEFERRABLE 369 #define DEFERRED 370 #define DEFINER 371 #define DELETE_P 372 #define DELIMITER 373 #define DELIMITERS 374 #define DEPENDS 375 #define DESC 376 #define DETACH 377 #define DICTIONARY 378 #define DISABLE_P 379 #define DISCARD 380 #define DISTINCT 381 #define DO 382 #define DOCUMENT_P 383 #define DOMAIN_P 384 #define DOUBLE_P 385 #define DROP 386 #define EACH 387 #define ELSE 388 #define ENABLE_P 389 #define ENCODING 390 #define ENCRYPTED 391 #define END_P 392 #define ENUM_P 393 #define ESCAPE 394 #define EVENT 395 #define EXCEPT 396 #define EXCLUDE 397 #define EXCLUDING 398 #define EXCLUSIVE 399 #define EXECUTE 400 #define EXISTS 401 #define EXPLAIN 402 #define EXTENSION 403 #define EXTERNAL 404 #define EXTRACT 405 #define FALSE_P 406 #define FAMILY 407 #define FETCH 408 #define FILTER 409 #define FIRST_P 410 #define FLOAT_P 411 #define FOLLOWING 412 #define FOR 413 #define FORCE 414 #define FOREIGN 415 #define FORWARD 416 #define FREEZE 417 #define FROM 418 #define FULL 419 #define FUNCTION 420 #define FUNCTIONS 421 #define GENERATED 422 #define GLOBAL 423 #define GRANT 424 #define GRANTED 425 #define GREATEST 426 #define GROUP_P 427 #define GROUPING 428 #define GROUPS 429 #define HANDLER 430 #define HAVING 431 #define HEADER_P 432 #define HOLD 433 #define HOUR_P 434 #define IDENTITY_P 435 #define IF_P 436 #define ILIKE 437 #define IMMEDIATE 438 #define IMMUTABLE 439 #define IMPLICIT_P 440 #define IMPORT_P 441 #define IN_P 442 #define INCLUDE 443 #define INCLUDING 444 #define INCREMENT 445 #define INDEX 446 #define INDEXES 447 #define INHERIT 448 #define INHERITS 449 #define INITIALLY 450 #define INLINE_P 451 #define INNER_P 452 #define INOUT 453 #define INPUT_P 454 #define INSENSITIVE 455 #define INSERT 456 #define INSTEAD 457 #define INT_P 458 #define INTEGER 459 #define INTERSECT 460 #define INTERVAL 461 #define INTO 462 #define INVOKER 463 #define IS 464 #define ISNULL 465 #define ISOLATION 466 #define JOIN 467 #define KEY 468 #define LABEL 469 #define LANGUAGE 470 #define LARGE_P 471 #define LAST_P 472 #define LATERAL_P 473 #define LEADING 474 #define LEAKPROOF 475 #define LEAST 476 #define LEFT 477 #define LEVEL 478 #define LIKE 479 #define LIMIT 480 #define LISTEN 481 #define LOAD 482 #define LOCAL 483 #define LOCALTIME 484 #define LOCALTIMESTAMP 485 #define LOCATION 486 #define LOCK_P 487 #define LOCKED 488 #define LOGGED 489 #define MAPPING 490 #define MATCH 491 #define MATERIALIZED 492 #define MAXVALUE 493 #define METHOD 494 #define MINUTE_P 495 #define MINVALUE 496 #define MODE 497 #define MONTH_P 498 #define MOVE 499 #define NAME_P 500 #define NAMES 501 #define NATIONAL 502 #define NATURAL 503 #define NCHAR 504 #define NEW 505 #define NEXT 506 #define NO 507 #define NONE 508 #define NOT 509 #define NOTHING 510 #define NOTIFY 511 #define NOTNULL 512 #define NOWAIT 513 #define NULL_P 514 #define NULLIF 515 #define NULLS_P 516 #define NUMERIC 517 #define OBJECT_P 518 #define OF 519 #define OFF 520 #define OFFSET 521 #define OIDS 522 #define OLD 523 #define ON 524 #define ONLY 525 #define OPERATOR 526 #define OPTION 527 #define OPTIONS 528 #define OR 529 #define ORDER 530 #define ORDINALITY 531 #define OTHERS 532 #define OUT_P 533 #define OUTER_P 534 #define OVER 535 #define OVERLAPS 536 #define OVERLAY 537 #define OVERRIDING 538 #define OWNED 539 #define OWNER 540 #define PARALLEL 541 #define PARSER 542 #define PARTIAL 543 #define PARTITION 544 #define PASSING 545 #define PASSWORD 546 #define PGPOOL 547 #define PLACING 548 #define PLANS 549 #define POLICY 550 #define POSITION 551 #define PRECEDING 552 #define PRECISION 553 #define PRESERVE 554 #define PREPARE 555 #define PREPARED 556 #define PRIMARY 557 #define PRIOR 558 #define PRIVILEGES 559 #define PROCEDURAL 560 #define PROCEDURE 561 #define PROCEDURES 562 #define PROGRAM 563 #define PUBLICATION 564 #define QUOTE 565 #define RANGE 566 #define READ 567 #define REAL 568 #define REASSIGN 569 #define RECHECK 570 #define RECURSIVE 571 #define REF 572 #define REFERENCES 573 #define REFERENCING 574 #define REFRESH 575 #define REINDEX 576 #define RELATIVE_P 577 #define RELEASE 578 #define RENAME 579 #define REPEATABLE 580 #define REPLACE 581 #define REPLICA 582 #define RESET 583 #define RESTART 584 #define RESTRICT 585 #define RETURNING 586 #define RETURNS 587 #define REVOKE 588 #define RIGHT 589 #define ROLE 590 #define ROLLBACK 591 #define ROLLUP 592 #define ROUTINE 593 #define ROUTINES 594 #define ROW 595 #define ROWS 596 #define RULE 597 #define SAVEPOINT 598 #define SCHEMA 599 #define SCHEMAS 600 #define SCROLL 601 #define SEARCH 602 #define SECOND_P 603 #define SECURITY 604 #define SELECT 605 #define SEQUENCE 606 #define SEQUENCES 607 #define SERIALIZABLE 608 #define SERVER 609 #define SESSION 610 #define SESSION_USER 611 #define SET 612 #define SETS 613 #define SETOF 614 #define SHARE 615 #define SHOW 616 #define SIMILAR 617 #define SIMPLE 618 #define SKIP 619 #define SMALLINT 620 #define SNAPSHOT 621 #define SOME 622 #define SQL_P 623 #define STABLE 624 #define STANDALONE_P 625 #define START 626 #define STATEMENT 627 #define STATISTICS 628 #define STDIN 629 #define STDOUT 630 #define STORAGE 631 #define STORED 632 #define STRICT_P 633 #define STRIP_P 634 #define SUBSCRIPTION 635 #define SUBSTRING 636 #define SUPPORT 637 #define SYMMETRIC 638 #define SYSID 639 #define SYSTEM_P 640 #define TABLE 641 #define TABLES 642 #define TABLESAMPLE 643 #define TABLESPACE 644 #define TEMP 645 #define TEMPLATE 646 #define TEMPORARY 647 #define TEXT_P 648 #define THEN 649 #define TIES 650 #define TIME 651 #define TIMESTAMP 652 #define TO 653 #define TRAILING 654 #define TRANSACTION 655 #define TRANSFORM 656 #define TREAT 657 #define TRIGGER 658 #define TRIM 659 #define TRUE_P 660 #define TRUNCATE 661 #define TRUSTED 662 #define TYPE_P 663 #define TYPES_P 664 #define UNBOUNDED 665 #define UNCOMMITTED 666 #define UNENCRYPTED 667 #define UNION 668 #define UNIQUE 669 #define UNKNOWN 670 #define UNLISTEN 671 #define UNLOGGED 672 #define UNTIL 673 #define UPDATE 674 #define USER 675 #define USING 676 #define VACUUM 677 #define VALID 678 #define VALIDATE 679 #define VALIDATOR 680 #define VALUE_P 681 #define VALUES 682 #define VARCHAR 683 #define VARIADIC 684 #define VARYING 685 #define VERBOSE 686 #define VERSION_P 687 #define VIEW 688 #define VIEWS 689 #define VOLATILE 690 #define WHEN 691 #define WHERE 692 #define WHITESPACE_P 693 #define WINDOW 694 #define WITH 695 #define WITHIN 696 #define WITHOUT 697 #define WORK 698 #define WRAPPER 699 #define WRITE 700 #define XML_P 701 #define XMLATTRIBUTES 702 #define XMLCONCAT 703 #define XMLELEMENT 704 #define XMLEXISTS 705 #define XMLFOREST 706 #define XMLNAMESPACES 707 #define XMLPARSE 708 #define XMLPI 709 #define XMLROOT 710 #define XMLSERIALIZE 711 #define XMLTABLE 712 #define YEAR_P 713 #define YES_P 714 #define ZONE 715 #define NOT_LA 716 #define NULLS_LA 717 #define WITH_LA 718 #define POSTFIXOP 719 #define UMINUS 720 /* Value type. */ #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED union YYSTYPE { #line 239 "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; ObjectWithArgs *objwithargs; DefElem *defelt; SortBy *sortby; WindowDef *windef; JoinExpr *jexpr; IndexElem *ielem; Alias *alias; RangeVar *range; IntoClause *into; WithClause *with; InferClause *infer; OnConflictClause *onconflict; A_Indices *aind; ResTarget *target; struct PrivTarget *privtarget; AccessPriv *accesspriv; struct ImportQual *importqual; InsertStmt *istmt; VariableSetStmt *vsetstmt; PartitionElem *partelem; PartitionSpec *partspec; PartitionBoundSpec *partboundspec; RoleSpec *rolespec; #line 1028 "gram.h" /* yacc.c:1909 */ }; typedef union YYSTYPE YYSTYPE; # 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-4.1.4/src/parser/gram.c0000664000175000017500001077573513730350127013451 00000000000000/* A Bison parser, made by GNU Bison 3.0.4. */ /* Bison implementation for Yacc-like parsers in C Copyright (C) 1984, 1989-1990, 2000-2015 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.4" /* 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-2019, PgPool Global Development Group * Portions Copyright (c) 1996-2019, 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 constraint_exclusion 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. * * 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" /* This is a configuration parameter since PostgreSQL 9.5. * We set this false in pgpool-II. This is default in PostgreSQL. */ static bool operator_precedence_warning = false; /* * 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/catalog/pg_attribute.h */ #define ATTRIBUTE_IDENTITY_ALWAYS 'a' #define ATTRIBUTE_IDENTITY_BY_DEFAULT 'd' /* * 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; /* * 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, or whose leftmost * component 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.) * * A cleaner answer would be to make YYLLOC_DEFAULT scan all the Rhs * locations until it's found one that's not -1. Then we'd get a correct * location for any nonterminal that isn't entirely empty. But this way * would add overhead to every rule reduction, and so far there's not been * a compelling reason to pay that overhead. */ /* * 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; ObjectType objtype; List *objs; } PrivTarget; /* Private struct for the result of import_qualification production */ typedef struct ImportQual { ImportForeignSchemaType type; List *table_names; } ImportQual; /* 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 RawStmt *makeRawStmt(Node *stmt, int stmt_location); static void updateRawStmtEnd(RawStmt *rs, int end_location); static Node *makeColumnRef(char *colname, List *indirection, int location, core_yyscan_t yyscanner); static Node *makeStringConst(char *str, 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 RoleSpec *makeRoleSpec(RoleSpecType type, 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 *makeAndExpr(Node *lexpr, Node *rexpr, int location); static Node *makeOrExpr(Node *lexpr, Node *rexpr, int location); static Node *makeNotExpr(Node *expr, int location); static Node *makeAArrayExpr(List *elements, int location); static Node *makeSQLValueFunction(SQLValueFunctionOp op, int32 typmod, 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 301 "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, EQUALS_GREATER = 269, LESS_EQUALS = 270, GREATER_EQUALS = 271, NOT_EQUALS = 272, ABORT_P = 273, ABSOLUTE_P = 274, ACCESS = 275, ACTION = 276, ADD_P = 277, ADMIN = 278, AFTER = 279, AGGREGATE = 280, ALL = 281, ALSO = 282, ALTER = 283, ALWAYS = 284, ANALYSE = 285, ANALYZE = 286, AND = 287, ANY = 288, ARRAY = 289, AS = 290, ASC = 291, ASSERTION = 292, ASSIGNMENT = 293, ASYMMETRIC = 294, AT = 295, ATTACH = 296, ATTRIBUTE = 297, AUTHORIZATION = 298, BACKWARD = 299, BEFORE = 300, BEGIN_P = 301, BETWEEN = 302, BIGINT = 303, BINARY = 304, BIT = 305, BOOLEAN_P = 306, BOTH = 307, BY = 308, CACHE = 309, CALL = 310, CALLED = 311, CASCADE = 312, CASCADED = 313, CASE = 314, CAST = 315, CATALOG_P = 316, CHAIN = 317, CHAR_P = 318, CHARACTER = 319, CHARACTERISTICS = 320, CHECK = 321, CHECKPOINT = 322, CLASS = 323, CLOSE = 324, CLUSTER = 325, COALESCE = 326, COLLATE = 327, COLLATION = 328, COLUMN = 329, COLUMNS = 330, COMMENT = 331, COMMENTS = 332, COMMIT = 333, COMMITTED = 334, CONCURRENTLY = 335, CONFIGURATION = 336, CONFLICT = 337, CONNECTION = 338, CONSTRAINT = 339, CONSTRAINTS = 340, CONTENT_P = 341, CONTINUE_P = 342, CONVERSION_P = 343, COPY = 344, COST = 345, CREATE = 346, CROSS = 347, CSV = 348, CUBE = 349, CURRENT_P = 350, CURRENT_CATALOG = 351, CURRENT_DATE = 352, CURRENT_ROLE = 353, CURRENT_SCHEMA = 354, CURRENT_TIME = 355, CURRENT_TIMESTAMP = 356, CURRENT_USER = 357, CURSOR = 358, CYCLE = 359, DATA_P = 360, DATABASE = 361, DAY_P = 362, DEALLOCATE = 363, DEC = 364, DECIMAL_P = 365, DECLARE = 366, DEFAULT = 367, DEFAULTS = 368, DEFERRABLE = 369, DEFERRED = 370, DEFINER = 371, DELETE_P = 372, DELIMITER = 373, DELIMITERS = 374, DEPENDS = 375, DESC = 376, DETACH = 377, DICTIONARY = 378, DISABLE_P = 379, DISCARD = 380, DISTINCT = 381, DO = 382, DOCUMENT_P = 383, DOMAIN_P = 384, DOUBLE_P = 385, DROP = 386, EACH = 387, ELSE = 388, ENABLE_P = 389, ENCODING = 390, ENCRYPTED = 391, END_P = 392, ENUM_P = 393, ESCAPE = 394, EVENT = 395, EXCEPT = 396, EXCLUDE = 397, EXCLUDING = 398, EXCLUSIVE = 399, EXECUTE = 400, EXISTS = 401, EXPLAIN = 402, EXTENSION = 403, EXTERNAL = 404, EXTRACT = 405, FALSE_P = 406, FAMILY = 407, FETCH = 408, FILTER = 409, FIRST_P = 410, FLOAT_P = 411, FOLLOWING = 412, FOR = 413, FORCE = 414, FOREIGN = 415, FORWARD = 416, FREEZE = 417, FROM = 418, FULL = 419, FUNCTION = 420, FUNCTIONS = 421, GENERATED = 422, GLOBAL = 423, GRANT = 424, GRANTED = 425, GREATEST = 426, GROUP_P = 427, GROUPING = 428, GROUPS = 429, HANDLER = 430, HAVING = 431, HEADER_P = 432, HOLD = 433, HOUR_P = 434, IDENTITY_P = 435, IF_P = 436, ILIKE = 437, IMMEDIATE = 438, IMMUTABLE = 439, IMPLICIT_P = 440, IMPORT_P = 441, IN_P = 442, INCLUDE = 443, INCLUDING = 444, INCREMENT = 445, INDEX = 446, INDEXES = 447, INHERIT = 448, INHERITS = 449, INITIALLY = 450, INLINE_P = 451, INNER_P = 452, INOUT = 453, INPUT_P = 454, INSENSITIVE = 455, INSERT = 456, INSTEAD = 457, INT_P = 458, INTEGER = 459, INTERSECT = 460, INTERVAL = 461, INTO = 462, INVOKER = 463, IS = 464, ISNULL = 465, ISOLATION = 466, JOIN = 467, KEY = 468, LABEL = 469, LANGUAGE = 470, LARGE_P = 471, LAST_P = 472, LATERAL_P = 473, LEADING = 474, LEAKPROOF = 475, LEAST = 476, LEFT = 477, LEVEL = 478, LIKE = 479, LIMIT = 480, LISTEN = 481, LOAD = 482, LOCAL = 483, LOCALTIME = 484, LOCALTIMESTAMP = 485, LOCATION = 486, LOCK_P = 487, LOCKED = 488, LOGGED = 489, MAPPING = 490, MATCH = 491, MATERIALIZED = 492, MAXVALUE = 493, METHOD = 494, MINUTE_P = 495, MINVALUE = 496, MODE = 497, MONTH_P = 498, MOVE = 499, NAME_P = 500, NAMES = 501, NATIONAL = 502, NATURAL = 503, NCHAR = 504, NEW = 505, NEXT = 506, NO = 507, NONE = 508, NOT = 509, NOTHING = 510, NOTIFY = 511, NOTNULL = 512, NOWAIT = 513, NULL_P = 514, NULLIF = 515, NULLS_P = 516, NUMERIC = 517, OBJECT_P = 518, OF = 519, OFF = 520, OFFSET = 521, OIDS = 522, OLD = 523, ON = 524, ONLY = 525, OPERATOR = 526, OPTION = 527, OPTIONS = 528, OR = 529, ORDER = 530, ORDINALITY = 531, OTHERS = 532, OUT_P = 533, OUTER_P = 534, OVER = 535, OVERLAPS = 536, OVERLAY = 537, OVERRIDING = 538, OWNED = 539, OWNER = 540, PARALLEL = 541, PARSER = 542, PARTIAL = 543, PARTITION = 544, PASSING = 545, PASSWORD = 546, PGPOOL = 547, PLACING = 548, PLANS = 549, POLICY = 550, POSITION = 551, PRECEDING = 552, PRECISION = 553, PRESERVE = 554, PREPARE = 555, PREPARED = 556, PRIMARY = 557, PRIOR = 558, PRIVILEGES = 559, PROCEDURAL = 560, PROCEDURE = 561, PROCEDURES = 562, PROGRAM = 563, PUBLICATION = 564, QUOTE = 565, RANGE = 566, READ = 567, REAL = 568, REASSIGN = 569, RECHECK = 570, RECURSIVE = 571, REF = 572, REFERENCES = 573, REFERENCING = 574, REFRESH = 575, REINDEX = 576, RELATIVE_P = 577, RELEASE = 578, RENAME = 579, REPEATABLE = 580, REPLACE = 581, REPLICA = 582, RESET = 583, RESTART = 584, RESTRICT = 585, RETURNING = 586, RETURNS = 587, REVOKE = 588, RIGHT = 589, ROLE = 590, ROLLBACK = 591, ROLLUP = 592, ROUTINE = 593, ROUTINES = 594, ROW = 595, ROWS = 596, RULE = 597, SAVEPOINT = 598, SCHEMA = 599, SCHEMAS = 600, SCROLL = 601, SEARCH = 602, SECOND_P = 603, SECURITY = 604, SELECT = 605, SEQUENCE = 606, SEQUENCES = 607, SERIALIZABLE = 608, SERVER = 609, SESSION = 610, SESSION_USER = 611, SET = 612, SETS = 613, SETOF = 614, SHARE = 615, SHOW = 616, SIMILAR = 617, SIMPLE = 618, SKIP = 619, SMALLINT = 620, SNAPSHOT = 621, SOME = 622, SQL_P = 623, STABLE = 624, STANDALONE_P = 625, START = 626, STATEMENT = 627, STATISTICS = 628, STDIN = 629, STDOUT = 630, STORAGE = 631, STORED = 632, STRICT_P = 633, STRIP_P = 634, SUBSCRIPTION = 635, SUBSTRING = 636, SUPPORT = 637, SYMMETRIC = 638, SYSID = 639, SYSTEM_P = 640, TABLE = 641, TABLES = 642, TABLESAMPLE = 643, TABLESPACE = 644, TEMP = 645, TEMPLATE = 646, TEMPORARY = 647, TEXT_P = 648, THEN = 649, TIES = 650, TIME = 651, TIMESTAMP = 652, TO = 653, TRAILING = 654, TRANSACTION = 655, TRANSFORM = 656, TREAT = 657, TRIGGER = 658, TRIM = 659, TRUE_P = 660, TRUNCATE = 661, TRUSTED = 662, TYPE_P = 663, TYPES_P = 664, UNBOUNDED = 665, UNCOMMITTED = 666, UNENCRYPTED = 667, UNION = 668, UNIQUE = 669, UNKNOWN = 670, UNLISTEN = 671, UNLOGGED = 672, UNTIL = 673, UPDATE = 674, USER = 675, USING = 676, VACUUM = 677, VALID = 678, VALIDATE = 679, VALIDATOR = 680, VALUE_P = 681, VALUES = 682, VARCHAR = 683, VARIADIC = 684, VARYING = 685, VERBOSE = 686, VERSION_P = 687, VIEW = 688, VIEWS = 689, VOLATILE = 690, WHEN = 691, WHERE = 692, WHITESPACE_P = 693, WINDOW = 694, WITH = 695, WITHIN = 696, WITHOUT = 697, WORK = 698, WRAPPER = 699, WRITE = 700, XML_P = 701, XMLATTRIBUTES = 702, XMLCONCAT = 703, XMLELEMENT = 704, XMLEXISTS = 705, XMLFOREST = 706, XMLNAMESPACES = 707, XMLPARSE = 708, XMLPI = 709, XMLROOT = 710, XMLSERIALIZE = 711, XMLTABLE = 712, YEAR_P = 713, YES_P = 714, ZONE = 715, NOT_LA = 716, NULLS_LA = 717, WITH_LA = 718, POSTFIXOP = 719, UMINUS = 720 }; #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 EQUALS_GREATER 269 #define LESS_EQUALS 270 #define GREATER_EQUALS 271 #define NOT_EQUALS 272 #define ABORT_P 273 #define ABSOLUTE_P 274 #define ACCESS 275 #define ACTION 276 #define ADD_P 277 #define ADMIN 278 #define AFTER 279 #define AGGREGATE 280 #define ALL 281 #define ALSO 282 #define ALTER 283 #define ALWAYS 284 #define ANALYSE 285 #define ANALYZE 286 #define AND 287 #define ANY 288 #define ARRAY 289 #define AS 290 #define ASC 291 #define ASSERTION 292 #define ASSIGNMENT 293 #define ASYMMETRIC 294 #define AT 295 #define ATTACH 296 #define ATTRIBUTE 297 #define AUTHORIZATION 298 #define BACKWARD 299 #define BEFORE 300 #define BEGIN_P 301 #define BETWEEN 302 #define BIGINT 303 #define BINARY 304 #define BIT 305 #define BOOLEAN_P 306 #define BOTH 307 #define BY 308 #define CACHE 309 #define CALL 310 #define CALLED 311 #define CASCADE 312 #define CASCADED 313 #define CASE 314 #define CAST 315 #define CATALOG_P 316 #define CHAIN 317 #define CHAR_P 318 #define CHARACTER 319 #define CHARACTERISTICS 320 #define CHECK 321 #define CHECKPOINT 322 #define CLASS 323 #define CLOSE 324 #define CLUSTER 325 #define COALESCE 326 #define COLLATE 327 #define COLLATION 328 #define COLUMN 329 #define COLUMNS 330 #define COMMENT 331 #define COMMENTS 332 #define COMMIT 333 #define COMMITTED 334 #define CONCURRENTLY 335 #define CONFIGURATION 336 #define CONFLICT 337 #define CONNECTION 338 #define CONSTRAINT 339 #define CONSTRAINTS 340 #define CONTENT_P 341 #define CONTINUE_P 342 #define CONVERSION_P 343 #define COPY 344 #define COST 345 #define CREATE 346 #define CROSS 347 #define CSV 348 #define CUBE 349 #define CURRENT_P 350 #define CURRENT_CATALOG 351 #define CURRENT_DATE 352 #define CURRENT_ROLE 353 #define CURRENT_SCHEMA 354 #define CURRENT_TIME 355 #define CURRENT_TIMESTAMP 356 #define CURRENT_USER 357 #define CURSOR 358 #define CYCLE 359 #define DATA_P 360 #define DATABASE 361 #define DAY_P 362 #define DEALLOCATE 363 #define DEC 364 #define DECIMAL_P 365 #define DECLARE 366 #define DEFAULT 367 #define DEFAULTS 368 #define DEFERRABLE 369 #define DEFERRED 370 #define DEFINER 371 #define DELETE_P 372 #define DELIMITER 373 #define DELIMITERS 374 #define DEPENDS 375 #define DESC 376 #define DETACH 377 #define DICTIONARY 378 #define DISABLE_P 379 #define DISCARD 380 #define DISTINCT 381 #define DO 382 #define DOCUMENT_P 383 #define DOMAIN_P 384 #define DOUBLE_P 385 #define DROP 386 #define EACH 387 #define ELSE 388 #define ENABLE_P 389 #define ENCODING 390 #define ENCRYPTED 391 #define END_P 392 #define ENUM_P 393 #define ESCAPE 394 #define EVENT 395 #define EXCEPT 396 #define EXCLUDE 397 #define EXCLUDING 398 #define EXCLUSIVE 399 #define EXECUTE 400 #define EXISTS 401 #define EXPLAIN 402 #define EXTENSION 403 #define EXTERNAL 404 #define EXTRACT 405 #define FALSE_P 406 #define FAMILY 407 #define FETCH 408 #define FILTER 409 #define FIRST_P 410 #define FLOAT_P 411 #define FOLLOWING 412 #define FOR 413 #define FORCE 414 #define FOREIGN 415 #define FORWARD 416 #define FREEZE 417 #define FROM 418 #define FULL 419 #define FUNCTION 420 #define FUNCTIONS 421 #define GENERATED 422 #define GLOBAL 423 #define GRANT 424 #define GRANTED 425 #define GREATEST 426 #define GROUP_P 427 #define GROUPING 428 #define GROUPS 429 #define HANDLER 430 #define HAVING 431 #define HEADER_P 432 #define HOLD 433 #define HOUR_P 434 #define IDENTITY_P 435 #define IF_P 436 #define ILIKE 437 #define IMMEDIATE 438 #define IMMUTABLE 439 #define IMPLICIT_P 440 #define IMPORT_P 441 #define IN_P 442 #define INCLUDE 443 #define INCLUDING 444 #define INCREMENT 445 #define INDEX 446 #define INDEXES 447 #define INHERIT 448 #define INHERITS 449 #define INITIALLY 450 #define INLINE_P 451 #define INNER_P 452 #define INOUT 453 #define INPUT_P 454 #define INSENSITIVE 455 #define INSERT 456 #define INSTEAD 457 #define INT_P 458 #define INTEGER 459 #define INTERSECT 460 #define INTERVAL 461 #define INTO 462 #define INVOKER 463 #define IS 464 #define ISNULL 465 #define ISOLATION 466 #define JOIN 467 #define KEY 468 #define LABEL 469 #define LANGUAGE 470 #define LARGE_P 471 #define LAST_P 472 #define LATERAL_P 473 #define LEADING 474 #define LEAKPROOF 475 #define LEAST 476 #define LEFT 477 #define LEVEL 478 #define LIKE 479 #define LIMIT 480 #define LISTEN 481 #define LOAD 482 #define LOCAL 483 #define LOCALTIME 484 #define LOCALTIMESTAMP 485 #define LOCATION 486 #define LOCK_P 487 #define LOCKED 488 #define LOGGED 489 #define MAPPING 490 #define MATCH 491 #define MATERIALIZED 492 #define MAXVALUE 493 #define METHOD 494 #define MINUTE_P 495 #define MINVALUE 496 #define MODE 497 #define MONTH_P 498 #define MOVE 499 #define NAME_P 500 #define NAMES 501 #define NATIONAL 502 #define NATURAL 503 #define NCHAR 504 #define NEW 505 #define NEXT 506 #define NO 507 #define NONE 508 #define NOT 509 #define NOTHING 510 #define NOTIFY 511 #define NOTNULL 512 #define NOWAIT 513 #define NULL_P 514 #define NULLIF 515 #define NULLS_P 516 #define NUMERIC 517 #define OBJECT_P 518 #define OF 519 #define OFF 520 #define OFFSET 521 #define OIDS 522 #define OLD 523 #define ON 524 #define ONLY 525 #define OPERATOR 526 #define OPTION 527 #define OPTIONS 528 #define OR 529 #define ORDER 530 #define ORDINALITY 531 #define OTHERS 532 #define OUT_P 533 #define OUTER_P 534 #define OVER 535 #define OVERLAPS 536 #define OVERLAY 537 #define OVERRIDING 538 #define OWNED 539 #define OWNER 540 #define PARALLEL 541 #define PARSER 542 #define PARTIAL 543 #define PARTITION 544 #define PASSING 545 #define PASSWORD 546 #define PGPOOL 547 #define PLACING 548 #define PLANS 549 #define POLICY 550 #define POSITION 551 #define PRECEDING 552 #define PRECISION 553 #define PRESERVE 554 #define PREPARE 555 #define PREPARED 556 #define PRIMARY 557 #define PRIOR 558 #define PRIVILEGES 559 #define PROCEDURAL 560 #define PROCEDURE 561 #define PROCEDURES 562 #define PROGRAM 563 #define PUBLICATION 564 #define QUOTE 565 #define RANGE 566 #define READ 567 #define REAL 568 #define REASSIGN 569 #define RECHECK 570 #define RECURSIVE 571 #define REF 572 #define REFERENCES 573 #define REFERENCING 574 #define REFRESH 575 #define REINDEX 576 #define RELATIVE_P 577 #define RELEASE 578 #define RENAME 579 #define REPEATABLE 580 #define REPLACE 581 #define REPLICA 582 #define RESET 583 #define RESTART 584 #define RESTRICT 585 #define RETURNING 586 #define RETURNS 587 #define REVOKE 588 #define RIGHT 589 #define ROLE 590 #define ROLLBACK 591 #define ROLLUP 592 #define ROUTINE 593 #define ROUTINES 594 #define ROW 595 #define ROWS 596 #define RULE 597 #define SAVEPOINT 598 #define SCHEMA 599 #define SCHEMAS 600 #define SCROLL 601 #define SEARCH 602 #define SECOND_P 603 #define SECURITY 604 #define SELECT 605 #define SEQUENCE 606 #define SEQUENCES 607 #define SERIALIZABLE 608 #define SERVER 609 #define SESSION 610 #define SESSION_USER 611 #define SET 612 #define SETS 613 #define SETOF 614 #define SHARE 615 #define SHOW 616 #define SIMILAR 617 #define SIMPLE 618 #define SKIP 619 #define SMALLINT 620 #define SNAPSHOT 621 #define SOME 622 #define SQL_P 623 #define STABLE 624 #define STANDALONE_P 625 #define START 626 #define STATEMENT 627 #define STATISTICS 628 #define STDIN 629 #define STDOUT 630 #define STORAGE 631 #define STORED 632 #define STRICT_P 633 #define STRIP_P 634 #define SUBSCRIPTION 635 #define SUBSTRING 636 #define SUPPORT 637 #define SYMMETRIC 638 #define SYSID 639 #define SYSTEM_P 640 #define TABLE 641 #define TABLES 642 #define TABLESAMPLE 643 #define TABLESPACE 644 #define TEMP 645 #define TEMPLATE 646 #define TEMPORARY 647 #define TEXT_P 648 #define THEN 649 #define TIES 650 #define TIME 651 #define TIMESTAMP 652 #define TO 653 #define TRAILING 654 #define TRANSACTION 655 #define TRANSFORM 656 #define TREAT 657 #define TRIGGER 658 #define TRIM 659 #define TRUE_P 660 #define TRUNCATE 661 #define TRUSTED 662 #define TYPE_P 663 #define TYPES_P 664 #define UNBOUNDED 665 #define UNCOMMITTED 666 #define UNENCRYPTED 667 #define UNION 668 #define UNIQUE 669 #define UNKNOWN 670 #define UNLISTEN 671 #define UNLOGGED 672 #define UNTIL 673 #define UPDATE 674 #define USER 675 #define USING 676 #define VACUUM 677 #define VALID 678 #define VALIDATE 679 #define VALIDATOR 680 #define VALUE_P 681 #define VALUES 682 #define VARCHAR 683 #define VARIADIC 684 #define VARYING 685 #define VERBOSE 686 #define VERSION_P 687 #define VIEW 688 #define VIEWS 689 #define VOLATILE 690 #define WHEN 691 #define WHERE 692 #define WHITESPACE_P 693 #define WINDOW 694 #define WITH 695 #define WITHIN 696 #define WITHOUT 697 #define WORK 698 #define WRAPPER 699 #define WRITE 700 #define XML_P 701 #define XMLATTRIBUTES 702 #define XMLCONCAT 703 #define XMLELEMENT 704 #define XMLEXISTS 705 #define XMLFOREST 706 #define XMLNAMESPACES 707 #define XMLPARSE 708 #define XMLPI 709 #define XMLROOT 710 #define XMLSERIALIZE 711 #define XMLTABLE 712 #define YEAR_P 713 #define YES_P 714 #define ZONE 715 #define NOT_LA 716 #define NULLS_LA 717 #define WITH_LA 718 #define POSTFIXOP 719 #define UMINUS 720 /* Value type. */ #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED union YYSTYPE { #line 239 "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; ObjectWithArgs *objwithargs; DefElem *defelt; SortBy *sortby; WindowDef *windef; JoinExpr *jexpr; IndexElem *ielem; Alias *alias; RangeVar *range; IntoClause *into; WithClause *with; InferClause *infer; OnConflictClause *onconflict; A_Indices *aind; ResTarget *target; struct PrivTarget *privtarget; AccessPriv *accesspriv; struct ImportQual *importqual; InsertStmt *istmt; VariableSetStmt *vsetstmt; PartitionElem *partelem; PartitionSpec *partspec; PartitionBoundSpec *partboundspec; RoleSpec *rolespec; #line 1315 "gram.c" /* yacc.c:355 */ }; typedef union YYSTYPE YYSTYPE; # 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 1345 "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 831 /* YYLAST -- Last index in YYTABLE. */ #define YYLAST 104297 /* YYNTOKENS -- Number of terminals. */ #define YYNTOKENS 483 /* YYNNTS -- Number of nonterminals. */ #define YYNNTS 667 /* YYNRULES -- Number of rules. */ #define YYNRULES 2728 /* YYNSTATES -- Number of states. */ #define YYNSTATES 5497 /* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned by yylex, with out-of-bounds checking. */ #define YYUNDEFTOK 2 #define YYMAXUTOK 720 #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, 472, 2, 2, 477, 478, 470, 468, 481, 469, 479, 471, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 482, 480, 464, 466, 465, 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, 475, 2, 476, 473, 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, 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, 467, 474 }; #if YYDEBUG /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ static const yytype_uint16 yyrline[] = { 0, 826, 826, 842, 854, 864, 865, 866, 867, 868, 869, 870, 871, 872, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882, 883, 884, 885, 886, 887, 888, 889, 890, 891, 892, 893, 894, 895, 896, 897, 898, 899, 900, 901, 902, 903, 904, 905, 906, 907, 908, 909, 910, 911, 912, 913, 914, 915, 916, 917, 918, 919, 920, 921, 922, 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 956, 957, 958, 959, 960, 961, 962, 963, 964, 965, 966, 967, 968, 969, 970, 971, 972, 973, 974, 975, 976, 977, 978, 979, 980, 981, 982, 983, 984, 985, 986, 988, 997, 1012, 1023, 1024, 1025, 1034, 1035, 1039, 1040, 1044, 1049, 1053, 1063, 1071, 1075, 1079, 1084, 1088, 1136, 1138, 1142, 1146, 1150, 1154, 1168, 1186, 1194, 1205, 1206, 1210, 1218, 1226, 1234, 1255, 1262, 1269, 1276, 1283, 1290, 1307, 1325, 1336, 1337, 1348, 1358, 1368, 1383, 1401, 1402, 1406, 1413, 1421, 1422, 1423, 1424, 1425, 1426, 1440, 1447, 1453, 1459, 1468, 1476, 1484, 1488, 1496, 1504, 1511, 1521, 1522, 1530, 1541, 1549, 1557, 1568, 1576, 1584, 1591, 1600, 1610, 1611, 1615, 1616, 1619, 1621, 1625, 1626, 1627, 1628, 1632, 1633, 1634, 1640, 1652, 1656, 1660, 1675, 1682, 1683, 1684, 1688, 1689, 1690, 1694, 1695, 1699, 1700, 1709, 1710, 1717, 1724, 1734, 1741, 1751, 1752, 1757, 1758, 1764, 1770, 1776, 1782, 1788, 1794, 1800, 1810, 1820, 1821, 1825, 1826, 1834, 1849, 1855, 1861, 1867, 1873, 1892, 1901, 1910, 1919, 1928, 1939, 1950, 1959, 1968, 1977, 1988, 1999, 2008, 2017, 2026, 2035, 2044, 2053, 2064, 2078, 2079, 2084, 2097, 2113, 2129, 2138, 2147, 2156, 2165, 2174, 2182, 2190, 2199, 2215, 2224, 2233, 2242, 2259, 2268, 2277, 2286, 2296, 2309, 2324, 2333, 2342, 2357, 2365, 2375, 2385, 2392, 2400, 2408, 2415, 2422, 2430, 2438, 2446, 2453, 2460, 2468, 2475, 2482, 2490, 2498, 2506, 2514, 2522, 2530, 2540, 2547, 2555, 2563, 2571, 2579, 2587, 2594, 2601, 2608, 2614, 2624, 2625, 2629, 2630, 2631, 2635, 2643, 2647, 2648, 2652, 2659, 2666, 2673, 2683, 2686, 2687, 2691, 2692, 2697, 2701, 2705, 2710, 2717, 2719, 2724, 2728, 2732, 2743, 2751, 2804, 2817, 2831, 2843, 2850, 2854, 2868, 2881, 2882, 2887, 2896, 2906, 2916, 2942, 2948, 2981, 3016, 3038, 3039, 3043, 3044, 3053, 3054, 3055, 3058, 3059, 3064, 3065, 3069, 3073, 3077, 3081, 3085, 3089, 3093, 3097, 3101, 3105, 3109, 3113, 3117, 3126, 3130, 3134, 3138, 3142, 3143, 3148, 3152, 3159, 3166, 3167, 3168, 3169, 3170, 3174, 3178, 3186, 3197, 3216, 3235, 3255, 3275, 3295, 3328, 3329, 3330, 3331, 3332, 3339, 3346, 3347, 3351, 3352, 3356, 3357, 3361, 3365, 3372, 3376, 3383, 3384, 3385, 3389, 3390, 3393, 3414, 3432, 3453, 3454, 3458, 3465, 3466, 3467, 3498, 3505, 3512, 3523, 3534, 3546, 3557, 3566, 3589, 3607, 3608, 3627, 3634, 3641, 3648, 3659, 3669, 3670, 3671, 3675, 3676, 3677, 3678, 3679, 3680, 3681, 3682, 3683, 3692, 3699, 3703, 3716, 3732, 3747, 3763, 3778, 3797, 3818, 3819, 3823, 3824, 3828, 3829, 3832, 3838, 3839, 3842, 3846, 3854, 3859, 3865, 3866, 3870, 3875, 3882, 3883, 3893, 3895, 3897, 3899, 3902, 3905, 3908, 3912, 3913, 3914, 3915, 3916, 3919, 3920, 3924, 3925, 3928, 3940, 3941, 3944, 3945, 3948, 3959, 3970, 3984, 3985, 3990, 3991, 3992, 3995, 3996, 3997, 3998, 4001, 4002, 4005, 4006, 4009, 4027, 4039, 4064, 4077, 4093, 4109, 4110, 4111, 4123, 4136, 4152, 4166, 4167, 4179, 4199, 4209, 4222, 4230, 4241, 4242, 4245, 4246, 4249, 4250, 4253, 4257, 4261, 4265, 4269, 4273, 4277, 4281, 4285, 4289, 4293, 4298, 4302, 4306, 4312, 4313, 4317, 4318, 4319, 4324, 4327, 4328, 4340, 4352, 4367, 4368, 4376, 4377, 4381, 4382, 4386, 4387, 4391, 4392, 4396, 4406, 4419, 4420, 4430, 4441, 4442, 4455, 4462, 4479, 4487, 4498, 4501, 4505, 4509, 4513, 4517, 4529, 4539, 4542, 4546, 4559, 4568, 4577, 4586, 4595, 4604, 4613, 4622, 4631, 4640, 4649, 4658, 4667, 4676, 4685, 4694, 4703, 4712, 4721, 4730, 4739, 4748, 4757, 4766, 4775, 4784, 4793, 4802, 4820, 4831, 4832, 4833, 4834, 4838, 4839, 4843, 4844, 4854, 4862, 4874, 4875, 4879, 4883, 4891, 4895, 4899, 4906, 4910, 4915, 4920, 4927, 4934, 4939, 4949, 4961, 4976, 4977, 4982, 4983, 4987, 4988, 4998, 5007, 5015, 5032, 5052, 5072, 5093, 5124, 5133, 5154, 5169, 5170, 5174, 5182, 5197, 5206, 5218, 5219, 5231, 5239, 5256, 5280, 5297, 5311, 5312, 5316, 5317, 5321, 5322, 5326, 5327, 5331, 5345, 5349, 5350, 5354, 5355, 5356, 5357, 5358, 5368, 5379, 5380, 5391, 5412, 5438, 5439, 5440, 5444, 5446, 5468, 5470, 5472, 5474, 5476, 5481, 5482, 5486, 5487, 5491, 5502, 5503, 5507, 5516, 5520, 5524, 5529, 5539, 5540, 5544, 5545, 5549, 5550, 5554, 5555, 5559, 5560, 5561, 5565, 5569, 5570, 5571, 5575, 5576, 5581, 5582, 5609, 5610, 5611, 5612, 5613, 5614, 5627, 5637, 5651, 5653, 5658, 5663, 5665, 5670, 5680, 5681, 5682, 5683, 5694, 5713, 5724, 5736, 5746, 5756, 5767, 5776, 5783, 5790, 5799, 5808, 5817, 5826, 5835, 5845, 5854, 5866, 5869, 5870, 5873, 5877, 5884, 5885, 5886, 5887, 5888, 5889, 5892, 5895, 5896, 5904, 5911, 5912, 5915, 5917, 5928, 5939, 5950, 5961, 5974, 5975, 5991, 6006, 6007, 6011, 6023, 6033, 6041, 6050, 6059, 6060, 6063, 6064, 6067, 6068, 6069, 6072, 6086, 6091, 6101, 6110, 6122, 6123, 6127, 6135, 6147, 6157, 6170, 6180, 6202, 6212, 6230, 6240, 6250, 6260, 6270, 6280, 6290, 6300, 6310, 6320, 6330, 6340, 6354, 6355, 6356, 6357, 6358, 6359, 6360, 6361, 6362, 6363, 6364, 6365, 6366, 6371, 6372, 6373, 6374, 6375, 6376, 6377, 6382, 6383, 6384, 6388, 6389, 6392, 6393, 6396, 6398, 6403, 6404, 6415, 6426, 6427, 6428, 6462, 6470, 6478, 6486, 6494, 6502, 6510, 6518, 6526, 6539, 6547, 6555, 6563, 6571, 6579, 6587, 6595, 6603, 6611, 6623, 6624, 6625, 6626, 6627, 6628, 6629, 6630, 6631, 6632, 6633, 6634, 6635, 6636, 6641, 6642, 6643, 6644, 6645, 6646, 6647, 6648, 6649, 6650, 6651, 6652, 6656, 6657, 6671, 6681, 6691, 6701, 6711, 6721, 6731, 6741, 6751, 6763, 6764, 6769, 6770, 6771, 6772, 6773, 6774, 6779, 6780, 6781, 6782, 6783, 6784, 6785, 6786, 6789, 6790, 6800, 6806, 6814, 6822, 6830, 6838, 6846, 6854, 6862, 6870, 6878, 6886, 6894, 6902, 6910, 6918, 6926, 6934, 6944, 6945, 6948, 6949, 6959, 6975, 6989, 7015, 7017, 7019, 7021, 7028, 7037, 7038, 7041, 7048, 7055, 7062, 7076, 7084, 7092, 7100, 7108, 7116, 7124, 7132, 7140, 7148, 7156, 7164, 7172, 7180, 7188, 7196, 7204, 7212, 7220, 7228, 7240, 7241, 7245, 7246, 7251, 7252, 7262, 7275, 7285, 7297, 7298, 7301, 7302, 7312, 7322, 7323, 7327, 7331, 7335, 7346, 7359, 7373, 7390, 7391, 7392, 7393, 7394, 7395, 7407, 7435, 7466, 7467, 7471, 7472, 7476, 7477, 7481, 7482, 7485, 7486, 7494, 7505, 7516, 7529, 7530, 7533, 7534, 7537, 7538, 7541, 7542, 7545, 7546, 7547, 7550, 7551, 7552, 7568, 7580, 7593, 7605, 7620, 7621, 7624, 7625, 7629, 7630, 7634, 7635, 7640, 7652, 7659, 7666, 7681, 7682, 7686, 7687, 7702, 7711, 7720, 7729, 7738, 7750, 7751, 7752, 7753, 7754, 7760, 7764, 7779, 7780, 7786, 7796, 7800, 7805, 7813, 7854, 7858, 7862, 7866, 7874, 7875, 7879, 7889, 7890, 7896, 7897, 7904, 7908, 7912, 7916, 7920, 7924, 7928, 7932, 7936, 7940, 7944, 7948, 7952, 7956, 7960, 7964, 7969, 7976, 7980, 7984, 7988, 7992, 7998, 7999, 8006, 8007, 8011, 8012, 8015, 8027, 8031, 8046, 8054, 8062, 8074, 8075, 8080, 8081, 8098, 8108, 8118, 8128, 8138, 8148, 8161, 8171, 8184, 8194, 8207, 8215, 8217, 8219, 8224, 8226, 8231, 8232, 8237, 8255, 8264, 8265, 8269, 8273, 8285, 8296, 8307, 8320, 8321, 8322, 8326, 8338, 8339, 8349, 8361, 8365, 8369, 8373, 8380, 8400, 8410, 8420, 8430, 8442, 8443, 8446, 8447, 8448, 8451, 8452, 8455, 8465, 8474, 8491, 8500, 8509, 8518, 8527, 8536, 8545, 8554, 8563, 8572, 8581, 8590, 8599, 8609, 8619, 8628, 8637, 8646, 8655, 8664, 8673, 8683, 8693, 8703, 8713, 8723, 8733, 8743, 8753, 8763, 8773, 8783, 8793, 8804, 8815, 8826, 8837, 8847, 8857, 8868, 8879, 8889, 8899, 8907, 8916, 8925, 8934, 8943, 8952, 8961, 8970, 8979, 8988, 9002, 9003, 9006, 9007, 9017, 9025, 9033, 9041, 9050, 9058, 9075, 9084, 9093, 9102, 9111, 9120, 9129, 9138, 9147, 9156, 9165, 9174, 9183, 9192, 9201, 9210, 9219, 9228, 9237, 9246, 9255, 9264, 9273, 9282, 9291, 9300, 9309, 9327, 9336, 9337, 9340, 9342, 9348, 9349, 9350, 9351, 9352, 9361, 9369, 9377, 9385, 9393, 9401, 9409, 9417, 9425, 9433, 9441, 9449, 9457, 9465, 9473, 9481, 9489, 9497, 9505, 9513, 9521, 9529, 9537, 9545, 9563, 9582, 9583, 9587, 9591, 9611, 9618, 9626, 9634, 9651, 9664, 9668, 9675, 9684, 9693, 9702, 9711, 9721, 9731, 9749, 9757, 9773, 9790, 9791, 9792, 9797, 9803, 9812, 9813, 9814, 9815, 9816, 9820, 9821, 9824, 9825, 9826, 9827, 9831, 9832, 9833, 9845, 9855, 9856, 9859, 9868, 9874, 9893, 9901, 9908, 9915, 9923, 9931, 9939, 9946, 9953, 9960, 9967, 9974, 9981, 9988, 9997, 9998, 9999, 10003, 10006, 10009, 10012, 10015, 10022, 10024, 10026, 10031, 10033, 10037, 10038, 10039, 10051, 10064, 10077, 10095, 10116, 10117, 10118, 10119, 10129, 10145, 10155, 10156, 10160, 10161, 10165, 10169, 10173, 10191, 10192, 10193, 10194, 10195, 10196, 10197, 10204, 10205, 10216, 10223, 10230, 10241, 10258, 10265, 10281, 10298, 10304, 10320, 10333, 10342, 10350, 10358, 10367, 10378, 10389, 10399, 10400, 10411, 10421, 10432, 10443, 10454, 10465, 10474, 10486, 10487, 10501, 10524, 10534, 10545, 10558, 10559, 10571, 10591, 10601, 10612, 10623, 10627, 10634, 10635, 10639, 10646, 10647, 10651, 10652, 10653, 10657, 10658, 10662, 10663, 10666, 10667, 10670, 10671, 10675, 10676, 10680, 10687, 10689, 10694, 10695, 10708, 10715, 10725, 10732, 10742, 10743, 10744, 10745, 10746, 10747, 10748, 10749, 10750, 10754, 10758, 10765, 10772, 10773, 10777, 10778, 10779, 10789, 10799, 10800, 10804, 10805, 10806, 10807, 10817, 10824, 10841, 10860, 10861, 10871, 10877, 10883, 10889, 10905, 10923, 10927, 10935, 10941, 10948, 10954, 10961, 10970, 10971, 10975, 10977, 10982, 10993, 11003, 11013, 11019, 11028, 11037, 11043, 11044, 11055, 11069, 11070, 11081, 11092, 11093, 11096, 11097, 11098, 11099, 11100, 11101, 11102, 11103, 11106, 11107, 11111, 11112, 11113, 11124, 11141, 11142, 11146, 11151, 11175, 11186, 11187, 11197, 11208, 11211, 11212, 11213, 11214, 11215, 11218, 11219, 11220, 11268, 11269, 11273, 11274, 11289, 11290, 11297, 11305, 11313, 11321, 11329, 11337, 11348, 11349, 11376, 11390, 11405, 11406, 11425, 11429, 11433, 11450, 11457, 11464, 11474, 11475, 11478, 11491, 11492, 11493, 11497, 11498, 11502, 11514, 11522, 11527, 11532, 11537, 11542, 11550, 11558, 11563, 11568, 11575, 11576, 11580, 11581, 11582, 11589, 11590, 11594, 11595, 11599, 11600, 11604, 11608, 11609, 11612, 11621, 11634, 11635, 11636, 11637, 11641, 11642, 11646, 11648, 11664, 11666, 11671, 11674, 11679, 11680, 11688, 11708, 11709, 11711, 11716, 11717, 11721, 11722, 11725, 11726, 11751, 11752, 11756, 11757, 11761, 11762, 11763, 11764, 11765, 11769, 11782, 11789, 11796, 11803, 11804, 11808, 11809, 11813, 11814, 11818, 11819, 11823, 11834, 11835, 11836, 11837, 11841, 11842, 11852, 11858, 11876, 11877, 11881, 11882, 11888, 11893, 11901, 11908, 11916, 11922, 11929, 11964, 11989, 11993, 12019, 12023, 12035, 12048, 12062, 12073, 12088, 12094, 12099, 12105, 12112, 12113, 12121, 12125, 12129, 12135, 12142, 12147, 12148, 12149, 12150, 12154, 12155, 12167, 12168, 12173, 12180, 12187, 12194, 12205, 12206, 12219, 12223, 12230, 12243, 12256, 12257, 12272, 12282, 12294, 12299, 12300, 12303, 12304, 12307, 12308, 12313, 12314, 12319, 12320, 12328, 12333, 12334, 12338, 12342, 12348, 12372, 12382, 12395, 12396, 12400, 12414, 12471, 12485, 12487, 12492, 12494, 12496, 12498, 12503, 12505, 12510, 12518, 12538, 12543, 12550, 12555, 12561, 12566, 12575, 12577, 12580, 12584, 12585, 12586, 12587, 12588, 12589, 12594, 12614, 12615, 12616, 12617, 12628, 12634, 12642, 12643, 12649, 12654, 12659, 12664, 12669, 12674, 12679, 12684, 12690, 12696, 12702, 12709, 12731, 12740, 12744, 12752, 12756, 12764, 12776, 12797, 12801, 12807, 12811, 12824, 12832, 12842, 12844, 12846, 12848, 12850, 12852, 12857, 12858, 12865, 12874, 12882, 12891, 12902, 12910, 12911, 12912, 12916, 12918, 12920, 12922, 12924, 12926, 12928, 12933, 12938, 12944, 12952, 12957, 12964, 12971, 12975, 12979, 13015, 13016, 13018, 13026, 13041, 13043, 13045, 13047, 13049, 13051, 13053, 13055, 13057, 13059, 13061, 13063, 13065, 13067, 13070, 13072, 13074, 13077, 13079, 13081, 13083, 13086, 13091, 13099, 13104, 13112, 13117, 13125, 13130, 13139, 13147, 13155, 13163, 13181, 13189, 13197, 13205, 13213, 13229, 13237, 13245, 13253, 13261, 13269, 13277, 13281, 13285, 13289, 13293, 13301, 13309, 13317, 13325, 13345, 13367, 13378, 13385, 13401, 13406, 13412, 13437, 13439, 13441, 13443, 13445, 13447, 13449, 13451, 13453, 13455, 13457, 13459, 13461, 13463, 13465, 13467, 13469, 13471, 13473, 13475, 13479, 13483, 13487, 13491, 13496, 13512, 13513, 13514, 13529, 13563, 13565, 13567, 13578, 13602, 13613, 13624, 13631, 13641, 13651, 13660, 13664, 13670, 13677, 13684, 13694, 13701, 13729, 13764, 13775, 13776, 13783, 13789, 13793, 13797, 13801, 13805, 13809, 13813, 13817, 13821, 13825, 13829, 13833, 13837, 13841, 13845, 13849, 13851, 13855, 13864, 13869, 13876, 13891, 13898, 13902, 13906, 13910, 13914, 13921, 13929, 13937, 13941, 13945, 13949, 13953, 13957, 13963, 13967, 13976, 13980, 13984, 13989, 14003, 14005, 14009, 14011, 14013, 14016, 14019, 14022, 14023, 14026, 14034, 14044, 14045, 14048, 14049, 14050, 14055, 14059, 14063, 14067, 14074, 14075, 14083, 14084, 14088, 14089, 14097, 14098, 14102, 14103, 14108, 14116, 14118, 14132, 14135, 14162, 14163, 14166, 14167, 14175, 14182, 14189, 14197, 14206, 14223, 14268, 14276, 14284, 14292, 14300, 14311, 14312, 14313, 14314, 14315, 14329, 14330, 14331, 14334, 14335, 14338, 14341, 14342, 14343, 14346, 14347, 14350, 14351, 14352, 14353, 14354, 14355, 14356, 14357, 14358, 14359, 14360, 14361, 14364, 14366, 14371, 14373, 14378, 14380, 14382, 14384, 14386, 14388, 14400, 14404, 14411, 14415, 14421, 14425, 14434, 14445, 14446, 14449, 14453, 14457, 14463, 14464, 14469, 14473, 14480, 14481, 14482, 14483, 14484, 14485, 14486, 14487, 14497, 14501, 14508, 14515, 14516, 14532, 14536, 14541, 14545, 14560, 14565, 14569, 14572, 14575, 14576, 14577, 14580, 14587, 14597, 14611, 14612, 14616, 14627, 14628, 14631, 14632, 14635, 14639, 14646, 14650, 14654, 14662, 14673, 14674, 14678, 14679, 14683, 14684, 14687, 14688, 14698, 14699, 14703, 14704, 14707, 14723, 14731, 14739, 14761, 14762, 14773, 14777, 14804, 14806, 14811, 14814, 14817, 14819, 14821, 14823, 14833, 14835, 14846, 14850, 14854, 14858, 14862, 14871, 14878, 14910, 14914, 14920, 14927, 14931, 14935, 14941, 14942, 14944, 14945, 14946, 14950, 14983, 15010, 15014, 15020, 15022, 15039, 15040, 15041, 15046, 15047, 15048, 15053, 15054, 15055, 15056, 15062, 15063, 15064, 15065, 15066, 15086, 15087, 15088, 15089, 15090, 15091, 15092, 15093, 15094, 15095, 15096, 15097, 15098, 15099, 15100, 15101, 15102, 15103, 15104, 15105, 15106, 15107, 15108, 15109, 15110, 15111, 15112, 15113, 15114, 15115, 15116, 15117, 15118, 15119, 15120, 15121, 15122, 15123, 15124, 15125, 15126, 15127, 15128, 15129, 15130, 15131, 15132, 15133, 15134, 15135, 15136, 15137, 15138, 15139, 15140, 15141, 15142, 15143, 15144, 15145, 15146, 15147, 15148, 15149, 15150, 15151, 15152, 15153, 15154, 15155, 15156, 15157, 15158, 15159, 15160, 15161, 15162, 15163, 15164, 15165, 15166, 15167, 15168, 15169, 15170, 15171, 15172, 15173, 15174, 15175, 15176, 15177, 15178, 15179, 15180, 15181, 15182, 15183, 15184, 15185, 15186, 15187, 15188, 15189, 15190, 15191, 15192, 15193, 15194, 15195, 15196, 15197, 15198, 15199, 15200, 15201, 15202, 15203, 15204, 15205, 15206, 15207, 15208, 15209, 15210, 15211, 15212, 15213, 15214, 15215, 15216, 15217, 15218, 15219, 15220, 15221, 15222, 15223, 15224, 15225, 15226, 15227, 15228, 15229, 15230, 15231, 15232, 15233, 15234, 15235, 15236, 15237, 15238, 15239, 15240, 15241, 15242, 15243, 15244, 15245, 15246, 15247, 15248, 15249, 15250, 15251, 15252, 15253, 15254, 15255, 15256, 15257, 15258, 15259, 15260, 15261, 15262, 15263, 15264, 15265, 15266, 15267, 15268, 15269, 15270, 15271, 15272, 15273, 15274, 15275, 15276, 15277, 15278, 15279, 15280, 15281, 15282, 15283, 15284, 15285, 15286, 15287, 15288, 15289, 15290, 15291, 15292, 15293, 15294, 15295, 15296, 15297, 15298, 15299, 15300, 15301, 15302, 15303, 15304, 15305, 15306, 15307, 15308, 15309, 15310, 15311, 15312, 15313, 15314, 15315, 15316, 15317, 15318, 15319, 15320, 15321, 15322, 15323, 15324, 15325, 15326, 15327, 15328, 15329, 15330, 15331, 15332, 15333, 15334, 15335, 15336, 15337, 15338, 15339, 15340, 15341, 15342, 15343, 15344, 15345, 15346, 15347, 15348, 15349, 15350, 15351, 15352, 15353, 15354, 15355, 15356, 15357, 15358, 15359, 15360, 15361, 15362, 15363, 15364, 15365, 15366, 15367, 15368, 15369, 15370, 15371, 15372, 15373, 15374, 15375, 15376, 15377, 15391, 15392, 15393, 15394, 15395, 15396, 15397, 15398, 15399, 15400, 15401, 15402, 15403, 15404, 15405, 15406, 15407, 15408, 15409, 15410, 15411, 15412, 15413, 15414, 15415, 15416, 15417, 15418, 15419, 15420, 15421, 15422, 15423, 15424, 15425, 15426, 15427, 15428, 15429, 15430, 15431, 15432, 15433, 15434, 15435, 15436, 15437, 15438, 15439, 15440, 15454, 15455, 15456, 15457, 15458, 15459, 15460, 15461, 15462, 15463, 15464, 15465, 15466, 15467, 15468, 15469, 15470, 15471, 15472, 15473, 15474, 15475, 15476, 15486, 15487, 15488, 15489, 15490, 15491, 15492, 15493, 15494, 15495, 15496, 15497, 15498, 15499, 15500, 15501, 15502, 15503, 15504, 15505, 15506, 15507, 15508, 15509, 15510, 15511, 15512, 15513, 15514, 15515, 15516, 15517, 15518, 15519, 15520, 15521, 15522, 15523, 15524, 15525, 15526, 15527, 15528, 15529, 15530, 15531, 15532, 15533, 15534, 15535, 15536, 15537, 15538, 15539, 15540, 15541, 15542, 15543, 15544, 15545, 15546, 15547, 15548, 15549, 15550, 15551, 15552, 15553, 15554, 15555, 15556, 15557, 15558, 15559, 15560, 15561, 15562 }; #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", "EQUALS_GREATER", "LESS_EQUALS", "GREATER_EQUALS", "NOT_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", "ATTACH", "ATTRIBUTE", "AUTHORIZATION", "BACKWARD", "BEFORE", "BEGIN_P", "BETWEEN", "BIGINT", "BINARY", "BIT", "BOOLEAN_P", "BOTH", "BY", "CACHE", "CALL", "CALLED", "CASCADE", "CASCADED", "CASE", "CAST", "CATALOG_P", "CHAIN", "CHAR_P", "CHARACTER", "CHARACTERISTICS", "CHECK", "CHECKPOINT", "CLASS", "CLOSE", "CLUSTER", "COALESCE", "COLLATE", "COLLATION", "COLUMN", "COLUMNS", "COMMENT", "COMMENTS", "COMMIT", "COMMITTED", "CONCURRENTLY", "CONFIGURATION", "CONFLICT", "CONNECTION", "CONSTRAINT", "CONSTRAINTS", "CONTENT_P", "CONTINUE_P", "CONVERSION_P", "COPY", "COST", "CREATE", "CROSS", "CSV", "CUBE", "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", "DEPENDS", "DESC", "DETACH", "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", "GENERATED", "GLOBAL", "GRANT", "GRANTED", "GREATEST", "GROUP_P", "GROUPING", "GROUPS", "HANDLER", "HAVING", "HEADER_P", "HOLD", "HOUR_P", "IDENTITY_P", "IF_P", "ILIKE", "IMMEDIATE", "IMMUTABLE", "IMPLICIT_P", "IMPORT_P", "IN_P", "INCLUDE", "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", "LEADING", "LEAKPROOF", "LEAST", "LEFT", "LEVEL", "LIKE", "LIMIT", "LISTEN", "LOAD", "LOCAL", "LOCALTIME", "LOCALTIMESTAMP", "LOCATION", "LOCK_P", "LOCKED", "LOGGED", "MAPPING", "MATCH", "MATERIALIZED", "MAXVALUE", "METHOD", "MINUTE_P", "MINVALUE", "MODE", "MONTH_P", "MOVE", "NAME_P", "NAMES", "NATIONAL", "NATURAL", "NCHAR", "NEW", "NEXT", "NO", "NONE", "NOT", "NOTHING", "NOTIFY", "NOTNULL", "NOWAIT", "NULL_P", "NULLIF", "NULLS_P", "NUMERIC", "OBJECT_P", "OF", "OFF", "OFFSET", "OIDS", "OLD", "ON", "ONLY", "OPERATOR", "OPTION", "OPTIONS", "OR", "ORDER", "ORDINALITY", "OTHERS", "OUT_P", "OUTER_P", "OVER", "OVERLAPS", "OVERLAY", "OVERRIDING", "OWNED", "OWNER", "PARALLEL", "PARSER", "PARTIAL", "PARTITION", "PASSING", "PASSWORD", "PGPOOL", "PLACING", "PLANS", "POLICY", "POSITION", "PRECEDING", "PRECISION", "PRESERVE", "PREPARE", "PREPARED", "PRIMARY", "PRIOR", "PRIVILEGES", "PROCEDURAL", "PROCEDURE", "PROCEDURES", "PROGRAM", "PUBLICATION", "QUOTE", "RANGE", "READ", "REAL", "REASSIGN", "RECHECK", "RECURSIVE", "REF", "REFERENCES", "REFERENCING", "REFRESH", "REINDEX", "RELATIVE_P", "RELEASE", "RENAME", "REPEATABLE", "REPLACE", "REPLICA", "RESET", "RESTART", "RESTRICT", "RETURNING", "RETURNS", "REVOKE", "RIGHT", "ROLE", "ROLLBACK", "ROLLUP", "ROUTINE", "ROUTINES", "ROW", "ROWS", "RULE", "SAVEPOINT", "SCHEMA", "SCHEMAS", "SCROLL", "SEARCH", "SECOND_P", "SECURITY", "SELECT", "SEQUENCE", "SEQUENCES", "SERIALIZABLE", "SERVER", "SESSION", "SESSION_USER", "SET", "SETS", "SETOF", "SHARE", "SHOW", "SIMILAR", "SIMPLE", "SKIP", "SMALLINT", "SNAPSHOT", "SOME", "SQL_P", "STABLE", "STANDALONE_P", "START", "STATEMENT", "STATISTICS", "STDIN", "STDOUT", "STORAGE", "STORED", "STRICT_P", "STRIP_P", "SUBSCRIPTION", "SUBSTRING", "SUPPORT", "SYMMETRIC", "SYSID", "SYSTEM_P", "TABLE", "TABLES", "TABLESAMPLE", "TABLESPACE", "TEMP", "TEMPLATE", "TEMPORARY", "TEXT_P", "THEN", "TIES", "TIME", "TIMESTAMP", "TO", "TRAILING", "TRANSACTION", "TRANSFORM", "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", "XMLNAMESPACES", "XMLPARSE", "XMLPI", "XMLROOT", "XMLSERIALIZE", "XMLTABLE", "YEAR_P", "YES_P", "ZONE", "NOT_LA", "NULLS_LA", "WITH_LA", "'<'", "'>'", "'='", "POSTFIXOP", "'+'", "'-'", "'*'", "'/'", "'%'", "'^'", "UMINUS", "'['", "']'", "'('", "')'", "'.'", "';'", "','", "':'", "$accept", "stmtblock", "stmtmulti", "stmt", "CallStmt", "CreateRoleStmt", "opt_with", "OptRoleList", "AlterOptRoleList", "AlterOptRoleElem", "CreateOptRoleElem", "CreateUserStmt", "AlterRoleStmt", "opt_in_database", "AlterRoleSetStmt", "DropRoleStmt", "CreateGroupStmt", "AlterGroupStmt", "add_drop", "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", "reset_rest", "generic_reset", "SetResetClause", "FunctionSetResetClause", "VariableShowStmt", "ConstraintsSetStmt", "constraints_set_list", "constraints_set_mode", "CheckPointStmt", "DiscardStmt", "AlterTableStmt", "alter_table_cmds", "partition_cmd", "index_partition_cmd", "alter_table_cmd", "alter_column_default", "opt_drop_behavior", "opt_collate_clause", "alter_using", "replica_identity", "reloptions", "opt_reloptions", "reloption_list", "reloption_elem", "alter_identity_column_option_list", "alter_identity_column_option", "PartitionBoundSpec", "hash_partbound_elem", "hash_partbound", "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", "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", "generated_when", "ConstraintAttr", "TableLikeClause", "TableLikeOptionList", "TableLikeOption", "TableConstraint", "ConstraintElem", "opt_no_inherit", "opt_column_list", "columnList", "columnElem", "opt_c_include", "key_match", "ExclusionConstraintList", "ExclusionConstraintElem", "ExclusionWhereClause", "key_actions", "key_update", "key_delete", "key_action", "OptInherit", "OptPartitionSpec", "PartitionSpec", "part_strategy", "part_params", "part_elem", "table_access_method_clause", "OptWith", "OnCommitOption", "OptTableSpace", "OptConsTableSpace", "ExistingIndex", "CreateStatsStmt", "CreateAsStmt", "create_as_target", "opt_with_data", "CreateMatViewStmt", "create_mv_target", "OptNoLog", "RefreshMatViewStmt", "CreateSeqStmt", "AlterSeqStmt", "OptSeqOptList", "OptParenthesizedSeqOptList", "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", "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", "AlterForeignServerStmt", "CreateForeignTableStmt", "AlterForeignTableStmt", "ImportForeignSchemaStmt", "import_qualification_type", "import_qualification", "CreateUserMappingStmt", "auth_ident", "DropUserMappingStmt", "AlterUserMappingStmt", "CreatePolicyStmt", "AlterPolicyStmt", "RowSecurityOptionalExpr", "RowSecurityOptionalWithCheck", "RowSecurityDefaultToRole", "RowSecurityOptionalToRole", "RowSecurityDefaultPermissive", "RowSecurityDefaultForCmd", "row_security_cmd", "CreateAmStmt", "am_type", "CreateTrigStmt", "TriggerActionTime", "TriggerEvents", "TriggerOneEvent", "TriggerReferencing", "TriggerTransitions", "TriggerTransition", "TransitionOldOrNew", "TransitionRowOrTable", "TransitionRelName", "TriggerForSpec", "TriggerForOptEach", "TriggerForType", "TriggerWhen", "FUNCTION_or_PROCEDURE", "TriggerFuncArgs", "TriggerFuncArg", "OptConstrFromTable", "ConstraintAttributeSpec", "ConstraintAttributeElem", "CreateEventTrigStmt", "event_trigger_when_list", "event_trigger_when_item", "event_trigger_value_list", "AlterEventTrigStmt", "enable_trigger", "CreateAssertionStmt", "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", "drop_type_name", "drop_type_name_on_any_name", "any_name_list", "any_name", "attrs", "type_name_list", "TruncateStmt", "opt_restart_seqs", "CommentStmt", "comment_type_any_name", "comment_type_name", "comment_text", "SecLabelStmt", "opt_provider", "security_label_type_any_name", "security_label_type_name", "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", "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_include", "index_including_params", "opt_collate", "opt_class", "opt_asc_desc", "opt_nulls_order", "CreateFunctionStmt", "opt_or_replace", "func_args", "func_args_list", "function_with_argtypes_list", "function_with_argtypes", "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", "aggregate_with_argtypes", "aggregate_with_argtypes_list", "createfunc_opt_list", "common_func_opt_item", "createfunc_opt_item", "func_as", "transform_type_list", "opt_definition", "table_func_column", "table_func_column_list", "AlterFunctionStmt", "alterfunc_opt_list", "opt_restrict", "RemoveFuncStmt", "RemoveAggrStmt", "RemoveOperStmt", "oper_argtypes", "any_operator", "operator_with_argtypes_list", "operator_with_argtypes", "DoStmt", "dostmt_opt_list", "dostmt_opt_item", "CreateCastStmt", "cast_context", "DropCastStmt", "opt_if_exists", "CreateTransformStmt", "transform_element_list", "DropTransformStmt", "ReindexStmt", "reindex_target_type", "reindex_target_multitable", "reindex_option_list", "reindex_option_elem", "AlterTblSpcStmt", "RenameStmt", "opt_column", "opt_set_data", "AlterObjectDependsStmt", "AlterObjectSchemaStmt", "AlterOperatorStmt", "operator_def_list", "operator_def_elem", "operator_def_arg", "AlterOwnerStmt", "CreatePublicationStmt", "opt_publication_for_tables", "publication_for_tables", "AlterPublicationStmt", "CreateSubscriptionStmt", "publication_name_list", "publication_name_item", "AlterSubscriptionStmt", "DropSubscriptionStmt", "RuleStmt", "RuleActionList", "RuleActionMulti", "RuleActionStmt", "RuleActionStmtOrEmpty", "event", "opt_instead", "NotifyStmt", "notify_payload", "ListenStmt", "UnlistenStmt", "TransactionStmt", "opt_transaction", "transaction_mode_item", "transaction_mode_list", "transaction_mode_list_or_empty", "opt_transaction_chain", "ViewStmt", "opt_check_option", "LoadStmt", "CreatedbStmt", "createdb_opt_list", "createdb_opt_items", "createdb_opt_item", "createdb_opt_name", "opt_equal", "AlterDatabaseStmt", "AlterDatabaseSetStmt", "DropdbStmt", "AlterCollationStmt", "AlterSystemStmt", "CreateDomainStmt", "AlterDomainStmt", "opt_as", "AlterTSDictionaryStmt", "AlterTSConfigurationStmt", "any_with", "CreateConversionStmt", "ClusterStmt", "cluster_index_specification", "VacuumStmt", "AnalyzeStmt", "vac_analyze_option_list", "analyze_keyword", "vac_analyze_option_elem", "vac_analyze_option_name", "vac_analyze_option_arg", "opt_analyze", "opt_verbose", "opt_full", "opt_freeze", "opt_name_list", "vacuum_relation", "vacuum_relation_list", "opt_vacuum_relation_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_target", "insert_rest", "override_kind", "insert_column_list", "insert_column_item", "opt_on_conflict", "opt_conf_expr", "returning_clause", "DeleteStmt", "using_clause", "LockStmt", "opt_lock", "lock_type", "opt_nowait", "opt_nowait_or_skip", "UpdateStmt", "set_clause_list", "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_materialized", "opt_with_clause", "into_clause", "OptTempTableName", "opt_table", "all_or_distinct", "distinct_clause", "opt_all_clause", "opt_sort_clause", "sort_clause", "sortby_list", "sortby", "select_limit", "opt_select_limit", "limit_clause", "offset_clause", "select_limit_value", "select_offset_value", "select_fetch_first_value", "I_or_F_const", "row_or_rows", "first_or_next", "group_clause", "group_by_list", "group_by_item", "empty_grouping_set", "rollup_clause", "cube_clause", "grouping_sets_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", "tablesample_clause", "opt_repeatable_clause", "func_table", "rowsfrom_item", "rowsfrom_list", "opt_col_def_list", "opt_ordinality", "where_clause", "where_or_current_clause", "OptTableFuncElementList", "TableFuncElementList", "TableFuncElement", "xmltable", "xmltable_column_list", "xmltable_column_el", "xmltable_column_option_list", "xmltable_column_option_el", "xml_namespace_list", "xml_namespace_el", "Typename", "opt_array_bounds", "SimpleTypename", "ConstTypename", "GenericType", "opt_type_modifiers", "Numeric", "opt_float", "Bit", "ConstBit", "BitWithLength", "BitWithoutLength", "Character", "ConstCharacter", "CharacterWithLength", "CharacterWithoutLength", "character", "opt_varying", "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", "xml_passing_mech", "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", "opt_window_exclusion_clause", "row", "explicit_row", "implicit_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", "opt_slice_bound", "indirection", "opt_indirection", "opt_asymmetric", "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", "SignedIconst", "RoleId", "RoleSpec", "role_list", "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, 678, 679, 680, 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, 691, 692, 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, 703, 704, 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, 715, 716, 717, 718, 60, 62, 61, 719, 43, 45, 42, 47, 37, 94, 720, 91, 93, 40, 41, 46, 59, 44, 58 }; # endif #define YYPACT_NINF -4903 #define yypact_value_is_default(Yystate) \ (!!((Yystate) == (-4903))) #define YYTABLE_NINF -2635 #define yytable_value_is_error(Yytable_value) \ (!!((Yytable_value) == (-2635))) /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing STATE-NUM. */ static const int yypact[] = { 5651, 1174, 15008, -4903, -4903, 1174, 62771, -4903, 70557, 57, 704, 1192, 190, 13386, 71015, 78801, 566, 900, 13924, 1174, 78801, 2242, 54069, 67809, 873, 78801, 1104, 902, 54069, 78801, 1776, 79259, 1080, 1182, 197, 79717, 71473, 66435, 1198, 78801, 1436, 1292, 80175, 71931, 1205, 72389, 902, 50433, 373, 1429, 80633, 78801, 1798, 1705, 1370, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, 1218, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, 1937, -4903, 1092, 2169, 1117, 865, 1480, -4903, -4903, 1893, 62771, 78801, 78801, 78801, 1701, 78801, 1616, 78801, 213, 62771, 58649, 72847, 1770, 1640, 46763, 81091, -4903, 62771, 78801, 56817, 62771, 78801, 78801, 81549, 78801, 78801, 78801, 1631, 69183, 78801, 1793, 78801, 78801, 57275, 82007, 1914, 1317, 219, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, 1696, 1745, -4903, 257, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, 78801, 14344, 1104, 1893, -4903, 1798, 78801, 1920, 78801, 1699, 82465, 1791, 78801, -4903, 78801, 1828, 82923, 481, 1597, 58649, 1691, 47222, 1875, 78801, 78801, 58649, 83381, 83839, 84297, 78801, 78801, -4903, -4903, 1909, 78801, 78801, -4903, 2026, 59107, 1427, 2037, 2211, 2094, 899, -4903, 73305, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, 61855, 900, -4903, -4903, 2100, 63229, 2137, -4903, -4903, 84755,101173, 1905, -4903, 511, 63687, 59565, 2277, 1944, 47681, 2294, -4903, 64145, -4903, 60023, 64603, -4903, -4903, -4903, -4903, -4903, 85213, -4903, 85671, 2034, 2137, -4903,101617, 60481, -4903, 2174, 86129, 86587, 87045, 1893, 1916, 2014, 2167, 42608, -4903, -4903, -4903, 57, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, 303, 1727, 313, 227, 327, -4903, -4903, 236, 237, 240, 303, 2389, 2389, -4903, 78801, -4903, -4903, 1727, 616, 1925, 1925, 1925, 2163, -1, -4903, 1925, 2099, -4903, -4903, -4903, -4903, 72389, -4903, 1957, 73763, 78801, 74221, 1104, 1989, 2425, 2038, -4903, -4903, -4903, -4903, -4903, 2061, 2421, 2421, 78801, -4903, -4903, 2505, 2048, 2286, 2040, -4903, -4903, -4903, 2280, 2287, 2296, 100, 1104, 273, -4903, 2411, -4903, 2306, 29469, 29469, 1104, 74679, 87503, 242, 61855, 1104, 75137, 2129, 218, 2339, -4903, -4903, -4903, 393, -4903, 2584, 2187, 2441, 2040, 1317, 43990, -4903, 2210, 1745, 72389, -4903, -4903, -4903, 60939, 2497, 31369, 78801, 2217, -4903, 2191, 2217, 2224, 2233, 1117, -4903, 5651, 60939, 78801, 1529, 1529, 2667, 1529, 1641, 1658, -4903, 2490, -4903, 2564, 2544, 72389, 2269, 302, -4903, 1491, 2285, 1782, 2253, 1553, 1444, -4903, -4903, 795, 78801, 462, 2331, 75595, 7512, 2304, 1745, 2309, -4903, -4903, -4903, 2469, 362, -4903, -4903, -4903, -4903, 2610, 2652, 9082, 274, 76053, -4903, -4903, -4903, -4903, 78801, 78801, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, 2326, 97, -4903, -4903, 2332, 2659, 2548, 11408, 1113, 2626, 2515, 1495, 12767, 2550, 133, 2675, 13459, 1228, 1732, 2116, 73763, 78801, 2636, 2689, 5191, 1751, 781, 2578, 913, 2626, 2694, 2532, 1495, 2711, 8062, 78801, -4903, 2635, 2756, 110, -4903, 196, -4903, 24329, 31369, 49975, -4903, 1745, 2453, 2625, 88, 2640, 62771, 2419, -4903, -4903, 78801, -4903, -4903,102061, 2480, -4903, 771, 62771, -4903, 2637, 2471, 48140, 78801, 62771, -4903, -4903, 62771, 78801, -4903, -4903, -4903, -4903, -4903, -4903, -4903, 2555, 2750, 78801, 102061, -4903, 2697, 78801, 78801, -4903, -4903, 2436, -4903, -4903, -4903, -4903, 1925, 78801, 2850,102061, 2676, 174, 78801, -15, 2886, 78801, 2682, -15, 2503, 87961, -4903, -4903, -15, -4903, -4903, -4903, 78801, 78801, 2472, 1902, 2684, 2797, -15, 2707, 2928, 2929, 2725, 2577, 2732, 2191, 2914, 2719, 1000, 1041, 193, 1706, -15, 2572, 88419, 88877, 78801, 2591, 78801, 2421, 62771, 62771, 62771, 78801, 2868, -4903, 2727, -4903, -4903, 1047, -4903, -4903, -4903, -4903, -4903, 2900, -4903, 187, 2907, 2582, 2918, -4903, -4903, -4903, 2647, -4903, 2647, 2647, 2611, 2611, 2757, 2623, 2919, -4903, -4903, -4903, 2183, 2647, 2611, -4903, 102949, -4903, 1459, 1533, -4903, 201, -4903, 3049, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, 2624, -4903, 948, 1830, -4903, -4903, 2666, -4903, 2965, 223, -4903, 2969, -4903, 2656, 89335, -4903, 89793, 90251, 2970, 305, -4903, 58649, 2971, 223, 2990, 2656, 2992, 223, 2993, 825, 2994, -4903, 1045, 2983, 2997, 201, 3000, 1763, 2656, 62313, 3002, 322, -4903, 3003, 355, -4903, 3005, 2883, -4903, 31369, -4903, 2767, -4903, 1429, -4903, -42, -4903, 53153, -4903, 2167, 1727, -4903, 78801, 1727, 78801, 1727, 78801, 1727, 78801, 1727, 78801, 78801, 78801, 1727, -4903, -4903, -4903, 78801, 2677, 78801, 78801, -4903, -4903, -4903, 68267, 58649, 68725, -4903, 78801, -4903, 360, 1104, -4903, -4903, -4903, 1326, -4903, 2040, -4903,102061, 3120, 58649, 2421, -4903, 1779, -4903, -4903, 78801, 78801, -4903, -4903, -4903, 2933, 78801, 2999, 3001, 68267, 58649, -4903, 90709, -4903, 61855, 2889, 2683, -4903, -4903, -4903, -4903, -4903, 1849, 3156, 217, 3157, 31369, 2686, 217, 217, 2687, 3008, -4903, -4903, -4903, 260, 2690, 2691, -4903, 229, 229, -4903, 2692, 2693, -4903, 241, 2696, 2700, 3166, 3169, 248, 2702, 2703, 2704, 2183, 217, 31369, -4903, 2705, 229, 2708, 2710, 2713, 3183, 2714, -4903, 3189, 2722, 267, 372, 2723, 2724, -4903, 2692, -4903, 263, 2726, 2734, 2735, 2738, 2742, 2745, 2746, 2747, 31369, 31369, 31369, -4903, 28044, 1745, 1104, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, 270, 4679, -4903, 2755, -4903, -4903, 2945, -4903, -4903, 31369, -4903, -4903, 743, -4903, 280, -4903, -4903, -4903, 1745, 3021, 2751, -4903, -4903, 281, 2760, -4903, 387, -4903, -4903, -4903, -4903, -4903, -4903, 61397, 3201, -4903, 417, 1104, 196, 331, 3143, 52237, 52695, -4903, -4903, 3019, -4903, 78801, -4903, -4903, 1745, 165, 1880, -4903, -4903, 53153, -4903, -4903, 57, 13198, 1940, 2217, 78801, 78801, 3209, -4903, -4903, -4903, 1941, -4903, 2764, -4903, 2191, -4903, -4903, 1117, 1117, 31369, 1117, 1342, 1425, 29944, 31844, 3088, 2984, 1463, 1356, 3091, -4903, 2987, 1641, 1658, 72389, 78801, 91167, 2895, 31369, -4903, 3191, 2856, 2858, 2913, 51349, -4903, 2860, 2827, 2862, 2920, 54985, 2786, 2869, 2874, 2922, -4903, 3048, -4903, -4903, 2876, 2947, 2878, 91625, -4903, -4903, 836, -4903, -4903, -4903, 836, -4903, 2811, 1534, 767, 1018, 2880, 444, 967, 3195, -4903, 1178, -4903, -4903, 2936, -4903, 6950, 78801, 3135, 8401, 3013, 274, 3014, 2935, -4903, -4903, 3065, 2890, 78801, 2891, 3028, 274, 1337, 92083, -4903, -4903, 78801, -4903, -4903, -4903, -4903, 4738, 27155, -4903, 1950, 2893, 2870, 2903, 78801, 65519, 367, 3007, 3029, 3030, 1266, 2091, 230, 2957, 78801, 1116, 3036, 78801, 2824, 2908, 2923, 3122, 2828, 1231, 3227, 2831, -4903, -4903, -4903, -4903, 2204, 2218, 3032, -4903, 3136, 3179, 6078, 2911, 2912, 99841, -4903, 2930, 34, 48599, 78801, 78801, 3060, 2937, 2939, 92541, 4738, 2948, 2952, 2941, 2943, 0, 3236, 1740, 2946, -4903, -4903, -4903, 1740, 3074, 2949, 2954, 92999, 4738, 78801, 2955, 2960, 78801,102949, 274, -4903, 3292, 274, 274, 1733, 3297, 2961, 438, 3110, 1251, -15, 2831, 2892, -4903, 2962, 2963, 310, -4903, 3089, 2967, 2968, 3024, 1104, -4903, -4903, 2972, 3062, 2974, 19, -4903, -4903, 2980, 72389, 3084, 3085, 232, 1378, 2831, -4903, 2977, 2978, 2828, 2828, 78801, 78801, 78801, 78801, 78801, 222, 3321, 3335, 2981, 212, 3034, 2899, -4903, 1740, 57733, 2985, -4903, 1740, 78801, 2988, 1790, 2831, 1614, 1760, -4903, -4903, -4903, 1317, -4903, 31369, 31369, 31369, 2915, -4903, 2399, 13198, 788, -4903, 284, 11017, 2916, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, 78801, -4903, 78801, -4903, 3173,102061, 3116, 3182, -4903, 2956, -4903, 3193, 274, -4903, 78801, 78801, 3194, 3137, 3196, 3198, 3139, 1070,102061, 3140, 3202, -4903, 3203, 3204, 3006, 163, 3016, 2944, 3375, 3268, 78801, 54985, -4903, 3401, 836, -4903,102061, 3162, 3280, -4903, 78801, 3178, 44, -4903, 3322, 3012, -4903, -4903, 59, 78801, 258, 2996, -4903, -4903, 3291, 58649, 1283, 3293, 1104, 3009, 3296, 3174, 1104, 58649, 3214, 78801, 78801, 78801, 78801, -4903, -4903, 3184, 1011, 162, -4903, 57733, 3192, -4903, 78801, 3197, 2892, 3199, 3414, 83, 1925, 93457, 3289, 93915, 2973, 2979, 2979, 3419,102061, 3240, -4903, 1986, -4903, 3111, -4903, 62771, -4903, -4903, 62771, -4903, -4903,102061, 78801, -4903, 2986, -4903, -4903, 31369, -4903, -4903, -4903, 2389, -4903,102061, 2647, 2647, -4903, -4903, 3428, 3068, 3072, 2389, -4903, 2389, -4903, 102061, -4903, 2995, 2998, 2389, 3073, 3076, 3080, -4903, 3004, 3081, 2389, -4903, -4903, 1960, -4903, -4903, 62771, 62771, -4903, 58649, 58649, 3326, 322, 3337, 3069, 3355, 3082, 48599, 48599, -4903, 380, 62771, -4903, 58649, 62771, -4903, 78801, -4903, 78801, -4903, -4903, -4903, -4903,102061,102061, -4903, 58649, 57733, 3356, 3360, 825, 78801, 78801, -4903, 78801, 78801, -4903, 78801, 78801, 1952, 94373, 2167, 60939, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, 78801, -4903, 78801, -4903, 78801, -4903, 78801, -4903, 78801, -4903, -4903, -4903, 78801, -4903, 78801, 1975, -4903, -4903, 1980, 1332, 78801, 78801, 778, 62771, 78801, 3244, 62771, 62771, 78801, 78801, 78801, 78801, 78801, 3113, 2760, 1540, -4903, 250, 793, 72389, 3251, -4903, -4903, 1981, 1798, 519, 78801, 1088, 2061, -4903, -4903, -4903, -4903, 68725, 67809, 3349, 144, 78801, -4903, -4903, 6748, 31369, 1745, 28994, -4903, -4903, 13198, 3077, 31369, 31369, 3038, 2389, 2389, -4903, 992, 31369, 31369, 31369, 2389, 2389, 9477, 31369, 48599, 31369, 36594, 25281, 31369, 31369, 28519, -4903, 31369, 3271, 38007, 31369, 331, 3272, 31369, 331, 9477, 3508, 3508, 1688, 6102, 3039, 1745, -4903, 2389, 1049, -4903, 412,102061, 31369, 31369, 31369, 31369, 54985, 3125, 251, 78801, 31369, 3046, 2000, -4903, 31369, -4903, 3047, 31369, 3127, 905, 31369, 31369, 31369, 31369, 31369, 31369, 31369, 31369, 31369, -4903, 39387, 427, 3354, 3374, 21, 496, 76511, 29469, 3368, 24329, -4903, 252, 3368, -4903, -4903, -4903, 78801, 3201, -4903, -4903, 3132, -4903, -4903, -4903, -4903, -4903, 289, -4903, -4903, -4903, -4903, -4903, -4903, -4903, 3053, -4903, -4903, -4903, -4903, 3053, -4903, 3058, 3358, 3359, 825, 78801, 60939, -4903, -4903, -4903, 2418, -4903, 31369, -4903, 1998, 1839, 78801, 78801, -4903, 3338, -4903, 3059, -4903, 11247, 3338, -4903, -4903, 37063, 3185, 3333, 3279, -4903, -4903, -4903, 3070, 13198, 32319, 32319, -4903, 2172, 13198, 2189, -4903, -4903, -4903, -4903, -4903, -4903, 143, -4903, 78801, 118, 3088, 1356, 3129, 983, 3519, 78801, -4903, 44450, 2008, -4903, 58649, 78801, 78801, 3277, -4903, 3503, -4903, 102949, -4903, 3086, -4903,102505, 98495, -4903, -4903, 976, -4903, 869, 58649, -4903, 78801, 78801, -4903, 54985, 58649, 78801, 78801, -4903, 58649, 78801, 78801, -4903, -4903, -4903, -4903, -4903, 53611, 58, 67809, 3216, 66893, -4903, -4903, 3094, 78801, 3141, 3345, 3350, -11, -4903, -4903, 94831, -4903, 3306, 58649, 78801, 78801, 31369, 3315, 78801, 78801, -4903, 326, 3177, 3200, -4903, 78801, 3205, 3341, 62771, 3099, 78801, 78801,102061, 3180, 803, 62771, 3148, 49058, 62771, 62771, 78801, 78801, 78801, 78801, 3235, 3431, 102061, 78801, 3376, 1193, 72389, 295, 2063, 2831, 3331, -4903, 3444, 1454, -4903, 58649, -4903, 78801, 3324, -4903, -4903, -4903, 76969, 3552, 3230, -4903, -4903, -4903, 95289, -4903, -4903, -4903, 2013, -4903, 58649, 58649, 78801, 10199, 95747, -8, 3346, -4903, -4903,102061, -4903, 78801, 77427, 78801, 78801, 3453, 3381, 78801, 69641, 96205, 96663, 581, 921, 3382, 78801, 70099, 3384, -4903, 3270, 78801, -4903, -4903, 55443, 58649, 78801, 790, 54985, -4903, -4903, 78801, -4903, 1001, -4903, 78801, 7181, -4903, -4903, 3210, 3222, 78801, 3344, 432, 2126, 2831, 78801, 78801, 3133, 2017, 58649, 78801, 54985, -4903, 3348, 614, 3467, 58649, 78801, 76969, -4903, 72389, 72389, 58649, 78801, 72389, -4903, 78801, 87503, -4903, 58649, 1071, -4903, 3470, 58649, 78801, 76969, -4903, 3302, 58649, 78801, 13497, -4903, -4903, -4903, 274, -4903, -4903, -4903, -4903, -4903, 78801, 78801, 274, 78801, 78801, 274, 264, -4903, 58649, 78801, -4903, -4903, -4903, 58649, 78801, 78801, -4903, 58649, 2996, 78801, 54985, -4903, 78801, 9869, 78801, 78801, 78801, 78801, 78801, 78801, 58649, 78801, -4903, -4903, 1109, 1297, 619, 956, 854, 78801, 3447, 78801, 97121, 58649, 78801, 78801, 1104, 78801, 1348, -4903, -4903, 3275, -4903, 58649, 1071, -4903, 10582, 78801, 78801, 3234, 3237, 169, 3327, -4903, -4903, -4903, 847, 847, 3365, -4903, 31369, 31369, 30419, 3155, -4903, -4903, 31369, -4903, -4903, -4903, 314, 3599, 97579, 314, -4903, 314, 3432, 3221, 3225, 314, 78801, 314, 314, 78801, -4903, -4903, -4903, -4903, 3434, 78801, 314, 314, 314, 3342, -4903, -4903, 3342, 892, 31369, 102061, 78801, -4903, 2025, -4903, 3186, 1011, -4903, -4903, 54985, 78801, 231, 709, 3507, 3390, 65977, 2598, 3497, 78801, 3224, 78801, 3623, 3273, 72389, 2472, -4903, 2598, 78801, -4903, 2434, 67809, -4903, -4903, -4903, -4903, -4903, -4903, -4903, 78801, -4903, -4903, 3501, 78801, 31369, 3353, -4903, 1104, 2472, 2472, 2472, 2472, -4903, -4903, -4903, -4903, 3404, 2012, -4903, 3207, 2472, 78801, 3316, 3525, 2598, 3208, 3526, -4903, 2892, 3527, 111, 78801, 3410, 65977, 3254, 3238, 3422, 3642, 1925, 1104, 3425, 3411, -4903, 51793, -4903, 2472, 27599, 6039, 8031, 3413, 3466, 61855, 3509, 3510, 3531, -4903, 187, -4903, 3655, -4903, 31369, 2043, 3219, 201, -4903, -4903, 3217, 2998, 3239, 3243, 3220, 3226, -4903, 2389, 226, 3228, 1141, 1142, 3352, 2389, 3451, 3229, -4903, 223, -4903, 2656, -4903, 78801, -4903, 78801, 78801, 78801, 78801, 305, -4903, -4903, 223, 2656, 223, 825, -4903, 3490, 201, 2656, 3357, 3550, 61855, -4903, 322, -4903, 355, -4903, 3440, 825, -4903, 3456, 1925, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, 2060, -4903, 78801, -4903, 3528, 3532, 3535, 3536, 3537, 3232, 3233, 3274, 78801, 3245, 3232, 274, 3245, 3245, 3232, 2760, 2760, 3232, 3233, 58191, 3702, 3557, -4903, 3332, 3252, 3568, 186, -4903, 199, 68, 3492, -4903, -4903, -4903, -4903,102061, -4903, 58649, 3298, 2421, 2421, -4903, 139, 3468, 3255, 58191, 3687, 825, -4903, 62771, -4903, -4903, 102061, 3340, 3362, 62771, 3478, 3311, 62771, -4903, -4903, 62771, -4903, -4903, -4903, -4903, -4903,102061, -4903, 3538, 78801, 78801, 2064, -4903, -4903, 1819, -4903, 1840, 31369, 419, -4903, 11977, 2069, 31369, 3276, 3278, -4903, -4903, -4903, -4903, -4903, -4903, -4903, 3281, 3583, -4903, 2079, 2089, 2112, 3282, 3283, 3412, 3284, 12098, 3295, 3300, 36594, 36594, 28044, 1900, -4903, 36594, 3301, 3471, 2117, 11310, 3294, 3304, 12257, 30894, 31369, 30894, 30894, 12568, 3294, 3307, 2127, 54985, 3465, 12725, 2148, -4903, 31369, 54985, 5590, 31369, -4903, 31369, 3309, -4903, -4903, 5155, 5155, 5155, 9477, -4903, 3318, -4903, 36594, 36594, -4903, 2736, 28044, -4903, -4903, 3594, -4903, -4903, 1731, -4903, 3312, -4903, -4903, 3772, 48599, 8440, 31369, 278, 31369, 3046, 31369, 3378, 5155, 5155, 5155, 423, 423, 268, 268, 268, 2075, 496, -4903, -4903, -4903, 3313, 3314, 3317, 3512, 3319, 31369, -4903, 2092, 2133, 78801, 2909, 2917, 4025, -4903, -4903, -4903, 40308, 3351, 788, 3351, -4903, 1317, 2389, 1049, 53153, -4903, -4903, -4903, -4903, -4903, -4903, -4903, 78801, 13198, -4903, -4903, 3521, 3320, -4903, -4903, 31369, -4903, -4903, 1095, 3336, 71, 3530, 2311, 2311, 2172, 3533, -4903, -4903, 3383, -4903, 31369, 2196, -4903, 2244, -4903, -4903, -4903, -4903, 2760, -4903, 3562, -4903, -4903, -4903, 40308, 3369, 3386, 1350, 43529, 3542, -4903, 78801, -4903, 78801, 168, -4903, 3339, -4903, -4903, -4903, -4903, -4903, -4903, 98495, 1830, -4903,102505, -4903,102505, -4903, 1830, 3761, -4903, 98495, 1918, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, 58649, 58649, 3546, 78801, 3544, 3548, 31369, 1006, 78801, 3343, 3347, 601, 3627, 78801, -4903, 3675, 825, -4903, -4903, 3424, -4903, 13198, -4903, -4903, -4903, -4903, -4903, 58649, 78801, -4903, 61855, -4903, 78801, -4903, 102061, -4903, -4903, -4903, 78801, 3385, 78801, -4903, 78801, 78801, 78801, -4903, -4903, -4903, -4903, -4903, -4903, -4903, 1148,102061, -4903, -4903, 78801, 78801, 755, 3429, 3435, 78801, -4903, 1305, 3089, 11007, 78801, 78801, 78801, 3635, 78801, -4903, -4903, -4903, -4903, 3576, -4903, -4903, 98495, -4903, 2656, 114, 3438, 2831, 3584, -4903, 3691, 3567, -4903, 3484, 1196, -4903, -4903, 78801, 3493, -4903, -4903, -4903, -4903, 3697, 825, 3700, 825, 78801, 78801, 78801, 78801, 3498, -4903, -4903, -4903, -4903, 3499, 3626, -4903, 54985, 54985, 54985, 2154, -4903, -4903, 1104, -4903, -4903, -4903, -4903, -4903, -4903, 3659, -4903, 2158, -4903, 1725, -4903, -4903, -4903, -4903, -4903, 58649, 78801, 12328, 3703, 78801, 78801, 78801, 1803, -4903, 1164,102061, -4903,100285, -4903, -4903, 2164, -4903, 3387, 78801, 3457, 58649, 3436, 78801, -4903, -4903, -4903, 3379, 3379, -4903, -4903, 3379, -4903, -4903, -4903, 3634, 3571, -4903, 318, 3574, 58649, 3448, -4903, 78801, -4903, -4903, -4903, 3469, -4903, -4903, 3472, 2146, 2831, 2892, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, 1654, -4903, -4903, 1479, 335, 2276, 2831, -4903, 1364, -4903, 3473, -4903, 3474, -4903, -4903, -4903, 3633, 3639, 3640, 3489, 3491, 3555, 3494, 3502, 3558, -4903, 3505, 3560, 3511, 3561, 3621, 3514, 825,102061, 3652, 1104, 3553, 3767, 825, -4903, 3534, -4903, 3539, -4903, 3865, -4903, 78801, -4903, 3543, 2352, 2831, -4903, -4903, 58649, 78801, -4903, -4903, -4903, 31369, 3446, 3455, 3462, 13198, 13198, 31369, -4903, -4903, 13198, 3449, -4903, -4903, -4903,102061, 78801, 3717, -4903, -4903, 314, 78801, 78801, -4903, 3719, -4903, -4903, 3720, 78801, 3726, -4903, -4903, -4903, -4903, 306, 306, -4903, -4903, 3770, 6232, 3464, 376, -4903, 54985, 45833, 2068, 2665, 164, -15, -4903, 61855, 78801, 61855, -4903, 709, 3567, 78801, 78801, 78801, 3475, 3476, -4903, -4903, -4903, -4903, 58649, 741, 58649, 2389, -4903, -4903, 3540, -4903, 78801, 1925, 3943, 3791, -4903, 3379, -4903, 3907, 2929, 1283, 3625, 1578, 2577, 3847, 2191, 203, 54985, 3238, -4903, -4903, -4903, -4903, 78801, 78801, 1011, 1104, -4903, 3477, 3479, -4903, 78801, 3803, 78801, 78801, 78801, 78801, 3298, 3487, 78801, 3495,102061, 78801, 2176, 2828, 3932, 3825, 1798, 3254, 3578, 3826, 72389, 3513, 2168, -4903, -4903, -4903, 2173, 184, -4903, 1104, 61855, 99397, 3816, -4903, 8031, -4903, -4903, 8031, 812, 78801, 3802, -4903, -4903, 1798, -4903,102061, 2175, -4903, -4903, -4903, 2389, -4903, -4903, 1275, 1275, 3504, -4903, 3506, -4903, -4903, -4903, -4903, -4903, -4903, -4903, 3500, -4903, -4903, -4903, 322, 3563, 825, 3564, 825, -4903, -4903, -4903, -4903, 78801, -4903, 78801, 57733, 825, -4903, -4903, 78801, -4903, 3835, -4903, -4903, 3643, 3644, 3646, 3647, 3648, 78801, 3232, -4903, 3516, 58649, 1709, -4903, -4903, 3711, -4903, -4903, 72389, 3632, -4903, -4903, -4903, -4903, 3849, 3850, -4903, -4903, -4903, 1144, -4903, 78801, 78801, 58649, 68267, 389, 58649, -4903, 3786, 3789, -4903, -4903, 3790, 274, -4903, 3792, 3794, 3795, -4903, 3797, 3798, -4903, -4903, -4903, 3541, 12818, 31369, -4903, 3863,102061, -4903, 6700, -4903, -4903, -4903, 31369, -4903, -4903, -4903, -4903, -4903, 31369, -4903, 31369, 3845, -4903, 25757, 4000, 4000, 3545, 102061, 36594, 36594, 36594, 36594, 245, 2708, 36594, 36594, 36594, 36594, 36594, 36594, 36594, 36594, 36594, 37538, 580, -4903, 3731, 31369, 31369, 3855, 3845, -4903,102061, 3554, 3294, 3556, 3559, 31369, -4903, -4903, 2179, 38467, 3569, 54985, -4903, 31369, 11290, 2180, 3582, 12948, 1745, 6774, 1104, 31369, 2655, 3299, 31369, 2186, 31369, 3854, -4903, -4903, -4903, 3572, -4903, -4903,102061, 31369, 3570, 4592, 36594, 36594, 5684, -4903, 5998, 31369, 28044, -4903, 3365, 3581, 44910, -4903, 26233, 3565, 902, 902, 902, 902, -4903, 78801, 78801, 78801, 40768, 3859, 3575, 39847, 77885, 3577, 2542, -4903, 77885, 78343, 77885, -4903, 3590, -4903, 1745, 31369, 3861, 3579, 3861, 196, 3587, -4903, -4903, -4903, -4903, 1798, -4903, 3589, -4903, 3336, 1100, -4903, -4903, -4903, 3775, -4903, -4903, -4903, -4903, 3577, 32794, 3709, -4903, -4903, -4903, 3605, 2197, -4903, -4903, 3973, 3709, -4903, -4903, 2198, 44450, 3369, 31369, 1745, 2207, 1931, -4903, -4903, 98495, -4903, 3651, 2656, 2656, 1258, 3232, 3898, 1258, 7349, -4903, -4903, 41228, 78801, 78801, -4903, 78801, 2231, 1617, 78801, -4903, 78801, -4903, -4903, -4903, -4903, 4026, -4903, 78801, -4903, -4903, 3650, 3654, 78801, 78801, 78801, 78801, 3852, -4903, -4903, 2253, -4903, -4903, 58649, 78801, -4903, -4903, -4903, 439, 2353, 2831, -4903, 3662, -4903, -4903, -4903, 3869, -4903, 4019, 3684, 78801, 3930, 78801, 3600, -4903, 1617, 3705, 3913, 1535, 2828, 438, 4601, -4903, 1197, -4903, -4903, 3673, -4903, -4903, 78801, -4903, 78801, -4903, -4903, -4903, -4903, -4903, -4903, -4903, 3736, -4903, -4903, -4903, -4903, 55443, -4903, -4903, 78801, -4903, 54985, 45833, 54985, -4903, 1523, 445, 2465, 2831, 78801, -4903, 3692, -4903, 3693, 3694, 3754, 955, 1520, 3701, 3706, 3756, 3629, 3630, 3636, -4903, 54985, 46304, 3787, 78801, 2656, 3638, 3672, -4903, 303, 1104, -4903, -4903, 1104, 2656, 1104, -4903, 78801, 78801, 78801, 54985, -4903, 4065, 3730, 78801, 78801, 78801, 78801, -4903, 3695, -4903, 78801, 78801, 3962, 1025, 1999, 58649, 78801, 78801, 58649, 78801, 78801, 78801, 78801, 78801, 78801, 3976, 78801, -4903, 4049, 3980, 2058, 4022, 3721, 78801, -4903, 78801, 1104, 3089, 78801, 78801, -4903, -4903, -4903, -4903, -4903, 3365, -4903, 3653, 3919, 314, -4903, 3921, 3923, 314, 314, 3924, 314, -4903, -4903, -15, -4903, 185, 78801, -4903, 2249, 78801, -4903, -4903, -4903, 3589, 2204, 2218, -4903, -4903, -4903, -4903, -4903, -4903, 78801, 3658, 78801, 78801, 36594, -4903, 1928, 1682, 253, -4903, 3926, 78801, 2996, -4903, -4903, -4903, 908, 78801, -4903, -4903, -4903, -4903, -4903, 666, 3487, -4903, 3942, 65977, 2656, 58649, 58649, 2656, -4903,102061, 3660, 3238, -4903, 339, 3742, 58649, 1283, 1381, 98037, 3009, 3698, 3875, 40308, 1654, -4903, 3666, 3829, -4903, 3679, 3669, -4903, -4903, 78801, 3567, 57733, 2243, 2892, 4118, 94, 1916, -4903, 67351, 3870, 3487, 3942, -4903, 2828, 3891, 3892, -4903, 1798, 78801, 3298, 3238, 1104, 78801, 3141, 45833, -4903, 4157, -4903, 98495, 31369, 31369, -4903, 3681, -4903, 3686, 8031, -4903, 3757, 3683, -4903, -4903, -4903, -4903, -4903, 3769, 3696, 78801, -4903, 3690, -4903, 3704, -4903, -4903, -4903, -4903, -4903, -4903, 78801, -4903, 78801, -4903, 825, -4903, 3820, -4903, 825, 78801, 78801, 78801, 78801, 78801, 78801, 3232, 274, -4903, 4001, 58191, -4903, -4903, 2247, 78801, -4903, -4903, -4903, 4071, -4903, -4903, 144, 4014, -4903, -4903, 319, 319, 319, 3970, 319, 319, 319, 319, 319, -4903, 31369, 13198, -4903, 3707, -4903, 13198, 7490, 13198, 3855, -4903, 2248, 31369, -4903, 2108, 2108, 2108, 3815, 4021, -4903, 1422, 3710, 2108, 2108, 2108, 587, 587, 214, 214, 214, 4000, 580, 13198, 13198, -4903, -4903, 3708, -4903, -4903, -4903, 3294, -4903, 33269, 662, 4129, 38007, -4903, -4903, -4903, 3751, 3758, 3733, -4903, 31369, 33744, 3714,102949, 3927, -4903, 1293, 31369, 31369, 4285, -4903, 11213, 31369,102061, 2255, 4285, 448, 31369, 3450, 3734, 31369, 31369, 6068, 7572, 3735, 31369, 98939, -4903, -4903, -4903, 2262, 31369, 78801, 78801, 78801, 78801, -4903, -4903, -4903, 77885, 78343, 77885, 3732, 38927, 26694, 2542, 3737, 78801, -4903, -4903, 3739, 40308, 4002, 3933, -4903, 40308, 3933, 1494, 3933, 4005, 3831, 45370, -4903, -4903, 3743, -4903, 3945, -4903, 1950, 13198, 4169, 4047, 1104, 4047, 1104, 3747, 48599, -4903, -4903, -4903, -4903, 3963, 13198, 29469, -4903, 1798, 1156, 78801, 1745, 73, -4903, 3765, 78801, -4903, 3709, 13198, -4903, 3824, 2267, -4903, -4903, -4903, -4903, -4903, -4903, -4903, 3836, 67809, 4072, -4903, 31369, 2321, -4903, 3796, 4165, 298, 2347, 2355, 1617, -4903, 4058, -4903, 1695, 4054, 431, -4903, 825, -4903,102061, -4903, 78801, 78801, -4903, -4903, -4903, -4903, 78801, 2786, -4903, -4903, 78801, 78801, 78801, 78801, -4903, 58649, 78801, -4903, 78801, -4903, 54985, 2665, 303, 1928, 4067, 3990, -4903, 274, -4903, 1928, 3993, 303, 78801, -4903, -4903, 2866, -4903,102061, 825, 825, -4903, -4903, -4903, -4903, -4903, 3788, 4200, 3866, 78801, 78801, 78801, -4903, 78801, 58649, 78801, 78801, 2389, 2389,102061, 3801, -4903, 2389, 2389, 3808, -4903, 58649, 78801, 78801, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, 3858, -4903, 31369, 4201, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, 58649, 78801, 3871, -4903, 3872, -4903, 157, -4903, -4903, 78801, 78801, 78801, 78801, 4125, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, 78801, -4903, 78801, -4903, -4903, 1104, 1104,102061, 825, 825, -4903, -4903, -4903, -4903, 3799, 4063, 314, -4903, 314, 314, -4903, -4903, 314, -4903, 3813, -4903, -15, 4155, -4903, 1617, 1665, 4110, -4903, 4113, 31369, -4903, 1126, 3815, -4903, 4166, 4257, -4903, -4903, -4903, -4903, 2996, 1925, 3876, -4903, -4903, 62771, 1373, -4903, 4111, 231, 4035, 65977, 1364, 1561, 3827, 3947, -4903, 2656, 2656, 3881, 78801, 4268, -4903, -4903, -4903, -4903, -4903, -4903, 58649, 3436, -4903, 4052, 753, 4147, 78801, 31369, 3577, -4903, 1919, 4150, -4903, 1104, -4903, -4903, 3955, 3238, -4903, 1391, 78801, 4048, 65977, 3298, 2362, -4903, -4903, -4903, 3873, 4258, 3254, -4903, 1364, 3870, -4903, -4903, 4236, 3928, 3879, 4280, -4903, 3928, 4153, 4051, 3846, -4903, 3513, -4903, -4903, 13198, 13198, 1104,103393, 8031,102061, 4164, 78801, 751, 4128, 825, -4903, 825, 825, -4903, 78801, -4903, 3232, 3232, 3232, 3232, 3232, -4903, 4056, -4903, -4903, 4123, -4903, 825, 58191, -4903, -4903, -4903, -4903, -4903, 319, -4903, -4903, -4903, -4903, -4903, 13198, -4903, -4903, -4903, -4903, 7974, 36594, 4168, -4903, 3856,102061, -4903, 3857, 2363, 2384, -4903, -4903, 662, -4903, 4129, -4903, -4903, -4903, 8249, 3909, 13198, 3966, 3860, 3862, 4285, 4285, 11213, 2385, -4903, 4285, 31369, 31369, 4285, 4285, 31369, -4903, -4903, 8553, 4050, -4903, -4903, 8796, -4903, -4903, -4903, -4903, -4903, -4903, -4903, 55901, 3864, 3465, 77885, 3877, 78801, 2542, 40308, -4903, -4903, 2212, -4903, 40308, 4131, -4903, 40308, 62771, -4903, 78801, 3878, 78801, -4903, 34219, 31369, 3920, -4903, 3920, -4903, -4903, 3882, 78801, 2751, -4903, 1350, -4903, -4903, 4253, 41228, 4234, 31369, -4903, -4903, -4903, -4903, 58191, 4093, 58191, 1617, 9291, 4058, 41228, 49517, 78801, 78801, 78801, 4045, 4058, 3888, 2996, -4903, -4903, -4903, -4903, -4903, -4903, 3889, -4903, -4903, -4903, -4903, 3971, -4903, -4903, 1015, 3251, -4903, 2400, -4903, -4903, 4333, 4224, -4903, -4903, -4903, -4903, -4903, -4903, 4049, -4903, -4903, 45833, 58649, 78801, -4903, 3974, -4903, -4903, -4903, -4903, -4903, 43069, 48599, -4903, 955, 3894, 3897, 1520, -4903, -4903, -4903, 78801, 9826, 3899, 1091, 3251, 78801, 78801, 3900, 3901, 3902, 1680, 1513, 1737, 3232, 4217, -4903, -4903, -4903, -4903, 4049, -4903, -4903, -4903, 314, -4903, -4903, -4903, -4903, 54985, -4903, 3054, 3813, 1104, 62771, 4345, 4345, 78801, -4903, 9904, 4122, -4903, -4903, 119, 3876, 4148, 4192, -4903, 3908, 78801, 908, 3910, 78801, 3911, 4032, 1028, 1028, 78801, 78801, 78801, 2406, 1798, 2656, 3672, 1283, 4244, 65977, 4286, 3567, 364, -4903, -4903, 1919, -4903, 1380, 4260, 3957, -4903, 78801, 4359, 78801, 3298, 3487, 78801, 3917, -4903, -4903, 67351, 4124, 2665, 103837, 2176, 3870, 3254, 243, 78801, -4903, 1276, -4903, 1798, -4903, 78801, 72389, 41228, -4903,102505, -4903, 2407, -4903, -4903, 3988, 3351, 4030, 4031, 3922, 78801, 711, -4903, -4903, -4903, -4903, -4903, 78801, -4903, 389, -4903, -4903, 3880, 36594,102061, 2412, 31369, -4903, 31369, -4903, -4903, -4903, -4903, 639, -4903, -4903, -4903, 4285, 4285, 4285, -4903, 4349, 3365, -4903, -4903, 2417, 4369, 35644, 4331, -4903, 78801, 2444, -4903, 31369, 3935, -4903, -4903, 40308, 2212, 3936, 2450, 78801, 2454,102061, 3937, 612, 3938, 24805, 3929, -4903, -4903, -4903, -4903, -4903, 13198, 13198, 78801, -4903, -4903, -4903, -4903, 3981, 78801, 2456, -4903, 1019, 13198, 1709, 1258, 389, 4165, 2996, -4903, 3939, -4903, -4903, -4903, 365, 365, 78801, 2996, 78801, 3876, -4903, 78801, 4033, -4903, -4903, 54985, 4239, -4903, 3999, -4903, 1130, 3251, 78801,102061, -4903, 135, 4265, -4903,102061,102061, -4903, -4903, -4903, 31369, 4036, -4903, -4903, -4903, 31369, 31369, 65061, -4903, -4903, 78801, 78801, 78801, 78801, 78801, 825, -4903, 2462, -4903, 42148, -4903, -4903, 2886, 1104, 2886, 152, -4903, -4903, 2886, 2886, -4903, 3351, -4903, 4345, 325, -4903, -4903, -4903, 1761, 4174, 3951, 31369, -4903, 837, 4161, 4042, 3956, -4903, 62771, 4428, 3487, 3942, 78801, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, 2463, 3567, 4284, 3238, 3879, -4903, 78801, 4003, -4903, 40308, -4903, -4903, -4903, 2886, -4903, 1569, 3967, 4298, 3567, 1798, 1916, -4903, 3870, 3487, 3942, -4903, -4903, -4903, 3972, -4903, 3892, 3254, 2176, 4109, -4903, 4112, -4903, 4385, 4180, 4388, 3298, -4903, 3141, 2467, -4903, 8031,103393,102061, 4328, 4016, 4018, -4903, -4903, 4034, 78801, -4903, -4903, 3567, -4903, 3880, 2476, -4903, 2481, 2487, 4040, -4903, 31369, 1340, 3590, 55901, 3983, -4903, 36594, 2488, -4903, 3793, 78801, 2495, -4903, 13198, 78801, -4903, -4903, 31369, -4903, 2499, -4903, 31369, 3984, 31369, -4903, 34219, 3987, -4903, 4434, 1798, -4903, 3351, 41228, -4903, 4116, -4903, 4307, -4903, 78801, 3876, 48599, 3336, 3336, 1925, 3876, 2500, -4903, -4903, 78801, -4903, 3951, 31369, -4903, 4085, -4903, -4903, 2506, 1397, 4160, 4160, 2517, 2521, 10031, 78801, 2525, 2533, -4903, 2535, 2389, 3233, 1737, 3233, -4903, 3232, -4903, -4903, 54985, -4903, 56359, -4903, -4903, -4903, 1104, -4903, 1104, 4219, 78801, 50891, 1104, 1104, -4903, -4903, -4903, -4903, 4344, 4287, -4903, 2892, -4903, 10409, -4903, -4903, -4903, 449, -4903, 4210, 4212, 78801, -4903, 4006, -4903, 2539, 1364, 4130, 3567, -4903, -4903, 78801, 4447, 4450, -4903, 757, 78801, 3577, 78801, -4903, -4903, -4903, 31369, 908, -4903, 3879, 3298, 3254, 1364, 3870, 2665, 41688, 3928, 2176, 3892, -4903, -4903, 4214, -4903, 4215, -4903, 4011, 4302, 8031, -4903, -4903, 895, 4326, 4327, -4903, -4903, -4903, -4903, -4903, -4903, -4903, 3294, 34694, 34694, 34694, 4015, -4903, -4903, 78801, 3815, 4013, 35644, 54985, 2541, -4903,100729, -4903, 2566, 2567, -4903, 2573, 34219, 2579, -4903, 78801, 4020, -4903, -4903, -4903, 44450, 58191, 365, 4059, 4017, -4903, -4903, 4148, -4903, -4903, 1617, 3251, -4903, 13198, 78801, 62771, 4445, -4903, -4903, -4903, -4903, -4903, -4903, -4903, 3251, 4101, -4903, -4903, 65061, -4903, 78801, -4903, -4903, 2588, -4903, -4903, -4903, 78801, 3666, -4903, 3666, -4903, -4903, 4162, -4903, 1111, 4134, 1085, 1085, 4384, -4903, 4089, -4903, -4903, 4037, -4903, 4507, 4159, 78801, -4903, -4903, 955, 1798, 65977, 3567, -4903, -4903, 10522, 62771, -4903, -4903, 2176, 3870, 3254, 31369, 2593, -4903, 4165, 298, -4903, 3892, 3928, -4903, -4903, 41228, 4039, 3238, -4903, -4903, 2428, 62771, 62771, 36119, 4178, 1203, 11959, 4372, -4903, 4372, 4372, -4903, 2595, 38007, -4903, -4903, -4903, 78801, 4243, 886, -4903, 4195, -4903, 2606, -4903, -4903, -4903, 1421, 389, 3336, 4046, -4903, -4903, 4161, 1617, -4903, 3251, -4903, 78801, -4903, 4053, -4903, -4903, -4903, 56359, 3666, 3957, -4903, -4903, -4903, 4503, -4903, 1331, -4903, -4903, -4903, -4903, 78801, 3567, 3801, 3879, -4903, -4903, 4057, 3892, 3254, 2176, 10679, -4903, 41688, 78801, 78801, 3928, -4903, 2614, 41228, 3928, -4903, 2511, -4903, -4903, -4903, -4903, -4903, -4903, -4903, 4061, 4068, 4494, -4903, -4903, -4903, -4903, -4903, 1005, -4903, -4903, -4903, -4903, 3465, -4903, -4903, 36594, 36594, 4270, -4903, 886, -4903, 4062, -4903, -4903, -4903, -4903, -4903, 31369, 1617, -4903, -4903, -4903, 31369, -4903, 4382, -4903, -4903, -4903, 3567, -4903, -4903, 54527, 3928, 2176, 3892, 4165, -4903, -4903, -4903, -4903, 4302, -4903, 2616, 3351, 2272, -4903, -4903, 2288, 2233, 4133, 4370, 35169, 4198, -4903, 4269, -4903, 4460, 3815, 3815, -4903, -4903, 31369, 10745, 1617, 2621, 908, -4903, -4903, 2627, -4903, -4903, -4903, -4903, -4903, 3892, 3928, 78801, 3238, -4903, 41228, -4903, -4903, 2511, 4182, 4183, -4903, -4903, -4903, 78801, 10905, -4903, -4903, 62771, -4903, 54527, 3928, -4903, -4903, 3928, -4903, -4903, 4114, 4115, 2631, -4903, 4075, -4903, -4903, 3351, 4392, 4393, -4903, 54527, -4903, 62771, 62771, 2654, -4903, -4903, -4903 }; /* 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[] = { 1668, 1439, 622, 1520, 1519, 1439, 0, 258, 0, 1530, 0, 1439, 415, 1116, 0, 0, 0, 0, 622, 1439, 0, 1668, 0, 0, 0, 0, 0, 1681, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1439, 0, 0, 1688, 0, 0, 0, 0, 1681, 0, 1532, 0, 0, 0, 0, 0, 2, 4, 37, 72, 73, 31, 30, 91, 55, 18, 63, 125, 124, 126, 42, 38, 80, 26, 28, 39, 43, 65, 67, 45, 56, 103, 64, 24, 62, 86, 68, 89, 50, 12, 13, 51, 14, 52, 15, 53, 16, 99, 74, 92, 35, 61, 23, 44, 70, 71, 5, 46, 78, 11, 57, 58, 60, 83, 84, 85, 108, 87, 120, 41, 117, 96, 97, 114, 98, 115, 9, 100, 54, 17, 111, 110, 112, 81, 47, 82, 69, 90, 109, 27, 113, 19, 20, 22, 21, 59, 29, 66, 32, 88, 116, 106, 102, 121, 119, 127, 104, 75, 7, 8, 93, 6, 25, 49, 10, 34, 33, 48, 40, 123, 36, 1530, 95, 107, 94, 76, 101, 79, 105, 122, 77, 118, 1638, 1637, 1690, 1641, 1667, 0, 1653, 1438, 1437, 1452, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 621, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1449, 2272, 2287, 2288, 2289, 2290, 2291, 2292, 2293, 2294, 2295, 2296, 2297, 2298, 2299, 2300, 2301, 2302, 2629, 2303, 2304, 2305, 2579, 2580, 2630, 2581, 2582, 2306, 2307, 2308, 2309, 2310, 2311, 2312, 2313, 2583, 2584, 2314, 2315, 2316, 2317, 2318, 2585, 2631, 2319, 2320, 2321, 2322, 2323, 2632, 2324, 2325, 2326, 2327, 2328, 2329, 2330, 2331, 2332, 2633, 2333, 2334, 2335, 2634, 2336, 2337, 2338, 2339, 2340, 2341, 2586, 2587, 2342, 2343, 2344, 2345, 2346, 2347, 2348, 2349, 2350, 2351, 2352, 2353, 2354, 2355, 2356, 2357, 2358, 2359, 2360, 2361, 2362, 2363, 2364, 2365, 2366, 2367, 2368, 2588, 2369, 2370, 2371, 2589, 2372, 2373, 2374, 2590, 2375, 2376, 2377, 2635, 2636, 2378, 2379, 2380, 2381, 2382, 2591, 2592, 2383, 2384, 2385, 2386, 2387, 2388, 2389, 2637, 2390, 2391, 2392, 2393, 2394, 2395, 2396, 2397, 2398, 2399, 2400, 2401, 2638, 2593, 2402, 2403, 2404, 2405, 2594, 2595, 2596, 2406, 2639, 2640, 2407, 2641, 2408, 2409, 2410, 2411, 2412, 2413, 2597, 2642, 2414, 2643, 2415, 2416, 2417, 2418, 2419, 2420, 2421, 2422, 2423, 2424, 2425, 2426, 2427, 2428, 2429, 2430, 2431, 2432, 2433, 2598, 2644, 2599, 2434, 2435, 2436, 2600, 2437, 2438, 2645, 2439, 2601, 2440, 2602, 2441, 2442, 2443, 2444, 2445, 2446, 2447, 2448, 2449, 2450, 2603, 2646, 2451, 2647, 2604, 2452, 2453, 2454, 2455, 2456, 2457, 2458, 2459, 2460, 2461, 2462, 2605, 2463, 2606, 2466, 2464, 2465, 2467, 2468, 2469, 2470, 2471, 2472, 2473, 2474, 2475, 2476, 2607, 2477, 2478, 2479, 2480, 2481, 2482, 2483, 2484, 2485, 2486, 2487, 2488, 2489, 2490, 2491, 2492, 2493, 2494, 2648, 2495, 2496, 2497, 2498, 2499, 2608, 2500, 2501, 2502, 2503, 2504, 2505, 2506, 2507, 2508, 2509, 2510, 2511, 2512, 2513, 2514, 2515, 2609, 2516, 2517, 2649, 2518, 2519, 2610, 2520, 2521, 2522, 2523, 2524, 2525, 2526, 2527, 2528, 2529, 2530, 2531, 2532, 2533, 2611, 2534, 2535, 2536, 2537, 2650, 2538, 2539, 2540, 2541, 2542, 2543, 2612, 2613, 2544, 2545, 2614, 2546, 2615, 2547, 2548, 2549, 2550, 2551, 2552, 2553, 2554, 2555, 2556, 2557, 2558, 2559, 2560, 2561, 2562, 2563, 2616, 2617, 2564, 2651, 2565, 2566, 2567, 2568, 2569, 2570, 2571, 2572, 2573, 2574, 2575, 2618, 2619, 2620, 2621, 2622, 2623, 2624, 2625, 2626, 2627, 2628, 2576, 2577, 2578, 129, 0, 0, 2246, 2273, 2274, 2277, 2272, 387, 386, 1628, 2240, 2273, 1529, 1509, 622, 0, 1452, 414, 1668, 0, 0, 0, 0, 0, 0, 0, 855, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 177, 0, 0, 0, 0, 438, 437, 0, 0, 0, 1084, 443, 0, 0, 0, 0, 0, 610, 1577, 2464, 1575, 1629, 259, 262, 263, 260, 261, 2262, 0, 1218, 1219, 1221, 0, 0, 1231, 895, 896, 0, 0, 0, 904, 0, 0, 0, 893, 0, 0, 0, 909, 0, 906, 0, 0, 910, 907, 890, 908, 897, 0, 889, 0, 0, 1231, 911, 0, 0, 891, 0, 0, 0, 0, 1452, 1574, 444, 1668, 0, 1551, 1552, 1553, 1530, 1542, 1554, 1547, 1549, 1548, 1550, 1546, 2261, 2288, 1019, 1019, 1019, 1019, 1016, 1017, 1019, 1019, 1019, 2484, 0, 0, 998, 0, 1000, 2263, 1019, 1024, 507, 507, 507, 0, 1023, 1028, 507, 0, 1420, 1461, 2245, 1680, 0, 999, 1419, 0, 0, 0, 2544, 1565, 0, 0, 1246, 1242, 1244, 1245, 1243, 0, 1087, 1087, 2502, 1431, 241, 2513, 2612, 2544, 240, 234, 236, 208, 2292, 0, 0, 1023, 0, 1452, 1429, 981, 1687, 1685, 0, 2227, 2312, 2327, 2417, 231, 2495, 2503, 2513, 2612, 2544, 2575, 187, 197, 192, 0, 252, 2513, 2612, 2544, 248, 1449, 0, 1654, 1789, 2236, 0, 1422, 1421, 1531, 0, 1534, 0, 2479, 1658, 1661, 1536, 1659, 1650, 0, 0, 1, 1668, 0, 1541, 1684, 1684, 0, 1684, 0, 1642, 1650, 1645, 1649, 0, 0, 0, 0, 0, 1423, 0, 0, 0, 914, 0, 1464, 2241, 1069, 0, 0, 0, 0, 0, 0, 0, 1125, 1124, 2278, 2268, 2269, 0, 2266, 2267, 2279, 2280, 2281, 0, 2389, 0, 0, 0, 2138, 2149, 2150, 2151, 2316, 2372, 2146, 2147, 2148, 2140, 2141, 2142, 2143, 2144, 2145, 0, 0, 1213, 2139, 0, 2389, 0, 0, 0, 156, 0, 133, 0, 0, 0, 2389, 0, 0, 0, 0, 0, 0, 0, 2389, 0, 0, 0, 0, 0, 156, 2422, 0, 133, 2389, 0, 0, 1443, 0, 0, 0, 1445, 1448, 1424, 0, 2219, 0, 2220, 2247, 1512, 0, 2236, 0, 0, 0, 950, 943, 0, 951, 958, 0, 0, 960, 0, 0, 944, 0, 0, 0, 0, 0, 963, 964, 0, 0, 965, 945, 966, 946, 967, 947, 968, 0, 0, 0, 0, 948, 0, 0, 0, 1435, 1426, 0, 1567, 1569, 1568, 1566, 507, 0, 0, 0, 2389, 0, 0, 133, 1497, 0, 2389, 133, 0, 0, 442, 441, 133, 2266, 440, 439, 2316, 2372, 0, 1115, 0, 1378, 133, 2389, 0, 179, 2389, 696, 2389, 1536, 0, 625, 0, 0, 810, 2422, 133, 0, 0, 0, 0, 0, 0, 1087, 0, 0, 0, 0, 0, 609, 622, 1578, 1576, 0, 1222, 233, 232, 1220, 902, 2389, 1157, 348, 0, 0, 2389, 1483, 2275, 1864, 1893, 1871, 1893, 1893, 1860, 1860, 2356, 1873, 2389, 1861, 1862, 1898, 0, 1893, 1860, 1865, 0, 1863, 1901, 1901, 1888, 348, 918, 1845, 1846, 1847, 1848, 1874, 1875, 1849, 1880, 1881, 1885, 1850, 1915, 1860, 2276, 903, 0, 894, 2389, 348, 1121, 2389, 2270, 166, 0, 892, 2316, 2372, 2389, 348, 1215, 0, 2389, 348, 2389, 162, 2389, 348, 2389, 348, 2389, 626, 0, 0, 2389, 348, 2389, 2422, 164, 0, 2389, 348, 912, 2389, 348, 2238, 2389, 0, 1427, 0, 1570, 0, 1544, 2616, 1559, 0, 1555, 1562, 1558, 1668, 1019, 1018, 0, 1019, 0, 1019, 0, 1019, 0, 1019, 0, 0, 0, 1019, 2264, 2265, 1001, 0, 1025, 0, 0, 1032, 1031, 1030, 0, 0, 0, 1033, 0, 1793, 1605, 0, 1417, 235, 186, 0, 247, 246, 1434, 0, 0, 0, 1087, 1249, 0, 1247, 1086, 0, 0, 1430, 239, 237, 0, 0, 0, 0, 0, 0, 1436, 0, 1428, 0, 0, 0, 2249, 2251, 2252, 2152, 2222, 0, 2580, 2581, 2582, 2211, 0, 2583, 2584, 2585, 2631, 2046, 2033, 2042, 2047, 2034, 2036, 2043, 2586, 2587, 1981, 2588, 2589, 2259, 2590, 2591, 2592, 2594, 2595, 2596, 2597, 2038, 2040, 2598, 2599, 0, 2260, 2601, 2602, 2446, 2604, 2605, 2607, 2608, 2044, 2610, 2611, 2612, 2613, 2614, 2615, 2258, 0, 2045, 2617, 2619, 2620, 2621, 2622, 2624, 2625, 2626, 2627, 0, 0, 0, 2233, 0, 2013, 0, 1853, 1854, 1876, 1877, 1855, 1882, 1883, 1856, 0, 2232, 1918, 2097, 2012, 2029, 0, 2018, 2019, 0, 2011, 2007, 1670, 2228, 0, 2008, 2248, 2250, 2212, 1670, 2226, 200, 254, 0, 255, 2234, 2513, 188, 230, 202, 229, 203, 201, 0, 2314, 189, 0, 0, 190, 0, 0, 0, 0, 251, 249, 0, 1425, 0, 1791, 1790, 2237, 923, 0, 1523, 1517, 1526, 1522, 1533, 1530, 2162, 0, 1660, 0, 0, 0, 1640, 1639, 3, 0, 1538, 1540, 1515, 1536, 1682, 1683, 0, 0, 0, 0, 0, 0, 0, 0, 1738, 1698, 1699, 1701, 1735, 1739, 1747, 0, 1646, 0, 0, 1795, 0, 0, 1450, 0, 0, 0, 0, 0, 1156, 0, 0, 0, 0, 0, 915, 0, 0, 0, 1470, 0, 1472, 1473, 1474, 0, 0, 0, 1475, 1476, 1464, 243, 1482, 1480, 1463, 1465, 1478, 0, 0, 0, 0, 0, 0, 0, 1489, 0, 170, 171, 0, 638, 622, 0, 2389, 0, 0, 0, 0, 0, 1164, 1171, 0, 0, 0, 0, 0, 0, 0, 0, 1165, 1163, 0, 1166, 245, 1176, 1195, 1198, 0, 1123, 1126, 0, 0, 0, 0, 0, 1306, 0, 0, 0, 0, 1306, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 270, 272, 283, 343, 601, 0, 0, 0, 604, 0, 2389, 0, 0, 0, 0, 1217, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1198, 0, 0, 0, 0, 0, 0, 0, 0, 131, 132, 137, 0, 0, 0, 0, 0, 1198, 0, 0, 0, 0, 0, 0, 587, 600, 0, 0, 0, 0, 0, 597, 0, 0, 133, 275, 577, 583, 0, 0, 0, 703, 702, 0, 0, 0, 0, 1394, 1393, 0, 0, 0, 0, 1487, 1486, 0, 0, 0, 0, 1306, 0, 264, 266, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 379, 380, 0, 0, 0, 137, 0, 0, 0, 0, 277, 0, 0, 1444, 1441, 1442, 0, 1447, 0, 0, 0, 0, 2021, 0, 2166, 1690, 2164, 1141, 2218, 0, 2282, 2652, 2653, 2654, 2655, 2656, 2657, 2658, 2659, 2660, 2661, 2662, 2663, 2664, 2665, 2666, 2667, 2668, 2669, 2670, 2671, 2672, 2673, 2674, 2675, 2676, 2677, 2678, 2679, 2680, 2681, 2682, 2683, 2684, 2685, 2686, 2687, 2688, 2689, 2690, 2691, 2692, 2693, 2694, 2695, 2696, 2697, 2698, 2699, 2700, 2701, 2702, 2703, 2704, 2705, 2706, 2707, 2708, 2709, 2710, 2711, 2712, 2713, 2714, 2715, 2716, 2717, 2718, 2719, 2720, 2721, 2722, 2723, 2724, 2725, 2726, 2727, 2728, 2215, 2214, 2243, 2283, 2284, 2285, 2286, 2221, 0, 1508, 0, 957, 0, 0, 0, 0, 959, 0, 952, 0, 0, 949, 2316, 2372, 0, 0, 0, 0, 0, 0, 0, 0, 0, 962, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 818, 0, 1464, 1496, 0, 0, 0, 631, 0, 2389, 0, 135, 856, 0, 808, 443, 0, 0, 0, 1188, 1377, 135, 0, 0, 173, 0, 0, 700, 0, 0, 0, 0, 0, 0, 0, 0, 0, 747, 746, 0, 0, 0, 809, 0, 0, 135, 0, 2389, 580, 2389, 0, 507, 507, 0, 0, 1089, 0, 0, 0, 0, 0, 0, 1632, 1634, 1633, 0, 1631, 0, 346, 347, 0, 1205, 1230, 0, 0, 1892, 1879, 1887, 1886, 0, 1869, 1868, 1867, 0, 1866, 0, 1893, 1893, 1891, 1870, 1845, 0, 0, 0, 1897, 0, 1895, 0, 885, 1841, 1837, 0, 1904, 1905, 1906, 1903, 1916, 1902, 0, 1851, 1907, 1860, 1857, 905, 0, 0, 1199, 0, 0, 2389, 348, 2389, 0, 2389, 0, 0, 0, 1207, 348, 0, 1201, 0, 0, 1203, 0, 1395, 0, 901, 899, 898, 900, 0, 0, 883, 0, 0, 0, 2389, 348, 0, 0, 878, 0, 0, 880, 0, 0, 0, 0, 1668, 0, 219, 220, 218, 1560, 221, 1561, 1557, 1543, 0, 1009, 0, 1013, 0, 1004, 0, 1010, 0, 1005, 1002, 1003, 0, 1008, 0, 0, 508, 510, 0, 0, 2339, 2355, 0, 2378, 2410, 2411, 2470, 2498, 2503, 2509, 0, 2538, 2549, 0, 1034, 1064, 1029, 714, 0, 0, 1615, 1418, 2169, 0, 1668, 0, 0, 0, 0, 1238, 1239, 238, 209, 0, 0, 0, 1066, 2502, 1433, 980, 622, 0, 2009, 0, 2016, 2017, 2210, 0, 0, 0, 0, 0, 0, 2015, 2177, 0, 0, 0, 0, 0, 1941, 0, 0, 0, 2190, 0, 2196, 0, 0, 1978, 0, 0, 0, 0, 0, 0, 0, 0, 1942, 1922, 1923, 2013, 2162, 0, 2014, 2255, 0, 1915, 2231, 2152, 0, 2149, 2150, 2151, 0, 0, 0, 2225, 0, 2160, 0, 0, 1956, 2158, 1958, 0, 0, 0, 0, 2146, 2147, 2148, 2140, 2141, 2142, 2143, 2144, 2145, 2156, 1938, 0, 0, 2099, 0, 1937, 0, 0, 1751, 0, 2253, 2213, 1751, 256, 257, 253, 0, 0, 205, 204, 0, 223, 227, 228, 199, 226, 0, 222, 207, 2086, 2085, 206, 198, 195, 193, 210, 212, 213, 196, 194, 250, 0, 0, 0, 348, 1541, 0, 1524, 1525, 1521, 1528, 1748, 0, 1662, 0, 1666, 1541, 0, 1537, 1657, 1656, 1691, 1692, 1107, 1655, 1718, 1719, 0, 0, 0, 0, 1744, 1742, 1709, 1702, 1708, 0, 0, 1706, 0, 1710, 1918, 1737, 1644, 1696, 1697, 1700, 1643, 0, 1740, 0, 1618, 1738, 1701, 1602, 0, 1580, 0, 1796, 0, 0, 1451, 0, 0, 0, 1136, 1138, 0, 1137, 0, 1140, 0, 1149, 0, 0, 1135, 1154, 0, 1143, 1141, 0, 1485, 0, 0, 916, 0, 0, 0, 0, 1471, 0, 0, 2538, 242, 1474, 1479, 1466, 1477, 0, 0, 0, 0, 0, 1068, 1067, 0, 0, 1091, 0, 0, 0, 1492, 496, 0, 345, 0, 0, 0, 0, 0, 0, 0, 0, 804, 801, 0, 0, 800, 0, 636, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 676, 0, 1306, 0, 708, 0, 1173, 0, 0, 1172, 0, 1177, 0, 0, 1174, 1169, 1170, 2503, 2513, 2544, 244, 1175, 1197, 0, 1196, 1192, 1118, 0, 1119, 0, 0, 0, 0, 0, 2365, 2389, 288, 308, 0, 1305, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 330, 0, 0, 333, 332, 0, 0, 0, 0, 0, 337, 316, 0, 317, 0, 336, 0, 0, 602, 603, 0, 0, 0, 0, 1306, 0, 279, 0, 0, 0, 0, 0, 0, 0, 1214, 0, 731, 0, 0, 0, 2503, 1193, 0, 0, 0, 0, 0, 1381, 0, 0, 159, 0, 154, 158, 0, 0, 0, 2503, 1194, 0, 0, 0, 0, 585, 586, 599, 0, 590, 591, 588, 592, 593, 0, 0, 0, 0, 0, 0, 0, 584, 0, 0, 698, 697, 701, 0, 0, 0, 1390, 0, 1188, 0, 0, 1389, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1251, 1250, 0, 0, 0, 0, 0, 0, 846, 0, 0, 0, 0, 0, 0, 0, 0, 161, 718, 0, 717, 0, 155, 160, 0, 0, 0, 0, 0, 0, 0, 217, 1440, 1446, 1690, 1690, 1690, 2027, 0, 0, 0, 0, 1689, 2216, 2219, 1511, 2244, 1510, 0, 0, 0, 0, 961, 0, 0, 0, 0, 0, 0, 0, 0, 0, 953, 954, 955, 956, 0, 0, 0, 0, 0, 393, 390, 391, 393, 0, 0, 0, 0, 820, 0, 823, 826, 0, 1462, 462, 0, 0, 628, 676, 0, 0, 446, 168, 0, 0, 0, 0, 733, 0, 0, 0, 1376, 130, 177, 179, 444, 0, 178, 180, 182, 183, 184, 181, 185, 0, 695, 699, 0, 0, 0, 0, 624, 0, 0, 0, 0, 0, 748, 752, 751, 755, 753, 0, 749, 0, 0, 1816, 0, 0, 153, 0, 0, 575, 579, 0, 0, 0, 0, 446, 548, 359, 2389, 0, 507, 0, 2389, 0, 1088, 0, 807, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1630, 348, 1158, 0, 1484, 0, 0, 0, 348, 1890, 1889, 1842, 1838, 0, 0, 0, 0, 919, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1858, 348, 1122, 167, 2271, 0, 887, 0, 0, 0, 0, 348, 1216, 875, 348, 163, 348, 348, 627, 0, 348, 165, 0, 0, 0, 619, 348, 913, 348, 2239, 0, 348, 1573, 2389, 507, 1545, 1556, 1006, 1015, 1014, 1012, 1011, 1007, 0, 1026, 0, 506, 0, 0, 0, 0, 0, 1042, 1043, 0, 0, 1039, 1044, 0, 1040, 1041, 1046, 1036, 1035, 1047, 1048, 0, 0, 1066, 712, 0, 0, 0, 0, 1612, 0, 1610, 0, 1794, 1614, 1603, 1564, 0, 1563, 0, 568, 1087, 1087, 1248, 0, 0, 1023, 0, 0, 348, 1432, 0, 982, 988, 0, 0, 0, 0, 0, 0, 0, 991, 992, 0, 993, 984, 994, 985, 995, 0, 986, 0, 0, 0, 0, 2223, 2173, 0, 2174, 0, 0, 2209, 2205, 0, 0, 0, 0, 0, 2178, 2181, 2182, 2183, 2180, 2184, 2179, 0, 0, 2185, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2608, 0, 0, 0, 0, 1982, 0, 0, 2133, 0, 2162, 2195, 0, 0, 0, 0, 0, 0, 2162, 2201, 0, 0, 0, 0, 2084, 0, 2081, 0, 0, 0, 0, 2222, 0, 0, 2256, 1919, 1933, 1934, 1935, 1939, 2230, 0, 2224, 0, 0, 1920, 1947, 0, 2202, 1974, 0, 1979, 1962, 0, 1955, 0, 1960, 1964, 1943, 0, 1940, 0, 2225, 2161, 0, 2159, 0, 1930, 1931, 1932, 1924, 1925, 1926, 1927, 1928, 1929, 1936, 2137, 2135, 2136, 0, 0, 0, 2107, 0, 0, 1959, 2381, 2417, 0, 1681, 1681, 1681, 1669, 1679, 2229, 0, 1811, 1690, 1811, 2235, 0, 0, 1915, 0, 1792, 921, 922, 920, 1514, 1518, 1527, 1541, 2163, 1535, 1664, 0, 0, 1516, 1539, 0, 1105, 1106, 0, 1110, 2608, 2500, 0, 0, 0, 0, 1711, 1745, 0, 1736, 0, 2249, 1712, 2248, 1713, 1716, 1717, 1707, 1746, 1616, 0, 1741, 1648, 1647, 0, 1814, 0, 0, 0, 1594, 1582, 0, 1797, 0, 1751, 1620, 0, 2222, 1749, 1352, 1252, 1315, 1139, 0, 1860, 1150, 0, 1134, 0, 1133, 1860, 0, 1151, 0, 1860, 1353, 1253, 1316, 917, 1354, 1254, 1317, 1355, 1255, 1481, 1469, 1468, 1467, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 785, 2389, 348, 1490, 1356, 0, 1256, 344, 1491, 1318, 1495, 803, 802, 0, 0, 1319, 0, 637, 0, 641, 0, 643, 644, 645, 0, 0, 0, 646, 0, 2316, 2372, 648, 651, 652, 653, 660, 665, 655, 0, 0, 667, 661, 0, 0, 0, 0, 0, 0, 673, 678, 0, 0, 0, 0, 0, 0, 0, 1167, 1168, 1357, 1259, 0, 1320, 1117, 0, 1260, 169, 0, 0, 271, 2389, 290, 0, 680, 785, 0, 1308, 287, 314, 0, 0, 329, 324, 325, 323, 2389, 348, 2389, 348, 0, 0, 0, 0, 0, 326, 321, 322, 318, 0, 0, 331, 2291, 2357, 2514, 0, 684, 686, 0, 691, 334, 1280, 355, 354, 353, 0, 338, 0, 360, 363, 335, 315, 313, 310, 284, 0, 0, 0, 0, 0, 0, 0, 0, 2242, 0, 0, 1209, 0, 1360, 1321, 0, 1343, 0, 0, 0, 0, 725, 0, 1363, 1266, 1324, 1382, 1384, 1374, 1267, 1383, 157, 1295, 146, 0, 0, 142, 0, 0, 0, 0, 136, 0, 1364, 1268, 1325, 0, 1365, 1269, 0, 0, 276, 578, 589, 594, 1274, 598, 595, 1333, 596, 1372, 1270, 1368, 1298, 1328, 1375, 1391, 1271, 1188, 1386, 1388, 0, 1306, 0, 265, 267, 0, 286, 0, 1272, 0, 1326, 1367, 1297, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1498, 0, 0, 0, 0, 0, 0, 348, 0, 0, 0, 1308, 2389, 348, 1366, 0, 1303, 0, 1341, 0, 381, 0, 1296, 0, 0, 278, 1276, 1335, 0, 0, 215, 214, 216, 0, 0, 0, 0, 2167, 2168, 0, 2165, 2022, 2218, 0, 970, 928, 969, 0, 2355, 0, 927, 929, 0, 0, 0, 930, 0, 934, 935, 0, 0, 0, 926, 924, 925, 392, 0, 0, 742, 743, 0, 0, 0, 0, 822, 0, 0, 0, 1488, 0, 133, 635, 0, 0, 0, 630, 675, 680, 0, 0, 0, 0, 445, 449, 453, 454, 455, 0, 0, 0, 0, 147, 134, 0, 864, 0, 507, 0, 735, 1380, 1379, 1187, 0, 179, 172, 0, 0, 696, 0, 1536, 0, 0, 359, 817, 815, 814, 816, 0, 0, 0, 838, 813, 0, 1815, 1817, 0, 0, 0, 0, 0, 0, 568, 448, 0, 0, 510, 0, 551, 0, 0, 0, 0, 548, 0, 0, 0, 2275, 0, 834, 806, 1128, 0, 1146, 1129, 0, 0, 0, 0, 1181, 1113, 1182, 1159, 1114, 0, 0, 607, 1635, 1636, 0, 1206, 0, 0, 1859, 1872, 886, 0, 1900, 1899, 1901, 1901, 0, 1843, 0, 1884, 1909, 1910, 1911, 1912, 1913, 1914, 0, 1908, 1852, 1200, 348, 0, 348, 0, 348, 1208, 1202, 1204, 1396, 0, 884, 0, 0, 348, 877, 879, 0, 881, 0, 1027, 509, 0, 0, 0, 0, 0, 0, 1038, 605, 1045, 0, 1059, 1054, 1056, 0, 1060, 711, 0, 0, 1613, 1606, 1608, 1607, 0, 0, 1604, 2170, 876, 0, 574, 0, 0, 0, 0, 348, 0, 1061, 0, 0, 989, 983, 0, 0, 987, 0, 0, 0, 990, 0, 0, 1686, 2171, 2172, 0, 0, 0, 2206, 0, 0, 2059, 0, 2035, 2037, 2049, 0, 2060, 2020, 2061, 2039, 2041, 0, 2153, 0, 0, 2050, 0, 1984, 1985, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2000, 1999, 2051, 2132, 0, 0, 2193, 2194, 2052, 0, 0, 2200, 0, 0, 0, 2057, 2062, 0, 0, 0, 0, 2068, 0, 2089, 0, 0, 0, 2010, 2163, 0, 0, 0, 0, 0, 0, 0, 0, 1980, 1963, 1957, 0, 1961, 1965, 0, 0, 0, 1951, 0, 0, 1949, 1975, 1945, 0, 0, 1976, 0, 0, 0, 2028, 0, 0, 1681, 1681, 1681, 1681, 1678, 0, 0, 0, 0, 2500, 2628, 0, 1775, 1750, 1752, 1762, 1775, 1780, 1775, 2030, 1809, 2031, 2236, 0, 1721, 0, 1721, 191, 0, 224, 211, 1513, 1665, 1668, 1693, 0, 2154, 1110, 0, 1695, 1715, 1714, 0, 1705, 1743, 1703, 1617, 1601, 0, 1599, 1586, 1588, 1587, 0, 0, 1589, 2222, 0, 1599, 1581, 1625, 0, 0, 1814, 0, 1624, 0, 1860, 1131, 1132, 0, 1155, 0, 1071, 1072, 0, 1070, 0, 0, 0, 495, 1090, 0, 0, 0, 785, 0, 0, 499, 0, 1493, 0, 1373, 1294, 639, 640, 0, 654, 0, 663, 662, 0, 0, 0, 0, 0, 0, 0, 647, 669, 611, 670, 672, 0, 0, 671, 674, 677, 1306, 0, 709, 1282, 0, 1339, 1161, 1309, 0, 1120, 0, 0, 0, 0, 0, 0, 462, 309, 0, 0, 0, 0, 368, 0, 292, 301, 366, 307, 0, 1314, 340, 0, 312, 0, 305, 327, 319, 328, 320, 339, 341, 0, 688, 689, 687, 683, 0, 690, 692, 0, 357, 0, 0, 0, 1359, 0, 1306, 0, 280, 0, 1278, 0, 1337, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1342, 0, 0, 0, 0, 730, 0, 727, 1310, 0, 0, 139, 138, 0, 145, 0, 1311, 0, 0, 0, 0, 1392, 0, 0, 0, 0, 0, 0, 375, 0, 285, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 382, 350, 0, 841, 0, 0, 0, 384, 0, 0, 0, 0, 0, 1358, 1261, 2025, 2026, 2023, 1690, 2217, 0, 0, 0, 941, 0, 0, 0, 0, 0, 0, 395, 396, 133, 394, 417, 0, 785, 0, 0, 819, 824, 832, 2446, 2140, 2141, 830, 825, 827, 829, 831, 828, 0, 0, 0, 0, 0, 478, 0, 0, 0, 468, 0, 0, 1188, 461, 464, 465, 0, 0, 631, 634, 632, 633, 668, 0, 448, 485, 536, 0, 149, 0, 0, 150, 148, 0, 0, 359, 732, 0, 729, 0, 175, 444, 0, 700, 0, 0, 0, 1188, 623, 754, 757, 750, 0, 837, 839, 811, 0, 680, 0, 0, 580, 0, 507, 1574, 563, 0, 538, 448, 536, 547, 0, 0, 555, 358, 0, 0, 568, 359, 0, 0, 1091, 0, 833, 0, 1127, 0, 0, 0, 1178, 1183, 1179, 0, 0, 1142, 0, 1180, 1160, 1412, 1413, 1410, 1411, 0, 0, 0, 1627, 0, 1878, 0, 1896, 1894, 1839, 1844, 1917, 888, 0, 871, 0, 873, 348, 719, 0, 620, 348, 0, 0, 0, 0, 0, 0, 1037, 0, 1057, 0, 0, 1020, 1063, 0, 0, 1611, 1609, 566, 0, 1240, 1241, 1066, 0, 1021, 1065, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2175, 0, 2208, 2204, 0, 2032, 2176, 0, 2188, 2187, 2133, 0, 0, 1983, 1995, 1996, 1997, 2189, 0, 2005, 0, 0, 1992, 1993, 1994, 1986, 1987, 1988, 1989, 1990, 1991, 1998, 2198, 2197, 2191, 2192, 0, 2054, 2055, 2056, 2199, 2063, 0, 2306, 2090, 0, 2067, 2083, 2082, 0, 0, 0, 2070, 0, 0, 2079, 0, 2134, 2257, 1921, 0, 0, 1948, 2203, 1966, 0, 0, 0, 1944, 2153, 0, 0, 0, 0, 0, 1953, 0, 0, 0, 2110, 2105, 2106, 2130, 0, 0, 0, 0, 0, 0, 1672, 1671, 1677, 1775, 1780, 1775, 0, 0, 1650, 0, 1762, 0, 1774, 1760, 1773, 0, 0, 1786, 1784, 0, 1786, 0, 1786, 0, 1754, 0, 1776, 1756, 1773, 1758, 0, 1801, 2237, 1810, 0, 1734, 2022, 1734, 0, 0, 0, 1694, 1108, 1109, 1704, 2335, 1812, 0, 1600, 0, 0, 0, 1591, 1597, 1579, 0, 0, 1621, 1599, 1622, 1152, 0, 0, 1144, 1077, 1078, 1081, 1079, 1076, 1080, 0, 0, 0, 785, 0, 0, 517, 0, 1102, 1102, 0, 0, 501, 560, 512, 788, 0, 0, 0, 786, 348, 1257, 0, 664, 0, 0, 659, 657, 656, 658, 0, 612, 1371, 1258, 0, 0, 0, 0, 1162, 0, 0, 1281, 0, 289, 0, 458, 0, 0, 302, 0, 298, 0, 1307, 0, 0, 0, 0, 297, 370, 0, 367, 0, 348, 348, 342, 685, 356, 361, 362, 365, 0, 0, 0, 0, 0, 1313, 0, 0, 0, 0, 0, 0, 0, 865, 848, 0, 0, 866, 867, 0, 0, 0, 1211, 1212, 1210, 1344, 1345, 1350, 1347, 1346, 1349, 1351, 1348, 0, 1264, 0, 0, 723, 143, 140, 141, 144, 1292, 1275, 1334, 1387, 0, 0, 0, 1273, 0, 1327, 0, 1288, 1284, 0, 0, 0, 0, 0, 1370, 1302, 1332, 1369, 1300, 1330, 1299, 1329, 1301, 1331, 0, 1293, 0, 1819, 845, 0, 0, 0, 348, 348, 844, 721, 1277, 1336, 0, 0, 0, 931, 0, 0, 933, 936, 0, 938, 400, 418, 133, 0, 741, 805, 0, 0, 821, 784, 0, 466, 0, 472, 476, 0, 0, 480, 481, 479, 467, 1188, 507, 559, 774, 775, 0, 0, 795, 0, 629, 0, 446, 0, 482, 0, 0, 450, 152, 151, 0, 0, 0, 736, 740, 738, 737, 739, 734, 0, 725, 179, 2389, 0, 0, 0, 0, 561, 1385, 0, 767, 812, 0, 1818, 715, 0, 359, 576, 0, 0, 0, 446, 568, 0, 451, 456, 457, 462, 0, 548, 537, 0, 538, 549, 550, 0, 557, 1460, 0, 569, 557, 0, 0, 0, 836, 0, 835, 1130, 1147, 1148, 0, 0, 1111, 0, 0, 0, 0, 614, 348, 1840, 348, 348, 1237, 0, 882, 1051, 1052, 1053, 1050, 1049, 606, 0, 1055, 713, 0, 567, 348, 0, 997, 975, 996, 974, 976, 0, 978, 979, 973, 971, 972, 2207, 2048, 2058, 2186, 2132, 2163, 0, 0, 2006, 0, 0, 2053, 2618, 0, 0, 2094, 2095, 0, 2091, 2092, 2087, 2088, 2069, 0, 2436, 2074, 0, 0, 0, 1972, 1970, 1967, 0, 1968, 1952, 0, 0, 1950, 1946, 0, 1977, 2096, 0, 2112, 2109, 2129, 2163, 1676, 1675, 1674, 1673, 1761, 1757, 1759, 0, 2623, 0, 1764, 1771, 0, 1753, 0, 1785, 1781, 0, 1782, 0, 0, 1783, 0, 0, 1755, 0, 1771, 0, 1808, 0, 0, 2101, 2254, 2101, 225, 1663, 0, 0, 1598, 1583, 0, 1584, 1590, 0, 0, 0, 0, 1626, 1619, 1145, 1153, 0, 0, 0, 497, 0, 512, 0, 0, 0, 1104, 1104, 0, 512, 0, 1188, 790, 789, 792, 787, 791, 1494, 0, 649, 650, 666, 1283, 0, 1340, 1290, 0, 1615, 291, 0, 681, 296, 0, 0, 293, 369, 371, 294, 295, 299, 350, 311, 304, 0, 0, 0, 1279, 0, 1338, 1286, 1361, 1262, 1322, 0, 0, 854, 0, 0, 0, 0, 1362, 1263, 1323, 0, 0, 0, 0, 1615, 0, 0, 0, 0, 0, 0, 0, 0, 1503, 0, 1312, 349, 843, 842, 350, 383, 1304, 2024, 0, 932, 939, 940, 937, 0, 389, 397, 400, 0, 0, 1228, 1228, 0, 785, 0, 0, 463, 477, 0, 559, 516, 0, 469, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 728, 727, 174, 0, 446, 0, 680, 0, 761, 762, 756, 758, 0, 769, 773, 840, 0, 0, 0, 568, 448, 0, 0, 1571, 447, 0, 0, 459, 0, 551, 538, 548, 0, 0, 565, 0, 1453, 0, 571, 0, 0, 0, 1184, 0, 1190, 0, 1141, 1185, 0, 1811, 0, 0, 0, 0, 618, 1229, 872, 874, 720, 1058, 0, 1062, 348, 977, 2134, 2001, 0, 0, 0, 0, 2064, 0, 2065, 2093, 2071, 2075, 0, 2072, 2073, 1969, 1973, 1971, 1954, 2098, 0, 1690, 2131, 1804, 0, 1807, 0, 0, 1763, 0, 0, 1765, 0, 0, 1767, 1769, 0, 0, 0, 0, 0, 0, 2240, 2334, 2592, 2497, 0, 1720, 1722, 1725, 1727, 1726, 1728, 1724, 1733, 0, 1652, 1651, 2155, 1813, 0, 0, 0, 1092, 0, 1623, 1059, 0, 348, 1102, 1188, 518, 2446, 519, 1101, 1103, 1107, 1107, 0, 1188, 0, 559, 642, 0, 0, 273, 679, 0, 0, 303, 352, 364, 0, 1615, 0, 0, 852, 861, 861, 849, 0, 0, 868, 1265, 724, 0, 0, 268, 1289, 1285, 0, 0, 0, 1505, 1506, 0, 0, 0, 0, 0, 348, 942, 0, 420, 427, 401, 405, 1497, 0, 1497, 0, 402, 406, 1497, 1497, 399, 1811, 416, 1228, 0, 1225, 1224, 783, 0, 505, 582, 0, 470, 0, 527, 0, 0, 796, 0, 0, 448, 536, 0, 494, 486, 487, 488, 490, 489, 491, 492, 493, 484, 483, 0, 680, 858, 359, 1460, 722, 0, 0, 693, 0, 759, 764, 763, 1497, 768, 0, 0, 0, 680, 0, 1574, 564, 538, 448, 536, 452, 462, 540, 0, 541, 555, 548, 551, 0, 552, 0, 556, 0, 0, 0, 568, 1507, 1091, 0, 1189, 0, 0, 0, 0, 0, 0, 1232, 613, 0, 0, 617, 608, 680, 1022, 2002, 0, 2003, 0, 0, 2077, 2076, 0, 2116, 1809, 0, 0, 1803, 0, 0, 1833, 0, 0, 0, 1772, 1788, 0, 1768, 1766, 0, 1777, 0, 1779, 0, 0, 0, 1729, 0, 2100, 2102, 0, 0, 1596, 1811, 0, 1593, 0, 1073, 0, 1074, 1104, 559, 0, 1110, 1110, 507, 559, 0, 785, 1291, 0, 682, 582, 0, 306, 0, 281, 1287, 0, 0, 863, 863, 0, 0, 0, 0, 0, 0, 377, 0, 0, 1499, 0, 1500, 1501, 1504, 385, 398, 0, 425, 0, 423, 422, 424, 0, 413, 0, 0, 0, 0, 0, 0, 388, 1223, 1227, 1226, 0, 0, 471, 0, 473, 0, 513, 514, 515, 0, 475, 523, 524, 0, 793, 0, 798, 0, 0, 0, 680, 535, 704, 0, 0, 0, 1454, 0, 0, 562, 0, 770, 771, 766, 0, 0, 716, 1460, 568, 548, 0, 538, 460, 0, 557, 551, 555, 553, 554, 0, 1457, 0, 570, 0, 1098, 1112, 1191, 1186, 1416, 0, 0, 616, 615, 710, 2004, 2080, 2066, 2078, 2111, 0, 0, 0, 0, 1802, 1805, 0, 1836, 0, 0, 0, 0, 1822, 0, 1770, 0, 0, 1778, 0, 0, 0, 1723, 0, 0, 1585, 1595, 1093, 0, 0, 1107, 522, 0, 1095, 1094, 516, 785, 511, 498, 1615, 300, 351, 0, 0, 0, 859, 862, 850, 851, 870, 869, 726, 1615, 0, 373, 372, 0, 376, 0, 421, 430, 0, 428, 403, 408, 0, 412, 410, 409, 404, 407, 0, 504, 0, 0, 0, 0, 0, 525, 0, 526, 558, 0, 797, 0, 0, 0, 706, 857, 0, 0, 446, 680, 760, 765, 0, 0, 1455, 1572, 551, 538, 548, 0, 0, 542, 1102, 1102, 433, 555, 557, 1458, 1459, 0, 0, 359, 1415, 1414, 1668, 0, 0, 2579, 2335, 2551, 0, 2128, 2117, 2128, 2128, 2108, 0, 0, 1834, 1835, 1820, 0, 0, 1824, 1787, 1800, 1731, 0, 1730, 2103, 2104, 1811, 348, 1110, 0, 785, 520, 527, 500, 274, 1615, 853, 0, 269, 0, 378, 1502, 426, 0, 411, 773, 581, 474, 532, 0, 531, 0, 529, 528, 794, 799, 0, 680, 847, 1460, 694, 772, 0, 555, 548, 551, 0, 539, 0, 1104, 1104, 557, 431, 0, 0, 557, 1398, 1668, 1397, 1399, 1407, 1404, 1406, 1405, 1403, 1235, 1236, 0, 2121, 2120, 2119, 2123, 2122, 0, 2115, 2113, 2114, 1806, 0, 1823, 1826, 0, 0, 0, 1832, 1825, 1827, 0, 1798, 1732, 1592, 1075, 1096, 0, 502, 785, 282, 860, 0, 429, 0, 530, 534, 533, 680, 705, 1456, 778, 557, 551, 555, 1102, 543, 545, 544, 435, 1098, 1099, 0, 1811, 0, 1408, 1402, 1650, 1637, 0, 0, 0, 0, 2125, 0, 2126, 0, 1829, 1830, 1831, 1828, 0, 0, 503, 0, 0, 707, 780, 0, 776, 779, 781, 782, 434, 555, 557, 1104, 359, 1097, 0, 1082, 1400, 1668, 0, 0, 2118, 2124, 2127, 0, 0, 521, 374, 0, 744, 0, 557, 432, 546, 557, 1100, 1401, 0, 0, 0, 1799, 0, 777, 436, 1811, 0, 0, 1821, 778, 1083, 0, 0, 0, 1233, 1234, 745 }; /* YYPGOTO[NTERM-NUM]. */ static const yytype_int16 yypgoto[] = { -4903, -4903, -4903, 3727, -4903, -4903, -900, 394, 2959, -629, -4903, -4903, -4903, 1362, -4903, -4903, -4903, -4903, 3682, -4903, 2044, -2437, -4903, -4903, 134, -397, -1301, 109, 3241, 1693, -4903, -1143, -4903, -4903, -514, 172, -4903, 329, 297, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -710, 2159, -4903, 2240, 1522, 2904, -2762, -4903, -4903, -1440, -3237, -4903, 834, -4903, 861, -4188, -647, -4903, -4903, -4903, 2144, -4903, -4903, -4903, 2087, 1327, -92, -4903, -4903, -4903, -4903, -4903, -4903, -495, -4903, -4903, -740, 146, 39, -2458, -3762, -4903, -4903, 701, -140, -1428, -4903, -3590, -4903, 238, -2488, -4903, -4903, -4903, -107, -1401, 1628, -4903, -697, -1118, 1936, -2503, -605, -4903, 15, -4903, -716, -508, -504, -635, -3784, -4267, -4903, -4903, -4903, -744, -3201, -4523, -4739, -4262, -4455, 1639, -4903, 154, -3134, -3206, 155, 675, -4903, 158, 159, -4903, 691, -441, -907, -1519, -4903, -749, -4903, -4903, -4903, -2930, -4903, -4903, -4903, -4903, 78, -4903, -4903, -4903, -4903, 735, -4903, -4903, -4903, -4903, -4903, -4903, -2694, 2110, 2111, -4903, -3150, -4903, -865, -4903, 884, -2979, 1544, -4903, -4903, 1313, 3715, 720, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -1723, -4903, -4903, -4903, -4903, 234, -79, -4903, -4903, -4903, -4903, -4903, -4903, -4903, 160, -4903, 2131, 1314, -4903, -4903, -83, -4903, -4903, -4903, -4903, -4903, -4903, -695, -4493, -855, -836, -4903, -2955, -4903, -4903, -4903, -51, -4903, -4903, -4903, -4903, -4903, -840, -4903, 1379, -3610, -4903, -4903, 699, -4903, -4903, -4903, -4903, -4903, -610, 10, 2884, -4903, -219, -410, -4903, -4903, -4903, 14, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -1097, 7782, -818, -576, -4903, -4903, -4903, -4903, -4903, -1948, -4903, -4903, -4903, -4903, -3662, -4903, 4626, 2221, 684, 170, -4903, -29, 56, 3480, -1146, -2643, 665, -175, -4903, -4903, -4903, -2573, -4903, -4903, -4903, -4903, -3526, 171, -4903, -654, -4903, -3813, -4520, -3565, -759, -4903, -4067, -4435, -4551, -3513, -4903, -4903, -4903, -4903, -546, -185, 2848, -4903, -1388, 2485, -897, -4903, -2105, 718, 1729, 2857, -2737, -136, 2853, -2516, -648, -3261, -4903, -4903, -2336, -307, -4903, -4903, 1488, -3, -4903, -4903, -4903, -4903, -617, 2798, -203, -4903, -4903, 4023, -4903, -4355, -4903, 3982, -4903, -4903, -4903, -4903, 2706, 2712, -4903, 2709, -4903, -4903, -1382, 1482, -4903, -4903, -4903, -4903, 924, -4903, -4903, -4903, -4903, -4903, -4903, -4903, 1390, 910, -4903, -4903, -4903, -4903, -4903, -581, -758, -4903, -4903, 173, -4903, -4903, -4903, -4903, 2145, -891, -726, 3896, 626, 182, -4697, -4903, -4903, -1124, -4903, 3286, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -2616, -4903, -4903, -4318, -4903, -4903, -4903, -4903, -4903, 3883, 112, 2601, -4903, -4903, -4903, -46, -4903, -4903, -958, 2594, -4903, -1929, -4903, -597, -4903, 2789, -4903, -4903, -4903, -4903, -1886, 191, -3795, -4903, 12, -4903, -4903, 145, -4903, 563, -4903, -4903, -3426, 16, -4903, -4903, -4903, -4903, -4426, -4903, 20, -471, 1093, -2807, -4903, 205, 92, -4903, -4903, 2, 286, -49, -55, -19, 6, 116, 3361, -4903, -4903, 3402, -4903, 18, 1768, -4903, -4903, -824, -167, -4903, 1841, -633, 2574, 3363, 3366, -4903, 1829, 2602, -1960, -1944, -4903, 1136, -451, -293, -4903, -4903, -4903, -4903, 593, -622, 2585, -4903, 3370, -4903, -4903, -4903, -1939, -2834, -3461, 1161, -3443, -3340, 632, 617, -1344, -60, -38, -751, 3367, -4903, -4903, 1169, -259, -4903, -4903, -256, -2811, 1118, -4903, -4338, -2323, 1189, -699, -548, -4903, -616, -4903, -404, -540, 2932, -1056, -4903, -4903, -993, 15247, -4903, -4903, -4903, 15934, 16070, -4903, -4903, 16531, 17354, -4903, -800, 17855, 14181, -1021, -1878, -396, 13763, -1745, -463, 52, -4903, -3073, -1313, -4903, -4903, -4903, 1, 1243, 815, -4903, -4390, -3818, -4903, -4903, 216, -4903, -406, -4903, -411, -4903, -4903, -4903, -2566, -4902, -2652, 2716, -4903, -4903, -4903, -200, -4903, 18880, -2746, -4903, -355, -1322, -1508, -3440, -1884, -4903, -4903, -4903, -4903, -4903, -4903, -4903, -1415, -3309, -439, 1955, -4903, -4903, 2046, -4903, -4903, -4903, -909, 2327, -777, -2638, 1962, -4903, -770, 2720, -767, 13149, -567, 9648, -533, -2232, -1246, -1646, -4903, 5173, -4903, 7599, 6575, 31, -141, 2254, -594, -6, 14650, -652, -711, 4613, 12896, 11728, -3135 }; /* YYDEFGOTO[NTERM-NUM]. */ static const yytype_int16 yydefgoto[] = { -1, 53, 54, 55, 56, 57, 1534, 2506, 2361, 3288, 3289, 58, 59, 1530, 60, 61, 62, 63, 1445, 64, 1020, 1777, 2521, 65, 2194, 803, 804, 805, 2095, 2096, 2445, 2097, 2085, 1331, 1918, 1467, 777, 778, 1427, 1468, 67, 68, 1325, 2076, 69, 70, 71, 1498, 1585, 1499, 1500, 1439, 1824, 4317, 5053, 3085, 2324, 3336, 3086, 3087, 3710, 3711, 3789, 5067, 5068, 72, 1601, 1602, 73, 74, 2487, 3253, 3839, 4670, 4671, 4901, 613, 4340, 4341, 4888, 4889, 5081, 5224, 5225, 2522, 1769, 3331, 3924, 3279, 4411, 3280, 4412, 3281, 4413, 3265, 3871, 3872, 4354, 3873, 3282, 4372, 4933, 3283, 2213, 5097, 2563, 1940, 1938, 4589, 4915, 4179, 4180, 5311, 5105, 5106, 5107, 5333, 4374, 4417, 4418, 4963, 5266, 5267, 3334, 3930, 4424, 4736, 4687, 2970, 76, 709, 1803, 3440, 710, 2566, 647, 711, 2523, 81, 2556, 5099, 2557, 1560, 2375, 3852, 3420, 82, 1046, 3676, 4756, 4990, 4991, 83, 225, 84, 1785, 85, 86, 2501, 3272, 87, 2230, 2987, 88, 89, 3018, 3019, 3020, 90, 3701, 4607, 1501, 3074, 3075, 3076, 3077, 3732, 91, 1780, 2530, 2531, 92, 93, 94, 95, 2682, 2683, 96, 2432, 97, 98, 99, 100, 3766, 4281, 4388, 3115, 3295, 3896, 4386, 101, 3257, 2524, 1793, 2546, 2547, 4398, 4712, 4713, 4714, 4948, 5256, 4716, 4950, 5128, 4952, 4364, 5445, 5446, 4678, 3655, 4193, 103, 4365, 4366, 5112, 104, 2228, 105, 106, 1753, 2493, 2494, 3853, 2573, 3344, 3345, 3910, 3911, 107, 3197, 108, 4257, 4258, 648, 5119, 5059, 5210, 109, 110, 4261, 4262, 111, 112, 113, 114, 115, 701, 702, 703, 1137, 1138, 2942, 1085, 116, 2105, 117, 983, 984, 3232, 118, 1218, 2728, 2729, 4467, 119, 734, 1157, 1158, 2525, 121, 743, 2702, 745, 1955, 3422, 3423, 3992, 122, 123, 2679, 2705, 124, 1432, 2204, 2205, 4174, 2526, 649, 1203, 2570, 2965, 4828, 4829, 5277, 5419, 4584, 4842, 2887, 3606, 126, 650, 1472, 2280, 1105, 1106, 2576, 3348, 2173, 2174, 2175, 3950, 2176, 3350, 2177, 1405, 2178, 1056, 1057, 3356, 3357, 3358, 3946, 3953, 2515, 4746, 4747, 127, 1470, 2278, 128, 129, 130, 1513, 896, 1115, 1116, 131, 662, 663, 132, 4906, 133, 1059, 134, 4754, 135, 136, 768, 769, 1200, 1201, 137, 138, 2294, 3713, 139, 140, 141, 3109, 3110, 4273, 142, 143, 1772, 1773, 144, 145, 3162, 3163, 146, 147, 148, 5359, 5421, 5422, 5423, 3959, 5280, 5361, 1188, 150, 151, 152, 189, 936, 937, 938, 849, 2527, 4738, 154, 155, 1428, 1429, 1430, 1431, 2199, 156, 157, 158, 159, 160, 161, 162, 1757, 163, 164, 4881, 165, 166, 1718, 167, 168, 1354, 1355, 1356, 1357, 2110, 2875, 607, 821, 1360, 1366, 1371, 1372, 1373, 170, 713, 1151, 1152, 1153, 1920, 171, 1196, 987, 714, 1146, 173, 715, 2156, 2917, 3620, 3621, 3622, 3625, 4569, 4152, 716, 2913, 176, 1962, 2688, 2691, 2909, 717, 2922, 2923, 2924, 3628, 718, 736, 1049, 2583, 719, 1292, 181, 182, 183, 830, 824, 825, 2880, 185, 2069, 2856, 752, 1377, 790, 791, 839, 2455, 2122, 2123, 2147, 2148, 1386, 1387, 2135, 2139, 2140, 2900, 2893, 2128, 4139, 4813, 4814, 4815, 4816, 4817, 4818, 4555, 2143, 2144, 1389, 1390, 1391, 2152, 186, 2860, 3580, 3581, 3582, 4116, 4117, 4131, 4127, 4540, 4800, 3583, 1186, 1397, 4548, 5389, 3584, 4789, 4790, 5006, 4135, 3591, 3616, 3319, 3320, 3321, 3585, 5175, 5176, 5386, 5387, 5008, 5009, 2179, 1853, 1087, 1293, 1088, 1865, 1294, 1837, 1090, 1295, 1296, 1297, 1093, 1298, 1299, 1300, 1096, 1829, 1301, 1302, 1847, 1862, 1863, 1361, 5010, 1304, 1305, 1306, 3587, 1307, 4070, 4504, 4490, 2788, 2789, 2092, 4066, 3525, 4060, 2064, 2846, 4822, 5027, 5028, 3564, 4095, 4520, 4787, 5167, 5287, 5288, 5375, 1308, 1309, 1310, 2843, 2060, 899, 1311, 3855, 2062, 2782, 1626, 1627, 1965, 1987, 2735, 2751, 2752, 2762, 3484, 2770, 2775, 3512, 3513, 2783, 2812, 1312, 2737, 2738, 3468, 1989, 1313, 942, 1630, 943, 1984, 2807, 1321, 1314, 1315, 1956, 814, 4796, 1141, 855, 3101, 1710, 945, 749, 1316, 1317, 1318, 1319, 1506, 870, 1108, 1109, 604, 596, 872, 3078, 605, 598, 599, 1715 }; /* 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[] = { 595, 897, 179, 829, 898, 1559, 184, 813, 782, 1052, 1917, 1014, 174, 1873, 863, 840, 175, 746, 1392, 748, 177, 1322, 903, 754, 1843, 908, 1326, 184, 1606, 771, 779, 746, 2212, 786, 1716, 1411, 779, 779, 1352, 815, 2388, 818, 1624, 1177, 1178, 1179, 1618, 3278, 1564, 1183, 2289, 3593, 646, 738, 850, 2319, 1154, 1937, 593, 738, 3445, 3359, 1849, 3160, 816, 1353, 1977, 1782, 906, 2935, 2937, 2458, 3906, 2551, 1340, 1833, 1834, 2290, 3614, 744, 2694, 3301, 927, 2281, 4181, 1842, 999, 3682, 1473, 3702, 1121, 4145, 3727, 783, 3729, 3954, 700, 3194, 3954, 1755, 602, 2734, 2302, 1760, 1134, 3103, 3426, 654, 1764, 4082, 1148, 4219, 169, 2449, 3627, 1204, 4585, 4113, 1774, 4176, 4371, 1131, 3922, 834, 3880, 4431, 4410, 4242, 3857, 842, 1505, 1086, 1798, 712, 2862, 1140, 1119, 1061, 3935, 1123, 3604, 4130, 4420, 4793, 1052, 776, 75, 1050, 2413, 2414, 4843, 2797, 810, 4733, 77, 78, 3533, 1086, 79, 80, 102, 2273, 2571, 4419, 2185, 843, 4740, 827, 1358, 1352, 120, 125, 66, 149, 1767, 2633, 802, 2872, 2902, 4851, 920, 1358, 153, 4694, 595, 853, 853, 856, 2881, 853, 1795, 172, 3919, 865, 3633, 815, 2905, 4919, 900, 4158, 2409, 865, 1558, 4049, 865, 178, 1385, 815, 4965, 853, 1584, 4805, 815, 4807, 2108, 1469, 853, 1388, 815, 4873, 1611, 2273, -1893, 4978, -2275, 3490, 5139, -2374, 1794, 4913, 1711, 4732, -2275, -2275, -1860, 720, -2412, -2435, 2273, 611, -2467, 4495, 5121, 4128, 1821, 4133, -1873, 660, 3217, 1833, 1834, 1849, 2103, -1898, 2425, 1469, 3327, -2247, 1821, 2303, 1469, 2767, -2276, 1213, 2420, -2634, 1830, 1831, -1888, 1842, -2276, -2276, -1901, -2634, -2634, 660, 3291, 1841, 1502, 2032, 1821, 1864, 1333, 720, 2512, 660, 180, 3632, 3268, -2246, 2805, 5042, 5043, 5058, 660, 1746, 3944, 2447, 2448, 4911, 2548, 2196, 3443, 762, -419, 848, 2292, 180, 2038, 3874, 932, 660, 720, -2303, 2704, 660, 2407, 2805, 861, 660, 4648, 4907, 720, 660, 660, 3683, 2485, -2377, 2401, 4432, 3430, 2859, 932, 2504, 4883, 4884, 720, 1751, 828, 1159, 2040, -1716, 4567, 3432, 4649, 4469, 4470, 2560, 4472, 4473, 4474, 4475, 4476, 1163, 1330, 2981, 2129, -2244, 4407, 1190, 4968, 2847, 1821, 5093, 1399, 4381, 3904, 4357, 2378, 2292, 4583, 4033, 2561, 4034, 4969, 2509, 2907, -1901, 2341, 1821, 1615, 5368, 1514, 4408, 1441, 1808, 2355, 3393, 763, 3395, 726, 2680, 5047, 2956, 3269, 2130, 2074, 1181, 3695, 726, 726, 2884, 5272, 726, 1919, -2433, 5086, 933, 3434, 2292, 2968, 5087, 1821, 2964, 727, 1724, 2119, 2090, 1542, 3783, 2082, 1502, 660, 727, 727, 1532, 720, 727, 898, 933, 1335, 1830, 1831, 5055, 2032, 5260, 1912, 1821, -2138, 1913, 1741, 2292, -133, 1716, 5141, -2138, 1821, -133, 1533, 1618, 934, 2293, 2078, 2840, 1515, 1749, 4382, 1543, 1841, 2091, 2841, 41, 5088, 2038, 2075, 4966, 2969, 1362, 5020, -1091, 841, 3696, 934, 2549, -2157, 2681, 726, 1752, 2957, 898, 1182, -2157, 2908, 1052, 1441, 1008, 2885, 3435, 606, 2372, 726, 1018, 2510, 1442, 2104, 2040, 1752, 45, 2848, 4035, 727, 1052, 2379, 2132, 1032, 2380, 2292, 2032, 935, 4036, 5094, 2342, 4358, 2292, 727, 2026, 3237, 1822, 3238, 2292, 1577, 2505, 3242, 1881, 3244, 3245, 5462, 4944, 2218, 2083, 935, 1822, 5352, 3249, 3250, 3251, 2038, 819, 49, 3845, 4383, 764, 4970, 2072, 1968, 4593, 3431, 1960, 3486, 5092, 4568, 50, 3466, 1822, 1400, 1616, 1342, 2304, 1921, 3433, 2562, 2486, 2133, 940, 1716, 1052, 5238, 941, 2040, 2391, 2305, 4409, 2306, 3231, 51, 3270, 4182, 3770, 4466, 3683, 3218, 1182, 765, 766, 1339, 5194, 1004, 1957, 52, 2086, 5199, 3490, 655, 1442, 2098, 2098, 4912, 4650, 3490, 862, 3875, 946, 3857, 1967, 5193, 5409, 4339, 815, 2109, 853, 2426, 853, 1512, 856, 991, 853, 1102, 5271, 184, 1978, 1182, 1901, 900, 1075, 988, 1871, 4276, 1021, 989, 853, 2408, 2497, 990, 2307, 2806, 1822, 853, 5259, 2427, 2550, -2433, 4509, 5309, 5407, 2513, 2084, 1961, 1828, 2421, 3629, 3945, 1752, 1822, 2982, 2383, 1964, 4380, 2386, 4537, 829, 595, 3553, 4541, 3271, 856, 4130, 1155, 612, 1823, 865, 1752, 1215, 5452, 900, 767, 1393, 865, 1617, 4775, 865, 3837, 3838, 1850, 1052, 2113, 1822, 982, 3505, 2356, 4384, 5134, 1052, 1052, 3022, -1893, 853, -2275, 4186, 4428, 1711, 2393, 2259, 3378, 1981, 1868, 1052, 1832, -2374, -2433, 1844, 1822, 2267, 5472, 184, 1185, 4480, -2412, -2435, 1836, 1822, -2467, -2433, 1624, 1624, 1624, -1898, 2446, 940, 4427, -2247, 1845, 941, 3648, 3784, -2276, 2402, 4572, -2634, 2257, 5344, -1888, 2059, 1503, 1504, 1846, 1147, 815, 2028, 2861, 779, 779, 779, 1156, 5221, 1161, 5354, 1165, 2070, 4385, 2153, 1733, -2246, 1169, 898, 1205, 4402, 2865, 4528, 5039, 4530, 2154, 732, 733, 940, 1728, 842, 5315, 941, 1185, -2138, 1735, 732, 733, 1736, 1320, 1320, 1879, 815, 779, 5319, 1910, 1343, 779, -2303, 2842, 732, 733, 2373, 2115, 2335, 2376, 2377, 2454, 1903, 3857, 2637, 815, -2377, 1396, 4765, 815, 843, 1721, 2684, 1844, -2157, 1320, 1433, 2654, 1443, 1150, 2080, 2277, 5411, 1448, 4729, 3780, 1172, 815, 3635, 3098, 3636, 5292, 2206, 179, 1845, 1906, 4208, 184, 1415, 815, 1961, 2219, 4246, 174, 2113, 2664, 3919, 175, 1848, 820, 2207, 177, 1752, 4594, 2736, 815, 2676, 3041, 1344, 656, 1871, 1590, 3898, 776, 1191, 1193, 1005, 5239, 5264, 3991, 2611, 1209, 3023, 815, 2277, 1726, 5270, 1532, 853, 853, 1444, 1821, 2665, 3013, 1503, 1504, 5451, 4343, 5382, 5397, 4999, 2277, 2056, 2057, 2058, 2059, 1103, 180, 2343, 4166, 1533, 3081, -1860, 1591, 660, -133, -133, 2995, 2208, 779, 779, 4342, 3887, 4752, 5414, 5415, 2695, 657, 1416, 1174, 2142, 5278, 3059, 1040, 5248, 1434, 2209, 1329, 3955, 3678, 2902, 1337, 1320, 1320, 1595, 2025, 2685, 3113, 1363, 2946, 1596, 595, 3188, 169, 3227, 3598, 5263, 3609, 5469, 2067, 3099, 2825, 865, 3082, 4369, 658, 900, 659, 865, 4957, 3014, 865, 4988, 2054, 2055, 2056, 2057, 2058, 2059, 5023, 1417, 2339, 608, 3192, 2273, 3189, 853, 75, 4492, 2467, -1860, 844, 3630, 3060, 4156, 77, 78, 3596, 5433, 79, 80, 102, 180, 828, 2744, 5345, 660, 5383, 815, 1871, 5101, 120, 125, 66, 149, 853, 853, 3831, 3832, 5353, 4857, 3114, 3956, 153, 4274, 4181, 2560, 5474, 3487, 3488, 4407, 2968, 172, 3507, 776, 1191, 1426, 815, 815, 815, 4445, 853, 747, 595, 595, 595, 178, 2388, 2593, 2594, 2495, 2561, 2161, 1597, 3083, 4408, 4770, 3500, 3501, 3502, 3503, 3504, 3505, 4924, 1855, 2954, 3502, 3503, 3504, 3505, 3537, 3538, 837, 1041, 1790, 845, 1418, 1592, 2210, 4395, 3090, 2206, 4362, 3127, 2731, 3888, 4797, 3651, 2220, 1435, 1786, 4801, 3255, 1189, 4803, 1791, 2826, 4493, 1998, 5416, 4794, 2827, 1175, 5420, 2914, 1815, 5279, 5000, 2745, 5429, 3927, 2214, 881, 853, 4925, 853, 853, 2564, 660, 882, 883, 884, 4926, 1843, 661, 841, 1716, 180, 1436, 4254, 2195, 837, 1787, 1814, 5102, 1890, 1856, 2542, 2828, 2215, 3178, 2666, 2686, 3017, 1524, 4989, 3179, 5114, 1320, 5384, 4927, 5329, 4370, -1860, 5385, 1545, 5450, 2208, 4753, 1816, 2475, 1437, 2687, 3128, 1822, 1855, 1727, 3854, 5113, 5133, 184, 3957, 1716, 5148, 1546, 2209, 4719, 1891, 1939, 1939, 2746, 1593, 1624, 815, 5136, 746, 5430, 3193, 3954, 3679, 2211, 2462, 4300, 2673, 2674, 3751, 3349, 1857, 2996, 5473, 1858, 3859, 2476, 762, 4928, 5135, 815, 1598, 2479, 5103, 5350, 5351, 1974, 4725, 1042, 815, 3129, 4929, 1980, 5484, 3084, 2543, 5485, 4363, 1547, 4731, 2498, 3704, 1438, 4930, 2221, 4578, 1320, 2068, 1423, 4255, 1424, 1856, 3670, 4706, 3958, 2747, 835, 5254, 2748, 986, 1599, 3862, 4608, 3180, 1043, 829, 1792, 1525, 1576, 2026, 1817, 3951, 3998, 1923, 2939, 1925, 1320, 1927, 4146, 1929, 5431, 1931, 1932, 1933, 1154, 2592, 3061, 3130, 1935, 2915, 2829, 3091, 2453, 1600, 3671, 2216, 2579, 5034, 2310, 2614, 2934, 3256, 763, 3190, 1320, 1320, 1320, 846, 1320, 2587, 1788, 751, 1857, 2626, 3830, 1858, 3864, 2588, 3752, 1859, 836, 1086, 1818, 1044, 1548, 2224, 2632, 2032, 1320, 1045, 5037, 2210, 2311, 2601, 2222, 2225, 3191, 2111, 2646, 898, 4147, 788, 2631, 3381, 2612, 2120, 2121, 3062, 2125, 2803, 3705, 3220, 4995, 1144, 4256, 1892, 41, 4972, -1860, 2625, 5330, 2639, 2627, 2749, 5016, 4973, 815, -1860, 5453, 1832, -1860, 1410, 1549, -1860, 4301, 1550, 4571, 2630, 1086, 1396, 2477, 843, 843, 5370, 843, 3131, 2387, 760, 2040, 3602, 837, 3013, 45, 3206, 5137, 4850, 1320, 2519, 2663, 1596, 1320, 1320, 2668, 4680, 3382, 3384, 2672, 2906, 3867, 2675, 2760, 815, 815, 2159, 1789, 1320, 1819, 3181, 1552, 3999, 1859, 1526, 2667, 5432, 4931, 2670, 2671, 4932, 4689, 1860, 1160, 1162, 1164, 49, 1216, 1166, 1167, 1168, 5331, 779, 2544, 789, 761, 2211, 5057, 1173, 50, 4168, 1861, 5061, 5062, 3868, 4464, 2545, 932, 764, 3182, 4440, 3672, 1893, 1527, 5035, 4564, 1554, 180, 5332, 5403, 3869, 3014, 51, 1415, 4872, 3753, 2750, 2264, 2520, 2268, 2940, 1358, 779, 2941, 4791, 853, 2916, 2478, 1555, 2226, 3146, 2320, 3183, 41, 5190, 1491, 1528, 815, 2291, 765, 766, 1711, 3787, 2590, 3015, 1597, 3013, 815, 1557, 3132, 853, 2320, 3857, 5054, 3754, 1859, 1859, 3133, 2798, 609, 3134, 4182, 1871, 2126, 2658, 784, 5371, 1491, 2227, 45, 4974, 838, 41, 1860, 4182, 1381, 900, 1986, 815, 1561, 5164, 4956, 779, 3016, 4690, 3391, 2350, 3755, 3788, 2252, 3706, 3707, 3707, 1416, 933, 5196, 5197, 1995, 4967, 779, 4361, 815, 4720, 2367, 815, 3673, 3870, 2404, 45, 2768, 49, 2269, 3588, 1052, 4484, 625, 4485, 2786, 1562, 3708, 4233, 1375, 1624, 3014, 4943, 887, 888, 889, 2011, 890, 891, 892, 893, 894, 895, 4396, 3027, 934, 1871, 815, 187, 3039, 3187, 2023, -675, 1417, 4015, 1383, 3184, 49, 853, 853, 853, 853, 815, 5327, 5404, 4401, 187, 2127, 52, 2385, 50, 4169, 187, 3588, 3120, 3121, 815, 4170, 3124, 811, 2298, 3088, 2299, 627, 4171, 1871, 2320, 1320, 1320, 1320, 1381, 188, 3017, 51, 2321, 3185, 1384, 3221, 3222, 3223, 3147, 2388, 2730, 935, 2733, 3111, 3854, 52, 3150, 188, 2740, 3153, 2129, 2659, 2321, 188, 2754, 2755, 2756, 4172, 3694, 2215, 2322, 606, 787, 5165, 2772, 2774, 3186, 1376, 4272, 2784, 4121, 2951, 1563, 3145, 3028, 841, 841, 2894, 841, 4173, 2322, 2300, 4182, 2660, 5207, 2323, 3298, 1418, 2623, 2130, 898, 898, 3978, 5166, 1529, 2613, 2661, 4259, 4486, 2586, 1383, 3036, 3164, 4122, 2200, 2323, 3168, 833, 2993, 3310, 3311, 3312, 3313, 5120, 1426, 2201, 4695, 831, 4543, 1426, 2318, 3318, 3010, 2459, 3227, 815, 4143, 4222, 4124, 1844, 3825, 2662, 4946, 2202, 2410, 4909, 1343, 853, 853, 3212, 2318, 1419, 3017, 4189, 3135, 4610, 3346, 3618, 1420, 2131, 1845, 4614, 4448, 41, 4449, 1033, 5208, 853, 4029, 4030, 4031, 4032, 4696, 3043, 4037, 4038, 4039, 4040, 4041, 4042, 4043, 4044, 4045, 4046, 3297, 3781, 815, 5140, 4947, 2321, 1421, 5147, 3619, 638, 36, 639, 1752, 1426, 1401, 45, 1034, 1426, 853, 853, 853, 853, 3785, 2132, 5117, -156, 3266, 4223, 5418, 4260, 1344, 815, 1381, 2322, 5393, 4355, 1768, 1382, 815, 1422, 2459, 5131, 898, 1209, 3135, 4244, 4086, 4087, 4590, -1689, 4190, 1035, 595, 1402, -1689, 595, 49, -2266, 2323, 856, 4764, -156, 3125, 4987, 1320, 2359, 4126, -1650, 4674, 50, 2362, 1423, 3854, 1424, 3782, 2378, 1412, 4882, 1922, -1650, 5158, 1924, 2133, 1926, -1650, 1928, 1403, 1930, 832, 3654, -156, 1934, 51, 2318, 4856, 3542, 3590, 3543, 1036, 865, 865, 4675, 1796, 4356, 1383, 2203, 52, 4191, 3339, 4192, 900, 900, 5050, 4189, 865, 1413, 4591, 865, 4245, 4331, 3544, -1689, 1425, 4334, 4335, 1797, 4337, 3954, 726, 5476, 2310, -1650, 1033, 3931, 853, 853, 4886, 2440, 2430, 1844, 3629, 853, 2436, 815, 822, 1384, 1223, 5126, 1414, 3490, 4693, -1650, 727, 3491, 3492, 3493, 184, 5095, 3419, 1898, 1845, 2689, -1689, 848, 2311, 5261, 1052, 1034, 1939, 4791, 4832, 5262, 4834, 1532, 1846, 853, 2441, 865, 4983, 5127, 865, 865, 1899, 815, 815, 2701, 853, 2611, 3259, 4724, 4704, 4879, -1650, 815, 4190, 4352, 1533, 916, 4182, 847, 815, -1650, 3900, 5250, 4597, 4598, 991, 746, 746, 2379, 184, 2706, 2380, 1844, 4880, 1320, 988, 1320, 2678, 4353, 989, 1052, 1320, 1320, 990, 1006, 917, 1007, 3545, 1320, 1320, 1320, 1906, 3546, 1845, 1320, 900, 1320, 1320, 1320, 1320, 1320, 1320, 857, 1320, 4187, 1320, 1320, 1848, 1036, 1320, 4191, 2648, 4192, 2649, 1566, 2650, 859, 2651, 1871, 2652, 4684, 2320, 1150, 2653, 1320, 1320, 1320, 1320, 2700, 1420, 879, 853, 1320, 1586, 3592, 3001, 1320, 5356, 898, 1320, 3441, 3442, 1320, 1320, 1320, 1320, 1320, 1320, 1320, 1320, 1320, 2997, 1320, 1567, 3002, 3003, 5157, 2727, 815, 1320, 5346, 1320, 5268, 3362, 1406, 36, 4024, 625, 815, 2442, 880, 3523, 1587, 2878, 4836, -1650, 1588, 3530, 1010, 4319, 1011, 4845, 2443, 2032, 3494, 3748, 1568, -1650, 5091, 5201, 2879, 2514, -1650, 2989, 2358, 4050, 3418, 815, -1650, 1407, 4320, 755, 5341, 1408, 1320, 1589, 3495, 5124, 815, 815, 2444, 3634, 2038, 1223, 4351, 2098, 3490, 4879, 3404, 1320, -2635, -2635, -2635, 2813, 3749, 2814, 931, 627, 1320, 1320, 756, 2439, 3779, 3547, 757, 3594, 1409, 922, 3035, -1650, 4880, 5410, 815, 3548, 2040, 41, 3990, 226, 2815, 2920, 3437, 2925, 3684, 610, 4302, 2918, 993, 3750, 1906, -1650, 940, 704, 2292, 1367, 941, 2516, 4710, 3449, 3496, 2958, 939, 2961, 2301, 995, 4879, 3307, 2321, 4303, 3712, 625, 785, 45, 3457, 856, 4711, 5406, 4232, 3991, 3737, 2553, 4403, 998, 746, 3907, 746, 180, 1569, 4880, 1015, 4182, -1650, 3738, 3551, 3917, 2322, 2327, 3383, 3385, 3386, -1650, 720, 1320, 1052, 3021, 5475, -444, 3126, 940, 5189, 2328, 2874, 941, 49, 595, 720, 853, 853, 2955, 1001, 2323, 865, 3368, 900, 865, 865, 50, 853, 1570, 853, 627, 735, 5314, 853, 1839, 1840, 815, 735, 1571, -573, 180, 4847, 2816, 5443, 1028, 1969, 706, 2817, 1970, 51, 3588, -572, 2818, 3588, 4224, 2318, 4231, 1535, 779, 4217, 3, 4, 1037, 52, 5268, 5083, 15, 5085, 2291, 3315, 4182, 5089, 5090, 1039, 3316, 1603, 3046, 815, 1607, 4430, 638, 3209, 639, 3462, 3058, 2320, 4003, 1038, 2113, 2768, 2768, 4209, 4120, 815, 2768, 1832, 1101, 1410, -1649, 3687, 20, 1185, 1185, 3607, 3463, 1185, 1058, 1768, 720, 3464, -1649, 1624, 1985, 815, 52, -1649, 2811, 1624, 3102, 3102, 5125, 706, 1052, -444, 3588, 3858, 3516, 1054, 3518, 3519, 3316, 2768, 2768, 815, 815, 1117, 3903, 815, -1650, 856, 779, 15, 3966, 3967, 5395, 1110, 2106, 4247, 2320, 2107, 3640, 3641, 3497, 3498, 3499, 3876, 3500, 3501, 3502, 3503, 3504, 3505, -1649, 853, 4121, 1111, 853, 3496, 2320, 1128, 4665, 4182, 4666, 4667, 3743, 20, 4668, 1135, 3639, 1523, 3643, 1145, -1649, 1832, 1540, 2186, 720, 815, 815, 1572, 1176, 4165, 638, 2819, 639, 3024, 1832, 4122, 2186, 3489, 2451, 2452, 3195, 2820, 3198, 3200, 2112, 2117, 3846, 2113, 2107, 3517, 4123, 940, 2581, -2247, 2582, 941, 2643, 644, 1180, 2113, 4124, -1649, 1573, 1832, 1187, 2186, 1574, 5440, 180, 1184, -1649, 1320, 1320, 1320, 3, 4, 3663, 1320, 2321, 2655, 871, 3540, 2656, 853, 2657, 2692, 4125, 2656, 2693, 907, 5150, 853, 1195, 4937, 853, 3674, 3100, 1198, 3661, 1575, 853, 1185, 2877, 928, 1197, 1906, 2322, 4798, 3567, 1320, 3568, 853, 2926, 33, 4421, 2113, 3778, 3033, 1199, 3566, 3034, 3105, 5391, 1208, 3106, 2291, 5040, 1202, 3102, 3261, 815, 2323, 3262, 815, 1207, 5045, 2320, 3300, 2903, 2904, 746, 2321, 3854, 41, 618, 1209, 3764, 3369, 4414, 3569, 2113, 3570, 853, 1320, 3452, -1711, -1711, 3455, 4184, 4185, 3456, 2321, -1715, -1715, 3410, 3773, 2318, 2656, 3461, 2322, 3195, 2113, 4126, 3470, 1206, 5308, 2113, 2495, 1210, 45, 853, 3349, 3332, 3476, 3303, 1211, 2113, 3328, 33, 2322, 3756, 1212, 3758, 3477, 2323, 1217, 2113, 3448, -2635, -2635, -2635, 1219, 3500, 3501, 3502, 3503, 3504, 3505, -1649, 1320, -1714, -1714, 2320, 2320, 2323, 1338, 3478, 3588, 41, 2113, 49, 3509, 3893, 3164, 2113, 5289, 5290, 3127, 625, 2318, 1378, 3522, 1380, 50, 2113, 5457, 853, 1341, 853, 3102, 853, 3102, 3928, 1052, 3929, 1052, 3786, 3284, 898, 2318, 2731, -1085, 3527, 1345, 45, 3528, 51, 835, 3730, 4799, 4120, 3731, 3735, 5376, 5377, 3736, 4979, 2611, 3759, -1690, 52, 3760, 3940, 1346, -1690, 3941, 1939, 3942, 1347, 3964, 3943, 3808, 2113, 4056, 4067, 1359, 4057, 4068, 627, 1223, 4078, 2321, 3490, 2113, 1365, 49, 3491, 3492, 3493, 707, 5490, 4154, 4159, 3994, 4155, 4160, 1351, 3128, 50, 5357, 29, 4164, 3603, 4075, 2941, 4344, 3886, 4345, 3889, 2322, 3827, 836, 3819, 4210, 1364, 2320, 1052, 595, 1367, 1618, 4009, 51, 4121, 865, 3302, 4188, 865, 1368, 2656, 865, 4232, -1690, 4887, 829, 2323, 708, 1379, 4404, 853, 2731, 2656, 4461, 4481, 1394, 1961, 2113, 1320, 3859, 1410, 4510, 3129, 1320, 2693, 3860, 4767, 4122, 4522, 2321, 2321, 2113, 2031, 4574, 1398, 2032, 2941, 3861, 5458, 1395, 5459, 2318, 4123, 3877, -1690, 3879, 1320, 1320, 1320, 829, 1404, 1320, 4124, 837, 1367, 29, -1638, 2322, 2322, 1320, 1320, 1320, 1320, 1446, 2038, 3862, 41, 3863, 4542, 1471, 4545, -2635, 1320, 3285, -2277, 1320, 4606, 1320, 4125, 3130, 3043, 1474, 2323, 2323, 4724, 1476, 1477, 4580, 1320, 1320, 4581, 1512, 1320, 1517, 3588, 4225, 2040, 4248, 3588, 1516, 4136, 1529, 45, 4062, 900, 1518, 1320, 1541, 1320, 1544, 1320, 1578, 638, 4586, 639, 3963, 2656, 2318, 2318, 2790, 3864, 4587, 2793, 1579, 2656, 641, 3948, 1531, 4726, 4772, 1320, 4727, 4773, 180, 815, 1594, 643, 4002, 3987, 1768, 1604, 3589, 2321, 49, 1605, 1608, 1613, 4205, 3865, 41, 4774, 4781, 3495, 2113, 2693, 829, 50, 815, 1614, 3572, 3573, 3574, 1717, 3539, 4126, 1320, 4852, 1720, 1009, 4853, 2322, 1725, 4938, 4980, 1009, 2656, 4981, 3131, 4996, 51, 1320, 2693, 1719, 5003, 1722, 45, 5004, 1009, 1729, 1545, 1738, 838, 1730, 5358, 3589, 2323, 1739, -2539, 3623, 3586, 1742, 3626, 1745, 2925, 1748, -2541, -2635, 3866, 1546, 1756, 5013, -2635, 3867, 1906, 3496, 1545, 5019, 4019, 1750, 3914, 5021, 3286, 5032, 3914, 1759, 5033, 49, 4338, 5076, 5116, 2318, 5077, 2077, 5149, 1546, 1761, 5033, 1752, 4028, 50, 4325, 1770, 5159, 1771, 1320, 2693, 3102, 5160, -2635, 1775, 3528, 1939, 3586, 5161, 5172, 3868, 2113, 5173, 1547, 1776, -176, 5178, 51, 4051, 1906, 5181, 5200, 1778, 3914, 2656, 3287, 3869, 5206, 1779, 1781, 2693, 52, -1409, 853, -1409, 853, 853, 853, 5212, 1547, 1783, 2693, 5213, -2539, 4328, 2693, 5216, 1784, 1799, 2113, 2047, -2541, 1964, 3132, 5217, 4271, 5218, 2113, 4505, 5219, 5246, 3133, 5296, 5247, 3134, 5297, 4994, 1806, 3088, 1813, 4243, 2768, 2768, 2768, 2768, 206, 4227, 2768, 2768, 2768, 2768, 2768, 2768, 2768, 2768, 2768, 2768, 5300, 5301, 1820, 1906, 2113, 3111, -2539, 5302, 2023, 1825, 2113, 1835, 1548, 5304, -2541, 1826, 2113, 4059, -2539, 3603, 1827, 1838, 5323, -2539, 3164, 5324, -2541, 5348, -2539, 5378, 5349, -2541, 3914, 1828, -2539, 3870, -2541, -2539, 1548, 1852, 5390, -2539, -2541, 5026, 1832, -2541, 2768, 2768, 5417, -2541, 5455, 5033, 2023, 5456, -2635, 5468, 1836, 1854, 2113, 4891, 1549, 5470, 815, 1550, 5471, 5488, 1866, 1867, 5297, 2811, -2539, 1870, 1878, 1882, 2387, 3497, 3498, 3499, -2541, 3500, 3501, 3502, 3503, 3504, 3505, 3560, 1549, 4026, 5496, 1550, -2539, 5471, 1884, 1871, 1885, 1887, 1889, 1894, -2541, 1895, 2387, 3579, 1897, 4892, 1902, 1905, 1552, 1908, 1909, 1911, 1936, 1966, 1973, 1975, 1982, 1976, 1983, -1864, -1871, 1990, 1991, 4055, 1992, 1993, 1994, 52, 1996, -1861, 4893, 1997, -1862, -2539, 1552, 1998, -2539, 1999, 2000, 2001, 2003, -2541, -2539, 2004, -2541, 2005, -1865, 4894, 2006, 2007, -2541, 4895, -1863, 1554, 2063, -2635, 3579, 2008, 2009, 2010, 828, 2012, 2054, 2055, 2056, 2057, 2058, 2059, 4098, 2013, 2014, 4896, 1320, 2015, 4897, 1555, 3588, 2016, 1320, 1554, 2017, 2018, 2019, 3588, 2065, 1716, 2067, 853, 3588, 4898, 2068, 3588, 3102, 3102, 2081, 1557, 2093, 4458, -2539, 2077, 2101, 1555, 2116, 2118, 1382, 2731, -2541, 2149, 1384, 2151, 2160, 2162, 2163, 3588, 2164, 2165, 2181, 2182, 2183, 4700, 5171, 1557, 2184, 2186, 2189, 2187, 3588, 815, 815, 815, 2188, 2190, 2191, 755, 2192, 2198, 2217, 2223, 2229, 2254, 2258, 2260, 2261, 2262, 815, 2266, 2263, 2265, 2283, 2282, 2284, 4376, 4377, 751, 2295, 2308, 2296, 2297, 2312, 2314, 2317, 751, 3938, 2318, 2315, 1223, 1939, 815, 3490, 2325, 2326, 4899, 3491, 3492, 3493, 2329, 1939, 815, 815, 2316, -2539, 2330, 815, 2331, 4414, 3102, 2340, 2346, -2541, 4076, 2336, 2337, 2351, 2347, 815, 2348, 2352, 2353, 3934, 2354, 2357, 2363, 2360, 2374, -2539, 2364, -2539, -2539, 2381, 4378, 2365, 2369, -2541, 2384, -2541, -2541, 2370, 2382, 2389, 2390, 1491, 2422, 4900, 2394, 2395, 3962, 2396, 2403, 2398, 2399, 2400, 2405, 2406, 2411, 2412, 2423, 2428, 2424, 2429, 4562, 2461, 2434, -2539, 2463, 2438, -2539, -2539, -2539, 1185, 2464, -2541, 2450, 4092, -2541, -2541, -2541, 2457, 2768, 2465, 853, 2466, 2470, 2484, 2472, 2471, 2473, 2474, 2480, 2490, 2481, 2482, 2483, 2491, 4453, 4454, 4455, 4456, 4457, 2031, 2489, 815, 2032, 2488, 2496, 2500, 2033, 2034, 2035, 3588, 2499, 2503, 2508, 620, 815, 2514, 2517, 815, 2528, 4672, 1563, 2532, 2533, 2036, 2536, 2552, 2568, 2541, 2559, 2572, 2555, 2038, 2558, 2578, 2580, 2575, 2584, 1223, 2039, 1320, 3490, 2595, 2589, 2597, 3491, 3492, 3493, 2598, 1320, 2602, 2605, 2616, 2603, 2606, 1320, 4613, 1320, 2607, 2609, 1320, 2608, 4512, 2618, 2040, 1320, 1320, 1320, 1320, 3588, 2619, 1320, 1320, 1320, 1320, 1320, 1320, 1320, 1320, 1320, 1320, 2620, 2634, 2621, 1320, 1320, 2635, 2669, 3495, 2690, 829, 2677, 2703, 2736, 1320, 2741, 2785, 2791, 1320, 2032, 2795, 2804, 1320, 2810, 2822, 2824, 2844, 4560, 2845, 829, 1320, 2859, 2864, 1320, 2867, 1320, 2868, 3603, 2869, 2870, 2883, 1964, 4745, 836, 1320, 2895, 2896, 1320, 1320, 2897, 2912, 2898, 1320, 1320, 2919, 2930, 2931, 4096, 2966, 1320, 2959, 3603, 2964, 2967, 2933, 2973, 815, 815, 815, 595, 3496, 2962, 3589, 4118, 2978, 2983, 2990, 4118, 4132, 4118, 2988, 2998, 3008, 2994, 1320, 4100, 4101, 4102, 4103, 3009, 3025, 3012, 3026, 3031, 2041, 1335, 1339, 4496, 2984, 2042, 3042, 3049, 991, 2986, 3050, 3063, 184, 3068, 3094, 1320, 3069, 3095, 988, 3097, 3104, 3116, 989, 3112, 3136, 4604, 990, 2043, 2044, 2925, 180, 1320, 3140, 3586, 3196, 3208, 3586, 3588, 3215, 3228, 3234, 3216, 2045, 5434, 5435, 3219, 837, 3239, 3240, 4183, 1939, 1939, 3241, 2459, 4533, 3247, 3252, 180, 3263, 3275, 3276, 3290, 4596, 3292, 3294, 3495, 3296, 3305, 3308, 4685, 853, 853, 853, 853, 3314, 2046, 3322, 3323, 3325, 3326, 3330, 3333, 3337, 3338, 3335, 3341, 3342, 3361, 3360, 2047, 3317, 3324, 2048, 3363, 3364, 3365, 3367, 3588, 3372, 2291, 3388, 4618, 4644, 3370, 3375, 3373, 1859, 3586, 4491, 3374, 3376, 3400, 3380, 3389, 3403, 3407, 3409, 3402, 4237, 1906, 1903, 3412, 4633, 2388, 3417, 3413, 3588, 3496, 3414, 3415, 3416, 3425, 1868, 2704, 5046, 3428, 3427, 3429, 4651, 4652, 3436, 4654, 1182, 3444, 3439, 3603, 3446, 3453, 1223, 3450, 3454, 3490, 3475, 5080, 3451, 3491, 3492, 3493, -2130, 3458, 3472, 3524, 3473, 3541, 3599, 3474, 3479, 3480, 3482, 3497, 3498, 3499, 4513, 3500, 3501, 3502, 3503, 3504, 3505, 3485, 2049, 2113, 3558, 3486, 3536, 3508, 2031, 4660, 3514, 2032, 5070, 3521, 5072, 3535, 3590, 3549, 3559, 3561, 3563, 4702, 3562, 3613, 3565, 3600, 3605, 4282, -1717, 1223, 3611, 3610, 3490, 3631, 3615, 4322, 3491, 3492, 3493, 3624, 2038, 3617, 3637, 3642, 3644, 3645, 3653, -2635, 3649, 3656, 3658, 1223, 3650, 3588, 3490, 3680, 5174, 3665, 3491, 3492, 3493, 3681, 3691, 3693, 3697, 3699, 3698, 853, 3700, 3703, 3715, 3716, 2040, 2023, 3718, 3724, 3725, 3726, 3734, 3744, 815, 3761, 853, 3763, 1320, 3765, 2433, 3768, 1961, 4107, 3769, 815, 4112, 3772, 3774, 3776, 3792, 4367, 3777, 3790, 3791, 2050, 3793, 3794, 2051, 2052, 2053, 2291, 2054, 2055, 2056, 2057, 2058, 2059, 180, 3795, 1223, 3796, 3805, 3490, 3798, 3481, 815, 3491, 3492, 3493, 3589, 3797, 3799, 4749, 3800, 3801, 3802, 3804, 3809, 2420, 3195, 3803, 3811, 3550, 3806, 3813, 3497, 3498, 3499, 4415, 3500, 3501, 3502, 3503, 3504, 3505, 3822, 3826, 3829, 815, 3833, 3834, 4935, 2459, 3815, 3823, 4425, 3836, 5223, 3816, 1320, 1320, 3824, 3818, 3844, 3495, 898, 3842, 3894, 1964, 3891, 3895, 3897, 3899, 3902, 3884, -2635, 3913, 3586, 3885, 4890, -2635, 3914, 3916, 3588, 5002, 3923, 4839, 3102, 3932, 3102, 5229, 5231, 3933, 3937, 3926, 3952, 815, 3936, 3961, 3970, 3939, 3968, 3981, 3969, 3993, 3972, 3974, 3995, 3982, 3983, 1851, 3984, 3985, 3986, 3996, 3997, 4006, -2635, 3988, 4007, 4008, 4018, 4010, 3495, 4011, 4012, 3496, 4013, 4014, 3511, 1869, 1320, 3490, -2129, 3510, 4069, 4863, 1985, 4080, 4093, 1880, 2768, 1320, 4110, 1883, 3495, -2556, 4027, 1886, 4858, 1888, 2518, 4153, 4052, 4138, 4053, 1896, 3588, 4054, 2535, 4709, 4151, 1904, 3588, 2047, 1907, 4148, 4099, 4061, 4084, 4081, 2433, 1320, 4111, 4134, 1320, 4157, 4175, 4140, 4119, 4167, 4211, 4196, 1320, 1320, 3496, 4142, 4144, 4204, 4212, 1320, 1320, 4198, 4213, 4214, 1320, 4199, 4216, 4218, 4220, 1320, 4221, 4235, 1320, 1320, 4745, 4238, 3496, 1320, 4521, -2635, 4250, 4251, 4252, 1320, 815, 815, 815, 815, 4253, 4263, 4265, 4118, 4132, 4118, 4264, 1320, 4118, 4266, 4267, 4535, 5325, 4277, 4280, 3589, 4268, 4279, -2556, 3589, 4290, 4291, 4299, 4316, 4296, 4550, 4314, 2615, 4318, 4226, 4330, 4321, 4332, 4329, 4333, 4336, -2635, 4348, 4373, 4379, 900, 4359, 4387, 5082, 4393, 3588, 4394, 1320, 4576, 2656, 4397, 3623, 4400, 3496, 2433, 4406, 2925, 4563, 4565, 4399, 4422, 4416, 4433, 4423, 4438, 4439, 4442, 4441, -2556, 4443, 4446, 746, 4459, 3586, 1320, 4444, 4451, 3586, 4463, 4465, -2556, 4471, 4447, 5223, 4494, -2556, 4483, 4478, 4488, 4487, -2556, 4497, 3579, 5236, 3102, 3102, -2556, 4503, 4498, -2556, 3497, 3498, 3499, -2556, 3500, 3501, 3502, 3503, 3504, 3505, -2131, 4531, 2291, 4499, 4539, 4518, 4538, 4534, 4536, 4546, 180, 4547, 4551, 4552, 4553, 4554, 4617, 4559, 5069, 4561, 5012, 1964, -2556, 4570, 4573, -2635, 4575, 4577, 4582, 4583, 1052, 5012, 2054, 2055, 2056, 2057, 2058, 2059, 4588, 4592, 4611, 4612, -2556, 4609, 4615, 4622, 4621, 4623, 4641, 3497, 3498, 3499, 4616, 3500, 3501, 3502, 3503, 3504, 3505, 4643, 3808, 4646, 4647, 4655, 4664, 1320, 4673, 4676, 4677, 4663, 4682, 3497, 3498, 3499, 4634, 3500, 3501, 3502, 3503, 3504, 3505, 4637, 4669, -2556, 4683, 2031, -2556, 853, 2032, 4686, 4691, 4692, -2556, 4698, 4699, 4701, 4697, 2768, 4705, 4707, 4715, 4718, 853, 4730, 4723, 4728, 4734, 4739, 4741, 4735, 5074, 4737, 4742, 1964, 4750, 4743, 4755, 2038, 1964, 1964, 4761, 2768, 4762, 4768, -2635, 4769, 4771, 4777, 4778, 4827, 4779, 4786, 4780, 4792, 1320, 4802, 3497, 3498, 3499, 5198, 3500, 3501, 3502, 3503, 3504, 3505, 4795, 4806, -2556, 2040, 595, 4821, 4824, 4830, 4833, 4844, 2291, 4846, 4890, 4848, 4854, 4849, 4855, 4866, 4860, 1939, 4867, 4885, 4871, 4876, 4877, 4878, 4905, 4358, 898, 4916, 4914, 4917, 4923, 4920, 1320, 4922, 4941, 4942, 4949, 4951, 4954, 4959, 4982, 4961, 4984, 4985, 4986, 853, 5001, 3332, 5005, 3579, 5011, 5030, 4721, 3579, 5026, 751, 5015, 5018, 5022, 5024, 5041, 2927, 4998, 5051, 5052, 3603, 5049, 5058, 5195, 5064, 5096, 1052, 5098, 4864, 5104, 5108, 898, 5111, 5109, 2943, 5118, 815, -2556, 180, 180, 2947, 5152, 5130, 5129, 2950, 4862, 5123, 5179, 5138, 5142, 5144, 5145, 5143, 5146, 5153, 5154, 2025, 5155, 5156, 5170, 5183, -2556, 5295, -2556, -2556, 5162, -2635, 5186, 5187, 5192, 2974, -2635, 5191, 5205, 5209, 5234, 1320, 5228, 5240, 5235, 5242, 5252, 5245, 5249, 5253, 5273, 5274, 5275, 4904, 5276, 5281, 5282, 5291, 5293, 5312, 5310, 4094, 5318, 5320, -2556, 5238, 5326, -2556, -2556, -2556, 1320, 1320, 5239, -2635, 1320, 5328, 5336, 5337, 5374, 5335, 5355, 3029, 5369, 5381, 5388, 5065, 5066, 5394, 5402, 595, 5428, 5442, 4118, 5436, 5399, 5460, 3589, 5461, 5408, 5465, 1009, 3589, 5463, 5438, 3589, 595, 5426, 3195, 2768, 4808, 5464, 1320, 1320, 5427, 5478, 5479, 5489, 1475, 5486, 5487, 2047, 5491, 5492, 1369, 3597, 3299, 4183, 3169, 1320, 2435, 3093, 5069, 3709, 3079, 4241, 4234, 5321, 3207, 3254, 4183, 900, 853, 853, 853, 4902, 3841, 5222, 3586, 5400, 2100, 4375, 4960, 4681, 4934, 3586, 3647, 3411, 5313, 3107, 3586, 4837, 5396, 3586, 5243, 2031, 3117, 5241, 2032, 5334, 5413, 3652, 3122, 4426, 4405, 5203, 4368, 3273, 3274, 1009, 4239, 3728, 3901, 3137, 597, 3586, 4392, 4703, 3141, 4940, 865, 900, 3264, 1565, 4945, 3909, 5401, 2038, 3586, 5493, 5483, 1545, 5299, 4918, -2635, 4434, 3847, 5339, 3154, 4865, 5060, 5163, -2635, 3156, 2507, 5211, 4868, 3159, 4825, 753, 1546, 4460, 5036, 5454, 2577, 2936, 4435, 1958, 5180, 2040, 3176, 2574, 5182, 865, 5184, 3638, 815, 1052, 2585, 5151, 2697, 2622, 1129, 3201, 2699, 3812, 2698, 2030, 4367, 4269, 1053, 815, 2031, 1009, 4289, 2032, 815, 180, 3102, 2033, 2034, 2035, 5449, 3905, 5360, 2291, 5477, 2647, 4939, 4977, 1547, 4226, 1348, 2873, 4826, 2768, 2036, 2882, 2220, 2037, 2197, 1370, 815, 4566, 2038, 5307, 4415, 4161, 2073, 3601, 2114, 2039, 3612, 2911, 4141, 2892, 4085, 5303, 5185, 4557, 853, 815, 4183, 2910, 4114, 4529, 4975, 4544, 5017, 4108, 5169, -2635, 5168, 4162, 5380, 2146, 2040, 2145, 2054, 2055, 2056, 2057, 2058, 2059, 2150, 5449, 2155, 1320, 829, 4109, 1320, 5480, 1320, 4227, 5294, 5437, 4063, 4997, 4823, -2635, 2596, 5306, 2617, 5449, -2635, 5305, 2849, 3556, 3467, 3230, 2624, 1320, 3554, 2858, 0, 0, 1548, 1320, 0, 1449, 3586, 3589, 0, 0, 0, 4808, 0, 0, 597, 0, 2636, 1320, 0, 0, 0, 0, 0, 597, 873, 0, 5029, -2635, 0, 0, 0, 597, 0, 873, 597, 3579, 0, 0, 0, 1450, 3579, 5379, 0, 3579, 0, 0, 0, 873, 0, 815, 1549, 1939, 898, 1550, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2387, 3586, 4228, 0, 0, 0, 0, 0, 2041, 0, 2047, 0, 1320, 2042, 0, 0, 0, 1320, 1320, 0, 0, 0, 853, 853, 853, 853, 0, 0, 0, 0, 0, 0, 1552, 0, 1452, 2043, 2044, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2045, 0, 0, 1320, 0, 0, 0, 0, 0, 0, 595, 0, 0, 0, 0, 0, 2768, 2768, 0, 1453, 0, 0, 0, 0, 0, 0, 0, 1554, 3424, 0, 0, 0, 815, 2046, 0, 3589, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3438, 2047, 0, 1555, 2048, -2635, 0, 5132, 3424, 1454, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1557, 0, 4229, 0, 0, 4230, 0, 0, 0, 0, 0, 0, 0, 0, 0, 180, 0, 0, 0, 0, 1455, 0, 0, 1320, 3586, 0, 595, 0, 0, 1320, 0, 0, 0, 5177, 0, 0, 0, 2871, 0, 0, 1320, 0, 0, 0, 1320, 0, 1320, 0, 1320, 5317, 0, 0, 1457, 180, 0, 4183, 0, 0, 1420, 0, 5188, 853, 0, 900, 0, 0, 0, 0, 0, 2049, 0, 0, 5441, 0, 1320, 0, 0, 0, 0, 0, 0, -2635, 0, 0, 3586, 0, 0, 0, 2054, 2055, 2056, 2057, 2058, 2059, 36, 0, 2275, 0, 1459, 0, 0, 0, 0, 0, 0, 0, 2318, 1460, 0, 1939, 1939, 0, 0, 3586, 0, 1461, 3579, 0, 0, 0, 0, 0, 0, 2276, 5366, 5367, 2023, 0, 0, 0, 0, 0, 0, 0, 0, 1463, 0, 0, 0, 0, 853, 0, 0, 0, 1464, 0, 0, 5257, 1465, 0, 0, 1320, 0, 0, 0, 0, 0, 0, 0, 0, 5269, 0, 0, 0, 0, 0, 0, 0, 2050, 0, 0, 2051, 2052, 2053, 0, 2054, 2055, 2056, 2057, 2058, 2059, 0, 0, 0, 0, 0, 1320, 1320, 1320, 0, 0, 2031, 3195, 0, 2032, 1320, 0, 0, -2635, -2635, -2635, 1466, 0, 0, 0, 1320, 0, 594, 5029, 0, 0, 0, 0, 2925, 0, 0, 0, 0, 3586, 0, 0, 0, 0, 2038, 0, 0, 0, 0, 865, 0, 2039, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1478, 0, 853, 0, 0, 0, 1479, 0, 0, 1939, 0, 0, 0, 0, 2040, 0, 0, 3579, 0, 1580, 0, 0, 0, 0, 3659, 0, 873, 180, 0, 0, 0, 0, 873, 0, 0, 2291, 0, 0, 0, 0, 595, 0, 5340, 0, 0, 873, 1320, 0, 1481, 0, 0, 0, 0, 0, 0, 0, 4183, 0, 0, 0, 0, 873, 865, 865, 1320, 0, 597, 0, 0, 5365, 0, 1100, 0, 184, 1320, 597, 873, 0, 5177, 5362, 0, 0, 597, 5363, 873, 597, 0, 5364, 0, 0, 0, 0, 0, 5494, 5495, 0, 5425, 1100, 873, 853, 1581, 0, 1483, 180, 0, 0, 0, 0, 873, 1484, 0, 0, 1485, 0, 3586, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2041, 0, 0, 0, 0, 2042, 5269, 853, 853, 0, 0, 3739, 4183, 1486, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5365, 0, 0, 851, 184, 0, 0, 0, 0, 0, 5362, 0, 864, 0, 5363, 0, 1320, 1320, 5364, 2045, 864, 0, 0, 864, 1487, 0, 0, 0, 1320, 0, 0, 0, 0, 1320, 0, 0, 0, 0, 0, 0, 0, 3586, 0, 597, 597, 0, 0, 3586, 0, 873, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1320, 0, 0, 0, 2047, 0, 0, 0, 0, 0, 1320, 873, 0, 597, 0, 0, 0, 0, 0, 0, 0, 1488, 0, 1489, 873, 853, 0, 0, 4183, 0, 0, 0, 0, 1490, 0, 0, 0, 5177, 0, 5365, 0, 595, 1491, 184, 0, 0, 0, 3820, 0, 5362, 0, 0, 0, 5363, 1492, 0, 0, 5364, 0, 0, 0, 0, 0, 865, 865, 0, 0, 3366, 0, 0, 0, 0, 0, 0, 3371, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3586, 0, 0, 0, 0, 0, 0, 1582, 3390, 2049, 1494, 1495, 0, 0, 0, 0, 0, 0, 3396, 0, 0, 3397, 0, 3398, 3399, 0, 0, 3401, 0, 0, 0, 180, 0, 3405, 0, 3406, 0, 0, 3408, 0, 1583, 0, 0, 0, 597, 597, 1712, 0, 0, 0, 0, 0, 0, 597, 0, 0, 0, 0, 180, 0, 1100, 0, 0, 0, 597, 0, 0, 0, 0, 0, 597, 0, 0, 597, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1100, 0, 0, 0, 0, 2031, 0, 0, 2032, 0, 0, 0, 2033, 2034, 2035, 1100, 3447, 0, 0, 0, 0, 0, 1497, 2050, 0, 0, -2635, -2635, -2635, 2036, 2054, 2055, 2056, 2057, 2058, 2059, 0, 2038, 0, 0, 0, 0, 0, 0, 2039, 0, 0, 0, 0, 0, 0, 5424, 0, 0, 0, 0, 0, 0, -128, 0, 597, 597, 597, 0, 2433, 0, 0, 0, 0, 2040, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 3989, 0, 0, 0, 2, 0, 3, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2031, 1100, 0, 2032, 0, 5, 0, 0, 4005, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 8, 9, 0, 0, 2038, 0, 0, 10, 0, 11, 873, -2635, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 13, 0, 0, 180, 0, 0, 873, 0, 0, 0, 0, 0, 0, 0, 2040, 0, 597, 14, 0, 0, 15, 0, 0, 0, 873, 0, 0, 0, 0, 0, 2041, 0, 0, 0, 16, 2042, 17, 0, 0, 0, 18, 0, 0, 0, 0, 0, 19, 0, 0, 0, 0, 0, 873, 0, 20, 0, 21, 2043, 2044, 0, 0, 0, 22, 0, 0, 0, 1100, 0, 873, 0, 0, 0, 2045, 0, 0, 0, 0, 0, 23, 0, 0, 4088, 0, 0, 873, 0, 0, 0, 873, 0, 0, 0, 0, 0, 0, 24, 0, 851, 0, 0, 597, 0, 0, 0, 0, 2046, 864, 0, 0, 0, 0, 0, 0, 864, 0, 0, 864, 0, 0, 2047, 0, 0, 2048, 0, -2635, 0, 0, 0, 0, -2635, 597, 0, 0, 0, 3657, 25, 26, 0, 0, 0, 0, 27, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 28, 0, 0, 0, 0, 597, 597, 597, 0, 597, 0, 0, 29, -2635, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 597, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4206, 0, 0, 0, 0, 0, 0, 0, 0, 30, 0, 0, 0, 0, 873, 0, 0, 31, 2049, 0, 0, 2047, 873, 873, 0, 0, 3717, 0, 3719, 0, 0, 32, 0, 0, 0, 0, 873, 33, 34, 0, 35, 0, 0, 0, 0, 36, 0, 0, 0, 0, 37, 0, 0, 38, 0, 0, 0, 0, 597, 0, 39, 0, 597, 597, 0, 0, 40, 41, 0, 0, 0, 0, 2031, 0, 42, 2032, 0, 597, 43, 0, 0, 0, 0, 1100, 0, 0, 0, 0, 44, 1712, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 45, 2038, 0, 0, 0, 0, 0, 0, -2635, -2635, 0, 0, 4304, 0, 2050, 4307, 0, 2051, 2052, 2053, 46, 2054, 2055, 2056, 2057, 2058, 2059, 0, 0, 0, 47, 0, 0, 2040, 3531, 0, 48, 3351, 0, 2031, 0, 49, 2032, 0, 0, 0, 0, 1100, 0, 0, 0, 0, 0, 0, 50, 0, 0, 0, 1449, 0, 0, 3807, 0, 1478, 0, 0, 0, 3814, 0, 1479, 0, 2038, 0, 2031, 0, 0, 2032, 51, -2635, 0, 2033, 2034, 2035, 0, 851, 0, 0, 0, 1100, 0, 0, 52, 1450, 0, -128, 864, 0, 2036, 0, 0, 4089, 864, 0, 2040, 864, 2038, 0, 0, -2635, 0, 0, 1481, 2039, 0, 4389, 2054, 2055, 2056, 2057, 2058, 2059, 1100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2433, 0, 0, 0, 2040, 0, 0, 0, 0, 0, -2635, 0, 0, 0, 0, -2635, 0, 0, 1452, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2332, 0, 0, 0, 1483, 0, 0, 0, 0, 4516, 0, 1484, 0, 0, 1485, 1809, 1810, 1811, 0, 873, 0, 0, 0, 0, -2635, 1453, 0, 0, 0, 0, 0, 0, 0, 0, 597, 597, 597, 0, 0, 1486, 0, 0, 2031, 0, 0, 2032, 0, 3424, 0, 2033, 2034, 2035, -2635, 0, 0, 0, 3352, -2635, 0, 0, 0, 1454, 0, 0, 0, 0, 2036, 0, 0, 0, 0, 2047, 0, 1487, 2038, 0, 0, 0, 0, 0, 0, 2039, 0, 0, 0, 0, 2041, 0, 0, 0, 0, 2042, 0, 0, -2635, 1455, 0, 3971, 0, 3973, 0, 3975, 0, 0, 0, 0, 2040, 0, 0, 0, 3979, 0, 0, 2043, 2044, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1457, 2045, 0, 0, 0, 1488, 1420, 1489, 0, 0, 1100, 0, 0, 0, 2047, 0, 0, 1490, 0, 0, 0, 0, 0, 0, 4004, 0, 1491, 1100, 0, 0, 0, 0, 0, 0, 2046, -2635, 0, 0, 1492, 0, 1712, 0, 36, 0, 0, 1100, 3353, 0, 2047, 0, 0, 2048, 0, 0, 0, 1460, 0, 0, 0, 0, 0, 0, 0, 1461, 873, 0, 0, 0, 0, 0, 0, 2276, 873, 0, 0, 0, 0, 2333, 0, 0, 1494, 1495, 0, 1463, 873, 0, 0, 0, 0, 2041, 0, 0, 1464, 0, 2042, 0, 1465, 0, 0, 0, 0, 1100, 0, 0, 0, -2635, 0, 0, 597, 0, 2334, 597, 0, 0, 1100, 3354, 2043, 2044, 0, 0, 597, 0, 0, 0, 0, 0, 1100, 0, 0, 0, 0, 2045, 0, 0, -2635, 0, 0, 0, 1100, 2049, 0, 2054, 2055, 2056, 2057, 2058, 2059, 0, 0, 1466, 0, 0, 0, 3355, 0, 597, 597, 0, 873, 873, 0, 0, 0, 0, 2046, 0, 0, 0, 0, 0, 597, 0, 873, 597, 0, 0, 0, 1497, 2047, 0, 4628, 2048, 1100, 1100, 0, 873, 873, 0, 0, 0, 0, 0, 4638, 0, 0, 0, 0, 0, 0, 0, 0, 873, 0, 0, -2635, 0, 0, 0, 0, 0, 0, 2054, 2055, 2056, 2057, 2058, 2059, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 597, 0, 0, 597, 597, 2050, 0, 0, 2051, 2052, 2053, 0, 2054, 2055, 2056, 2057, 2058, 2059, 0, 0, 0, 0, 2794, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 664, 0, 2049, 0, 597, 0, 597, 0, 0, 750, 0, 597, 597, 0, 0, 0, 0, 0, 597, 597, 597, 0, 0, 0, 597, 0, 597, 597, 597, 597, 597, 597, 0, 597, 0, 597, 597, 0, 0, 597, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1100, 597, 597, 597, 597, 1712, 0, 0, 0, 597, 0, 0, 0, 597, 0, 0, 597, 0, 0, 597, 597, 597, 597, 597, 597, 597, 597, 597, 0, 597, 0, 0, 0, 0, 0, 0, 597, 0, 597, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2050, 0, 0, 2051, 2052, 2053, 0, 2054, 2055, 2056, 2057, 2058, 2059, 0, 0, 2031, 0, 3843, 2032, 0, 0, 0, 2033, 2034, 2035, 0, 3424, 873, 0, 0, 0, 0, 0, 597, 0, 0, 0, 0, 0, 2036, 0, 0, 0, 0, 0, 0, 0, 2038, 597, 0, 0, 0, 0, 0, 2039, 0, 0, 597, 597, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2040, 2707, 0, 0, 873, 0, 0, 0, 0, 0, 2031, 1100, 0, 2032, 0, 1100, 1100, 2033, 2034, 2035, 0, 0, 873, 0, 0, 0, 0, 1712, 873, 0, 0, 0, 873, 0, 2036, 0, 0, 0, 0, 0, 873, 0, 2038, 0, 0, 0, 0, 0, 0, 2039, 2708, 0, 0, 0, 0, 0, 0, 3424, 873, 3424, 0, 597, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 597, 2040, 0, 0, 1100, 0, 0, 597, 0, 2709, 597, 597, 0, 0, 0, 0, 0, 0, 1100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 873, 2710, 0, 0, 4450, 0, 2041, 0, 4452, 0, 0, 2042, 2711, 0, 0, 0, 0, 0, 0, 873, 873, 0, 0, 0, 0, 0, 0, 0, 1100, 0, 0, 0, 2712, 2043, 2044, 0, 0, 2713, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2045, 0, 0, 1712, 873, 0, 0, 1712, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 873, 0, 1712, 2041, 2046, 0, 0, 873, 2042, 0, 0, 2714, 0, 873, 0, 0, 0, 2231, 2047, 0, 873, 2048, 2232, 0, 873, 0, 0, 0, 0, 873, 2043, 2044, 2715, 0, 0, 0, 0, 0, 0, 0, 851, 0, 0, 851, 0, 2045, 0, 0, 0, 873, 0, 0, 0, 0, 873, 0, 0, 2233, 873, 0, 0, 1712, 0, 0, 0, 0, 0, 0, 0, 0, 2234, 873, 0, 0, 0, 0, 0, 0, 2046, 0, 0, 0, 0, 0, 873, 2235, 0, 864, 864, 0, 0, 0, 2047, 0, 873, 2048, 0, 0, 0, 0, 206, 2716, 864, 0, 2717, 864, 0, 0, 0, 2049, 0, 597, 597, 597, 0, 0, 0, 597, 0, 0, 0, 0, 0, 0, 0, 0, 2236, 0, 0, 0, 2718, 0, 0, 2719, 0, 0, 0, 2237, 0, 2720, 0, 0, 0, 0, 0, 4595, 2721, 0, 0, 597, 1100, 0, 0, 0, 0, 0, 0, 2238, 0, 1712, 0, 0, 2239, 0, 0, 864, 0, 0, 864, 864, 0, 0, 0, 0, 0, 2722, 0, 0, 0, 0, 0, 2723, 0, 2049, 2724, 0, 0, 4619, 4620, 0, 0, 0, 0, 597, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2725, 0, 0, 0, 0, 2050, 0, 0, 2051, 2052, 2053, 0, 2054, 2055, 2056, 2057, 2058, 2059, 0, 0, 0, 0, 4020, 0, 0, 2726, 0, 0, 985, 1100, 0, 2240, 1100, 0, 0, 0, 0, 873, 0, 0, 0, 0, 0, 0, 0, 0, 597, 1478, 0, 0, 0, 0, 0, 1479, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2241, 0, 0, 0, 0, 4661, 4662, 0, 0, 0, 0, 0, 0, 0, 2050, 1051, 664, 2051, 2052, 2053, 0, 2054, 2055, 2056, 2057, 2058, 2059, 873, 0, 0, 1481, 4072, 0, 0, 206, 2242, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2243, 0, 873, 0, 0, 0, 2244, 0, 0, 0, 0, 0, 0, 2245, 0, 0, 2246, 1483, 1100, 0, 873, 0, 0, 0, 1484, 0, 0, 1485, 873, 0, 0, 0, 597, 0, 0, 1100, 0, 0, 597, 0, 0, 597, 0, 0, 597, 1194, 0, 0, 2247, 0, 1100, 0, 1486, 0, 0, 2248, 0, 0, 0, 0, 0, 597, 4757, 2249, 4758, 4759, 597, 0, 0, 2031, 2250, 1214, 2032, 0, 0, 0, 2033, 2034, 2035, 1323, 4763, 0, 1332, 1051, 1334, 0, 1487, 0, 0, 597, 597, 597, 0, 2036, 597, 2251, 0, 0, 0, 0, 0, 2038, 597, 597, 597, 597, 0, 0, 2039, 0, 1712, 0, 0, 0, 0, 597, 1712, 851, 597, 0, 597, 0, 0, 0, 864, 0, 0, 864, 864, 0, 0, 597, 597, 2040, 0, 597, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1488, 0, 1489, 0, 597, 0, 597, 0, 597, 0, 0, 0, 1490, 3424, 0, 0, 0, 0, 0, 0, 0, 1491, 0, 0, 0, 0, 0, 0, 597, 0, 0, 0, 0, 1492, 0, 0, 0, 0, 0, 597, 0, 0, 0, 0, 0, 0, 0, 873, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 597, 0, 2031, 0, 0, 2032, 0, 0, 0, 2033, 2034, 2035, 1494, 1495, 0, 597, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2036, 0, 0, 597, 0, 0, 0, 0, 2038, 2041, 0, 0, 0, 0, 2042, 2039, 1496, 0, 0, 0, 0, 0, 1100, 0, 0, 1100, 0, 1100, 0, 0, 0, 0, 1100, 0, 0, 0, 2043, 2044, 0, 0, 2040, 0, 0, 0, 0, 0, 1449, 873, 873, 0, 0, 2045, 0, 597, 0, 0, 0, 0, 2031, 0, 0, 2032, 0, 0, 0, 2033, 2034, 2035, 0, 0, 0, 0, 0, 0, 873, 0, 0, 873, 0, 0, 1450, 1100, 2036, 1497, 2046, 0, 0, 0, 0, 0, 2038, 0, 0, 0, 0, 0, 0, 2039, 2047, 737, 1100, 2048, 0, 0, 0, 737, 0, 0, 0, 0, 1451, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2040, 0, 0, 1100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1452, 0, 0, 0, 0, 0, 0, 4993, 0, 0, 0, 2041, 0, 0, 0, 0, 2042, 0, 0, 0, 0, 0, 0, 1712, 1712, 1712, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1453, 0, 0, 2043, 2044, 0, 0, 0, 0, 0, 0, 873, 0, 0, 1051, 2049, 0, 0, 2045, 0, 0, 1100, 0, 1100, 0, 0, 0, 0, 0, 0, 0, 873, 1051, 0, 0, 0, 1454, 0, 0, 0, 0, 0, 5038, 0, 0, 0, 0, 0, 0, 0, 873, 2046, 0, 0, 0, 0, 0, 0, 2041, 0, 0, 0, 0, 2042, 0, 2047, 1963, 0, 2048, 0, 1455, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2043, 2044, 0, 0, 0, 0, 0, 0, 0, 5075, 0, 1051, 0, 0, 0, 2045, 1456, 1457, 0, 0, 0, 0, 0, 1420, 0, 0, 0, 1100, 0, 2050, 0, 0, 2051, 2052, 2053, 0, 2054, 2055, 2056, 2057, 2058, 2059, 0, 0, 0, 0, 4177, 873, 2046, 0, 0, 0, 597, 0, 0, 1458, 0, 0, 597, 36, 0, 0, 2047, 1459, 0, 2048, 1100, 0, 0, 0, 0, 2049, 1460, 0, 0, 0, 0, 0, 0, 0, 1461, 0, 0, 0, 0, 0, 0, 2027, 1462, 0, 0, 0, 0, 0, 1712, 1100, 2029, 0, 0, 851, 1463, 873, 0, 873, 0, 864, 0, 0, 864, 1464, 2071, 864, 0, 1465, 0, 0, 873, 0, 873, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1051, 0, 0, 2088, 2089, 0, 0, 0, 1051, 1051, 0, 1712, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1051, 0, 2049, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1100, 0, 1466, 0, 0, 0, 2050, 0, 0, 2051, 2052, 2053, 0, 2054, 2055, 2056, 2057, 2058, 2059, 0, 873, 1100, 0, 4479, 0, 0, 0, 0, 852, 854, 0, 0, 858, 0, 0, 1100, 0, 2031, 0, 0, 2032, 0, 0, 0, 2033, 2034, 2035, 0, 0, 0, 0, 0, 914, 0, 0, 0, 0, 0, 0, 924, 0, 2036, 0, 0, 0, 0, 0, 0, 0, 2038, 0, 873, 0, 0, 0, 0, 2039, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 594, 2050, 873, 0, 2051, 2052, 2053, 0, 2054, 2055, 2056, 2057, 2058, 2059, 2040, 0, 0, 0, 4517, 0, 0, 0, 0, 0, 873, 0, 0, 873, 0, 0, 0, 0, 0, 0, 3351, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 597, 0, 0, 1100, 0, 1478, 594, 0, 1449, 597, 0, 1479, 0, 0, 0, 597, 0, 597, 0, 0, 597, 0, 0, 0, 1100, 597, 597, 597, 597, 0, 0, 597, 597, 597, 597, 597, 597, 597, 597, 597, 597, 0, 1450, 0, 597, 597, 0, 0, 0, 1100, 0, 0, 0, 1481, 597, 0, 0, 0, 597, 2392, 1712, 0, 597, 0, 0, 2397, 0, 0, 0, 0, 597, 0, 0, 597, 0, 597, 0, 2041, 0, 0, 0, 0, 2042, 1100, 597, 0, 0, 597, 597, 0, 0, 0, 597, 597, 0, 0, 0, 0, 0, 597, 0, 1452, 0, 0, 2043, 2044, 0, 1483, 0, 597, 0, 0, 597, 0, 1484, 0, 0, 1485, 0, 2045, 0, 0, 0, 0, 597, 0, 0, 0, 0, 0, 0, 0, 0, 5392, 0, 0, 1453, 0, 0, 0, 0, 0, 1486, 0, 0, 0, 0, 0, 0, 597, 0, 0, 2046, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 597, 2047, 3352, 0, 2048, 0, 1100, 1454, 0, 0, 0, 1487, 0, 2031, 0, 0, 2032, 0, 597, 0, 2033, 2034, 2035, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2036, 0, 0, 0, 1455, 0, 0, 0, 2038, 0, 0, 0, 873, 0, 0, 2039, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1488, 0, 1489, 1457, 0, 0, 737, 2040, 737, 1420, 737, 0, 1490, 0, 0, 0, 737, 1170, 1171, 0, 0, 1491, 2049, 0, 0, 0, 0, 0, 0, 0, 1712, 0, 0, 1492, 0, 1712, 1100, 1712, 0, 0, 2529, 0, 0, 0, 2534, 36, 0, 0, 0, 1459, 0, 0, 0, 0, 0, 0, 0, 0, 1460, 1712, 1100, 0, 0, 0, 0, 0, 1461, 0, 0, 0, 0, 0, 1609, 0, 2276, 1494, 1495, 0, 1712, 0, 0, 0, 0, 994, 0, 997, 1463, 0, 0, 1000, 0, 0, 0, 0, 873, 1464, 0, 873, 0, 1465, 0, 0, 0, 1025, 0, 1610, 0, 0, 0, 1478, 1030, 0, 0, 0, 0, 1479, 0, 2041, 3354, 0, 0, 2050, 2042, 0, 2051, 2052, 2053, 0, 2054, 2055, 2056, 2057, 2058, 2059, 2031, 0, 0, 2032, 4766, 0, 0, 2033, 2034, 2035, 2043, 2044, 0, 0, 0, 0, 0, 0, 1466, 0, 0, 0, 3355, 1481, 2036, 2045, 0, 597, 0, 0, 737, 0, 2038, 0, 0, 0, 0, 0, 1497, 2039, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 873, 873, 0, 0, 1100, 0, 2046, 0, 0, 0, 873, 0, 2040, 0, 0, 0, 0, 597, 0, 0, 2047, 0, 0, 2048, 0, 1483, 0, 0, 0, 873, 0, 0, 1484, 0, 0, 1485, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1100, 0, 0, 0, 1100, 597, 597, 0, 1486, 2031, 0, 0, 2032, 0, 0, 0, 2033, 2034, 2035, 2753, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2036, 0, 0, 0, 0, 0, 0, 0, 2038, 1487, 0, 0, 0, 0, 0, 2039, 0, 0, 0, 873, 0, 0, 0, 0, 0, 0, 2049, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2041, 0, 0, 2040, 0, 2042, 0, 597, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 597, 0, 0, 0, 0, 0, 0, 0, 0, 2043, 2044, 0, 0, 1488, 0, 1489, 0, 0, 0, 0, 0, 0, 2866, 0, 2045, 1490, 0, 1510, 1511, 0, 597, 0, 0, 597, 1491, 0, 0, 0, 0, 0, 0, 597, 597, 0, 1100, 0, 1492, 0, 597, 597, 0, 0, 0, 597, 1100, 0, 0, 2046, 597, 0, 0, 597, 597, 0, 0, 0, 597, 0, 0, 0, 2050, 2047, 597, 2051, 2052, 2053, 0, 2054, 2055, 2056, 2057, 2058, 2059, 0, 597, 2255, 0, 4776, 1494, 1495, 0, 0, 597, 0, 0, 2041, 597, 0, 0, 0, 2042, 0, 0, 0, 0, 0, 0, 0, 594, 0, 0, 594, 737, 0, 0, 0, 0, 0, 2256, 0, 0, 0, 2043, 2044, 597, 1743, 0, 0, 0, 0, 0, 0, 0, 0, 1051, 0, 0, 2045, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 597, 0, 0, 1765, 1766, 0, 0, 0, 0, 0, 0, 2049, 0, 2031, 0, 0, 2032, 0, 1100, 2046, 2033, 2034, 2035, 0, 0, 0, 0, 0, 0, 1807, 0, 594, 0, 2047, 1497, 873, 2048, 2036, 0, 0, 1712, 0, 0, 0, 0, 2038, 0, 0, 0, 0, 0, 0, 2039, 0, 1334, 0, 0, 1100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 873, 0, 0, 0, 2040, 1100, 0, 0, 0, 0, 0, 0, 873, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 597, 0, 1875, 1877, 0, 0, 0, 0, 0, 2050, 0, 873, 2051, 2052, 2053, 0, 2054, 2055, 2056, 2057, 2058, 2059, 0, 2049, 0, 0, 0, 0, 0, 0, 0, 0, 1334, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1100, 0, 0, 737, 0, 0, 0, 1334, 737, 737, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 737, 0, 0, 0, 0, 597, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 597, 2041, 0, 0, 0, 0, 2042, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 873, 0, 3204, 0, 0, 2043, 2044, 597, 0, 0, 0, 0, 0, 0, 2050, 0, 0, 2051, 2052, 2053, 2045, 2054, 2055, 2056, 2057, 2058, 2059, 0, 0, 0, 0, 4785, 0, 0, 0, 0, 3233, 0, 0, 3233, 0, 3233, 0, 0, 0, 3233, 0, 3233, 3233, 737, 0, 0, 1100, 2046, 1100, 0, 3233, 3233, 3233, 737, 0, 0, 0, 0, 0, 0, 0, 2047, 0, 0, 2048, 0, 0, 0, 0, 0, 0, 594, 873, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 597, 0, 0, 0, 1100, 0, 1170, 1171, 1478, 0, 0, 0, 0, 0, 1479, 3309, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1480, 0, 597, 597, 0, 0, 597, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3340, 597, 737, 0, 0, 737, 737, 0, 597, 1481, 0, 0, 1051, 597, 0, 2049, 597, 597, 0, 0, 0, 0, 0, 597, 597, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 597, 0, 597, 0, 0, 0, 0, 873, 0, 873, 0, 0, 0, 597, 0, 0, 0, 0, 0, 0, 0, 1482, 0, 0, 0, 1483, 0, 0, 0, 1051, 0, 0, 1484, 0, 0, 1485, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1100, 873, 0, 0, 0, 0, 0, 1486, 0, 0, 597, 0, 0, 2274, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2050, 0, 0, 2051, 2052, 2053, 0, 2054, 2055, 2056, 2057, 2058, 2059, 0, 0, 2313, 0, 4788, 1487, 0, 0, 0, 0, 0, 0, 1712, 0, 0, 0, 0, 597, 0, 0, 0, 0, 594, 0, 0, 0, 594, 0, 0, 2031, 0, 0, 2032, 0, 0, 0, 2033, 2034, 2035, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2036, 0, 0, 0, 0, 737, 0, 0, 2038, 0, 0, 1488, 0, 1489, 0, 2039, 0, 0, 0, 0, 4964, 0, 0, 1490, 0, 0, 0, 0, 0, 0, 0, 0, 1491, 597, 0, 1100, 0, 0, 0, 0, 2040, 0, 0, 0, 1492, 0, 0, 0, 0, 2415, 2416, 2417, 2418, 0, 0, 0, 0, 0, 597, 1100, 0, 597, 0, 597, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 597, 1493, 0, 0, 1494, 1495, 597, 0, 0, 0, 597, 0, 0, 0, 0, 0, 1100, 0, 0, 0, 597, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2591, 0, 0, 0, 1496, 0, 0, 1051, 0, 0, 2599, 0, 2600, 0, 0, 0, 0, 0, 2604, 0, 0, 0, 0, 0, 0, 2610, 0, 0, 0, 0, 0, 1712, 0, 0, 0, 0, 0, 0, 2041, 1100, 0, 0, 0, 2042, 1100, 1100, 0, 0, 0, 597, 2031, 0, 0, 2032, 597, 597, 873, 2033, 2034, 2035, 0, 0, 0, 0, 0, 2043, 2044, 0, 873, 0, 0, 1497, 0, 0, 0, 0, 0, 0, 2468, 2469, 2045, 0, 2038, 0, 0, 0, 0, 0, 0, 2039, 597, 0, 0, 0, 0, 0, 0, 597, 2492, 0, 0, 0, 4688, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2046, 2040, 0, 0, 0, 0, 0, 0, 0, 597, 0, 0, 0, 1051, 2047, 0, 0, 2048, 0, 0, 2537, 2538, 2539, 2540, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2742, 2743, 1100, 1100, 0, 0, 0, 2757, 2758, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 597, 0, 0, 597, 0, 0, 597, 0, 0, 0, 0, 0, 0, 2796, 0, 0, 0, 597, 0, 0, 0, 597, 0, 597, 0, 597, 0, 0, 0, 0, 0, 0, 597, 0, 0, 0, 0, 0, 3733, 2049, 0, 0, 603, 0, 0, 2041, 0, 0, 653, 603, 2042, 597, 0, 0, 705, 0, 603, 0, 0, 0, 0, 0, 603, 0, 0, 759, 0, 0, 0, 0, 0, 2638, 2043, 2044, 0, 0, 1712, 2642, 873, 0, 0, 0, 0, 0, 826, 826, 0, 2045, 0, 0, 594, 0, 3771, 0, 0, 0, 0, 594, 0, 0, 0, 0, 594, 0, 0, 594, 4804, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2046, 0, 2901, 2901, 0, 0, 0, 594, 597, 0, 0, 0, 0, 0, 2047, 0, 0, 597, 2050, 0, 594, 2051, 2052, 2053, 0, 2054, 2055, 2056, 2057, 2058, 2059, 0, 0, 0, 0, 4835, 0, 0, 3810, 0, 0, 0, 0, 597, 597, 597, 0, 0, 0, 0, 0, 0, 597, 1712, 0, 0, 1100, 0, 0, 0, 0, 0, 597, 0, 737, 0, 0, 0, 0, 0, 864, 873, 0, 0, 0, 0, 0, 0, 0, 0, 3233, 0, 0, 0, 0, 597, 0, 0, 2808, 0, 0, 0, 0, 0, 3840, 3840, 0, 0, 873, 0, 2031, 0, 0, 2032, 3856, 2049, 0, 2033, 2034, 2035, 1051, 860, 1051, 864, 0, 0, 0, 0, 0, 902, 0, 0, 904, 0, 2036, 909, 910, 0, 913, 0, 915, 0, 2038, 921, 0, 923, 0, 0, 597, 2039, 0, 0, 0, 0, 597, 0, 0, 0, 0, 0, 0, 0, 0, 0, 597, 0, 0, 1478, 3912, 3045, 597, 597, 597, 1479, 2040, 0, 0, 0, 0, 0, 0, 0, 597, 0, 0, 0, 1580, 0, 2031, 0, 0, 2032, 594, 0, 0, 2033, 2034, 2035, 0, 0, 0, 0, 3947, 1051, 0, 0, 0, 0, 0, 0, 0, 0, 2036, 873, 2050, 1481, 0, 2051, 2052, 2053, 2038, 2054, 2055, 2056, 2057, 2058, 2059, 2039, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 597, 0, 0, 0, 0, 0, 597, 0, 0, 0, 0, 0, 737, 594, 2040, 0, 0, 0, 0, 0, 737, 0, 0, 737, 0, 0, 0, 0, 0, 1581, 0, 1483, 0, 597, 597, 0, 0, 0, 1484, 0, 0, 1485, 0, 0, 0, 597, 2041, 0, 0, 0, 597, 2042, 0, 0, 2991, 2992, 0, 0, 0, 1712, 0, 0, 0, 0, 0, 3005, 1486, 3007, 0, 0, 0, 3011, 0, 2043, 2044, 0, 0, 2031, 0, 597, 2032, 0, 0, 0, 2033, 2034, 2035, 0, 2045, 597, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1487, 2036, 0, 0, 0, 0, 0, 597, 0, 2038, 0, 0, 0, 0, 0, 0, 2039, 0, 0, 0, 597, 2046, 1712, 0, 2041, 0, 0, 0, 0, 2042, 5110, 0, 0, 0, 0, 2047, 0, 0, 2048, 0, 1712, 2040, 597, 597, 0, 0, 0, 0, 4073, 0, 0, 2043, 2044, 0, 0, 594, 0, 0, 0, 1488, 0, 1489, 0, 0, 0, 0, 2045, 0, 0, 0, 0, 1490, 0, 0, 0, 0, 0, 0, 0, 0, 1491, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1492, 0, 0, 0, 0, 0, 0, 2046, 0, 3148, 0, 0, 3151, 0, 0, 0, 0, 0, 0, 0, 0, 2047, 0, 594, 2048, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2049, 0, 0, 0, 0, 3166, 0, 0, 1494, 1495, 0, 0, 0, 3377, 3379, 0, 0, 0, 594, 3387, 0, 0, 0, 0, 0, 2041, 0, 0, 0, 0, 2042, 0, 0, 1478, 0, 0, 0, 0, 3167, 1479, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2043, 2044, 0, 0, 0, 3236, 0, 0, 0, 0, 0, 0, 0, 3243, 0, 2045, 3246, 0, 0, 0, 0, 0, 3248, 0, 0, 0, 2049, 0, 737, 1481, 0, 1003, 0, 3260, 0, 0, 0, 0, 1016, 1017, 0, 0, 1023, 0, 1026, 1027, 0, 2050, 2046, 1029, 2051, 2052, 2053, 1497, 2054, 2055, 2056, 2057, 2058, 2059, 1048, 0, 2047, 0, 4870, 2048, 0, 0, 0, 0, 0, 594, 3856, 0, 3306, 0, 0, 0, 0, 0, 0, 0, 0, 1483, 0, 0, 0, 0, 0, 0, 1484, 0, 0, 1485, 0, 0, 4275, 0, 0, 1125, 0, 1127, 3329, 0, 4283, 0, 0, 4284, 0, 4285, 0, 1143, 0, 0, 0, 0, 0, 0, 1486, 0, 0, 0, 0, 0, 0, 2050, 0, 0, 2051, 2052, 2053, 0, 2054, 2055, 2056, 2057, 2058, 2059, 0, 864, 0, 0, 4910, 603, 0, 0, 0, 0, 0, 0, 0, 4324, 1487, 2049, 0, 0, 0, 0, 0, 0, 3392, 0, 3394, 0, 3233, 0, 0, 0, 3233, 3233, 0, 3233, 0, 0, 0, 0, 0, 2031, 0, 0, 2032, 0, 0, 0, 2033, 2034, 2035, 0, 0, 0, 0, 0, 5343, 0, 0, 0, 0, 0, 0, 0, 0, 2036, 0, 0, 0, 0, 0, 0, 594, 2038, 0, 1488, 0, 1489, 864, 864, 2039, 0, 0, 0, 0, 0, 0, 1490, 3595, 0, 737, 0, 0, 0, 0, 826, 1491, 0, 0, 0, 0, 0, 0, 0, 0, 2040, 0, 0, 1492, 0, 0, 0, 0, 3608, 3608, 0, 2050, 0, 0, 2051, 2052, 2053, 0, 2054, 2055, 2056, 2057, 2058, 2059, 0, 0, 1440, 0, 5214, 3459, 4429, 0, 0, 3856, 0, 0, 0, 0, 0, 0, 0, 594, 3038, 0, 0, 1494, 1495, 594, 0, 2031, 0, 0, 2032, 0, 0, 0, 2033, 2034, 2035, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2036, 0, 1496, 0, 0, 0, 0, 0, 2038, 0, 0, 0, 0, 0, 0, 2039, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1612, 0, 4468, 4468, 4468, 0, 4468, 4468, 4468, 4468, 4468, 0, 2041, 0, 0, 2040, 0, 2042, 0, 0, 0, 1723, 0, 0, 0, 1478, 0, 0, 0, 0, 0, 1479, 0, 1734, 0, 0, 0, 0, 1737, 2043, 2044, 0, 0, 0, 1497, 0, 0, 0, 1740, 0, 594, 0, 0, 1744, 2045, 0, 0, 0, 0, 0, 0, 0, 1747, 5482, 0, 0, 0, 1754, 0, 0, 1758, 0, 0, 1481, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 864, 864, 2046, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2047, 0, 0, 2048, 0, 0, 0, 2031, 0, 0, 2032, 1812, 0, 0, 2033, 2034, 2035, 0, 0, 0, 0, 0, 0, 0, 2041, 0, 1483, 0, 0, 2042, 0, 2036, 0, 1484, 0, 4556, 1485, 4558, 0, 2038, 0, 0, 0, 0, 0, 0, 2039, 0, 0, 0, 0, 2043, 2044, 0, 0, 0, 0, 0, 0, 0, 0, 1486, 0, 0, 0, 0, 2045, 0, 0, 0, 0, 2040, 0, 2031, 0, 0, 2032, 0, 0, 0, 2033, 2034, 2035, 0, 0, 0, 0, 0, 0, 0, 0, 2049, 0, 0, 0, 1487, 0, 2036, 3666, 2046, 3667, 3668, 3669, 0, 0, 2038, 0, 0, 0, 0, 0, 0, 2039, 2047, 0, 0, 2048, 0, 0, 0, 0, 0, 0, 0, 0, 0, 603, 0, 603, 0, 603, 0, 603, 0, 603, 603, 603, 2040, 0, 0, 0, 603, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1959, 0, 1488, 0, 1489, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1490, 0, 0, 0, 0, 0, 1972, 0, 0, 1491, 0, 0, 0, 0, 0, 2041, 737, 0, 0, 0, 2042, 1492, 0, 0, 2050, 0, 0, 2051, 2052, 2053, 0, 2054, 2055, 2056, 2057, 2058, 2059, 0, 2049, 0, 3890, 5237, 2043, 2044, 0, 0, 0, 0, 4658, 4659, 0, 0, 0, 0, 0, 0, 0, 2045, 0, 3233, 3210, 3233, 3233, 1494, 1495, 3233, 0, 2031, 0, 0, 2032, 0, 0, 0, 2033, 2034, 2035, 0, 0, 0, 0, 2041, 0, 0, 0, 0, 2042, 0, 0, 0, 2046, 2036, 0, 3211, 0, 0, 0, 0, 0, 2038, 0, 0, 0, 0, 2047, 0, 2039, 2048, 2043, 2044, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2045, 0, 3965, 0, 0, 0, 4717, 0, 2040, 0, 0, 0, 0, 0, 2050, 0, 0, 2051, 2052, 2053, 0, 2054, 2055, 2056, 2057, 2058, 2059, 0, 0, 0, 0, 5342, 0, 2046, 0, 0, 0, 1497, 0, 0, 0, 0, 0, 826, 4744, 0, 0, 2047, 3828, 0, 2048, 0, 0, 0, 0, 0, 2031, 0, 0, 2032, 1478, 0, 0, 2033, 2034, 2035, 1479, 0, 0, 0, 0, 0, 2049, 0, 0, 0, 0, 4468, 0, 0, 2036, 0, 0, 737, 0, 0, 0, 0, 2038, 0, 0, 0, 0, 0, 0, 2039, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1481, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2041, 0, 2040, 0, 0, 2042, 0, 2253, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2049, 0, 0, 0, 0, 0, 0, 2043, 2044, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2045, 0, 1483, 0, 0, 0, 0, 0, 0, 1484, 0, 2050, 1485, 0, 2051, 2052, 2053, 0, 2054, 2055, 2056, 2057, 2058, 2059, 0, 0, 0, 0, 5412, 0, 0, 0, 0, 2046, 0, 0, 2344, 1486, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2047, 0, 0, 2048, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3980, 0, 0, 0, 0, 0, 0, 3856, 0, 0, 2041, 1487, 0, 0, 0, 2042, 0, 2050, 0, 0, 2051, 2052, 2053, 0, 2054, 2055, 2056, 2057, 2058, 2059, 0, 0, 2031, 0, 5467, 2032, 0, 2043, 2044, 2033, 2034, 2035, 0, 0, 0, 0, 0, 0, 0, 0, 3233, 0, 2045, 0, 0, 0, 0, 0, 0, 4903, 0, 0, 0, 0, 2038, 0, 2031, 0, 0, 2032, 1488, 2039, 1489, 2033, 2034, 2035, 0, 0, 2049, 0, 0, 0, 1490, 0, 0, 2046, 0, 0, 0, 0, 2036, 1491, 0, 0, 2884, 0, 2040, 0, 2038, 2047, 0, 0, 2048, 1492, 0, 2039, 0, 0, 0, 2031, 0, 0, 2032, 0, 0, 0, 2033, 2034, 2035, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2031, 2040, 0, 2032, 2036, 0, 0, 2033, 2034, 2035, 0, 0, 2038, 3685, 0, 0, 1494, 1495, 737, 2039, 0, 0, 0, 0, 2036, 0, 0, 0, 0, 0, 0, 0, 2038, 0, 0, 0, 0, 0, 0, 2039, 0, 0, 737, 0, 2040, 0, 3686, 0, 2050, 737, 2885, 2051, 2052, 2053, 0, 2054, 2055, 2056, 2057, 2058, 2059, 2049, 0, 0, 2040, 5481, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2041, 0, 0, 0, 0, 2042, 0, 0, 0, 0, 0, 0, 0, 0, 2502, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -2635, -2635, 0, 0, 0, 0, 0, 2041, 0, 1497, 0, 0, 2042, 0, 0, 2045, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1170, 1171, 0, 4200, 4201, 4202, 4203, 2043, 2044, 0, 0, 0, 0, 0, 0, 1449, 1051, 0, 0, 3510, 5084, -2635, 2045, 2041, 3511, 0, 0, 0, 2042, 2050, 0, 0, 2051, 2052, 2053, 2047, 2054, 2055, 2056, 2057, 2058, 2059, 0, 2041, 2456, 0, 0, 0, 2042, 1450, 2043, 2044, 0, 0, 0, 2046, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2045, 0, 0, 0, 2047, 2043, 2044, 2048, 0, 0, 0, 0, 0, 0, 1519, 0, 0, 0, 0, 0, 2045, 2628, 0, 2629, 737, 0, 0, 0, 0, 0, 0, 0, 0, 2046, 0, 0, 0, 0, 0, 0, 2640, 0, 2641, 1452, 0, 0, 0, 2047, 0, 0, 2048, 0, 0, 2046, 0, 0, 603, 0, 603, 0, 603, 2049, 603, 0, 603, 0, 0, 2047, 603, 0, 2048, 0, 0, 737, 0, 4064, 0, 0, 1453, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2049, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4346, 1454, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4349, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2049, 0, 1051, 0, 0, 0, 5226, 0, 5227, 0, 1455, 0, 5232, 5233, 0, 0, 2886, 4065, 0, 0, 2049, 0, 2050, 0, 0, 2051, 2052, 2053, 0, 2054, 2055, 2056, 2057, 2058, 2059, 0, 0, 0, 0, 0, 0, 1520, 1457, 0, 0, 0, 0, 0, 1420, 0, 0, 0, 0, 0, 0, 0, 2050, 0, 0, 2051, 2052, 2053, 0, 2054, 2055, 2056, 2057, 2058, 2059, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1521, 0, 0, 0, 36, 0, 0, 0, 1459, 0, 0, 0, 0, 0, 0, 0, 0, 1460, 0, 2050, 0, 0, 2051, 2052, 2053, 1461, 2054, 2055, 2056, 2057, 2058, 2059, 0, 1522, 0, 0, 0, 0, 0, 2050, 0, 0, 2051, 2052, 2053, 1463, 2054, 2055, 2056, 2057, 2058, 2059, 0, 0, 1464, 0, 0, 0, 1465, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2928, 2929, 0, 0, 0, 0, 0, 737, 0, 0, 0, 0, 737, 0, 0, 0, 737, 0, 0, 2944, 2945, 0, 0, 0, 2948, 2949, 0, 0, 0, 2952, 0, 1466, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4631, 4632, 2963, 0, 0, 4635, 4636, 0, 0, 2972, 0, 0, 0, 2975, 2976, 0, 0, 2979, 2980, 0, 0, 0, 0, 0, 2985, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3004, 0, 3006, 0, 0, 0, 0, 1051, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3030, 0, 0, 0, 0, 3032, 0, 0, 0, 0, 0, 0, 0, 0, 866, 875, 0, 0, 0, 3037, 0, 0, 866, 0, 875, 866, 0, 0, 3044, 0, 0, 3048, 0, 0, 3051, 3054, 3056, 0, 875, 0, 0, 3064, 3067, 0, 0, 0, 0, 0, 0, 0, 0, 3080, 0, 0, 2031, 0, 3089, 2032, 0, 0, 3092, 2033, 2034, 2035, 0, 0, 0, 0, 0, 0, 5448, 0, 2031, 0, 0, 2032, 3108, 0, 2036, 2033, 2034, 2035, 0, 3118, 3119, 0, 2038, 0, 0, 3123, 0, 0, 0, 2039, 0, 0, 2036, 0, 0, 3469, 3138, 3139, 0, 0, 2038, 3142, 0, 0, 0, 0, 0, 2039, 0, 0, 0, 0, 0, 3149, 2040, 0, 3152, 0, 0, 0, 0, 3155, 0, 0, 0, 0, 3157, 3158, 0, 5448, 0, 3161, 2040, 0, 3165, 0, 0, 0, 3172, 3173, 3174, 3175, 0, 3177, 0, 0, 0, 5448, 0, 0, 0, 0, 0, 0, 0, 0, 3202, 3203, 0, 3205, 0, 0, 0, 0, 0, 0, 4653, 0, 0, 3213, 3214, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4657, 0, 0, 0, 0, 0, 0, 0, 2031, 0, 0, 2032, 0, 0, 0, 2033, 2034, 2035, 5372, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2036, 0, 0, 0, 0, 0, 0, 0, 2038, 0, 0, 2041, 0, 0, 0, 2039, 2042, 0, 3267, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2041, 0, 0, 0, 0, 2042, 0, 0, 0, 2043, 2044, 2040, 0, 0, 0, 0, 0, 3304, 0, 0, 0, 0, 0, 0, 2045, 0, 0, 2043, 2044, 0, 4722, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2045, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2046, 0, 0, 0, 737, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2047, 0, 0, 2048, 2046, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2047, 0, 0, 2048, 0, 0, 0, 0, 5373, 0, 0, 0, 0, 0, 0, 0, 0, 2031, 0, 0, 2032, 0, 0, 0, 2033, 2034, 2035, 0, 0, 0, 0, 0, 2041, 0, 0, 0, 0, 2042, 0, 0, 0, 2036, 0, 0, 3515, 0, 0, 0, 0, 2038, 0, 0, 0, 0, 0, 0, 2039, 0, 0, 2043, 2044, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2049, 2045, 0, 0, 0, 0, 0, 0, 2040, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2049, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1478, 0, 0, 0, 875, 2046, 1479, 0, 0, 0, 875, 0, 0, 0, 0, 4840, 4841, 4841, 0, 2047, 0, 0, 2048, 875, 0, 0, 0, 3460, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 875, 0, 3483, 0, 0, 0, 0, 0, 0, 1481, 0, 0, 0, 0, 866, 875, 0, 0, 0, 0, 0, 866, 0, 875, 866, 0, 0, 0, 0, 0, 0, 2050, 0, 0, 2051, 2052, 2053, 875, 2054, 2055, 2056, 2057, 2058, 2059, 0, 0, 0, 875, 0, 2050, 2041, 0, 2051, 2052, 2053, 2042, 2054, 2055, 2056, 2057, 2058, 2059, 0, 1483, 0, 0, 0, 0, 0, 0, 1484, 2049, 0, 1485, 0, 0, 0, 2043, 2044, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2045, 0, 0, 0, 0, 0, 1486, 0, 737, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2046, 0, 0, 0, 0, 0, 0, 1487, 0, 4976, 875, 0, 0, 0, 2047, 0, 0, 2048, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 875, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2050, 0, 875, 2051, 2052, 2053, 0, 2054, 2055, 2056, 2057, 2058, 2059, 0, 0, 0, 0, 2031, 0, 0, 2032, 1488, 0, 1489, 2033, 2034, 2035, 0, 0, 0, 0, 0, 0, 1490, 0, 0, 0, 0, 0, 0, 0, 2036, 1491, 0, 0, 0, 0, 0, 0, 2038, 0, 0, 0, 0, 1492, 0, 2039, 0, 0, 0, 2049, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3660, 0, 0, 0, 3662, 0, 0, 0, 2040, 0, 3664, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3741, 0, 0, 1494, 1495, 0, 0, 0, 3675, 3677, 0, 0, 5071, 3677, 5073, 0, 5220, 1714, 3688, 3689, 3690, 0, 3692, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3742, 0, 866, 0, 0, 0, 0, 0, 866, 0, 0, 866, 3714, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3720, 3721, 3722, 3723, 0, 0, 0, 0, 0, 0, 0, 2050, 0, 0, 2051, 2052, 2053, 0, 2054, 2055, 2056, 2057, 2058, 2059, 3520, 0, 2031, 0, 0, 2032, 0, 0, 0, 2033, 2034, 2035, 3740, 0, 0, 3745, 3746, 3747, 0, 2041, 0, 1497, 0, 0, 2042, 0, 2036, 0, 0, 3526, 0, 0, 0, 3767, 2038, 0, 0, 0, 0, 0, 0, 2039, 0, 0, 0, 0, 2043, 2044, 0, 0, 0, 0, 0, 3775, 0, 0, 0, 0, 0, 0, 0, 2045, 0, 0, 0, 0, 2040, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4841, 0, 1449, 0, 2046, 2031, 0, 0, 2032, 0, 0, 0, 2033, 2034, 2035, 0, 0, 0, 2047, 0, 0, 2048, 0, 0, 875, 0, 0, 0, 0, 2036, 0, 0, 0, 0, 0, 3817, 1450, 2038, 0, 0, 0, 0, 875, 3821, 2039, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 875, 0, 0, 0, 0, 0, 1536, 0, 0, 2040, 0, 0, 0, 0, 3835, 0, 0, 0, 0, 5251, 0, 0, 0, 0, 0, 0, 2041, 0, 875, 0, 0, 2042, 0, 0, 0, 1452, 0, 3878, 0, 0, 0, 0, 0, 0, 875, 0, 0, 0, 0, 2049, 0, 0, 0, 2043, 2044, 0, 0, 0, 0, 0, 875, 0, 0, 0, 875, 0, 0, 0, 2045, 0, 1453, 0, 0, 0, 0, 2031, 0, 0, 2032, 0, 0, 0, 2033, 2034, 2035, 0, 0, 0, 0, 3915, 0, 0, 0, 0, 3921, 0, 0, 0, 0, 2036, 0, 2046, 4071, 0, 0, 0, 1454, 2038, 0, 0, 0, 0, 0, 0, 2039, 2047, 0, 0, 2048, 2041, 0, 0, 5322, 0, 2042, 0, 5447, 0, 3960, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2040, 1455, 0, 0, 0, 0, 0, 2043, 2044, 2050, 0, 0, 2051, 2052, 2053, 0, 2054, 2055, 2056, 2057, 2058, 2059, 2045, 0, 0, 0, 0, 0, 3976, 0, 3977, 0, 1537, 1457, 0, 0, 0, 0, 0, 1420, 0, 0, 0, 875, 0, 0, 0, 0, 0, 0, 5447, 875, 875, 0, 0, 2046, 0, 0, 0, 0, 0, 0, 0, 0, 0, 875, 0, 2049, 5447, 2047, 4001, 1538, 2048, 0, 0, 36, 874, 0, 0, 1459, 5398, 0, 0, 0, 0, 874, 0, 0, 1460, 0, 0, 0, 0, 0, 0, 0, 1461, 0, 0, 874, 0, 0, 0, 0, 1539, 0, 0, 0, 0, 0, 2041, 0, 4841, 4841, 0, 2042, 1463, 0, 1714, 0, 0, 0, 0, 0, 0, 1464, 0, 0, 0, 1465, 0, 0, 0, 0, 0, 0, 0, 2043, 2044, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2045, 0, 0, 0, 0, 0, 0, 0, 2049, 0, 0, 0, 0, 0, 2050, 0, 0, 2051, 2052, 2053, 0, 2054, 2055, 2056, 2057, 2058, 2059, 0, 0, 0, 1466, 0, 0, 2046, 2031, 0, 0, 2032, 0, 0, 4016, 2033, 2034, 2035, 0, 0, 0, 2047, 0, 0, 2048, 0, 0, 0, 0, 0, 0, 0, 2036, 0, 0, 0, 0, 4841, 0, 0, 2038, 0, 0, 0, 0, 0, 0, 2039, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2040, 0, 0, 0, 0, 0, 0, 0, 0, 2050, 0, 0, 2051, 2052, 2053, 0, 2054, 2055, 2056, 2057, 2058, 2059, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4194, 0, 4195, 0, 0, 0, 2049, 0, 0, 4197, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4207, 0, 0, 875, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4215, 0, 0, 0, 0, 878, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 912, 0, 4236, 0, 0, 0, 0, 0, 0, 0, 0, 930, 0, 0, 0, 0, 0, 0, 2041, 0, 4240, 0, 0, 2042, 0, 0, 0, 0, 0, 0, 4249, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 614, 2043, 2044, 2050, 0, 4278, 2051, 2052, 2053, 0, 2054, 2055, 2056, 2057, 2058, 2059, 2045, 615, 4286, 4287, 4288, 0, 0, 0, 0, 4292, 4293, 4294, 4295, 0, 0, 0, 4297, 4298, 0, 0, 0, 0, 4305, 4306, 616, 4308, 4309, 4310, 4311, 4312, 4313, 0, 4315, 2046, 0, 0, 0, 617, 0, 0, 0, 4323, 0, 0, 4326, 4327, 0, 2047, 618, 0, 2048, 0, -856, 0, 0, 0, 0, 0, 1714, 1478, 0, 0, 0, 0, 0, 1479, 0, 0, 3677, 0, 619, 0, 1545, 0, 0, 0, 620, 0, 0, 0, 0, 0, 875, 0, 0, 0, 0, 4350, 0, 0, 875, 1546, 0, 621, 0, 0, 0, 1478, 0, 0, 874, 0, 875, 1479, 622, 0, 874, 1481, 0, 0, 1545, 0, 623, 0, 0, 0, 0, 0, 0, 874, 0, 0, 0, 0, 624, 0, 0, 0, 0, 1546, 0, 0, 625, 0, 0, 874, 626, 0, 2049, 0, 0, 1547, 0, 0, 0, 1481, 0, 0, 0, 0, 874, 0, 0, 0, 0, -1085, 0, 0, 874, 0, 0, 1483, 0, 0, 0, 0, 0, 0, 1484, 0, 0, 1485, 874, 866, 866, 0, 875, 875, 0, 1547, 0, 0, 874, 0, 0, 0, 0, 3677, 866, 0, 875, 866, 627, 0, 0, 0, 1486, 0, 0, 1483, 0, -573, 0, 875, 875, 0, 1484, 0, 0, 1485, 0, 0, 0, 0, 0, 0, 0, 0, 0, 875, 0, 4462, 0, 0, 0, 0, 0, 1548, 0, 0, 1487, 0, 0, 0, 1486, 628, 0, 2050, 629, 0, 2051, 2052, 2053, 0, 2054, 2055, 2056, 2057, 2058, 2059, 0, 866, 0, 0, 866, 866, 0, 0, 0, 630, 0, 0, 0, 0, 0, 1548, 0, 0, 1487, 0, 874, 0, 0, 631, 0, 1549, 0, 0, 1550, 0, -444, 0, 0, 0, 0, 0, 0, 0, 0, 1551, 0, 1489, 0, 0, 874, 0, 0, 0, 0, 632, 0, 1490, 0, 0, 0, 0, 0, 874, 633, 0, 1491, 0, 0, 1549, 0, -444, 1550, 0, 634, 0, 0, 1552, 1492, 0, 0, 0, 0, 1551, 0, 1489, 0, 0, 0, 0, 944, 0, 0, 635, 0, 1490, 992, 0, 0, 1714, 636, 0, 0, 0, 1491, 0, -444, 0, 0, 637, 638, 0, 639, 640, 0, 1552, 1492, 1553, 0, 0, 1494, 1495, 1554, 641, 0, 0, 0, 0, 642, 0, 0, 0, 0, 0, 643, 0, 0, 644, 0, 0, 645, 0, 0, 0, 1555, 0, 0, 0, 0, 0, 1556, 0, 0, -444, 0, 3143, 0, 0, 1494, 1495, 1554, 0, 0, 0, 1557, 0, 0, 0, 0, 875, 0, 1713, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1555, 0, 0, 0, 4599, 0, 3144, 0, 4600, 4601, 4602, 4603, 0, 0, 4605, 0, 0, 0, 0, 0, 1557, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1497, 0, 0, 0, 0, 0, 0, 0, 875, 0, 0, 4624, 4625, 4626, 0, 4627, 0, 4629, 4630, 0, 0, 0, 0, 0, 0, 0, 875, 0, 0, 4639, 4640, 1714, 875, 0, 0, 0, 875, 0, 1497, 0, 0, 0, 0, 0, 875, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4645, 0, 0, 1327, 0, 665, 875, 0, 0, 0, 666, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1350, 4656, 0, 0, 0, 0, 866, 0, 0, 866, 866, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1374, 667, 0, 0, 0, 0, 0, 0, 875, 0, 0, 0, 0, 0, 668, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 875, 875, 669, 874, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1509, 670, 874, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4708, 1714, 875, 0, 0, 1714, 0, 0, 874, 0, 0, 0, 671, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 672, 0, 0, 0, 875, 0, 1714, 0, 673, 0, 0, 875, 0, 874, 0, 0, 0, 875, 0, 0, 674, 0, 0, 0, 875, 675, 0, 0, 875, 874, 0, 0, 676, 875, 0, 4760, 0, 0, 0, 0, 0, 0, 0, 0, 0, 874, 0, 0, 0, 874, 0, 677, 0, 875, 0, 0, 0, 0, 875, 0, 0, 0, 875, 0, 0, 1714, 0, 0, 0, 0, 0, 0, 0, 0, 0, 875, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 875, 0, 1763, 0, 0, 0, 0, 0, 0, 678, 875, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1801, 1804, 1805, 0, 0, 0, 0, 0, 0, 0, 0, 0, 679, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 680, 603, 0, 0, 0, 0, 0, 0, 0, 0, 0, 681, 0, 0, 0, 0, 0, 0, 0, 1714, 0, 206, 682, 874, 0, 683, 0, 0, 0, 0, 0, 874, 874, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 874, 0, 0, 0, 0, 0, 684, 0, 0, 685, 0, 0, 0, 686, 0, 687, 0, 0, 4859, 0, 0, 0, 688, 0, 0, 689, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4869, 0, 0, 0, 0, 4874, 4875, 0, 690, 0, 0, 0, 0, 0, 0, 691, 0, 1713, 0, 875, 0, 692, 0, 0, 693, 0, 0, 0, 694, 0, 0, 0, 0, 0, 0, 0, 695, 0, 696, 0, 1327, 0, 0, 697, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 698, 0, 4936, 0, 0, 0, 0, 0, 1971, 0, 0, 0, 0, 699, 0, 0, 0, 1327, 0, 875, 947, 0, 4953, 0, 4955, 948, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4971, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3677, 949, 875, 0, 0, 0, 0, 4992, 0, 0, 0, 0, 0, 0, 950, 951, 0, 0, 0, 0, 875, 0, 0, 0, 0, 952, 0, 0, 875, 953, 0, 0, 0, 0, 0, 0, 0, 0, 866, 0, 0, 866, 0, 0, 866, 0, 0, 954, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 955, 0, 5031, 0, 0, 0, 0, 0, 0, 0, 0, 956, 0, 0, 0, 0, 0, 0, 0, 957, 0, 0, 0, 0, 5048, 2102, 0, 874, 0, 0, 0, 958, 0, 0, 0, 5056, 959, 0, 0, 0, 1714, 0, 0, 0, 0, 0, 1714, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 960, 0, 0, 0, 0, 0, 0, 0, 0, 2157, 0, 0, 0, 0, 0, 0, 0, 0, 1303, 1303, 0, 0, 0, 0, 0, 961, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 962, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 875, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 963, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2285, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2309, 3677, 0, 964, 0, 0, 0, 0, 0, 0, 0, 0, 1713, 206, 965, 0, 0, 966, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2345, 0, 0, 0, 0, 874, 0, 0, 0, 0, 0, 0, 967, 874, 0, 968, 0, 875, 875, 969, 0, 970, 0, 2368, 0, 874, 2371, 0, 971, 0, 5202, 972, 0, 0, 0, 1625, 1629, 0, 0, 0, 0, 0, 0, 0, 875, 5215, 0, 875, 0, 0, 973, 0, 0, 0, 0, 0, 0, 974, 0, 0, 0, 0, 0, 975, 0, 0, 976, 0, 0, 0, 977, 0, 0, 0, 0, 0, 2419, 0, 978, 0, 979, 0, 0, 0, 0, 980, 0, 0, 0, 5244, 2437, 0, 0, 0, 0, 0, 0, 0, 0, 874, 874, 0, 0, 0, 5255, 0, 0, 0, 0, 0, 981, 0, 0, 874, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 874, 874, 0, 0, 0, 0, 1714, 1714, 1714, 0, 0, 0, 0, 0, 0, 0, 874, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 875, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 875, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1098, 5316, 0, 0, 0, 0, 0, 0, 0, 875, 0, 0, 0, 0, 0, 0, 2460, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1098, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5338, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2511, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1713, 0, 0, 0, 0, 0, 0, 0, 0, 0, 875, 0, 0, 0, 0, 2554, 0, 0, 0, 0, 0, 0, 2567, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5405, 0, 0, 0, 0, 1714, 0, 1988, 0, 0, 0, 0, 875, 0, 875, 0, 0, 0, 874, 0, 0, 0, 0, 0, 0, 0, 0, 875, 0, 875, 0, 0, 0, 0, 0, 0, 0, 2002, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 190, 0, 0, 1714, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2020, 2021, 2022, 0, 2024, 0, 0, 0, 0, 874, 2645, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2066, 0, 0, 874, 0, 0, 875, 191, 1713, 874, 0, 0, 0, 874, 0, 0, 0, 0, 0, 0, 0, 874, 192, 0, 0, 0, 1327, 1327, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 874, 193, 0, 0, 2696, 0, 0, 194, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 875, 0, 0, 0, 0, 1098, 195, 0, 0, 0, 0, 2124, 0, 0, 0, 2136, 2141, 196, 875, 0, 0, 0, 0, 0, 0, 197, 0, 0, 874, 0, 1098, 0, 0, 0, 0, 0, 0, 198, 0, 0, 875, 0, 199, 875, 0, 1098, 0, 874, 874, 200, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 201, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1713, 874, 0, 0, 1713, 0, 2857, 0, 0, 0, 0, 0, 0, 0, 202, 0, 2863, 0, 0, 0, 0, 0, 0, 0, 0, 0, 874, 0, 1713, 0, 0, 0, 0, 874, 0, 203, 0, 0, 0, 874, 0, 0, 0, 0, 1714, 1374, 874, 0, 0, 0, 874, 1098, 0, 0, 0, 874, 1374, 1374, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 204, 0, 0, 0, 0, 0, 874, 0, 0, 0, 0, 874, 0, 0, 0, 874, 0, 0, 1713, 0, 0, 1327, 0, 0, 205, 0, 0, 0, 874, 0, 0, 0, 0, 0, 206, 207, 0, 0, 208, 0, 0, 874, 1099, 0, 0, 0, 0, 0, 0, 0, 0, 874, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 209, 0, 0, 210, 1099, 0, 0, 211, 0, 212, 0, 0, 0, 0, 0, 0, 213, 0, 0, 214, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1098, 0, 0, 0, 0, 215, 1625, 1625, 1625, 0, 0, 0, 216, 0, 0, 0, 0, 217, 218, 1713, 0, 219, 0, 0, 0, 220, 0, 0, 0, 0, 0, 0, 875, 0, 0, 221, 0, 0, 0, 0, 222, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 223, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, 0, 0, 3047, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1714, 3070, 0, 0, 0, 1714, 0, 1714, 0, 0, 0, 0, 0, 0, 0, 0, 0, 874, 0, 0, 0, 3096, 0, 0, 0, 0, 0, 0, 0, 1714, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1714, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2087, 0, 0, 0, 875, 0, 0, 875, 0, 0, 0, 0, 874, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3170, 3171, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 874, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1098, 0, 0, 0, 1628, 0, 874, 0, 0, 0, 0, 0, 0, 0, 874, 0, 0, 0, 0, 0, 1099, 0, 0, 0, 0, 0, 0, 0, 0, 0, 875, 875, 0, 0, 0, 0, 0, 0, 0, 0, 875, 0, 0, 0, 0, 1099, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 875, 1099, 0, 0, 0, 0, 0, 0, 1098, 0, 0, 0, 0, 0, 0, 3293, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1713, 0, 0, 0, 0, 0, 1713, 0, 0, 0, 0, 0, 1098, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 875, 0, 0, 0, 0, 0, 0, 1098, 0, 0, 0, 1099, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2739, 0, 0, 0, 0, 0, 0, 0, 0, 0, 874, 0, 0, 2759, 0, 2761, 0, 0, 2773, 2776, 2781, 0, 0, 0, 0, 2787, 0, 0, 2792, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2799, 2800, 2801, 2802, 0, 0, 0, 0, 2809, 0, 0, 0, 2821, 0, 0, 2823, 0, 0, 2830, 2831, 2832, 2833, 2834, 2835, 2836, 2837, 2838, 0, 2839, 0, 0, 0, 0, 0, 0, 1303, 0, 1625, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1099, 0, 0, 0, 0, 0, 0, 874, 874, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2876, 0, 0, 874, 0, 0, 874, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2021, 2022, 0, 1098, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1089, 0, 1098, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1098, 0, 0, 875, 0, 0, 1089, 0, 1714, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1713, 1713, 1713, 0, 0, 0, 0, 0, 0, 0, 0, 0, 875, 0, 0, 0, 2977, 0, 0, 0, 0, 0, 0, 874, 875, 0, 0, 1098, 0, 0, 0, 0, 0, 0, 3571, 0, 0, 0, 0, 0, 1098, 0, 0, 874, 0, 0, 0, 0, 0, 0, 0, 875, 1098, 0, 0, 0, 0, 1374, 0, 0, 0, 0, 874, 0, 1098, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2180, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1098, 1098, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 874, 0, 0, 0, 875, 0, 0, 0, 0, 0, 2180, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1713, 0, 0, 0, 1099, 0, 0, 874, 0, 874, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 874, 0, 874, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 875, 0, 1099, 0, 0, 0, 0, 0, 0, 1089, 0, 1713, 0, 0, 0, 0, 0, 0, 0, 0, 1098, 3224, 3225, 1625, 0, 0, 0, 3229, 0, 0, 0, 0, 0, 0, 1089, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1089, 0, 0, 0, 0, 0, 874, 0, 0, 0, 3258, 0, 0, 0, 0, 0, 0, 0, 0, 3762, 0, 0, 0, 0, 0, 0, 0, 1628, 1628, 1628, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 874, 0, 0, 0, 875, 0, 875, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 874, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1089, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 874, 0, 0, 874, 0, 0, 0, 0, 0, 0, 0, 875, 1098, 0, 0, 0, 1098, 1098, 0, 0, 866, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1099, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1099, 0, 0, 0, 0, 0, 0, 0, 1714, 0, 0, 0, 0, 866, 0, 0, 0, 0, 1099, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1098, 0, 0, 0, 0, 1713, 0, 3881, 3882, 3883, 0, 0, 0, 0, 1098, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3892, 1089, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1099, 3908, 0, 0, 0, 0, 0, 0, 0, 1098, 0, 3918, 3920, 1099, 0, 0, 3925, 0, 0, 0, 0, 0, 0, 0, 0, 1099, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3465, 1099, 0, 0, 0, 3471, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2024, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2781, 0, 2781, 2781, 1099, 1099, 0, 0, 0, 0, 0, 0, 0, 3529, 0, 0, 3532, 0, 3534, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 874, 0, 0, 0, 0, 1714, 0, 0, 0, 0, 0, 3552, 0, 3555, 4000, 3557, 0, 1327, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1091, 875, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 875, 0, 0, 0, 0, 0, 0, 0, 0, 1713, 0, 0, 0, 1091, 1713, 0, 1713, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2124, 0, 0, 0, 0, 1089, 0, 0, 0, 0, 1713, 0, 0, 0, 0, 2141, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1098, 0, 0, 0, 1713, 0, 0, 0, 0, 0, 0, 1099, 0, 0, 0, 0, 0, 0, 0, 0, 874, 0, 0, 874, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1089, 0, 1628, 4104, 4105, 4106, 0, 3646, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1092, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1098, 0, 0, 1098, 0, 0, 1089, 0, 0, 0, 0, 0, 0, 0, 1092, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 874, 874, 0, 0, 0, 0, 0, 0, 0, 1089, 874, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1714, 0, 875, 0, 0, 0, 0, 874, 0, 0, 0, 0, 0, 0, 0, 2932, 0, 0, 0, 2180, 2938, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1098, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1099, 874, 0, 1091, 0, 1098, 0, 0, 0, 0, 0, 0, 0, 0, 1099, 0, 1714, 0, 0, 0, 1098, 0, 0, 0, 0, 0, 0, 0, 1091, 0, 0, 0, 0, 0, 875, 0, 0, 0, 0, 0, 0, 0, 0, 1091, 0, 0, 0, 0, 866, 0, 0, 0, 0, 0, 0, 1099, 0, 0, 0, 0, 0, 875, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1089, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1625, 0, 0, 1089, 0, 0, 1625, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1089, 0, 0, 4347, 0, 866, 866, 0, 0, 0, 1091, 0, 0, 0, 4360, 0, 0, 0, 0, 0, 0, 1092, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4391, 1092, 0, 875, 0, 0, 0, 0, 0, 0, 0, 1089, 0, 0, 0, 0, 1092, 0, 0, 0, 0, 0, 0, 0, 1089, 0, 0, 0, 0, 0, 0, 0, 0, 2567, 0, 0, 1089, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1089, 0, 0, 0, 0, 0, 1628, 0, 0, 0, 0, 0, 874, 0, 0, 1098, 0, 1713, 1098, 0, 1098, 0, 0, 0, 0, 1098, 0, 0, 0, 0, 0, 0, 1091, 2645, 0, 0, 0, 0, 0, 1714, 0, 0, 0, 1099, 1089, 1089, 0, 0, 0, 0, 874, 0, 0, 1092, 0, 0, 0, 0, 0, 0, 0, 0, 874, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1098, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 874, 0, 0, 0, 1098, 0, 0, 0, 0, 0, 0, 0, 0, 1714, 0, 0, 1094, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1098, 0, 1714, 0, 866, 866, 0, 2180, 0, 0, 2180, 0, 0, 1094, 4017, 0, 0, 0, 0, 0, 0, 0, 0, 4021, 0, 0, 0, 0, 0, 4022, 0, 4023, 0, 0, 4524, 4525, 4526, 4527, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1092, 0, 0, 0, 0, 0, 0, 0, 4047, 4048, 0, 0, 0, 0, 1089, 0, 0, 0, 874, 0, 1098, 0, 1098, 0, 0, 0, 2787, 0, 0, 0, 0, 0, 0, 0, 4074, 0, 0, 4077, 0, 4079, 0, 0, 0, 0, 0, 0, 0, 0, 4083, 0, 0, 0, 0, 0, 0, 0, 4090, 4091, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1091, 0, 0, 0, 0, 1099, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4137, 0, 0, 0, 0, 0, 0, 1099, 874, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1099, 1098, 0, 4150, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4163, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1091, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1098, 0, 1089, 0, 0, 0, 1089, 1089, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1098, 0, 1091, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 874, 0, 874, 1092, 0, 0, 0, 0, 1091, 0, 0, 0, 1089, 0, 0, 1094, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1089, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1094, 0, 1098, 0, 0, 0, 0, 874, 0, 0, 0, 0, 0, 0, 0, 1094, 0, 0, 0, 0, 0, 0, 0, 1098, 0, 0, 0, 1089, 0, 0, 1092, 0, 0, 0, 0, 0, 0, 1098, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1713, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2180, 1092, 0, 2938, 0, 2938, 0, 0, 0, 0, 2180, 4751, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1094, 0, 0, 0, 1092, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1099, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1098, 0, 0, 0, 0, 0, 1091, 0, 0, 1099, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1098, 0, 1091, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2180, 0, 0, 0, 0, 0, 0, 1091, 0, 0, 0, 0, 1098, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4436, 4437, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1094, 0, 0, 0, 1098, 0, 0, 0, 0, 0, 0, 1089, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1091, 0, 1713, 0, 0, 0, 0, 1099, 0, 1099, 0, 0, 0, 1091, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1091, 0, 874, 0, 0, 0, 0, 4477, 0, 0, 0, 0, 1091, 0, 874, 0, 0, 0, 4482, 0, 1092, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1092, 0, 0, 0, 0, 0, 0, 0, 0, 1098, 1089, 0, 0, 1089, 0, 0, 0, 4908, 1092, 1091, 1091, 0, 4500, 4502, 0, 0, 0, 0, 0, 4506, 4507, 0, 4921, 0, 4508, 0, 1099, 1327, 0, 4511, 0, 0, 4514, 4515, 0, 0, 0, 4519, 0, 0, 0, 0, 0, 4523, 0, 0, 0, 0, 0, 0, 0, 1628, 0, 4958, 0, 0, 0, 1628, 0, 0, 0, 0, 0, 0, 1092, 1099, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1092, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1092, 0, 0, 0, 0, 2938, 1303, 0, 0, 0, 1098, 0, 1092, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1094, 0, 0, 0, 0, 1089, 4579, 1098, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1089, 0, 0, 0, 0, 0, 0, 1092, 1092, 1091, 0, 0, 0, 0, 0, 1089, 1713, 0, 874, 0, 0, 0, 0, 0, 0, 1099, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5044, 0, 0, 0, 0, 0, 0, 0, 0, 1094, 2938, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1099, 0, 0, 0, 0, 0, 0, 0, 1095, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4642, 1094, 0, 0, 0, 0, 0, 0, 0, 1095, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1713, 0, 1098, 0, 0, 0, 1094, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 874, 0, 5122, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1092, 0, 1091, 0, 0, 0, 1091, 1091, 0, 4679, 0, 0, 0, 874, 0, 0, 0, 1099, 1098, 0, 0, 0, 1098, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1099, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1099, 0, 0, 0, 0, 1091, 0, 0, 0, 0, 0, 0, 0, 1089, 0, 0, 1089, 0, 1089, 1091, 0, 0, 0, 1089, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1099, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 874, 0, 0, 0, 0, 1091, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1089, 0, 0, 1092, 0, 0, 0, 1092, 1092, 0, 0, 0, 0, 0, 0, 1098, 1094, 0, 0, 1089, 0, 0, 0, 0, 0, 1098, 0, 0, 0, 0, 0, 0, 0, 1094, 0, 0, 0, 0, 4782, 4783, 0, 0, 4784, 0, 1089, 0, 0, 0, 0, 0, 2180, 1094, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1713, 0, 1092, 0, 0, 1095, 0, 0, 0, 0, 0, 0, 4819, 4820, 0, 0, 1092, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4831, 1095, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1094, 0, 0, 0, 0, 1095, 0, 1089, 0, 1089, 0, 0, 0, 1094, 0, 0, 0, 1092, 0, 0, 0, 0, 0, 1713, 0, 1094, 0, 0, 0, 0, 0, 0, 0, 1098, 0, 0, 0, 1094, 0, 0, 0, 1713, 0, 2938, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2938, 0, 0, 0, 0, 1098, 0, 0, 0, 0, 0, 0, 0, 1091, 1094, 1094, 0, 0, 0, 0, 0, 0, 0, 1095, 0, 0, 1098, 0, 0, 0, 0, 1089, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1089, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1098, 0, 0, 0, 1091, 0, 0, 1091, 1089, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1097, 0, 0, 0, 0, 0, 0, 0, 2787, 0, 0, 0, 0, 0, 0, 1099, 0, 0, 0, 0, 0, 0, 0, 1095, 0, 0, 1097, 0, 0, 0, 0, 0, 0, 0, 1092, 5014, 0, 1094, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2024, 0, 0, 0, 1089, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2938, 0, 0, 0, 2180, 0, 0, 0, 0, 0, 0, 1089, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1089, 0, 0, 0, 0, 0, 0, 0, 1098, 0, 0, 0, 0, 1091, 0, 0, 0, 0, 0, 0, 5063, 0, 0, 0, 0, 0, 0, 0, 1092, 0, 1091, 1092, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1091, 0, 0, 0, 0, 0, 0, 0, 0, 1098, 0, 0, 0, 0, 0, 0, 5100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1094, 0, 0, 0, 1094, 1094, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1089, 0, 0, 0, 0, 1099, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1099, 0, 0, 0, 0, 0, 1089, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1095, 0, 0, 0, 1089, 1092, 0, 0, 0, 1094, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1092, 1094, 0, 0, 0, 0, 0, 0, 0, 4819, 0, 0, 0, 0, 0, 1092, 1089, 0, 0, 0, 0, 0, 1098, 0, 0, 0, 0, 0, 0, 0, 1097, 0, 0, 0, 0, 5204, 0, 0, 0, 0, 0, 0, 1094, 0, 0, 1095, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1097, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1099, 0, 0, 0, 1097, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1091, 1095, 0, 1091, 0, 1091, 0, 0, 0, 0, 1091, 0, 0, 0, 0, 0, 0, 0, 0, 1089, 1099, 0, 0, 0, 0, 0, 0, 5258, 0, 0, 0, 0, 0, 0, 1095, 0, 0, 0, 0, 0, 0, 1099, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1091, 0, 1098, 5286, 5286, 5286, 0, 0, 0, 0, 0, 1097, 0, 0, 0, 0, 0, 0, 0, 1091, 0, 0, 4819, 0, 0, 0, 1098, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1091, 0, 0, 1099, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1089, 0, 0, 0, 0, 1098, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1092, 0, 0, 1092, 0, 1092, 0, 1089, 0, 0, 1092, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1094, 0, 0, 0, 0, 0, 0, 5347, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1091, 0, 1091, 0, 1098, 0, 0, 0, 5286, 1098, 1098, 0, 1097, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1092, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1095, 0, 0, 1092, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4748, 0, 1099, 0, 1095, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1094, 1092, 0, 1094, 0, 0, 0, 0, 1095, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1091, 0, 0, 0, 0, 0, 0, 0, 1099, 1089, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5439, 0, 0, 0, 0, 0, 1098, 0, 0, 0, 1095, 1091, 0, 0, 0, 0, 0, 1092, 0, 1092, 0, 0, 0, 1095, 0, 0, 0, 0, 0, 1089, 0, 0, 0, 1089, 5286, 1095, 0, 0, 0, 0, 1091, 0, 0, 0, 5466, 0, 0, 1095, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1094, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1094, 0, 0, 0, 0, 0, 0, 1095, 1095, 0, 0, 0, 0, 0, 0, 1094, 0, 0, 1097, 0, 0, 0, 0, 0, 1092, 1091, 0, 0, 0, 0, 2938, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1091, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1091, 0, 0, 1092, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1089, 0, 0, 0, 0, 0, 0, 0, 1097, 0, 1089, 0, 0, 0, 0, 1092, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1098, 0, 0, 0, 0, 0, 0, 0, 0, 1097, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1095, 0, 0, 0, 0, 0, 0, 0, 0, 2938, 0, 0, 0, 0, 1097, 0, 1092, 1091, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1099, 0, 0, 0, 1092, 1091, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1092, 0, 0, 0, 0, 0, 1089, 0, 0, 0, 0, 0, 1091, 0, 0, 0, 0, 0, 0, 0, 0, 1099, 0, 0, 0, 1094, 0, 0, 1094, 0, 1094, 0, 0, 0, 0, 1094, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1089, 1091, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1089, 0, 0, 0, 0, 0, 0, 0, 1099, 0, 0, 0, 0, 1099, 1099, 0, 0, 0, 1094, 0, 0, 1095, 0, 0, 0, 1095, 1095, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1092, 1094, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1092, 0, 0, 0, 0, 1094, 0, 0, 1089, 0, 0, 1091, 0, 0, 0, 0, 0, 1097, 0, 0, 0, 0, 0, 0, 0, 1092, 0, 0, 0, 0, 1095, 0, 0, 0, 1097, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1095, 0, 0, 0, 0, 0, 0, 0, 1097, 0, 0, 0, 0, 0, 0, 1092, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4748, 1099, 0, 0, 1094, 0, 1094, 0, 0, 0, 0, 0, 0, 0, 1095, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1097, 0, 0, 1091, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1097, 0, 0, 0, 0, 0, 0, 1089, 0, 0, 0, 0, 1097, 0, 1091, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1097, 0, 1092, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1094, 0, 0, 0, 0, 0, 0, 0, 1089, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1097, 1097, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1094, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1094, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1092, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1091, 0, 1099, 0, 0, 0, 1092, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1095, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1094, 0, 0, 0, 0, 1089, 0, 0, 0, 0, 1091, 0, 0, 0, 1091, 0, 0, 0, 0, 0, 0, 1094, 0, 0, 1097, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1094, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1095, 0, 0, 1095, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1092, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1089, 0, 0, 0, 0, 0, 0, 0, 1094, 0, 0, 0, 0, 1091, 0, 0, 0, 1092, 0, 0, 0, 1092, 0, 1091, 1089, 0, 0, 0, 0, 1094, 0, 0, 0, 1097, 0, 0, 0, 1097, 1097, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1094, 1095, 0, 0, 0, 0, 0, 0, 0, 1089, 0, 0, 0, 0, 0, 0, 0, 0, 1095, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1095, 1094, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1097, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1097, 0, 0, 1089, 0, 0, 0, 0, 1089, 1089, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1091, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1092, 0, 0, 0, 0, 1097, 0, 0, 0, 0, 1092, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1094, 1091, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2061, 0, 0, 0, 0, 0, 0, 1091, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1089, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2061, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1091, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1092, 0, 1094, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1095, 0, 0, 1095, 0, 1095, 0, 1094, 0, 0, 1095, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1092, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1092, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1095, 1097, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1095, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1091, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1095, 0, 0, 1092, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1091, 1094, 0, 1089, 0, 0, 1097, 0, 0, 1097, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1095, 0, 1095, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1094, 0, 0, 0, 1094, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2061, 0, 0, 0, 2061, 0, 1092, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1097, 1095, 0, 0, 0, 0, 0, 1091, 0, 1092, 0, 0, 0, 0, 0, 0, 0, 1097, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1097, 0, 0, 0, 0, 0, 0, 0, 1095, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1094, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1094, 0, 0, 0, 0, 1095, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1091, 0, 0, 0, 0, 0, 0, 1095, 0, 0, 0, 0, 1092, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1091, 0, 0, 0, 1095, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1095, 0, 0, 0, 0, 0, 1094, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1091, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1094, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1097, 1094, 0, 1097, 0, 1097, 0, 0, 0, 1091, 1097, 0, 0, 0, 1091, 1091, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1092, 0, 0, 0, 0, 0, 0, 0, 1095, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1092, 0, 0, 0, 0, 1095, 1097, 0, 0, 0, 0, 0, 0, 1094, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1097, 0, 0, 0, 2061, 1095, 0, 0, 0, 0, 0, 0, 0, 0, 1092, 0, 0, 0, 2061, 0, 0, 0, 2769, 0, 0, 1097, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2061, 2061, 2061, 1095, 2061, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1091, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1092, 0, 0, 0, 0, 1092, 1092, 0, 0, 0, 0, 0, 0, 0, 0, 2061, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1097, 0, 1097, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1094, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1095, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2061, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2061, 0, 1094, 0, 0, 2061, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1097, 0, 1092, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1097, 0, 1095, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1091, 0, 0, 0, 1095, 0, 0, 1097, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1094, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1097, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1097, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1097, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1095, 0, 1092, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1094, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1095, 0, 0, 0, 1095, 0, 0, 1094, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1097, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1094, 0, 0, 0, 0, 0, 1097, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1097, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1094, 0, 0, 0, 0, 1094, 1094, 0, 0, 0, 0, 0, 1097, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1095, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1095, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1097, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1094, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1095, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1095, 0, 0, 1097, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1095, 0, 0, 0, 0, 0, 1097, 0, 0, 2061, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2061, 0, 2061, 0, 0, 2769, 2769, 0, 3506, 0, 2769, 0, 0, 0, 2061, 0, 0, 2061, 0, 0, 0, 0, 2061, 0, 0, 0, 0, 0, 2061, 0, 0, 0, 0, 2061, 0, 0, 1095, 0, 0, 0, 2061, 2061, 2061, 2061, 0, 0, 0, 2769, 2769, 0, 2061, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2061, 0, 2061, 0, 0, 0, 0, 1094, 0, 2061, 2061, 2061, 2061, 2061, 2061, 2061, 2061, 2061, 2061, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1097, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2061, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1097, 1095, 0, 0, 1097, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1095, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2061, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1097, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1097, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1095, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1097, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1097, 0, 0, 0, 0, 0, 0, 0, 0, 1095, 0, 0, 0, 0, 2061, 2061, 0, 0, 0, 2061, 0, 1097, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1095, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2061, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1095, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1097, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1095, 0, 0, 0, 0, 1095, 1095, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1097, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1095, 0, 0, 0, 0, 0, 1097, 0, 0, 2061, 0, 0, 0, 0, 0, 2061, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3506, 3506, 0, 0, 2769, 2769, 2769, 2769, 0, 0, 2769, 2769, 2769, 2769, 2769, 2769, 2769, 2769, 2769, 2769, 3506, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2061, 0, 0, 2061, 0, 2061, 0, 0, 3506, 3506, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2061, 2769, 2769, 2061, 0, 2061, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1097, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2061, 0, 0, 0, 0, 1095, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1097, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1097, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1097, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1097, 0, 0, 0, 0, 1097, 1097, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2769, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1097, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2061, 0, 0, 0, 2061, 2061, 2061, 0, 0, 0, 0, 0, 3506, 3506, 3506, 3506, 0, 0, 0, 0, 3506, 3506, 3506, 3506, 3506, 3506, 3506, 3506, 3506, 3506, 2061, 2061, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2061, 0, 0, 2061, 0, 2061, 0, 0, 0, 2061, 0, 0, 3506, 3506, 0, 0, 2061, 2061, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2061, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2061, 0, 1097, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2061, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3506, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2061, 2061, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2061, 0, 0, 0, 0, 2061, 2769, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2061, 0, 2061, 0, 0, 0, 2061, 2061, 2061, 0, 0, 2061, 0, 0, 2061, 2061, 0, 0, 0, 2061, 0, 0, 0, 2061, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2061, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2061, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2061, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3506, 2769, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2061, 2061, 2061, 0, 0, 0, 0, 0, 0, 0, 2769, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2061, 2061, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2061, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3506, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2769, 0, 0, 3506, 0, 0, 0, 2061, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2061, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2061, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3506, 0, 2769, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2061, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2061, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2061, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2061, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2769, 2769, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3506, 3506, 0, 0, 0, 2061, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 227, 1220, 660, 1221, 1222, 1223, 720, 1224, 0, 0, 0, 0, 0, 0, 2061, 228, 229, 230, 231, 232, 233, 234, 235, 1619, 236, 237, 238, 0, 0, 0, 0, 1225, 0, 0, 239, 240, 0, 241, 242, 243, 244, 245, 246, 247, 248, 1226, 250, 1227, 1228, 0, 253, 254, 255, 256, 257, 258, 1229, 1230, 259, 260, 1231, 1232, 263, 0, 264, 265, 266, 267, 1233, 0, 1234, 0, 270, 271, 272, 273, 274, 275, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 285, 286, 287, 288, 1235, 1236, 1237, 1238, 1239, 1240, 1241, 290, 291, 292, 293, 294, 295, 1242, 1243, 298, 1244, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 1620, 0, 310, 311, 1070, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 1245, 326, 327, 328, 1246, 1247, 330, 0, 331, 332, 1248, 334, 0, 335, 0, 336, 337, 0, 338, 339, 340, 341, 342, 0, 343, 1249, 0, 1250, 346, 347, 0, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 366, 367, 368, 369, 370, 371, 1251, 1252, 0, 1253, 0, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 0, 0, 385, 1254, 387, 388, 389, 0, 390, 391, 392, 1255, 1256, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 1257, 410, 1258, 412, 413, 414, 415, 1259, 416, 417, 418, 419, 1260, 1261, 421, 1262, 423, 424, 425, 0, 426, 427, 0, 0, 1263, 429, 430, 0, 0, 431, 432, 433, 434, 435, 436, 1264, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 1265, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 1266, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 484, 485, 486, 487, 488, 489, 1267, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 1268, 505, 506, 507, 508, 509, 510, 511, 512, 1269, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 1270, 529, 0, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 0, 539, 1271, 1272, 0, 0, 542, 543, 1273, 545, 1274, 1275, 547, 548, 549, 550, 551, 552, 553, 0, 1276, 554, 555, 556, 557, 558, 1277, 0, 559, 560, 561, 562, 563, 564, 1278, 1621, 566, 567, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 1279, 1280, 1281, 1282, 584, 1283, 1284, 1285, 1286, 589, 590, 591, 592, 1287, 0, 0, 0, 0, 0, 0, 1288, 1289, 1622, 0, 0, 0, 0, 0, 0, 1291, 1623, 227, 1220, 660, 1221, 1222, 1223, 720, 1224, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 1225, 0, 0, 239, 240, 0, 241, 242, 243, 244, 245, 246, 247, 248, 1226, 250, 1227, 1228, 0, 253, 254, 255, 256, 257, 258, 1229, 1230, 259, 260, 1231, 1232, 263, 0, 264, 265, 266, 267, 1233, 0, 1234, 0, 270, 271, 272, 273, 274, 275, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 285, 286, 287, 288, 1235, 1236, 1237, 1238, 1239, 1240, 1241, 290, 291, 292, 293, 294, 295, 1242, 1243, 298, 1244, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 1070, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 1245, 326, 327, 328, 1246, 1247, 330, 0, 331, 332, 1248, 334, 0, 335, 0, 336, 337, 0, 338, 339, 340, 341, 342, 0, 343, 1249, 0, 1250, 346, 347, 0, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 366, 367, 368, 369, 370, 371, 1251, 1252, 0, 1253, 0, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 0, 0, 385, 1254, 387, 388, 389, 0, 390, 391, 392, 1255, 1256, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 1257, 410, 1258, 412, 413, 414, 415, 1259, 416, 417, 418, 419, 1260, 1261, 421, 1262, 423, 424, 425, 0, 426, 427, 0, 0, 1263, 429, 430, 0, 0, 431, 432, 433, 434, 435, 436, 1264, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 1265, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 1266, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 484, 485, 486, 487, 488, 489, 1267, 491, 492, 493, 494, 495, 496, 497, 498, 499, 41, 500, 501, 502, 503, 504, 1268, 505, 506, 507, 508, 509, 510, 511, 512, 1269, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 1270, 529, 0, 530, 531, 45, 532, 533, 534, 535, 536, 537, 538, 0, 539, 1271, 1272, 0, 0, 542, 543, 1273, 545, 1274, 1275, 547, 548, 549, 550, 551, 552, 553, 0, 1276, 554, 555, 556, 557, 558, 1277, 0, 559, 560, 561, 562, 563, 1149, 1278, 0, 566, 567, 568, 569, 570, 571, 0, 0, 572, 0, 50, 573, 574, 575, 576, 577, 578, 579, 1279, 1280, 1281, 1282, 584, 1283, 1284, 1285, 1286, 589, 590, 591, 592, 1287, 0, 51, 0, 0, 0, 0, 1288, 1289, 0, 0, 0, 0, 0, 0, 0, 1291, 5025, 227, 1220, 660, 1221, 1222, 1223, 720, 1224, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 1225, 0, 0, 239, 240, 0, 241, 242, 243, 244, 245, 246, 247, 248, 1226, 250, 1227, 1228, 0, 253, 254, 255, 256, 257, 258, 1229, 1230, 259, 260, 1231, 1232, 263, 0, 264, 265, 266, 267, 1233, 0, 1234, 0, 270, 271, 272, 273, 274, 275, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 285, 286, 287, 288, 1235, 1236, 1237, 1238, 1239, 1240, 1241, 290, 291, 292, 293, 294, 295, 1242, 1243, 298, 1244, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 1070, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 1245, 326, 327, 328, 1246, 1247, 330, 0, 331, 332, 1248, 334, 0, 335, 0, 336, 337, 0, 338, 339, 340, 341, 342, 0, 343, 1249, 0, 1250, 346, 347, 0, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 366, 367, 368, 369, 370, 371, 1251, 1252, 0, 1253, 0, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 0, 0, 385, 1254, 387, 388, 389, 0, 390, 391, 392, 1255, 1256, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 1257, 410, 1258, 412, 413, 414, 415, 1259, 416, 417, 418, 419, 1260, 1261, 421, 1262, 423, 424, 425, 0, 426, 427, 0, 0, 1263, 429, 430, 0, 0, 431, 432, 433, 434, 435, 436, 1264, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 1265, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 1266, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 484, 485, 486, 487, 488, 489, 1267, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 1268, 505, 506, 507, 508, 509, 510, 511, 512, 1269, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 1270, 529, 0, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 0, 539, 1271, 1272, 0, 0, 542, 543, 1273, 545, 1274, 1275, 547, 548, 549, 550, 551, 552, 553, 0, 1276, 554, 555, 556, 557, 558, 1277, 0, 559, 560, 561, 562, 563, 564, 1278, 0, 566, 567, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 1279, 1280, 1281, 1282, 584, 1283, 1284, 1285, 1286, 589, 590, 591, 592, 1287, 0, 0, 0, 0, 0, 0, 1288, 1289, 0, 0, 0, 0, 0, 0, 0, 1291, 2771, 227, 1220, 660, 1221, 1222, 1223, 720, 1224, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 1225, 0, 0, 239, 240, 0, 241, 242, 243, 244, 245, 246, 247, 248, 1226, 250, 1227, 1228, 0, 253, 254, 255, 256, 257, 258, 1229, 1230, 259, 260, 1231, 1232, 263, 0, 264, 265, 266, 267, 1233, 0, 1234, 0, 270, 271, 272, 273, 274, 275, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 285, 286, 287, 288, 1235, 1236, 1237, 1238, 1239, 1240, 1241, 290, 291, 292, 293, 294, 295, 1242, 1243, 298, 1244, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 1070, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 1245, 326, 327, 328, 1246, 1247, 330, 0, 331, 332, 1248, 334, 0, 335, 0, 336, 337, 0, 338, 339, 340, 341, 342, 0, 343, 1249, 0, 1250, 346, 347, 0, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 366, 367, 368, 369, 370, 371, 1251, 1252, 0, 1253, 0, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 0, 0, 385, 1254, 387, 388, 389, 0, 390, 391, 392, 1255, 1256, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 1257, 410, 1258, 412, 413, 414, 415, 1259, 416, 417, 418, 419, 1260, 1261, 421, 1262, 423, 424, 425, 0, 426, 427, 0, 0, 1263, 429, 430, 0, 0, 431, 432, 433, 434, 435, 436, 1264, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 1265, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 1266, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 484, 485, 486, 487, 488, 489, 1267, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 1268, 505, 506, 507, 508, 509, 510, 511, 512, 1269, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 1270, 529, 0, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 0, 539, 1271, 1272, 0, 0, 542, 543, 1273, 545, 1274, 1275, 547, 548, 549, 550, 551, 552, 553, 0, 1276, 554, 555, 556, 557, 558, 1277, 0, 559, 560, 561, 562, 563, 564, 1278, 0, 566, 567, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 1279, 1280, 1281, 1282, 584, 1283, 1284, 1285, 1286, 589, 590, 591, 592, 1287, 0, 0, 0, 0, 0, 0, 1288, 1289, 0, 0, 0, 0, 0, 0, 0, 1291, 4025, 227, 1220, 660, 1221, 1222, 1223, 720, 1224, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 1225, 0, 0, 239, 240, 0, 241, 242, 243, 244, 245, 246, 247, 248, 1226, 250, 1227, 1228, 0, 253, 254, 255, 256, 257, 258, 1229, 1230, 259, 260, 1231, 1232, 263, 0, 264, 265, 266, 267, 1233, 0, 1234, 0, 270, 271, 272, 273, 274, 275, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 285, 286, 287, 288, 1235, 1236, 1237, 1238, 1239, 1240, 1241, 290, 291, 292, 293, 294, 295, 1242, 1243, 298, 1244, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 1070, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 1245, 326, 327, 328, 1246, 1247, 330, 0, 331, 332, 1248, 334, 0, 335, 0, 336, 337, 0, 338, 339, 340, 341, 342, 0, 343, 1249, 0, 1250, 346, 347, 0, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 366, 367, 368, 369, 370, 371, 1251, 1252, 0, 1253, 0, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 0, 0, 385, 1254, 387, 388, 389, 0, 390, 391, 392, 1255, 1256, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 1257, 410, 1258, 412, 413, 414, 415, 1259, 416, 417, 418, 419, 1260, 1261, 421, 1262, 423, 424, 425, 0, 426, 427, 0, 0, 1263, 429, 430, 0, 0, 431, 432, 433, 434, 435, 436, 1264, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 1265, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 1266, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 484, 485, 486, 487, 488, 489, 1267, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 1268, 505, 506, 507, 508, 509, 510, 511, 512, 1269, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 1270, 529, 0, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 0, 539, 1271, 1272, 0, 0, 542, 543, 1273, 545, 1274, 1275, 547, 548, 549, 550, 551, 552, 553, 0, 1276, 554, 555, 556, 557, 558, 1277, 0, 559, 560, 561, 562, 563, 564, 1278, 0, 566, 567, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 1279, 1280, 1281, 1282, 584, 1283, 1284, 1285, 1286, 589, 590, 591, 592, 1287, 0, 0, 600, 0, 0, 0, 1288, 1289, 0, 0, 0, 0, 0, 0, 0, 1291, 4097, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 4115, 0, 239, 240, 0, 241, 242, 243, 0, 245, 246, 247, 248, 249, 0, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 0, 0, 270, 271, 272, 273, 274, 0, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, -1775, 286, 287, 288, 0, 0, 0, 0, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 0, 0, -1775, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 352, 0, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, -1775, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 0, 0, 378, -1775, 380, 381, 382, 383, 384, 0, 0, 385, 386, -1775, 388, 0, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, -1775, 411, 412, 413, 414, 415, 0, 416, 417, 0, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 0, 435, 0, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, -1775, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 507, 508, 509, 0, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 0, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 0, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 0, 0, 0, 1062, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1367, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 244, 245, 246, 247, 0, 1063, 250, 1064, 1065, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 1066, 1067, 263, 0, 264, 265, 266, 267, 0, 0, 269, 0, 270, 271, 272, 273, 274, 275, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 285, 286, 287, 288, 0, 0, 0, 289, 0, 0, 0, 290, 291, 292, 293, 294, 295, 1068, 1069, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 1070, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 0, 326, 327, 328, 0, 0, 330, 0, 331, 332, 1071, 334, 0, 335, 0, 336, 337, 0, 338, 339, 340, 341, 342, 0, 343, 0, 0, 0, 346, 347, 0, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 2166, 358, 359, 360, 361, 362, 363, 364, 0, 365, 366, 2167, 368, 369, 370, 371, 1073, 1074, 0, 1075, 0, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 0, 0, 385, 0, 387, 388, 389, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 1076, 410, 1077, 412, 413, 414, 0, 0, 416, 417, 418, 419, 0, 0, 421, 1078, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 2169, 434, 435, 436, 0, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 0, 450, 0, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 1079, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 484, 485, 486, 487, 488, 489, 0, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 2170, 508, 509, 510, 511, 512, 1081, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 0, 529, 0, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 0, 539, 1082, 1083, 0, 0, 542, 543, 0, 545, 0, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 0, 1084, 2171, 566, 567, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 1062, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 590, 591, 592, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 2279, 0, 0, 239, 240, 0, 241, 242, 243, 244, 245, 246, 247, 0, 1063, 250, 1064, 1065, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 1066, 1067, 263, 0, 264, 265, 266, 267, 0, 0, 269, 0, 270, 271, 272, 273, 274, 275, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 285, 286, 287, 288, 0, 0, 0, 289, 0, 0, 0, 290, 291, 292, 293, 294, 295, 1068, 1069, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 1070, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 0, 326, 327, 328, 0, 0, 330, 0, 331, 332, 1071, 334, 0, 335, 0, 336, 337, 0, 338, 339, 340, 341, 342, 0, 343, 0, 0, 0, 346, 347, 0, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 2166, 358, 359, 360, 361, 362, 363, 364, 0, 365, 366, 2167, 368, 369, 370, 371, 1073, 1074, 0, 1075, 0, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 0, 0, 385, 0, 387, 388, 389, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 1076, 410, 1077, 412, 413, 414, 0, 0, 416, 417, 418, 419, 0, 0, 421, 1078, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 2169, 434, 435, 436, 0, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 0, 450, 0, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 1079, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 484, 485, 486, 487, 488, 489, 0, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 2170, 508, 509, 510, 511, 512, 1081, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 0, 529, 0, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 0, 539, 1082, 1083, 0, 0, 542, 543, 0, 545, 0, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 0, 1084, 2171, 566, 567, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 0, 227, 1220, 660, 1221, 1222, 1223, 720, 1224, 0, 0, 590, 591, 592, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 3347, 1225, 0, 0, 239, 240, 0, 241, 242, 243, 244, 245, 246, 247, 248, 1226, 250, 1227, 1228, 0, 253, 254, 255, 256, 257, 258, 1229, 1230, 259, 260, 1231, 1232, 263, 0, 264, 265, 266, 267, 1233, 0, 1234, 0, 270, 271, 272, 273, 274, 275, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 285, 286, 287, 288, 1235, 1236, 1237, 1238, 1239, 1240, 1241, 290, 291, 292, 293, 294, 295, 1242, 1243, 298, 1244, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 1070, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 1245, 326, 327, 328, 1246, 1247, 330, 0, 331, 332, 1248, 334, 0, 335, 0, 336, 337, 0, 338, 339, 340, 341, 342, 0, 343, 1249, 0, 1250, 346, 347, 0, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 366, 367, 368, 369, 370, 371, 1251, 1252, 0, 1253, 0, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 0, 0, 385, 1254, 387, 388, 389, 0, 390, 391, 392, 1255, 1256, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 1257, 410, 1258, 412, 413, 414, 415, 1259, 416, 417, 418, 419, 1260, 1261, 421, 1262, 423, 424, 425, 0, 426, 427, 0, 0, 1263, 429, 430, 0, 0, 431, 432, 433, 434, 435, 436, 1264, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 1265, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 1266, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 484, 485, 486, 487, 488, 489, 1267, 491, 492, 493, 494, 495, 496, 497, 498, 499, 41, 500, 501, 502, 503, 504, 1268, 505, 506, 507, 508, 509, 510, 511, 512, 1269, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 1270, 529, 0, 530, 531, 45, 532, 533, 534, 535, 536, 537, 538, 0, 539, 1271, 1272, 0, 0, 542, 543, 1273, 545, 1274, 1275, 547, 548, 549, 550, 551, 552, 553, 0, 1276, 554, 555, 556, 557, 558, 1277, 0, 559, 560, 561, 562, 563, 1149, 1278, 0, 566, 567, 568, 569, 570, 571, 0, 0, 572, 0, 50, 573, 574, 575, 576, 577, 578, 579, 1279, 1280, 1281, 1282, 584, 1283, 1284, 1285, 1286, 589, 590, 591, 592, 1287, 0, 51, 0, 0, 0, 0, 1288, 1289, 0, 0, 0, 0, 0, 0, 0, 1291, 227, 1220, 660, 1221, 1222, 1223, 720, 1224, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 1225, 0, 0, 239, 240, 0, 241, 242, 243, 244, 245, 246, 247, 248, 1226, 250, 1227, 1228, 2777, 253, 254, 255, 256, 257, 258, 1229, 1230, 259, 260, 1231, 1232, 263, 0, 264, 265, 266, 267, 1233, 0, 1234, 0, 270, 271, 272, 273, 274, 275, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 285, 286, 287, 288, 1235, 1236, 1237, 1238, 1239, 1240, 1241, 290, 291, 292, 293, 294, 295, 1242, 1243, 298, 1244, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 1070, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 1245, 326, 327, 328, 1246, 1247, 330, 0, 331, 332, 1248, 334, 0, 335, 0, 336, 337, 2778, 338, 339, 340, 341, 342, 0, 343, 1249, 0, 1250, 346, 347, 0, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 366, 367, 368, 369, 370, 371, 1251, 1252, 0, 1253, 0, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 0, 2779, 385, 1254, 387, 388, 389, 0, 390, 391, 392, 1255, 1256, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 1257, 410, 1258, 412, 413, 414, 415, 1259, 416, 417, 418, 419, 1260, 1261, 421, 1262, 423, 424, 425, 0, 426, 427, 0, 0, 1263, 429, 430, 0, 0, 431, 432, 433, 434, 435, 436, 1264, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 1265, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 1266, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 484, 485, 486, 487, 488, 489, 1267, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 1268, 505, 506, 507, 508, 509, 510, 511, 512, 1269, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 1270, 529, 0, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 0, 539, 1271, 1272, 0, 2780, 542, 543, 1273, 545, 1274, 1275, 547, 548, 549, 550, 551, 552, 553, 0, 1276, 554, 555, 556, 557, 558, 1277, 0, 559, 560, 561, 562, 563, 564, 1278, 0, 566, 567, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 1279, 1280, 1281, 1282, 584, 1283, 1284, 1285, 1286, 589, 590, 591, 592, 1287, 0, 0, 0, 0, 0, 0, 1288, 1289, 0, 0, 0, 0, 0, 0, 0, 1291, 227, 1220, 660, 1221, 1222, 1223, 720, 1224, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 1225, 0, 0, 239, 240, 0, 241, 242, 243, 244, 245, 246, 247, 248, 1226, 250, 1227, 1228, 0, 253, 254, 255, 256, 257, 258, 1229, 1230, 259, 260, 1231, 1232, 263, 0, 264, 265, 266, 267, 1233, 0, 1234, 0, 270, 271, 272, 273, 274, 275, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 285, 286, 287, 288, 1235, 1236, 1237, 1238, 1239, 1240, 1241, 290, 291, 292, 293, 294, 295, 1242, 1243, 298, 1244, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 1070, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 1245, 326, 327, 328, 1246, 1247, 330, 0, 331, 332, 1248, 334, 0, 335, 0, 336, 337, 0, 338, 339, 340, 341, 342, 0, 343, 1249, 0, 1250, 346, 347, 0, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 366, 367, 368, 369, 370, 371, 1251, 1252, 0, 1253, 0, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 0, 0, 385, 1254, 387, 388, 389, 0, 390, 391, 392, 1255, 1256, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 1257, 410, 1258, 412, 413, 414, 415, 1259, 416, 417, 418, 419, 1260, 1261, 421, 1262, 423, 424, 425, 0, 426, 427, 0, 0, 1263, 429, 430, 0, 0, 431, 432, 433, 434, 435, 436, 1264, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 1265, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 1266, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 484, 485, 486, 487, 488, 489, 1267, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 1268, 505, 506, 507, 508, 509, 510, 511, 512, 1269, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 1270, 529, 0, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 0, 539, 1271, 1272, 0, 0, 542, 543, 1273, 545, 1274, 1275, 547, 548, 549, 550, 551, 552, 553, 0, 1276, 554, 555, 556, 557, 558, 1277, 0, 559, 560, 561, 562, 563, 564, 1278, 0, 566, 567, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 1279, 1280, 1281, 1282, 584, 1283, 1284, 1285, 1286, 589, 590, 591, 592, 1287, 0, 0, 0, 0, 0, 0, 1288, 1289, 0, 0, 0, 0, 0, 1985, 2732, 1291, 227, 1220, 660, 1221, 1222, 1223, 720, 1224, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 1225, 0, 0, 239, 240, 0, 241, 242, 243, 244, 245, 246, 247, 248, 1226, 250, 1227, 1228, 0, 253, 254, 255, 256, 257, 258, 1229, 1230, 259, 260, 1231, 1232, 263, 0, 264, 265, 266, 267, 1233, 0, 1234, 0, 270, 271, 272, 273, 274, 275, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 285, 286, 287, 288, 1235, 1236, 1237, 1238, 1239, 1240, 1241, 290, 291, 292, 293, 294, 295, 1242, 1243, 298, 1244, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 1070, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 1245, 326, 327, 328, 1246, 1247, 330, 0, 331, 332, 1248, 334, 0, 335, 0, 336, 337, 0, 338, 339, 340, 341, 342, 0, 343, 1249, 0, 1250, 346, 347, 0, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 366, 367, 368, 369, 370, 371, 1251, 1252, 0, 1253, 0, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 0, 0, 385, 1254, 387, 388, 389, 0, 390, 391, 392, 1255, 1256, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 1257, 410, 1258, 412, 413, 414, 415, 1259, 416, 417, 418, 419, 1260, 1261, 421, 1262, 423, 424, 425, 0, 426, 427, 0, 0, 1263, 429, 430, 0, 0, 431, 432, 433, 434, 435, 436, 1264, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 1265, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 1266, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 484, 485, 486, 487, 488, 489, 1267, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 1268, 505, 506, 507, 508, 509, 510, 511, 512, 1269, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 1270, 529, 0, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 0, 539, 1271, 1272, 0, 0, 542, 543, 1273, 545, 1274, 1275, 547, 548, 549, 550, 551, 552, 553, 0, 1276, 554, 555, 556, 557, 558, 1277, 0, 559, 560, 561, 562, 563, 564, 1278, 0, 566, 567, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 1279, 1280, 1281, 1282, 584, 1283, 1284, 1285, 1286, 589, 590, 591, 592, 1287, 0, 0, 0, 0, 0, 0, 1288, 1289, 1290, 0, 0, 0, 0, 0, 0, 1291, 227, 1220, 660, 1221, 1222, 1223, 720, 1224, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 2134, 236, 237, 238, 0, 0, 0, 0, 1225, 0, 0, 239, 240, 0, 241, 242, 243, 244, 245, 246, 247, 248, 1226, 250, 1227, 1228, 0, 253, 254, 255, 256, 257, 258, 1229, 1230, 259, 260, 1231, 1232, 263, 0, 264, 265, 266, 267, 1233, 0, 1234, 0, 270, 271, 272, 273, 274, 275, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 285, 286, 287, 288, 1235, 1236, 1237, 1238, 1239, 1240, 1241, 290, 291, 292, 293, 294, 295, 1242, 1243, 298, 1244, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 1070, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 1245, 326, 327, 328, 1246, 1247, 330, 0, 331, 332, 1248, 334, 0, 335, 0, 336, 337, 0, 338, 339, 340, 341, 342, 0, 343, 1249, 0, 1250, 346, 347, 0, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 366, 367, 368, 369, 370, 371, 1251, 1252, 0, 1253, 0, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 0, 0, 385, 1254, 387, 388, 389, 0, 390, 391, 392, 1255, 1256, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 1257, 410, 1258, 412, 413, 414, 415, 1259, 416, 417, 418, 419, 1260, 1261, 421, 1262, 423, 424, 425, 0, 426, 427, 0, 0, 1263, 429, 430, 0, 0, 431, 432, 433, 434, 435, 436, 1264, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 1265, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 1266, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 484, 485, 486, 487, 488, 489, 1267, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 1268, 505, 506, 507, 508, 509, 510, 511, 512, 1269, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 1270, 529, 0, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 0, 539, 1271, 1272, 0, 0, 542, 543, 1273, 545, 1274, 1275, 547, 548, 549, 550, 551, 552, 553, 0, 1276, 554, 555, 556, 557, 558, 1277, 0, 559, 560, 561, 562, 563, 564, 1278, 0, 566, 567, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 1279, 1280, 1281, 1282, 584, 1283, 1284, 1285, 1286, 589, 590, 591, 592, 1287, 0, 0, 0, 0, 0, 0, 1288, 1289, 0, 0, 0, 0, 0, 0, 0, 1291, 227, 1220, 660, 1221, 1222, 1223, 720, 1224, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 1225, 0, 0, 239, 240, 0, 241, 242, 243, 244, 245, 246, 247, 248, 1226, 250, 1227, 1228, 0, 253, 254, 255, 256, 257, 258, 1229, 1230, 259, 260, 1231, 1232, 263, 0, 264, 265, 266, 267, 1233, 0, 1234, 0, 270, 271, 272, 273, 274, 275, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 285, 286, 287, 288, 1235, 1236, 1237, 1238, 1239, 1240, 1241, 290, 291, 292, 293, 294, 295, 1242, 1243, 298, 1244, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 1070, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 1245, 326, 327, 328, 1246, 1247, 330, 0, 331, 332, 1248, 334, 0, 335, 0, 336, 337, 0, 338, 339, 340, 341, 342, 0, 343, 1249, 0, 1250, 346, 347, 0, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 366, 367, 368, 369, 370, 371, 1251, 1252, 0, 1253, 0, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 0, 0, 385, 1254, 387, 388, 389, 0, 390, 391, 392, 1255, 1256, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 1257, 410, 1258, 412, 413, 414, 415, 1259, 416, 417, 418, 419, 1260, 1261, 421, 1262, 423, 424, 425, 0, 426, 427, 0, 0, 1263, 429, 430, 0, 0, 431, 432, 433, 434, 435, 436, 1264, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 1265, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 1266, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 484, 485, 486, 487, 488, 489, 1267, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 1268, 505, 506, 507, 508, 509, 510, 511, 512, 1269, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 1270, 529, 0, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 0, 539, 1271, 1272, 0, 0, 542, 543, 1273, 545, 1274, 1275, 547, 548, 549, 550, 551, 552, 553, 0, 1276, 554, 555, 556, 557, 558, 1277, 0, 559, 560, 561, 562, 563, 564, 1278, 3226, 566, 567, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 1279, 1280, 1281, 1282, 584, 1283, 1284, 1285, 1286, 589, 590, 591, 592, 1287, 0, 0, 0, 0, 0, 0, 1288, 1289, 0, 0, 0, 0, 0, 0, 0, 1291, 227, 1220, 660, 1221, 1222, 1223, 720, 1224, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 1225, 0, 0, 239, 240, 0, 241, 242, 243, 244, 245, 246, 247, 248, 1226, 250, 1227, 1228, 0, 253, 254, 255, 256, 257, 258, 1229, 1230, 259, 260, 1231, 1232, 263, 0, 264, 265, 266, 267, 1233, 0, 1234, 0, 270, 271, 272, 273, 274, 275, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 285, 286, 287, 288, 1235, 1236, 1237, 1238, 1239, 1240, 1241, 290, 291, 292, 293, 294, 295, 1242, 1243, 298, 1244, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 1070, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 1245, 326, 327, 328, 1246, 1247, 330, 0, 331, 332, 1248, 334, 0, 335, 0, 336, 337, 2778, 338, 339, 340, 341, 342, 0, 343, 1249, 0, 1250, 346, 347, 0, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 366, 367, 368, 369, 370, 371, 1251, 1252, 0, 1253, 0, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 0, 0, 385, 1254, 387, 388, 389, 0, 390, 391, 392, 1255, 1256, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 1257, 410, 1258, 412, 413, 414, 415, 1259, 416, 417, 418, 419, 1260, 1261, 421, 1262, 423, 424, 425, 0, 426, 427, 0, 0, 1263, 429, 430, 0, 0, 431, 432, 433, 434, 435, 436, 1264, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 1265, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 1266, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 484, 485, 486, 487, 488, 489, 1267, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 1268, 505, 506, 507, 508, 509, 510, 511, 512, 1269, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 1270, 529, 0, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 0, 539, 1271, 1272, 0, 0, 542, 543, 1273, 545, 1274, 1275, 547, 548, 549, 550, 551, 552, 553, 0, 1276, 554, 555, 556, 557, 558, 1277, 0, 559, 560, 561, 562, 563, 564, 1278, 0, 566, 567, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 1279, 1280, 1281, 1282, 584, 1283, 1284, 1285, 1286, 589, 590, 591, 592, 1287, 0, 0, 0, 0, 0, 0, 1288, 1289, 0, 0, 0, 0, 0, 0, 0, 1291, 227, 1220, 660, 1221, 1222, 1223, 720, 1224, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 1225, 0, 0, 239, 240, 0, 241, 242, 243, 244, 245, 246, 247, 248, 1226, 250, 1227, 1228, 0, 253, 254, 255, 256, 257, 258, 1229, 1230, 259, 260, 1231, 1232, 263, 0, 264, 265, 266, 267, 1233, 0, 1234, 0, 270, 271, 272, 273, 274, 275, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 285, 286, 287, 288, 1235, 1236, 1237, 1238, 1239, 1240, 1241, 290, 291, 292, 293, 294, 295, 1242, 1243, 298, 1244, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 1070, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 1245, 326, 327, 328, 1246, 1247, 330, 0, 331, 332, 1248, 334, 0, 335, 0, 336, 337, 0, 338, 339, 340, 341, 342, 0, 343, 1249, 0, 1250, 346, 347, 0, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 366, 367, 368, 369, 370, 371, 1251, 1252, 0, 1253, 0, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 0, 0, 385, 1254, 387, 388, 389, 0, 390, 391, 392, 1255, 1256, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 1257, 410, 1258, 412, 413, 414, 415, 1259, 416, 417, 418, 419, 1260, 1261, 421, 1262, 423, 424, 425, 0, 426, 427, 0, 0, 1263, 429, 430, 0, 0, 431, 432, 433, 434, 435, 436, 1264, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 1265, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 1266, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 484, 485, 486, 487, 488, 489, 1267, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 1268, 505, 506, 507, 508, 509, 510, 511, 512, 1269, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 1270, 529, 0, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 0, 539, 1271, 1272, 0, 0, 542, 543, 1273, 545, 1274, 1275, 547, 548, 549, 550, 551, 552, 553, 0, 1276, 554, 555, 556, 557, 558, 1277, 0, 559, 560, 561, 562, 563, 564, 1278, 0, 566, 567, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 1279, 1280, 1281, 1282, 584, 1283, 1284, 1285, 1286, 589, 590, 591, 592, 1287, 0, 0, 0, 0, 0, 0, 1288, 1289, 0, 0, 0, 0, 0, 0, 0, 1291, 227, 1220, 660, 1221, 1222, 1223, 720, 1224, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 1225, 0, 0, 239, 240, 0, 241, 242, 243, 244, 245, 246, 247, 248, 1226, 250, 1227, 1228, 0, 253, 254, 255, 256, 257, 258, 1229, 1230, 259, 260, 1231, 1232, 263, 0, 264, 265, 266, 267, 1233, 0, 1234, 0, 270, 271, 272, 273, 274, 275, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 285, 286, 287, 288, 1235, 1236, 1237, 1238, 1239, 1240, 1241, 290, 291, 292, 293, 294, 295, 1242, 1243, 298, 1244, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 1070, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 1245, 326, 327, 328, 1246, 1247, 330, 0, 331, 332, 1248, 334, 0, 335, 0, 336, 337, 0, 338, 339, 340, 341, 342, 0, 343, 1249, 0, 1250, 346, 347, 0, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 366, 367, 368, 369, 370, 371, 1251, 1252, 0, 1253, 0, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 0, 0, 385, 1254, 387, 388, 389, 0, 390, 391, 392, 1255, 1256, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 1257, 410, 1258, 412, 413, 414, 415, 1259, 416, 417, 418, 419, 1260, 1261, 421, 1262, 423, 424, 425, 0, 426, 427, 0, 0, 1263, 429, 430, 0, 0, 431, 432, 433, 434, 435, 436, 1264, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 1265, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 1266, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 484, 485, 486, 487, 488, 489, 1267, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 1268, 505, 506, 507, 508, 509, 510, 511, 512, 1269, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 1270, 529, 0, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 0, 539, 1271, 1272, 0, 0, 542, 543, 1273, 545, 1274, 1275, 547, 548, 549, 550, 551, 552, 553, 0, 1276, 554, 555, 556, 557, 558, 1277, 0, 559, 560, 561, 562, 563, 564, 1278, 0, 566, 567, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 1279, 1280, 1281, 1282, 584, 1283, 1284, 1285, 1286, 589, 590, 591, 592, 1287, 0, 0, 0, 0, 0, 0, 2137, 2138, 0, 0, 0, 0, 0, 0, 0, 1291, 227, 2899, 660, 1221, 1222, 1223, 720, 1224, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 1225, 0, 0, 239, 240, 0, 241, 242, 243, 244, 245, 246, 247, 248, 1226, 250, 1227, 1228, 0, 253, 254, 255, 256, 257, 258, 1229, 1230, 259, 260, 1231, 1232, 263, 0, 264, 265, 266, 267, 1233, 0, 1234, 0, 270, 271, 272, 273, 274, 275, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 285, 286, 287, 288, 1235, 1236, 1237, 1238, 1239, 1240, 1241, 290, 291, 292, 293, 294, 295, 1242, 1243, 298, 1244, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 1070, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 1245, 326, 327, 328, 1246, 1247, 330, 0, 331, 332, 1248, 334, 0, 335, 0, 336, 337, 0, 338, 339, 340, 341, 342, 0, 343, 1249, 0, 1250, 346, 347, 0, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 366, 367, 368, 369, 370, 371, 1251, 1252, 0, 1253, 0, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 0, 0, 385, 1254, 387, 388, 389, 0, 390, 391, 392, 1255, 1256, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 1257, 410, 1258, 412, 413, 414, 415, 1259, 416, 417, 418, 419, 1260, 1261, 421, 1262, 423, 424, 425, 0, 426, 427, 0, 0, 1263, 429, 430, 0, 0, 431, 432, 433, 434, 435, 436, 1264, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 1265, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 1266, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 484, 485, 486, 487, 488, 489, 1267, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 1268, 505, 506, 507, 508, 509, 510, 511, 512, 1269, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 1270, 529, 0, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 0, 539, 1271, 1272, 0, 0, 542, 543, 1273, 545, 1274, 1275, 547, 548, 549, 550, 551, 552, 553, 0, 1276, 554, 555, 556, 557, 558, 1277, 0, 559, 560, 561, 562, 563, 564, 1278, 0, 566, 567, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 1279, 1280, 1281, 1282, 584, 1283, 1284, 1285, 1286, 589, 590, 591, 592, 1287, 0, 0, 0, 0, 0, 0, 1288, 1289, 0, 0, 0, 0, 0, 0, 0, 1291, 227, 1220, 660, 1221, 1222, 1223, 720, 1224, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 1225, 0, 0, 239, 240, 0, 241, 242, 243, 244, 245, 246, 247, 248, 1226, 250, 1227, 1228, 0, 253, 254, 255, 256, 257, 258, 1229, 1230, 259, 260, 1231, 1232, 263, 0, 264, 265, 266, 267, 1233, 0, 1234, 0, 270, 271, 272, 273, 274, 275, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 285, 286, 287, 4149, 1235, 1236, 1237, 1238, 1239, 1240, 1241, 290, 291, 292, 293, 294, 295, 1242, 1243, 298, 1244, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 1070, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 1245, 326, 327, 328, 1246, 1247, 330, 0, 331, 332, 1248, 334, 0, 335, 0, 336, 337, 0, 338, 339, 340, 341, 342, 0, 343, 1249, 0, 1250, 346, 347, 0, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 366, 367, 368, 369, 370, 371, 1251, 1252, 0, 1253, 0, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 0, 0, 385, 1254, 387, 388, 389, 0, 390, 391, 392, 1255, 1256, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 1257, 410, 1258, 412, 413, 414, 415, 1259, 416, 417, 418, 419, 1260, 1261, 421, 1262, 423, 424, 425, 0, 426, 427, 0, 0, 1263, 429, 430, 0, 0, 431, 432, 433, 434, 435, 436, 1264, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 1265, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 1266, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 484, 485, 486, 487, 488, 489, 1267, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 1268, 505, 506, 507, 508, 509, 510, 511, 512, 1269, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 1270, 529, 0, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 0, 539, 1271, 1272, 0, 0, 542, 543, 1273, 545, 1274, 1275, 547, 548, 549, 550, 551, 552, 553, 0, 1276, 554, 555, 556, 557, 558, 1277, 0, 559, 560, 561, 562, 563, 564, 1278, 0, 566, 567, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 1279, 1280, 1281, 1282, 584, 1283, 1284, 1285, 1286, 589, 590, 591, 592, 1287, 0, 0, 0, 0, 0, 0, 1288, 1289, 0, 0, 0, 0, 0, 0, 0, 1291, 227, 1220, 660, 1221, 1222, 1223, 720, 1224, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 1225, 0, 0, 239, 240, 0, 241, 242, 243, 244, 245, 246, 247, 248, 1226, 250, 1227, 1228, 0, 253, 254, 255, 256, 257, 258, 1229, 1230, 259, 260, 1231, 1232, 263, 0, 264, 265, 266, 267, 1233, 0, 1234, 0, 270, 271, 272, 273, 274, 275, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 285, 286, 287, 288, 1235, 1236, 1237, 1238, 1239, 1240, 1241, 290, 291, 292, 293, 294, 295, 1242, 1243, 298, 1244, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 1070, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 1245, 326, 327, 328, 1246, 1247, 330, 0, 331, 332, 1248, 334, 0, 335, 0, 336, 337, 0, 338, 339, 340, 341, 342, 0, 343, 1249, 0, 1250, 346, 347, 0, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 366, 367, 368, 369, 370, 371, 1251, 1252, 0, 1253, 0, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 0, 0, 385, 1254, 387, 388, 389, 0, 390, 391, 392, 1255, 1256, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 1257, 410, 1258, 412, 413, 414, 415, 1259, 416, 417, 418, 419, 1260, 1261, 421, 1262, 423, 424, 425, 0, 426, 427, 0, 0, 1263, 429, 430, 0, 0, 431, 432, 433, 434, 435, 436, 1264, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 1265, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 1266, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 484, 485, 486, 487, 488, 489, 1267, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 1268, 505, 506, 507, 508, 509, 510, 511, 512, 1269, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 1270, 529, 0, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 0, 539, 1271, 1272, 0, 0, 542, 543, 1273, 545, 1274, 1275, 547, 548, 549, 550, 551, 552, 553, 0, 1276, 554, 555, 556, 557, 558, 1277, 0, 559, 560, 561, 562, 563, 564, 1278, 0, 566, 567, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 4489, 1279, 1280, 1281, 1282, 584, 1283, 1284, 1285, 1286, 589, 590, 591, 592, 1287, 0, 0, 0, 0, 0, 0, 1288, 1289, 0, 0, 0, 0, 0, 0, 0, 1291, 227, 1220, 660, 1221, 1222, 1223, 720, 1224, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 1225, 0, 0, 239, 240, 0, 241, 242, 243, 244, 245, 246, 247, 248, 1226, 250, 1227, 1228, 0, 253, 254, 255, 256, 257, 258, 1229, 1230, 259, 260, 1231, 1232, 263, 0, 264, 265, 266, 267, 1233, 0, 1234, 0, 270, 271, 272, 273, 274, 275, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 285, 286, 287, 288, 1235, 1236, 1237, 1238, 1239, 1240, 1241, 290, 291, 292, 293, 294, 295, 1242, 1243, 298, 1244, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 1070, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 1245, 326, 327, 328, 1246, 1247, 330, 0, 331, 332, 1248, 334, 0, 335, 0, 336, 337, 0, 338, 339, 340, 341, 342, 0, 343, 1249, 0, 1250, 346, 347, 0, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 366, 367, 368, 369, 370, 371, 1251, 1252, 0, 1253, 0, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 0, 0, 385, 1254, 387, 388, 389, 0, 390, 391, 392, 1255, 1256, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 1257, 410, 1258, 412, 413, 4501, 415, 1259, 416, 417, 418, 419, 1260, 1261, 421, 1262, 423, 424, 425, 0, 426, 427, 0, 0, 1263, 429, 430, 0, 0, 431, 432, 433, 434, 435, 436, 1264, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 1265, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 1266, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 484, 485, 486, 487, 488, 489, 1267, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 1268, 505, 506, 507, 508, 509, 510, 511, 512, 1269, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 1270, 529, 0, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 0, 539, 1271, 1272, 0, 0, 542, 543, 1273, 545, 1274, 1275, 547, 548, 549, 550, 551, 552, 553, 0, 1276, 554, 555, 556, 557, 558, 1277, 0, 559, 560, 561, 562, 563, 564, 1278, 0, 566, 567, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 1279, 1280, 1281, 1282, 584, 1283, 1284, 1285, 1286, 589, 590, 591, 592, 1287, 0, 0, 0, 0, 0, 0, 1288, 1289, 0, 0, 0, 0, 0, 0, 0, 1291, 227, 1220, 660, 1221, 1222, 1223, 720, 1224, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 1225, 0, 0, 239, 240, 0, 241, 242, 243, 244, 245, 246, 247, 248, 1226, 250, 1227, 1228, 0, 253, 254, 255, 256, 257, 258, 1229, 1230, 259, 260, 1231, 1232, 263, 0, 264, 265, 266, 267, 1233, 0, 1234, 0, 270, 271, 272, 273, 274, 275, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 285, 286, 4809, 288, 1235, 1236, 1237, 1238, 1239, 1240, 1241, 290, 291, 292, 293, 294, 295, 1242, 1243, 298, 1244, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 1070, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 1245, 326, 327, 328, 1246, 1247, 330, 0, 331, 332, 1248, 334, 0, 335, 0, 336, 337, 0, 338, 339, 340, 341, 342, 0, 343, 1249, 0, 4810, 346, 347, 0, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 366, 367, 368, 369, 370, 371, 1251, 1252, 0, 1253, 0, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 0, 0, 385, 1254, 387, 388, 389, 0, 390, 391, 392, 1255, 1256, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 1257, 410, 1258, 412, 413, 414, 415, 1259, 416, 417, 418, 419, 1260, 1261, 421, 1262, 423, 424, 425, 0, 426, 427, 0, 0, 1263, 429, 430, 0, 0, 431, 432, 433, 434, 435, 436, 1264, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 1265, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 1266, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 484, 485, 486, 4811, 488, 489, 1267, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 1268, 505, 506, 507, 508, 509, 510, 511, 512, 1269, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 1270, 529, 0, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 0, 539, 1271, 1272, 0, 0, 542, 543, 1273, 545, 1274, 1275, 547, 548, 549, 550, 551, 552, 553, 0, 1276, 554, 555, 556, 557, 558, 1277, 0, 559, 560, 561, 562, 563, 564, 1278, 0, 566, 567, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 1279, 1280, 1281, 1282, 584, 1283, 1284, 1285, 1286, 589, 590, 591, 592, 1287, 0, 0, 0, 0, 0, 0, 1288, 1289, 0, 0, 0, 0, 0, 0, 0, 4812, 227, 1220, 660, 1221, 1222, 1223, 720, 1224, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 1225, 0, 0, 239, 240, 0, 241, 242, 243, 244, 245, 246, 247, 5283, 1226, 250, 1227, 1228, 0, 253, 254, 255, 256, 257, 258, 1229, 1230, 259, 260, 1231, 1232, 263, 0, 264, 265, 266, 267, 1233, 0, 1234, 0, 270, 271, 272, 273, 274, 275, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 285, 286, 287, 5284, 1235, 1236, 1237, 1238, 1239, 1240, 1241, 290, 291, 292, 293, 294, 295, 1242, 1243, 298, 1244, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 1070, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 1245, 326, 327, 328, 1246, 1247, 330, 0, 331, 332, 1248, 334, 0, 335, 0, 336, 337, 0, 338, 339, 340, 341, 342, 0, 343, 1249, 0, 1250, 346, 347, 0, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 366, 367, 368, 369, 370, 371, 1251, 1252, 0, 1253, 0, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 0, 0, 385, 1254, 387, 388, 389, 0, 390, 391, 392, 1255, 1256, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 1257, 410, 1258, 412, 413, 414, 415, 1259, 416, 417, 418, 419, 1260, 1261, 421, 1262, 423, 424, 425, 0, 426, 427, 0, 0, 1263, 429, 430, 0, 0, 431, 432, 433, 434, 435, 436, 1264, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 1265, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 1266, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 484, 485, 486, 487, 488, 489, 1267, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 1268, 505, 506, 507, 508, 509, 510, 511, 512, 1269, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 1270, 529, 0, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 0, 539, 1271, 1272, 0, 0, 542, 543, 1273, 545, 1274, 1275, 547, 548, 549, 550, 5285, 552, 553, 0, 1276, 554, 555, 556, 557, 558, 1277, 0, 559, 560, 561, 562, 563, 564, 1278, 0, 566, 567, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 1279, 1280, 1281, 1282, 584, 1283, 1284, 1285, 1286, 589, 590, 591, 592, 1287, 0, 0, 0, 0, 0, 0, 1288, 1289, 0, 0, 0, 0, 0, 0, 0, 1291, 227, 1220, 660, 1221, 1222, 1223, 720, 1224, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 1225, 0, 0, 239, 240, 0, 241, 242, 243, 244, 245, 246, 247, 248, 1226, 250, 1227, 1228, 0, 253, 254, 255, 256, 257, 258, 1229, 1230, 259, 260, 1231, 1232, 263, 0, 264, 265, 266, 267, 1233, 0, 1234, 0, 270, 271, 272, 273, 274, 275, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 285, 286, 287, 5284, 1235, 1236, 1237, 1238, 1239, 1240, 1241, 290, 291, 292, 293, 294, 295, 1242, 1243, 298, 1244, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 1070, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 1245, 326, 327, 328, 1246, 1247, 330, 0, 331, 332, 1248, 334, 0, 335, 0, 336, 337, 0, 338, 339, 340, 341, 342, 0, 343, 1249, 0, 1250, 346, 347, 0, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 366, 367, 368, 369, 370, 371, 1251, 1252, 0, 1253, 0, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 0, 0, 385, 1254, 387, 388, 389, 0, 390, 391, 392, 1255, 1256, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 1257, 410, 1258, 412, 413, 414, 415, 1259, 416, 417, 418, 419, 1260, 1261, 421, 1262, 423, 424, 425, 0, 426, 427, 0, 0, 1263, 429, 430, 0, 0, 431, 432, 433, 434, 435, 436, 1264, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 1265, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 1266, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 484, 485, 486, 487, 488, 489, 1267, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 1268, 505, 506, 507, 508, 509, 510, 511, 512, 1269, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 1270, 529, 0, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 0, 539, 1271, 1272, 0, 0, 542, 543, 1273, 545, 1274, 1275, 547, 548, 549, 550, 5285, 552, 553, 0, 1276, 554, 555, 556, 557, 558, 1277, 0, 559, 560, 561, 562, 563, 564, 1278, 0, 566, 567, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 1279, 1280, 1281, 1282, 584, 1283, 1284, 1285, 1286, 589, 590, 591, 592, 1287, 0, 0, 0, 0, 0, 0, 1288, 1289, 0, 0, 0, 0, 0, 0, 0, 1291, 227, 1220, 660, 1221, 1222, 1223, 720, 1224, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 1225, 0, 0, 239, 240, 0, 241, 242, 243, 244, 245, 246, 247, 248, 1226, 250, 1227, 1228, 0, 253, 254, 255, 256, 257, 258, 1229, 1230, 259, 260, 1231, 1232, 263, 0, 264, 265, 266, 267, 1233, 0, 1234, 0, 270, 271, 272, 273, 274, 275, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 285, 286, 287, 288, 1235, 1236, 1237, 1238, 1239, 1240, 1241, 290, 291, 292, 293, 294, 295, 1242, 1243, 298, 5007, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 1070, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 1245, 326, 327, 328, 1246, 1247, 330, 0, 331, 332, 1248, 334, 0, 335, 0, 336, 337, 0, 338, 339, 340, 341, 342, 0, 343, 1249, 0, 1250, 346, 347, 0, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 366, 367, 368, 369, 370, 371, 1251, 1252, 0, 1253, 0, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 0, 0, 385, 1254, 387, 388, 389, 0, 390, 391, 392, 1255, 1256, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 1257, 410, 1258, 412, 413, 414, 415, 0, 416, 417, 418, 419, 1260, 1261, 421, 1262, 423, 424, 425, 0, 426, 427, 0, 0, 1263, 429, 430, 0, 0, 431, 432, 433, 434, 435, 436, 1264, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 1265, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 1266, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 484, 485, 486, 487, 488, 489, 2763, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 1268, 505, 506, 507, 508, 509, 510, 511, 512, 1269, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 1270, 529, 0, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 0, 539, 1271, 1272, 0, 0, 542, 543, 1273, 545, 1274, 1275, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 1277, 0, 559, 560, 561, 562, 563, 564, 1278, 0, 566, 567, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 1279, 1280, 1281, 1282, 584, 1283, 1284, 1285, 1286, 589, 590, 591, 592, 0, 0, 0, 0, 0, 0, 0, 2764, 2765, 0, 0, 0, 0, 0, 0, 0, 2766, 227, 1220, 660, 1221, 1222, 1223, 720, 1224, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 1225, 0, 0, 239, 240, 0, 241, 242, 243, 244, 245, 246, 247, -2635, 1226, 250, 1227, 1228, 0, 253, 254, 255, 256, 257, 258, 1229, 1230, 259, 260, 1231, 1232, 263, 0, 264, 265, 266, 267, 1233, 0, 1234, 0, 270, 271, 272, 273, 274, 275, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 285, 286, 287, 5284, 1235, 1236, 1237, 1238, 1239, 1240, 1241, 290, 291, 292, 293, 294, 295, 1242, 1243, 298, 1244, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 1070, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 1245, 326, 327, 328, 1246, 1247, 330, 0, 331, 332, 1248, 334, 0, 335, 0, 336, 337, 0, 338, 339, 340, 341, 342, 0, 343, 1249, 0, 1250, 346, 347, 0, 348, 349, 350, 351, 352, -2635, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 366, 367, 368, 369, 370, 371, 1251, 1252, 0, 1253, 0, 375, 0, 0, 378, 379, 380, 381, 382, 383, 384, 0, 0, 385, 1254, 387, 388, -2635, 0, 390, 391, 392, 1255, 1256, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 1257, 410, 1258, 412, 413, 414, 415, 1259, 416, 417, 0, 419, 1260, 1261, 421, 1262, 423, 424, 425, 0, 426, 427, 0, 0, 1263, 429, 430, 0, 0, 431, 432, 433, 434, 435, 436, 1264, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 1265, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 1266, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 484, 485, 486, 487, 488, 489, 1267, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 1268, 505, 506, 507, 508, 509, -2635, 511, 512, 1269, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 1270, 529, 0, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 0, 539, 1271, 1272, 0, 0, 542, 543, 1273, 545, 1274, 1275, 547, 548, 549, 550, 5285, 552, 553, 0, 1276, 554, 555, 556, 557, 558, 1277, 0, 559, 560, 561, 562, 563, 564, 1278, 0, 566, 567, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 1279, 1280, 1281, 1282, 584, 1283, 1284, 1285, 1286, 589, 590, 591, 592, -2635, 0, 0, 0, 0, 0, 0, 1288, 1289, 0, 0, 0, 0, 0, 0, 0, 1291, 227, 1220, 660, 1221, 1222, 1223, 720, 1224, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 1225, 0, 0, 239, 240, 0, 241, 242, 243, 244, 245, 246, 247, 248, 1226, 250, 1227, 1228, 0, 253, 254, 255, 256, 257, 258, 1229, 1230, 259, 260, 1231, 1232, 263, 0, 264, 265, 266, 267, 1233, 0, 1234, 0, 270, 271, 272, 273, 274, 275, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 285, 286, 287, 288, 1235, 1236, 1237, 1238, 1239, 1240, 1241, 290, 291, 292, 293, 294, 295, 1242, 1243, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 1070, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 1245, 326, 327, 328, 1246, 1247, 330, 0, 331, 332, 1248, 334, 0, 335, 0, 336, 337, 0, 338, 339, 340, 341, 342, 0, 343, 1249, 0, 1250, 346, 347, 0, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 366, 367, 368, 369, 370, 371, 1251, 1252, 0, 1253, 0, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 0, 0, 385, 1254, 387, 388, 389, 0, 390, 391, 392, 1255, 1256, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 1257, 410, 1258, 412, 413, 414, 415, 0, 416, 417, 418, 419, 1260, 1261, 421, 1262, 423, 424, 425, 0, 426, 427, 0, 0, 1263, 429, 430, 0, 0, 431, 432, 433, 434, 435, 436, 1264, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 1265, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 1266, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 484, 485, 486, 487, 488, 489, 2763, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 1268, 505, 506, 507, 508, 509, 510, 511, 512, 1269, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 1270, 529, 0, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 0, 539, 1271, 1272, 0, 0, 542, 543, 1273, 545, 1274, 1275, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 1277, 0, 559, 560, 561, 562, 563, 564, 1278, 0, 566, 567, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 1279, 1280, 1281, 1282, 584, 1283, 1284, 1285, 1286, 589, 590, 591, 592, 0, 0, 0, 0, 0, 0, 0, 2764, 2765, 0, 0, 227, 1220, 660, 1221, 1222, 2766, 720, 1224, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 1225, 0, 0, 239, 240, 0, 241, 242, 243, 244, 245, 246, 247, 248, 1226, 250, 1227, 1228, 0, 253, 254, 255, 256, 257, 258, 1229, 1230, 259, 260, 1231, 1232, 263, 0, 264, 265, 266, 267, 1233, 0, 1234, 0, 270, 271, 272, 273, 274, 275, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 285, 286, 287, 288, 1235, 1236, 1237, 1238, 1239, 1240, 1241, 290, 291, 292, 293, 294, 295, 1242, 1243, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 1070, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 1245, 326, 327, 328, 1246, 1247, 330, 0, 331, 332, 1248, 334, 0, 335, 0, 336, 337, 0, 338, 339, 340, 341, 342, 0, 343, 1249, 0, 1250, 346, 347, 0, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 366, 367, 368, 369, 370, 371, 1251, 1252, 0, 1253, 0, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 0, 0, 385, 1254, 387, 388, 389, 0, 390, 391, 392, 1255, 1256, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 1257, 410, 1258, 412, 413, 414, 415, 0, 416, 417, 418, 419, 1260, 1261, 421, 1262, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 434, 435, 436, 1264, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 1265, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 1266, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 484, 485, 486, 487, 488, 489, 2888, 2889, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 1268, 505, 506, 507, 508, 509, 510, 511, 512, 1269, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 1270, 529, 0, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 0, 539, 1271, 1272, 0, 0, 542, 543, 1273, 545, 1274, 1275, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 1277, 0, 559, 560, 561, 562, 563, 564, 1278, 0, 566, 567, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 1279, 1280, 1281, 1282, 584, 1283, 1284, 1285, 1286, 589, 590, 591, 592, 0, 0, 0, 0, 0, 0, 0, 2890, 2891, 0, 0, 0, 0, 0, 0, 0, 2766, 227, 1220, 660, 1221, 1222, 1223, 720, 1224, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 1225, 0, 0, 239, 240, 0, 241, 242, 243, 244, 245, 246, 247, 248, 1226, 250, 1227, 1228, 0, 253, 254, 255, 256, 257, 258, 1229, 1230, 259, 260, 1231, 1232, 263, 0, 264, 265, 266, 267, 1233, 0, 1234, 0, 270, 271, 272, 273, 274, 275, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 285, 286, 287, 288, 1235, 1236, 1237, 1238, 1239, 1240, 1241, 290, 291, 292, 293, 294, 295, 1242, 1243, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 1070, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 1245, 326, 327, 328, 1246, 1247, 330, 0, 331, 332, 1248, 334, 0, 335, 0, 336, 337, 0, 338, 339, 340, 341, 342, 0, 343, 1249, 0, 1250, 346, 347, 0, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 366, 367, 368, 369, 370, 371, 1251, 1252, 0, 1253, 0, 375, 0, 377, 378, 379, 380, 381, 382, 383, 384, 0, 0, 385, 1254, 387, 388, 389, 0, 390, 391, 392, 1255, 1256, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 1257, 410, 1258, 412, 413, 414, 415, 0, 416, 417, 418, 419, 1260, 1261, 421, 1262, 423, 424, 425, 0, 426, 427, 0, 0, 1263, 429, 430, 0, 0, 431, 432, 433, 434, 435, 436, 1264, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 1265, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 1266, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 484, 485, 486, 487, 488, 489, 2763, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 1268, 505, 506, 507, 508, 509, 510, 511, 512, 1269, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 1270, 529, 0, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 0, 539, 1271, 1272, 0, 0, 542, 543, 1273, 545, 1274, 1275, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 1277, 0, 559, 560, 561, 562, 563, 564, 1278, 0, 566, 567, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 1279, 1280, 1281, 1282, 584, 1283, 1284, 1285, 1286, 589, 590, 591, 592, 0, 0, 0, 0, 0, 0, 0, 2764, 2765, 0, 0, 227, 1220, 660, 1221, 1222, 2766, 720, 1224, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 1225, 0, 0, 239, 240, 0, 241, 242, 243, 244, 245, 246, 247, 248, 1226, 250, 1227, 1228, 0, 253, 254, 255, 256, 257, 258, 1229, 1230, 259, 260, 1231, 1232, 263, 0, 264, 265, 266, 267, 1233, 0, 1234, 0, 270, 271, 272, 273, 274, 275, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 285, 286, 287, 288, 1235, 1236, 1237, 1238, 1239, 1240, 1241, 290, 291, 292, 293, 294, 295, 1242, 1243, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 1070, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 1245, 326, 327, 328, 1246, 1247, 330, 0, 331, 332, 1248, 334, 0, 335, 0, 336, 337, 0, 338, 339, 340, 341, 342, 0, 343, 1249, 0, 1250, 346, 347, 0, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 366, 367, 368, 369, 370, 371, 1251, 1252, 0, 1253, 0, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 0, 0, 385, 1254, 387, 388, 389, 0, 390, 391, 392, 1255, 1256, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 1257, 410, 1258, 412, 413, 414, 415, 0, 416, 417, 418, 419, 1260, 1261, 421, 1262, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 434, 435, 436, 1264, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 1265, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 1266, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 484, 485, 486, 487, 488, 489, 2763, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 1268, 505, 506, 507, 508, 509, 510, 511, 512, 1269, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 1270, 529, 0, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 0, 539, 1271, 1272, 0, 0, 542, 543, 1273, 545, 1274, 1275, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 1277, 0, 559, 560, 561, 562, 563, 564, 1278, 0, 566, 567, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 1279, 1280, 1281, 1282, 584, 1283, 1284, 1285, 1286, 589, 590, 591, 592, 0, 0, 227, 1220, 660, 1221, 1222, 0, 720, 1224, 0, 0, 0, 0, 0, 0, 2766, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 1225, 0, 0, 239, 240, 0, 241, 242, 243, 244, 245, 246, 247, 248, 1226, 250, 1227, 1228, 0, 4058, 254, 255, 256, 257, 258, 1229, 1230, 259, 260, 1231, 1232, 263, 0, 264, 265, 266, 267, 1233, 0, 1234, 0, 270, 271, 272, 273, 274, 275, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 285, 286, 287, 288, 1235, 1236, 1237, 1238, 1239, 1240, 1241, 290, 291, 292, 293, 294, 295, 1242, 1243, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 1070, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 1245, 326, 327, 328, 1246, 1247, 330, 0, 331, 332, 1248, 334, 0, 335, 0, 336, 337, 0, 338, 339, 340, 341, 342, 0, 343, 1249, 0, 1250, 346, 347, 0, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 366, 367, 368, 369, 370, 371, 1251, 1252, 0, 1253, 0, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 0, 0, 385, 1254, 387, 388, 389, 0, 390, 391, 392, 1255, 1256, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 1257, 410, 1258, 412, 413, 414, 415, 0, 416, 417, 418, 419, 1260, 1261, 421, 1262, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 434, 435, 436, 1264, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 1265, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 1266, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 484, 485, 486, 487, 488, 489, 2763, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 1268, 505, 506, 507, 508, 509, 510, 511, 512, 1269, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 1270, 529, 0, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 0, 539, 1271, 1272, 0, 0, 542, 543, 1273, 545, 1274, 1275, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 1277, 0, 559, 560, 561, 562, 563, 564, 1278, 0, 566, 567, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 1279, 1280, 1281, 1282, 584, 1283, 1284, 1285, 1286, 589, 590, 591, 592, 0, 0, 227, 1220, 660, 1221, 1222, 0, 720, 1224, 0, 0, 0, 0, 0, 0, 2766, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 1225, 0, 0, 239, 240, 0, 241, 242, 243, 244, 245, 246, 247, 248, 1226, 250, 1227, 1228, 0, 253, 254, 255, 256, 257, 258, 1229, 1230, 259, 260, 1231, 1232, 263, 0, 264, 265, 266, 267, 1233, 0, 1234, 0, 270, 271, 272, 273, 274, 275, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 285, 286, 287, 288, 1235, 1236, 1237, 1238, 1239, 1240, 1241, 290, 291, 292, 293, 294, 295, 1242, 1243, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 1070, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 1245, 326, 327, 328, 1246, 1247, 330, 0, 331, 332, 1248, 334, 0, 335, 0, 336, 337, 0, 338, 339, 340, 341, 342, 0, 343, 1249, 0, 1250, 346, 347, 0, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 366, 367, 368, 369, 370, 371, 1251, 1252, 0, 1253, 0, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 0, 0, 385, 1254, 387, 388, 389, 0, 390, 391, 392, 1255, 1256, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 1257, 410, 1258, 412, 413, 414, 415, 0, 416, 417, 418, 419, 1260, 1261, 421, 1262, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 434, 435, 436, 1264, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 1265, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 1266, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 484, 485, 486, 487, 488, 489, 2763, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 1268, 505, 506, 507, 508, 509, 510, 511, 512, 1269, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 1270, 529, 0, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 0, 539, 1271, 1272, 0, 0, 542, 543, 1273, 545, 1274, 1275, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 1277, 0, 559, 560, 561, 562, 563, 564, 1278, 0, 566, 567, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 1279, 1280, 1281, 1282, 4532, 1283, 1284, 1285, 1286, 589, 590, 591, 592, 0, 0, 227, 1220, 660, 1221, 1222, 1223, 720, 1224, 0, 0, 0, 0, 0, 0, 2766, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 1225, 0, 0, 239, 240, 0, 241, 242, 243, 244, 245, 246, 247, 0, 1226, 250, 1227, 1228, 0, 253, 254, 255, 256, 257, 258, 1229, 1230, 259, 260, 1231, 1232, 263, 0, 264, 265, 266, 267, 1233, 0, 1234, 0, 270, 271, 272, 273, 274, 275, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 285, 286, 287, 288, 1235, 1236, 1237, 1238, 1239, 1240, 1241, 290, 291, 292, 293, 294, 295, 1242, 1243, 298, 1244, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 1070, 313, 314, 0, 315, 316, 317, 0, 318, 0, 320, 0, 321, 322, 323, 324, 1245, 326, 327, 328, 1246, 1247, 330, 0, 331, 332, 1248, 334, 0, 335, 0, 336, 337, 0, 338, 339, 340, 341, 342, 0, 343, 1249, 0, 1250, 346, 347, 0, 348, 349, 350, 351, 352, 0, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 366, 367, 368, 369, 370, 371, 1251, 1252, 0, 1253, 0, 375, 0, 0, 378, 379, 380, 381, 382, 383, 384, 0, 0, 385, 1254, 387, 388, 0, 0, 390, 391, 392, 1255, 1256, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 1257, 410, 1258, 412, 413, 414, 415, 1259, 416, 417, 0, 419, 1260, 1261, 421, 1262, 423, 424, 425, 0, 426, 427, 0, 0, 1263, 429, 430, 0, 0, 431, 432, 433, 434, 435, 436, 1264, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 1265, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 1266, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 484, 485, 486, 487, 488, 489, 1267, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 1268, 505, 506, 507, 508, 509, 0, 511, 512, 1269, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 1270, 529, 0, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 0, 539, 1271, 1272, 0, 0, 542, 543, 1273, 545, 1274, 1275, 547, 548, 549, 550, 551, 552, 553, 0, 1276, 554, 555, 556, 557, 558, 1277, 0, 559, 560, 561, 562, 563, 564, 1278, 0, 566, 567, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 1279, 1280, 1281, 1282, 584, 1283, 1284, 1285, 1286, 589, 590, 591, 592, 0, 0, 227, 0, 0, 0, 0, 1288, 1289, 0, 0, 0, 0, 0, 0, 0, 1291, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 1230, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 1233, 0, 1234, 0, 270, 271, 272, 273, 274, 275, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 285, 286, 287, 288, 1235, 1236, 1237, 1238, 1239, 1240, 1241, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 1246, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 337, 0, 338, 339, 340, 341, 342, 0, 343, 1249, 0, 345, 346, 347, 0, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 366, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 3575, 0, 385, 1254, 387, 388, 389, 0, 390, 391, 392, 1255, 1256, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 0, 416, 417, 418, 419, 0, 1261, 421, 422, 423, 424, 425, 0, 426, 427, 0, 812, 428, 429, 430, 0, 0, 431, 432, 433, 434, 435, 436, 1264, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 1265, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 3576, 492, 493, 494, 495, 496, 497, 498, 499, 41, 500, 501, 502, 503, 504, 1268, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 1270, 529, 0, 530, 531, 45, 532, 533, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 1273, 545, 1274, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 1277, 0, 559, 560, 561, 562, 563, 1149, 565, 0, 566, 567, 568, 569, 570, 571, 0, 0, 572, 0, 50, 573, 574, 575, 576, 577, 578, 579, 1279, 1280, 1281, 1282, 584, 1283, 1284, 1285, 1286, 3577, 590, 591, 592, 0, 0, 51, 227, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3578, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 1230, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 1233, 0, 1234, 0, 270, 271, 272, 273, 274, 275, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 285, 286, 287, 288, 1235, 1236, 1237, 1238, 1239, 1240, 1241, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 1246, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 337, 0, 338, 339, 340, 341, 342, 0, 343, 1249, 0, 345, 346, 347, 0, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 366, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 3575, 0, 385, 1254, 387, 388, 389, 0, 390, 391, 392, 1255, 1256, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 0, 416, 417, 418, 419, 0, 1261, 421, 422, 423, 424, 425, 0, 426, 427, 0, 812, 428, 429, 430, 0, 0, 431, 432, 433, 434, 435, 436, 1264, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 1265, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 3576, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 1268, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 1270, 529, 0, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 1273, 545, 1274, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 1277, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 1279, 1280, 1281, 1282, 584, 1283, 1284, 1285, 1286, 3577, 590, 591, 592, 0, 0, 227, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3578, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 1230, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 1233, 0, 1234, 0, 270, 271, 272, 273, 274, 275, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 285, 286, 287, 288, 1235, 1236, 1237, 1238, 1239, 1240, 1241, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 1246, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 337, 0, 338, 339, 340, 341, 342, 0, 343, 1249, 0, 345, 346, 347, 0, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 366, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 0, 0, 385, 1254, 387, 388, 389, 0, 390, 391, 392, 1255, 1256, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 0, 416, 417, 418, 419, 0, 1261, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 434, 435, 436, 1264, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 1265, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 3576, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 1268, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 1270, 529, 0, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 1273, 545, 1274, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 1277, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 1279, 1280, 1281, 1282, 584, 1283, 1284, 1285, 1286, 3577, 590, 591, 592, 0, 0, 227, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 52, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 1230, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 1233, 0, 1234, 0, 270, 271, 272, 273, 274, 275, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 285, 286, 287, 288, 1235, 1236, 1237, 1238, 1239, 1240, 1241, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 1246, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 337, 0, 338, 339, 340, 341, 342, 0, 343, 1249, 0, 345, 346, 347, 0, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 366, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 0, 0, 385, 1254, 387, 388, 389, 0, 390, 391, 392, 1255, 1256, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 0, 416, 417, 418, 419, 0, 1261, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 434, 435, 436, 1264, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 1265, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 1268, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 1270, 529, 0, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 1273, 545, 1274, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 1277, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 1279, 1280, 1281, 1282, 584, 1283, 1284, 1285, 1286, 589, 590, 591, 592, 0, 0, 227, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4178, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 1230, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 1233, 0, 1234, 0, 270, 271, 272, 273, 274, 275, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 285, 286, 287, 288, 1235, 1236, 1237, 1238, 1239, 1240, 1241, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 1246, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 337, 0, 338, 339, 340, 341, 342, 0, 343, 1249, 0, 345, 346, 347, 0, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 366, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 0, 0, 385, 1254, 387, 388, 389, 0, 390, 391, 392, 1255, 1256, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 0, 416, 417, 418, 419, 0, 1261, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 434, 435, 436, 1264, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 1265, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 1268, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 1270, 529, 0, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 1273, 545, 1274, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 1277, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 1279, 1280, 1281, 1282, 584, 1283, 1284, 1285, 1286, 589, 590, 591, 592, 0, 0, 867, 1502, 660, 0, 0, 0, 720, 0, 0, 0, 0, 0, 0, 0, 5265, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 269, 0, 270, 271, 272, 273, 274, 275, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 285, 286, 287, 288, 0, 0, 0, 289, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 1914, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 337, 0, 338, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 366, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 0, 0, 385, 386, 387, 388, 389, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 0, 416, 417, 418, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 1915, 0, 428, 429, 430, 0, 0, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 1916, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 0, 0, 867, 0, 0, 0, 0, 1503, 1504, 5078, 0, 0, 0, 0, 0, 0, 5079, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 3, 4, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 269, 0, 270, 271, 272, 273, 274, 275, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 285, 286, 287, 288, 0, 0, 0, 289, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 337, 0, 338, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 366, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 0, 0, 385, 386, 387, 388, 389, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 0, 416, 417, 418, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 41, 500, 501, 502, 503, 504, 0, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 45, 532, 533, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 1149, 565, 0, 566, 567, 568, 569, 570, 571, 0, 0, 572, 0, 50, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 0, 0, 51, 227, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 52, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 269, 0, 270, 271, 272, 273, 274, 275, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 285, 286, 287, 288, 0, 0, 0, 289, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 337, 0, 338, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 366, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 0, 0, 385, 386, 387, 388, 389, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 0, 416, 417, 418, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 0, 0, 600, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4861, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 0, 245, 246, 247, 248, 249, 0, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 0, 0, 270, 271, 272, 273, 274, 0, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 0, 286, 287, 288, 0, 0, 0, 0, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 0, 0, 0, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 352, 0, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 0, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 0, 0, 378, 0, 380, 381, 382, 383, 384, 0, 0, 385, 386, 0, 388, 0, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 0, 411, 412, 413, 414, 415, 0, 416, 417, 0, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 0, 435, 0, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 0, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 41, 500, 501, 502, 503, 504, 0, 505, 506, 507, 508, 509, 0, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 45, 532, 0, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 1149, 565, 0, 566, 0, 568, 569, 570, 571, 0, 0, 572, 0, 50, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 0, 0, 51, 600, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 52, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 0, 245, 246, 247, 248, 249, 0, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 0, 0, 270, 271, 272, 273, 274, 0, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 0, 286, 287, 288, 0, 0, 0, 0, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 0, 0, 0, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 352, 0, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 0, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 0, 0, 378, 0, 380, 381, 382, 383, 384, 0, 0, 385, 386, 0, 388, 0, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 0, 411, 412, 413, 414, 415, 0, 416, 417, 0, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 0, 435, 0, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 0, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 507, 508, 509, 0, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 0, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 0, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 0, 0, 600, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1349, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 0, 245, 246, 247, 248, 249, 0, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 0, 0, 270, 271, 272, 273, 274, 0, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 0, 286, 287, 288, 0, 0, 0, 0, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 0, 0, 0, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 352, 0, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 0, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 0, 0, 378, 0, 380, 381, 382, 383, 384, 0, 0, 385, 386, 0, 388, 0, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 0, 411, 412, 413, 414, 415, 0, 416, 417, 0, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 0, 435, 0, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 0, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 507, 508, 509, 0, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 0, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 0, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 0, 0, 600, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2921, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 0, 245, 246, 247, 248, 249, 0, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 0, 0, 270, 271, 272, 273, 274, 0, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 0, 286, 287, 288, 0, 0, 0, 0, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 0, 0, 0, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 352, 0, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 0, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 0, 0, 378, 0, 380, 381, 382, 383, 384, 0, 0, 385, 386, 0, 388, 0, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 0, 411, 412, 413, 414, 415, 0, 416, 417, 0, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 0, 435, 0, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 0, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 507, 508, 509, 0, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 0, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 0, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 0, 0, 600, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4094, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 0, 245, 246, 247, 248, 249, 0, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 0, 0, 270, 271, 272, 273, 274, 0, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 0, 286, 287, 288, 0, 0, 0, 0, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 0, 0, 0, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 352, 0, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 0, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 0, 0, 378, 0, 380, 381, 382, 383, 384, 0, 0, 385, 386, 0, 388, 0, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 0, 411, 412, 413, 414, 415, 0, 416, 417, 0, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 0, 435, 0, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 0, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 507, 508, 509, 0, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 0, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 0, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 0, 0, 0, 0, 0, 1062, 1502, 660, 0, 0, 881, 720, 0, 0, 0, 0, 4549, 882, 883, 884, 228, 229, 230, 231, 232, 233, 234, 235, 1632, 236, 237, 238, 1633, 1634, 1635, 1636, 1637, 1638, 1639, 239, 240, 1640, 241, 242, 243, 244, 245, 246, 247, 0, 1063, 250, 1064, 1065, 1641, 253, 254, 255, 256, 257, 258, 1642, 1643, 259, 260, 1066, 1067, 263, 1644, 264, 265, 266, 267, 0, 1645, 269, 1646, 270, 271, 272, 273, 274, 275, 276, 277, 278, 1647, 279, 280, 281, 282, 283, 284, 1648, 285, 286, 287, 288, 1649, 1650, 1651, 289, 1652, 1653, 1654, 290, 291, 292, 293, 294, 295, 1068, 1069, 298, 1655, 299, 1656, 300, 301, 302, 303, 304, 305, 1657, 306, 307, 308, 309, 1658, 1659, 310, 311, 1070, 313, 314, 1660, 315, 316, 317, 1661, 318, 319, 320, 1662, 321, 322, 323, 324, 0, 326, 327, 328, 0, 1663, 330, 1664, 331, 332, 1071, 334, 1665, 335, 1666, 336, 337, 1667, 338, 339, 340, 341, 342, 1668, 343, 0, 1669, 0, 346, 347, 1670, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 1671, 358, 359, 360, 361, 362, 363, 364, 1672, 365, 366, 0, 368, 369, 370, 371, 1073, 1074, 1673, 1075, 1674, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 1675, 1676, 385, 0, 387, 388, 389, 1677, 390, 391, 392, 1678, 1679, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 1076, 410, 1077, 412, 413, 414, 3848, 1680, 416, 417, 418, 419, 1681, 0, 421, 1078, 423, 424, 425, 1682, 426, 427, 1683, 1684, 3849, 429, 430, 1685, 1686, 431, 432, 0, 434, 435, 436, 0, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 1687, 447, 448, 0, 450, 0, 452, 453, 454, 1688, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 1079, 466, 467, 468, 469, 1689, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 1690, 482, 483, 484, 485, 486, 487, 488, 489, 0, 491, 492, 493, 494, 495, 496, 497, 498, 499, 1691, 500, 501, 502, 503, 504, 1692, 505, 506, 2170, 508, 509, 510, 511, 512, 1081, 514, 1693, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 0, 529, 1694, 530, 531, 1695, 532, 533, 534, 535, 536, 537, 538, 1696, 539, 1082, 1083, 1697, 1698, 542, 543, 0, 545, 0, 1699, 547, 548, 549, 550, 551, 552, 553, 1700, 1701, 554, 555, 556, 557, 558, 1702, 1703, 559, 560, 561, 562, 563, 0, 1084, 1704, 566, 567, 568, 569, 570, 571, 1705, 1706, 572, 1707, 1708, 573, 574, 575, 576, 577, 578, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 590, 591, 592, 0, 0, 0, 887, 888, 889, 0, 3850, 3851, 892, 893, 894, 895, 1062, 1502, 660, 0, 0, 881, 720, 0, 0, 0, 0, 0, 882, 883, 884, 228, 229, 230, 231, 232, 233, 234, 235, 1632, 236, 237, 238, 1633, 1634, 1635, 1636, 1637, 1638, 1639, 239, 240, 1640, 241, 242, 243, 244, 245, 246, 247, 0, 1063, 250, 1064, 1065, 1641, 253, 254, 255, 256, 257, 258, 1642, 1643, 259, 260, 1066, 1067, 263, 1644, 264, 265, 266, 267, 0, 1645, 269, 1646, 270, 271, 272, 273, 274, 275, 276, 277, 278, 1647, 279, 280, 281, 282, 283, 284, 1648, 285, 286, 287, 288, 1649, 1650, 1651, 289, 1652, 1653, 1654, 290, 291, 292, 293, 294, 295, 1068, 1069, 298, 1655, 299, 1656, 300, 301, 302, 303, 304, 305, 1657, 306, 307, 308, 309, 1658, 1659, 310, 311, 1070, 313, 314, 1660, 315, 316, 317, 1661, 318, 319, 320, 1662, 321, 322, 323, 324, 0, 326, 327, 328, 0, 1663, 330, 1664, 331, 332, 1071, 334, 1665, 335, 1666, 336, 337, 1667, 338, 339, 340, 341, 342, 1668, 343, 0, 1669, 0, 346, 347, 1670, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 1671, 358, 359, 360, 361, 362, 363, 364, 1672, 365, 366, 0, 368, 369, 370, 371, 1073, 1074, 1673, 1075, 1674, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 1675, 1676, 385, 0, 387, 388, 389, 1677, 390, 391, 392, 1678, 1679, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 1076, 410, 1077, 412, 413, 414, 4270, 1680, 416, 417, 418, 419, 1681, 0, 421, 1078, 423, 424, 425, 1682, 426, 427, 1683, 1684, 3849, 429, 430, 1685, 1686, 431, 432, 0, 434, 435, 436, 0, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 1687, 447, 448, 0, 450, 0, 452, 453, 454, 1688, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 1079, 466, 467, 468, 469, 1689, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 1690, 482, 483, 484, 485, 486, 487, 488, 489, 0, 491, 492, 493, 494, 495, 496, 497, 498, 499, 1691, 500, 501, 502, 503, 504, 1692, 505, 506, 2170, 508, 509, 510, 511, 512, 1081, 514, 1693, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 0, 529, 1694, 530, 531, 1695, 532, 533, 534, 535, 536, 537, 538, 1696, 539, 1082, 1083, 1697, 1698, 542, 543, 0, 545, 0, 1699, 547, 548, 549, 550, 551, 552, 553, 1700, 1701, 554, 555, 556, 557, 558, 1702, 1703, 559, 560, 561, 562, 563, 0, 1084, 1704, 566, 567, 568, 569, 570, 571, 1705, 1706, 572, 1707, 1708, 573, 574, 575, 576, 577, 578, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 590, 591, 592, 0, 600, 0, 887, 888, 889, 881, 3850, 3851, 892, 893, 894, 895, 882, 883, 884, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 0, 245, 246, 247, 248, 249, 0, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 885, 266, 267, 268, 0, 0, 0, 270, 271, 272, 273, 274, 0, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 0, 286, 287, 288, 0, 0, 0, 0, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 886, 0, 331, 332, 333, 334, 0, 335, 0, 336, 0, 0, 0, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 352, 0, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 0, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 0, 0, 378, 0, 380, 381, 382, 383, 384, 0, 0, 385, 386, 0, 388, 0, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 0, 411, 412, 413, 414, 415, 0, 416, 417, 0, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 0, 435, 0, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 0, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 507, 508, 509, 0, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 0, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 0, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 0, 600, 0, 887, 888, 889, 881, 890, 891, 892, 893, 894, 895, 882, 883, 884, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 0, 245, 246, 247, 248, 249, 0, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 1012, 266, 267, 268, 0, 0, 0, 270, 271, 272, 273, 274, 0, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 0, 286, 287, 288, 0, 0, 0, 0, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 1013, 0, 331, 332, 333, 334, 0, 335, 0, 336, 0, 0, 0, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 352, 0, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 0, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 0, 0, 378, 0, 380, 381, 382, 383, 384, 0, 0, 385, 386, 0, 388, 0, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 0, 411, 412, 413, 414, 415, 0, 416, 417, 0, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 0, 435, 0, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 0, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 507, 508, 509, 0, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 0, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 0, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 0, 600, 0, 887, 888, 889, 881, 890, 891, 892, 893, 894, 895, 882, 883, 884, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 0, 245, 246, 247, 248, 249, 0, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 1112, 266, 267, 268, 0, 0, 0, 270, 271, 272, 273, 274, 0, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 0, 286, 287, 288, 0, 0, 0, 0, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 1113, 0, 331, 332, 333, 334, 0, 335, 0, 336, 0, 0, 0, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 1114, 0, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 0, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 0, 0, 378, 0, 380, 381, 382, 383, 384, 0, 0, 385, 386, 0, 388, 0, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 0, 411, 412, 413, 414, 415, 0, 416, 417, 0, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 0, 435, 0, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 0, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 507, 508, 509, 0, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 0, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 0, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 0, 600, 0, 887, 888, 889, 881, 890, 891, 892, 893, 894, 895, 882, 883, 884, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 0, 245, 246, 247, 248, 249, 0, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 1731, 266, 267, 268, 0, 0, 0, 270, 271, 272, 273, 274, 0, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 0, 286, 287, 288, 0, 0, 0, 0, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 1732, 0, 331, 332, 333, 334, 0, 335, 0, 336, 0, 0, 0, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 352, 0, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 0, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 0, 0, 378, 0, 380, 381, 382, 383, 384, 0, 0, 385, 386, 0, 388, 0, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 0, 411, 412, 413, 414, 415, 0, 416, 417, 0, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 0, 435, 0, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 0, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 507, 508, 509, 0, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 0, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 0, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 0, 600, 0, 887, 888, 889, 881, 890, 891, 892, 893, 894, 895, 882, 883, 884, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 0, 245, 246, 247, 248, 249, 0, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 0, 0, 270, 271, 272, 273, 274, 0, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 0, 286, 287, 288, 0, 0, 0, 0, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 0, 0, 0, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 352, 0, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 0, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 0, 0, 378, 0, 380, 381, 382, 383, 384, 0, 0, 385, 386, 0, 388, 0, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 0, 411, 412, 413, 414, 415, 0, 416, 417, 0, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 0, 435, 0, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 0, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 507, 508, 509, 0, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 0, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 0, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 0, 600, 0, 887, 888, 889, 881, 890, 891, 892, 893, 894, 895, 882, 883, 884, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 0, 245, 246, 247, 248, 249, 0, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 2999, 266, 267, 268, 0, 0, 0, 270, 271, 272, 273, 274, 0, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 0, 286, 287, 288, 0, 0, 0, 0, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 3000, 0, 331, 332, 333, 334, 0, 335, 0, 336, 0, 0, 0, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 352, 0, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 0, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 0, 0, 378, 0, 380, 381, 382, 383, 384, 0, 0, 385, 386, 0, 388, 0, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 0, 411, 412, 413, 414, 415, 0, 416, 417, 0, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 0, 435, 0, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 0, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 507, 508, 509, 0, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 0, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 0, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 0, 600, 0, 887, 888, 889, 881, 890, 891, 892, 893, 894, 895, 882, 883, 884, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 0, 245, 246, 247, 248, 249, 0, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 0, 0, 270, 271, 272, 273, 274, 0, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 0, 286, 287, 288, 0, 0, 0, 0, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 0, 0, 0, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 352, 0, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 0, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 0, 0, 378, 0, 380, 381, 382, 383, 384, 0, 0, 385, 386, 0, 388, 0, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 0, 411, 412, 413, 414, 415, 0, 416, 417, 0, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 4838, 429, 430, 0, 0, 431, 432, 433, 0, 435, 0, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 0, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 507, 508, 509, 0, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 0, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 0, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 1631, 0, 0, 887, 888, 889, 0, 890, 891, 892, 893, 894, 895, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 1632, 236, 237, 238, 1633, 1634, 1635, 1636, 1637, 1638, 1639, 239, 240, 1640, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 1641, 253, 254, 255, 256, 257, 258, 1642, 1643, 259, 260, 261, 262, 263, 1644, 264, 265, 266, 267, 268, 1645, 269, 1646, 270, 271, 272, 273, 274, 275, 276, 277, 278, 1647, 279, 280, 281, 282, 283, 284, 1648, 285, 286, 287, 288, 1649, 1650, 1651, 289, 1652, 1653, 1654, 290, 291, 292, 293, 294, 295, 296, 297, 298, 1655, 299, 1656, 300, 301, 302, 303, 304, 305, 1657, 306, 307, 308, 309, 1658, 1659, 310, 311, 312, 313, 314, 1660, 315, 316, 317, 1661, 318, 319, 320, 1662, 321, 322, 323, 324, 325, 326, 327, 328, 329, 1663, 330, 1664, 331, 332, 333, 334, 1665, 335, 1666, 336, 337, 1667, 338, 339, 340, 341, 342, 1668, 343, 344, 1669, 345, 346, 347, 1670, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 1671, 358, 359, 360, 361, 362, 363, 364, 1672, 365, 366, 367, 368, 369, 370, 371, 372, 373, 1673, 374, 1674, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 1675, 1676, 385, 386, 387, 388, 389, 1677, 390, 391, 392, 1678, 1679, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 1680, 416, 417, 418, 419, 1681, 420, 421, 422, 423, 424, 425, 1682, 426, 427, 1683, 1684, 428, 429, 430, 1685, 1686, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 1687, 447, 448, 449, 450, 451, 452, 453, 454, 1688, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 1689, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 1690, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 1691, 500, 501, 502, 503, 504, 1692, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 1693, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 1694, 530, 531, 1695, 532, 533, 534, 535, 536, 537, 538, 1696, 539, 540, 541, 1697, 1698, 542, 543, 544, 545, 546, 1699, 547, 548, 549, 550, 551, 552, 553, 1700, 1701, 554, 555, 556, 557, 558, 1702, 1703, 559, 560, 561, 562, 563, 564, 565, 1704, 566, 567, 568, 569, 570, 571, 1705, 1706, 572, 1707, 1708, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 600, 0, 0, 0, 0, 0, 0, 0, 0, 1709, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 0, 245, 246, 247, 248, 249, 0, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 0, 0, 270, 271, 272, 273, 274, 0, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 0, 286, 287, 288, 0, 0, 0, 0, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 0, 0, 0, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 352, 0, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 0, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 0, 0, 378, 0, 380, 381, 382, 383, 384, 0, 0, 385, 386, 0, 388, 0, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 0, 411, 412, 413, 414, 415, 0, 416, 417, 0, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 0, 435, 0, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 0, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 507, 508, 509, 0, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 0, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 0, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 600, 0, 0, 0, 0, 0, 0, 0, 0, 817, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 0, 245, 246, 247, 248, 249, 0, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 0, 0, 270, 271, 272, 273, 274, 0, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 0, 286, 287, 288, 0, 0, 0, 0, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 0, 0, 0, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 352, 0, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 0, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 0, 0, 378, 0, 380, 381, 382, 383, 384, 0, 0, 385, 386, 0, 388, 0, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 0, 411, 412, 413, 414, 415, 0, 416, 417, 0, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 0, 435, 0, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 0, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 507, 508, 509, 0, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 0, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 0, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 1062, 0, 0, 0, 0, 0, 0, 0, 0, 5230, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 244, 245, 246, 247, 0, 1063, 250, 1064, 1065, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 1066, 1067, 263, 0, 264, 265, 266, 267, 0, 0, 269, 0, 270, 271, 272, 273, 274, 275, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 285, 286, 287, 288, 0, 0, 0, 289, 0, 0, 0, 290, 291, 292, 293, 294, 295, 1068, 1069, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 1070, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 0, 326, 327, 328, 0, 0, 330, 0, 331, 332, 1071, 334, 0, 335, 0, 336, 337, 0, 338, 339, 340, 341, 342, 0, 343, 0, 0, 0, 346, 347, 0, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 2166, 358, 359, 360, 361, 362, 363, 364, 0, 365, 366, 2167, 368, 369, 370, 371, 1073, 1074, 0, 1075, 0, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 0, 0, 385, 0, 387, 388, 389, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 1076, 410, 1077, 412, 413, 414, 0, 0, 416, 417, 418, 419, 0, 0, 421, 1078, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 2168, 431, 432, 2169, 434, 435, 436, 0, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 0, 450, 0, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 1079, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 484, 485, 486, 487, 488, 489, 0, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 2170, 508, 509, 510, 511, 512, 1081, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 0, 529, 0, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 0, 539, 1082, 1083, 0, 0, 542, 543, 0, 545, 0, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 0, 1084, 2171, 566, 567, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 3343, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 590, 591, 592, 0, 228, 229, 230, 231, 232, 233, 234, 235, 2172, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 244, 245, 246, 247, 0, 1063, 250, 1064, 1065, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 1066, 1067, 263, 0, 264, 265, 266, 267, 0, 0, 269, 0, 270, 271, 272, 273, 274, 275, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 285, 286, 287, 288, 0, 0, 0, 289, 0, 0, 0, 290, 291, 292, 293, 294, 295, 1068, 1069, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 1070, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 0, 326, 327, 328, 0, 0, 330, 0, 331, 332, 1071, 334, 0, 335, 0, 336, 337, 0, 338, 339, 340, 341, 342, 0, 343, 0, 0, 0, 346, 347, 0, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 2166, 358, 359, 360, 361, 362, 363, 364, 0, 365, 366, 2167, 368, 369, 370, 371, 1073, 1074, 0, 1075, 0, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 0, 0, 385, 0, 387, 388, 389, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 1076, 410, 1077, 412, 413, 414, 0, 0, 416, 417, 418, 419, 0, 0, 421, 1078, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 2168, 431, 432, 2169, 434, 435, 436, 0, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 0, 450, 0, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 1079, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 484, 485, 486, 487, 488, 489, 0, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 2170, 508, 509, 510, 511, 512, 1081, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 0, 529, 0, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 0, 539, 1082, 1083, 0, 0, 542, 543, 0, 545, 0, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 0, 1084, 2171, 566, 567, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 867, 1502, 660, 0, 0, 0, 720, 0, 0, 0, 0, 590, 591, 592, 0, 228, 229, 230, 231, 232, 233, 234, 235, 2172, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 269, 0, 270, 271, 272, 273, 274, 275, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 285, 286, 287, 288, 0, 0, 0, 289, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 2094, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 1914, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 337, 0, 338, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 366, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 0, 0, 385, 386, 387, 388, 389, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 0, 416, 417, 418, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 1915, 0, 428, 429, 430, 0, 0, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 1916, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 867, 1502, 660, 0, 0, 0, 720, 1503, 1504, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 269, 0, 270, 271, 272, 273, 274, 275, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 285, 286, 287, 288, 0, 0, 0, 289, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 2099, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 1914, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 337, 0, 338, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 366, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 0, 0, 385, 386, 387, 388, 389, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 0, 416, 417, 418, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 1915, 0, 428, 429, 430, 0, 0, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 1916, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 867, 1502, 660, 0, 0, 0, 720, 1503, 1504, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 269, 0, 270, 271, 272, 273, 274, 275, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 285, 286, 287, 288, 0, 0, 0, 289, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 1914, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 337, 0, 338, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 366, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 0, 0, 385, 386, 387, 388, 389, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 0, 416, 417, 418, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 1915, 0, 428, 429, 430, 0, 0, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 1916, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 867, 0, 660, 0, 0, 0, 720, 1503, 1504, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 269, 0, 270, 271, 272, 273, 274, 275, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 285, 286, 287, 288, 0, 0, 0, 289, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 2953, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 1914, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 337, 0, 338, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 366, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 0, 0, 385, 386, 387, 388, 389, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 0, 416, 417, 418, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 1915, 0, 428, 429, 430, 0, 0, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 1916, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 600, 0, 0, 0, 0, 0, 720, 732, 733, 0, 0, 0, 0, 0, 0, 228, 721, 230, 231, 232, 233, 234, 235, 722, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 0, 723, 246, 247, 248, 249, 0, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 0, 0, 270, 271, 272, 273, 274, 0, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 0, 286, 287, 288, 0, 0, 0, 0, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 724, 333, 334, 0, 335, 0, 725, 0, 726, 0, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 352, 0, 354, 355, 356, 357, 727, 358, 359, 360, 361, 362, 363, 364, 0, 365, 0, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 0, 0, 378, 0, 380, 381, 382, 383, 728, 0, 0, 385, 386, 0, 388, 0, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 0, 411, 412, 729, 414, 415, 0, 416, 417, 0, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 0, 435, 0, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 730, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 731, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 0, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 507, 508, 509, 0, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 0, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 0, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 1631, 5444, 660, 0, 0, 0, 720, 732, 733, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 1632, 236, 237, 238, 1633, 1634, 1635, 1636, 1637, 1638, 1639, 239, 240, 1640, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 1641, 253, 254, 255, 256, 257, 258, 1642, 1643, 259, 260, 261, 262, 263, 1644, 264, 265, 266, 267, 268, 1645, 269, 1646, 270, 271, 272, 273, 274, 275, 276, 277, 278, 1647, 279, 280, 281, 282, 283, 284, 1648, 285, 286, 287, 288, 1649, 1650, 1651, 289, 1652, 1653, 1654, 290, 291, 292, 293, 294, 295, 296, 297, 298, 1655, 299, 1656, 300, 301, 302, 303, 304, 305, 1657, 306, 307, 308, 309, 1658, 1659, 310, 311, 312, 313, 314, 1660, 315, 316, 317, 1661, 318, 319, 320, 1662, 321, 322, 323, 324, 325, 326, 327, 328, 329, 1663, 330, 1664, 331, 332, 333, 334, 1665, 335, 1666, 336, 337, 1667, 338, 339, 340, 341, 342, 1668, 343, 344, 1669, 345, 346, 347, 1670, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 1671, 358, 359, 360, 361, 362, 363, 364, 1672, 365, 366, 367, 368, 369, 370, 371, 372, 373, 1673, 374, 1674, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 1675, 1676, 385, 386, 387, 388, 389, 1677, 390, 391, 392, 1678, 1679, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 1680, 416, 417, 418, 419, 1681, 420, 421, 422, 423, 424, 425, 1682, 426, 427, 1683, 1684, 428, 429, 430, 1685, 1686, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 1687, 447, 448, 449, 450, 451, 452, 453, 454, 1688, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 1689, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 1690, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 1691, 500, 501, 502, 503, 504, 1692, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 1693, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 1694, 530, 531, 1695, 532, 533, 534, 535, 536, 537, 538, 1696, 539, 540, 541, 1697, 1698, 542, 543, 544, 545, 546, 1699, 547, 548, 549, 550, 551, 552, 553, 1700, 1701, 554, 555, 556, 557, 558, 1702, 1703, 559, 560, 561, 562, 563, 564, 565, 1704, 566, 567, 568, 569, 570, 571, 1705, 1706, 572, 1707, 1708, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 1631, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 1632, 236, 237, 238, 1633, 1634, 1635, 1636, 1637, 1638, 1639, 239, 240, 1640, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 1641, 253, 254, 255, 256, 257, 258, 1642, 1643, 259, 260, 261, 262, 263, 1644, 264, 265, 266, 267, 268, 1645, 269, 1646, 270, 271, 272, 273, 274, 275, 276, 277, 278, 1647, 279, 280, 281, 282, 283, 284, 1648, 285, 286, 287, 288, 1649, 1650, 1651, 289, 1652, 1653, 1654, 290, 291, 292, 293, 294, 295, 296, 297, 298, 1655, 299, 1656, 300, 301, 302, 303, 304, 305, 1657, 306, 307, 308, 309, 1658, 1659, 310, 311, 312, 313, 314, 1660, 315, 316, 317, 1661, 318, 319, 320, 1662, 321, 322, 323, 324, 325, 326, 327, 328, 329, 1663, 330, 1664, 331, 332, 333, 334, 1665, 335, 1666, 336, 337, 1667, 338, 339, 340, 341, 342, 1668, 343, 344, 1669, 345, 346, 347, 1670, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 1671, 358, 359, 360, 361, 362, 363, 364, 1672, 365, 366, 367, 368, 369, 370, 371, 372, 373, 1673, 374, 1674, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 1675, 1676, 385, 386, 387, 388, 389, 1677, 390, 391, 392, 1678, 1679, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 1680, 416, 417, 418, 419, 1681, 420, 421, 422, 423, 424, 425, 1682, 426, 427, 1683, 1684, 428, 429, 430, 1685, 1686, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 1687, 447, 448, 449, 450, 451, 452, 453, 454, 1688, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 1689, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 1690, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 1691, 500, 501, 502, 503, 504, 1692, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 1693, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 1694, 530, 531, 1695, 532, 533, 534, 535, 536, 537, 538, 1696, 539, 540, 541, 1697, 1698, 542, 543, 544, 545, 546, 1699, 547, 548, 549, 550, 551, 552, 553, 1700, 1701, 554, 555, 556, 557, 558, 1702, 1703, 559, 560, 561, 562, 563, 564, 565, 1704, 566, 567, 568, 569, 570, 571, 1705, 1706, 572, 1707, 1708, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 1631, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 3071, 233, 234, 235, 1632, 236, 237, 238, 1633, 1634, 1635, 1636, 1637, 1638, 1639, 239, 240, 1640, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 1641, 253, 254, 255, 256, 257, 258, 1642, 1643, 259, 260, 261, 262, 263, 1644, 264, 265, 266, 267, 268, 1645, 269, 1646, 270, 271, 272, 273, 274, 275, 276, 277, 278, 1647, 279, 280, 281, 282, 283, 284, 1648, 285, 286, 287, 288, 1649, 1650, 1651, 289, 1652, 1653, 1654, 290, 291, 292, 293, 294, 295, 296, 297, 298, 1655, 299, 1656, 300, 301, 302, 303, 304, 305, 1657, 306, 307, 308, 309, 1658, 1659, 310, 311, 312, 3072, 314, 1660, 315, 316, 317, 1661, 318, 319, 320, 1662, 321, 322, 323, 324, 325, 326, 327, 328, 329, 1663, 330, 1664, 331, 332, 333, 334, 1665, 335, 1666, 336, 337, 1667, 338, 339, 340, 341, 342, 1668, 343, 344, 1669, 345, 346, 347, 1670, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 1671, 358, 359, 360, 361, 362, 363, 364, 1672, 365, 366, 367, 368, 369, 370, 371, 372, 373, 1673, 374, 1674, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 1675, 1676, 385, 386, 387, 388, 389, 1677, 390, 391, 392, 1678, 1679, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 1680, 416, 417, 418, 419, 1681, 420, 421, 422, 423, 424, 425, 1682, 426, 427, 1683, 1684, 428, 429, 430, 1685, 1686, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 1687, 447, 448, 449, 450, 451, 452, 453, 454, 1688, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 1689, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 1690, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 1691, 500, 501, 502, 503, 504, 1692, 3073, 506, 507, 508, 509, 510, 511, 512, 513, 514, 1693, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 1694, 530, 531, 1695, 532, 533, 534, 535, 536, 537, 538, 1696, 539, 540, 541, 1697, 1698, 542, 543, 544, 545, 546, 1699, 547, 548, 549, 550, 551, 552, 553, 1700, 1701, 554, 555, 556, 557, 558, 1702, 1703, 559, 560, 561, 562, 563, 564, 565, 1704, 566, 567, 568, 569, 570, 571, 1705, 1706, 572, 1707, 1708, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 227, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 1230, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 1233, 0, 1234, 0, 270, 271, 272, 273, 274, 275, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 285, 286, 287, 288, 1235, 1236, 1237, 1238, 1239, 1240, 1241, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 1246, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 337, 0, 338, 339, 340, 341, 342, 0, 343, 1249, 0, 345, 346, 347, 0, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 366, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 0, 0, 385, 1254, 387, 388, 389, 0, 390, 391, 392, 1255, 1256, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 0, 416, 417, 418, 419, 0, 1261, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 434, 435, 436, 1264, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 1265, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 1268, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 1270, 529, 0, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 1273, 545, 1274, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 1277, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 1279, 1280, 1281, 1282, 584, 1283, 1284, 1285, 1286, 589, 590, 591, 592, 867, 0, 660, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 269, 0, 270, 271, 272, 273, 274, 275, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 285, 286, 287, 288, 0, 0, 0, 289, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 1914, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 337, 0, 338, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 366, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 0, 0, 385, 386, 387, 388, 389, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 0, 416, 417, 418, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 1915, 0, 428, 429, 430, 0, 0, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 1916, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 867, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 905, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 269, 0, 270, 271, 272, 273, 274, 275, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 285, 286, 287, 288, 0, 0, 0, 289, 0, 0, 868, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 337, 0, 338, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 366, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 0, 0, 385, 386, 387, 388, 389, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 0, 416, 417, 418, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 869, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 867, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 925, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 269, 0, 270, 271, 272, 273, 274, 275, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 285, 286, 287, 288, 0, 0, 0, 289, 0, 0, 868, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 337, 0, 338, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 366, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 0, 0, 385, 386, 387, 388, 389, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 926, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 0, 416, 417, 418, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 869, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 867, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 269, 0, 270, 271, 272, 273, 274, 275, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 285, 286, 287, 288, 0, 0, 0, 289, 0, 0, 868, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 337, 0, 338, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 366, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 0, 0, 385, 386, 387, 388, 389, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 0, 416, 417, 418, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 869, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 2431, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 867, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 269, 0, 270, 271, 272, 273, 274, 275, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 285, 286, 287, 288, 0, 0, 0, 289, 0, 0, 868, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 337, 0, 338, 339, 340, 341, 342, 0, 343, 344, 3421, 345, 346, 347, 0, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 366, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 0, 0, 385, 386, 387, 388, 389, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 0, 416, 417, 418, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 869, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 867, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 269, 0, 270, 271, 272, 273, 274, 275, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 285, 286, 287, 288, 0, 0, 0, 289, 0, 0, 868, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 337, 0, 338, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 366, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 0, 0, 385, 386, 387, 388, 389, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 0, 416, 417, 418, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 869, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 867, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 269, 0, 270, 271, 272, 273, 274, 275, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 285, 286, 287, 288, 0, 0, 0, 289, 0, 0, 868, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 337, 0, 338, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 366, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 0, 0, 385, 386, 387, 388, 389, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 1031, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 0, 416, 417, 418, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 869, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 867, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 269, 0, 270, 271, 272, 273, 274, 275, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 285, 286, 287, 288, 0, 0, 0, 289, 0, 0, 868, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 337, 0, 338, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 1107, 353, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 366, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 0, 0, 385, 386, 387, 388, 389, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 0, 416, 417, 418, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 869, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 867, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 269, 0, 270, 271, 272, 273, 274, 275, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 285, 286, 287, 288, 0, 0, 0, 289, 0, 0, 868, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 337, 0, 338, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 1120, 353, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 366, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 0, 0, 385, 386, 387, 388, 389, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 0, 416, 417, 418, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 869, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 867, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 269, 0, 270, 271, 272, 273, 274, 275, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 285, 286, 287, 288, 0, 0, 0, 289, 0, 0, 868, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 337, 0, 338, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 1132, 353, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 366, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 0, 0, 385, 386, 387, 388, 389, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 1133, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 0, 416, 417, 418, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 869, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 867, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 3, 4, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 269, 0, 270, 271, 272, 273, 274, 275, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 285, 286, 287, 288, 0, 0, 0, 289, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 337, 0, 338, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 366, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 0, 0, 385, 386, 387, 388, 389, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 0, 416, 417, 418, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 867, 0, 660, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 269, 0, 270, 271, 272, 273, 274, 275, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 285, 286, 287, 288, 0, 0, 0, 289, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 2079, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 337, 0, 338, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 366, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 0, 0, 385, 386, 387, 388, 389, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 0, 416, 417, 418, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 867, 0, 660, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 269, 0, 270, 271, 272, 273, 274, 275, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 285, 286, 287, 288, 0, 0, 0, 289, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 337, 0, 338, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 366, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 0, 0, 385, 386, 387, 388, 389, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 0, 416, 417, 418, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 867, 0, 660, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 269, 0, 270, 271, 272, 273, 274, 275, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 285, 286, 287, 288, 0, 0, 0, 289, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 337, 0, 338, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 1900, 353, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 366, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 0, 0, 385, 386, 387, 388, 389, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 0, 416, 417, 418, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 227, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 269, 0, 270, 271, 272, 273, 274, 275, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 285, 286, 287, 288, 0, 0, 0, 289, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 337, 0, 338, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 366, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 0, 0, 385, 386, 387, 388, 389, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 0, 416, 417, 418, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 227, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 269, 0, 270, 271, 272, 273, 274, 275, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 285, 286, 287, 288, 0, 0, 0, 289, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 337, 0, 338, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 1055, 353, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 366, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 0, 0, 385, 386, 387, 388, 389, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 0, 416, 417, 418, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 227, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 269, 0, 270, 271, 272, 273, 274, 275, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 285, 286, 287, 288, 0, 0, 0, 289, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 337, 0, 338, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 1104, 353, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 366, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 0, 0, 385, 386, 387, 388, 389, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 0, 416, 417, 418, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 227, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 269, 0, 270, 271, 272, 273, 274, 275, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 285, 286, 287, 288, 0, 0, 0, 289, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 337, 0, 338, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 1118, 353, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 366, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 0, 0, 385, 386, 387, 388, 389, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 0, 416, 417, 418, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 227, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 269, 0, 270, 271, 272, 273, 274, 275, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 285, 286, 287, 288, 0, 0, 0, 289, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 337, 0, 338, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 1122, 353, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 366, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 0, 0, 385, 386, 387, 388, 389, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 0, 416, 417, 418, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 867, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 269, 0, 270, 271, 272, 273, 274, 275, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 285, 286, 287, 288, 0, 0, 0, 289, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 337, 0, 338, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 366, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 0, 0, 385, 386, 387, 388, 389, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 0, 416, 417, 418, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 600, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 0, 245, 246, 247, 248, 249, 0, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 2206, 264, 265, 266, 267, 268, 0, 0, 2286, 270, 271, 272, 273, 274, 0, 276, 277, 278, 2207, 279, 280, 281, 282, 283, 284, 0, 0, 286, 287, 288, 0, 0, 0, 0, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 2287, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 2209, 336, 0, 0, 0, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 2288, 0, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 0, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 0, 0, 378, 0, 380, 381, 382, 383, 384, 0, 0, 385, 386, 0, 388, 0, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 0, 411, 412, 413, 414, 415, 0, 416, 417, 0, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 0, 435, 0, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 2210, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 0, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 507, 508, 509, 0, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 0, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 2211, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 0, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 600, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 0, 245, 246, 247, 248, 249, 0, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 2206, 264, 265, 266, 267, 268, 0, 0, 0, 270, 271, 272, 273, 274, 0, 276, 277, 278, 2207, 279, 280, 281, 282, 283, 284, 0, 0, 286, 287, 288, 0, 0, 0, 0, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 2287, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 2209, 336, 0, 0, 0, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 352, 0, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 0, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 0, 0, 378, 0, 380, 381, 382, 383, 384, 0, 0, 385, 386, 0, 388, 3277, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 0, 411, 412, 413, 414, 415, 0, 416, 417, 0, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 0, 435, 0, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 2210, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 0, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 507, 508, 509, 0, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 0, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 2211, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 0, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 600, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 780, 234, 235, 739, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 0, 245, 246, 247, 248, 249, 0, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 0, 0, 270, 271, 272, 273, 274, 0, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 740, 0, 286, 287, 288, 0, 0, 0, 0, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 0, 0, 0, 339, 340, 341, 342, 781, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 352, 0, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 0, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 0, 0, 378, 0, 380, 381, 382, 383, 384, 0, 0, 385, 386, 0, 388, 0, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 0, 411, 412, 413, 414, 415, 0, 416, 417, 0, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 0, 435, 0, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 741, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 0, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 742, 500, 501, 502, 503, 504, 0, 505, 506, 507, 508, 509, 0, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 0, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 0, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 600, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 739, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 0, 245, 246, 247, 248, 249, 0, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 0, 0, 270, 271, 272, 273, 274, 0, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 740, 0, 286, 287, 288, 0, 0, 0, 0, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 0, 0, 0, 339, 340, 341, 342, 2960, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 352, 0, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 0, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 0, 0, 378, 0, 380, 381, 382, 383, 384, 0, 0, 385, 386, 0, 388, 0, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 0, 411, 412, 413, 414, 415, 0, 416, 417, 0, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 0, 435, 0, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 741, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 0, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 742, 500, 501, 502, 503, 504, 0, 505, 506, 507, 508, 509, 0, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 0, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 0, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 600, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 0, 245, 246, 247, 248, 249, 0, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 2206, 264, 265, 266, 267, 268, 0, 0, 0, 270, 271, 272, 273, 274, 0, 276, 277, 278, 2207, 279, 280, 281, 282, 283, 284, 0, 0, 286, 287, 288, 0, 0, 0, 0, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 2287, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 2209, 336, 0, 0, 0, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 352, 0, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 0, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 0, 0, 378, 0, 380, 381, 382, 383, 384, 0, 0, 385, 386, 0, 388, 0, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 0, 411, 412, 413, 414, 415, 0, 416, 417, 0, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 0, 435, 0, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 2210, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 0, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 507, 508, 509, 0, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 0, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 2211, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 0, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 600, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 739, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 0, 245, 246, 247, 248, 249, 0, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 0, 0, 270, 271, 272, 273, 274, 0, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 740, 0, 286, 287, 288, 0, 0, 0, 0, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 0, 0, 0, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 352, 0, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 0, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 0, 0, 378, 0, 380, 381, 382, 383, 384, 0, 0, 385, 386, 0, 388, 0, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 0, 411, 412, 413, 414, 415, 0, 416, 417, 0, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 0, 435, 0, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 741, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 0, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 742, 500, 501, 502, 503, 504, 0, 505, 506, 507, 508, 509, 0, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 0, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 0, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 600, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 1941, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 0, 245, 246, 247, 248, 249, 0, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 0, 0, 270, 271, 272, 273, 274, 0, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 0, 286, 287, 288, 0, 0, 0, 0, 0, 0, 0, 290, 291, 292, 1942, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 1943, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 1944, 336, 0, 0, 0, 1945, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 352, 0, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 0, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 0, 0, 378, 0, 380, 381, 1946, 1947, 384, 0, 0, 385, 386, 0, 388, 0, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 0, 411, 412, 413, 414, 415, 0, 416, 417, 0, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 0, 435, 0, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 1948, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 0, 485, 486, 487, 1949, 489, 490, 491, 492, 493, 1950, 495, 496, 497, 498, 499, 0, 1951, 501, 502, 503, 504, 0, 505, 506, 507, 508, 509, 0, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 1952, 532, 0, 1953, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 1954, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 0, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 600, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 0, 245, 246, 247, 248, 249, 0, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 0, 0, 270, 271, 272, 273, 274, 0, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 740, 0, 286, 287, 288, 0, 0, 0, 0, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 0, 0, 0, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 352, 0, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 0, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 0, 0, 378, 0, 380, 381, 382, 383, 384, 0, 0, 385, 386, 0, 388, 0, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 0, 411, 412, 413, 414, 415, 0, 416, 417, 0, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 0, 435, 0, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 741, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 0, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 742, 500, 501, 502, 503, 504, 0, 505, 506, 507, 508, 509, 0, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 0, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 0, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 600, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 918, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 0, 245, 246, 247, 248, 249, 0, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 0, 0, 270, 271, 272, 273, 274, 0, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 0, 286, 287, 288, 0, 0, 0, 0, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 0, 0, 0, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 919, 0, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 0, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 0, 0, 378, 0, 380, 381, 382, 383, 384, 0, 0, 385, 386, 0, 388, 0, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 0, 411, 412, 413, 414, 415, 0, 416, 417, 0, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 812, 428, 429, 430, 0, 0, 431, 432, 433, 0, 435, 0, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 0, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 507, 508, 509, 0, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 0, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 0, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 600, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 3052, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 0, 245, 246, 247, 248, 249, 0, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 0, 0, 270, 271, 272, 273, 274, 0, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 0, 286, 287, 288, 0, 0, 0, 0, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 0, 0, 0, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 352, 0, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 0, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 0, 0, 378, 0, 380, 381, 382, 383, 384, 0, 0, 385, 386, 0, 388, 0, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 0, 411, 412, 413, 414, 415, 0, 416, 417, 0, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 0, 435, 0, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 0, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 507, 508, 509, 0, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 0, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 3053, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 0, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 600, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 3065, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 0, 245, 246, 247, 248, 249, 0, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 0, 0, 270, 271, 272, 273, 274, 0, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 0, 286, 287, 288, 0, 0, 0, 0, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 0, 0, 0, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 352, 0, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 0, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 0, 0, 378, 0, 380, 381, 382, 383, 384, 0, 0, 385, 386, 0, 388, 0, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 0, 411, 412, 413, 414, 415, 0, 416, 417, 0, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 0, 435, 0, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 0, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 507, 508, 509, 0, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 0, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 3066, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 0, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 600, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 601, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 0, 245, 246, 247, 248, 249, 0, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 0, 0, 270, 271, 272, 273, 274, 0, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 0, 286, 287, 288, 0, 0, 0, 0, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 0, 0, 0, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 352, 0, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 0, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 0, 0, 378, 0, 380, 381, 382, 383, 384, 0, 0, 385, 386, 0, 388, 0, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 0, 411, 412, 413, 414, 415, 0, 416, 417, 0, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 0, 435, 0, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 0, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 507, 508, 509, 0, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 0, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 0, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 600, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 651, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 0, 245, 246, 247, 248, 249, 0, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 0, 0, 270, 271, 272, 273, 274, 0, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 0, 286, 287, 288, 0, 0, 0, 0, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 0, 0, 0, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 352, 0, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 0, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 0, 0, 378, 0, 380, 381, 382, 383, 384, 0, 0, 385, 386, 0, 388, 0, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 0, 411, 412, 413, 414, 415, 0, 416, 417, 0, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 0, 435, 0, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 652, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 0, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 507, 508, 509, 0, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 0, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 0, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 600, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 772, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 0, 245, 246, 247, 248, 249, 0, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 0, 0, 270, 271, 272, 273, 274, 0, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 0, 286, 287, 288, 0, 0, 0, 0, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 0, 0, 0, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 352, 0, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 0, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 0, 0, 378, 0, 380, 381, 382, 383, 384, 0, 0, 385, 386, 0, 388, 0, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 0, 411, 412, 413, 414, 415, 0, 416, 417, 0, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 0, 435, 0, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 0, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 773, 0, 505, 506, 507, 508, 509, 0, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 0, 534, 535, 536, 537, 538, 0, 539, 774, 541, 0, 0, 775, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 0, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 600, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 806, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 0, 245, 246, 247, 248, 249, 0, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 0, 0, 270, 271, 272, 273, 274, 0, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 0, 286, 287, 288, 0, 0, 0, 0, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 0, 0, 0, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 352, 0, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 0, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 0, 0, 378, 0, 380, 381, 382, 383, 384, 0, 0, 385, 386, 0, 388, 0, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 0, 411, 412, 413, 414, 415, 0, 416, 417, 0, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 0, 435, 0, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 0, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 807, 0, 505, 506, 507, 508, 509, 0, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 0, 534, 535, 536, 537, 538, 0, 539, 808, 541, 0, 0, 809, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 0, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 600, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 0, 245, 246, 247, 248, 249, 0, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 0, 0, 270, 271, 272, 273, 274, 0, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 0, 286, 287, 288, 0, 0, 0, 0, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 0, 0, 0, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 352, 0, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 0, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 0, 0, 378, 0, 380, 381, 382, 383, 384, 0, 0, 385, 386, 0, 388, 0, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 0, 411, 412, 413, 414, 415, 0, 416, 417, 0, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 812, 428, 429, 430, 0, 0, 431, 432, 433, 0, 435, 0, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 0, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 507, 508, 509, 0, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 0, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 0, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 600, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 876, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 0, 245, 246, 247, 248, 249, 0, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 0, 0, 270, 271, 272, 273, 274, 0, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 0, 286, 287, 288, 0, 0, 0, 0, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 0, 0, 0, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 877, 0, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 0, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 0, 0, 378, 0, 380, 381, 382, 383, 384, 0, 0, 385, 386, 0, 388, 0, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 0, 411, 412, 413, 414, 415, 0, 416, 417, 0, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 0, 435, 0, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 0, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 507, 508, 509, 0, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 0, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 0, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 600, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 1047, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 0, 245, 246, 247, 248, 249, 0, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 0, 0, 270, 271, 272, 273, 274, 0, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 0, 286, 287, 288, 0, 0, 0, 0, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 0, 0, 0, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 352, 0, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 0, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 0, 0, 378, 0, 380, 381, 382, 383, 384, 0, 0, 385, 386, 0, 388, 0, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 0, 411, 412, 413, 414, 415, 0, 416, 417, 0, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 0, 435, 0, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 0, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 507, 508, 509, 0, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 0, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 0, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 600, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 772, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 0, 245, 246, 247, 248, 249, 0, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 0, 0, 270, 271, 272, 273, 274, 0, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 0, 286, 287, 288, 0, 0, 0, 0, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 0, 0, 0, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 352, 0, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 0, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 0, 0, 378, 0, 380, 381, 382, 383, 384, 0, 0, 385, 386, 0, 388, 0, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 0, 411, 412, 413, 414, 415, 0, 416, 417, 0, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 0, 435, 0, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 0, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 507, 508, 509, 0, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 0, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 0, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 600, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 1192, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 0, 245, 246, 247, 248, 249, 0, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 0, 0, 270, 271, 272, 273, 274, 0, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 0, 286, 287, 288, 0, 0, 0, 0, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 0, 0, 0, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 352, 0, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 0, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 0, 0, 378, 0, 380, 381, 382, 383, 384, 0, 0, 385, 386, 0, 388, 0, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 0, 411, 412, 413, 414, 415, 0, 416, 417, 0, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 0, 435, 0, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 0, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 507, 508, 509, 0, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 0, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 0, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 600, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 1324, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 0, 245, 246, 247, 248, 249, 0, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 0, 0, 270, 271, 272, 273, 274, 0, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 0, 286, 287, 288, 0, 0, 0, 0, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 0, 0, 0, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 352, 0, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 0, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 0, 0, 378, 0, 380, 381, 382, 383, 384, 0, 0, 385, 386, 0, 388, 0, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 0, 411, 412, 413, 414, 415, 0, 416, 417, 0, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 0, 435, 0, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 0, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 507, 508, 509, 0, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 0, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 0, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 600, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 1335, 245, 246, 247, 248, 249, 0, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 792, 260, 261, 262, 1336, 0, 264, 265, 266, 267, 268, 0, 0, 0, 270, 271, 272, 273, 274, 0, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 0, 286, 287, 288, 0, 0, 0, 0, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 0, 0, 0, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 352, 0, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 0, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 0, 0, 378, 0, 380, 381, 382, 383, 384, 0, 0, 385, 386, 0, 388, 0, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 795, 409, 0, 411, 412, 413, 414, 415, 0, 416, 417, 0, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 0, 435, 0, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 0, 796, 486, 487, 488, 489, 490, 491, 492, 493, 797, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 1328, 0, 505, 506, 507, 508, 509, 0, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 0, 534, 535, 536, 537, 538, 0, 539, 799, 541, 0, 0, 800, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 0, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 801, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 600, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 0, 245, 246, 247, 248, 249, 0, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 0, 0, 270, 271, 272, 273, 274, 0, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 0, 286, 287, 288, 0, 0, 0, 0, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 0, 0, 0, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 1447, 0, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 0, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 0, 0, 378, 0, 380, 381, 382, 383, 384, 0, 0, 385, 386, 0, 388, 0, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 0, 411, 412, 413, 414, 415, 0, 416, 417, 0, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 812, 428, 429, 430, 0, 0, 431, 432, 433, 0, 435, 0, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 0, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 507, 508, 509, 0, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 0, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 0, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 600, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 1507, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 0, 245, 246, 247, 248, 249, 0, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 0, 0, 270, 271, 272, 273, 274, 0, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 0, 286, 287, 288, 0, 0, 0, 0, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 0, 0, 0, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 1508, 0, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 0, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 0, 0, 378, 0, 380, 381, 382, 383, 384, 0, 0, 385, 386, 0, 388, 0, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 0, 411, 412, 413, 414, 415, 0, 416, 417, 0, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 0, 435, 0, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 0, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 507, 508, 509, 0, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 0, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 0, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 600, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 0, 245, 246, 247, 248, 249, 0, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 0, 0, 270, 271, 272, 273, 274, 0, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 0, 286, 287, 288, 0, 0, 0, 0, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 0, 0, 0, 339, 340, 341, 2850, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 352, 0, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 0, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 0, 0, 378, 0, 380, 381, 382, 383, 384, 0, 0, 385, 386, 0, 388, 0, 0, 390, 391, 2851, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 0, 411, 412, 413, 414, 415, 0, 416, 417, 0, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 0, 435, 0, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 0, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 507, 508, 509, 0, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 2852, 532, 0, 534, 2853, 536, 2854, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 2855, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 0, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 600, 0, 660, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 0, 245, 246, 247, 248, 249, 0, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 0, 0, 270, 271, 272, 273, 274, 0, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 0, 286, 287, 288, 0, 0, 0, 0, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 0, 0, 0, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 352, 0, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 0, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 0, 0, 378, 0, 380, 381, 382, 383, 384, 0, 0, 385, 386, 0, 388, 0, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 0, 411, 412, 413, 414, 415, 0, 416, 417, 0, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 0, 435, 0, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 0, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 507, 508, 509, 0, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 0, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 0, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 600, 0, 0, 0, 0, 0, 720, 0, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 0, 245, 246, 247, 248, 249, 0, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 0, 0, 270, 271, 272, 273, 274, 0, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 0, 286, 287, 288, 0, 0, 0, 0, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 0, 0, 0, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 352, 0, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 0, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 0, 0, 378, 0, 380, 381, 382, 383, 384, 0, 0, 385, 386, 0, 388, 0, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 0, 411, 412, 413, 414, 415, 0, 416, 417, 0, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 0, 435, 0, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 0, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 507, 508, 509, 0, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 0, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 0, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 600, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 4115, 0, 239, 240, 0, 241, 242, 243, 0, 245, 246, 247, 248, 249, 0, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 0, 0, 270, 271, 272, 273, 274, 0, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 0, 286, 287, 288, 0, 0, 0, 0, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 0, 0, 0, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 352, 0, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 0, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 0, 0, 378, 0, 380, 381, 382, 383, 384, 0, 0, 385, 386, 0, 388, 0, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 0, 411, 412, 413, 414, 415, 0, 416, 417, 0, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 0, 435, 0, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 0, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 507, 508, 509, 0, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 0, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 0, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 600, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 4129, 0, 239, 240, 0, 241, 242, 243, 0, 245, 246, 247, 248, 249, 0, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 0, 0, 270, 271, 272, 273, 274, 0, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 0, 286, 287, 288, 0, 0, 0, 0, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 0, 0, 0, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 352, 0, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 0, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 0, 0, 378, 0, 380, 381, 382, 383, 384, 0, 0, 385, 386, 0, 388, 0, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 0, 411, 412, 413, 414, 415, 0, 416, 417, 0, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 0, 435, 0, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 0, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 507, 508, 509, 0, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 0, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 0, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 600, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 0, 245, 246, 247, 248, 249, 0, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 0, 0, 270, 271, 272, 273, 274, 0, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 0, 286, 287, 288, 0, 0, 0, 0, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 0, 0, 0, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 352, 0, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 0, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 0, 0, 378, 0, 380, 381, 382, 383, 384, 0, 0, 385, 386, 0, 388, 0, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 0, 411, 412, 413, 414, 415, 0, 416, 417, 0, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 0, 435, 0, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 0, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 507, 508, 509, 0, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 0, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 0, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 600, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 0, 245, 246, 247, 248, 249, 0, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 0, 0, 270, 271, 272, 273, 274, 0, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 0, 286, 287, 288, 0, 0, 0, 0, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 0, 0, 0, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 352, 0, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 0, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 0, 0, 378, 0, 380, 381, 382, 383, 384, 0, 0, 385, 386, 0, 388, 0, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 0, 411, 412, 413, 414, 415, 0, 416, 417, 0, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 0, 435, 0, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 0, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 507, 508, 509, 0, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 0, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 758, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 0, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 600, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 0, 245, 246, 247, 248, 249, 0, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 0, 0, 270, 271, 272, 273, 274, 0, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 0, 286, 287, 288, 0, 0, 0, 0, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 0, 0, 0, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 352, 0, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 0, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 0, 0, 378, 0, 380, 381, 382, 383, 384, 0, 0, 385, 386, 0, 388, 0, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 0, 411, 412, 413, 414, 415, 0, 416, 417, 0, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 0, 435, 0, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 0, 485, 486, 487, 488, 489, 490, 491, 492, 770, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 507, 508, 509, 0, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 0, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 0, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 600, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 0, 245, 246, 247, 248, 249, 0, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 792, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 0, 0, 270, 271, 272, 273, 274, 0, 276, 277, 278, 0, 793, 280, 281, 282, 283, 284, 0, 0, 286, 287, 288, 0, 0, 0, 0, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 0, 0, 0, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 352, 0, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 0, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 0, 0, 378, 0, 380, 381, 382, 383, 384, 0, 0, 385, 386, 0, 388, 0, 0, 390, 391, 794, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 795, 409, 0, 411, 412, 413, 414, 415, 0, 416, 417, 0, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 0, 435, 0, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 0, 796, 486, 487, 488, 489, 490, 491, 492, 493, 797, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 798, 0, 505, 506, 507, 508, 509, 0, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 0, 534, 535, 536, 537, 538, 0, 539, 799, 541, 0, 0, 800, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 0, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 801, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 600, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 0, 245, 246, 247, 248, 249, 0, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 0, 0, 270, 271, 272, 273, 274, 0, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 0, 286, 287, 288, 0, 0, 0, 0, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 0, 0, 0, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 352, 0, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 0, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 0, 0, 378, 0, 380, 381, 382, 383, 384, 0, 0, 385, 386, 0, 388, 0, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 0, 411, 412, 413, 414, 415, 0, 416, 417, 0, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 0, 435, 0, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 823, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 0, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 507, 508, 509, 0, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 0, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 0, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 600, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 0, 245, 246, 247, 248, 249, 0, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 0, 0, 270, 271, 272, 273, 274, 0, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 0, 286, 287, 288, 0, 0, 0, 0, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 0, 0, 0, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 901, 0, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 0, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 0, 0, 378, 0, 380, 381, 382, 383, 384, 0, 0, 385, 386, 0, 388, 0, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 0, 411, 412, 413, 414, 415, 0, 416, 417, 0, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 0, 435, 0, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 0, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 507, 508, 509, 0, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 0, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 0, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 600, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 0, 245, 246, 247, 248, 249, 0, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 0, 0, 270, 271, 272, 273, 274, 0, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 0, 286, 287, 288, 0, 0, 0, 0, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 0, 0, 0, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 911, 0, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 0, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 0, 0, 378, 0, 380, 381, 382, 383, 384, 0, 0, 385, 386, 0, 388, 0, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 0, 411, 412, 413, 414, 415, 0, 416, 417, 0, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 0, 435, 0, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 0, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 507, 508, 509, 0, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 0, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 0, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 600, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 0, 245, 246, 247, 248, 249, 0, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 0, 0, 270, 271, 272, 273, 274, 0, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 0, 286, 287, 288, 0, 0, 0, 0, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 0, 0, 0, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 929, 0, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 0, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 0, 0, 378, 0, 380, 381, 382, 383, 384, 0, 0, 385, 386, 0, 388, 0, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 0, 411, 412, 413, 414, 415, 0, 416, 417, 0, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 0, 435, 0, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 0, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 507, 508, 509, 0, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 0, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 0, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 600, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 0, 245, 246, 247, 248, 249, 0, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 0, 0, 270, 271, 272, 273, 274, 0, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 0, 286, 287, 288, 0, 0, 0, 0, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 0, 0, 0, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 996, 0, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 0, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 0, 0, 378, 0, 380, 381, 382, 383, 384, 0, 0, 385, 386, 0, 388, 0, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 0, 411, 412, 413, 414, 415, 0, 416, 417, 0, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 0, 435, 0, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 0, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 507, 508, 509, 0, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 0, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 0, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 600, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 0, 245, 246, 247, 248, 249, 0, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 0, 0, 270, 271, 272, 273, 274, 0, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 0, 286, 287, 288, 0, 0, 0, 0, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 0, 0, 0, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 1002, 0, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 0, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 0, 0, 378, 0, 380, 381, 382, 383, 384, 0, 0, 385, 386, 0, 388, 0, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 0, 411, 412, 413, 414, 415, 0, 416, 417, 0, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 0, 435, 0, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 0, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 507, 508, 509, 0, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 0, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 0, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 600, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 0, 245, 246, 247, 248, 249, 0, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 0, 0, 270, 271, 272, 273, 274, 0, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 0, 286, 287, 288, 0, 0, 0, 0, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 0, 0, 0, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 1019, 0, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 0, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 0, 0, 378, 0, 380, 381, 382, 383, 384, 0, 0, 385, 386, 0, 388, 0, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 0, 411, 412, 413, 414, 415, 0, 416, 417, 0, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 0, 435, 0, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 0, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 507, 508, 509, 0, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 0, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 0, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 600, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 0, 245, 246, 247, 248, 249, 0, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 0, 0, 270, 271, 272, 273, 274, 0, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 0, 286, 287, 288, 0, 0, 0, 0, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 0, 0, 0, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 1022, 0, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 0, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 0, 0, 378, 0, 380, 381, 382, 383, 384, 0, 0, 385, 386, 0, 388, 0, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 0, 411, 412, 413, 414, 415, 0, 416, 417, 0, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 0, 435, 0, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 0, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 507, 508, 509, 0, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 0, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 0, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 600, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 0, 245, 246, 247, 248, 249, 0, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 0, 0, 270, 271, 272, 273, 274, 0, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 0, 286, 287, 288, 0, 0, 0, 0, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 0, 0, 0, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 1024, 0, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 0, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 0, 0, 378, 0, 380, 381, 382, 383, 384, 0, 0, 385, 386, 0, 388, 0, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 0, 411, 412, 413, 414, 415, 0, 416, 417, 0, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 0, 435, 0, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 0, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 507, 508, 509, 0, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 0, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 0, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 600, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 0, 245, 246, 247, 248, 249, 0, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 0, 0, 270, 271, 272, 273, 274, 0, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 0, 286, 287, 288, 0, 0, 0, 0, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 0, 0, 0, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 1060, 0, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 0, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 0, 0, 378, 0, 380, 381, 382, 383, 384, 0, 0, 385, 386, 0, 388, 0, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 0, 411, 412, 413, 414, 415, 0, 416, 417, 0, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 0, 435, 0, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 0, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 507, 508, 509, 0, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 0, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 0, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 600, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 0, 245, 246, 247, 248, 249, 0, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 0, 0, 270, 271, 272, 273, 274, 0, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 0, 286, 287, 288, 0, 0, 0, 0, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 0, 0, 0, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 1124, 0, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 0, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 0, 0, 378, 0, 380, 381, 382, 383, 384, 0, 0, 385, 386, 0, 388, 0, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 0, 411, 412, 413, 414, 415, 0, 416, 417, 0, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 0, 435, 0, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 0, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 507, 508, 509, 0, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 0, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 0, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 600, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 0, 245, 246, 247, 248, 249, 0, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 0, 0, 270, 271, 272, 273, 274, 0, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 0, 286, 287, 288, 0, 0, 0, 0, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 0, 0, 0, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 1126, 0, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 0, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 0, 0, 378, 0, 380, 381, 382, 383, 384, 0, 0, 385, 386, 0, 388, 0, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 0, 411, 412, 413, 414, 415, 0, 416, 417, 0, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 0, 435, 0, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 0, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 507, 508, 509, 0, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 0, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 0, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 600, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 0, 245, 246, 247, 248, 249, 0, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 0, 0, 270, 271, 272, 273, 274, 0, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 0, 286, 287, 288, 0, 0, 0, 0, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 0, 0, 0, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 1136, 0, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 0, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 0, 0, 378, 0, 380, 381, 382, 383, 384, 0, 0, 385, 386, 0, 388, 0, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 0, 411, 412, 413, 414, 415, 0, 416, 417, 0, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 0, 435, 0, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 0, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 507, 508, 509, 0, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 0, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 0, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 600, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 0, 245, 246, 247, 248, 249, 0, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 0, 0, 270, 271, 272, 273, 274, 0, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 0, 286, 287, 288, 0, 0, 0, 0, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 0, 0, 0, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 1139, 0, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 0, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 0, 0, 378, 0, 380, 381, 382, 383, 384, 0, 0, 385, 386, 0, 388, 0, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 0, 411, 412, 413, 414, 415, 0, 416, 417, 0, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 0, 435, 0, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 0, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 507, 508, 509, 0, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 0, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 0, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 600, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 0, 245, 246, 247, 248, 249, 0, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 0, 0, 270, 271, 272, 273, 274, 0, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 0, 286, 287, 288, 0, 0, 0, 0, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 0, 0, 0, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 1142, 0, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 0, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 0, 0, 378, 0, 380, 381, 382, 383, 384, 0, 0, 385, 386, 0, 388, 0, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 0, 411, 412, 413, 414, 415, 0, 416, 417, 0, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 0, 435, 0, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 0, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 507, 508, 509, 0, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 0, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 0, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 600, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 0, 245, 246, 247, 248, 249, 0, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 792, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 0, 0, 270, 271, 272, 273, 274, 0, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 0, 286, 287, 288, 0, 0, 0, 0, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 0, 0, 0, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 352, 0, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 0, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 0, 0, 378, 0, 380, 381, 382, 383, 384, 0, 0, 385, 386, 0, 388, 0, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 795, 409, 0, 411, 412, 413, 414, 415, 0, 416, 417, 0, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 0, 435, 0, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 0, 796, 486, 487, 488, 489, 490, 491, 492, 493, 797, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 1328, 0, 505, 506, 507, 508, 509, 0, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 0, 534, 535, 536, 537, 538, 0, 539, 799, 541, 0, 0, 800, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 0, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 801, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 600, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 0, 245, 246, 247, 248, 249, 0, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 0, 0, 270, 271, 272, 273, 274, 0, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 0, 286, 287, 288, 0, 0, 0, 0, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 0, 0, 0, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 1762, 0, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 0, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 0, 0, 378, 0, 380, 381, 382, 383, 384, 0, 0, 385, 386, 0, 388, 0, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 0, 411, 412, 413, 414, 415, 0, 416, 417, 0, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 0, 435, 0, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 0, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 507, 508, 509, 0, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 0, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 0, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 600, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 0, 245, 246, 247, 248, 249, 0, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 0, 0, 270, 271, 272, 273, 274, 0, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 0, 286, 287, 288, 0, 0, 0, 0, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 0, 0, 0, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 1800, 0, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 0, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 0, 0, 378, 0, 380, 381, 382, 383, 384, 0, 0, 385, 386, 0, 388, 0, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 0, 411, 412, 413, 414, 415, 0, 416, 417, 0, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 0, 435, 0, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 0, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 507, 508, 509, 0, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 0, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 0, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 600, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 0, 245, 246, 247, 248, 249, 0, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 0, 0, 270, 271, 272, 273, 274, 0, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 0, 286, 287, 288, 0, 0, 0, 0, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 0, 0, 0, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 1802, 0, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 0, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 0, 0, 378, 0, 380, 381, 382, 383, 384, 0, 0, 385, 386, 0, 388, 0, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 0, 411, 412, 413, 414, 415, 0, 416, 417, 0, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 0, 435, 0, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 0, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 507, 508, 509, 0, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 0, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 0, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 600, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 0, 245, 246, 247, 248, 249, 0, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 0, 0, 270, 271, 272, 273, 274, 0, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 0, 286, 287, 288, 0, 0, 0, 0, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 0, 0, 0, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 1872, 0, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 0, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 0, 0, 378, 0, 380, 381, 382, 383, 384, 0, 0, 385, 386, 0, 388, 0, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 0, 411, 412, 413, 414, 415, 0, 416, 417, 0, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 0, 435, 0, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 0, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 507, 508, 509, 0, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 0, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 0, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 600, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 0, 245, 246, 247, 248, 249, 0, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 0, 0, 270, 271, 272, 273, 274, 0, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 0, 286, 287, 288, 0, 0, 0, 0, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 0, 0, 0, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 1874, 0, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 0, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 0, 0, 378, 0, 380, 381, 382, 383, 384, 0, 0, 385, 386, 0, 388, 0, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 0, 411, 412, 413, 414, 415, 0, 416, 417, 0, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 0, 435, 0, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 0, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 507, 508, 509, 0, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 0, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 0, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 600, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 0, 245, 246, 247, 248, 249, 0, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 0, 0, 270, 271, 272, 273, 274, 0, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 0, 286, 287, 288, 0, 0, 0, 0, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 0, 0, 0, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 1876, 0, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 0, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 0, 0, 378, 0, 380, 381, 382, 383, 384, 0, 0, 385, 386, 0, 388, 0, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 0, 411, 412, 413, 414, 415, 0, 416, 417, 0, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 0, 435, 0, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 0, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 507, 508, 509, 0, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 0, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 0, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 600, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 0, 245, 246, 247, 248, 249, 0, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 0, 0, 270, 271, 272, 273, 274, 0, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 0, 286, 287, 288, 0, 0, 0, 0, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 0, 0, 0, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 352, 0, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 0, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 0, 0, 378, 0, 380, 381, 382, 383, 384, 0, 0, 385, 386, 0, 388, 0, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 0, 411, 412, 413, 414, 415, 0, 416, 417, 0, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 0, 435, 0, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 0, 485, 486, 487, 488, 489, 490, 491, 492, 1979, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 507, 508, 509, 0, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 0, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 0, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 600, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 2158, 0, 239, 240, 0, 241, 242, 243, 0, 245, 246, 247, 248, 249, 0, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 0, 0, 270, 271, 272, 273, 274, 0, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 0, 286, 287, 288, 0, 0, 0, 0, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 0, 0, 0, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 352, 0, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 0, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 0, 0, 378, 0, 380, 381, 382, 383, 384, 0, 0, 385, 386, 0, 388, 0, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 0, 411, 412, 413, 414, 415, 0, 416, 417, 0, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 0, 435, 0, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 0, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 0, 506, 507, 508, 509, 0, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 0, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 0, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 600, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 0, 245, 246, 247, 248, 249, 0, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 792, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 0, 0, 270, 271, 272, 273, 274, 0, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 0, 286, 287, 288, 0, 0, 0, 0, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 0, 0, 0, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 352, 0, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 0, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 0, 0, 378, 0, 380, 381, 382, 383, 384, 0, 0, 385, 386, 0, 388, 0, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 795, 409, 0, 411, 412, 413, 414, 415, 0, 416, 417, 0, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 0, 435, 0, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 0, 796, 486, 487, 488, 489, 490, 491, 492, 493, 797, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 1328, 0, 505, 506, 507, 508, 509, 0, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 0, 2193, 535, 536, 537, 538, 0, 539, 799, 541, 0, 0, 800, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 0, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 801, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 600, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 0, 245, 246, 247, 248, 249, 0, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 792, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 0, 0, 270, 271, 272, 273, 274, 0, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 0, 286, 287, 288, 0, 0, 0, 0, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 0, 0, 0, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 352, 0, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 0, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 0, 0, 378, 0, 380, 381, 382, 383, 384, 0, 0, 385, 386, 0, 388, 0, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 795, 409, 0, 411, 412, 413, 414, 415, 0, 416, 417, 0, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 0, 435, 0, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 0, 796, 486, 487, 488, 489, 490, 491, 492, 493, 2270, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 2271, 0, 505, 506, 507, 508, 509, 0, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 0, 534, 535, 536, 537, 538, 0, 539, 799, 541, 0, 0, 2272, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 0, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 801, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 600, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 0, 245, 246, 247, 248, 249, 0, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 792, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 0, 0, 270, 271, 272, 273, 274, 0, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 0, 286, 287, 288, 0, 0, 0, 0, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 0, 0, 0, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 352, 0, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 0, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 0, 0, 378, 0, 380, 381, 382, 383, 384, 0, 0, 385, 386, 0, 388, 0, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 795, 409, 0, 411, 412, 413, 414, 415, 0, 416, 417, 0, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 0, 435, 0, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 0, 796, 486, 487, 488, 489, 490, 491, 492, 493, 2349, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 2271, 0, 505, 506, 507, 508, 509, 0, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 0, 534, 535, 536, 537, 538, 0, 539, 799, 541, 0, 0, 2272, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 0, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 801, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 600, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 0, 245, 246, 247, 248, 249, 0, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 792, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 0, 0, 270, 271, 272, 273, 274, 0, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 0, 286, 287, 288, 0, 0, 0, 0, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 0, 0, 0, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 352, 0, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 0, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 0, 0, 378, 0, 380, 381, 382, 383, 384, 0, 0, 385, 386, 0, 388, 0, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 795, 409, 0, 411, 412, 413, 414, 415, 0, 416, 417, 0, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 0, 435, 0, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 0, 796, 486, 487, 488, 489, 490, 491, 492, 493, 2366, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 2271, 0, 505, 506, 507, 508, 509, 0, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 0, 534, 535, 536, 537, 538, 0, 539, 799, 541, 0, 0, 2272, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 0, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 801, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 600, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 0, 245, 246, 247, 248, 249, 0, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 0, 0, 270, 271, 272, 273, 274, 0, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 0, 286, 287, 288, 0, 0, 0, 0, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 0, 0, 0, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 2565, 0, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 0, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 0, 0, 378, 0, 380, 381, 382, 383, 384, 0, 0, 385, 386, 0, 388, 0, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 0, 411, 412, 413, 414, 415, 0, 416, 417, 0, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 0, 435, 0, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 0, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 507, 508, 509, 0, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 0, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 0, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 600, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 0, 245, 246, 247, 248, 249, 0, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 0, 0, 270, 271, 272, 273, 274, 0, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 0, 286, 287, 288, 0, 0, 0, 0, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 0, 0, 0, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 2569, 0, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 0, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 0, 0, 378, 0, 380, 381, 382, 383, 384, 0, 0, 385, 386, 0, 388, 0, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 0, 411, 412, 413, 414, 415, 0, 416, 417, 0, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 0, 435, 0, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 0, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 507, 508, 509, 0, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 0, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 0, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 600, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 0, 245, 246, 247, 248, 249, 0, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 0, 0, 270, 271, 272, 273, 274, 0, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 0, 286, 287, 288, 0, 0, 0, 0, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 0, 0, 0, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 2644, 0, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 0, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 0, 0, 378, 0, 380, 381, 382, 383, 384, 0, 0, 385, 386, 0, 388, 0, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 0, 411, 412, 413, 414, 415, 0, 416, 417, 0, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 0, 435, 0, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 0, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 507, 508, 509, 0, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 0, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 0, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 600, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 0, 245, 246, 247, 248, 249, 0, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 0, 0, 270, 271, 272, 273, 274, 0, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 0, 286, 287, 288, 0, 0, 0, 0, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 0, 0, 0, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 2971, 0, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 0, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 0, 0, 378, 0, 380, 381, 382, 383, 384, 0, 0, 385, 386, 0, 388, 0, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 0, 411, 412, 413, 414, 415, 0, 416, 417, 0, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 0, 435, 0, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 0, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 507, 508, 509, 0, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 0, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 0, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 600, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 0, 245, 246, 247, 248, 249, 0, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 792, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 0, 0, 270, 271, 272, 273, 274, 0, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 0, 286, 287, 288, 0, 0, 0, 0, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 0, 0, 0, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 352, 0, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 0, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 0, 0, 378, 0, 380, 381, 382, 383, 384, 0, 0, 385, 386, 0, 388, 0, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 795, 409, 0, 411, 412, 413, 414, 415, 0, 416, 417, 0, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 0, 435, 0, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 0, 796, 486, 487, 488, 489, 490, 491, 492, 493, 797, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 2271, 0, 505, 506, 507, 508, 509, 0, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 0, 534, 535, 536, 537, 538, 0, 539, 799, 541, 0, 0, 2272, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 0, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 801, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 600, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 0, 245, 246, 247, 248, 249, 0, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 0, 0, 270, 271, 272, 273, 274, 0, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 0, 286, 287, 288, 0, 0, 0, 0, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 0, 0, 0, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 3040, 0, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 0, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 0, 0, 378, 0, 380, 381, 382, 383, 384, 0, 0, 385, 386, 0, 388, 0, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 0, 411, 412, 413, 414, 415, 0, 416, 417, 0, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 0, 435, 0, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 0, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 507, 508, 509, 0, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 0, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 0, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 600, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 0, 245, 246, 247, 248, 249, 0, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 0, 0, 270, 271, 272, 273, 274, 0, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 0, 286, 287, 288, 0, 0, 0, 0, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 0, 0, 0, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 3055, 0, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 0, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 0, 0, 378, 0, 380, 381, 382, 383, 384, 0, 0, 385, 386, 0, 388, 0, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 0, 411, 412, 413, 414, 415, 0, 416, 417, 0, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 0, 435, 0, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 0, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 507, 508, 509, 0, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 0, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 0, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 600, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 0, 245, 246, 247, 248, 249, 0, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 0, 0, 270, 271, 272, 273, 274, 0, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 0, 286, 287, 288, 0, 0, 0, 0, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 0, 0, 0, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 3057, 0, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 0, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 0, 0, 378, 0, 380, 381, 382, 383, 384, 0, 0, 385, 386, 0, 388, 0, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 0, 411, 412, 413, 414, 415, 0, 416, 417, 0, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 0, 435, 0, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 0, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 507, 508, 509, 0, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 0, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 0, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 600, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 0, 245, 246, 247, 248, 249, 0, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 0, 0, 270, 271, 272, 273, 274, 0, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 0, 286, 287, 288, 0, 0, 0, 0, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 0, 0, 0, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 3199, 0, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 0, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 0, 0, 378, 0, 380, 381, 382, 383, 384, 0, 0, 385, 386, 0, 388, 0, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 0, 411, 412, 413, 414, 415, 0, 416, 417, 0, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 0, 435, 0, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 0, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 507, 508, 509, 0, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 0, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 0, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 600, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 0, 245, 246, 247, 248, 249, 0, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 0, 0, 270, 271, 272, 273, 274, 0, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 0, 286, 287, 288, 0, 0, 0, 0, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 3235, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 0, 0, 0, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 352, 0, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 0, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 0, 0, 378, 0, 380, 381, 382, 383, 384, 0, 0, 385, 386, 0, 388, 0, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 0, 411, 412, 413, 414, 415, 0, 416, 417, 0, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 0, 435, 0, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 0, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 507, 508, 509, 0, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 0, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 0, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 600, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 0, 245, 246, 247, 248, 249, 0, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 0, 0, 270, 271, 272, 273, 274, 0, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 0, 286, 287, 288, 0, 0, 0, 0, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 0, 0, 0, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 4390, 0, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 0, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 0, 0, 378, 0, 380, 381, 382, 383, 384, 0, 0, 385, 386, 0, 388, 0, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 0, 411, 412, 413, 414, 415, 0, 416, 417, 0, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 0, 435, 0, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 0, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 507, 508, 509, 0, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 0, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 0, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 1062, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 244, 245, 246, 247, 0, 1063, 250, 1064, 1065, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 1066, 1067, 263, 0, 264, 265, 266, 267, 0, 0, 269, 0, 270, 271, 272, 273, 274, 275, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 285, 286, 287, 288, 0, 0, 0, 289, 0, 0, 0, 290, 291, 292, 293, 294, 295, 1068, 1069, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 1070, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 0, 326, 327, 328, 0, 0, 330, 0, 331, 332, 1071, 334, 0, 335, 0, 336, 337, 0, 338, 339, 340, 341, 342, 0, 343, 0, 0, 0, 346, 347, 0, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 2166, 358, 359, 360, 361, 362, 363, 364, 0, 365, 366, 2167, 368, 369, 370, 371, 1073, 1074, 0, 1075, 0, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 0, 0, 385, 0, 387, 388, 389, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 1076, 410, 1077, 412, 413, 414, 0, 0, 416, 417, 418, 419, 0, 0, 421, 1078, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 2169, 434, 435, 436, 0, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 0, 450, 0, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 1079, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 484, 485, 486, 487, 488, 489, 0, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 2170, 508, 509, 510, 511, 512, 1081, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 0, 529, 0, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 0, 539, 1082, 1083, 0, 0, 542, 543, 0, 545, 0, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 0, 1084, 2171, 566, 567, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 600, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 590, 591, 592, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 0, 245, 246, 247, 248, 249, 0, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 0, 0, 270, 271, 272, 273, 274, 0, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 0, 286, 287, 288, 0, 0, 0, 0, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 0, 0, 0, 339, 340, 341, 342, 0, 343, 344, 0, 345, 0, 347, 0, 348, 349, 350, 351, 352, 0, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 0, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 0, 0, 378, 0, 380, 381, 382, 383, 384, 0, 0, 385, 386, 0, 388, 0, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 0, 411, 412, 413, 414, 415, 0, 416, 417, 0, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 0, 435, 0, 437, 438, 439, 440, 441, 442, 443, 0, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 0, 485, 486, 487, 488, 489, 490, 0, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 507, 508, 509, 0, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 0, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 0, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 1062, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 244, 245, 246, 247, 0, 1063, 250, 1064, 1065, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 1066, 1067, 263, 0, 264, 265, 266, 267, 0, 0, 269, 0, 270, 271, 272, 273, 274, 275, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 285, 286, 287, 288, 0, 0, 0, 289, 0, 0, 0, 290, 291, 292, 293, 294, 295, 1068, 1069, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 1070, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 0, 326, 327, 328, 0, 0, 330, 0, 331, 332, 1071, 334, 0, 335, 0, 336, 337, 0, 338, 339, 340, 341, 342, 0, 343, 0, 0, 0, 346, 347, 0, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 366, 0, 368, 369, 370, 371, 1073, 1074, 0, 1075, 0, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 0, 0, 385, 0, 387, 388, 389, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 1076, 410, 1077, 412, 413, 414, 0, 0, 416, 417, 418, 419, 2266, 0, 421, 1078, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 0, 434, 435, 436, 0, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 0, 450, 0, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 1079, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 484, 485, 486, 487, 488, 489, 0, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 2170, 508, 509, 510, 511, 512, 1081, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 0, 529, 0, 530, 531, 3949, 532, 533, 534, 535, 536, 537, 538, 0, 539, 1082, 1083, 0, 0, 542, 543, 0, 545, 0, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 0, 1084, 0, 566, 567, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 1062, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 590, 591, 592, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 244, 245, 246, 247, 0, 1063, 250, 1064, 1065, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 1066, 1067, 263, 0, 264, 265, 266, 267, 0, 0, 269, 0, 270, 271, 272, 273, 274, 275, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 285, 286, 287, 288, 0, 0, 0, 289, 0, 0, 0, 290, 291, 292, 293, 294, 295, 1068, 1069, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 1070, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 0, 326, 327, 328, 0, 0, 330, 0, 331, 332, 1071, 334, 0, 335, 0, 336, 337, 0, 338, 339, 340, 341, 342, 0, 343, 0, 0, 0, 346, 347, 0, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 366, 0, 368, 369, 370, 371, 1073, 1074, 0, 1075, 0, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 0, 0, 385, 0, 387, 388, 389, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 1076, 410, 1077, 412, 413, 414, 2338, 0, 416, 417, 418, 419, 0, 0, 421, 1078, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 0, 434, 435, 436, 0, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 0, 450, 0, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 1079, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 484, 485, 486, 487, 488, 489, 0, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 1080, 508, 509, 510, 511, 512, 1081, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 0, 529, 0, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 0, 539, 1082, 1083, 0, 0, 542, 543, 0, 545, 0, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 0, 1084, 0, 566, 567, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 1062, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 590, 591, 592, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 244, 245, 246, 247, 0, 1063, 250, 1064, 1065, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 1066, 1067, 263, 0, 264, 265, 266, 267, 0, 0, 269, 0, 270, 271, 272, 273, 274, 275, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 285, 286, 287, 288, 0, 0, 0, 289, 0, 0, 0, 290, 291, 292, 293, 294, 295, 1068, 1069, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 1070, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 0, 326, 327, 328, 0, 0, 330, 0, 331, 332, 1071, 334, 0, 335, 0, 336, 337, 0, 338, 339, 340, 341, 342, 0, 343, 0, 0, 0, 346, 347, 0, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 366, 0, 368, 369, 370, 371, 1073, 1074, 0, 1075, 0, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 0, 0, 385, 0, 387, 388, 389, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 1076, 410, 1077, 412, 413, 414, 3757, 0, 416, 417, 418, 419, 0, 0, 421, 1078, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 0, 434, 435, 436, 0, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 0, 450, 0, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 1079, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 484, 485, 486, 487, 488, 489, 0, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 1080, 508, 509, 510, 511, 512, 1081, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 0, 529, 0, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 0, 539, 1082, 1083, 0, 0, 542, 543, 0, 545, 0, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 0, 1084, 0, 566, 567, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 1062, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 590, 591, 592, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 244, 245, 246, 247, 0, 1063, 250, 1064, 1065, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 1066, 1067, 263, 0, 264, 265, 266, 267, 0, 0, 269, 0, 270, 271, 272, 273, 274, 275, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 285, 286, 287, 288, 0, 0, 0, 289, 0, 0, 0, 290, 291, 292, 293, 294, 295, 1068, 1069, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 1070, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 0, 326, 327, 328, 0, 0, 330, 0, 331, 332, 1071, 334, 5298, 335, 0, 336, 337, 0, 338, 339, 340, 341, 342, 0, 343, 0, 0, 0, 346, 347, 0, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 366, 0, 368, 369, 370, 371, 1073, 1074, 0, 1075, 0, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 0, 0, 385, 0, 387, 388, 389, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 1076, 410, 1077, 412, 413, 414, 0, 0, 416, 417, 418, 419, 0, 0, 421, 1078, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 0, 434, 435, 436, 0, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 0, 450, 0, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 1079, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 484, 485, 486, 487, 488, 489, 0, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 1080, 508, 509, 510, 511, 512, 1081, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 0, 529, 0, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 0, 539, 1082, 1083, 0, 0, 542, 543, 0, 545, 0, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 0, 1084, 0, 566, 567, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 1062, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 590, 591, 592, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 244, 245, 246, 247, 0, 1063, 250, 1064, 1065, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 1066, 1067, 263, 0, 264, 265, 266, 267, 0, 0, 269, 0, 270, 271, 272, 273, 274, 275, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 285, 286, 287, 288, 0, 0, 0, 289, 0, 0, 0, 290, 291, 292, 293, 294, 295, 1068, 1069, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 1070, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 0, 326, 327, 328, 0, 0, 330, 0, 331, 332, 1071, 334, 0, 335, 0, 336, 337, 0, 338, 339, 340, 341, 342, 0, 343, 0, 0, 0, 346, 347, 0, 348, 349, 350, 351, 1072, 353, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 366, 0, 368, 369, 370, 371, 1073, 1074, 0, 1075, 0, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 0, 0, 385, 0, 387, 388, 389, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 1076, 410, 1077, 412, 413, 414, 0, 0, 416, 417, 418, 419, 0, 0, 421, 1078, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 0, 434, 435, 436, 0, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 0, 450, 0, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 1079, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 484, 485, 486, 487, 488, 489, 0, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 1080, 508, 509, 510, 511, 512, 1081, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 0, 529, 0, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 0, 539, 1082, 1083, 0, 0, 542, 543, 0, 545, 0, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 0, 1084, 0, 566, 567, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 1062, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 590, 591, 592, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 244, 245, 246, 247, 0, 1063, 250, 1064, 1065, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 1066, 1067, 263, 0, 264, 265, 266, 267, 0, 0, 269, 0, 270, 271, 272, 273, 274, 275, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 285, 286, 287, 288, 0, 0, 0, 289, 0, 0, 0, 290, 291, 292, 293, 294, 295, 1068, 1069, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 1070, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 0, 326, 327, 328, 0, 0, 330, 0, 331, 332, 1071, 334, 0, 335, 0, 336, 337, 0, 338, 339, 340, 341, 342, 0, 343, 0, 0, 0, 346, 347, 0, 348, 349, 350, 351, 1130, 353, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 366, 0, 368, 369, 370, 371, 1073, 1074, 0, 1075, 0, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 0, 0, 385, 0, 387, 388, 389, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 1076, 410, 1077, 412, 413, 414, 0, 0, 416, 417, 418, 419, 0, 0, 421, 1078, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 0, 434, 435, 436, 0, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 0, 450, 0, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 1079, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 484, 485, 486, 487, 488, 489, 0, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 1080, 508, 509, 510, 511, 512, 1081, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 0, 529, 0, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 0, 539, 1082, 1083, 0, 0, 542, 543, 0, 545, 0, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 0, 1084, 0, 566, 567, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 1062, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 590, 591, 592, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 244, 245, 246, 247, 0, 1063, 250, 1064, 1065, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 1066, 1067, 263, 0, 264, 265, 266, 267, 0, 0, 269, 0, 270, 271, 272, 273, 274, 275, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 285, 286, 287, 288, 0, 0, 0, 289, 0, 0, 0, 290, 291, 292, 293, 294, 295, 1068, 1069, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 1070, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 0, 326, 327, 328, 0, 0, 330, 0, 331, 332, 1071, 334, 0, 335, 0, 336, 337, 0, 338, 339, 340, 341, 342, 0, 343, 0, 0, 0, 346, 347, 0, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 366, 0, 368, 369, 370, 371, 1073, 1074, 0, 1075, 0, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 0, 0, 385, 0, 387, 388, 389, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 1076, 410, 1077, 412, 413, 414, 0, 0, 416, 417, 418, 419, 0, 0, 421, 1078, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 0, 434, 435, 436, 0, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 0, 450, 0, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 1079, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 484, 485, 486, 487, 488, 489, 0, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 1080, 508, 509, 510, 511, 512, 1081, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 0, 529, 0, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 0, 539, 1082, 1083, 0, 0, 542, 543, 0, 545, 0, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 0, 1084, 0, 566, 567, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 1062, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 590, 591, 592, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 244, 245, 246, 247, 0, 1063, 250, 1064, 1065, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 1066, 1067, 263, 0, 264, 265, 266, 267, 0, 0, 269, 0, 270, 271, 272, 273, 274, 275, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 285, 286, 287, 288, 0, 0, 0, 289, 0, 0, 0, 290, 291, 292, 293, 294, 295, 1068, 1069, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 1070, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 0, 326, 327, 328, 0, 0, 330, 0, 331, 332, 1071, 334, 0, 335, 0, 336, 337, 0, 338, 339, 340, 341, 342, 0, 343, 0, 0, 0, 346, 347, 0, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 366, 0, 368, 369, 370, 371, 1073, 1074, 0, 1075, 0, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 0, 0, 385, 0, 387, 388, 389, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 1076, 410, 1077, 412, 413, 414, 0, 0, 416, 417, 418, 419, 0, 0, 421, 1078, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 0, 434, 435, 436, 0, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 0, 450, 0, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 1079, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 484, 485, 486, 487, 488, 489, 0, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 2170, 508, 509, 510, 511, 512, 1081, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 0, 529, 0, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 0, 539, 1082, 1083, 0, 0, 542, 543, 0, 545, 0, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 0, 1084, 0, 566, 567, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 1062, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 590, 591, 592, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 244, 245, 246, 247, 0, 1063, 250, 1064, 1065, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 1066, 1067, 263, 0, 264, 265, 266, 267, 0, 0, 269, 0, 270, 271, 272, 273, 274, 275, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 285, 286, 287, 288, 0, 0, 0, 289, 0, 0, 0, 290, 291, 292, 293, 294, 295, 1068, 1069, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 1070, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 0, 326, 327, 328, 0, 0, 330, 0, 331, 332, 1071, 334, 0, 335, 0, 336, 337, 0, 338, 339, 340, 341, 342, 0, 343, 0, 0, 0, 346, 347, 0, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 366, 0, 368, 369, 370, 371, 1073, 1074, 0, 1075, 0, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 0, 0, 385, 0, 387, 388, 389, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 1076, 410, 1077, 412, 413, 414, 0, 0, 416, 417, 418, 419, 0, 0, 421, 1078, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 0, 434, 435, 436, 0, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 0, 450, 0, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 1079, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 484, 485, 486, 487, 488, 489, 0, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 0, 508, 509, 510, 511, 512, 1081, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 0, 529, 0, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 0, 539, 1082, 1083, 0, 0, 542, 543, 0, 545, 0, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 0, 1084, 0, 566, 567, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 1062, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 590, 591, 592, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 244, 245, 246, 247, 0, 0, 250, 0, 0, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 0, 0, 263, 0, 264, 265, 266, 267, 0, 0, 269, 0, 270, 271, 272, 273, 274, 275, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 285, 286, 287, 288, 0, 0, 0, 289, 0, 0, 0, 290, 291, 292, 293, 294, 295, 0, 0, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 0, 326, 327, 328, 0, 0, 330, 0, 331, 332, 0, 334, 0, 335, 0, 336, 337, 0, 338, 339, 340, 341, 342, 0, 343, 0, 0, 0, 346, 347, 0, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 366, 0, 368, 369, 370, 371, 0, 0, 0, 0, 0, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 0, 0, 385, 0, 387, 388, 389, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 0, 410, 0, 412, 413, 414, 0, 0, 416, 417, 418, 419, 0, 0, 421, 0, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 0, 434, 435, 436, 0, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 0, 450, 0, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 0, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 484, 485, 486, 487, 488, 489, 0, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 0, 508, 509, 510, 511, 512, 0, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 0, 529, 0, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 0, 539, 0, 0, 0, 0, 542, 543, 0, 545, 0, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 0, 0, 0, 566, 567, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 4962, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 590, 591, 592, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 0, 0, 263, 0, 264, 265, 266, 267, 0, 0, 0, 0, 270, 271, 272, 273, 274, 0, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 0, 286, 287, 288, 0, 0, 0, 0, 0, 0, 0, 290, 291, 292, 293, 294, 295, 0, 0, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 0, 326, 327, 328, 0, 0, 330, 0, 331, 332, 0, 334, 0, 335, 0, 336, 0, 0, 0, 339, 340, 341, 342, 0, 343, 0, 0, 0, 346, 347, 0, 348, 349, 350, 351, 352, 0, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 0, 0, 368, 369, 370, 371, 0, 0, 0, 0, 0, 375, 0, 0, 378, 0, 380, 381, 382, 383, 384, 0, 0, 385, 0, 0, 388, 0, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 0, 0, 0, 412, 413, 414, 0, 0, 416, 417, 0, 419, 0, 0, 421, 0, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 0, 0, 435, 0, 0, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 0, 450, 0, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 0, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 0, 485, 486, 487, 488, 489, 0, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 0, 508, 509, 0, 511, 512, 0, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 0, 529, 0, 530, 531, 0, 532, 0, 534, 535, 536, 537, 538, 0, 539, 0, 0, 0, 0, 542, 543, 0, 545, 0, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 0, 0, 0, 566, 0, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 590, 591, 592 }; static const yytype_int16 yycheck[] = { 6, 204, 0, 52, 204, 912, 0, 45, 37, 661, 1153, 628, 0, 1110, 199, 182, 0, 23, 842, 25, 0, 791, 207, 29, 1080, 210, 793, 21, 928, 35, 36, 37, 1433, 39, 943, 853, 42, 43, 815, 45, 1559, 47, 939, 740, 741, 742, 937, 2505, 913, 746, 1478, 2862, 13, 22, 190, 1495, 708, 1175, 6, 28, 2703, 2577, 1083, 2399, 46, 816, 1212, 1025, 209, 2174, 2175, 1717, 3309, 1796, 800, 1068, 1069, 1478, 2912, 23, 1966, 2518, 223, 1471, 3649, 1078, 619, 3017, 865, 3044, 684, 3604, 3071, 37, 3073, 3356, 18, 2420, 3359, 999, 8, 1985, 1484, 1003, 698, 2337, 2679, 15, 1008, 3549, 707, 3701, 0, 1621, 2921, 769, 4183, 3578, 1018, 3645, 3882, 697, 3328, 169, 3274, 3938, 3921, 3737, 3263, 184, 879, 671, 1032, 21, 2073, 702, 682, 670, 3339, 685, 2886, 3584, 3926, 4533, 796, 36, 0, 661, 1588, 1589, 4585, 2029, 43, 4420, 0, 0, 2794, 697, 0, 0, 0, 1462, 1808, 3925, 1410, 184, 4428, 51, 820, 946, 0, 0, 0, 0, 1014, 1898, 42, 2106, 2138, 4605, 218, 833, 0, 4371, 190, 191, 192, 193, 2117, 195, 1030, 0, 3326, 199, 2931, 201, 2140, 4690, 204, 3625, 1582, 207, 912, 3512, 210, 0, 839, 213, 4731, 215, 920, 4549, 218, 4551, 1357, 863, 222, 839, 224, 4645, 930, 1522, 5, 4743, 5, 11, 4965, 0, 35, 4684, 941, 4419, 13, 14, 5, 9, 0, 0, 1539, 49, 0, 4059, 4939, 3583, 57, 3585, 5, 5, 79, 1242, 1243, 1272, 87, 5, 42, 903, 145, 5, 57, 29, 908, 2006, 5, 163, 42, 5, 1066, 1067, 5, 1262, 13, 14, 5, 13, 14, 5, 2508, 1077, 4, 11, 57, 1099, 796, 9, 26, 5, 0, 2925, 57, 5, 39, 4842, 4843, 158, 5, 992, 112, 1619, 1620, 180, 138, 1425, 163, 106, 119, 32, 74, 21, 40, 145, 114, 5, 9, 0, 170, 5, 84, 39, 105, 5, 163, 4676, 9, 5, 5, 3019, 163, 0, 309, 3939, 144, 163, 114, 289, 4652, 4653, 9, 163, 52, 26, 72, 270, 269, 144, 187, 4007, 4008, 264, 4010, 4011, 4012, 4013, 4014, 26, 112, 29, 213, 269, 264, 756, 117, 340, 57, 38, 62, 26, 163, 114, 104, 74, 72, 126, 289, 128, 131, 316, 258, 5, 344, 57, 270, 5283, 285, 289, 22, 1039, 386, 2619, 191, 2621, 163, 141, 4847, 335, 163, 252, 115, 398, 284, 163, 163, 36, 5141, 163, 1153, 163, 254, 211, 340, 74, 421, 259, 57, 421, 187, 955, 1374, 86, 285, 84, 3, 4, 5, 187, 187, 440, 9, 187, 628, 211, 43, 1231, 1232, 4859, 11, 5132, 478, 57, 26, 481, 980, 74, 4, 1352, 4967, 33, 57, 9, 463, 1340, 254, 84, 65, 26, 357, 995, 117, 324, 1258, 128, 33, 350, 310, 40, 183, 4732, 477, 822, 4806, 477, 184, 357, 254, 311, 26, 225, 163, 477, 420, 679, 481, 33, 364, 1135, 22, 626, 121, 419, 431, 1545, 163, 632, 433, 131, 329, 72, 477, 386, 477, 254, 187, 1153, 238, 360, 645, 241, 74, 11, 312, 264, 185, 477, 259, 74, 187, 1292, 2464, 330, 2466, 74, 917, 477, 2470, 1117, 2472, 2473, 5428, 163, 84, 112, 312, 330, 5271, 2481, 2482, 2483, 40, 164, 427, 163, 201, 344, 299, 1320, 1198, 114, 360, 187, 477, 4904, 477, 440, 133, 330, 252, 445, 163, 327, 1155, 360, 477, 398, 419, 475, 1473, 1217, 117, 479, 72, 259, 340, 477, 342, 259, 463, 344, 3649, 259, 259, 3273, 411, 481, 385, 386, 366, 5040, 105, 1181, 477, 1338, 5045, 11, 26, 131, 1343, 1344, 477, 440, 11, 386, 436, 607, 3737, 1197, 5039, 5344, 421, 613, 1357, 615, 398, 617, 477, 619, 612, 621, 105, 5140, 612, 1213, 481, 1135, 628, 206, 612, 481, 3761, 633, 612, 635, 398, 1755, 612, 403, 383, 330, 642, 5130, 426, 477, 398, 4081, 5193, 5340, 386, 228, 481, 430, 426, 481, 466, 477, 330, 327, 1554, 1195, 3893, 1557, 4119, 708, 666, 383, 4123, 432, 670, 4108, 712, 477, 481, 675, 477, 398, 5411, 679, 477, 842, 682, 481, 4496, 685, 374, 375, 481, 1335, 481, 330, 608, 473, 1528, 350, 4957, 1343, 1344, 398, 477, 701, 477, 3652, 3935, 1410, 1565, 1450, 476, 1217, 481, 1357, 477, 480, 466, 442, 330, 1460, 5451, 707, 752, 4024, 480, 480, 477, 330, 480, 479, 1619, 1620, 1621, 477, 1617, 475, 3934, 477, 463, 479, 2964, 398, 477, 1575, 4162, 477, 1448, 5262, 477, 473, 468, 469, 477, 706, 752, 477, 2070, 755, 756, 757, 721, 5071, 723, 5275, 725, 477, 419, 1392, 963, 477, 731, 963, 770, 3915, 477, 4107, 4835, 4109, 1392, 468, 469, 475, 959, 830, 5202, 479, 816, 367, 965, 468, 469, 968, 790, 791, 481, 793, 794, 5215, 1145, 398, 798, 480, 367, 468, 469, 1546, 1365, 1509, 1549, 1550, 1626, 481, 3939, 1902, 812, 480, 846, 4471, 816, 830, 948, 20, 442, 367, 822, 22, 1936, 357, 708, 1335, 1470, 5346, 862, 4415, 3162, 735, 834, 2934, 398, 2936, 5170, 66, 832, 463, 481, 398, 832, 3, 846, 481, 398, 398, 832, 481, 1943, 3981, 832, 477, 477, 84, 832, 477, 423, 436, 862, 1954, 2286, 466, 294, 481, 81, 3300, 755, 756, 757, 386, 419, 5136, 481, 1864, 479, 2255, 880, 1523, 105, 5139, 440, 885, 886, 419, 57, 105, 175, 468, 469, 5410, 3843, 3, 5316, 252, 1540, 470, 471, 472, 473, 386, 612, 1516, 3637, 463, 112, 34, 123, 5, 468, 469, 105, 142, 916, 917, 3842, 172, 163, 5350, 5351, 398, 352, 83, 304, 1384, 27, 342, 25, 5113, 131, 160, 794, 117, 175, 2891, 798, 939, 940, 22, 1291, 144, 324, 823, 2186, 28, 948, 324, 832, 2453, 2875, 5135, 2892, 5442, 207, 2333, 47, 959, 164, 289, 390, 963, 392, 965, 4722, 252, 968, 252, 468, 469, 470, 471, 472, 473, 358, 135, 1512, 269, 120, 2276, 357, 983, 832, 317, 1729, 112, 117, 2922, 403, 3623, 832, 832, 2866, 5379, 832, 832, 832, 707, 708, 3, 5263, 5, 112, 1005, 481, 164, 832, 832, 832, 832, 1012, 1013, 3240, 3241, 5272, 4621, 398, 201, 832, 3761, 4581, 264, 5453, 2764, 2765, 264, 421, 832, 2769, 916, 917, 855, 1034, 1035, 1036, 3961, 1038, 160, 1040, 1041, 1042, 832, 2557, 1839, 1840, 1752, 289, 1398, 131, 255, 289, 4487, 468, 469, 470, 471, 472, 473, 26, 107, 2199, 470, 471, 472, 473, 2806, 2807, 275, 165, 24, 201, 231, 287, 302, 3904, 70, 66, 165, 3, 1984, 335, 4538, 477, 112, 285, 81, 4543, 191, 755, 4546, 45, 182, 426, 477, 5352, 4534, 187, 477, 5356, 112, 49, 202, 459, 107, 95, 3333, 84, 8, 1110, 77, 1112, 1113, 1805, 5, 15, 16, 17, 85, 2170, 215, 830, 2026, 832, 324, 165, 285, 275, 123, 1046, 288, 81, 179, 117, 224, 112, 22, 354, 340, 425, 22, 425, 28, 4922, 1145, 254, 113, 57, 477, 275, 259, 35, 5409, 142, 398, 103, 81, 357, 360, 83, 330, 107, 386, 3263, 4921, 4955, 1155, 350, 2072, 4977, 54, 160, 4404, 123, 1175, 1176, 179, 391, 2070, 1180, 4959, 1182, 172, 324, 4440, 425, 414, 1722, 158, 1951, 1952, 22, 2575, 240, 386, 5452, 243, 66, 123, 106, 167, 4958, 1203, 285, 1739, 363, 5268, 5269, 1209, 4410, 306, 1212, 136, 180, 1215, 5472, 421, 201, 5475, 306, 104, 4417, 1757, 22, 424, 192, 254, 4177, 1229, 481, 389, 271, 391, 179, 81, 477, 419, 240, 141, 477, 243, 610, 324, 112, 4218, 131, 342, 1291, 202, 131, 916, 2023, 200, 3353, 105, 1158, 275, 1160, 1259, 1162, 155, 1164, 252, 1166, 1167, 1168, 1913, 1838, 342, 193, 1173, 283, 362, 267, 481, 357, 123, 254, 1813, 255, 159, 1870, 2174, 386, 191, 324, 1287, 1288, 1289, 419, 1291, 1826, 287, 386, 240, 1884, 3239, 243, 167, 1827, 131, 348, 205, 1838, 252, 401, 190, 124, 1897, 11, 1311, 407, 4833, 302, 193, 1850, 344, 134, 357, 1360, 1912, 1516, 217, 26, 1895, 179, 1867, 1377, 1378, 403, 1380, 2037, 131, 481, 4769, 704, 376, 287, 350, 58, 466, 1882, 252, 1905, 1885, 348, 4802, 66, 1349, 475, 5412, 477, 478, 479, 238, 481, 326, 241, 4160, 1894, 1895, 1394, 287, 1377, 1378, 157, 1380, 291, 252, 284, 72, 271, 275, 175, 386, 22, 4961, 357, 1379, 91, 1942, 28, 1383, 1384, 1946, 254, 240, 240, 1950, 2151, 259, 1953, 2004, 1394, 1395, 1396, 391, 1398, 346, 285, 284, 252, 348, 285, 1945, 395, 373, 1948, 1949, 376, 32, 458, 723, 724, 725, 427, 785, 728, 729, 730, 330, 1422, 406, 126, 237, 414, 4861, 738, 440, 166, 477, 4866, 4867, 302, 4002, 419, 114, 344, 324, 3950, 287, 391, 324, 419, 283, 329, 1155, 357, 112, 318, 252, 463, 3, 357, 285, 458, 1457, 169, 116, 478, 2107, 1462, 481, 4531, 1465, 477, 391, 351, 285, 2371, 234, 357, 350, 5033, 273, 357, 1477, 1478, 385, 386, 2186, 112, 1832, 285, 131, 175, 1487, 371, 412, 1490, 234, 4621, 357, 324, 348, 348, 420, 2032, 301, 423, 4568, 481, 155, 166, 301, 297, 273, 324, 386, 228, 413, 350, 458, 4581, 153, 1516, 1225, 1518, 285, 174, 4721, 1522, 324, 145, 2616, 1523, 357, 158, 1445, 328, 329, 329, 83, 211, 5042, 5043, 1245, 4733, 1539, 3870, 1541, 145, 1540, 1544, 391, 414, 1579, 386, 2006, 427, 208, 2859, 2199, 126, 168, 128, 2014, 324, 357, 357, 26, 2453, 252, 4708, 464, 465, 466, 1276, 468, 469, 470, 471, 472, 473, 3905, 116, 254, 481, 1579, 400, 2285, 2416, 1291, 273, 135, 3464, 225, 285, 427, 1590, 1591, 1592, 1593, 1594, 478, 259, 3914, 400, 251, 477, 344, 440, 339, 400, 2912, 2351, 2352, 1608, 345, 2355, 400, 340, 2318, 342, 228, 352, 481, 234, 1619, 1620, 1621, 153, 443, 425, 463, 389, 324, 266, 2447, 2448, 2449, 2375, 3146, 1983, 312, 1985, 2342, 3737, 477, 2383, 443, 1991, 2386, 213, 307, 389, 443, 1997, 1998, 1999, 387, 3034, 112, 417, 431, 214, 311, 2007, 2008, 357, 126, 3761, 2012, 164, 2192, 432, 2371, 208, 1377, 1378, 2128, 1380, 409, 417, 403, 4743, 339, 275, 442, 2514, 231, 1879, 252, 1878, 1879, 3403, 341, 187, 1868, 352, 165, 264, 1823, 225, 2283, 2401, 197, 158, 442, 2404, 477, 2236, 2537, 2538, 2539, 2540, 4938, 1530, 169, 143, 0, 212, 1535, 477, 2549, 2250, 1717, 3220, 1719, 3600, 180, 222, 442, 3226, 387, 340, 187, 344, 4678, 398, 1731, 1732, 2437, 477, 285, 425, 114, 2361, 4221, 2574, 385, 292, 312, 463, 4227, 3972, 350, 3974, 316, 347, 1751, 3491, 3492, 3493, 3494, 189, 2291, 3497, 3498, 3499, 3500, 3501, 3502, 3503, 3504, 3505, 3506, 2513, 284, 1770, 4966, 386, 389, 324, 4975, 420, 390, 328, 392, 477, 1603, 285, 386, 351, 1607, 1786, 1787, 1788, 1789, 3166, 360, 4936, 292, 2499, 254, 5355, 271, 466, 1799, 153, 417, 5309, 115, 417, 158, 1806, 357, 1808, 4953, 2004, 479, 2435, 284, 3553, 3554, 115, 153, 195, 386, 1820, 324, 158, 1823, 427, 324, 442, 1827, 4465, 328, 2357, 4755, 1832, 1530, 334, 141, 165, 440, 1535, 389, 3939, 391, 357, 104, 285, 326, 1156, 153, 4992, 1159, 419, 1161, 158, 1163, 357, 1165, 480, 2969, 357, 1169, 463, 477, 4618, 126, 437, 128, 433, 1867, 1868, 198, 158, 183, 225, 333, 477, 252, 2567, 254, 1878, 1879, 4853, 114, 1882, 324, 183, 1885, 357, 3829, 151, 225, 440, 3833, 3834, 181, 3836, 5150, 163, 5456, 159, 205, 316, 3335, 1902, 1903, 4660, 285, 1603, 442, 481, 1909, 1607, 1911, 477, 266, 8, 340, 357, 11, 4370, 225, 187, 15, 16, 17, 1912, 158, 2669, 158, 463, 1961, 266, 32, 193, 5133, 2580, 351, 1936, 5004, 4575, 5134, 4577, 440, 477, 1943, 324, 1945, 4751, 372, 1948, 1949, 181, 1951, 1952, 1976, 1954, 2942, 2490, 4409, 4389, 440, 266, 1961, 195, 29, 463, 328, 5033, 481, 1968, 275, 386, 5115, 4198, 4199, 1966, 1975, 1976, 238, 1966, 1979, 241, 442, 463, 1983, 1966, 1985, 440, 53, 1966, 2635, 1990, 1991, 1966, 390, 357, 392, 259, 1997, 1998, 1999, 481, 264, 463, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 304, 2012, 3653, 2014, 2015, 477, 433, 2018, 252, 1922, 254, 1924, 285, 1926, 403, 1928, 481, 1930, 4359, 234, 1913, 1934, 2033, 2034, 2035, 2036, 1975, 292, 263, 2040, 2041, 285, 2861, 2241, 2045, 5277, 2241, 2048, 2697, 2698, 2051, 2052, 2053, 2054, 2055, 2056, 2057, 2058, 2059, 2239, 2061, 324, 2242, 2243, 4989, 1982, 2067, 2068, 5264, 2070, 5138, 2580, 285, 328, 3484, 168, 2077, 312, 433, 2785, 324, 237, 4580, 141, 328, 2791, 390, 24, 392, 4587, 325, 11, 187, 285, 357, 153, 4902, 5047, 254, 440, 158, 2232, 357, 3513, 2666, 2106, 413, 320, 45, 328, 5255, 324, 2113, 357, 209, 4944, 2117, 2118, 353, 2932, 40, 8, 3862, 2867, 11, 440, 2635, 2128, 15, 16, 17, 126, 324, 128, 215, 228, 2137, 2138, 357, 344, 481, 405, 361, 2864, 357, 347, 2282, 205, 463, 5345, 2151, 415, 72, 350, 440, 5, 151, 2158, 2693, 2160, 3020, 11, 158, 2156, 239, 357, 481, 225, 475, 19, 74, 478, 479, 1774, 250, 2710, 271, 2201, 477, 2203, 84, 477, 440, 2533, 389, 181, 3046, 168, 38, 386, 2725, 2192, 268, 5338, 3708, 481, 466, 1798, 3916, 403, 2201, 3314, 2203, 1912, 83, 463, 326, 5275, 266, 479, 2822, 3324, 417, 4, 2605, 2606, 2607, 275, 9, 2220, 2867, 2254, 5454, 316, 2360, 475, 5032, 4, 2111, 479, 427, 2232, 9, 2234, 2235, 2199, 403, 442, 2239, 2589, 2241, 2242, 2243, 440, 2245, 124, 2247, 228, 22, 5199, 2251, 63, 64, 2254, 28, 134, 237, 1966, 4589, 254, 5405, 347, 478, 91, 259, 481, 463, 3575, 237, 264, 3578, 3706, 477, 3708, 907, 2276, 3699, 30, 31, 237, 477, 5349, 4893, 111, 4895, 2286, 269, 5355, 4899, 4900, 191, 274, 925, 2294, 2295, 928, 3937, 390, 2434, 392, 476, 2302, 234, 3444, 88, 481, 2764, 2765, 3685, 92, 2311, 2769, 477, 403, 479, 141, 3021, 145, 2351, 2352, 4, 476, 2355, 181, 417, 9, 481, 153, 3220, 475, 2331, 477, 158, 2042, 3226, 2336, 2337, 4948, 91, 2986, 433, 3649, 269, 2777, 239, 2779, 2780, 274, 2806, 2807, 2351, 2352, 53, 3306, 2355, 413, 2357, 2358, 111, 3375, 3376, 5311, 80, 478, 3741, 234, 481, 2956, 2957, 464, 465, 466, 3267, 468, 469, 470, 471, 472, 473, 205, 2381, 164, 433, 2384, 271, 234, 347, 4330, 5456, 4332, 4333, 3096, 145, 4336, 215, 472, 903, 2959, 477, 225, 477, 908, 479, 9, 2405, 2406, 285, 477, 472, 390, 405, 392, 344, 477, 197, 479, 2766, 13, 14, 2420, 415, 2422, 2423, 478, 478, 3260, 481, 481, 2778, 212, 475, 440, 477, 442, 479, 478, 417, 269, 481, 222, 266, 320, 477, 481, 479, 324, 5396, 2156, 344, 275, 2451, 2452, 2453, 30, 31, 2990, 2457, 389, 478, 200, 2810, 481, 2463, 478, 478, 248, 481, 481, 209, 4980, 2471, 477, 4699, 2474, 3009, 344, 433, 2986, 357, 2480, 2513, 478, 223, 53, 481, 417, 269, 390, 2489, 392, 2491, 478, 320, 3928, 481, 344, 478, 431, 2848, 481, 478, 5307, 211, 481, 2505, 4836, 80, 2508, 478, 2510, 442, 481, 2513, 460, 4845, 234, 2517, 340, 341, 2520, 389, 4621, 350, 84, 479, 3114, 478, 3923, 390, 481, 392, 2532, 2533, 2713, 340, 341, 2716, 3650, 3651, 2719, 389, 340, 341, 478, 3133, 477, 481, 478, 417, 2550, 481, 334, 478, 43, 5192, 481, 3262, 272, 386, 2560, 3943, 2562, 478, 2519, 272, 481, 2559, 320, 417, 3104, 269, 3106, 478, 442, 158, 481, 2707, 464, 465, 466, 269, 468, 469, 470, 471, 472, 473, 413, 2589, 340, 341, 234, 234, 442, 460, 478, 3904, 350, 481, 427, 478, 3293, 3308, 481, 5165, 5166, 3, 168, 477, 836, 478, 838, 440, 481, 5420, 2616, 272, 2618, 2619, 2620, 2621, 440, 3269, 442, 3271, 344, 23, 2822, 477, 3533, 191, 478, 43, 386, 481, 463, 141, 478, 421, 92, 481, 478, 5289, 5290, 481, 4745, 3634, 478, 153, 477, 481, 478, 460, 158, 481, 2656, 478, 211, 478, 481, 3195, 481, 478, 478, 162, 481, 481, 228, 8, 478, 389, 11, 481, 477, 427, 15, 16, 17, 431, 5485, 478, 478, 3428, 481, 481, 470, 83, 440, 255, 256, 478, 2886, 32, 481, 440, 3284, 442, 3286, 417, 3234, 205, 344, 344, 481, 234, 3352, 2707, 478, 3594, 3453, 463, 164, 2713, 274, 478, 2716, 478, 481, 2719, 4233, 225, 4664, 2766, 442, 477, 53, 478, 2728, 3632, 481, 478, 478, 163, 481, 481, 2736, 66, 479, 478, 136, 2741, 481, 72, 4483, 197, 478, 389, 389, 481, 8, 478, 477, 11, 481, 84, 478, 207, 480, 477, 212, 3269, 266, 3271, 2764, 2765, 2766, 2810, 477, 2769, 222, 275, 478, 256, 480, 417, 417, 2777, 2778, 2779, 2780, 444, 40, 112, 350, 114, 4124, 477, 4126, 47, 2790, 187, 477, 2793, 4216, 2795, 248, 193, 3332, 324, 442, 442, 5254, 187, 146, 478, 2806, 2807, 481, 477, 2810, 146, 4119, 3707, 72, 344, 4123, 479, 3589, 187, 386, 3526, 2822, 269, 2824, 269, 2826, 146, 2828, 187, 390, 478, 392, 3367, 481, 477, 477, 2016, 167, 478, 2019, 146, 481, 403, 3352, 324, 478, 478, 2848, 481, 481, 2559, 2852, 269, 414, 3443, 3417, 417, 158, 2859, 389, 427, 324, 146, 223, 3677, 195, 350, 478, 478, 209, 481, 481, 2916, 440, 2875, 114, 2853, 2854, 2855, 421, 139, 334, 2883, 478, 239, 626, 481, 417, 403, 478, 478, 632, 481, 481, 291, 478, 463, 2898, 481, 269, 478, 477, 386, 481, 645, 263, 35, 347, 413, 433, 477, 2912, 442, 158, 0, 2916, 2859, 215, 2919, 478, 2921, 66, 0, 182, 254, 54, 35, 478, 187, 259, 481, 271, 35, 478, 3469, 254, 481, 478, 335, 478, 481, 254, 481, 427, 3839, 478, 478, 477, 481, 481, 478, 54, 444, 481, 477, 3490, 440, 3817, 269, 478, 158, 2962, 481, 2964, 478, 224, 254, 481, 2969, 2912, 478, 478, 302, 481, 481, 104, 43, 43, 478, 463, 3515, 481, 478, 478, 254, 481, 481, 384, 318, 478, 408, 254, 481, 477, 478, 2996, 480, 2998, 2999, 3000, 478, 104, 83, 481, 478, 91, 3825, 481, 478, 285, 433, 481, 271, 91, 3549, 412, 478, 3761, 478, 481, 4071, 481, 478, 420, 478, 481, 423, 481, 4768, 433, 3736, 158, 3738, 3491, 3492, 3493, 3494, 305, 167, 3497, 3498, 3499, 3500, 3501, 3502, 3503, 3504, 3505, 3506, 478, 478, 146, 481, 481, 3760, 141, 478, 2766, 146, 481, 298, 190, 478, 141, 477, 481, 3524, 153, 3263, 146, 146, 478, 158, 3779, 481, 153, 478, 163, 478, 481, 158, 481, 430, 169, 414, 163, 172, 190, 34, 478, 176, 169, 481, 477, 172, 3553, 3554, 478, 176, 478, 481, 2810, 481, 362, 478, 477, 477, 481, 49, 238, 478, 3112, 241, 481, 478, 444, 146, 481, 2827, 205, 146, 146, 146, 252, 464, 465, 466, 205, 468, 469, 470, 471, 472, 473, 2843, 238, 3486, 478, 241, 225, 481, 146, 481, 146, 146, 146, 158, 225, 146, 252, 2859, 146, 93, 146, 146, 284, 146, 269, 386, 477, 35, 223, 158, 269, 158, 477, 5, 5, 477, 477, 3520, 158, 477, 477, 477, 477, 5, 118, 477, 5, 266, 284, 477, 269, 477, 477, 477, 477, 266, 275, 477, 269, 477, 5, 135, 477, 477, 275, 139, 5, 329, 441, 461, 2912, 477, 477, 477, 2916, 477, 468, 469, 470, 471, 472, 473, 3565, 477, 477, 159, 3220, 477, 162, 351, 4531, 477, 3226, 329, 477, 477, 477, 4538, 281, 4136, 207, 3235, 4543, 177, 481, 4546, 3240, 3241, 35, 371, 95, 3988, 331, 481, 223, 351, 35, 481, 158, 4156, 331, 158, 266, 264, 357, 62, 398, 4568, 398, 344, 398, 432, 398, 4379, 5007, 371, 344, 479, 344, 398, 4581, 3275, 3276, 3277, 398, 225, 398, 328, 398, 466, 398, 84, 344, 146, 269, 269, 349, 220, 3292, 259, 398, 398, 420, 398, 389, 3887, 3888, 386, 289, 340, 269, 269, 264, 477, 180, 386, 3342, 477, 398, 8, 3314, 3315, 11, 84, 481, 259, 15, 16, 17, 285, 3324, 3325, 3326, 398, 413, 187, 3330, 146, 4727, 3333, 398, 269, 413, 32, 421, 421, 386, 398, 3342, 398, 386, 398, 3338, 398, 106, 269, 398, 53, 437, 398, 439, 440, 53, 3891, 398, 398, 437, 245, 439, 440, 398, 398, 398, 398, 273, 42, 310, 398, 398, 3365, 344, 389, 398, 309, 398, 289, 289, 398, 398, 42, 344, 398, 481, 4151, 209, 398, 475, 269, 398, 478, 479, 480, 3428, 209, 475, 478, 3561, 478, 479, 480, 482, 3862, 444, 3407, 209, 209, 398, 209, 269, 209, 269, 269, 35, 209, 209, 209, 146, 3982, 3983, 3984, 3985, 3986, 8, 477, 3428, 11, 408, 24, 146, 15, 16, 17, 4743, 269, 254, 421, 112, 3441, 440, 146, 3444, 146, 4340, 432, 146, 269, 32, 231, 254, 158, 264, 35, 477, 254, 40, 254, 35, 215, 477, 346, 8, 47, 3466, 11, 34, 477, 396, 15, 16, 17, 396, 3475, 475, 398, 146, 475, 398, 3481, 4225, 3483, 398, 398, 3486, 477, 32, 146, 72, 3491, 3492, 3493, 3494, 4802, 421, 3497, 3498, 3499, 3500, 3501, 3502, 3503, 3504, 3505, 3506, 146, 146, 421, 3510, 3511, 146, 263, 209, 258, 3559, 398, 163, 436, 3520, 477, 245, 245, 3524, 11, 481, 396, 3528, 477, 477, 398, 172, 4144, 154, 3578, 3536, 163, 400, 3539, 481, 3541, 478, 3737, 180, 180, 481, 4081, 4439, 205, 3550, 360, 213, 3553, 3554, 270, 421, 481, 3558, 3559, 35, 278, 53, 3563, 213, 3565, 344, 3761, 421, 213, 478, 259, 3572, 3573, 3574, 3575, 271, 477, 3578, 3579, 259, 398, 477, 3583, 3584, 3585, 239, 433, 347, 403, 3590, 3567, 3568, 3569, 3570, 158, 259, 215, 148, 269, 182, 43, 366, 4060, 398, 187, 254, 148, 3600, 398, 223, 223, 3600, 223, 398, 3615, 340, 389, 3600, 269, 481, 148, 3600, 269, 148, 4213, 3600, 209, 210, 3629, 3338, 3631, 324, 3575, 181, 354, 3578, 4944, 398, 478, 35, 398, 224, 5382, 5383, 312, 275, 209, 421, 3649, 3650, 3651, 421, 3653, 4111, 215, 308, 3365, 466, 146, 264, 158, 4196, 433, 35, 209, 387, 160, 309, 4360, 3670, 3671, 3672, 3673, 264, 257, 354, 146, 146, 146, 264, 421, 254, 35, 440, 254, 269, 215, 269, 271, 477, 477, 274, 178, 178, 158, 35, 5004, 475, 3699, 243, 4235, 4290, 478, 478, 460, 348, 3649, 4057, 460, 478, 215, 478, 478, 158, 269, 254, 354, 3718, 481, 481, 187, 4256, 5236, 444, 187, 5033, 271, 187, 187, 187, 23, 481, 170, 4846, 477, 398, 163, 4299, 4300, 242, 4302, 481, 269, 440, 3939, 53, 263, 8, 403, 433, 11, 163, 4890, 386, 15, 16, 17, 281, 215, 478, 290, 478, 163, 237, 478, 478, 478, 478, 464, 465, 466, 32, 468, 469, 470, 471, 472, 473, 478, 362, 481, 398, 477, 460, 478, 8, 4321, 478, 11, 4881, 478, 4883, 478, 437, 477, 477, 477, 280, 4387, 477, 233, 477, 477, 462, 3768, 270, 8, 419, 270, 11, 466, 437, 3813, 15, 16, 17, 269, 40, 427, 53, 269, 272, 269, 191, 47, 477, 146, 398, 8, 477, 5138, 11, 398, 35, 444, 15, 16, 17, 398, 199, 259, 398, 146, 254, 3845, 273, 357, 349, 146, 72, 3559, 146, 349, 349, 223, 191, 148, 3858, 466, 3860, 398, 3862, 421, 1604, 225, 481, 3575, 291, 3869, 3578, 291, 418, 398, 235, 3875, 398, 398, 398, 461, 235, 235, 464, 465, 466, 3885, 468, 469, 470, 471, 472, 473, 3600, 398, 8, 398, 269, 11, 398, 481, 3900, 15, 16, 17, 3904, 344, 398, 4441, 344, 398, 344, 344, 254, 42, 3914, 398, 357, 139, 398, 146, 464, 465, 466, 3923, 468, 469, 470, 471, 472, 473, 478, 476, 209, 3933, 209, 209, 4697, 3937, 398, 478, 3932, 209, 5079, 398, 3944, 3945, 478, 398, 478, 209, 4144, 175, 3, 4487, 408, 158, 43, 326, 105, 478, 182, 478, 3904, 481, 4669, 187, 481, 158, 5275, 4787, 477, 4582, 3972, 35, 3974, 5087, 5088, 146, 146, 478, 158, 3981, 398, 175, 478, 466, 476, 146, 476, 272, 421, 421, 354, 344, 344, 1085, 344, 344, 344, 144, 144, 209, 224, 481, 209, 209, 137, 209, 209, 209, 209, 271, 209, 209, 163, 1105, 4016, 11, 281, 158, 432, 4632, 475, 163, 437, 1115, 4483, 4027, 163, 1119, 209, 0, 481, 1123, 4622, 1125, 1776, 426, 478, 172, 478, 1131, 5349, 478, 1784, 4394, 331, 1137, 5355, 271, 1140, 270, 481, 478, 478, 477, 1796, 4057, 477, 463, 4060, 82, 158, 478, 481, 408, 398, 35, 4068, 4069, 271, 478, 477, 215, 199, 4075, 4076, 421, 53, 389, 4080, 421, 146, 477, 373, 4085, 167, 408, 4088, 4089, 4981, 349, 271, 4093, 4094, 209, 398, 398, 398, 4099, 4100, 4101, 4102, 4103, 344, 398, 344, 4107, 4108, 4109, 398, 4111, 4112, 478, 478, 4115, 5228, 324, 440, 4119, 478, 477, 91, 4123, 53, 389, 158, 72, 427, 4129, 148, 1871, 146, 105, 209, 408, 209, 478, 209, 209, 362, 477, 194, 477, 4144, 213, 398, 4890, 444, 5456, 269, 4151, 4175, 481, 319, 4155, 481, 271, 1898, 35, 4160, 4153, 4154, 478, 267, 289, 3, 269, 481, 477, 481, 408, 141, 398, 478, 4175, 169, 4119, 4178, 477, 354, 4123, 105, 163, 153, 209, 476, 5324, 53, 158, 163, 478, 478, 477, 163, 438, 3904, 5098, 4198, 4199, 169, 481, 438, 172, 464, 465, 466, 176, 468, 469, 470, 471, 472, 473, 281, 477, 4216, 478, 279, 478, 212, 478, 477, 212, 3932, 388, 477, 276, 53, 176, 4230, 478, 4878, 264, 4795, 4769, 205, 466, 408, 461, 398, 163, 440, 72, 4890, 4806, 468, 469, 470, 471, 472, 473, 188, 193, 181, 259, 225, 4220, 259, 53, 466, 389, 398, 464, 465, 466, 4229, 468, 469, 470, 471, 472, 473, 66, 4808, 398, 398, 146, 209, 4279, 119, 165, 163, 478, 112, 464, 465, 466, 481, 468, 469, 470, 471, 472, 473, 481, 477, 266, 35, 8, 269, 4301, 11, 421, 187, 264, 275, 354, 421, 35, 477, 4768, 254, 160, 158, 354, 4316, 53, 264, 440, 78, 35, 163, 389, 4885, 440, 269, 4861, 158, 477, 196, 40, 4866, 4867, 272, 4792, 207, 163, 47, 477, 477, 426, 370, 84, 478, 289, 478, 477, 4348, 212, 464, 465, 466, 5044, 468, 469, 470, 471, 472, 473, 477, 477, 331, 72, 4364, 439, 478, 127, 269, 318, 4370, 477, 5077, 478, 35, 398, 146, 477, 398, 4379, 477, 158, 477, 477, 477, 477, 35, 259, 4582, 191, 236, 477, 354, 477, 4394, 478, 146, 105, 132, 436, 35, 478, 408, 273, 368, 368, 478, 4407, 53, 4409, 35, 4119, 75, 426, 4406, 4123, 481, 386, 477, 477, 477, 477, 477, 2163, 4773, 180, 421, 4621, 389, 158, 5041, 389, 252, 5079, 477, 4632, 269, 389, 4632, 5, 478, 2181, 152, 4443, 413, 4153, 4154, 2187, 4982, 145, 477, 2191, 4631, 444, 5015, 477, 341, 66, 272, 341, 66, 127, 440, 4812, 440, 425, 477, 477, 437, 5174, 439, 440, 426, 182, 481, 35, 163, 2217, 187, 357, 389, 315, 132, 4483, 259, 269, 193, 269, 35, 477, 354, 35, 272, 272, 477, 4674, 188, 165, 165, 478, 481, 478, 437, 477, 53, 398, 475, 117, 340, 478, 479, 480, 4512, 4513, 419, 224, 4516, 377, 5, 354, 142, 478, 477, 2263, 340, 276, 325, 4876, 4877, 477, 21, 4531, 32, 145, 4534, 259, 477, 398, 4538, 163, 477, 75, 2282, 4543, 340, 477, 4546, 4547, 481, 4549, 5007, 4551, 277, 4553, 4554, 481, 368, 368, 477, 871, 440, 440, 271, 165, 165, 832, 2867, 2517, 4568, 2404, 4570, 1606, 2326, 5219, 3046, 2315, 3736, 3710, 5219, 2429, 2487, 4581, 4582, 4583, 4584, 4585, 4672, 3254, 5077, 4531, 5324, 1344, 3885, 4727, 4350, 4696, 4538, 2963, 2656, 5198, 2340, 4543, 4581, 5313, 4546, 5107, 8, 2347, 5106, 11, 5239, 5349, 2967, 2353, 3933, 3918, 5051, 3876, 2502, 2502, 2360, 3731, 3072, 3304, 2364, 6, 4568, 3901, 4388, 2369, 4703, 4631, 4632, 2496, 913, 4712, 3316, 5326, 40, 4581, 5489, 5471, 35, 5177, 4689, 47, 3941, 3262, 5252, 2389, 4634, 4864, 5001, 362, 2394, 1765, 5060, 4637, 2398, 4561, 28, 54, 3991, 4832, 5417, 1811, 2175, 3943, 1182, 5018, 72, 2411, 1809, 5022, 4674, 5024, 2941, 4677, 5324, 1820, 4981, 1969, 1878, 695, 2424, 1970, 3198, 1969, 3, 4689, 3760, 662, 4692, 8, 2434, 3779, 11, 4697, 4406, 4699, 15, 16, 17, 5408, 3308, 5280, 4706, 5459, 1913, 4701, 4742, 104, 105, 811, 2107, 4564, 5173, 32, 2118, 112, 35, 1429, 833, 4723, 4155, 40, 5191, 4727, 3629, 1321, 2883, 1364, 47, 2898, 2154, 3593, 2128, 139, 5183, 5026, 4141, 4741, 4742, 4743, 2153, 3578, 4108, 4739, 4125, 4803, 3575, 5004, 461, 5003, 3630, 5297, 1387, 72, 1386, 468, 469, 470, 471, 472, 473, 1389, 5471, 1394, 4768, 4812, 3575, 4771, 5465, 4773, 167, 5173, 5386, 3528, 4771, 4557, 182, 1843, 5187, 1873, 5489, 187, 5186, 2065, 2827, 2737, 2457, 1881, 4792, 2825, 2068, -1, -1, 190, 4798, -1, 56, 4743, 4802, -1, -1, -1, 4806, -1, -1, 190, -1, 1901, 4812, -1, -1, -1, -1, -1, 199, 200, -1, 4821, 224, -1, -1, -1, 207, -1, 209, 210, 4538, -1, -1, -1, 90, 4543, 5293, -1, 4546, -1, -1, -1, 223, -1, 4844, 238, 4846, 5041, 241, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 252, 4802, 254, -1, -1, -1, -1, -1, 182, -1, 271, -1, 4871, 187, -1, -1, -1, 4876, 4877, -1, -1, -1, 4881, 4882, 4883, 4884, -1, -1, -1, -1, -1, -1, 284, -1, 149, 209, 210, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 224, -1, -1, 4912, -1, -1, -1, -1, -1, -1, 4919, -1, -1, -1, -1, -1, 5382, 5383, -1, 184, -1, -1, -1, -1, -1, -1, -1, 329, 2677, -1, -1, -1, 4941, 257, -1, 4944, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2695, 271, -1, 351, 274, 362, -1, 4954, 2703, 220, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 371, -1, 373, -1, -1, 376, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4701, -1, -1, -1, -1, 254, -1, -1, 5001, 4944, -1, 5004, -1, -1, 5007, -1, -1, -1, 5011, -1, -1, -1, 2105, -1, -1, 5018, -1, -1, -1, 5022, -1, 5024, -1, 5026, 5206, -1, -1, 286, 4739, -1, 5033, -1, -1, 292, -1, 5030, 5039, -1, 5041, -1, -1, -1, -1, -1, 362, -1, -1, 5399, -1, 5052, -1, -1, -1, -1, -1, -1, 461, -1, -1, 5004, -1, -1, -1, 468, 469, 470, 471, 472, 473, 328, -1, 330, -1, 332, -1, -1, -1, -1, -1, -1, -1, 477, 341, -1, 5087, 5088, -1, -1, 5033, -1, 349, 4802, -1, -1, -1, -1, -1, -1, 357, 5281, 5282, 4812, -1, -1, -1, -1, -1, -1, -1, -1, 369, -1, -1, -1, -1, 5118, -1, -1, -1, 378, -1, -1, 5125, 382, -1, -1, 5129, -1, -1, -1, -1, -1, -1, -1, -1, 5138, -1, -1, -1, -1, -1, -1, -1, 461, -1, -1, 464, 465, 466, -1, 468, 469, 470, 471, 472, 473, -1, -1, -1, -1, -1, 5164, 5165, 5166, -1, -1, 8, 5170, -1, 11, 5173, -1, -1, 15, 16, 17, 435, -1, -1, -1, 5183, -1, 6, 5186, -1, -1, -1, -1, 5191, -1, -1, -1, -1, 5138, -1, -1, -1, -1, 40, -1, -1, -1, -1, 5206, -1, 47, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 22, -1, 5221, -1, -1, -1, 28, -1, -1, 5228, -1, -1, -1, -1, 72, -1, -1, 4944, -1, 41, -1, -1, -1, -1, 2983, -1, 626, 4954, -1, -1, -1, -1, 632, -1, -1, 5254, -1, -1, -1, -1, 5259, -1, 5253, -1, -1, 645, 5265, -1, 70, -1, -1, -1, -1, -1, -1, -1, 5275, -1, -1, -1, -1, 661, 5281, 5282, 5283, -1, 666, -1, -1, 5280, -1, 671, -1, 5280, 5293, 675, 676, -1, 5297, 5280, -1, -1, 682, 5280, 684, 685, -1, 5280, -1, -1, -1, -1, -1, 5491, 5492, -1, 5358, 697, 698, 5318, 122, -1, 124, 5030, -1, -1, -1, -1, 708, 131, -1, -1, 134, -1, 5275, -1, -1, -1, -1, -1, -1, -1, -1, -1, 182, -1, -1, -1, -1, 187, 5349, 5350, 5351, -1, -1, 3094, 5355, 159, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5358, -1, -1, 190, 5358, -1, -1, -1, -1, -1, 5358, -1, 199, -1, 5358, -1, 5382, 5383, 5358, 224, 207, -1, -1, 210, 193, -1, -1, -1, 5394, -1, -1, -1, -1, 5399, -1, -1, -1, -1, -1, -1, -1, 5349, -1, 790, 791, -1, -1, 5355, -1, 796, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5428, -1, -1, -1, 271, -1, -1, -1, -1, -1, 5438, 820, -1, 822, -1, -1, -1, -1, -1, -1, -1, 252, -1, 254, 833, 5453, -1, -1, 5456, -1, -1, -1, -1, 264, -1, -1, -1, 5465, -1, 5459, -1, 5469, 273, 5459, -1, -1, -1, 3215, -1, 5459, -1, -1, -1, 5459, 285, -1, -1, 5459, -1, -1, -1, -1, -1, 5491, 5492, -1, -1, 2585, -1, -1, -1, -1, -1, -1, 2592, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5456, -1, -1, -1, -1, -1, -1, 324, 2612, 362, 327, 328, -1, -1, -1, -1, -1, -1, 2622, -1, -1, 2625, -1, 2627, 2628, -1, -1, 2631, -1, -1, -1, 5253, -1, 2637, -1, 2639, -1, -1, 2642, -1, 357, -1, -1, -1, 939, 940, 941, -1, -1, -1, -1, -1, -1, 948, -1, -1, -1, -1, 5280, -1, 955, -1, -1, -1, 959, -1, -1, -1, -1, -1, 965, -1, -1, 968, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 980, -1, -1, -1, -1, 8, -1, -1, 11, -1, -1, -1, 15, 16, 17, 995, 2705, -1, -1, -1, -1, -1, 424, 461, -1, -1, 464, 465, 466, 32, 468, 469, 470, 471, 472, 473, -1, 40, -1, -1, -1, -1, -1, -1, 47, -1, -1, -1, -1, -1, -1, 5358, -1, -1, -1, -1, -1, -1, 0, -1, 1040, 1041, 1042, -1, 3403, -1, -1, -1, -1, 72, -1, -1, -1, -1, -1, -1, 18, -1, -1, -1, -1, -1, 3421, -1, -1, -1, 28, -1, 30, 31, -1, -1, -1, -1, -1, -1, -1, -1, -1, 8, 1080, -1, 11, -1, 46, -1, -1, 3446, -1, -1, -1, -1, -1, 55, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 67, -1, 69, 70, -1, -1, 40, -1, -1, 76, -1, 78, 1117, 47, -1, -1, -1, -1, -1, -1, -1, -1, 89, -1, 91, -1, -1, 5459, -1, -1, 1135, -1, -1, -1, -1, -1, -1, -1, 72, -1, 1145, 108, -1, -1, 111, -1, -1, -1, 1153, -1, -1, -1, -1, -1, 182, -1, -1, -1, 125, 187, 127, -1, -1, -1, 131, -1, -1, -1, -1, -1, 137, -1, -1, -1, -1, -1, 1181, -1, 145, -1, 147, 209, 210, -1, -1, -1, 153, -1, -1, -1, 1195, -1, 1197, -1, -1, -1, 224, -1, -1, -1, -1, -1, 169, -1, -1, 139, -1, -1, 1213, -1, -1, -1, 1217, -1, -1, -1, -1, -1, -1, 186, -1, 666, -1, -1, 1229, -1, -1, -1, -1, 257, 675, -1, -1, -1, -1, -1, -1, 682, -1, -1, 685, -1, -1, 271, -1, -1, 274, -1, 182, -1, -1, -1, -1, 187, 1259, -1, -1, -1, 2972, 226, 227, -1, -1, -1, -1, 232, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 244, -1, -1, -1, -1, 1287, 1288, 1289, -1, 1291, -1, -1, 256, 224, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1311, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3680, -1, -1, -1, -1, -1, -1, -1, -1, 292, -1, -1, -1, -1, 1335, -1, -1, 300, 362, -1, -1, 271, 1343, 1344, -1, -1, 3056, -1, 3058, -1, -1, 314, -1, -1, -1, -1, 1357, 320, 321, -1, 323, -1, -1, -1, -1, 328, -1, -1, -1, -1, 333, -1, -1, 336, -1, -1, -1, -1, 1379, -1, 343, -1, 1383, 1384, -1, -1, 349, 350, -1, -1, -1, -1, 8, -1, 357, 11, -1, 1398, 361, -1, -1, -1, -1, 1404, -1, -1, -1, -1, 371, 1410, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 386, 40, -1, -1, -1, -1, -1, -1, 47, 362, -1, -1, 3795, -1, 461, 3798, -1, 464, 465, 466, 406, 468, 469, 470, 471, 472, 473, -1, -1, -1, 416, -1, -1, 72, 481, -1, 422, 35, -1, 8, -1, 427, 11, -1, -1, -1, -1, 1471, -1, -1, -1, -1, -1, -1, 440, -1, -1, -1, 56, -1, -1, 3194, -1, 22, -1, -1, -1, 3200, -1, 28, -1, 40, -1, 8, -1, -1, 11, 463, 47, -1, 15, 16, 17, -1, 948, -1, -1, -1, 1512, -1, -1, 477, 90, -1, 480, 959, -1, 32, -1, -1, 139, 965, -1, 72, 968, 40, -1, -1, 461, -1, -1, 70, 47, -1, 3897, 468, 469, 470, 471, 472, 473, 1545, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3916, -1, -1, -1, 72, -1, -1, -1, -1, -1, 182, -1, -1, -1, -1, 187, -1, -1, 149, -1, -1, -1, -1, -1, -1, -1, -1, -1, 120, -1, -1, -1, 124, -1, -1, -1, -1, 139, -1, 131, -1, -1, 134, 1040, 1041, 1042, -1, 1604, -1, -1, -1, -1, 224, 184, -1, -1, -1, -1, -1, -1, -1, -1, 1619, 1620, 1621, -1, -1, 159, -1, -1, 8, -1, -1, 11, -1, 3991, -1, 15, 16, 17, 182, -1, -1, -1, 215, 187, -1, -1, -1, 220, -1, -1, -1, -1, 32, -1, -1, -1, -1, 271, -1, 193, 40, -1, -1, -1, -1, -1, -1, 47, -1, -1, -1, -1, 182, -1, -1, -1, -1, 187, -1, -1, 224, 254, -1, 3391, -1, 3393, -1, 3395, -1, -1, -1, -1, 72, -1, -1, -1, 3404, -1, -1, 209, 210, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 286, 224, -1, -1, -1, 252, 292, 254, -1, -1, 1722, -1, -1, -1, 271, -1, -1, 264, -1, -1, -1, -1, -1, -1, 3445, -1, 273, 1739, -1, -1, -1, -1, -1, -1, 257, 362, -1, -1, 285, -1, 1752, -1, 328, -1, -1, 1757, 332, -1, 271, -1, -1, 274, -1, -1, -1, 341, -1, -1, -1, -1, -1, -1, -1, 349, 1776, -1, -1, -1, -1, -1, -1, 357, 1784, -1, -1, -1, -1, 324, -1, -1, 327, 328, -1, 369, 1796, -1, -1, -1, -1, 182, -1, -1, 378, -1, 187, -1, 382, -1, -1, -1, -1, 1813, -1, -1, -1, 362, -1, -1, 1820, -1, 357, 1823, -1, -1, 1826, 401, 209, 210, -1, -1, 1832, -1, -1, -1, -1, -1, 1838, -1, -1, -1, -1, 224, -1, -1, 461, -1, -1, -1, 1850, 362, -1, 468, 469, 470, 471, 472, 473, -1, -1, 435, -1, -1, -1, 439, -1, 1867, 1868, -1, 1870, 1871, -1, -1, -1, -1, 257, -1, -1, -1, -1, -1, 1882, -1, 1884, 1885, -1, -1, -1, 424, 271, -1, 4251, 274, 1894, 1895, -1, 1897, 1898, -1, -1, -1, -1, -1, 4263, -1, -1, -1, -1, -1, -1, -1, -1, 1913, -1, -1, 461, -1, -1, -1, -1, -1, -1, 468, 469, 470, 471, 472, 473, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1945, -1, -1, 1948, 1949, 461, -1, -1, 464, 465, 466, -1, 468, 469, 470, 471, 472, 473, -1, -1, -1, -1, 478, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 17, -1, 362, -1, 1983, -1, 1985, -1, -1, 26, -1, 1990, 1991, -1, -1, -1, -1, -1, 1997, 1998, 1999, -1, -1, -1, 2003, -1, 2005, 2006, 2007, 2008, 2009, 2010, -1, 2012, -1, 2014, 2015, -1, -1, 2018, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2032, 2033, 2034, 2035, 2036, 2037, -1, -1, -1, 2041, -1, -1, -1, 2045, -1, -1, 2048, -1, -1, 2051, 2052, 2053, 2054, 2055, 2056, 2057, 2058, 2059, -1, 2061, -1, -1, -1, -1, -1, -1, 2068, -1, 2070, -1, -1, -1, -1, -1, -1, -1, -1, -1, 461, -1, -1, 464, 465, 466, -1, 468, 469, 470, 471, 472, 473, -1, -1, 8, -1, 478, 11, -1, -1, -1, 15, 16, 17, -1, 4465, 2107, -1, -1, -1, -1, -1, 2113, -1, -1, -1, -1, -1, 32, -1, -1, -1, -1, -1, -1, -1, 40, 2128, -1, -1, -1, -1, -1, 47, -1, -1, 2137, 2138, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 72, 25, -1, -1, 2163, -1, -1, -1, -1, -1, 8, 2170, -1, 11, -1, 2174, 2175, 15, 16, 17, -1, -1, 2181, -1, -1, -1, -1, 2186, 2187, -1, -1, -1, 2191, -1, 32, -1, -1, -1, -1, -1, 2199, -1, 40, -1, -1, -1, -1, -1, -1, 47, 74, -1, -1, -1, -1, -1, -1, 4575, 2217, 4577, -1, 2220, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2232, 72, -1, -1, 2236, -1, -1, 2239, -1, 106, 2242, 2243, -1, -1, -1, -1, -1, -1, 2250, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2263, 129, -1, -1, 3976, -1, 182, -1, 3980, -1, -1, 187, 140, -1, -1, -1, -1, -1, -1, 2282, 2283, -1, -1, -1, -1, -1, -1, -1, 2291, -1, -1, -1, 160, 209, 210, -1, -1, 165, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 224, -1, -1, 2314, 2315, -1, -1, 2318, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2340, -1, 2342, 182, 257, -1, -1, 2347, 187, -1, -1, 216, -1, 2353, -1, -1, -1, 20, 271, -1, 2360, 274, 25, -1, 2364, -1, -1, -1, -1, 2369, 209, 210, 237, -1, -1, -1, -1, -1, -1, -1, 1820, -1, -1, 1823, -1, 224, -1, -1, -1, 2389, -1, -1, -1, -1, 2394, -1, -1, 60, 2398, -1, -1, 2401, -1, -1, -1, -1, -1, -1, -1, -1, 73, 2411, -1, -1, -1, -1, -1, -1, 257, -1, -1, -1, -1, -1, 2424, 88, -1, 1867, 1868, -1, -1, -1, 271, -1, 2434, 274, -1, -1, -1, -1, 305, 306, 1882, -1, 309, 1885, -1, -1, -1, 362, -1, 2451, 2452, 2453, -1, -1, -1, 2457, -1, -1, -1, -1, -1, -1, -1, -1, 129, -1, -1, -1, 335, -1, -1, 338, -1, -1, -1, 140, -1, 344, -1, -1, -1, -1, -1, 4194, 351, -1, -1, 2489, 2490, -1, -1, -1, -1, -1, -1, 160, -1, 2499, -1, -1, 165, -1, -1, 1945, -1, -1, 1948, 1949, -1, -1, -1, -1, -1, 380, -1, -1, -1, -1, -1, 386, -1, 362, 389, -1, -1, 4236, 4237, -1, -1, -1, -1, 2533, -1, -1, -1, -1, -1, -1, -1, -1, -1, 408, -1, -1, -1, -1, 461, -1, -1, 464, 465, 466, -1, 468, 469, 470, 471, 472, 473, -1, -1, -1, -1, 478, -1, -1, 433, -1, -1, 609, 2572, -1, 237, 2575, -1, -1, -1, -1, 2580, -1, -1, -1, -1, -1, -1, -1, -1, 2589, 22, -1, -1, -1, -1, -1, 28, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 271, -1, -1, -1, -1, 4322, 4323, -1, -1, -1, -1, -1, -1, -1, 461, 661, 662, 464, 465, 466, -1, 468, 469, 470, 471, 472, 473, 2635, -1, -1, 70, 478, -1, -1, 305, 306, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 338, -1, 2677, -1, -1, -1, 344, -1, -1, -1, -1, -1, -1, 351, -1, -1, 354, 124, 2693, -1, 2695, -1, -1, -1, 131, -1, -1, 134, 2703, -1, -1, -1, 2707, -1, -1, 2710, -1, -1, 2713, -1, -1, 2716, -1, -1, 2719, 758, -1, -1, 386, -1, 2725, -1, 159, -1, -1, 393, -1, -1, -1, -1, -1, 2736, 4446, 401, 4448, 4449, 2741, -1, -1, 8, 408, 784, 11, -1, -1, -1, 15, 16, 17, 792, 4464, -1, 795, 796, 797, -1, 193, -1, -1, 2764, 2765, 2766, -1, 32, 2769, 433, -1, -1, -1, -1, -1, 40, 2777, 2778, 2779, 2780, -1, -1, 47, -1, 2785, -1, -1, -1, -1, 2790, 2791, 2232, 2793, -1, 2795, -1, -1, -1, 2239, -1, -1, 2242, 2243, -1, -1, 2806, 2807, 72, -1, 2810, -1, -1, -1, -1, -1, -1, -1, -1, -1, 252, -1, 254, -1, 2824, -1, 2826, -1, 2828, -1, -1, -1, 264, 5192, -1, -1, -1, -1, -1, -1, -1, 273, -1, -1, -1, -1, -1, -1, 2848, -1, -1, -1, -1, 285, -1, -1, -1, -1, -1, 2859, -1, -1, -1, -1, -1, -1, -1, 2867, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2883, -1, 8, -1, -1, 11, -1, -1, -1, 15, 16, 17, 327, 328, -1, 2898, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 32, -1, -1, 2912, -1, -1, -1, -1, 40, 182, -1, -1, -1, -1, 187, 47, 357, -1, -1, -1, -1, -1, 2931, -1, -1, 2934, -1, 2936, -1, -1, -1, -1, 2941, -1, -1, -1, 209, 210, -1, -1, 72, -1, -1, -1, -1, -1, 56, 2956, 2957, -1, -1, 224, -1, 2962, -1, -1, -1, -1, 8, -1, -1, 11, -1, -1, -1, 15, 16, 17, -1, -1, -1, -1, -1, -1, 2983, -1, -1, 2986, -1, -1, 90, 2990, 32, 424, 257, -1, -1, -1, -1, -1, 40, -1, -1, -1, -1, -1, -1, 47, 271, 22, 3009, 274, -1, -1, -1, 28, -1, -1, -1, -1, 120, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 72, -1, -1, 3034, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 149, -1, -1, -1, -1, -1, -1, 4764, -1, -1, -1, 182, -1, -1, -1, -1, 187, -1, -1, -1, -1, -1, -1, 3071, 3072, 3073, -1, -1, -1, -1, -1, -1, -1, -1, -1, 184, -1, -1, 209, 210, -1, -1, -1, -1, -1, -1, 3094, -1, -1, 1135, 362, -1, -1, 224, -1, -1, 3104, -1, 3106, -1, -1, -1, -1, -1, -1, -1, 3114, 1153, -1, -1, -1, 220, -1, -1, -1, -1, -1, 4834, -1, -1, -1, -1, -1, -1, -1, 3133, 257, -1, -1, -1, -1, -1, -1, 182, -1, -1, -1, -1, 187, -1, 271, 1187, -1, 274, -1, 254, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 209, 210, -1, -1, -1, -1, -1, -1, -1, 4886, -1, 1217, -1, -1, -1, 224, 285, 286, -1, -1, -1, -1, -1, 292, -1, -1, -1, 3195, -1, 461, -1, -1, 464, 465, 466, -1, 468, 469, 470, 471, 472, 473, -1, -1, -1, -1, 478, 3215, 257, -1, -1, -1, 3220, -1, -1, 324, -1, -1, 3226, 328, -1, -1, 271, 332, -1, 274, 3234, -1, -1, -1, -1, 362, 341, -1, -1, -1, -1, -1, -1, -1, 349, -1, -1, -1, -1, -1, -1, 1293, 357, -1, -1, -1, -1, -1, 3262, 3263, 1302, -1, -1, 2707, 369, 3269, -1, 3271, -1, 2713, -1, -1, 2716, 378, 1316, 2719, -1, 382, -1, -1, 3284, -1, 3286, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1335, -1, -1, 1338, 1339, -1, -1, -1, 1343, 1344, -1, 3308, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1357, -1, 362, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3332, -1, 435, -1, -1, -1, 461, -1, -1, 464, 465, 466, -1, 468, 469, 470, 471, 472, 473, -1, 3352, 3353, -1, 478, -1, -1, -1, -1, 191, 192, -1, -1, 195, -1, -1, 3367, -1, 8, -1, -1, 11, -1, -1, -1, 15, 16, 17, -1, -1, -1, -1, -1, 215, -1, -1, -1, -1, -1, -1, 222, -1, 32, -1, -1, -1, -1, -1, -1, -1, 40, -1, 3403, -1, -1, -1, -1, 47, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2859, 461, 3421, -1, 464, 465, 466, -1, 468, 469, 470, 471, 472, 473, 72, -1, -1, -1, 478, -1, -1, -1, -1, -1, 3443, -1, -1, 3446, -1, -1, -1, -1, -1, -1, 35, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3466, -1, -1, 3469, -1, 22, 2912, -1, 56, 3475, -1, 28, -1, -1, -1, 3481, -1, 3483, -1, -1, 3486, -1, -1, -1, 3490, 3491, 3492, 3493, 3494, -1, -1, 3497, 3498, 3499, 3500, 3501, 3502, 3503, 3504, 3505, 3506, -1, 90, -1, 3510, 3511, -1, -1, -1, 3515, -1, -1, -1, 70, 3520, -1, -1, -1, 3524, 1563, 3526, -1, 3528, -1, -1, 1569, -1, -1, -1, -1, 3536, -1, -1, 3539, -1, 3541, -1, 182, -1, -1, -1, -1, 187, 3549, 3550, -1, -1, 3553, 3554, -1, -1, -1, 3558, 3559, -1, -1, -1, -1, -1, 3565, -1, 149, -1, -1, 209, 210, -1, 124, -1, 3575, -1, -1, 3578, -1, 131, -1, -1, 134, -1, 224, -1, -1, -1, -1, 3590, -1, -1, -1, -1, -1, -1, -1, -1, 5308, -1, -1, 184, -1, -1, -1, -1, -1, 159, -1, -1, -1, -1, -1, -1, 3615, -1, -1, 257, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3631, 271, 215, -1, 274, -1, 3637, 220, -1, -1, -1, 193, -1, 8, -1, -1, 11, -1, 3649, -1, 15, 16, 17, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 32, -1, -1, -1, 254, -1, -1, -1, 40, -1, -1, -1, 3680, -1, -1, 47, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 252, -1, 254, 286, -1, -1, 721, 72, 723, 292, 725, -1, 264, -1, -1, -1, 731, 732, 733, -1, -1, 273, 362, -1, -1, -1, -1, -1, -1, -1, 3731, -1, -1, 285, -1, 3736, 3737, 3738, -1, -1, 1779, -1, -1, -1, 1783, 328, -1, -1, -1, 332, -1, -1, -1, -1, -1, -1, -1, -1, 341, 3760, 3761, -1, -1, -1, -1, -1, 349, -1, -1, -1, -1, -1, 324, -1, 357, 327, 328, -1, 3779, -1, -1, -1, -1, 615, -1, 617, 369, -1, -1, 621, -1, -1, -1, -1, 3795, 378, -1, 3798, -1, 382, -1, -1, -1, 635, -1, 357, -1, -1, -1, 22, 642, -1, -1, -1, -1, 28, -1, 182, 401, -1, -1, 461, 187, -1, 464, 465, 466, -1, 468, 469, 470, 471, 472, 473, 8, -1, -1, 11, 478, -1, -1, 15, 16, 17, 209, 210, -1, -1, -1, -1, -1, -1, 435, -1, -1, -1, 439, 70, 32, 224, -1, 3862, -1, -1, 879, -1, 40, -1, -1, -1, -1, -1, 424, 47, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3887, 3888, -1, -1, 3891, -1, 257, -1, -1, -1, 3897, -1, 72, -1, -1, -1, -1, 3904, -1, -1, 271, -1, -1, 274, -1, 124, -1, -1, -1, 3916, -1, -1, 131, -1, -1, 134, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3939, -1, -1, -1, 3943, 3944, 3945, -1, 159, 8, -1, -1, 11, -1, -1, -1, 15, 16, 17, 1996, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 32, -1, -1, -1, -1, -1, -1, -1, 40, 193, -1, -1, -1, -1, -1, 47, -1, -1, -1, 3991, -1, -1, -1, -1, -1, -1, 362, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 182, -1, -1, 72, -1, 187, -1, 4016, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4027, -1, -1, -1, -1, -1, -1, -1, -1, 209, 210, -1, -1, 252, -1, 254, -1, -1, -1, -1, -1, -1, 2087, -1, 224, 264, -1, 885, 886, -1, 4057, -1, -1, 4060, 273, -1, -1, -1, -1, -1, -1, 4068, 4069, -1, 4071, -1, 285, -1, 4075, 4076, -1, -1, -1, 4080, 4081, -1, -1, 257, 4085, -1, -1, 4088, 4089, -1, -1, -1, 4093, -1, -1, -1, 461, 271, 4099, 464, 465, 466, -1, 468, 469, 470, 471, 472, 473, -1, 4111, 324, -1, 478, 327, 328, -1, -1, 4119, -1, -1, 182, 4123, -1, -1, -1, 187, -1, -1, -1, -1, -1, -1, -1, 3575, -1, -1, 3578, 1153, -1, -1, -1, -1, -1, 357, -1, -1, -1, 209, 210, 4151, 983, -1, -1, -1, -1, -1, -1, -1, -1, 2199, -1, -1, 224, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4178, -1, -1, 1012, 1013, -1, -1, -1, -1, -1, -1, 362, -1, 8, -1, -1, 11, -1, 4196, 257, 15, 16, 17, -1, -1, -1, -1, -1, -1, 1038, -1, 3649, -1, 271, 424, 4213, 274, 32, -1, -1, 4218, -1, -1, -1, -1, 40, -1, -1, -1, -1, -1, -1, 47, -1, 2270, -1, -1, 4235, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4251, -1, -1, -1, 72, 4256, -1, -1, -1, -1, -1, -1, 4263, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4279, -1, 1112, 1113, -1, -1, -1, -1, -1, 461, -1, 4290, 464, 465, 466, -1, 468, 469, 470, 471, 472, 473, -1, 362, -1, -1, -1, -1, -1, -1, -1, -1, 2349, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4321, -1, -1, 1338, -1, -1, -1, 2366, 1343, 1344, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1357, -1, -1, -1, -1, 4348, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4364, 182, -1, -1, -1, -1, 187, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4387, -1, 2427, -1, -1, 209, 210, 4394, -1, -1, -1, -1, -1, -1, 461, -1, -1, 464, 465, 466, 224, 468, 469, 470, 471, 472, 473, -1, -1, -1, -1, 478, -1, -1, -1, -1, 2461, -1, -1, 2464, -1, 2466, -1, -1, -1, 2470, -1, 2472, 2473, 1450, -1, -1, 4439, 257, 4441, -1, 2481, 2482, 2483, 1460, -1, -1, -1, -1, -1, -1, -1, 271, -1, -1, 274, -1, -1, -1, -1, -1, -1, 3904, 4465, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4483, -1, -1, -1, 4487, -1, 1503, 1504, 22, -1, -1, -1, -1, -1, 28, 2536, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 41, -1, 4512, 4513, -1, -1, 4516, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2568, 4531, 1546, -1, -1, 1549, 1550, -1, 4538, 70, -1, -1, 2580, 4543, -1, 362, 4546, 4547, -1, -1, -1, -1, -1, 4553, 4554, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4568, -1, 4570, -1, -1, -1, -1, 4575, -1, 4577, -1, -1, -1, 4581, -1, -1, -1, -1, -1, -1, -1, 120, -1, -1, -1, 124, -1, -1, -1, 2635, -1, -1, 131, -1, -1, 134, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4621, 4622, -1, -1, -1, -1, -1, 159, -1, -1, 4631, -1, -1, 1465, -1, -1, -1, -1, -1, -1, -1, -1, -1, 461, -1, -1, 464, 465, 466, -1, 468, 469, 470, 471, 472, 473, -1, -1, 1490, -1, 478, 193, -1, -1, -1, -1, -1, -1, 4669, -1, -1, -1, -1, 4674, -1, -1, -1, -1, 4119, -1, -1, -1, 4123, -1, -1, 8, -1, -1, 11, -1, -1, -1, 15, 16, 17, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 32, -1, -1, -1, -1, 1729, -1, -1, 40, -1, -1, 252, -1, 254, -1, 47, -1, -1, -1, -1, 4730, -1, -1, 264, -1, -1, -1, -1, -1, -1, -1, -1, 273, 4743, -1, 4745, -1, -1, -1, -1, 72, -1, -1, -1, 285, -1, -1, -1, -1, 1590, 1591, 1592, 1593, -1, -1, -1, -1, -1, 4768, 4769, -1, 4771, -1, 4773, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4792, 324, -1, -1, 327, 328, 4798, -1, -1, -1, 4802, -1, -1, -1, -1, -1, 4808, -1, -1, -1, 4812, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1836, -1, -1, -1, 357, -1, -1, 2867, -1, -1, 1846, -1, 1848, -1, -1, -1, -1, -1, 1854, -1, -1, -1, -1, -1, -1, 1861, -1, -1, -1, -1, -1, 4853, -1, -1, -1, -1, -1, -1, 182, 4861, -1, -1, -1, 187, 4866, 4867, -1, -1, -1, 4871, 8, -1, -1, 11, 4876, 4877, 4878, 15, 16, 17, -1, -1, -1, -1, -1, 209, 210, -1, 4890, -1, -1, 424, -1, -1, -1, -1, -1, -1, 1731, 1732, 224, -1, 40, -1, -1, -1, -1, -1, -1, 47, 4912, -1, -1, -1, -1, -1, -1, 4919, 1751, -1, -1, -1, 4364, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 257, 72, -1, -1, -1, -1, -1, -1, -1, 4944, -1, -1, -1, 2986, 271, -1, -1, 274, -1, -1, 1786, 1787, 1788, 1789, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1993, 1994, 4981, 4982, -1, -1, -1, 2000, 2001, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5001, -1, -1, 5004, -1, -1, 5007, -1, -1, -1, -1, -1, -1, 2028, -1, -1, -1, 5018, -1, -1, -1, 5022, -1, 5024, -1, 5026, -1, -1, -1, -1, -1, -1, 5033, -1, -1, -1, -1, -1, 3077, 362, -1, -1, 8, -1, -1, 182, -1, -1, 14, 15, 187, 5052, -1, -1, 20, -1, 22, -1, -1, -1, -1, -1, 28, -1, -1, 31, -1, -1, -1, -1, -1, 1903, 209, 210, -1, -1, 5077, 1909, 5079, -1, -1, -1, -1, -1, 50, 51, -1, 224, -1, -1, 4531, -1, 3131, -1, -1, -1, -1, 4538, -1, -1, -1, -1, 4543, -1, -1, 4546, 4547, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 257, -1, 2137, 2138, -1, -1, -1, 4568, 5129, -1, -1, -1, -1, -1, 271, -1, -1, 5138, 461, -1, 4581, 464, 465, 466, -1, 468, 469, 470, 471, 472, 473, -1, -1, -1, -1, 478, -1, -1, 3197, -1, -1, -1, -1, 5164, 5165, 5166, -1, -1, -1, -1, -1, -1, 5173, 5174, -1, -1, 5177, -1, -1, -1, -1, -1, 5183, -1, 2199, -1, -1, -1, -1, -1, 4631, 5192, -1, -1, -1, -1, -1, -1, -1, -1, 3239, -1, -1, -1, -1, 5206, -1, -1, 2040, -1, -1, -1, -1, -1, 3253, 3254, -1, -1, 5219, -1, 8, -1, -1, 11, 3263, 362, -1, 15, 16, 17, 3269, 197, 3271, 4674, -1, -1, -1, -1, -1, 205, -1, -1, 208, -1, 32, 211, 212, -1, 214, -1, 216, -1, 40, 219, -1, 221, -1, -1, 5259, 47, -1, -1, -1, -1, 5265, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5275, -1, -1, 22, 3317, 2294, 5281, 5282, 5283, 28, 72, -1, -1, -1, -1, -1, -1, -1, 5293, -1, -1, -1, 41, -1, 8, -1, -1, 11, 4743, -1, -1, 15, 16, 17, -1, -1, -1, -1, 3351, 3352, -1, -1, -1, -1, -1, -1, -1, -1, 32, 5324, 461, 70, -1, 464, 465, 466, 40, 468, 469, 470, 471, 472, 473, 47, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5349, -1, -1, -1, -1, -1, 5355, -1, -1, -1, -1, -1, 2375, 4802, 72, -1, -1, -1, -1, -1, 2383, -1, -1, 2386, -1, -1, -1, -1, -1, 122, -1, 124, -1, 5382, 5383, -1, -1, -1, 131, -1, -1, 134, -1, -1, -1, 5394, 182, -1, -1, -1, 5399, 187, -1, -1, 2234, 2235, -1, -1, -1, 5408, -1, -1, -1, -1, -1, 2245, 159, 2247, -1, -1, -1, 2251, -1, 209, 210, -1, -1, 8, -1, 5428, 11, -1, -1, -1, 15, 16, 17, -1, 224, 5438, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 193, 32, -1, -1, -1, -1, -1, 5456, -1, 40, -1, -1, -1, -1, -1, -1, 47, -1, -1, -1, 5469, 257, 5471, -1, 182, -1, -1, -1, -1, 187, 4919, -1, -1, -1, -1, 271, -1, -1, 274, -1, 5489, 72, 5491, 5492, -1, -1, -1, -1, 3535, -1, -1, 209, 210, -1, -1, 4944, -1, -1, -1, 252, -1, 254, -1, -1, -1, -1, 224, -1, -1, -1, -1, 264, -1, -1, -1, -1, -1, -1, -1, -1, 273, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 285, -1, -1, -1, -1, -1, -1, 257, -1, 2381, -1, -1, 2384, -1, -1, -1, -1, -1, -1, -1, -1, 271, -1, 5004, 274, -1, -1, -1, -1, -1, -1, -1, -1, -1, 362, -1, -1, -1, -1, 324, -1, -1, 327, 328, -1, -1, -1, 2602, 2603, -1, -1, -1, 5033, 2608, -1, -1, -1, -1, -1, 182, -1, -1, -1, -1, 187, -1, -1, 22, -1, -1, -1, -1, 357, 28, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 209, 210, -1, -1, -1, 2463, -1, -1, -1, -1, -1, -1, -1, 2471, -1, 224, 2474, -1, -1, -1, -1, -1, 2480, -1, -1, -1, 362, -1, 2669, 70, -1, 623, -1, 2491, -1, -1, -1, -1, 630, 631, -1, -1, 634, -1, 636, 637, -1, 461, 257, 641, 464, 465, 466, 424, 468, 469, 470, 471, 472, 473, 652, -1, 271, -1, 478, 274, -1, -1, -1, -1, -1, 5138, 3737, -1, 2532, -1, -1, -1, -1, -1, -1, -1, -1, 124, -1, -1, -1, -1, -1, -1, 131, -1, -1, 134, -1, -1, 3761, -1, -1, 691, -1, 693, 2560, -1, 3769, -1, -1, 3772, -1, 3774, -1, 703, -1, -1, -1, -1, -1, -1, 159, -1, -1, -1, -1, -1, -1, 461, -1, -1, 464, 465, 466, -1, 468, 469, 470, 471, 472, 473, -1, 5206, -1, -1, 478, 735, -1, -1, -1, -1, -1, -1, -1, 3816, 193, 362, -1, -1, -1, -1, -1, -1, 2618, -1, 2620, -1, 3829, -1, -1, -1, 3833, 3834, -1, 3836, -1, -1, -1, -1, -1, 8, -1, -1, 11, -1, -1, -1, 15, 16, 17, -1, -1, -1, -1, -1, 5259, -1, -1, -1, -1, -1, -1, -1, -1, 32, -1, -1, -1, -1, -1, -1, 5275, 40, -1, 252, -1, 254, 5281, 5282, 47, -1, -1, -1, -1, -1, -1, 264, 2865, -1, 2867, -1, -1, -1, -1, 823, 273, -1, -1, -1, -1, -1, -1, -1, -1, 72, -1, -1, 285, -1, -1, -1, -1, 2890, 2891, -1, 461, -1, -1, 464, 465, 466, -1, 468, 469, 470, 471, 472, 473, -1, -1, 859, -1, 478, 2728, 3936, -1, -1, 3939, -1, -1, -1, -1, -1, -1, -1, 5349, 324, -1, -1, 327, 328, 5355, -1, 8, -1, -1, 11, -1, -1, -1, 15, 16, 17, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 32, -1, 357, -1, -1, -1, -1, -1, 40, -1, -1, -1, -1, -1, -1, 47, -1, -1, -1, -1, -1, -1, -1, -1, -1, 931, -1, 4006, 4007, 4008, -1, 4010, 4011, 4012, 4013, 4014, -1, 182, -1, -1, 72, -1, 187, -1, -1, -1, 952, -1, -1, -1, 22, -1, -1, -1, -1, -1, 28, -1, 964, -1, -1, -1, -1, 969, 209, 210, -1, -1, -1, 424, -1, -1, -1, 979, -1, 5456, -1, -1, 984, 224, -1, -1, -1, -1, -1, -1, -1, 993, 5469, -1, -1, -1, 998, -1, -1, 1001, -1, -1, 70, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5491, 5492, 257, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 271, -1, -1, 274, -1, -1, -1, 8, -1, -1, 11, 1043, -1, -1, 15, 16, 17, -1, -1, -1, -1, -1, -1, -1, 182, -1, 124, -1, -1, 187, -1, 32, -1, 131, -1, 4140, 134, 4142, -1, 40, -1, -1, -1, -1, -1, -1, 47, -1, -1, -1, -1, 209, 210, -1, -1, -1, -1, -1, -1, -1, -1, 159, -1, -1, -1, -1, 224, -1, -1, -1, -1, 72, -1, 8, -1, -1, 11, -1, -1, -1, 15, 16, 17, -1, -1, -1, -1, -1, -1, -1, -1, 362, -1, -1, -1, 193, -1, 32, 2996, 257, 2998, 2999, 3000, -1, -1, 40, -1, -1, -1, -1, -1, -1, 47, 271, -1, -1, 274, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1158, -1, 1160, -1, 1162, -1, 1164, -1, 1166, 1167, 1168, 72, -1, -1, -1, 1173, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1184, -1, 252, -1, 254, -1, -1, -1, -1, -1, -1, -1, -1, -1, 264, -1, -1, -1, -1, -1, 1204, -1, -1, 273, -1, -1, -1, -1, -1, 182, 3263, -1, -1, -1, 187, 285, -1, -1, 461, -1, -1, 464, 465, 466, -1, 468, 469, 470, 471, 472, 473, -1, 362, -1, 3287, 478, 209, 210, -1, -1, -1, -1, 4319, 4320, -1, -1, -1, -1, -1, -1, -1, 224, -1, 4330, 324, 4332, 4333, 327, 328, 4336, -1, 8, -1, -1, 11, -1, -1, -1, 15, 16, 17, -1, -1, -1, -1, 182, -1, -1, -1, -1, 187, -1, -1, -1, 257, 32, -1, 357, -1, -1, -1, -1, -1, 40, -1, -1, -1, -1, 271, -1, 47, 274, 209, 210, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 224, -1, 3372, -1, -1, -1, 4400, -1, 72, -1, -1, -1, -1, -1, 461, -1, -1, 464, 465, 466, -1, 468, 469, 470, 471, 472, 473, -1, -1, -1, -1, 478, -1, 257, -1, -1, -1, 424, -1, -1, -1, -1, -1, 1364, 4438, -1, -1, 271, 3235, -1, 274, -1, -1, -1, -1, -1, 8, -1, -1, 11, 22, -1, -1, 15, 16, 17, 28, -1, -1, -1, -1, -1, 362, -1, -1, -1, -1, 4471, -1, -1, 32, -1, -1, 3453, -1, -1, -1, -1, 40, -1, -1, -1, -1, -1, -1, 47, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 70, -1, -1, -1, -1, -1, -1, -1, -1, -1, 182, -1, 72, -1, -1, 187, -1, 1446, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 362, -1, -1, -1, -1, -1, -1, 209, 210, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 224, -1, 124, -1, -1, -1, -1, -1, -1, 131, -1, 461, 134, -1, 464, 465, 466, -1, 468, 469, 470, 471, 472, 473, -1, -1, -1, -1, 478, -1, -1, -1, -1, 257, -1, -1, 1517, 159, -1, -1, -1, -1, -1, -1, -1, -1, -1, 271, -1, -1, 274, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3407, -1, -1, -1, -1, -1, -1, 4621, -1, -1, 182, 193, -1, -1, -1, 187, -1, 461, -1, -1, 464, 465, 466, -1, 468, 469, 470, 471, 472, 473, -1, -1, 8, -1, 478, 11, -1, 209, 210, 15, 16, 17, -1, -1, -1, -1, -1, -1, -1, -1, 4664, -1, 224, -1, -1, -1, -1, -1, -1, 4673, -1, -1, -1, -1, 40, -1, 8, -1, -1, 11, 252, 47, 254, 15, 16, 17, -1, -1, 362, -1, -1, -1, 264, -1, -1, 257, -1, -1, -1, -1, 32, 273, -1, -1, 36, -1, 72, -1, 40, 271, -1, -1, 274, 285, -1, 47, -1, -1, -1, 8, -1, -1, 11, -1, -1, -1, 15, 16, 17, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 8, 72, -1, 11, 32, -1, -1, 15, 16, 17, -1, -1, 40, 324, -1, -1, 327, 328, 3737, 47, -1, -1, -1, -1, 32, -1, -1, -1, -1, -1, -1, -1, 40, -1, -1, -1, -1, -1, -1, 47, -1, -1, 3761, -1, 72, -1, 357, -1, 461, 3768, 121, 464, 465, 466, -1, 468, 469, 470, 471, 472, 473, 362, -1, -1, 72, 478, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 182, -1, -1, -1, -1, 187, -1, -1, -1, -1, -1, -1, -1, -1, 1761, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 209, 210, -1, -1, -1, -1, -1, 182, -1, 424, -1, -1, 187, -1, -1, 224, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3850, 3851, -1, 3670, 3671, 3672, 3673, 209, 210, -1, -1, -1, -1, -1, -1, 56, 4890, -1, -1, 158, 4894, 257, 224, 182, 163, -1, -1, -1, 187, 461, -1, -1, 464, 465, 466, 271, 468, 469, 470, 471, 472, 473, -1, 182, 476, -1, -1, -1, 187, 90, 209, 210, -1, -1, -1, 257, -1, -1, -1, -1, -1, -1, -1, -1, -1, 224, -1, -1, -1, 271, 209, 210, 274, -1, -1, -1, -1, -1, -1, 120, -1, -1, -1, -1, -1, 224, 1887, -1, 1889, 3939, -1, -1, -1, -1, -1, -1, -1, -1, 257, -1, -1, -1, -1, -1, -1, 1906, -1, 1908, 149, -1, -1, -1, 271, -1, -1, 274, -1, -1, 257, -1, -1, 1922, -1, 1924, -1, 1926, 362, 1928, -1, 1930, -1, -1, 271, 1934, -1, 274, -1, -1, 3988, -1, 299, -1, -1, 184, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 362, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3845, 220, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3860, -1, -1, -1, -1, -1, -1, -1, -1, -1, 362, -1, 5079, -1, -1, -1, 5083, -1, 5085, -1, 254, -1, 5089, 5090, -1, -1, 421, 379, -1, -1, 362, -1, 461, -1, -1, 464, 465, 466, -1, 468, 469, 470, 471, 472, 473, -1, -1, -1, -1, -1, -1, 285, 286, -1, -1, -1, -1, -1, 292, -1, -1, -1, -1, -1, -1, -1, 461, -1, -1, 464, 465, 466, -1, 468, 469, 470, 471, 472, 473, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 324, -1, -1, -1, 328, -1, -1, -1, 332, -1, -1, -1, -1, -1, -1, -1, -1, 341, -1, 461, -1, -1, 464, 465, 466, 349, 468, 469, 470, 471, 472, 473, -1, 357, -1, -1, -1, -1, -1, 461, -1, -1, 464, 465, 466, 369, 468, 469, 470, 471, 472, 473, -1, -1, 378, -1, -1, -1, 382, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2164, 2165, -1, -1, -1, -1, -1, 4220, -1, -1, -1, -1, 4225, -1, -1, -1, 4229, -1, -1, 2183, 2184, -1, -1, -1, 2188, 2189, -1, -1, -1, 2193, -1, 435, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4254, 4255, 2207, -1, -1, 4259, 4260, -1, -1, 2214, -1, -1, -1, 2218, 2219, -1, -1, 2222, 2223, -1, -1, -1, -1, -1, 2229, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2244, -1, 2246, -1, -1, -1, -1, 5324, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2265, -1, -1, -1, -1, 2270, -1, -1, -1, -1, -1, -1, -1, -1, 199, 200, -1, -1, -1, 2284, -1, -1, 207, -1, 209, 210, -1, -1, 2293, -1, -1, 2296, -1, -1, 2299, 2300, 2301, -1, 223, -1, -1, 2306, 2307, -1, -1, -1, -1, -1, -1, -1, -1, 2316, -1, -1, 8, -1, 2321, 11, -1, -1, 2325, 15, 16, 17, -1, -1, -1, -1, -1, -1, 5408, -1, 8, -1, -1, 11, 2341, -1, 32, 15, 16, 17, -1, 2348, 2349, -1, 40, -1, -1, 2354, -1, -1, -1, 47, -1, -1, 32, -1, -1, 35, 2365, 2366, -1, -1, 40, 2370, -1, -1, -1, -1, -1, 47, -1, -1, -1, -1, -1, 2382, 72, -1, 2385, -1, -1, -1, -1, 2390, -1, -1, -1, -1, 2395, 2396, -1, 5471, -1, 2400, 72, -1, 2403, -1, -1, -1, 2407, 2408, 2409, 2410, -1, 2412, -1, -1, -1, 5489, -1, -1, -1, -1, -1, -1, -1, -1, 2425, 2426, -1, 2428, -1, -1, -1, -1, -1, -1, 4301, -1, -1, 2438, 2439, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4316, -1, -1, -1, -1, -1, -1, -1, 8, -1, -1, 11, -1, -1, -1, 15, 16, 17, 157, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 32, -1, -1, -1, -1, -1, -1, -1, 40, -1, -1, 182, -1, -1, -1, 47, 187, -1, 2500, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 182, -1, -1, -1, -1, 187, -1, -1, -1, 209, 210, 72, -1, -1, -1, -1, -1, 2528, -1, -1, -1, -1, -1, -1, 224, -1, -1, 209, 210, -1, 4407, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 224, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 257, -1, -1, -1, 4621, -1, -1, -1, -1, -1, -1, -1, -1, -1, 271, -1, -1, 274, 257, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 271, -1, -1, 274, -1, -1, -1, -1, 297, -1, -1, -1, -1, -1, -1, -1, -1, 8, -1, -1, 11, -1, -1, -1, 15, 16, 17, -1, -1, -1, -1, -1, 182, -1, -1, -1, -1, 187, -1, -1, -1, 32, -1, -1, 35, -1, -1, -1, -1, 40, -1, -1, -1, -1, -1, -1, 47, -1, -1, 209, 210, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 362, 224, -1, -1, -1, -1, -1, -1, 72, -1, -1, -1, -1, -1, -1, -1, -1, -1, 362, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 22, -1, -1, -1, 626, 257, 28, -1, -1, -1, 632, -1, -1, -1, -1, 4583, 4584, 4585, -1, 271, -1, -1, 274, 645, -1, -1, -1, 2729, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 661, -1, 293, -1, -1, -1, -1, -1, -1, 70, -1, -1, -1, -1, 675, 676, -1, -1, -1, -1, -1, 682, -1, 684, 685, -1, -1, -1, -1, -1, -1, 461, -1, -1, 464, 465, 466, 698, 468, 469, 470, 471, 472, 473, -1, -1, -1, 708, -1, 461, 182, -1, 464, 465, 466, 187, 468, 469, 470, 471, 472, 473, -1, 124, -1, -1, -1, -1, -1, -1, 131, 362, -1, 134, -1, -1, -1, 209, 210, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 224, -1, -1, -1, -1, -1, 159, -1, 4890, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 257, -1, -1, -1, -1, -1, -1, 193, -1, 4741, 796, -1, -1, -1, 271, -1, -1, 274, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 820, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 461, -1, 833, 464, 465, 466, -1, 468, 469, 470, 471, 472, 473, -1, -1, -1, -1, 8, -1, -1, 11, 252, -1, 254, 15, 16, 17, -1, -1, -1, -1, -1, -1, 264, -1, -1, -1, -1, -1, -1, -1, 32, 273, -1, -1, -1, -1, -1, -1, 40, -1, -1, -1, -1, 285, -1, 47, -1, -1, -1, 362, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2984, -1, -1, -1, 2988, -1, -1, -1, 72, -1, 2994, -1, -1, -1, -1, -1, -1, -1, -1, -1, 324, -1, -1, 327, 328, -1, -1, -1, 3012, 3013, -1, -1, 4882, 3017, 4884, -1, 5069, 941, 3022, 3023, 3024, -1, 3026, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 357, -1, 959, -1, -1, -1, -1, -1, 965, -1, -1, 968, 3049, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3059, 3060, 3061, 3062, -1, -1, -1, -1, -1, -1, -1, 461, -1, -1, 464, 465, 466, -1, 468, 469, 470, 471, 472, 473, 163, -1, 8, -1, -1, 11, -1, -1, -1, 15, 16, 17, 3095, -1, -1, 3098, 3099, 3100, -1, 182, -1, 424, -1, -1, 187, -1, 32, -1, -1, 35, -1, -1, -1, 3116, 40, -1, -1, -1, -1, -1, -1, 47, -1, -1, -1, -1, 209, 210, -1, -1, -1, -1, -1, 3136, -1, -1, -1, -1, -1, -1, -1, 224, -1, -1, -1, -1, 72, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5039, -1, 56, -1, 257, 8, -1, -1, 11, -1, -1, -1, 15, 16, 17, -1, -1, -1, 271, -1, -1, 274, -1, -1, 1117, -1, -1, -1, -1, 32, -1, -1, -1, -1, -1, 3208, 90, 40, -1, -1, -1, -1, 1135, 3216, 47, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1153, -1, -1, -1, -1, -1, 120, -1, -1, 72, -1, -1, -1, -1, 3247, -1, -1, -1, -1, 5118, -1, -1, -1, -1, -1, -1, 182, -1, 1181, -1, -1, 187, -1, -1, -1, 149, -1, 3270, -1, -1, -1, -1, -1, -1, 1197, -1, -1, -1, -1, 362, -1, -1, -1, 209, 210, -1, -1, -1, -1, -1, 1213, -1, -1, -1, 1217, -1, -1, -1, 224, -1, 184, -1, -1, -1, -1, 8, -1, -1, 11, -1, -1, -1, 15, 16, 17, -1, -1, -1, -1, 3322, -1, -1, -1, -1, 3327, -1, -1, -1, -1, 32, -1, 257, 35, -1, -1, -1, 220, 40, -1, -1, -1, -1, -1, -1, 47, 271, -1, -1, 274, 182, -1, -1, 5221, -1, 187, -1, 5408, -1, 3361, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 72, 254, -1, -1, -1, -1, -1, 209, 210, 461, -1, -1, 464, 465, 466, -1, 468, 469, 470, 471, 472, 473, 224, -1, -1, -1, -1, -1, 3400, -1, 3402, -1, 285, 286, -1, -1, -1, -1, -1, 292, -1, -1, -1, 1335, -1, -1, -1, -1, -1, -1, 5471, 1343, 1344, -1, -1, 257, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1357, -1, 362, 5489, 271, 3442, 324, 274, -1, -1, 328, 200, -1, -1, 332, 5318, -1, -1, -1, -1, 209, -1, -1, 341, -1, -1, -1, -1, -1, -1, -1, 349, -1, -1, 223, -1, -1, -1, -1, 357, -1, -1, -1, -1, -1, 182, -1, 5350, 5351, -1, 187, 369, -1, 1410, -1, -1, -1, -1, -1, -1, 378, -1, -1, -1, 382, -1, -1, -1, -1, -1, -1, -1, 209, 210, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 224, -1, -1, -1, -1, -1, -1, -1, 362, -1, -1, -1, -1, -1, 461, -1, -1, 464, 465, 466, -1, 468, 469, 470, 471, 472, 473, -1, -1, -1, 435, -1, -1, 257, 8, -1, -1, 11, -1, -1, 394, 15, 16, 17, -1, -1, -1, 271, -1, -1, 274, -1, -1, -1, -1, -1, -1, -1, 32, -1, -1, -1, -1, 5453, -1, -1, 40, -1, -1, -1, -1, -1, -1, 47, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 72, -1, -1, -1, -1, -1, -1, -1, -1, 461, -1, -1, 464, 465, 466, -1, 468, 469, 470, 471, 472, 473, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3656, -1, 3658, -1, -1, -1, 362, -1, -1, 3665, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3681, -1, -1, 1604, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3697, -1, -1, -1, -1, 201, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 213, -1, 3716, -1, -1, -1, -1, -1, -1, -1, -1, 224, -1, -1, -1, -1, -1, -1, 182, -1, 3734, -1, -1, 187, -1, -1, -1, -1, -1, -1, 3744, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 209, 210, 461, -1, 3763, 464, 465, 466, -1, 468, 469, 470, 471, 472, 473, 224, 37, 3776, 3777, 3778, -1, -1, -1, -1, 3783, 3784, 3785, 3786, -1, -1, -1, 3790, 3791, -1, -1, -1, -1, 3796, 3797, 60, 3799, 3800, 3801, 3802, 3803, 3804, -1, 3806, 257, -1, -1, -1, 73, -1, -1, -1, 3815, -1, -1, 3818, 3819, -1, 271, 84, -1, 274, -1, 88, -1, -1, -1, -1, -1, 1752, 22, -1, -1, -1, -1, -1, 28, -1, -1, 3842, -1, 106, -1, 35, -1, -1, -1, 112, -1, -1, -1, -1, -1, 1776, -1, -1, -1, -1, 3861, -1, -1, 1784, 54, -1, 129, -1, -1, -1, 22, -1, -1, 626, -1, 1796, 28, 140, -1, 632, 70, -1, -1, 35, -1, 148, -1, -1, -1, -1, -1, -1, 645, -1, -1, -1, -1, 160, -1, -1, -1, -1, 54, -1, -1, 168, -1, -1, 661, 172, -1, 362, -1, -1, 104, -1, -1, -1, 70, -1, -1, -1, -1, 676, -1, -1, -1, -1, 191, -1, -1, 684, -1, -1, 124, -1, -1, -1, -1, -1, -1, 131, -1, -1, 134, 698, 1867, 1868, -1, 1870, 1871, -1, 104, -1, -1, 708, -1, -1, -1, -1, 3961, 1882, -1, 1884, 1885, 228, -1, -1, -1, 159, -1, -1, 124, -1, 237, -1, 1897, 1898, -1, 131, -1, -1, 134, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1913, -1, 3995, -1, -1, -1, -1, -1, 190, -1, -1, 193, -1, -1, -1, 159, 271, -1, 461, 274, -1, 464, 465, 466, -1, 468, 469, 470, 471, 472, 473, -1, 1945, -1, -1, 1948, 1949, -1, -1, -1, 295, -1, -1, -1, -1, -1, 190, -1, -1, 193, -1, 796, -1, -1, 309, -1, 238, -1, -1, 241, -1, 316, -1, -1, -1, -1, -1, -1, -1, -1, 252, -1, 254, -1, -1, 820, -1, -1, -1, -1, 335, -1, 264, -1, -1, -1, -1, -1, 833, 344, -1, 273, -1, -1, 238, -1, 351, 241, -1, 354, -1, -1, 284, 285, -1, -1, -1, -1, 252, -1, 254, -1, -1, -1, -1, 607, -1, -1, 373, -1, 264, 613, -1, -1, 2037, 380, -1, -1, -1, 273, -1, 386, -1, -1, 389, 390, -1, 392, 393, -1, 284, 285, 324, -1, -1, 327, 328, 329, 403, -1, -1, -1, -1, 408, -1, -1, -1, -1, -1, 414, -1, -1, 417, -1, -1, 420, -1, -1, -1, 351, -1, -1, -1, -1, -1, 357, -1, -1, 433, -1, 324, -1, -1, 327, 328, 329, -1, -1, -1, 371, -1, -1, -1, -1, 2107, -1, 941, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 351, -1, -1, -1, 4204, -1, 357, -1, 4208, 4209, 4210, 4211, -1, -1, 4214, -1, -1, -1, -1, -1, 371, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 424, -1, -1, -1, -1, -1, -1, -1, 2163, -1, -1, 4246, 4247, 4248, -1, 4250, -1, 4252, 4253, -1, -1, -1, -1, -1, -1, -1, 2181, -1, -1, 4264, 4265, 2186, 2187, -1, -1, -1, 2191, -1, 424, -1, -1, -1, -1, -1, 2199, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4291, -1, -1, 793, -1, 20, 2217, -1, -1, -1, 25, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 812, 4314, -1, -1, -1, -1, 2239, -1, -1, 2242, 2243, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 834, 60, -1, -1, -1, -1, -1, -1, 2263, -1, -1, -1, -1, -1, 73, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2282, 2283, 88, 1117, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 880, 106, 1135, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4393, 2314, 2315, -1, -1, 2318, -1, -1, 1153, -1, -1, -1, 129, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 140, -1, -1, -1, 2340, -1, 2342, -1, 148, -1, -1, 2347, -1, 1181, -1, -1, -1, 2353, -1, -1, 160, -1, -1, -1, 2360, 165, -1, -1, 2364, 1197, -1, -1, 172, 2369, -1, 4451, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1213, -1, -1, -1, 1217, -1, 191, -1, 2389, -1, -1, -1, -1, 2394, -1, -1, -1, 2398, -1, -1, 2401, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2411, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2424, -1, 1005, -1, -1, -1, -1, -1, -1, 237, 2434, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1034, 1035, 1036, -1, -1, -1, -1, -1, -1, -1, -1, -1, 271, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 284, 4561, -1, -1, -1, -1, -1, -1, -1, -1, -1, 295, -1, -1, -1, -1, -1, -1, -1, 2499, -1, 305, 306, 1335, -1, 309, -1, -1, -1, -1, -1, 1343, 1344, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1357, -1, -1, -1, -1, -1, 335, -1, -1, 338, -1, -1, -1, 342, -1, 344, -1, -1, 4623, -1, -1, -1, 351, -1, -1, 354, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4641, -1, -1, -1, -1, 4646, 4647, -1, 373, -1, -1, -1, -1, -1, -1, 380, -1, 1410, -1, 2580, -1, 386, -1, -1, 389, -1, -1, -1, 393, -1, -1, -1, -1, -1, -1, -1, 401, -1, 403, -1, 1180, -1, -1, 408, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 420, -1, 4698, -1, -1, -1, -1, -1, 1203, -1, -1, -1, -1, 433, -1, -1, -1, 1212, -1, 2635, 20, -1, 4718, -1, 4720, 25, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4735, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4755, 60, 2677, -1, -1, -1, -1, 4762, -1, -1, -1, -1, -1, -1, 73, 74, -1, -1, -1, -1, 2695, -1, -1, -1, -1, 84, -1, -1, 2703, 88, -1, -1, -1, -1, -1, -1, -1, -1, 2713, -1, -1, 2716, -1, -1, 2719, -1, -1, 106, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 129, -1, 4827, -1, -1, -1, -1, -1, -1, -1, -1, 140, -1, -1, -1, -1, -1, -1, -1, 148, -1, -1, -1, -1, 4849, 1349, -1, 1604, -1, -1, -1, 160, -1, -1, -1, 4860, 165, -1, -1, -1, 2785, -1, -1, -1, -1, -1, 2791, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 191, -1, -1, -1, -1, -1, -1, -1, -1, 1395, -1, -1, -1, -1, -1, -1, -1, -1, 790, 791, -1, -1, -1, -1, -1, 216, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4923, -1, -1, -1, -1, -1, -1, -1, -1, -1, 237, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2867, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 271, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1477, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1487, 4989, -1, 295, -1, -1, -1, -1, -1, -1, -1, -1, 1752, 305, 306, -1, -1, 309, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1518, -1, -1, -1, -1, 1776, -1, -1, -1, -1, -1, -1, 335, 1784, -1, 338, -1, 2956, 2957, 342, -1, 344, -1, 1541, -1, 1796, 1544, -1, 351, -1, 5049, 354, -1, -1, -1, 939, 940, -1, -1, -1, -1, -1, -1, -1, 2983, 5064, -1, 2986, -1, -1, 373, -1, -1, -1, -1, -1, -1, 380, -1, -1, -1, -1, -1, 386, -1, -1, 389, -1, -1, -1, 393, -1, -1, -1, -1, -1, 1594, -1, 401, -1, 403, -1, -1, -1, -1, 408, -1, -1, -1, 5108, 1608, -1, -1, -1, -1, -1, -1, -1, -1, 1870, 1871, -1, -1, -1, 5123, -1, -1, -1, -1, -1, 433, -1, -1, 1884, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1897, 1898, -1, -1, -1, -1, 3071, 3072, 3073, -1, -1, -1, -1, -1, -1, -1, 1913, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3094, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3114, -1, -1, -1, -1, -1, -1, -1, -1, -1, 671, 5205, -1, -1, -1, -1, -1, -1, -1, 3133, -1, -1, -1, -1, -1, -1, 1719, -1, -1, -1, -1, -1, -1, -1, -1, -1, 697, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5249, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1770, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2037, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3215, -1, -1, -1, -1, 1799, -1, -1, -1, -1, -1, -1, 1806, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5337, -1, -1, -1, -1, 3262, -1, 1229, -1, -1, -1, -1, 3269, -1, 3271, -1, -1, -1, 2107, -1, -1, -1, -1, -1, -1, -1, -1, 3284, -1, 3286, -1, -1, -1, -1, -1, -1, -1, 1259, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 25, -1, -1, 3308, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1287, 1288, 1289, -1, 1291, -1, -1, -1, -1, 2163, 1911, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1311, -1, -1, 2181, -1, -1, 3352, 73, 2186, 2187, -1, -1, -1, 2191, -1, -1, -1, -1, -1, -1, -1, 2199, 88, -1, -1, -1, 1951, 1952, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2217, 106, -1, -1, 1968, -1, -1, 112, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3403, -1, -1, -1, -1, 955, 129, -1, -1, -1, -1, 1379, -1, -1, -1, 1383, 1384, 140, 3421, -1, -1, -1, -1, -1, -1, 148, -1, -1, 2263, -1, 980, -1, -1, -1, -1, -1, -1, 160, -1, -1, 3443, -1, 165, 3446, -1, 995, -1, 2282, 2283, 172, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 191, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2314, 2315, -1, -1, 2318, -1, 2067, -1, -1, -1, -1, -1, -1, -1, 216, -1, 2077, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2340, -1, 2342, -1, -1, -1, -1, 2347, -1, 237, -1, -1, -1, 2353, -1, -1, -1, -1, 3526, 2106, 2360, -1, -1, -1, 2364, 1080, -1, -1, -1, 2369, 2117, 2118, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 271, -1, -1, -1, -1, -1, 2389, -1, -1, -1, -1, 2394, -1, -1, -1, 2398, -1, -1, 2401, -1, -1, 2151, -1, -1, 295, -1, -1, -1, 2411, -1, -1, -1, -1, -1, 305, 306, -1, -1, 309, -1, -1, 2424, 671, -1, -1, -1, -1, -1, -1, -1, -1, 2434, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 335, -1, -1, 338, 697, -1, -1, 342, -1, 344, -1, -1, -1, -1, -1, -1, 351, -1, -1, 354, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1195, -1, -1, -1, -1, 373, 1619, 1620, 1621, -1, -1, -1, 380, -1, -1, -1, -1, 385, 386, 2499, -1, 389, -1, -1, -1, 393, -1, -1, -1, -1, -1, -1, 3680, -1, -1, 403, -1, -1, -1, -1, 408, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 420, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 433, -1, -1, 2295, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3731, 2311, -1, -1, -1, 3736, -1, 3738, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2580, -1, -1, -1, 2331, -1, -1, -1, -1, -1, -1, -1, 3760, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3779, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1338, -1, -1, -1, 3795, -1, -1, 3798, -1, -1, -1, -1, 2635, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2405, 2406, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2677, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1404, -1, -1, -1, 939, -1, 2695, -1, -1, -1, -1, -1, -1, -1, 2703, -1, -1, -1, -1, -1, 955, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3887, 3888, -1, -1, -1, -1, -1, -1, -1, -1, 3897, -1, -1, -1, -1, 980, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3916, 995, -1, -1, -1, -1, -1, -1, 1471, -1, -1, -1, -1, -1, -1, 2510, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2785, -1, -1, -1, -1, -1, 2791, -1, -1, -1, -1, -1, 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, 3991, -1, -1, -1, -1, -1, -1, 1545, -1, -1, -1, 1080, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1990, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2867, -1, -1, 2003, -1, 2005, -1, -1, 2008, 2009, 2010, -1, -1, -1, -1, 2015, -1, -1, 2018, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2033, 2034, 2035, 2036, -1, -1, -1, -1, 2041, -1, -1, -1, 2045, -1, -1, 2048, -1, -1, 2051, 2052, 2053, 2054, 2055, 2056, 2057, 2058, 2059, -1, 2061, -1, -1, -1, -1, -1, -1, 2068, -1, 2070, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1195, -1, -1, -1, -1, -1, -1, 2956, 2957, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2113, -1, -1, 2983, -1, -1, 2986, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2137, 2138, -1, 1722, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 671, -1, 1739, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1757, -1, -1, 4213, -1, -1, 697, -1, 4218, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3071, 3072, 3073, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4251, -1, -1, -1, 2220, -1, -1, -1, -1, -1, -1, 3094, 4263, -1, -1, 1813, -1, -1, -1, -1, -1, -1, 2852, -1, -1, -1, -1, -1, 1826, -1, -1, 3114, -1, -1, -1, -1, -1, -1, -1, 4290, 1838, -1, -1, -1, -1, 2875, -1, -1, -1, -1, 3133, -1, 1850, -1, -1, -1, -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, 1894, 1895, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3215, -1, -1, -1, 4387, -1, -1, -1, -1, -1, 1471, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3262, -1, -1, -1, 1512, -1, -1, 3269, -1, 3271, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3284, -1, 3286, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4465, -1, 1545, -1, -1, -1, -1, -1, -1, 955, -1, 3308, -1, -1, -1, -1, -1, -1, -1, -1, 2032, 2451, 2452, 2453, -1, -1, -1, 2457, -1, -1, -1, -1, -1, -1, 980, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 995, -1, -1, -1, -1, -1, 3352, -1, -1, -1, 2489, -1, -1, -1, -1, -1, -1, -1, -1, 3112, -1, -1, -1, -1, -1, -1, -1, 1619, 1620, 1621, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3403, -1, -1, -1, 4575, -1, 4577, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3421, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1080, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3443, -1, -1, 3446, -1, -1, -1, -1, -1, -1, -1, 4622, 2170, -1, -1, -1, 2174, 2175, -1, -1, 4631, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1722, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1739, -1, -1, -1, -1, -1, -1, -1, 4669, -1, -1, -1, -1, 4674, -1, -1, -1, -1, 1757, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2236, -1, -1, -1, -1, 3526, -1, 3275, 3276, 3277, -1, -1, -1, -1, 2250, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3292, 1195, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1813, 3315, -1, -1, -1, -1, -1, -1, -1, 2291, -1, 3325, 3326, 1826, -1, -1, 3330, -1, -1, -1, -1, -1, -1, -1, -1, 1838, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2736, 1850, -1, -1, -1, 2741, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2766, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2777, -1, 2779, 2780, 1894, 1895, -1, -1, -1, -1, -1, -1, -1, 2790, -1, -1, 2793, -1, 2795, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3680, -1, -1, -1, -1, 4853, -1, -1, -1, -1, -1, 2824, -1, 2826, 3441, 2828, -1, 3444, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 671, 4878, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4890, -1, -1, -1, -1, -1, -1, -1, -1, 3731, -1, -1, -1, 697, 3736, -1, 3738, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2883, -1, -1, -1, -1, 1404, -1, -1, -1, -1, 3760, -1, -1, -1, -1, 2898, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2490, -1, -1, -1, 3779, -1, -1, -1, -1, -1, -1, 2032, -1, -1, -1, -1, -1, -1, -1, -1, 3795, -1, -1, 3798, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1471, -1, 2070, 3572, 3573, 3574, -1, 2962, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 671, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2572, -1, -1, 2575, -1, -1, 1512, -1, -1, -1, -1, -1, -1, -1, 697, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3887, 3888, -1, -1, -1, -1, -1, -1, -1, 1545, 3897, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5077, -1, 5079, -1, -1, -1, -1, 3916, -1, -1, -1, -1, -1, -1, -1, 2170, -1, -1, -1, 2174, 2175, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2693, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2236, 3991, -1, 955, -1, 2710, -1, -1, -1, -1, -1, -1, -1, -1, 2250, -1, 5174, -1, -1, -1, 2725, -1, -1, -1, -1, -1, -1, -1, 980, -1, -1, -1, -1, -1, 5192, -1, -1, -1, -1, -1, -1, -1, -1, 995, -1, -1, -1, -1, 5206, -1, -1, -1, -1, -1, -1, 2291, -1, -1, -1, -1, -1, 5219, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1722, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3220, -1, -1, 1739, -1, -1, 3226, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1757, -1, -1, 3858, -1, 5281, 5282, -1, -1, -1, 1080, -1, -1, -1, 3869, -1, -1, -1, -1, -1, -1, 955, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3900, 980, -1, 5324, -1, -1, -1, -1, -1, -1, -1, 1813, -1, -1, -1, -1, 995, -1, -1, -1, -1, -1, -1, -1, 1826, -1, -1, -1, -1, -1, -1, -1, -1, 3933, -1, -1, 1838, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1850, -1, -1, -1, -1, -1, 2453, -1, -1, -1, -1, -1, 4213, -1, -1, 2931, -1, 4218, 2934, -1, 2936, -1, -1, -1, -1, 2941, -1, -1, -1, -1, -1, -1, 1195, 3981, -1, -1, -1, -1, -1, 5408, -1, -1, -1, 2490, 1894, 1895, -1, -1, -1, -1, 4251, -1, -1, 1080, -1, -1, -1, -1, -1, -1, -1, -1, 4263, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2990, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4290, -1, -1, -1, 3009, -1, -1, -1, -1, -1, -1, -1, -1, 5471, -1, -1, 671, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3034, -1, 5489, -1, 5491, 5492, -1, 2572, -1, -1, 2575, -1, -1, 697, 3466, -1, -1, -1, -1, -1, -1, -1, -1, 3475, -1, -1, -1, -1, -1, 3481, -1, 3483, -1, -1, 4100, 4101, 4102, 4103, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1195, -1, -1, -1, -1, -1, -1, -1, 3510, 3511, -1, -1, -1, -1, 2032, -1, -1, -1, 4387, -1, 3104, -1, 3106, -1, -1, -1, 3528, -1, -1, -1, -1, -1, -1, -1, 3536, -1, -1, 3539, -1, 3541, -1, -1, -1, -1, -1, -1, -1, -1, 3550, -1, -1, -1, -1, -1, -1, -1, 3558, 3559, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1404, -1, -1, -1, -1, 2693, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3590, -1, -1, -1, -1, -1, -1, 2710, 4465, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2725, 3195, -1, 3615, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3631, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1471, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3234, -1, 2170, -1, -1, -1, 2174, 2175, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3263, -1, 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, 4575, -1, 4577, 1404, -1, -1, -1, -1, 1545, -1, -1, -1, 2236, -1, -1, 955, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2250, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 980, -1, 3332, -1, -1, -1, -1, 4622, -1, -1, -1, -1, -1, -1, -1, 995, -1, -1, -1, -1, -1, -1, -1, 3353, -1, -1, -1, 2291, -1, -1, 1471, -1, -1, -1, -1, -1, -1, 3367, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4669, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2931, 1512, -1, 2934, -1, 2936, -1, -1, -1, -1, 2941, 4443, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1080, -1, -1, -1, 1545, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2990, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3469, -1, -1, -1, -1, -1, 1722, -1, -1, 3009, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3490, -1, 1739, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3034, -1, -1, -1, -1, -1, -1, 1757, -1, -1, -1, -1, 3515, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3944, 3945, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1195, -1, -1, -1, 3549, -1, -1, -1, -1, -1, -1, 2490, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1813, -1, 4853, -1, -1, -1, -1, 3104, -1, 3106, -1, -1, -1, 1826, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1838, -1, 4878, -1, -1, -1, -1, 4016, -1, -1, -1, -1, 1850, -1, 4890, -1, -1, -1, 4027, -1, 1722, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1739, -1, -1, -1, -1, -1, -1, -1, -1, 3637, 2572, -1, -1, 2575, -1, -1, -1, 4677, 1757, 1894, 1895, -1, 4068, 4069, -1, -1, -1, -1, -1, 4075, 4076, -1, 4692, -1, 4080, -1, 3195, 4697, -1, 4085, -1, -1, 4088, 4089, -1, -1, -1, 4093, -1, -1, -1, -1, -1, 4099, -1, -1, -1, -1, -1, -1, -1, 3220, -1, 4723, -1, -1, -1, 3226, -1, -1, -1, -1, -1, -1, 1813, 3234, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1826, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1838, -1, -1, -1, -1, 3263, 4151, -1, -1, -1, 3737, -1, 1850, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1404, -1, -1, -1, -1, 2693, 4178, 3761, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2710, -1, -1, -1, -1, -1, -1, 1894, 1895, 2032, -1, -1, -1, -1, -1, 2725, 5077, -1, 5079, -1, -1, -1, -1, -1, -1, 3332, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4844, -1, -1, -1, -1, -1, -1, -1, -1, 1471, 3353, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3367, -1, -1, -1, -1, -1, -1, -1, 671, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4279, 1512, -1, -1, -1, -1, -1, -1, -1, 697, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5174, -1, 3891, -1, -1, -1, 1545, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5192, -1, 4941, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2032, -1, 2170, -1, -1, -1, 2174, 2175, -1, 4348, -1, -1, -1, 5219, -1, -1, -1, 3469, 3939, -1, -1, -1, 3943, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3490, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3515, -1, -1, -1, -1, 2236, -1, -1, -1, -1, -1, -1, -1, 2931, -1, -1, 2934, -1, 2936, 2250, -1, -1, -1, 2941, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3549, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5324, -1, -1, -1, -1, 2291, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2990, -1, -1, 2170, -1, -1, -1, 2174, 2175, -1, -1, -1, -1, -1, -1, 4071, 1722, -1, -1, 3009, -1, -1, -1, -1, -1, 4081, -1, -1, -1, -1, -1, -1, -1, 1739, -1, -1, -1, -1, 4512, 4513, -1, -1, 4516, -1, 3034, -1, -1, -1, -1, -1, 3637, 1757, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5408, -1, 2236, -1, -1, 955, -1, -1, -1, -1, -1, -1, 4553, 4554, -1, -1, 2250, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4570, 980, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1813, -1, -1, -1, -1, 995, -1, 3104, -1, 3106, -1, -1, -1, 1826, -1, -1, -1, 2291, -1, -1, -1, -1, -1, 5471, -1, 1838, -1, -1, -1, -1, -1, -1, -1, 4196, -1, -1, -1, 1850, -1, -1, -1, 5489, -1, 3737, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3761, -1, -1, -1, -1, 4235, -1, -1, -1, -1, -1, -1, -1, 2490, 1894, 1895, -1, -1, -1, -1, -1, -1, -1, 1080, -1, -1, 4256, -1, -1, -1, -1, 3195, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3234, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4321, -1, -1, -1, 2572, -1, -1, 2575, 3263, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 671, -1, -1, -1, -1, -1, -1, -1, 4771, -1, -1, -1, -1, -1, -1, 3891, -1, -1, -1, -1, -1, -1, -1, 1195, -1, -1, 697, -1, -1, -1, -1, -1, -1, -1, 2490, 4798, -1, 2032, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4812, -1, -1, -1, 3332, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3939, -1, -1, -1, 3943, -1, -1, -1, -1, -1, -1, 3353, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3367, -1, -1, -1, -1, -1, -1, -1, 4441, -1, -1, -1, -1, 2693, -1, -1, -1, -1, -1, -1, 4871, -1, -1, -1, -1, -1, -1, -1, 2572, -1, 2710, 2575, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2725, -1, -1, -1, -1, -1, -1, -1, -1, 4487, -1, -1, -1, -1, -1, -1, 4912, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2170, -1, -1, -1, 2174, 2175, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3469, -1, -1, -1, -1, 4071, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4081, -1, -1, -1, -1, -1, 3490, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1404, -1, -1, -1, 3515, 2693, -1, -1, -1, 2236, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2710, 2250, -1, -1, -1, -1, -1, -1, -1, 5026, -1, -1, -1, -1, -1, 2725, 3549, -1, -1, -1, -1, -1, 4621, -1, -1, -1, -1, -1, -1, -1, 955, -1, -1, -1, -1, 5052, -1, -1, -1, -1, -1, -1, 2291, -1, -1, 1471, -1, -1, -1, -1, -1, -1, -1, -1, -1, 980, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4196, -1, -1, -1, 995, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2931, 1512, -1, 2934, -1, 2936, -1, -1, -1, -1, 2941, -1, -1, -1, -1, -1, -1, -1, -1, 3637, 4235, -1, -1, -1, -1, -1, -1, 5129, -1, -1, -1, -1, -1, -1, 1545, -1, -1, -1, -1, -1, -1, 4256, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2990, -1, 4745, 5164, 5165, 5166, -1, -1, -1, -1, -1, 1080, -1, -1, -1, -1, -1, -1, -1, 3009, -1, -1, 5183, -1, -1, -1, 4769, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3034, -1, -1, 4321, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3737, -1, -1, -1, -1, 4808, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2931, -1, -1, 2934, -1, 2936, -1, 3761, -1, -1, 2941, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2490, -1, -1, -1, -1, -1, -1, 5265, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3104, -1, 3106, -1, 4861, -1, -1, -1, 5283, 4866, 4867, -1, 1195, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2990, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1722, -1, -1, 3009, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4439, -1, 4441, -1, 1739, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2572, 3034, -1, 2575, -1, -1, -1, -1, 1757, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3195, -1, -1, -1, -1, -1, -1, -1, 4487, 3891, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5394, -1, -1, -1, -1, -1, 4982, -1, -1, -1, 1813, 3234, -1, -1, -1, -1, -1, 3104, -1, 3106, -1, -1, -1, 1826, -1, -1, -1, -1, -1, 3939, -1, -1, -1, 3943, 5428, 1838, -1, -1, -1, -1, 3263, -1, -1, -1, 5438, -1, -1, 1850, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2693, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2710, -1, -1, -1, -1, -1, -1, 1894, 1895, -1, -1, -1, -1, -1, -1, 2725, -1, -1, 1404, -1, -1, -1, -1, -1, 3195, 3332, -1, -1, -1, -1, 4621, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3353, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3367, -1, -1, 3234, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4071, -1, -1, -1, -1, -1, -1, -1, 1471, -1, 4081, -1, -1, -1, -1, 3263, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5177, -1, -1, -1, -1, -1, -1, -1, -1, 1512, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2032, -1, -1, -1, -1, -1, -1, -1, -1, 4745, -1, -1, -1, -1, 1545, -1, 3332, 3469, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4769, -1, -1, -1, 3353, 3490, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3367, -1, -1, -1, -1, -1, 4196, -1, -1, -1, -1, -1, 3515, -1, -1, -1, -1, -1, -1, -1, -1, 4808, -1, -1, -1, 2931, -1, -1, 2934, -1, 2936, -1, -1, -1, -1, 2941, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4235, 3549, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4256, -1, -1, -1, -1, -1, -1, -1, 4861, -1, -1, -1, -1, 4866, 4867, -1, -1, -1, 2990, -1, -1, 2170, -1, -1, -1, 2174, 2175, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3469, 3009, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3490, -1, -1, -1, -1, 3034, -1, -1, 4321, -1, -1, 3637, -1, -1, -1, -1, -1, 1722, -1, -1, -1, -1, -1, -1, -1, 3515, -1, -1, -1, -1, 2236, -1, -1, -1, 1739, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2250, -1, -1, -1, -1, -1, -1, -1, 1757, -1, -1, -1, -1, -1, -1, 3549, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4981, 4982, -1, -1, 3104, -1, 3106, -1, -1, -1, -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, 1813, -1, -1, 3737, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1826, -1, -1, -1, -1, -1, -1, 4441, -1, -1, -1, -1, 1838, -1, 3761, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1850, -1, 3637, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3195, -1, -1, -1, -1, -1, -1, -1, 4487, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1894, 1895, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3234, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3263, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3737, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3891, -1, 5177, -1, -1, -1, 3761, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2490, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3332, -1, -1, -1, -1, 4621, -1, -1, -1, -1, 3939, -1, -1, -1, 3943, -1, -1, -1, -1, -1, -1, 3353, -1, -1, 2032, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3367, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2572, -1, -1, 2575, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3891, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4745, -1, -1, -1, -1, -1, -1, -1, 3469, -1, -1, -1, -1, 4071, -1, -1, -1, 3939, -1, -1, -1, 3943, -1, 4081, 4769, -1, -1, -1, -1, 3490, -1, -1, -1, 2170, -1, -1, -1, 2174, 2175, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3515, 2693, -1, -1, -1, -1, -1, -1, -1, 4808, -1, -1, -1, -1, -1, -1, -1, -1, 2710, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2725, 3549, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2236, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2250, -1, -1, 4861, -1, -1, -1, -1, 4866, 4867, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4196, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4071, -1, -1, -1, -1, 2291, -1, -1, -1, -1, 4081, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3637, 4235, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1303, -1, -1, -1, -1, -1, -1, 4256, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4982, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1361, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4321, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4196, -1, 3737, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2931, -1, -1, 2934, -1, 2936, -1, 3761, -1, -1, 2941, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4235, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4256, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2990, 2490, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3009, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4441, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3034, -1, -1, 4321, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4487, 3891, -1, 5177, -1, -1, 2572, -1, -1, 2575, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3104, -1, 3106, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3939, -1, -1, -1, 3943, -1, -1, -1, -1, -1, -1, -1, -1, -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, -1, 1629, -1, 4441, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2693, 3195, -1, -1, -1, -1, -1, 4621, -1, 4487, -1, -1, -1, -1, -1, -1, -1, 2710, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2725, -1, -1, -1, -1, -1, -1, -1, 3234, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4071, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4081, -1, -1, -1, -1, 3263, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4745, -1, -1, -1, -1, -1, -1, 3332, -1, -1, -1, -1, 4621, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4769, -1, -1, -1, 3353, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3367, -1, -1, -1, -1, -1, 4196, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4808, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4235, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2931, 4256, -1, 2934, -1, 2936, -1, -1, -1, 4861, 2941, -1, -1, -1, 4866, 4867, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4745, -1, -1, -1, -1, -1, -1, -1, 3469, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4769, -1, -1, -1, -1, 3490, 2990, -1, -1, -1, -1, -1, -1, 4321, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3009, -1, -1, -1, 1988, 3515, -1, -1, -1, -1, -1, -1, -1, -1, 4808, -1, -1, -1, 2002, -1, -1, -1, 2006, -1, -1, 3034, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2020, 2021, 2022, 3549, 2024, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4982, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4861, -1, -1, -1, -1, 4866, 4867, -1, -1, -1, -1, -1, -1, -1, -1, 2066, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3104, -1, 3106, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4441, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3637, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2124, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2136, -1, 4487, -1, -1, 2141, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3195, -1, 4982, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3234, -1, 3737, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5177, -1, -1, -1, 3761, -1, -1, 3263, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4621, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3332, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3353, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3367, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3891, -1, 5177, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4745, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3939, -1, -1, -1, 3943, -1, -1, 4769, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3469, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4808, -1, -1, -1, -1, -1, 3490, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3515, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4861, -1, -1, -1, -1, 4866, 4867, -1, -1, -1, -1, -1, 3549, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4071, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4081, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3637, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4982, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4196, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4235, -1, -1, 3737, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4256, -1, -1, -1, -1, -1, 3761, -1, -1, 2739, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2759, -1, 2761, -1, -1, 2764, 2765, -1, 2767, -1, 2769, -1, -1, -1, 2773, -1, -1, 2776, -1, -1, -1, -1, 2781, -1, -1, -1, -1, -1, 2787, -1, -1, -1, -1, 2792, -1, -1, 4321, -1, -1, -1, 2799, 2800, 2801, 2802, -1, -1, -1, 2806, 2807, -1, 2809, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2821, -1, 2823, -1, -1, -1, -1, 5177, -1, 2830, 2831, 2832, 2833, 2834, 2835, 2836, 2837, 2838, 2839, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3891, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2876, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3939, 4441, -1, -1, 3943, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4487, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2977, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4071, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4081, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4621, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4196, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4235, -1, -1, -1, -1, -1, -1, -1, -1, 4745, -1, -1, -1, -1, 3224, 3225, -1, -1, -1, 3229, -1, 4256, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4769, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3258, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4808, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4321, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4861, -1, -1, -1, -1, 4866, 4867, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4441, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4982, -1, -1, -1, -1, -1, 4487, -1, -1, 3465, -1, -1, -1, -1, -1, 3471, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3487, 3488, -1, -1, 3491, 3492, 3493, 3494, -1, -1, 3497, 3498, 3499, 3500, 3501, 3502, 3503, 3504, 3505, 3506, 3507, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3529, -1, -1, 3532, -1, 3534, -1, -1, 3537, 3538, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3552, 3553, 3554, 3555, -1, 3557, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4621, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3646, -1, -1, -1, -1, 5177, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4745, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4769, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4808, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4861, -1, -1, -1, -1, 4866, 4867, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3862, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4982, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4017, -1, -1, -1, 4021, 4022, 4023, -1, -1, -1, -1, -1, 4029, 4030, 4031, 4032, -1, -1, -1, -1, 4037, 4038, 4039, 4040, 4041, 4042, 4043, 4044, 4045, 4046, 4047, 4048, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4074, -1, -1, 4077, -1, 4079, -1, -1, -1, 4083, -1, -1, 4086, 4087, -1, -1, 4090, 4091, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4137, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4150, -1, 5177, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4163, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4351, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4436, 4437, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4477, -1, -1, -1, -1, 4482, 4483, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4500, -1, 4502, -1, -1, -1, 4506, 4507, 4508, -1, -1, 4511, -1, -1, 4514, 4515, -1, -1, -1, 4519, -1, -1, -1, 4523, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4579, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4642, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4679, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4767, 4768, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4782, 4783, 4784, -1, -1, -1, -1, -1, -1, -1, 4792, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4819, 4820, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4831, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4994, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5007, -1, -1, 5010, -1, -1, -1, 5014, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5063, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5100, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5171, -1, 5173, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5204, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5258, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5286, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5347, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5382, 5383, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5434, 5435, -1, -1, -1, 5439, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3, 4, 5, 6, 7, 8, 9, 10, -1, -1, -1, -1, -1, -1, 5466, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, -1, -1, -1, -1, 34, -1, -1, 37, 38, -1, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, 73, -1, 75, 76, 77, 78, 79, 80, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, 126, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, 162, -1, 164, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, 197, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, -1, -1, 220, 221, 222, 223, 224, -1, 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, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, 388, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, -1, 414, 415, 416, 417, 418, 419, 420, -1, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, -1, -1, -1, -1, -1, -1, 468, 469, 470, -1, -1, -1, -1, -1, -1, 477, 478, 3, 4, 5, 6, 7, 8, 9, 10, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, 34, -1, -1, 37, 38, -1, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, 73, -1, 75, 76, 77, 78, 79, 80, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, 162, -1, 164, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, 197, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, -1, -1, 220, 221, 222, 223, 224, -1, 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, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 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, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, -1, 414, 415, 416, 417, 418, 419, 420, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, 431, 432, 433, 434, 435, -1, -1, 438, -1, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, -1, 463, -1, -1, -1, -1, 468, 469, -1, -1, -1, -1, -1, -1, -1, 477, 478, 3, 4, 5, 6, 7, 8, 9, 10, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, 34, -1, -1, 37, 38, -1, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, 73, -1, 75, 76, 77, 78, 79, 80, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, 162, -1, 164, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, 197, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, -1, -1, 220, 221, 222, 223, 224, -1, 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, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, 388, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, -1, 414, 415, 416, 417, 418, 419, 420, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, 431, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, -1, -1, -1, -1, -1, -1, 468, 469, -1, -1, -1, -1, -1, -1, -1, 477, 478, 3, 4, 5, 6, 7, 8, 9, 10, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, 34, -1, -1, 37, 38, -1, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, 73, -1, 75, 76, 77, 78, 79, 80, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, 162, -1, 164, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, 197, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, -1, -1, 220, 221, 222, 223, 224, -1, 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, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, 388, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, -1, 414, 415, 416, 417, 418, 419, 420, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, 431, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, -1, -1, -1, -1, -1, -1, 468, 469, -1, -1, -1, -1, -1, -1, -1, 477, 478, 3, 4, 5, 6, 7, 8, 9, 10, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, 34, -1, -1, 37, 38, -1, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, 73, -1, 75, 76, 77, 78, 79, 80, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, 162, -1, 164, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, 197, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, -1, -1, 220, 221, 222, 223, 224, -1, 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, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, 388, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, -1, 414, 415, 416, 417, 418, 419, 420, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, 431, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, -1, -1, 3, -1, -1, -1, 468, 469, -1, -1, -1, -1, -1, -1, -1, 477, 478, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, 35, -1, 37, 38, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, -1, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, -1, -1, 75, 76, 77, 78, 79, -1, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, 92, 93, 94, 95, -1, -1, -1, -1, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, -1, -1, 164, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, -1, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, 197, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, -1, -1, 211, 212, 213, 214, 215, 216, 217, -1, -1, 220, 221, 222, 223, -1, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, -1, 255, 256, -1, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, -1, 280, -1, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, -1, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, -1, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, -1, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, -1, -1, -1, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 478, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, 43, 44, 45, 46, -1, 48, 49, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, -1, -1, 73, -1, 75, 76, 77, 78, 79, 80, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, 92, 93, 94, 95, -1, -1, -1, 99, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, -1, 147, 148, 149, -1, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, 162, -1, 164, 165, 166, 167, 168, -1, 170, -1, -1, -1, 174, 175, -1, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, -1, 196, 197, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, -1, -1, 220, -1, 222, 223, 224, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, -1, -1, 255, 256, 257, 258, -1, -1, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, 279, 280, 281, -1, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, -1, 297, -1, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, 334, 335, 336, 337, 338, 339, -1, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, -1, 382, -1, 384, 385, -1, 387, 388, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, -1, 403, -1, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, -1, 428, 429, 430, 431, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 458, 459, 460, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, 478, -1, -1, 37, 38, -1, 40, 41, 42, 43, 44, 45, 46, -1, 48, 49, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, -1, -1, 73, -1, 75, 76, 77, 78, 79, 80, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, 92, 93, 94, 95, -1, -1, -1, 99, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, -1, 147, 148, 149, -1, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, 162, -1, 164, 165, 166, 167, 168, -1, 170, -1, -1, -1, 174, 175, -1, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, -1, 196, 197, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, -1, -1, 220, -1, 222, 223, 224, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, -1, -1, 255, 256, 257, 258, -1, -1, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, 279, 280, 281, -1, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, -1, 297, -1, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, 334, 335, 336, 337, 338, 339, -1, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, -1, 382, -1, 384, 385, -1, 387, 388, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, -1, 403, -1, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, -1, 428, 429, 430, 431, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, -1, 3, 4, 5, 6, 7, 8, 9, 10, -1, -1, 458, 459, 460, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, 478, 34, -1, -1, 37, 38, -1, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, 73, -1, 75, 76, 77, 78, 79, 80, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, 162, -1, 164, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, 197, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, -1, -1, 220, 221, 222, 223, 224, -1, 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, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 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, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, -1, 414, 415, 416, 417, 418, 419, 420, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, 431, 432, 433, 434, 435, -1, -1, 438, -1, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, -1, 463, -1, -1, -1, -1, 468, 469, -1, -1, -1, -1, -1, -1, -1, 477, 3, 4, 5, 6, 7, 8, 9, 10, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, 34, -1, -1, 37, 38, -1, 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, -1, 67, 68, 69, 70, 71, -1, 73, -1, 75, 76, 77, 78, 79, 80, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, 162, 163, 164, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, 197, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, -1, 219, 220, 221, 222, 223, 224, -1, 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, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, 388, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, -1, 414, 415, 416, 417, 418, 419, 420, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, 431, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, -1, -1, -1, -1, -1, -1, 468, 469, -1, -1, -1, -1, -1, -1, -1, 477, 3, 4, 5, 6, 7, 8, 9, 10, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, 34, -1, -1, 37, 38, -1, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, 73, -1, 75, 76, 77, 78, 79, 80, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, 162, -1, 164, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, 197, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, -1, -1, 220, 221, 222, 223, 224, -1, 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, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, 388, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, -1, 414, 415, 416, 417, 418, 419, 420, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, 431, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, -1, -1, -1, -1, -1, -1, 468, 469, -1, -1, -1, -1, -1, 475, 476, 477, 3, 4, 5, 6, 7, 8, 9, 10, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, 34, -1, -1, 37, 38, -1, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, 73, -1, 75, 76, 77, 78, 79, 80, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, 162, -1, 164, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, 197, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, -1, -1, 220, 221, 222, 223, 224, -1, 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, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, 388, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, -1, 414, 415, 416, 417, 418, 419, 420, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, 431, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, -1, -1, -1, -1, -1, -1, 468, 469, 470, -1, -1, -1, -1, -1, -1, 477, 3, 4, 5, 6, 7, 8, 9, 10, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, -1, -1, -1, -1, 34, -1, -1, 37, 38, -1, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, 73, -1, 75, 76, 77, 78, 79, 80, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, 162, -1, 164, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, 197, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, -1, -1, 220, 221, 222, 223, 224, -1, 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, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, 388, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, -1, 414, 415, 416, 417, 418, 419, 420, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, 431, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, -1, -1, -1, -1, -1, -1, 468, 469, -1, -1, -1, -1, -1, -1, -1, 477, 3, 4, 5, 6, 7, 8, 9, 10, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, 34, -1, -1, 37, 38, -1, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, 73, -1, 75, 76, 77, 78, 79, 80, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, 162, -1, 164, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, 197, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, -1, -1, 220, 221, 222, 223, 224, -1, 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, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, 388, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, -1, 414, 415, 416, 417, 418, 419, 420, -1, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, -1, -1, -1, -1, -1, -1, 468, 469, -1, -1, -1, -1, -1, -1, -1, 477, 3, 4, 5, 6, 7, 8, 9, 10, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, 34, -1, -1, 37, 38, -1, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, 73, -1, 75, 76, 77, 78, 79, 80, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, 162, 163, 164, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, 197, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, -1, -1, 220, 221, 222, 223, 224, -1, 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, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, 388, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, -1, 414, 415, 416, 417, 418, 419, 420, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, 431, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, -1, -1, -1, -1, -1, -1, 468, 469, -1, -1, -1, -1, -1, -1, -1, 477, 3, 4, 5, 6, 7, 8, 9, 10, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, 34, -1, -1, 37, 38, -1, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, 73, -1, 75, 76, 77, 78, 79, 80, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, 162, -1, 164, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, 197, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, -1, -1, 220, 221, 222, 223, 224, -1, 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, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, 388, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, -1, 414, 415, 416, 417, 418, 419, 420, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, 431, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, -1, -1, -1, -1, -1, -1, 468, 469, -1, -1, -1, -1, -1, -1, -1, 477, 3, 4, 5, 6, 7, 8, 9, 10, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, 34, -1, -1, 37, 38, -1, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, 73, -1, 75, 76, 77, 78, 79, 80, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, 162, -1, 164, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, 197, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, -1, -1, 220, 221, 222, 223, 224, -1, 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, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, 388, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, -1, 414, 415, 416, 417, 418, 419, 420, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, 431, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, -1, -1, -1, -1, -1, -1, 468, 469, -1, -1, -1, -1, -1, -1, -1, 477, 3, 4, 5, 6, 7, 8, 9, 10, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, 34, -1, -1, 37, 38, -1, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, 73, -1, 75, 76, 77, 78, 79, 80, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, 162, -1, 164, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, 197, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, -1, -1, 220, 221, 222, 223, 224, -1, 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, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, 388, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, -1, 414, 415, 416, 417, 418, 419, 420, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, 431, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, -1, -1, -1, -1, -1, -1, 468, 469, -1, -1, -1, -1, -1, -1, -1, 477, 3, 4, 5, 6, 7, 8, 9, 10, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, 34, -1, -1, 37, 38, -1, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, 73, -1, 75, 76, 77, 78, 79, 80, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, 162, -1, 164, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, 197, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, -1, -1, 220, 221, 222, 223, 224, -1, 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, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, 388, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, -1, 414, 415, 416, 417, 418, 419, 420, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, 431, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, -1, -1, -1, -1, -1, -1, 468, 469, -1, -1, -1, -1, -1, -1, -1, 477, 3, 4, 5, 6, 7, 8, 9, 10, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, 34, -1, -1, 37, 38, -1, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, 73, -1, 75, 76, 77, 78, 79, 80, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, 162, -1, 164, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, 197, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, -1, -1, 220, 221, 222, 223, 224, -1, 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, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, 388, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, -1, 414, 415, 416, 417, 418, 419, 420, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, 431, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, -1, -1, -1, -1, -1, -1, 468, 469, -1, -1, -1, -1, -1, -1, -1, 477, 3, 4, 5, 6, 7, 8, 9, 10, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, 34, -1, -1, 37, 38, -1, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, 73, -1, 75, 76, 77, 78, 79, 80, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, 162, -1, 164, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, 197, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, -1, -1, 220, 221, 222, 223, 224, -1, 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, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, 388, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, -1, 414, 415, 416, 417, 418, 419, 420, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, 431, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, -1, -1, -1, -1, -1, -1, 468, 469, -1, -1, -1, -1, -1, -1, -1, 477, 3, 4, 5, 6, 7, 8, 9, 10, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, 34, -1, -1, 37, 38, -1, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, 73, -1, 75, 76, 77, 78, 79, 80, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, 162, -1, 164, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, 197, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, -1, -1, 220, 221, 222, 223, 224, -1, 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, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, 388, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, -1, 414, 415, 416, 417, 418, 419, 420, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, 431, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, -1, -1, -1, -1, -1, -1, 468, 469, -1, -1, -1, -1, -1, -1, -1, 477, 3, 4, 5, 6, 7, 8, 9, 10, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, 34, -1, -1, 37, 38, -1, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, 73, -1, 75, 76, 77, 78, 79, 80, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, 162, -1, 164, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, 197, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, -1, -1, 220, 221, 222, 223, 224, -1, 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, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, 388, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, -1, 414, 415, 416, 417, 418, 419, 420, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, 431, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, -1, -1, -1, -1, -1, -1, 468, 469, -1, -1, -1, -1, -1, -1, -1, 477, 3, 4, 5, 6, 7, 8, 9, 10, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, 34, -1, -1, 37, 38, -1, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, 73, -1, 75, 76, 77, 78, 79, 80, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, 162, -1, 164, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, 197, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, -1, -1, 220, 221, 222, 223, 224, -1, 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, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, 388, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, -1, 414, 415, 416, 417, 418, 419, 420, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, 431, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, -1, -1, -1, -1, -1, -1, 468, 469, -1, -1, -1, -1, -1, -1, -1, 477, 3, 4, 5, 6, 7, 8, 9, 10, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, 34, -1, -1, 37, 38, -1, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, 73, -1, 75, 76, 77, 78, 79, 80, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, 162, -1, 164, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, 197, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, -1, -1, 220, 221, 222, 223, 224, -1, 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, -1, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, 388, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, 420, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, 431, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, -1, -1, -1, -1, -1, -1, -1, 468, 469, -1, -1, -1, -1, -1, -1, -1, 477, 3, 4, 5, 6, 7, 8, 9, 10, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, 34, -1, -1, 37, 38, -1, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, 73, -1, 75, 76, 77, 78, 79, 80, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, 162, -1, 164, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, 197, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, -1, -1, 211, 212, 213, 214, 215, 216, 217, -1, -1, 220, 221, 222, 223, 224, -1, 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, -1, 258, 259, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, 388, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, -1, 414, 415, 416, 417, 418, 419, 420, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, 431, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, -1, -1, -1, -1, -1, -1, 468, 469, -1, -1, -1, -1, -1, -1, -1, 477, 3, 4, 5, 6, 7, 8, 9, 10, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, 34, -1, -1, 37, 38, -1, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, 73, -1, 75, 76, 77, 78, 79, 80, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, 162, -1, 164, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, 197, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, -1, -1, 220, 221, 222, 223, 224, -1, 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, -1, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, 388, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, 420, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, 431, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, -1, -1, -1, -1, -1, -1, -1, 468, 469, -1, -1, 3, 4, 5, 6, 7, 477, 9, 10, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, 34, -1, -1, 37, 38, -1, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, 73, -1, 75, 76, 77, 78, 79, 80, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, 162, -1, 164, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, 197, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, -1, -1, 220, 221, 222, 223, 224, -1, 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, -1, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, 388, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, 420, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, 431, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, -1, -1, -1, -1, -1, -1, -1, 468, 469, -1, -1, -1, -1, -1, -1, -1, 477, 3, 4, 5, 6, 7, 8, 9, 10, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, 34, -1, -1, 37, 38, -1, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, 73, -1, 75, 76, 77, 78, 79, 80, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, 162, -1, 164, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, 197, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, -1, 210, 211, 212, 213, 214, 215, 216, 217, -1, -1, 220, 221, 222, 223, 224, -1, 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, -1, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, 388, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, 420, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, 431, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, -1, -1, -1, -1, -1, -1, -1, 468, 469, -1, -1, 3, 4, 5, 6, 7, 477, 9, 10, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, 34, -1, -1, 37, 38, -1, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, 73, -1, 75, 76, 77, 78, 79, 80, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, 162, -1, 164, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, 197, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, -1, -1, 220, 221, 222, 223, 224, -1, 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, -1, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, 388, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, 420, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, 431, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, -1, -1, 3, 4, 5, 6, 7, -1, 9, 10, -1, -1, -1, -1, -1, -1, 477, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, 34, -1, -1, 37, 38, -1, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, 73, -1, 75, 76, 77, 78, 79, 80, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, 162, -1, 164, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, 197, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, -1, -1, 220, 221, 222, 223, 224, -1, 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, -1, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, 388, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, 420, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, 431, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, -1, -1, 3, 4, 5, 6, 7, -1, 9, 10, -1, -1, -1, -1, -1, -1, 477, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, 34, -1, -1, 37, 38, -1, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, 73, -1, 75, 76, 77, 78, 79, 80, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, 162, -1, 164, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, 197, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, -1, -1, 220, 221, 222, 223, 224, -1, 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, -1, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, 388, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, 420, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, 431, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, -1, -1, 3, 4, 5, 6, 7, 8, 9, 10, -1, -1, -1, -1, -1, -1, 477, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, 34, -1, -1, 37, 38, -1, 40, 41, 42, 43, 44, 45, 46, -1, 48, 49, 50, 51, -1, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, 73, -1, 75, 76, 77, 78, 79, 80, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, -1, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, 162, -1, 164, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, -1, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, 197, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, -1, -1, 211, 212, 213, 214, 215, 216, 217, -1, -1, 220, 221, 222, 223, -1, -1, 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, -1, 258, 259, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, -1, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, 388, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, -1, 414, 415, 416, 417, 418, 419, 420, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, 431, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, -1, -1, 3, -1, -1, -1, -1, 468, 469, -1, -1, -1, -1, -1, -1, -1, 477, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, 60, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, 73, -1, 75, 76, 77, 78, 79, 80, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, 162, -1, 164, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, 197, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, -1, 220, 221, 222, 223, 224, -1, 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, -1, 255, 256, 257, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, 270, 271, 272, 273, -1, -1, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 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, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, 420, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, 431, 432, 433, 434, 435, -1, -1, 438, -1, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, -1, -1, 463, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 477, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, 60, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, 73, -1, 75, 76, 77, 78, 79, 80, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, 162, -1, 164, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, 197, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, -1, 220, 221, 222, 223, 224, -1, 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, -1, 255, 256, 257, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, 270, 271, 272, 273, -1, -1, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, 388, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, 420, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, 431, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, -1, -1, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 477, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, 60, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, 73, -1, 75, 76, 77, 78, 79, 80, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, 162, -1, 164, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, 197, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, -1, -1, 220, 221, 222, 223, 224, -1, 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, -1, 255, 256, 257, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, 388, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, 420, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, 431, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, -1, -1, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 477, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, 60, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, 73, -1, 75, 76, 77, 78, 79, 80, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, 162, -1, 164, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, 197, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, -1, -1, 220, 221, 222, 223, 224, -1, 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, -1, 255, 256, 257, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, 388, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, 420, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, 431, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, -1, -1, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 477, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, 60, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, 73, -1, 75, 76, 77, 78, 79, 80, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, 162, -1, 164, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, 197, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, -1, -1, 220, 221, 222, 223, 224, -1, 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, -1, 255, 256, 257, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, 388, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, 420, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, 431, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, -1, -1, 3, 4, 5, -1, -1, -1, 9, -1, -1, -1, -1, -1, -1, -1, 477, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, 73, -1, 75, 76, 77, 78, 79, 80, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, 92, 93, 94, 95, -1, -1, -1, 99, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, 162, -1, 164, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, 197, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, -1, -1, 220, 221, 222, 223, 224, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, -1, 255, 256, 257, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, 269, -1, 271, 272, 273, -1, -1, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, 388, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, 431, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, -1, -1, 3, -1, -1, -1, -1, 468, 469, 470, -1, -1, -1, -1, -1, -1, 477, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, 30, 31, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, 73, -1, 75, 76, 77, 78, 79, 80, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, 92, 93, 94, 95, -1, -1, -1, 99, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, 162, -1, 164, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, 197, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, -1, -1, 220, 221, 222, 223, 224, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, -1, 255, 256, 257, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, 431, 432, 433, 434, 435, -1, -1, 438, -1, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, -1, -1, 463, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 477, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, 73, -1, 75, 76, 77, 78, 79, 80, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, 92, 93, 94, 95, -1, -1, -1, 99, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, 162, -1, 164, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, 197, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, -1, -1, 220, 221, 222, 223, 224, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, -1, 255, 256, 257, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, 388, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, 431, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, -1, -1, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 477, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, -1, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, -1, -1, 75, 76, 77, 78, 79, -1, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, -1, 93, 94, 95, -1, -1, -1, -1, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, -1, -1, -1, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, -1, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, -1, -1, 211, -1, 213, 214, 215, 216, 217, -1, -1, 220, 221, -1, 223, -1, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, 250, 251, 252, 253, -1, 255, 256, -1, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, -1, 280, -1, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, -1, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, 386, 387, -1, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, -1, 432, 433, 434, 435, -1, -1, 438, -1, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, -1, -1, 463, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 477, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, -1, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, -1, -1, 75, 76, 77, 78, 79, -1, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, -1, 93, 94, 95, -1, -1, -1, -1, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, -1, -1, -1, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, -1, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, -1, -1, 211, -1, 213, 214, 215, 216, 217, -1, -1, 220, 221, -1, 223, -1, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, 250, 251, 252, 253, -1, 255, 256, -1, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, -1, 280, -1, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, -1, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, -1, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, -1, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, -1, -1, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 477, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, -1, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, -1, -1, 75, 76, 77, 78, 79, -1, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, -1, 93, 94, 95, -1, -1, -1, -1, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, -1, -1, -1, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, -1, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, -1, -1, 211, -1, 213, 214, 215, 216, 217, -1, -1, 220, 221, -1, 223, -1, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, 250, 251, 252, 253, -1, 255, 256, -1, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, -1, 280, -1, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, -1, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, -1, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, -1, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, -1, -1, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 477, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, -1, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, -1, -1, 75, 76, 77, 78, 79, -1, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, -1, 93, 94, 95, -1, -1, -1, -1, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, -1, -1, -1, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, -1, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, -1, -1, 211, -1, 213, 214, 215, 216, 217, -1, -1, 220, 221, -1, 223, -1, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, 250, 251, 252, 253, -1, 255, 256, -1, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, -1, 280, -1, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, -1, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, -1, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, -1, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, -1, -1, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 477, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, -1, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, -1, -1, 75, 76, 77, 78, 79, -1, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, -1, 93, 94, 95, -1, -1, -1, -1, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, -1, -1, -1, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, -1, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, -1, -1, 211, -1, 213, 214, 215, 216, 217, -1, -1, 220, 221, -1, 223, -1, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, 250, 251, 252, 253, -1, 255, 256, -1, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, -1, 280, -1, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, -1, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, -1, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, -1, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, -1, -1, -1, -1, -1, 3, 4, 5, -1, -1, 8, 9, -1, -1, -1, -1, 477, 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, -1, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, -1, 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, -1, 147, 148, 149, -1, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, -1, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, -1, 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, -1, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, -1, 279, 280, 281, -1, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, 295, -1, 297, -1, 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, -1, 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, -1, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, -1, 403, -1, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, -1, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 458, 459, 460, -1, -1, -1, 464, 465, 466, -1, 468, 469, 470, 471, 472, 473, 3, 4, 5, -1, -1, 8, 9, -1, -1, -1, -1, -1, 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, -1, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, -1, 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, -1, 147, 148, 149, -1, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, -1, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, -1, 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, -1, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, -1, 279, 280, 281, -1, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, 295, -1, 297, -1, 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, -1, 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, -1, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, -1, 403, -1, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, -1, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 458, 459, 460, -1, 3, -1, 464, 465, 466, 8, 468, 469, 470, 471, 472, 473, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, -1, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, -1, -1, 75, 76, 77, 78, 79, -1, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, -1, 93, 94, 95, -1, -1, -1, -1, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, -1, -1, -1, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, -1, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, -1, -1, 211, -1, 213, 214, 215, 216, 217, -1, -1, 220, 221, -1, 223, -1, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, 250, 251, 252, 253, -1, 255, 256, -1, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, -1, 280, -1, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, -1, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, -1, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, -1, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, -1, 3, -1, 464, 465, 466, 8, 468, 469, 470, 471, 472, 473, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, -1, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, -1, -1, 75, 76, 77, 78, 79, -1, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, -1, 93, 94, 95, -1, -1, -1, -1, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, -1, -1, -1, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, -1, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, -1, -1, 211, -1, 213, 214, 215, 216, 217, -1, -1, 220, 221, -1, 223, -1, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, 250, 251, 252, 253, -1, 255, 256, -1, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, -1, 280, -1, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, -1, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, -1, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, -1, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, -1, 3, -1, 464, 465, 466, 8, 468, 469, 470, 471, 472, 473, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, -1, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, -1, -1, 75, 76, 77, 78, 79, -1, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, -1, 93, 94, 95, -1, -1, -1, -1, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, -1, -1, -1, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, -1, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, -1, -1, 211, -1, 213, 214, 215, 216, 217, -1, -1, 220, 221, -1, 223, -1, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, 250, 251, 252, 253, -1, 255, 256, -1, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, -1, 280, -1, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, -1, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, -1, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, -1, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, -1, 3, -1, 464, 465, 466, 8, 468, 469, 470, 471, 472, 473, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, -1, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, -1, -1, 75, 76, 77, 78, 79, -1, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, -1, 93, 94, 95, -1, -1, -1, -1, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, -1, -1, -1, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, -1, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, -1, -1, 211, -1, 213, 214, 215, 216, 217, -1, -1, 220, 221, -1, 223, -1, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, 250, 251, 252, 253, -1, 255, 256, -1, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, -1, 280, -1, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, -1, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, -1, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, -1, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, -1, 3, -1, 464, 465, 466, 8, 468, 469, 470, 471, 472, 473, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, -1, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, -1, -1, 75, 76, 77, 78, 79, -1, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, -1, 93, 94, 95, -1, -1, -1, -1, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, -1, -1, -1, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, -1, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, -1, -1, 211, -1, 213, 214, 215, 216, 217, -1, -1, 220, 221, -1, 223, -1, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, 250, 251, 252, 253, -1, 255, 256, -1, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, -1, 280, -1, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, -1, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, -1, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, -1, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, -1, 3, -1, 464, 465, 466, 8, 468, 469, 470, 471, 472, 473, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, -1, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, -1, -1, 75, 76, 77, 78, 79, -1, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, -1, 93, 94, 95, -1, -1, -1, -1, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, -1, -1, -1, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, -1, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, -1, -1, 211, -1, 213, 214, 215, 216, 217, -1, -1, 220, 221, -1, 223, -1, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, 250, 251, 252, 253, -1, 255, 256, -1, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, -1, 280, -1, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, -1, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, -1, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, -1, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, -1, 3, -1, 464, 465, 466, 8, 468, 469, 470, 471, 472, 473, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, -1, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, -1, -1, 75, 76, 77, 78, 79, -1, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, -1, 93, 94, 95, -1, -1, -1, -1, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, -1, -1, -1, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, -1, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, -1, -1, 211, -1, 213, 214, 215, 216, 217, -1, -1, 220, 221, -1, 223, -1, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, 250, 251, 252, 253, -1, 255, 256, -1, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, -1, 280, -1, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, -1, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, -1, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, -1, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, -1, 464, 465, 466, -1, 468, 469, 470, 471, 472, 473, -1, -1, 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, -1, 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, 3, -1, -1, -1, -1, -1, -1, -1, -1, 470, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, -1, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, -1, -1, 75, 76, 77, 78, 79, -1, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, -1, 93, 94, 95, -1, -1, -1, -1, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, -1, -1, -1, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, -1, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, -1, -1, 211, -1, 213, 214, 215, 216, 217, -1, -1, 220, 221, -1, 223, -1, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, 250, 251, 252, 253, -1, 255, 256, -1, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, -1, 280, -1, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, -1, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, -1, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, -1, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, -1, -1, -1, -1, -1, -1, -1, 470, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, -1, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, -1, -1, 75, 76, 77, 78, 79, -1, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, -1, 93, 94, 95, -1, -1, -1, -1, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, -1, -1, -1, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, -1, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, -1, -1, 211, -1, 213, 214, 215, 216, 217, -1, -1, 220, 221, -1, 223, -1, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, 250, 251, 252, 253, -1, 255, 256, -1, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, -1, 280, -1, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, -1, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, -1, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, -1, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, -1, -1, -1, -1, -1, -1, -1, 470, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, 43, 44, 45, 46, -1, 48, 49, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, -1, -1, 73, -1, 75, 76, 77, 78, 79, 80, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, 92, 93, 94, 95, -1, -1, -1, 99, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, -1, 147, 148, 149, -1, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, 162, -1, 164, 165, 166, 167, 168, -1, 170, -1, -1, -1, 174, 175, -1, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, -1, 196, 197, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, -1, -1, 220, -1, 222, 223, 224, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, -1, -1, 255, 256, 257, 258, -1, -1, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, 275, 276, 277, 278, 279, 280, 281, -1, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, -1, 297, -1, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, 334, 335, 336, 337, 338, 339, -1, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, -1, 382, -1, 384, 385, -1, 387, 388, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, -1, 403, -1, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, -1, 428, 429, 430, 431, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 458, 459, 460, -1, 18, 19, 20, 21, 22, 23, 24, 25, 470, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, 43, 44, 45, 46, -1, 48, 49, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, -1, -1, 73, -1, 75, 76, 77, 78, 79, 80, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, 92, 93, 94, 95, -1, -1, -1, 99, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, -1, 147, 148, 149, -1, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, 162, -1, 164, 165, 166, 167, 168, -1, 170, -1, -1, -1, 174, 175, -1, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, -1, 196, 197, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, -1, -1, 220, -1, 222, 223, 224, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, -1, -1, 255, 256, 257, 258, -1, -1, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, 275, 276, 277, 278, 279, 280, 281, -1, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, -1, 297, -1, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, 334, 335, 336, 337, 338, 339, -1, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, -1, 382, -1, 384, 385, -1, 387, 388, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, -1, 403, -1, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, -1, 428, 429, 430, 431, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 3, 4, 5, -1, -1, -1, 9, -1, -1, -1, -1, 458, 459, 460, -1, 18, 19, 20, 21, 22, 23, 24, 25, 470, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, 73, -1, 75, 76, 77, 78, 79, 80, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, 92, 93, 94, 95, -1, -1, -1, 99, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, 162, -1, 164, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, 197, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, -1, -1, 220, 221, 222, 223, 224, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, -1, 255, 256, 257, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, 269, -1, 271, 272, 273, -1, -1, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, 388, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, 431, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, 4, 5, -1, -1, -1, 9, 468, 469, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, 73, -1, 75, 76, 77, 78, 79, 80, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, 92, 93, 94, 95, -1, -1, -1, 99, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, 162, -1, 164, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, 197, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, -1, -1, 220, 221, 222, 223, 224, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, -1, 255, 256, 257, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, 269, -1, 271, 272, 273, -1, -1, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, 388, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, 431, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, 4, 5, -1, -1, -1, 9, 468, 469, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, 73, -1, 75, 76, 77, 78, 79, 80, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, 92, 93, 94, 95, -1, -1, -1, 99, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, 162, -1, 164, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, 197, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, -1, -1, 220, 221, 222, 223, 224, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, -1, 255, 256, 257, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, 269, -1, 271, 272, 273, -1, -1, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, 388, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, 431, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, 5, -1, -1, -1, 9, 468, 469, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, 73, -1, 75, 76, 77, 78, 79, 80, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, 92, 93, 94, 95, -1, -1, -1, 99, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, 162, -1, 164, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, 197, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, -1, -1, 220, 221, 222, 223, 224, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, -1, 255, 256, 257, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, 269, -1, 271, 272, 273, -1, -1, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, 388, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, 431, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, -1, -1, -1, -1, 9, 468, 469, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, -1, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, -1, -1, 75, 76, 77, 78, 79, -1, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, -1, 93, 94, 95, -1, -1, -1, -1, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, -1, 163, -1, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, -1, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, -1, -1, 211, -1, 213, 214, 215, 216, 217, -1, -1, 220, 221, -1, 223, -1, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, 250, 251, 252, 253, -1, 255, 256, -1, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, -1, 280, -1, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, -1, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, -1, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, -1, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, 4, 5, -1, -1, -1, 9, 468, 469, -1, -1, -1, -1, -1, -1, 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, -1, 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, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 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, -1, 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, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 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, -1, 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, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, 60, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, 73, -1, 75, 76, 77, 78, 79, 80, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, 162, -1, 164, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, 197, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, -1, -1, 220, 221, 222, 223, 224, -1, 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, -1, 255, 256, 257, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, 388, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, 420, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, 431, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, 73, -1, 75, 76, 77, 78, 79, 80, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, 92, 93, 94, 95, -1, -1, -1, 99, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, 162, -1, 164, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, 197, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, -1, -1, 220, 221, 222, 223, 224, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, -1, 255, 256, 257, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, 269, -1, 271, 272, 273, -1, -1, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, 388, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, 431, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, 73, -1, 75, 76, 77, 78, 79, 80, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, 92, 93, 94, 95, -1, -1, -1, 99, -1, -1, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, 162, -1, 164, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, 197, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, -1, -1, 220, 221, 222, 223, 224, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, -1, 255, 256, 257, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, 388, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, 431, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, 73, -1, 75, 76, 77, 78, 79, 80, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, 92, 93, 94, 95, -1, -1, -1, 99, -1, -1, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, 162, -1, 164, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, 197, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, -1, -1, 220, 221, 222, 223, 224, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, -1, 255, 256, 257, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, 388, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, 431, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, 73, -1, 75, 76, 77, 78, 79, 80, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, 92, 93, 94, 95, -1, -1, -1, 99, -1, -1, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, 162, -1, 164, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, 197, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, -1, -1, 220, 221, 222, 223, 224, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, -1, 255, 256, 257, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, 388, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, 420, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, 431, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, 73, -1, 75, 76, 77, 78, 79, 80, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, 92, 93, 94, 95, -1, -1, -1, 99, -1, -1, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, 162, -1, 164, 165, 166, 167, 168, -1, 170, 171, 172, 173, 174, 175, -1, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, 197, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, -1, -1, 220, 221, 222, 223, 224, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, -1, 255, 256, 257, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, 388, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, 431, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, 73, -1, 75, 76, 77, 78, 79, 80, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, 92, 93, 94, 95, -1, -1, -1, 99, -1, -1, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, 162, -1, 164, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, 197, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, -1, -1, 220, 221, 222, 223, 224, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, -1, 255, 256, 257, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, 388, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, 431, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, 73, -1, 75, 76, 77, 78, 79, 80, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, 92, 93, 94, 95, -1, -1, -1, 99, -1, -1, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, 162, -1, 164, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, 197, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, -1, -1, 220, 221, 222, 223, 224, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, -1, 255, 256, 257, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, 388, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, 431, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, 73, -1, 75, 76, 77, 78, 79, 80, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, 92, 93, 94, 95, -1, -1, -1, 99, -1, -1, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, 162, -1, 164, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, 197, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, -1, -1, 220, 221, 222, 223, 224, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, -1, 255, 256, 257, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, 388, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, 431, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, 73, -1, 75, 76, 77, 78, 79, 80, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, 92, 93, 94, 95, -1, -1, -1, 99, -1, -1, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, 162, -1, 164, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, 197, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, -1, -1, 220, 221, 222, 223, 224, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, -1, 255, 256, 257, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, 388, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, 431, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, 73, -1, 75, 76, 77, 78, 79, 80, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, 92, 93, 94, 95, -1, -1, -1, 99, -1, -1, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, 162, -1, 164, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, 197, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, -1, -1, 220, 221, 222, 223, 224, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, -1, 255, 256, 257, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, 388, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, 431, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, 30, 31, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, 73, -1, 75, 76, 77, 78, 79, 80, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, 92, 93, 94, 95, -1, -1, -1, 99, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, 162, -1, 164, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, 197, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, -1, -1, 220, 221, 222, 223, 224, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, -1, 255, 256, 257, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, 388, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, 431, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, 73, -1, 75, 76, 77, 78, 79, 80, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, 92, 93, 94, 95, -1, -1, -1, 99, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, 162, -1, 164, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, 197, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, -1, -1, 220, 221, 222, 223, 224, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, -1, 255, 256, 257, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, 388, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, 431, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, 73, -1, 75, 76, 77, 78, 79, 80, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, 92, 93, 94, 95, -1, -1, -1, 99, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, 162, -1, 164, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, 197, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, -1, -1, 220, 221, 222, 223, 224, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, -1, 255, 256, 257, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, 388, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, 431, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, 73, -1, 75, 76, 77, 78, 79, 80, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, 92, 93, 94, 95, -1, -1, -1, 99, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, 162, -1, 164, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, 197, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, -1, -1, 220, 221, 222, 223, 224, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, -1, 255, 256, 257, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, 388, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, 431, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, 73, -1, 75, 76, 77, 78, 79, 80, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, 92, 93, 94, 95, -1, -1, -1, 99, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, 162, -1, 164, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, 197, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, -1, -1, 220, 221, 222, 223, 224, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, -1, 255, 256, 257, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, 388, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, 431, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, 73, -1, 75, 76, 77, 78, 79, 80, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, 92, 93, 94, 95, -1, -1, -1, 99, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, 162, -1, 164, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, 197, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, -1, -1, 220, 221, 222, 223, 224, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, -1, 255, 256, 257, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, 388, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, 431, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, 73, -1, 75, 76, 77, 78, 79, 80, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, 92, 93, 94, 95, -1, -1, -1, 99, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, 162, -1, 164, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, 197, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, -1, -1, 220, 221, 222, 223, 224, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, -1, 255, 256, 257, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, 388, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, 431, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, 73, -1, 75, 76, 77, 78, 79, 80, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, 92, 93, 94, 95, -1, -1, -1, 99, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, 162, -1, 164, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, 197, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, -1, -1, 220, 221, 222, 223, 224, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, -1, 255, 256, 257, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, 388, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, 431, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, 73, -1, 75, 76, 77, 78, 79, 80, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, 92, 93, 94, 95, -1, -1, -1, 99, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, 162, -1, 164, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, 197, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, -1, -1, 220, 221, 222, 223, 224, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, -1, 255, 256, 257, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, 388, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, 431, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, 73, -1, 75, 76, 77, 78, 79, 80, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, 92, 93, 94, 95, -1, -1, -1, 99, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, 162, -1, 164, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, 197, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, -1, -1, 220, 221, 222, 223, 224, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, -1, 255, 256, 257, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, 388, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, 431, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, -1, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, -1, -1, 74, 75, 76, 77, 78, 79, -1, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, -1, -1, 93, 94, 95, -1, -1, -1, -1, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, 160, 161, -1, -1, -1, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, -1, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, -1, -1, 211, -1, 213, 214, 215, 216, 217, -1, -1, 220, 221, -1, 223, -1, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, 250, 251, 252, 253, -1, 255, 256, -1, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, -1, 280, -1, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, -1, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, -1, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, 414, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, -1, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, -1, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, -1, -1, -1, 75, 76, 77, 78, 79, -1, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, -1, -1, 93, 94, 95, -1, -1, -1, -1, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, 160, 161, -1, -1, -1, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, -1, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, -1, -1, 211, -1, 213, 214, 215, 216, 217, -1, -1, 220, 221, -1, 223, 224, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, 250, 251, 252, 253, -1, 255, 256, -1, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, -1, 280, -1, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, -1, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, -1, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, 414, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, -1, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, -1, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, -1, -1, 75, 76, 77, 78, 79, -1, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, 91, -1, 93, 94, 95, -1, -1, -1, -1, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, -1, -1, -1, 165, 166, 167, 168, 169, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, -1, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, -1, -1, 211, -1, 213, 214, 215, 216, 217, -1, -1, 220, 221, -1, 223, -1, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, 250, 251, 252, 253, -1, 255, 256, -1, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, -1, 280, -1, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 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, -1, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, -1, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, -1, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, -1, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, -1, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, -1, -1, 75, 76, 77, 78, 79, -1, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, 91, -1, 93, 94, 95, -1, -1, -1, -1, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, -1, -1, -1, 165, 166, 167, 168, 169, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, -1, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, -1, -1, 211, -1, 213, 214, 215, 216, 217, -1, -1, 220, 221, -1, 223, -1, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, 250, 251, 252, 253, -1, 255, 256, -1, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, -1, 280, -1, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 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, -1, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, -1, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, -1, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, -1, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, -1, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, -1, -1, -1, 75, 76, 77, 78, 79, -1, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, -1, -1, 93, 94, 95, -1, -1, -1, -1, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, 160, 161, -1, -1, -1, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, -1, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, -1, -1, 211, -1, 213, 214, 215, 216, 217, -1, -1, 220, 221, -1, 223, -1, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, 250, 251, 252, 253, -1, 255, 256, -1, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, -1, 280, -1, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, -1, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, -1, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, 414, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, -1, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, -1, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, -1, -1, 75, 76, 77, 78, 79, -1, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, 91, -1, 93, 94, 95, -1, -1, -1, -1, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, -1, -1, -1, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, -1, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, -1, -1, 211, -1, 213, 214, 215, 216, 217, -1, -1, 220, 221, -1, 223, -1, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, 250, 251, 252, 253, -1, 255, 256, -1, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, -1, 280, -1, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 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, -1, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, -1, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, -1, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, -1, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, -1, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, -1, -1, 75, 76, 77, 78, 79, -1, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, -1, 93, 94, 95, -1, -1, -1, -1, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, 160, 161, -1, -1, -1, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, -1, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, -1, -1, 211, -1, 213, 214, 215, 216, 217, -1, -1, 220, 221, -1, 223, -1, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, 250, 251, 252, 253, -1, 255, 256, -1, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, -1, 280, -1, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, -1, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, 386, 387, -1, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, -1, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, -1, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, -1, -1, 75, 76, 77, 78, 79, -1, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, 91, -1, 93, 94, 95, -1, -1, -1, -1, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, -1, -1, -1, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, -1, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, -1, -1, 211, -1, 213, 214, 215, 216, 217, -1, -1, 220, 221, -1, 223, -1, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, 250, 251, 252, 253, -1, 255, 256, -1, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, -1, 280, -1, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 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, -1, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, -1, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, -1, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, -1, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, -1, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, -1, -1, 75, 76, 77, 78, 79, -1, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, -1, 93, 94, 95, -1, -1, -1, -1, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, -1, -1, -1, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, -1, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, -1, -1, 211, -1, 213, 214, 215, 216, 217, -1, -1, 220, 221, -1, 223, -1, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, 250, 251, 252, 253, -1, 255, 256, -1, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, 270, 271, 272, 273, -1, -1, 276, 277, 278, -1, 280, -1, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, -1, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, -1, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, -1, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, -1, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, -1, -1, 75, 76, 77, 78, 79, -1, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, -1, 93, 94, 95, -1, -1, -1, -1, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, -1, -1, -1, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, -1, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, -1, -1, 211, -1, 213, 214, 215, 216, 217, -1, -1, 220, 221, -1, 223, -1, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, 250, 251, 252, 253, -1, 255, 256, -1, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, -1, 280, -1, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, -1, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, -1, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, 420, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, -1, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, -1, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, -1, -1, 75, 76, 77, 78, 79, -1, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, -1, 93, 94, 95, -1, -1, -1, -1, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, -1, -1, -1, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, -1, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, -1, -1, 211, -1, 213, 214, 215, 216, 217, -1, -1, 220, 221, -1, 223, -1, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, 250, 251, 252, 253, -1, 255, 256, -1, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, -1, 280, -1, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, -1, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, -1, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, 420, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, -1, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, -1, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, -1, -1, 75, 76, 77, 78, 79, -1, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, -1, 93, 94, 95, -1, -1, -1, -1, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, -1, -1, -1, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, -1, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, -1, -1, 211, -1, 213, 214, 215, 216, 217, -1, -1, 220, 221, -1, 223, -1, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, 250, 251, 252, 253, -1, 255, 256, -1, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, -1, 280, -1, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, -1, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, -1, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, -1, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, -1, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, -1, -1, 75, 76, 77, 78, 79, -1, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, -1, 93, 94, 95, -1, -1, -1, -1, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, -1, -1, -1, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, -1, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, -1, -1, 211, -1, 213, 214, 215, 216, 217, -1, -1, 220, 221, -1, 223, -1, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, 250, 251, 252, 253, -1, 255, 256, -1, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, -1, 280, -1, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, -1, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, -1, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, -1, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, -1, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, -1, -1, 75, 76, 77, 78, 79, -1, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, -1, 93, 94, 95, -1, -1, -1, -1, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, -1, -1, -1, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, -1, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, -1, -1, 211, -1, 213, 214, 215, 216, 217, -1, -1, 220, 221, -1, 223, -1, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, 250, 251, 252, 253, -1, 255, 256, -1, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, -1, 280, -1, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, -1, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, -1, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, -1, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, -1, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, -1, -1, 75, 76, 77, 78, 79, -1, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, -1, 93, 94, 95, -1, -1, -1, -1, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, -1, -1, -1, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, -1, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, -1, -1, 211, -1, 213, 214, 215, 216, 217, -1, -1, 220, 221, -1, 223, -1, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, 250, 251, 252, 253, -1, 255, 256, -1, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, -1, 280, -1, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, -1, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, -1, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, -1, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, -1, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, -1, -1, 75, 76, 77, 78, 79, -1, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, -1, 93, 94, 95, -1, -1, -1, -1, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, -1, -1, -1, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, -1, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, -1, -1, 211, -1, 213, 214, 215, 216, 217, -1, -1, 220, 221, -1, 223, -1, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, 250, 251, 252, 253, -1, 255, 256, -1, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, 270, 271, 272, 273, -1, -1, 276, 277, 278, -1, 280, -1, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, -1, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, -1, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, -1, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, -1, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, -1, -1, 75, 76, 77, 78, 79, -1, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, -1, 93, 94, 95, -1, -1, -1, -1, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, -1, -1, -1, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, -1, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, -1, -1, 211, -1, 213, 214, 215, 216, 217, -1, -1, 220, 221, -1, 223, -1, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, 250, 251, 252, 253, -1, 255, 256, -1, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, -1, 280, -1, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, -1, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, -1, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, -1, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, -1, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, -1, -1, 75, 76, 77, 78, 79, -1, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, -1, 93, 94, 95, -1, -1, -1, -1, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, -1, -1, -1, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, -1, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, -1, -1, 211, -1, 213, 214, 215, 216, 217, -1, -1, 220, 221, -1, 223, -1, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, 250, 251, 252, 253, -1, 255, 256, -1, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, -1, 280, -1, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, -1, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, -1, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, -1, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, -1, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, -1, -1, 75, 76, 77, 78, 79, -1, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, -1, 93, 94, 95, -1, -1, -1, -1, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, -1, -1, -1, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, -1, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, -1, -1, 211, -1, 213, 214, 215, 216, 217, -1, -1, 220, 221, -1, 223, -1, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, 250, 251, 252, 253, -1, 255, 256, -1, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, -1, 280, -1, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, -1, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, -1, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, -1, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, -1, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, -1, -1, 75, 76, 77, 78, 79, -1, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, -1, 93, 94, 95, -1, -1, -1, -1, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, -1, -1, -1, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, -1, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, -1, -1, 211, -1, 213, 214, 215, 216, 217, -1, -1, 220, 221, -1, 223, -1, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, 250, 251, 252, 253, -1, 255, 256, -1, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, -1, 280, -1, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, -1, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, -1, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, -1, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, -1, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, -1, -1, 75, 76, 77, 78, 79, -1, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, -1, 93, 94, 95, -1, -1, -1, -1, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, -1, -1, -1, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, -1, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, -1, -1, 211, -1, 213, 214, 215, 216, 217, -1, -1, 220, 221, -1, 223, -1, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, 250, 251, 252, 253, -1, 255, 256, -1, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, -1, 280, -1, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, -1, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, -1, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, -1, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, 43, 44, 45, 46, 47, 48, -1, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, -1, -1, 75, 76, 77, 78, 79, -1, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, -1, 93, 94, 95, -1, -1, -1, -1, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, -1, -1, -1, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, -1, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, -1, -1, 211, -1, 213, 214, 215, 216, 217, -1, -1, 220, 221, -1, 223, -1, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, 250, 251, 252, 253, -1, 255, 256, -1, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, -1, 280, -1, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, -1, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, -1, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, -1, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, -1, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, -1, -1, 75, 76, 77, 78, 79, -1, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, -1, 93, 94, 95, -1, -1, -1, -1, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, -1, -1, -1, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, -1, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, -1, -1, 211, -1, 213, 214, 215, 216, 217, -1, -1, 220, 221, -1, 223, -1, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, 250, 251, 252, 253, -1, 255, 256, -1, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, 270, 271, 272, 273, -1, -1, 276, 277, 278, -1, 280, -1, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, -1, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, -1, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, -1, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, -1, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, -1, -1, 75, 76, 77, 78, 79, -1, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, -1, 93, 94, 95, -1, -1, -1, -1, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, -1, -1, -1, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, -1, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, -1, -1, 211, -1, 213, 214, 215, 216, 217, -1, -1, 220, 221, -1, 223, -1, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, 250, 251, 252, 253, -1, 255, 256, -1, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, -1, 280, -1, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, -1, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, -1, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, -1, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, -1, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, -1, -1, 75, 76, 77, 78, 79, -1, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, -1, 93, 94, 95, -1, -1, -1, -1, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, -1, -1, -1, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, -1, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, -1, -1, 211, -1, 213, 214, 215, 216, 217, -1, -1, 220, 221, -1, 223, -1, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, 250, 251, 252, 253, -1, 255, 256, -1, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, -1, 280, -1, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, -1, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, 386, 387, -1, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, -1, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, -1, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, -1, -1, 75, 76, 77, 78, 79, -1, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, -1, 93, 94, 95, -1, -1, -1, -1, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, -1, -1, -1, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, -1, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, -1, -1, 211, -1, 213, 214, 215, 216, 217, -1, -1, 220, 221, -1, 223, -1, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, 250, 251, 252, 253, -1, 255, 256, -1, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, -1, 280, -1, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, -1, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, -1, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, -1, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, -1, -1, -1, -1, 9, -1, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, -1, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, -1, -1, 75, 76, 77, 78, 79, -1, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, -1, 93, 94, 95, -1, -1, -1, -1, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, -1, -1, -1, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, -1, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, -1, -1, 211, -1, 213, 214, 215, 216, 217, -1, -1, 220, 221, -1, 223, -1, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, 250, 251, 252, 253, -1, 255, 256, -1, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, -1, 280, -1, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, -1, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, -1, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, -1, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, 35, -1, 37, 38, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, -1, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, -1, -1, 75, 76, 77, 78, 79, -1, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, -1, 93, 94, 95, -1, -1, -1, -1, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, -1, -1, -1, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, -1, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, -1, -1, 211, -1, 213, 214, 215, 216, 217, -1, -1, 220, 221, -1, 223, -1, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, 250, 251, 252, 253, -1, 255, 256, -1, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, -1, 280, -1, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, -1, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, -1, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, -1, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, 35, -1, 37, 38, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, -1, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, -1, -1, 75, 76, 77, 78, 79, -1, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, -1, 93, 94, 95, -1, -1, -1, -1, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, -1, -1, -1, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, -1, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, -1, -1, 211, -1, 213, 214, 215, 216, 217, -1, -1, 220, 221, -1, 223, -1, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, 250, 251, 252, 253, -1, 255, 256, -1, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, -1, 280, -1, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, -1, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, -1, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, -1, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, -1, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, -1, -1, 75, 76, 77, 78, 79, -1, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, -1, 93, 94, 95, -1, -1, -1, -1, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, -1, -1, -1, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, -1, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, -1, -1, 211, -1, 213, 214, 215, 216, 217, -1, -1, 220, 221, -1, 223, -1, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, 250, 251, 252, 253, -1, 255, 256, -1, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, -1, 280, -1, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, -1, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, -1, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, -1, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, -1, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, -1, -1, 75, 76, 77, 78, 79, -1, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, -1, 93, 94, 95, -1, -1, -1, -1, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, -1, -1, -1, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, -1, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, -1, -1, 211, -1, 213, 214, 215, 216, 217, -1, -1, 220, 221, -1, 223, -1, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, 250, 251, 252, 253, -1, 255, 256, -1, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, -1, 280, -1, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, -1, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, -1, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, -1, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, -1, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, -1, -1, 75, 76, 77, 78, 79, -1, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, -1, 93, 94, 95, -1, -1, -1, -1, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, -1, -1, -1, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, -1, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, -1, -1, 211, -1, 213, 214, 215, 216, 217, -1, -1, 220, 221, -1, 223, -1, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, 250, 251, 252, 253, -1, 255, 256, -1, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, -1, 280, -1, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, -1, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, -1, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, -1, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, -1, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, -1, -1, 75, 76, 77, 78, 79, -1, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, -1, 93, 94, 95, -1, -1, -1, -1, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, -1, -1, -1, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, -1, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, -1, -1, 211, -1, 213, 214, 215, 216, 217, -1, -1, 220, 221, -1, 223, -1, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, 250, 251, 252, 253, -1, 255, 256, -1, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, -1, 280, -1, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, -1, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, -1, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, -1, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, -1, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, -1, -1, 75, 76, 77, 78, 79, -1, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, -1, 93, 94, 95, -1, -1, -1, -1, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, -1, -1, -1, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, -1, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, -1, -1, 211, -1, 213, 214, 215, 216, 217, -1, -1, 220, 221, -1, 223, -1, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, 250, 251, 252, 253, -1, 255, 256, -1, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, -1, 280, -1, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, -1, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, -1, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, -1, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, -1, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, -1, -1, 75, 76, 77, 78, 79, -1, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, -1, 93, 94, 95, -1, -1, -1, -1, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, -1, -1, -1, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, -1, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, -1, -1, 211, -1, 213, 214, 215, 216, 217, -1, -1, 220, 221, -1, 223, -1, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, 250, 251, 252, 253, -1, 255, 256, -1, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, -1, 280, -1, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, -1, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, -1, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, -1, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, -1, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, -1, -1, 75, 76, 77, 78, 79, -1, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, -1, 93, 94, 95, -1, -1, -1, -1, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, -1, -1, -1, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, -1, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, -1, -1, 211, -1, 213, 214, 215, 216, 217, -1, -1, 220, 221, -1, 223, -1, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, 250, 251, 252, 253, -1, 255, 256, -1, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, -1, 280, -1, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, -1, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, -1, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, -1, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, -1, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, -1, -1, 75, 76, 77, 78, 79, -1, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, -1, 93, 94, 95, -1, -1, -1, -1, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, -1, -1, -1, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, -1, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, -1, -1, 211, -1, 213, 214, 215, 216, 217, -1, -1, 220, 221, -1, 223, -1, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, 250, 251, 252, 253, -1, 255, 256, -1, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, -1, 280, -1, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, -1, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, -1, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, -1, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, -1, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, -1, -1, 75, 76, 77, 78, 79, -1, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, -1, 93, 94, 95, -1, -1, -1, -1, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, -1, -1, -1, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, -1, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, -1, -1, 211, -1, 213, 214, 215, 216, 217, -1, -1, 220, 221, -1, 223, -1, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, 250, 251, 252, 253, -1, 255, 256, -1, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, -1, 280, -1, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, -1, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, -1, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, -1, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, -1, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, -1, -1, 75, 76, 77, 78, 79, -1, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, -1, 93, 94, 95, -1, -1, -1, -1, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, -1, -1, -1, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, -1, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, -1, -1, 211, -1, 213, 214, 215, 216, 217, -1, -1, 220, 221, -1, 223, -1, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, 250, 251, 252, 253, -1, 255, 256, -1, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, -1, 280, -1, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, -1, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, -1, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, -1, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, -1, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, -1, -1, 75, 76, 77, 78, 79, -1, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, -1, 93, 94, 95, -1, -1, -1, -1, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, -1, -1, -1, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, -1, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, -1, -1, 211, -1, 213, 214, 215, 216, 217, -1, -1, 220, 221, -1, 223, -1, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, 250, 251, 252, 253, -1, 255, 256, -1, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, -1, 280, -1, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, -1, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, -1, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, -1, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, -1, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, -1, -1, 75, 76, 77, 78, 79, -1, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, -1, 93, 94, 95, -1, -1, -1, -1, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, -1, -1, -1, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, -1, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, -1, -1, 211, -1, 213, 214, 215, 216, 217, -1, -1, 220, 221, -1, 223, -1, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, 250, 251, 252, 253, -1, 255, 256, -1, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, -1, 280, -1, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, -1, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, -1, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, -1, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, -1, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, -1, -1, 75, 76, 77, 78, 79, -1, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, -1, 93, 94, 95, -1, -1, -1, -1, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, -1, -1, -1, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, -1, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, -1, -1, 211, -1, 213, 214, 215, 216, 217, -1, -1, 220, 221, -1, 223, -1, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, 250, 251, 252, 253, -1, 255, 256, -1, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, -1, 280, -1, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, -1, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, -1, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, -1, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, -1, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, -1, -1, 75, 76, 77, 78, 79, -1, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, -1, 93, 94, 95, -1, -1, -1, -1, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, -1, -1, -1, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, -1, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, -1, -1, 211, -1, 213, 214, 215, 216, 217, -1, -1, 220, 221, -1, 223, -1, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, 250, 251, 252, 253, -1, 255, 256, -1, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, -1, 280, -1, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, -1, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, -1, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, -1, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, -1, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, -1, -1, 75, 76, 77, 78, 79, -1, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, -1, 93, 94, 95, -1, -1, -1, -1, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, -1, -1, -1, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, -1, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, -1, -1, 211, -1, 213, 214, 215, 216, 217, -1, -1, 220, 221, -1, 223, -1, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, 250, 251, 252, 253, -1, 255, 256, -1, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, -1, 280, -1, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, -1, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, -1, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, -1, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, -1, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, -1, -1, 75, 76, 77, 78, 79, -1, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, -1, 93, 94, 95, -1, -1, -1, -1, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, -1, -1, -1, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, -1, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, -1, -1, 211, -1, 213, 214, 215, 216, 217, -1, -1, 220, 221, -1, 223, -1, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, 250, 251, 252, 253, -1, 255, 256, -1, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, -1, 280, -1, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, -1, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, -1, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, -1, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, -1, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, -1, -1, 75, 76, 77, 78, 79, -1, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, -1, 93, 94, 95, -1, -1, -1, -1, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, -1, -1, -1, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, -1, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, -1, -1, 211, -1, 213, 214, 215, 216, 217, -1, -1, 220, 221, -1, 223, -1, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, 250, 251, 252, 253, -1, 255, 256, -1, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, -1, 280, -1, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, -1, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, -1, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, -1, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, -1, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, -1, -1, 75, 76, 77, 78, 79, -1, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, -1, 93, 94, 95, -1, -1, -1, -1, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, -1, -1, -1, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, -1, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, -1, -1, 211, -1, 213, 214, 215, 216, 217, -1, -1, 220, 221, -1, 223, -1, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, 250, 251, 252, 253, -1, 255, 256, -1, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, -1, 280, -1, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, -1, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, -1, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, -1, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, -1, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, -1, -1, 75, 76, 77, 78, 79, -1, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, -1, 93, 94, 95, -1, -1, -1, -1, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, -1, -1, -1, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, -1, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, -1, -1, 211, -1, 213, 214, 215, 216, 217, -1, -1, 220, 221, -1, 223, -1, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, 250, 251, 252, 253, -1, 255, 256, -1, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, -1, 280, -1, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, -1, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, -1, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, -1, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, -1, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, -1, -1, 75, 76, 77, 78, 79, -1, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, -1, 93, 94, 95, -1, -1, -1, -1, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, -1, -1, -1, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, -1, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, -1, -1, 211, -1, 213, 214, 215, 216, 217, -1, -1, 220, 221, -1, 223, -1, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, 250, 251, 252, 253, -1, 255, 256, -1, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, -1, 280, -1, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, -1, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, -1, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, -1, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, -1, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, -1, -1, 75, 76, 77, 78, 79, -1, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, -1, 93, 94, 95, -1, -1, -1, -1, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, -1, -1, -1, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, -1, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, -1, -1, 211, -1, 213, 214, 215, 216, 217, -1, -1, 220, 221, -1, 223, -1, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, 250, 251, 252, 253, -1, 255, 256, -1, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, -1, 280, -1, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, -1, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, -1, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, -1, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, -1, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, -1, -1, 75, 76, 77, 78, 79, -1, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, -1, 93, 94, 95, -1, -1, -1, -1, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, -1, -1, -1, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, -1, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, -1, -1, 211, -1, 213, 214, 215, 216, 217, -1, -1, 220, 221, -1, 223, -1, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, 250, 251, 252, 253, -1, 255, 256, -1, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, -1, 280, -1, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, -1, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, -1, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, -1, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, -1, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, -1, -1, 75, 76, 77, 78, 79, -1, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, -1, 93, 94, 95, -1, -1, -1, -1, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, -1, -1, -1, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, -1, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, -1, -1, 211, -1, 213, 214, 215, 216, 217, -1, -1, 220, 221, -1, 223, -1, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, 250, 251, 252, 253, -1, 255, 256, -1, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, -1, 280, -1, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, -1, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, -1, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, -1, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, -1, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, -1, -1, 75, 76, 77, 78, 79, -1, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, -1, 93, 94, 95, -1, -1, -1, -1, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, -1, -1, -1, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, -1, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, -1, -1, 211, -1, 213, 214, 215, 216, 217, -1, -1, 220, 221, -1, 223, -1, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, 250, 251, 252, 253, -1, 255, 256, -1, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, -1, 280, -1, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, -1, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, -1, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, -1, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, -1, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, -1, -1, 75, 76, 77, 78, 79, -1, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, -1, 93, 94, 95, -1, -1, -1, -1, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, -1, -1, -1, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, -1, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, -1, -1, 211, -1, 213, 214, 215, 216, 217, -1, -1, 220, 221, -1, 223, -1, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, 250, 251, 252, 253, -1, 255, 256, -1, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, -1, 280, -1, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, -1, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, -1, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, -1, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, -1, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, -1, -1, 75, 76, 77, 78, 79, -1, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, -1, 93, 94, 95, -1, -1, -1, -1, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, -1, -1, -1, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, -1, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, -1, -1, 211, -1, 213, 214, 215, 216, 217, -1, -1, 220, 221, -1, 223, -1, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, 250, 251, 252, 253, -1, 255, 256, -1, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, -1, 280, -1, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, -1, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, -1, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, -1, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, -1, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, -1, -1, 75, 76, 77, 78, 79, -1, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, -1, 93, 94, 95, -1, -1, -1, -1, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, -1, -1, -1, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, -1, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, -1, -1, 211, -1, 213, 214, 215, 216, 217, -1, -1, 220, 221, -1, 223, -1, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, 250, 251, 252, 253, -1, 255, 256, -1, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, -1, 280, -1, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, -1, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, -1, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, -1, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, 35, -1, 37, 38, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, -1, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, -1, -1, 75, 76, 77, 78, 79, -1, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, -1, 93, 94, 95, -1, -1, -1, -1, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, -1, -1, -1, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, -1, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, -1, -1, 211, -1, 213, 214, 215, 216, 217, -1, -1, 220, 221, -1, 223, -1, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, 250, 251, 252, 253, -1, 255, 256, -1, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, -1, 280, -1, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, -1, 358, 359, 360, 361, -1, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, -1, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, -1, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, -1, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, -1, -1, 75, 76, 77, 78, 79, -1, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, -1, 93, 94, 95, -1, -1, -1, -1, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, -1, -1, -1, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, -1, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, -1, -1, 211, -1, 213, 214, 215, 216, 217, -1, -1, 220, 221, -1, 223, -1, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, 250, 251, 252, 253, -1, 255, 256, -1, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, -1, 280, -1, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, -1, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, -1, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, -1, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, -1, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, -1, -1, 75, 76, 77, 78, 79, -1, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, -1, 93, 94, 95, -1, -1, -1, -1, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, -1, -1, -1, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, -1, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, -1, -1, 211, -1, 213, 214, 215, 216, 217, -1, -1, 220, 221, -1, 223, -1, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, 250, 251, 252, 253, -1, 255, 256, -1, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, -1, 280, -1, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, -1, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, -1, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, -1, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, -1, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, -1, -1, 75, 76, 77, 78, 79, -1, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, -1, 93, 94, 95, -1, -1, -1, -1, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, -1, -1, -1, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, -1, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, -1, -1, 211, -1, 213, 214, 215, 216, 217, -1, -1, 220, 221, -1, 223, -1, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, 250, 251, 252, 253, -1, 255, 256, -1, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, -1, 280, -1, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, -1, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, -1, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, -1, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, -1, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, -1, -1, 75, 76, 77, 78, 79, -1, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, -1, 93, 94, 95, -1, -1, -1, -1, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, -1, -1, -1, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, -1, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, -1, -1, 211, -1, 213, 214, 215, 216, 217, -1, -1, 220, 221, -1, 223, -1, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, 250, 251, 252, 253, -1, 255, 256, -1, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, -1, 280, -1, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, -1, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, -1, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, -1, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, -1, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, -1, -1, 75, 76, 77, 78, 79, -1, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, -1, 93, 94, 95, -1, -1, -1, -1, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, -1, -1, -1, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, -1, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, -1, -1, 211, -1, 213, 214, 215, 216, 217, -1, -1, 220, 221, -1, 223, -1, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, 250, 251, 252, 253, -1, 255, 256, -1, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, -1, 280, -1, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, -1, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, -1, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, -1, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, -1, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, -1, -1, 75, 76, 77, 78, 79, -1, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, -1, 93, 94, 95, -1, -1, -1, -1, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, -1, -1, -1, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, -1, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, -1, -1, 211, -1, 213, 214, 215, 216, 217, -1, -1, 220, 221, -1, 223, -1, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, 250, 251, 252, 253, -1, 255, 256, -1, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, -1, 280, -1, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, -1, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, -1, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, -1, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, -1, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, -1, -1, 75, 76, 77, 78, 79, -1, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, -1, 93, 94, 95, -1, -1, -1, -1, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, -1, -1, -1, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, -1, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, -1, -1, 211, -1, 213, 214, 215, 216, 217, -1, -1, 220, 221, -1, 223, -1, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, 250, 251, 252, 253, -1, 255, 256, -1, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, -1, 280, -1, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, -1, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, -1, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, -1, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, -1, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, -1, -1, 75, 76, 77, 78, 79, -1, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, -1, 93, 94, 95, -1, -1, -1, -1, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, -1, -1, -1, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, -1, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, -1, -1, 211, -1, 213, 214, 215, 216, 217, -1, -1, 220, 221, -1, 223, -1, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, 250, 251, 252, 253, -1, 255, 256, -1, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, -1, 280, -1, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, -1, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, -1, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, -1, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, -1, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, -1, -1, 75, 76, 77, 78, 79, -1, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, -1, 93, 94, 95, -1, -1, -1, -1, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, -1, -1, -1, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, -1, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, -1, -1, 211, -1, 213, 214, 215, 216, 217, -1, -1, 220, 221, -1, 223, -1, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, 250, 251, 252, 253, -1, 255, 256, -1, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, -1, 280, -1, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, -1, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, -1, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, -1, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, -1, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, -1, -1, 75, 76, 77, 78, 79, -1, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, -1, 93, 94, 95, -1, -1, -1, -1, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, -1, -1, -1, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, -1, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, -1, -1, 211, -1, 213, 214, 215, 216, 217, -1, -1, 220, 221, -1, 223, -1, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, 250, 251, 252, 253, -1, 255, 256, -1, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, -1, 280, -1, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, -1, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, -1, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, -1, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, -1, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, -1, -1, 75, 76, 77, 78, 79, -1, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, -1, 93, 94, 95, -1, -1, -1, -1, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, -1, -1, -1, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, -1, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, -1, -1, 211, -1, 213, 214, 215, 216, 217, -1, -1, 220, 221, -1, 223, -1, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, 250, 251, 252, 253, -1, 255, 256, -1, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, -1, 280, -1, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, -1, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, -1, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, -1, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, -1, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, -1, -1, 75, 76, 77, 78, 79, -1, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, -1, 93, 94, 95, -1, -1, -1, -1, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, -1, -1, -1, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, -1, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, -1, -1, 211, -1, 213, 214, 215, 216, 217, -1, -1, 220, 221, -1, 223, -1, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, 250, 251, 252, 253, -1, 255, 256, -1, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, -1, 280, -1, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, -1, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, -1, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, -1, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, -1, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, -1, -1, 75, 76, 77, 78, 79, -1, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, -1, 93, 94, 95, -1, -1, -1, -1, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, -1, -1, -1, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, -1, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, -1, -1, 211, -1, 213, 214, 215, 216, 217, -1, -1, 220, 221, -1, 223, -1, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, 250, 251, 252, 253, -1, 255, 256, -1, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, -1, 280, -1, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, -1, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, -1, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, -1, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, -1, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, -1, -1, 75, 76, 77, 78, 79, -1, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, -1, 93, 94, 95, -1, -1, -1, -1, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, -1, -1, -1, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, -1, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, -1, -1, 211, -1, 213, 214, 215, 216, 217, -1, -1, 220, 221, -1, 223, -1, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, 250, 251, 252, 253, -1, 255, 256, -1, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, -1, 280, -1, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, -1, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, -1, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, -1, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, -1, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, -1, -1, 75, 76, 77, 78, 79, -1, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, -1, 93, 94, 95, -1, -1, -1, -1, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, -1, -1, -1, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, -1, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, -1, -1, 211, -1, 213, 214, 215, 216, 217, -1, -1, 220, 221, -1, 223, -1, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, 250, 251, 252, 253, -1, 255, 256, -1, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, -1, 280, -1, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, -1, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, -1, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, -1, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, 43, 44, 45, 46, -1, 48, 49, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, -1, -1, 73, -1, 75, 76, 77, 78, 79, 80, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, 92, 93, 94, 95, -1, -1, -1, 99, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, -1, 147, 148, 149, -1, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, 162, -1, 164, 165, 166, 167, 168, -1, 170, -1, -1, -1, 174, 175, -1, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, -1, 196, 197, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, -1, -1, 220, -1, 222, 223, 224, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, -1, -1, 255, 256, 257, 258, -1, -1, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, 279, 280, 281, -1, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, -1, 297, -1, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, 334, 335, 336, 337, 338, 339, -1, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, -1, 382, -1, 384, 385, -1, 387, 388, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, -1, 403, -1, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, -1, 428, 429, 430, 431, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 458, 459, 460, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, -1, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, -1, -1, 75, 76, 77, 78, 79, -1, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, -1, 93, 94, 95, -1, -1, -1, -1, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, -1, -1, -1, 165, 166, 167, 168, -1, 170, 171, -1, 173, -1, 175, -1, 177, 178, 179, 180, 181, -1, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, -1, -1, 211, -1, 213, 214, 215, 216, 217, -1, -1, 220, 221, -1, 223, -1, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, 250, 251, 252, 253, -1, 255, 256, -1, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, -1, 280, -1, 282, 283, 284, 285, 286, 287, 288, -1, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, -1, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, -1, 335, 336, 337, 338, 339, 340, -1, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, -1, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, -1, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, -1, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, 43, 44, 45, 46, -1, 48, 49, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, -1, -1, 73, -1, 75, 76, 77, 78, 79, 80, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, 92, 93, 94, 95, -1, -1, -1, 99, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, -1, 147, 148, 149, -1, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, 162, -1, 164, 165, 166, 167, 168, -1, 170, -1, -1, -1, 174, 175, -1, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, 197, -1, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, -1, -1, 220, -1, 222, 223, 224, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, -1, -1, 255, 256, 257, 258, 259, -1, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, -1, 279, 280, 281, -1, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, -1, 297, -1, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, 334, 335, 336, 337, 338, 339, -1, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, -1, 382, -1, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, -1, 403, -1, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, -1, 428, -1, 430, 431, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 458, 459, 460, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, 43, 44, 45, 46, -1, 48, 49, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, -1, -1, 73, -1, 75, 76, 77, 78, 79, 80, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, 92, 93, 94, 95, -1, -1, -1, 99, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, -1, 147, 148, 149, -1, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, 162, -1, 164, 165, 166, 167, 168, -1, 170, -1, -1, -1, 174, 175, -1, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, 197, -1, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, -1, -1, 220, -1, 222, 223, 224, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, -1, 255, 256, 257, 258, -1, -1, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, -1, 279, 280, 281, -1, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, -1, 297, -1, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, 334, 335, 336, 337, 338, 339, -1, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, -1, 382, -1, 384, 385, -1, 387, 388, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, -1, 403, -1, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, -1, 428, -1, 430, 431, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 458, 459, 460, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, 43, 44, 45, 46, -1, 48, 49, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, -1, -1, 73, -1, 75, 76, 77, 78, 79, 80, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, 92, 93, 94, 95, -1, -1, -1, 99, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, -1, 147, 148, 149, -1, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, 162, -1, 164, 165, 166, 167, 168, -1, 170, -1, -1, -1, 174, 175, -1, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, 197, -1, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, -1, -1, 220, -1, 222, 223, 224, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, -1, 255, 256, 257, 258, -1, -1, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, -1, 279, 280, 281, -1, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, -1, 297, -1, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, 334, 335, 336, 337, 338, 339, -1, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, -1, 382, -1, 384, 385, -1, 387, 388, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, -1, 403, -1, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, -1, 428, -1, 430, 431, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 458, 459, 460, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, 43, 44, 45, 46, -1, 48, 49, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, -1, -1, 73, -1, 75, 76, 77, 78, 79, 80, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, 92, 93, 94, 95, -1, -1, -1, 99, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, -1, 147, 148, 149, -1, -1, 152, -1, 154, 155, 156, 157, 158, 159, -1, 161, 162, -1, 164, 165, 166, 167, 168, -1, 170, -1, -1, -1, 174, 175, -1, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, 197, -1, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, -1, -1, 220, -1, 222, 223, 224, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, -1, -1, 255, 256, 257, 258, -1, -1, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, -1, 279, 280, 281, -1, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, -1, 297, -1, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, 334, 335, 336, 337, 338, 339, -1, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, -1, 382, -1, 384, 385, -1, 387, 388, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, -1, 403, -1, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, -1, 428, -1, 430, 431, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 458, 459, 460, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, 43, 44, 45, 46, -1, 48, 49, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, -1, -1, 73, -1, 75, 76, 77, 78, 79, 80, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, 92, 93, 94, 95, -1, -1, -1, 99, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, -1, 147, 148, 149, -1, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, 162, -1, 164, 165, 166, 167, 168, -1, 170, -1, -1, -1, 174, 175, -1, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, 197, -1, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, -1, -1, 220, -1, 222, 223, 224, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, -1, -1, 255, 256, 257, 258, -1, -1, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, -1, 279, 280, 281, -1, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, -1, 297, -1, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, 334, 335, 336, 337, 338, 339, -1, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, -1, 382, -1, 384, 385, -1, 387, 388, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, -1, 403, -1, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, -1, 428, -1, 430, 431, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 458, 459, 460, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, 43, 44, 45, 46, -1, 48, 49, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, -1, -1, 73, -1, 75, 76, 77, 78, 79, 80, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, 92, 93, 94, 95, -1, -1, -1, 99, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, -1, 147, 148, 149, -1, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, 162, -1, 164, 165, 166, 167, 168, -1, 170, -1, -1, -1, 174, 175, -1, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, 197, -1, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, -1, -1, 220, -1, 222, 223, 224, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, -1, -1, 255, 256, 257, 258, -1, -1, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, -1, 279, 280, 281, -1, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, -1, 297, -1, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, 334, 335, 336, 337, 338, 339, -1, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, -1, 382, -1, 384, 385, -1, 387, 388, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, -1, 403, -1, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, -1, 428, -1, 430, 431, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 458, 459, 460, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, 43, 44, 45, 46, -1, 48, 49, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, -1, -1, 73, -1, 75, 76, 77, 78, 79, 80, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, 92, 93, 94, 95, -1, -1, -1, 99, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, -1, 147, 148, 149, -1, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, 162, -1, 164, 165, 166, 167, 168, -1, 170, -1, -1, -1, 174, 175, -1, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, 197, -1, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, -1, -1, 220, -1, 222, 223, 224, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, -1, -1, 255, 256, 257, 258, -1, -1, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, -1, 279, 280, 281, -1, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, -1, 297, -1, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, 334, 335, 336, 337, 338, 339, -1, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, -1, 382, -1, 384, 385, -1, 387, 388, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, -1, 403, -1, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, -1, 428, -1, 430, 431, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 458, 459, 460, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, 43, 44, 45, 46, -1, 48, 49, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, -1, -1, 73, -1, 75, 76, 77, 78, 79, 80, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, 92, 93, 94, 95, -1, -1, -1, 99, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, -1, 147, 148, 149, -1, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, 162, -1, 164, 165, 166, 167, 168, -1, 170, -1, -1, -1, 174, 175, -1, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, 197, -1, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, -1, -1, 220, -1, 222, 223, 224, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, -1, -1, 255, 256, 257, 258, -1, -1, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, -1, 279, 280, 281, -1, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, -1, 297, -1, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, 334, 335, 336, 337, 338, 339, -1, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, -1, 382, -1, 384, 385, -1, 387, 388, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, -1, 403, -1, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, -1, 428, -1, 430, 431, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 458, 459, 460, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, 43, 44, 45, 46, -1, 48, 49, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, -1, -1, 73, -1, 75, 76, 77, 78, 79, 80, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, 92, 93, 94, 95, -1, -1, -1, 99, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, -1, 147, 148, 149, -1, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, 162, -1, 164, 165, 166, 167, 168, -1, 170, -1, -1, -1, 174, 175, -1, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, 197, -1, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, -1, -1, 220, -1, 222, 223, 224, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, -1, -1, 255, 256, 257, 258, -1, -1, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, -1, 279, 280, 281, -1, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, -1, 297, -1, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, 334, 335, 336, 337, 338, 339, -1, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, -1, 360, 361, 362, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, -1, 382, -1, 384, 385, -1, 387, 388, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, -1, 403, -1, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, -1, 428, -1, 430, 431, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 458, 459, 460, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, 43, 44, 45, 46, -1, -1, 49, -1, -1, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, -1, -1, 65, -1, 67, 68, 69, 70, -1, -1, 73, -1, 75, 76, 77, 78, 79, 80, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, 92, 93, 94, 95, -1, -1, -1, 99, -1, -1, -1, 103, 104, 105, 106, 107, 108, -1, -1, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, -1, 147, 148, 149, -1, -1, 152, -1, 154, 155, -1, 157, -1, 159, -1, 161, 162, -1, 164, 165, 166, 167, 168, -1, 170, -1, -1, -1, 174, 175, -1, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, 197, -1, 199, 200, 201, 202, -1, -1, -1, -1, -1, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, -1, -1, 220, -1, 222, 223, 224, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, 248, -1, 250, 251, 252, -1, -1, 255, 256, 257, 258, -1, -1, 261, -1, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, -1, 279, 280, 281, -1, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, -1, 297, -1, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, -1, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, 334, 335, 336, 337, 338, 339, -1, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, -1, 360, 361, 362, 363, 364, -1, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, -1, 382, -1, 384, 385, -1, 387, 388, 389, 390, 391, 392, 393, -1, 395, -1, -1, -1, -1, 400, 401, -1, 403, -1, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, -1, -1, -1, 430, 431, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 458, 459, 460, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, -1, 44, 45, 46, -1, -1, -1, -1, -1, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, -1, -1, 65, -1, 67, 68, 69, 70, -1, -1, -1, -1, 75, 76, 77, 78, 79, -1, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, -1, 93, 94, 95, -1, -1, -1, -1, -1, -1, -1, 103, 104, 105, 106, 107, 108, -1, -1, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, -1, 147, 148, 149, -1, -1, 152, -1, 154, 155, -1, 157, -1, 159, -1, 161, -1, -1, -1, 165, 166, 167, 168, -1, 170, -1, -1, -1, 174, 175, -1, 177, 178, 179, 180, 181, -1, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, -1, -1, 199, 200, 201, 202, -1, -1, -1, -1, -1, 208, -1, -1, 211, -1, 213, 214, 215, 216, 217, -1, -1, 220, -1, -1, 223, -1, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, -1, 250, 251, 252, -1, -1, 255, 256, -1, 258, -1, -1, 261, -1, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, -1, -1, 280, -1, -1, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, -1, 297, -1, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, -1, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, -1, 335, 336, 337, 338, 339, -1, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, -1, 360, 361, -1, 363, 364, -1, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, -1, 382, -1, 384, 385, -1, 387, -1, 389, 390, 391, 392, 393, -1, 395, -1, -1, -1, -1, 400, 401, -1, 403, -1, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, -1, -1, -1, 430, -1, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 458, 459, 460 }; /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing symbol of state STATE-NUM. */ static const yytype_uint16 yystos[] = { 0, 18, 28, 30, 31, 46, 55, 67, 69, 70, 76, 78, 89, 91, 108, 111, 125, 127, 131, 137, 145, 147, 153, 169, 186, 226, 227, 232, 244, 256, 292, 300, 314, 320, 321, 323, 328, 333, 336, 343, 349, 350, 357, 361, 371, 386, 406, 416, 422, 427, 440, 463, 477, 484, 485, 486, 487, 488, 494, 495, 497, 498, 499, 500, 502, 506, 518, 523, 524, 527, 528, 529, 548, 551, 552, 567, 612, 613, 616, 619, 620, 621, 629, 635, 637, 639, 640, 643, 646, 647, 651, 660, 664, 665, 666, 667, 670, 672, 673, 674, 675, 683, 685, 705, 709, 711, 712, 722, 724, 731, 732, 735, 736, 737, 738, 739, 747, 749, 753, 758, 762, 763, 771, 772, 775, 780, 793, 820, 823, 824, 825, 830, 833, 835, 837, 839, 840, 845, 846, 849, 850, 851, 855, 856, 859, 860, 863, 864, 865, 872, 874, 875, 876, 882, 884, 885, 891, 892, 893, 894, 895, 896, 897, 899, 900, 902, 903, 905, 906, 908, 920, 926, 929, 931, 932, 941, 943, 948, 953, 957, 958, 959, 960, 961, 962, 966, 1001, 400, 443, 877, 25, 73, 88, 106, 112, 129, 140, 148, 160, 165, 172, 191, 216, 237, 271, 295, 305, 306, 309, 335, 338, 342, 344, 351, 354, 373, 380, 385, 386, 389, 393, 403, 408, 420, 433, 636, 877, 3, 18, 19, 20, 21, 22, 23, 24, 25, 27, 28, 29, 37, 38, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 53, 54, 55, 56, 57, 58, 61, 62, 63, 64, 65, 67, 68, 69, 70, 71, 73, 75, 76, 77, 78, 79, 80, 81, 82, 83, 85, 86, 87, 88, 89, 90, 92, 93, 94, 95, 99, 103, 104, 105, 106, 107, 108, 109, 110, 111, 113, 115, 116, 117, 118, 119, 120, 122, 123, 124, 125, 128, 129, 130, 131, 132, 134, 135, 136, 138, 139, 140, 142, 143, 144, 145, 146, 147, 148, 149, 150, 152, 154, 155, 156, 157, 159, 161, 162, 164, 165, 166, 167, 168, 170, 171, 173, 174, 175, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 188, 189, 190, 191, 192, 193, 194, 196, 197, 198, 199, 200, 201, 202, 203, 204, 206, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 220, 221, 222, 223, 224, 226, 227, 228, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 255, 256, 257, 258, 260, 261, 262, 263, 264, 265, 267, 268, 271, 272, 273, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 294, 295, 296, 297, 298, 299, 300, 301, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 351, 352, 353, 354, 355, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, 384, 385, 387, 388, 389, 390, 391, 392, 393, 395, 396, 397, 400, 401, 402, 403, 404, 406, 407, 408, 409, 410, 411, 412, 415, 416, 417, 418, 419, 422, 423, 424, 425, 426, 427, 428, 430, 431, 432, 433, 434, 435, 438, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 1060, 1134, 1142, 1143, 1146, 1147, 1148, 3, 26, 954, 1128, 1142, 1146, 431, 913, 269, 301, 877, 49, 477, 559, 20, 37, 60, 73, 84, 106, 112, 129, 140, 148, 160, 168, 172, 228, 271, 274, 295, 309, 335, 344, 354, 373, 380, 389, 390, 392, 393, 403, 408, 414, 417, 420, 568, 618, 727, 781, 794, 26, 300, 1128, 954, 26, 294, 352, 390, 392, 5, 215, 831, 832, 1137, 20, 25, 60, 73, 88, 106, 129, 140, 148, 160, 165, 172, 191, 237, 271, 284, 295, 306, 309, 335, 338, 342, 344, 351, 354, 373, 380, 386, 389, 393, 401, 403, 408, 420, 433, 636, 740, 741, 742, 877, 1128, 91, 431, 477, 613, 616, 619, 908, 921, 929, 932, 941, 948, 953, 957, 9, 19, 26, 44, 155, 161, 163, 187, 217, 251, 303, 322, 468, 469, 759, 760, 954, 1136, 1138, 26, 91, 318, 350, 764, 765, 766, 1142, 160, 1142, 1133, 1137, 386, 969, 759, 1142, 328, 357, 361, 400, 1128, 284, 237, 106, 191, 344, 385, 386, 477, 841, 842, 343, 1142, 26, 355, 396, 400, 510, 519, 520, 1142, 23, 169, 764, 765, 301, 877, 1142, 214, 26, 126, 971, 972, 61, 85, 228, 246, 335, 344, 355, 396, 400, 446, 507, 508, 509, 510, 26, 355, 396, 400, 510, 400, 270, 1012, 1126, 1142, 969, 470, 1142, 164, 477, 914, 477, 316, 963, 964, 1128, 963, 958, 959, 962, 0, 480, 477, 913, 141, 205, 275, 413, 973, 974, 958, 960, 961, 117, 201, 419, 481, 32, 881, 810, 1134, 744, 1142, 744, 1129, 1142, 304, 744, 403, 1128, 105, 386, 798, 1134, 1142, 1148, 3, 102, 356, 1139, 1140, 1144, 1146, 1147, 1148, 26, 181, 1126, 263, 433, 8, 15, 16, 17, 68, 152, 464, 465, 466, 468, 469, 470, 471, 472, 473, 827, 829, 1090, 1091, 1142, 181, 1128, 798, 1128, 26, 1139, 1140, 798, 1128, 1128, 181, 1126, 1128, 744, 1128, 328, 357, 26, 181, 1012, 1128, 347, 1128, 744, 26, 235, 1139, 1140, 181, 1126, 215, 114, 211, 254, 312, 878, 879, 880, 477, 475, 479, 1117, 1119, 1126, 1132, 1142, 20, 25, 60, 73, 74, 84, 88, 106, 129, 140, 148, 160, 165, 191, 216, 237, 271, 295, 306, 309, 335, 338, 342, 344, 351, 354, 373, 380, 386, 389, 393, 401, 403, 408, 433, 636, 750, 751, 1137, 881, 928, 932, 941, 948, 957, 1126, 239, 744, 477, 181, 744, 403, 1129, 744, 403, 181, 1128, 105, 386, 390, 392, 1139, 1140, 390, 392, 68, 152, 827, 326, 1128, 1128, 1139, 181, 503, 1142, 181, 1128, 181, 744, 1128, 1128, 347, 1128, 744, 235, 1139, 316, 351, 386, 433, 237, 88, 191, 25, 165, 306, 342, 401, 407, 630, 26, 1128, 955, 517, 1137, 1144, 832, 239, 181, 810, 811, 181, 836, 181, 1129, 3, 48, 50, 51, 63, 64, 109, 110, 130, 156, 181, 203, 204, 206, 247, 249, 262, 313, 359, 365, 396, 397, 428, 746, 1034, 1036, 1038, 1040, 1042, 1044, 1045, 1046, 1048, 1049, 1050, 1052, 1053, 1143, 1146, 403, 105, 386, 181, 797, 798, 181, 1140, 1141, 80, 433, 68, 152, 181, 828, 829, 53, 181, 797, 181, 1141, 181, 797, 181, 1128, 181, 1128, 347, 836, 181, 746, 181, 235, 1141, 215, 181, 743, 744, 181, 1127, 1128, 181, 1128, 881, 477, 930, 568, 921, 427, 908, 922, 923, 924, 1144, 913, 1138, 760, 761, 26, 761, 1138, 761, 26, 761, 1138, 761, 761, 761, 1138, 1136, 1136, 954, 761, 304, 477, 477, 588, 588, 588, 269, 398, 481, 588, 344, 1012, 1013, 481, 873, 520, 508, 510, 26, 510, 1137, 477, 927, 53, 433, 431, 843, 844, 80, 782, 782, 1142, 43, 460, 211, 479, 272, 272, 269, 163, 1137, 398, 881, 158, 754, 269, 4, 6, 7, 8, 10, 34, 48, 50, 51, 59, 60, 63, 64, 71, 73, 96, 97, 98, 99, 100, 101, 102, 109, 110, 112, 146, 150, 151, 156, 171, 173, 203, 204, 206, 221, 229, 230, 247, 249, 254, 259, 260, 262, 271, 282, 296, 313, 340, 356, 365, 381, 396, 397, 402, 404, 405, 414, 420, 428, 448, 449, 450, 451, 453, 454, 455, 456, 461, 468, 469, 470, 477, 958, 1037, 1040, 1043, 1044, 1045, 1047, 1048, 1049, 1052, 1053, 1057, 1059, 1060, 1061, 1063, 1086, 1087, 1088, 1092, 1111, 1116, 1123, 1124, 1134, 1135, 1136, 1137, 1142, 1122, 1123, 1137, 26, 525, 1125, 1126, 355, 507, 112, 516, 1137, 517, 1137, 43, 65, 507, 460, 366, 879, 272, 163, 398, 466, 43, 460, 211, 880, 477, 1126, 470, 1119, 1013, 907, 908, 909, 910, 1144, 162, 915, 1057, 1095, 963, 481, 477, 916, 478, 478, 486, 907, 917, 918, 919, 1126, 26, 126, 970, 970, 53, 970, 153, 158, 225, 266, 977, 979, 980, 995, 997, 998, 999, 973, 974, 163, 207, 1012, 1014, 477, 62, 252, 285, 324, 357, 477, 808, 285, 320, 324, 357, 479, 745, 285, 324, 357, 3, 83, 135, 231, 285, 292, 324, 357, 389, 391, 440, 518, 521, 886, 887, 888, 889, 776, 22, 131, 285, 324, 357, 424, 534, 1128, 22, 131, 357, 419, 501, 444, 181, 1012, 56, 90, 120, 149, 184, 220, 254, 285, 286, 324, 332, 341, 349, 357, 369, 378, 382, 435, 518, 522, 813, 821, 477, 795, 1119, 324, 501, 187, 146, 22, 28, 41, 70, 120, 124, 131, 134, 159, 193, 252, 254, 264, 273, 285, 324, 327, 328, 357, 424, 530, 532, 533, 654, 4, 468, 469, 627, 1138, 26, 181, 1126, 744, 744, 477, 826, 285, 357, 479, 146, 269, 120, 285, 324, 357, 821, 22, 131, 285, 324, 357, 187, 496, 324, 440, 463, 489, 496, 120, 285, 324, 357, 821, 269, 285, 324, 146, 35, 54, 104, 190, 238, 241, 252, 284, 324, 329, 351, 357, 371, 530, 624, 625, 285, 324, 432, 654, 662, 285, 324, 357, 83, 124, 134, 285, 320, 324, 357, 520, 508, 187, 146, 41, 122, 324, 357, 530, 531, 285, 324, 328, 357, 81, 123, 287, 391, 269, 22, 28, 131, 285, 324, 357, 549, 550, 496, 158, 324, 489, 496, 146, 324, 357, 530, 1128, 223, 114, 270, 445, 481, 878, 26, 126, 429, 470, 478, 803, 1057, 1096, 1097, 1143, 1057, 1118, 3, 26, 30, 31, 32, 33, 34, 35, 36, 39, 52, 59, 60, 66, 72, 74, 84, 91, 96, 97, 98, 100, 101, 102, 112, 114, 121, 126, 127, 133, 137, 141, 151, 153, 158, 160, 163, 169, 172, 176, 187, 195, 205, 207, 218, 219, 225, 229, 230, 254, 259, 266, 269, 270, 274, 275, 293, 302, 318, 331, 350, 356, 367, 383, 386, 394, 398, 399, 405, 413, 414, 420, 421, 429, 436, 437, 439, 440, 470, 1131, 1145, 1146, 1147, 1148, 1149, 1117, 421, 904, 269, 239, 810, 477, 1128, 1034, 403, 105, 386, 798, 263, 433, 68, 152, 829, 1128, 798, 798, 1128, 347, 158, 1128, 1034, 215, 744, 1128, 478, 588, 1128, 66, 1034, 254, 163, 477, 713, 1128, 489, 35, 898, 1128, 254, 489, 444, 181, 1126, 489, 744, 744, 713, 417, 568, 269, 158, 857, 858, 489, 254, 43, 504, 254, 408, 661, 254, 916, 83, 285, 638, 81, 123, 287, 391, 24, 45, 202, 686, 35, 713, 158, 181, 489, 433, 181, 1126, 181, 614, 1126, 1126, 433, 744, 782, 1134, 1134, 1134, 1128, 158, 636, 49, 103, 200, 252, 346, 146, 57, 330, 481, 535, 146, 477, 146, 430, 1051, 1051, 1051, 477, 1039, 1039, 298, 477, 1041, 146, 63, 64, 1051, 1039, 1036, 442, 463, 477, 1054, 477, 1054, 481, 535, 34, 1035, 477, 107, 179, 240, 243, 348, 458, 477, 1055, 1056, 745, 1039, 444, 146, 481, 535, 146, 481, 181, 743, 181, 744, 181, 744, 146, 481, 535, 1141, 146, 535, 146, 146, 535, 146, 535, 146, 81, 123, 287, 391, 158, 146, 535, 146, 158, 181, 181, 517, 146, 481, 535, 146, 481, 535, 146, 269, 1095, 386, 478, 481, 151, 269, 405, 514, 517, 627, 925, 921, 761, 954, 761, 954, 761, 954, 761, 954, 761, 954, 954, 954, 761, 954, 477, 589, 590, 1142, 589, 26, 106, 129, 160, 165, 215, 216, 306, 338, 344, 351, 386, 389, 408, 767, 1125, 1141, 766, 1128, 187, 481, 944, 1137, 1034, 1098, 35, 1141, 782, 478, 481, 1126, 1128, 223, 1142, 158, 158, 767, 1141, 343, 1142, 517, 269, 477, 1120, 475, 958, 1099, 1057, 1115, 477, 477, 158, 477, 477, 958, 477, 477, 477, 477, 477, 477, 1057, 477, 477, 477, 477, 477, 477, 477, 477, 958, 477, 477, 477, 477, 477, 477, 477, 477, 1057, 1057, 1057, 958, 1057, 1095, 1119, 1137, 477, 1137, 3, 8, 11, 15, 16, 17, 32, 35, 40, 47, 72, 182, 187, 209, 210, 224, 257, 271, 274, 362, 461, 464, 465, 466, 468, 469, 470, 471, 472, 473, 1090, 1092, 1094, 441, 1073, 281, 1057, 207, 481, 967, 477, 1137, 1119, 967, 115, 183, 526, 481, 65, 112, 517, 35, 3, 112, 228, 515, 627, 1053, 1137, 1137, 86, 128, 1069, 95, 112, 511, 512, 514, 627, 112, 511, 223, 1126, 87, 329, 748, 478, 481, 514, 627, 911, 913, 478, 481, 964, 1127, 35, 478, 481, 916, 960, 960, 975, 976, 1057, 960, 155, 251, 986, 213, 252, 312, 360, 419, 26, 981, 1057, 468, 469, 982, 983, 1057, 1059, 995, 996, 980, 979, 977, 978, 158, 998, 264, 1000, 977, 995, 1014, 933, 1126, 35, 1142, 357, 1095, 62, 398, 398, 344, 187, 198, 275, 278, 359, 429, 470, 801, 802, 803, 805, 807, 809, 1034, 1143, 398, 432, 398, 344, 1131, 479, 398, 398, 344, 225, 398, 398, 389, 507, 285, 886, 888, 466, 890, 158, 169, 187, 333, 777, 778, 66, 84, 142, 160, 302, 414, 585, 586, 84, 112, 254, 398, 84, 398, 112, 254, 344, 84, 124, 134, 285, 324, 710, 344, 644, 20, 25, 60, 73, 88, 129, 140, 160, 165, 237, 271, 306, 338, 344, 351, 354, 386, 393, 401, 408, 433, 636, 1128, 146, 324, 357, 530, 269, 627, 269, 349, 220, 398, 1142, 398, 259, 627, 116, 208, 344, 355, 400, 509, 744, 330, 357, 813, 822, 478, 796, 801, 398, 420, 389, 1126, 74, 142, 181, 575, 585, 1142, 74, 84, 847, 289, 269, 269, 340, 342, 403, 84, 847, 29, 327, 340, 342, 403, 340, 1126, 159, 193, 264, 744, 477, 398, 398, 180, 477, 539, 234, 389, 417, 442, 539, 84, 481, 4, 4, 285, 187, 146, 120, 324, 357, 530, 421, 421, 253, 1034, 398, 344, 477, 827, 1128, 1126, 269, 398, 398, 344, 822, 386, 386, 398, 398, 386, 713, 106, 357, 521, 398, 491, 521, 269, 398, 398, 344, 822, 1126, 398, 398, 1126, 1036, 627, 53, 626, 627, 627, 104, 238, 241, 53, 398, 489, 245, 344, 489, 252, 625, 398, 398, 259, 1137, 654, 398, 398, 344, 1137, 398, 309, 398, 309, 713, 389, 1012, 289, 289, 84, 398, 847, 344, 398, 398, 539, 539, 744, 744, 744, 744, 1126, 42, 426, 42, 42, 398, 42, 398, 426, 344, 481, 521, 420, 671, 1140, 398, 491, 521, 1126, 398, 344, 285, 324, 312, 325, 353, 513, 878, 1096, 1096, 1097, 478, 13, 14, 481, 973, 974, 476, 482, 1132, 1142, 1126, 209, 1034, 269, 209, 444, 209, 627, 744, 744, 209, 269, 209, 209, 269, 81, 123, 287, 391, 1034, 269, 209, 209, 209, 398, 163, 398, 553, 408, 477, 35, 146, 744, 714, 715, 1145, 24, 886, 1034, 269, 146, 641, 1128, 254, 289, 477, 490, 727, 421, 316, 433, 1126, 26, 386, 440, 817, 490, 146, 1140, 91, 169, 505, 567, 620, 685, 762, 780, 882, 146, 1137, 662, 663, 146, 269, 1137, 1140, 231, 744, 744, 744, 744, 264, 117, 201, 406, 419, 687, 688, 138, 311, 477, 671, 254, 490, 1126, 254, 622, 624, 254, 35, 264, 289, 477, 588, 588, 181, 617, 1126, 158, 181, 783, 1132, 477, 717, 808, 477, 799, 799, 35, 1034, 215, 440, 442, 956, 346, 811, 810, 1034, 1129, 477, 1095, 1136, 746, 1051, 1051, 34, 1035, 396, 396, 1136, 1136, 1034, 475, 475, 1136, 398, 398, 398, 477, 398, 1136, 1039, 797, 798, 1141, 1140, 146, 535, 146, 421, 146, 421, 828, 829, 535, 797, 1141, 797, 1128, 1128, 1034, 746, 1141, 671, 146, 146, 535, 743, 744, 1127, 1128, 1128, 744, 478, 181, 1126, 921, 923, 954, 954, 954, 954, 954, 954, 589, 478, 481, 478, 166, 307, 339, 352, 387, 1127, 743, 105, 354, 797, 1127, 263, 797, 797, 1127, 1125, 1125, 1127, 743, 398, 440, 773, 141, 225, 668, 669, 20, 144, 340, 360, 945, 1012, 258, 946, 478, 481, 928, 398, 1126, 841, 842, 844, 765, 764, 765, 163, 170, 774, 1142, 25, 74, 106, 129, 140, 160, 165, 216, 237, 306, 309, 335, 338, 344, 351, 380, 386, 389, 408, 433, 636, 755, 756, 1095, 1117, 476, 1095, 1099, 1100, 436, 1112, 1113, 1057, 1095, 477, 1136, 1136, 3, 107, 179, 240, 243, 348, 458, 1101, 1102, 1137, 1095, 1095, 1095, 1136, 1136, 1057, 827, 1057, 1103, 340, 468, 469, 477, 1058, 1059, 1092, 1105, 478, 1095, 1057, 1095, 1106, 1057, 52, 163, 219, 399, 1057, 1095, 1109, 1095, 245, 1059, 1057, 1067, 1068, 1069, 245, 1057, 1069, 478, 481, 1136, 1055, 1034, 1057, 1057, 1057, 1057, 1145, 396, 39, 383, 1121, 744, 1057, 477, 958, 1110, 126, 128, 151, 254, 259, 264, 405, 415, 1057, 477, 1057, 398, 47, 182, 187, 224, 362, 1057, 1057, 1057, 1057, 1057, 1057, 1057, 1057, 1057, 1057, 26, 33, 367, 1089, 172, 154, 1074, 340, 477, 1086, 168, 228, 386, 390, 392, 417, 968, 1126, 1124, 163, 1002, 1096, 1002, 1126, 400, 477, 1137, 481, 478, 180, 180, 535, 919, 909, 908, 912, 1057, 478, 237, 254, 965, 919, 917, 481, 36, 121, 421, 791, 340, 341, 468, 469, 983, 985, 1059, 360, 213, 270, 481, 4, 984, 1136, 984, 340, 341, 985, 1125, 258, 364, 947, 996, 978, 421, 942, 112, 283, 477, 934, 957, 35, 1142, 477, 949, 950, 951, 1142, 478, 1140, 1128, 1128, 278, 53, 1143, 478, 803, 805, 802, 805, 1143, 275, 478, 481, 745, 1140, 1128, 1128, 1131, 1140, 1128, 1128, 1140, 1129, 1128, 112, 514, 1138, 335, 420, 764, 344, 169, 764, 477, 1128, 421, 784, 213, 213, 421, 477, 611, 181, 1128, 259, 1140, 1128, 1128, 1057, 259, 1128, 1128, 29, 327, 398, 398, 1128, 398, 645, 239, 810, 477, 744, 744, 1034, 403, 105, 386, 798, 433, 68, 152, 829, 798, 798, 1128, 744, 1128, 744, 347, 158, 1034, 744, 215, 175, 252, 285, 324, 425, 648, 649, 650, 1012, 398, 847, 344, 259, 148, 116, 208, 1140, 1128, 269, 1128, 478, 481, 1139, 1141, 1128, 324, 530, 181, 575, 254, 1034, 1128, 1136, 1142, 1126, 1128, 148, 223, 1128, 26, 420, 1128, 181, 1128, 181, 1142, 342, 403, 342, 403, 223, 1128, 26, 420, 1128, 223, 340, 1126, 22, 131, 357, 655, 656, 657, 658, 1145, 1140, 1128, 112, 164, 255, 421, 538, 541, 542, 1145, 1128, 70, 267, 1128, 533, 398, 389, 1126, 269, 398, 847, 344, 1130, 1142, 1130, 481, 478, 481, 1140, 1128, 852, 853, 1145, 269, 324, 398, 679, 148, 1140, 1128, 1128, 1013, 1013, 1140, 1128, 1013, 1129, 1139, 3, 83, 136, 193, 291, 412, 420, 423, 492, 148, 1140, 1128, 1128, 324, 1140, 1128, 324, 357, 530, 624, 627, 744, 1128, 627, 744, 1128, 627, 1140, 1128, 1140, 1128, 1128, 1140, 817, 1128, 861, 862, 1145, 1128, 324, 357, 530, 531, 1126, 1126, 1128, 1128, 1128, 1128, 1140, 1128, 22, 28, 131, 285, 324, 357, 285, 324, 357, 713, 324, 357, 324, 357, 120, 324, 1026, 1142, 181, 723, 1142, 181, 1142, 1140, 1128, 1128, 1137, 1128, 22, 550, 354, 1139, 324, 357, 530, 1128, 1128, 398, 398, 79, 411, 312, 481, 973, 973, 973, 1057, 1057, 429, 1097, 478, 1057, 1118, 259, 752, 1137, 35, 129, 744, 752, 752, 209, 421, 421, 752, 744, 752, 752, 744, 215, 744, 752, 752, 752, 308, 554, 554, 191, 386, 684, 1057, 1034, 744, 478, 481, 466, 687, 577, 1145, 1128, 57, 163, 344, 432, 642, 649, 650, 146, 264, 224, 569, 571, 573, 575, 582, 585, 23, 187, 335, 384, 492, 493, 158, 1130, 433, 1126, 35, 680, 387, 1013, 713, 503, 1142, 504, 274, 568, 1128, 160, 744, 1095, 309, 1137, 713, 713, 713, 713, 264, 269, 274, 477, 713, 1024, 1025, 1026, 354, 146, 477, 146, 146, 145, 957, 744, 264, 569, 1142, 421, 606, 440, 540, 254, 35, 588, 1137, 254, 269, 3, 718, 719, 713, 478, 800, 801, 806, 35, 215, 332, 401, 439, 812, 813, 814, 812, 269, 215, 517, 178, 178, 158, 535, 35, 1095, 478, 478, 535, 475, 460, 460, 478, 478, 1136, 476, 1136, 478, 179, 240, 1056, 240, 1056, 1056, 1136, 243, 478, 535, 743, 744, 1130, 744, 1130, 535, 535, 535, 535, 215, 535, 354, 158, 517, 535, 535, 269, 535, 254, 478, 590, 187, 187, 187, 187, 187, 444, 1127, 627, 628, 172, 768, 769, 1140, 23, 774, 398, 477, 163, 144, 360, 144, 360, 340, 419, 242, 1034, 1140, 440, 615, 782, 782, 163, 269, 768, 53, 535, 810, 1034, 403, 386, 798, 263, 433, 798, 798, 1034, 215, 744, 1128, 478, 476, 476, 481, 1057, 133, 1113, 1114, 35, 478, 1057, 478, 478, 478, 163, 478, 478, 478, 478, 478, 481, 478, 293, 1104, 478, 477, 1058, 1058, 1095, 11, 15, 16, 17, 187, 209, 271, 464, 465, 466, 468, 469, 470, 471, 472, 473, 1092, 1058, 478, 478, 158, 163, 1107, 1108, 478, 35, 1109, 1095, 1109, 1109, 163, 478, 478, 1145, 290, 1071, 35, 478, 481, 1057, 1145, 481, 1057, 1120, 1057, 478, 460, 1058, 1058, 139, 1095, 163, 126, 128, 151, 259, 264, 405, 415, 477, 139, 827, 1057, 383, 1121, 1057, 1110, 1057, 398, 477, 958, 477, 477, 280, 1078, 477, 1095, 390, 392, 390, 392, 1126, 969, 969, 969, 218, 341, 457, 477, 958, 1003, 1004, 1005, 1012, 1017, 1027, 1060, 1062, 1063, 1142, 437, 1022, 973, 1022, 879, 1136, 1055, 512, 919, 237, 477, 976, 271, 1090, 1093, 462, 792, 4, 1136, 985, 270, 419, 982, 233, 1003, 437, 1023, 427, 385, 420, 935, 936, 937, 1142, 269, 938, 1142, 951, 952, 481, 1002, 466, 1120, 809, 745, 805, 805, 53, 807, 472, 1141, 1141, 269, 1127, 272, 269, 1057, 586, 1130, 477, 477, 477, 611, 191, 589, 703, 146, 535, 398, 1140, 1128, 517, 1128, 1034, 1128, 444, 744, 744, 744, 744, 81, 123, 287, 391, 1034, 1128, 631, 1128, 175, 425, 398, 398, 631, 648, 654, 324, 357, 530, 1128, 1128, 1128, 199, 1128, 259, 801, 284, 357, 398, 254, 146, 273, 652, 703, 357, 22, 131, 328, 329, 357, 534, 543, 544, 654, 848, 1128, 349, 146, 535, 146, 535, 1128, 1128, 1128, 1128, 349, 349, 223, 657, 658, 657, 478, 481, 659, 1137, 191, 478, 481, 466, 479, 1140, 1128, 324, 357, 530, 148, 1128, 1128, 1128, 285, 324, 357, 22, 131, 285, 324, 357, 1034, 253, 1034, 478, 481, 466, 1126, 398, 1141, 421, 676, 1128, 225, 291, 259, 1137, 291, 1141, 418, 1128, 398, 398, 344, 481, 817, 284, 357, 84, 398, 847, 344, 112, 158, 545, 398, 398, 235, 235, 235, 398, 398, 344, 398, 398, 344, 398, 344, 398, 344, 269, 398, 535, 1034, 254, 1137, 357, 848, 146, 535, 398, 398, 1128, 398, 344, 1140, 1128, 478, 478, 478, 1097, 476, 1034, 744, 209, 752, 1130, 1130, 209, 209, 1128, 209, 374, 375, 555, 1137, 555, 175, 478, 478, 163, 713, 715, 253, 271, 468, 469, 627, 716, 805, 1093, 1137, 1149, 269, 66, 72, 84, 112, 114, 167, 195, 254, 259, 302, 318, 414, 578, 579, 581, 145, 436, 489, 517, 1128, 517, 652, 1126, 1126, 1126, 478, 481, 1141, 172, 335, 1141, 1136, 408, 1126, 588, 3, 158, 681, 43, 504, 326, 386, 661, 105, 916, 163, 861, 540, 589, 1126, 688, 720, 721, 1137, 478, 481, 1128, 158, 589, 1126, 614, 1126, 1128, 615, 477, 570, 1126, 478, 1130, 440, 442, 607, 539, 35, 146, 957, 606, 398, 146, 1012, 466, 478, 481, 478, 481, 112, 466, 815, 1137, 517, 386, 804, 805, 158, 816, 814, 117, 201, 350, 419, 870, 1128, 175, 957, 1034, 478, 1136, 1054, 1054, 476, 476, 478, 535, 421, 535, 421, 535, 1128, 1128, 671, 535, 744, 146, 344, 344, 344, 344, 344, 1127, 481, 1140, 440, 481, 770, 272, 1013, 354, 144, 144, 105, 252, 1126, 1128, 1141, 767, 535, 1140, 209, 209, 209, 627, 209, 209, 209, 209, 209, 1099, 394, 1057, 137, 1034, 478, 1057, 1057, 1057, 1107, 478, 1095, 481, 1034, 1058, 1058, 1058, 1058, 126, 128, 254, 264, 1058, 1058, 1058, 1058, 1058, 1058, 1058, 1058, 1058, 1058, 1057, 1057, 1108, 1107, 1034, 478, 478, 478, 1095, 478, 481, 53, 1059, 1072, 478, 1145, 1068, 299, 379, 1070, 478, 481, 432, 1064, 35, 478, 1137, 1057, 32, 32, 1057, 478, 1057, 163, 477, 1098, 1057, 478, 139, 1058, 1058, 139, 139, 1057, 1057, 974, 437, 477, 1079, 1142, 478, 1095, 481, 969, 969, 969, 969, 1126, 1126, 1126, 958, 1017, 1027, 163, 477, 958, 1004, 1005, 35, 1006, 1007, 1142, 481, 92, 164, 197, 212, 222, 248, 334, 1009, 1007, 35, 1006, 1008, 1142, 1007, 463, 1021, 1119, 1057, 172, 987, 478, 987, 478, 928, 477, 792, 155, 217, 270, 95, 1057, 331, 940, 426, 478, 481, 1120, 82, 940, 478, 481, 950, 1023, 1057, 478, 472, 809, 408, 166, 339, 345, 352, 387, 409, 779, 158, 779, 478, 477, 593, 594, 786, 1062, 1142, 589, 589, 703, 1132, 478, 114, 195, 252, 254, 704, 1128, 1128, 35, 1128, 421, 421, 744, 744, 744, 744, 215, 745, 1140, 1128, 398, 847, 344, 398, 199, 53, 389, 1128, 146, 575, 477, 577, 373, 167, 180, 254, 539, 489, 105, 167, 254, 373, 376, 539, 625, 357, 544, 408, 1128, 1142, 349, 656, 1128, 542, 716, 1145, 284, 357, 398, 847, 344, 1128, 398, 398, 398, 344, 165, 271, 376, 725, 726, 165, 271, 733, 734, 398, 398, 344, 478, 478, 478, 853, 253, 627, 805, 854, 1093, 1137, 1149, 324, 1128, 477, 440, 677, 1138, 1137, 1137, 1137, 1128, 1128, 1128, 862, 53, 389, 1128, 1128, 1128, 1128, 427, 1128, 1128, 158, 158, 326, 158, 181, 1140, 1128, 1128, 1140, 1128, 1128, 1128, 1128, 1128, 1128, 148, 1128, 72, 536, 146, 24, 45, 408, 1142, 1128, 1137, 654, 1128, 1128, 973, 478, 209, 752, 209, 209, 752, 752, 209, 752, 489, 421, 560, 561, 631, 703, 440, 442, 744, 1126, 477, 744, 1128, 1058, 29, 53, 580, 115, 183, 114, 259, 213, 1126, 817, 165, 306, 699, 706, 707, 1142, 641, 289, 477, 570, 583, 194, 600, 573, 1141, 1141, 1034, 477, 540, 26, 117, 201, 350, 419, 682, 398, 678, 1140, 181, 1126, 663, 444, 269, 1003, 817, 319, 689, 478, 481, 1026, 652, 671, 478, 622, 35, 264, 289, 477, 930, 572, 574, 576, 585, 1142, 289, 601, 602, 570, 600, 539, 267, 269, 608, 957, 617, 615, 540, 1137, 1132, 784, 716, 3, 719, 806, 1057, 1057, 481, 477, 812, 408, 481, 398, 477, 631, 478, 476, 1130, 1130, 535, 354, 535, 1127, 1127, 1127, 1127, 1127, 627, 169, 769, 478, 1128, 105, 774, 163, 259, 757, 1137, 757, 757, 209, 757, 757, 757, 757, 757, 1057, 478, 478, 1108, 478, 1057, 163, 126, 128, 264, 477, 478, 447, 1066, 1095, 317, 426, 53, 1072, 1059, 438, 438, 478, 1057, 252, 1057, 481, 1065, 1036, 1057, 1057, 1057, 1098, 478, 1057, 32, 32, 1057, 1057, 139, 478, 478, 1057, 1080, 1142, 478, 1057, 1126, 1126, 1126, 1126, 1007, 1008, 1007, 477, 452, 1059, 478, 1142, 477, 1004, 212, 279, 1010, 1004, 1010, 212, 1009, 1010, 212, 388, 1015, 477, 1142, 477, 276, 53, 176, 994, 1137, 994, 1137, 478, 827, 264, 1123, 957, 283, 957, 937, 269, 477, 939, 466, 951, 940, 408, 478, 398, 764, 163, 703, 1057, 478, 481, 440, 72, 789, 789, 478, 478, 188, 591, 115, 183, 193, 114, 423, 535, 1034, 1130, 1130, 1128, 1128, 1128, 1128, 1128, 1141, 1128, 575, 653, 657, 1138, 580, 181, 259, 627, 580, 259, 1138, 1142, 1034, 535, 535, 466, 53, 389, 1128, 1128, 1128, 1128, 1140, 1128, 1128, 1136, 1136, 1034, 481, 1136, 1136, 481, 1140, 1128, 1128, 398, 1057, 66, 1141, 1128, 398, 398, 163, 187, 440, 1127, 1127, 744, 1127, 146, 1128, 744, 1137, 1137, 1034, 535, 535, 478, 209, 752, 752, 752, 752, 477, 556, 557, 489, 119, 165, 198, 165, 163, 702, 1057, 254, 579, 112, 35, 817, 588, 421, 610, 1134, 32, 145, 187, 264, 569, 545, 143, 189, 477, 354, 421, 589, 35, 1141, 676, 504, 254, 477, 160, 1128, 1095, 250, 268, 690, 691, 692, 158, 695, 1137, 354, 540, 145, 957, 744, 264, 569, 615, 478, 481, 440, 577, 53, 606, 545, 601, 78, 389, 609, 440, 883, 35, 609, 163, 269, 477, 1137, 803, 818, 819, 1143, 1034, 158, 1126, 163, 398, 838, 196, 632, 535, 535, 535, 1128, 272, 207, 535, 768, 757, 478, 1058, 163, 477, 1098, 477, 478, 481, 478, 1072, 478, 426, 370, 478, 478, 478, 1057, 1057, 1057, 478, 289, 1081, 478, 1018, 1019, 1062, 477, 1071, 1006, 477, 1127, 1004, 269, 421, 1011, 1004, 212, 1004, 1134, 1025, 477, 1025, 1142, 94, 173, 337, 477, 988, 989, 990, 991, 992, 993, 1057, 1057, 439, 1075, 1075, 478, 954, 935, 84, 785, 786, 127, 1057, 768, 269, 768, 478, 591, 594, 271, 827, 744, 744, 790, 790, 318, 591, 477, 817, 478, 398, 357, 946, 478, 481, 35, 146, 536, 716, 1141, 1128, 398, 477, 798, 827, 829, 726, 477, 477, 734, 1128, 478, 477, 357, 946, 1128, 1128, 477, 477, 477, 440, 463, 901, 326, 901, 901, 158, 536, 752, 562, 563, 1145, 49, 93, 118, 135, 139, 159, 162, 177, 259, 310, 558, 556, 1137, 798, 35, 834, 834, 1126, 703, 478, 180, 477, 610, 236, 592, 191, 477, 707, 699, 477, 1126, 478, 354, 26, 77, 85, 113, 167, 180, 192, 373, 376, 584, 584, 1125, 1128, 1130, 478, 957, 677, 146, 105, 652, 163, 691, 340, 386, 693, 132, 696, 436, 698, 1128, 35, 1128, 615, 570, 1126, 478, 574, 273, 3, 603, 1146, 607, 601, 606, 117, 131, 299, 1128, 58, 66, 228, 957, 744, 1012, 785, 805, 478, 481, 408, 1022, 368, 368, 478, 631, 252, 425, 633, 634, 1128, 535, 1058, 1098, 478, 1067, 1095, 252, 459, 53, 973, 478, 481, 35, 1020, 112, 1032, 1033, 1058, 75, 1127, 478, 1057, 477, 1004, 1011, 477, 478, 1025, 478, 477, 358, 477, 478, 481, 1076, 1077, 1142, 426, 1128, 478, 481, 255, 419, 770, 779, 535, 789, 817, 477, 791, 791, 1126, 817, 589, 610, 1128, 389, 657, 180, 421, 537, 357, 946, 1128, 1098, 158, 729, 729, 1098, 1098, 1057, 389, 1095, 1095, 546, 547, 1144, 743, 744, 743, 744, 1127, 535, 478, 481, 470, 477, 514, 564, 627, 898, 1137, 898, 254, 259, 310, 898, 898, 1022, 834, 38, 185, 158, 252, 587, 477, 623, 1057, 164, 288, 363, 269, 596, 597, 598, 389, 478, 1134, 5, 708, 570, 600, 1128, 478, 652, 152, 728, 540, 883, 1126, 444, 1003, 898, 340, 372, 697, 477, 145, 652, 957, 930, 601, 570, 600, 577, 477, 608, 606, 607, 341, 341, 66, 272, 66, 615, 784, 478, 812, 818, 1034, 127, 440, 440, 425, 631, 652, 478, 478, 478, 426, 1095, 174, 311, 341, 1082, 1021, 1018, 477, 1058, 478, 481, 35, 1028, 1029, 1142, 478, 1127, 1095, 478, 1095, 477, 1095, 989, 481, 35, 957, 1022, 786, 357, 163, 790, 610, 827, 792, 792, 588, 610, 478, 703, 1128, 623, 1057, 389, 478, 275, 347, 315, 730, 730, 478, 478, 478, 1128, 478, 478, 478, 481, 1136, 901, 563, 514, 565, 566, 1137, 1137, 259, 589, 470, 589, 1137, 1137, 132, 193, 624, 478, 117, 419, 269, 598, 269, 597, 1128, 477, 478, 481, 545, 354, 652, 744, 35, 35, 477, 1128, 694, 1142, 1057, 699, 883, 615, 606, 545, 601, 477, 604, 605, 1062, 1142, 609, 607, 608, 272, 272, 477, 188, 787, 27, 202, 871, 165, 165, 47, 95, 410, 1057, 1083, 1084, 1083, 1083, 478, 1025, 481, 1033, 1145, 478, 481, 158, 1034, 478, 478, 478, 988, 478, 1077, 1079, 949, 768, 791, 437, 595, 478, 592, 703, 946, 1128, 798, 53, 946, 398, 546, 744, 478, 481, 589, 340, 478, 377, 57, 252, 330, 357, 599, 599, 478, 5, 354, 1128, 725, 957, 652, 478, 1134, 607, 601, 606, 1057, 478, 481, 789, 789, 608, 609, 785, 477, 540, 255, 477, 866, 868, 872, 932, 941, 948, 957, 798, 798, 1084, 340, 157, 297, 157, 297, 142, 1085, 1085, 1085, 478, 1059, 1029, 276, 3, 112, 254, 259, 1030, 1031, 325, 1016, 478, 1022, 535, 792, 477, 703, 596, 946, 744, 477, 566, 698, 21, 112, 259, 1128, 652, 883, 477, 608, 606, 607, 478, 605, 790, 790, 609, 478, 786, 788, 609, 867, 868, 869, 958, 959, 481, 481, 32, 95, 172, 252, 395, 1071, 1058, 1058, 259, 1031, 477, 1057, 703, 1095, 145, 652, 4, 700, 701, 1136, 1137, 1145, 609, 607, 608, 789, 787, 478, 481, 1022, 478, 480, 398, 163, 1084, 340, 277, 75, 1057, 478, 478, 699, 478, 481, 608, 609, 790, 540, 786, 869, 368, 368, 1028, 478, 1134, 701, 609, 609, 440, 440, 478, 477, 1022, 165, 165, 700, 798, 798, 478 }; /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ static const yytype_uint16 yyr1[] = { 0, 483, 484, 485, 485, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 487, 488, 489, 489, 489, 490, 490, 491, 491, 492, 492, 492, 492, 492, 492, 492, 492, 492, 493, 493, 493, 493, 493, 493, 494, 495, 495, 496, 496, 497, 497, 497, 497, 498, 498, 498, 498, 498, 498, 499, 500, 501, 501, 502, 502, 502, 502, 503, 503, 504, 504, 505, 505, 505, 505, 505, 505, 506, 506, 506, 506, 507, 507, 507, 508, 508, 508, 508, 509, 509, 509, 509, 509, 509, 509, 509, 509, 509, 509, 510, 510, 511, 511, 512, 512, 513, 513, 513, 513, 514, 514, 514, 514, 515, 515, 515, 515, 515, 515, 515, 516, 516, 516, 517, 517, 518, 518, 519, 519, 519, 519, 520, 520, 521, 521, 522, 522, 523, 523, 523, 523, 523, 523, 523, 524, 525, 525, 526, 526, 527, 528, 528, 528, 528, 528, 529, 529, 529, 529, 529, 529, 529, 529, 529, 529, 529, 529, 529, 529, 529, 529, 529, 529, 529, 530, 530, 531, 531, 532, 533, 533, 533, 533, 533, 533, 533, 533, 533, 533, 533, 533, 533, 533, 533, 533, 533, 533, 533, 533, 533, 533, 533, 533, 533, 533, 533, 533, 533, 533, 533, 533, 533, 533, 533, 533, 533, 533, 533, 533, 533, 533, 533, 533, 533, 533, 533, 533, 533, 533, 533, 533, 533, 533, 533, 533, 534, 534, 535, 535, 535, 536, 536, 537, 537, 538, 538, 538, 538, 539, 540, 540, 541, 541, 542, 542, 542, 542, 543, 543, 544, 544, 544, 544, 545, 545, 545, 545, 546, 547, 547, 548, 549, 549, 550, 550, 550, 550, 551, 551, 552, 552, 553, 553, 554, 554, 555, 555, 555, 556, 556, 557, 557, 558, 558, 558, 558, 558, 558, 558, 558, 558, 558, 558, 558, 558, 559, 559, 560, 560, 561, 561, 562, 562, 563, 564, 564, 564, 564, 564, 565, 565, 566, 567, 567, 567, 567, 567, 567, 568, 568, 568, 568, 568, 568, 568, 568, 569, 569, 570, 570, 571, 571, 572, 572, 573, 573, 573, 574, 574, 575, 576, 576, 577, 577, 578, 578, 578, 578, 579, 579, 579, 579, 579, 579, 579, 579, 579, 580, 580, 581, 581, 581, 581, 582, 583, 583, 583, 584, 584, 584, 584, 584, 584, 584, 584, 584, 585, 585, 586, 586, 586, 586, 586, 586, 586, 587, 587, 588, 588, 589, 589, 590, 591, 591, 592, 592, 592, 592, 593, 593, 594, 594, 595, 595, 596, 596, 596, 596, 596, 597, 598, 599, 599, 599, 599, 599, 600, 600, 601, 601, 602, 603, 603, 604, 604, 605, 605, 605, 606, 606, 607, 607, 607, 608, 608, 608, 608, 609, 609, 610, 610, 611, 612, 612, 613, 613, 614, 615, 615, 615, 616, 616, 617, 618, 618, 619, 620, 620, 621, 621, 622, 622, 623, 623, 624, 624, 625, 625, 625, 625, 625, 625, 625, 625, 625, 625, 625, 625, 625, 625, 626, 626, 627, 627, 627, 627, 628, 628, 629, 629, 630, 630, 631, 631, 632, 632, 633, 633, 634, 634, 635, 635, 636, 636, 637, 638, 638, 639, 639, 640, 640, 641, 641, 642, 642, 642, 642, 643, 644, 644, 645, 646, 646, 646, 646, 646, 646, 646, 646, 646, 646, 646, 646, 646, 646, 646, 646, 646, 646, 646, 646, 646, 646, 646, 646, 646, 646, 646, 646, 647, 648, 648, 648, 648, 649, 649, 650, 650, 651, 651, 652, 652, 653, 653, 654, 655, 655, 656, 656, 656, 656, 657, 658, 659, 660, 660, 661, 661, 662, 662, 663, 663, 664, 664, 664, 665, 665, 665, 665, 666, 666, 667, 668, 668, 669, 669, 670, 670, 671, 671, 672, 672, 673, 674, 675, 676, 676, 677, 677, 678, 678, 679, 679, 680, 680, 681, 681, 682, 682, 682, 682, 682, 683, 684, 684, 685, 685, 686, 686, 686, 687, 687, 688, 688, 688, 688, 688, 689, 689, 690, 690, 691, 692, 692, 693, 693, 694, 695, 695, 696, 696, 697, 697, 698, 698, 699, 699, 700, 700, 700, 701, 701, 701, 701, 702, 702, 703, 703, 704, 704, 704, 704, 704, 704, 705, 705, 706, 706, 707, 708, 708, 709, 710, 710, 710, 710, 711, 712, 712, 712, 712, 712, 712, 712, 712, 712, 712, 712, 712, 712, 712, 712, 712, 713, 714, 714, 715, 715, 716, 716, 716, 716, 716, 716, 717, 718, 718, 719, 720, 720, 721, 721, 722, 722, 722, 722, 723, 723, 724, 725, 725, 726, 726, 726, 726, 726, 727, 727, 728, 728, 729, 729, 729, 730, 730, 731, 732, 732, 733, 733, 734, 734, 735, 735, 736, 736, 737, 738, 739, 739, 739, 739, 739, 739, 739, 739, 739, 739, 739, 739, 740, 740, 740, 740, 740, 740, 740, 740, 740, 740, 740, 740, 740, 741, 741, 741, 741, 741, 741, 741, 742, 742, 742, 743, 743, 744, 744, 745, 745, 746, 746, 747, 748, 748, 748, 749, 749, 749, 749, 749, 749, 749, 749, 749, 749, 749, 749, 749, 749, 749, 749, 749, 749, 749, 750, 750, 750, 750, 750, 750, 750, 750, 750, 750, 750, 750, 750, 750, 751, 751, 751, 751, 751, 751, 751, 751, 751, 751, 751, 751, 752, 752, 753, 753, 753, 753, 753, 753, 753, 753, 753, 754, 754, 755, 755, 755, 755, 755, 755, 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, 760, 760, 761, 761, 762, 763, 763, 764, 764, 764, 764, 764, 765, 765, 766, 766, 766, 766, 767, 767, 767, 767, 767, 767, 767, 767, 767, 767, 767, 767, 767, 767, 767, 767, 767, 767, 767, 767, 768, 768, 769, 769, 770, 770, 771, 772, 772, 773, 773, 774, 774, 775, 776, 776, 777, 777, 777, 778, 778, 778, 779, 779, 779, 779, 779, 779, 780, 780, 781, 781, 782, 782, 783, 783, 784, 784, 785, 785, 786, 786, 786, 787, 787, 788, 788, 789, 789, 790, 790, 791, 791, 791, 792, 792, 792, 793, 793, 793, 793, 794, 794, 795, 795, 796, 796, 797, 797, 798, 798, 798, 798, 799, 799, 800, 800, 801, 801, 801, 801, 801, 802, 802, 802, 802, 802, 803, 804, 805, 805, 805, 806, 806, 806, 807, 808, 808, 808, 808, 809, 809, 810, 811, 811, 812, 812, 813, 813, 813, 813, 813, 813, 813, 813, 813, 813, 813, 813, 813, 813, 813, 813, 813, 814, 814, 814, 814, 814, 815, 815, 816, 816, 817, 817, 818, 819, 819, 820, 820, 820, 821, 821, 822, 822, 823, 823, 823, 823, 823, 823, 824, 824, 825, 825, 826, 826, 826, 826, 827, 827, 828, 828, 829, 830, 831, 831, 832, 832, 833, 833, 833, 834, 834, 834, 835, 836, 836, 837, 838, 838, 838, 838, 839, 840, 840, 840, 840, 841, 841, 842, 842, 842, 843, 843, 844, 845, 845, 846, 846, 846, 846, 846, 846, 846, 846, 846, 846, 846, 846, 846, 846, 846, 846, 846, 846, 846, 846, 846, 846, 846, 846, 846, 846, 846, 846, 846, 846, 846, 846, 846, 846, 846, 846, 846, 846, 846, 846, 846, 846, 846, 846, 846, 846, 846, 846, 846, 846, 846, 846, 846, 847, 847, 848, 848, 849, 849, 849, 849, 849, 849, 850, 850, 850, 850, 850, 850, 850, 850, 850, 850, 850, 850, 850, 850, 850, 850, 850, 850, 850, 850, 850, 850, 850, 850, 850, 850, 850, 851, 852, 852, 853, 853, 854, 854, 854, 854, 854, 855, 855, 855, 855, 855, 855, 855, 855, 855, 855, 855, 855, 855, 855, 855, 855, 855, 855, 855, 855, 855, 855, 855, 855, 856, 857, 857, 858, 858, 859, 859, 859, 859, 860, 861, 861, 862, 863, 863, 863, 863, 863, 863, 864, 864, 865, 866, 866, 866, 867, 867, 868, 868, 868, 868, 868, 869, 869, 870, 870, 870, 870, 871, 871, 871, 872, 873, 873, 874, 875, 875, 876, 876, 876, 876, 876, 876, 876, 876, 876, 876, 876, 876, 876, 876, 877, 877, 877, 878, 878, 878, 878, 878, 879, 879, 879, 880, 880, 881, 881, 881, 882, 882, 882, 882, 883, 883, 883, 883, 884, 885, 886, 886, 887, 887, 888, 888, 888, 889, 889, 889, 889, 889, 889, 889, 890, 890, 891, 891, 891, 892, 893, 893, 894, 895, 895, 896, 897, 897, 897, 897, 897, 897, 897, 898, 898, 899, 900, 900, 900, 900, 900, 900, 901, 901, 902, 903, 903, 903, 904, 904, 905, 905, 906, 906, 907, 907, 908, 908, 909, 910, 910, 911, 911, 911, 912, 912, 913, 913, 914, 914, 915, 915, 916, 916, 917, 918, 918, 919, 919, 920, 920, 920, 920, 921, 921, 921, 921, 921, 921, 921, 921, 921, 922, 922, 923, 924, 924, 925, 925, 925, 926, 927, 927, 928, 928, 928, 928, 929, 929, 929, 930, 930, 931, 931, 931, 931, 932, 933, 933, 934, 934, 934, 934, 934, 935, 935, 936, 936, 937, 938, 938, 938, 939, 939, 939, 940, 940, 941, 942, 942, 943, 944, 944, 945, 945, 945, 945, 945, 945, 945, 945, 946, 946, 947, 947, 947, 948, 949, 949, 950, 950, 951, 952, 952, 953, 954, 955, 955, 955, 955, 955, 956, 956, 956, 957, 957, 958, 958, 959, 959, 959, 959, 959, 959, 959, 959, 960, 960, 961, 961, 961, 961, 961, 961, 961, 962, 962, 962, 963, 963, 964, 965, 965, 965, 966, 966, 967, 967, 968, 968, 968, 968, 968, 968, 968, 968, 968, 969, 969, 970, 970, 970, 971, 971, 972, 972, 973, 973, 974, 975, 975, 976, 976, 977, 977, 977, 977, 978, 978, 979, 979, 979, 979, 980, 980, 981, 981, 982, 983, 983, 983, 984, 984, 985, 985, 986, 986, 987, 987, 988, 988, 989, 989, 989, 989, 989, 990, 991, 992, 993, 994, 994, 995, 995, 996, 996, 997, 997, 998, 999, 999, 999, 999, 1000, 1000, 1001, 1001, 1002, 1002, 1003, 1003, 1004, 1004, 1004, 1004, 1004, 1004, 1004, 1004, 1004, 1004, 1005, 1005, 1005, 1005, 1005, 1005, 1006, 1006, 1006, 1006, 1007, 1007, 1008, 1008, 1008, 1008, 1008, 1009, 1009, 1009, 1009, 1010, 1010, 1011, 1011, 1012, 1012, 1012, 1012, 1013, 1013, 1014, 1014, 1014, 1015, 1016, 1016, 1017, 1017, 1018, 1019, 1019, 1020, 1020, 1021, 1021, 1022, 1022, 1023, 1023, 1023, 1024, 1024, 1025, 1025, 1026, 1027, 1027, 1028, 1028, 1029, 1029, 1029, 1030, 1030, 1031, 1031, 1031, 1031, 1032, 1032, 1033, 1033, 1034, 1034, 1034, 1034, 1034, 1034, 1035, 1035, 1035, 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1037, 1037, 1037, 1037, 1038, 1038, 1039, 1039, 1040, 1040, 1040, 1040, 1040, 1040, 1040, 1040, 1040, 1040, 1040, 1041, 1041, 1042, 1042, 1043, 1043, 1044, 1045, 1046, 1046, 1047, 1047, 1048, 1049, 1050, 1050, 1050, 1050, 1050, 1050, 1051, 1051, 1052, 1052, 1052, 1052, 1053, 1054, 1054, 1054, 1055, 1055, 1055, 1055, 1055, 1055, 1055, 1055, 1055, 1055, 1055, 1055, 1055, 1055, 1056, 1056, 1057, 1057, 1057, 1057, 1057, 1057, 1057, 1057, 1057, 1057, 1057, 1057, 1057, 1057, 1057, 1057, 1057, 1057, 1057, 1057, 1057, 1057, 1057, 1057, 1057, 1057, 1057, 1057, 1057, 1057, 1057, 1057, 1057, 1057, 1057, 1057, 1057, 1057, 1057, 1057, 1057, 1057, 1057, 1057, 1057, 1057, 1057, 1057, 1057, 1057, 1057, 1057, 1057, 1057, 1057, 1057, 1057, 1057, 1057, 1057, 1057, 1057, 1057, 1057, 1058, 1058, 1058, 1058, 1058, 1058, 1058, 1058, 1058, 1058, 1058, 1058, 1058, 1058, 1058, 1058, 1058, 1058, 1058, 1058, 1058, 1058, 1058, 1058, 1058, 1059, 1059, 1059, 1059, 1059, 1059, 1059, 1059, 1059, 1059, 1059, 1059, 1059, 1059, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1061, 1061, 1062, 1062, 1063, 1063, 1063, 1063, 1063, 1063, 1063, 1063, 1063, 1063, 1063, 1063, 1063, 1063, 1063, 1063, 1063, 1063, 1063, 1063, 1063, 1063, 1063, 1063, 1063, 1063, 1063, 1063, 1063, 1063, 1063, 1063, 1063, 1063, 1063, 1063, 1063, 1063, 1063, 1063, 1063, 1063, 1064, 1064, 1065, 1065, 1065, 1065, 1066, 1067, 1067, 1068, 1068, 1069, 1069, 1070, 1070, 1070, 1071, 1071, 1071, 1071, 1072, 1072, 1073, 1073, 1074, 1074, 1075, 1075, 1076, 1076, 1077, 1078, 1078, 1078, 1079, 1080, 1080, 1081, 1081, 1082, 1082, 1082, 1082, 1083, 1083, 1084, 1084, 1084, 1084, 1084, 1085, 1085, 1085, 1085, 1085, 1086, 1086, 1086, 1087, 1087, 1088, 1089, 1089, 1089, 1090, 1090, 1091, 1091, 1091, 1091, 1091, 1091, 1091, 1091, 1091, 1091, 1091, 1091, 1092, 1092, 1093, 1093, 1094, 1094, 1094, 1094, 1094, 1094, 1095, 1095, 1096, 1096, 1097, 1097, 1097, 1098, 1098, 1099, 1099, 1099, 1100, 1100, 1101, 1101, 1102, 1102, 1102, 1102, 1102, 1102, 1102, 1102, 1103, 1103, 1104, 1105, 1105, 1106, 1106, 1106, 1106, 1106, 1106, 1107, 1108, 1109, 1109, 1109, 1110, 1110, 1111, 1112, 1112, 1113, 1114, 1114, 1115, 1115, 1116, 1116, 1117, 1117, 1117, 1117, 1118, 1118, 1119, 1119, 1120, 1120, 1121, 1121, 1122, 1122, 1123, 1123, 1124, 1124, 1124, 1124, 1125, 1125, 1126, 1126, 1127, 1127, 1128, 1129, 1130, 1131, 1132, 1133, 1134, 1134, 1135, 1135, 1135, 1135, 1135, 1135, 1135, 1135, 1135, 1135, 1135, 1135, 1135, 1136, 1137, 1138, 1138, 1138, 1139, 1140, 1140, 1140, 1141, 1141, 1142, 1142, 1142, 1143, 1143, 1143, 1144, 1144, 1144, 1144, 1145, 1145, 1145, 1145, 1145, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1147, 1147, 1147, 1147, 1147, 1147, 1147, 1147, 1147, 1147, 1147, 1147, 1147, 1147, 1147, 1147, 1147, 1147, 1147, 1147, 1147, 1147, 1147, 1147, 1147, 1147, 1147, 1147, 1147, 1147, 1147, 1147, 1147, 1147, 1147, 1147, 1147, 1147, 1147, 1147, 1147, 1147, 1147, 1147, 1147, 1147, 1147, 1147, 1147, 1147, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149 }; /* 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, 1, 1, 1, 1, 1, 1, 1, 0, 2, 5, 1, 1, 0, 2, 0, 2, 0, 2, 2, 3, 3, 1, 3, 3, 2, 1, 1, 2, 2, 2, 3, 3, 5, 5, 5, 0, 3, 5, 5, 5, 5, 3, 5, 3, 5, 3, 5, 5, 6, 1, 1, 6, 4, 9, 7, 1, 0, 2, 0, 1, 1, 1, 1, 1, 1, 3, 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, 5, 1, 1, 1, 1, 1, 0, 1, 1, 2, 3, 1, 2, 3, 2, 1, 1, 2, 1, 2, 1, 3, 3, 2, 3, 4, 3, 2, 4, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 4, 6, 4, 6, 10, 13, 4, 6, 4, 10, 13, 4, 6, 4, 6, 5, 7, 11, 14, 1, 3, 4, 3, 3, 2, 5, 3, 6, 4, 6, 6, 6, 6, 5, 5, 6, 9, 4, 5, 7, 6, 4, 8, 4, 2, 4, 3, 6, 4, 3, 3, 3, 2, 2, 3, 4, 4, 3, 3, 3, 3, 3, 3, 4, 4, 3, 2, 3, 2, 2, 3, 3, 2, 2, 3, 4, 4, 4, 5, 1, 3, 2, 1, 1, 0, 2, 0, 2, 0, 1, 1, 1, 3, 3, 2, 0, 1, 3, 3, 1, 5, 3, 1, 2, 1, 3, 2, 3, 6, 6, 10, 1, 2, 1, 3, 4, 1, 3, 4, 6, 4, 8, 2, 2, 11, 9, 1, 1, 1, 0, 1, 1, 1, 1, 3, 2, 0, 1, 1, 3, 3, 1, 1, 3, 3, 3, 3, 4, 3, 2, 1, 0, 3, 0, 1, 0, 1, 3, 2, 1, 1, 1, 3, 0, 1, 3, 1, 13, 16, 12, 15, 14, 17, 1, 1, 2, 2, 2, 2, 1, 0, 1, 0, 3, 0, 1, 3, 1, 3, 1, 1, 1, 1, 1, 4, 2, 4, 2, 0, 3, 1, 1, 2, 2, 1, 3, 4, 5, 2, 5, 7, 5, 1, 2, 1, 2, 2, 2, 3, 3, 3, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, 5, 8, 3, 9, 4, 10, 11, 2, 0, 3, 0, 1, 3, 1, 4, 0, 2, 2, 2, 0, 1, 3, 3, 6, 4, 0, 1, 1, 2, 2, 0, 3, 3, 2, 1, 1, 2, 2, 4, 0, 1, 0, 6, 1, 1, 1, 3, 3, 3, 5, 2, 0, 2, 2, 0, 3, 4, 4, 0, 2, 0, 4, 0, 3, 8, 11, 7, 10, 6, 2, 3, 0, 8, 11, 5, 1, 0, 6, 5, 8, 4, 6, 1, 0, 3, 0, 1, 2, 2, 2, 1, 2, 3, 2, 2, 2, 2, 3, 3, 3, 1, 3, 1, 0, 1, 2, 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, 1, 5, 2, 0, 2, 7, 6, 10, 6, 6, 6, 6, 7, 6, 9, 9, 6, 6, 6, 7, 6, 8, 8, 8, 8, 6, 6, 7, 7, 8, 6, 9, 6, 7, 2, 2, 2, 2, 1, 2, 1, 0, 7, 6, 4, 0, 1, 3, 4, 1, 3, 1, 2, 2, 2, 2, 1, 1, 10, 13, 2, 0, 2, 2, 1, 0, 5, 4, 4, 11, 14, 12, 15, 5, 7, 11, 2, 1, 4, 0, 8, 11, 1, 1, 7, 9, 8, 10, 8, 4, 0, 5, 0, 2, 0, 2, 0, 2, 0, 2, 0, 1, 1, 1, 1, 1, 8, 1, 1, 16, 20, 1, 1, 2, 1, 3, 1, 1, 1, 3, 1, 2, 0, 1, 2, 4, 1, 1, 1, 1, 1, 3, 0, 1, 0, 1, 1, 4, 0, 1, 1, 1, 3, 0, 1, 1, 1, 1, 2, 0, 0, 2, 2, 1, 2, 2, 2, 2, 11, 13, 1, 3, 5, 1, 3, 5, 1, 2, 2, 1, 8, 6, 5, 4, 4, 3, 7, 8, 6, 6, 6, 6, 6, 4, 7, 5, 8, 3, 1, 3, 3, 1, 1, 1, 1, 1, 1, 1, 3, 1, 3, 3, 1, 0, 1, 3, 7, 9, 9, 8, 3, 0, 13, 1, 3, 5, 5, 3, 6, 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, 6, 4, 6, 8, 4, 6, 4, 6, 5, 7, 1, 1, 1, 2, 1, 2, 1, 1, 1, 3, 3, 3, 3, 2, 2, 1, 3, 1, 1, 1, 1, 1, 1, 1, 3, 1, 2, 2, 3, 1, 3, 5, 2, 2, 0, 6, 6, 6, 6, 6, 6, 6, 8, 9, 8, 6, 6, 8, 9, 8, 9, 9, 7, 10, 1, 1, 1, 1, 1, 1, 2, 1, 1, 2, 3, 3, 3, 3, 2, 1, 2, 1, 3, 2, 1, 1, 1, 1, 1, 1, 1, 1, 8, 8, 8, 8, 8, 8, 9, 8, 8, 2, 0, 1, 2, 1, 1, 1, 2, 1, 2, 2, 1, 1, 1, 1, 1, 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, 2, 2, 3, 2, 2, 2, 5, 5, 5, 5, 5, 1, 3, 1, 2, 3, 0, 6, 6, 9, 3, 0, 3, 0, 5, 2, 0, 3, 3, 3, 7, 7, 10, 1, 1, 1, 1, 1, 1, 15, 18, 1, 0, 1, 0, 1, 0, 2, 0, 1, 3, 5, 5, 7, 4, 0, 1, 3, 2, 0, 1, 0, 1, 1, 0, 2, 2, 0, 8, 11, 6, 6, 2, 0, 3, 2, 1, 3, 1, 3, 2, 1, 1, 2, 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, 2, 1, 3, 1, 2, 4, 5, 1, 1, 1, 1, 3, 3, 2, 2, 1, 2, 2, 2, 2, 1, 2, 2, 2, 2, 1, 1, 1, 3, 3, 5, 2, 0, 2, 1, 3, 5, 5, 5, 1, 2, 1, 0, 4, 6, 4, 6, 4, 6, 4, 6, 4, 6, 3, 5, 5, 5, 1, 3, 1, 3, 2, 2, 1, 2, 1, 2, 11, 10, 10, 2, 2, 0, 9, 2, 0, 10, 11, 11, 5, 5, 8, 4, 4, 7, 7, 1, 1, 1, 1, 1, 1, 3, 1, 5, 5, 6, 6, 6, 6, 6, 8, 8, 6, 6, 7, 9, 9, 8, 10, 6, 6, 6, 6, 6, 6, 6, 8, 6, 8, 6, 8, 7, 9, 6, 8, 7, 9, 8, 10, 9, 11, 8, 10, 9, 11, 8, 8, 7, 6, 6, 6, 6, 8, 8, 8, 8, 6, 9, 1, 0, 2, 0, 7, 7, 7, 9, 8, 7, 6, 6, 6, 6, 6, 6, 6, 9, 9, 6, 6, 6, 8, 6, 8, 8, 8, 8, 6, 8, 6, 8, 7, 9, 7, 9, 6, 7, 1, 3, 3, 3, 1, 1, 1, 1, 1, 6, 6, 6, 6, 6, 6, 7, 7, 6, 9, 9, 6, 6, 6, 6, 6, 6, 8, 8, 8, 6, 7, 6, 6, 5, 1, 0, 3, 3, 5, 6, 6, 6, 8, 1, 3, 1, 5, 5, 6, 7, 4, 4, 4, 6, 13, 1, 1, 3, 3, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 3, 2, 0, 2, 2, 2, 3, 3, 3, 3, 3, 3, 2, 3, 2, 5, 4, 3, 3, 3, 1, 1, 0, 3, 2, 2, 1, 2, 1, 3, 2, 1, 0, 2, 3, 0, 9, 11, 12, 14, 3, 4, 4, 0, 2, 5, 1, 0, 1, 2, 3, 3, 3, 1, 2, 1, 1, 1, 1, 1, 1, 0, 5, 4, 6, 4, 3, 5, 5, 4, 4, 6, 4, 6, 6, 5, 7, 9, 6, 1, 0, 6, 11, 11, 11, 13, 9, 11, 1, 1, 10, 4, 2, 5, 2, 0, 6, 5, 3, 5, 1, 3, 1, 1, 2, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 3, 0, 2, 1, 3, 1, 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, 12, 3, 0, 2, 3, 2, 3, 7, 1, 3, 1, 4, 4, 7, 2, 1, 1, 1, 3, 2, 8, 5, 0, 4, 3, 0, 2, 0, 7, 2, 0, 5, 3, 0, 2, 2, 2, 3, 1, 3, 1, 2, 1, 0, 1, 2, 0, 8, 1, 3, 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, 9, 1, 2, 4, 4, 4, 2, 2, 3, 1, 3, 7, 1, 2, 0, 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, 4, 2, 3, 1, 1, 1, 1, 2, 2, 1, 1, 1, 1, 1, 1, 3, 0, 1, 3, 1, 1, 1, 1, 1, 2, 4, 4, 5, 2, 0, 1, 3, 1, 0, 1, 2, 3, 2, 4, 2, 3, 2, 0, 4, 5, 2, 0, 1, 3, 2, 3, 2, 3, 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, 6, 4, 0, 2, 6, 2, 1, 3, 4, 0, 2, 0, 2, 0, 2, 4, 0, 1, 0, 1, 3, 3, 7, 12, 1, 3, 2, 3, 3, 1, 2, 2, 2, 2, 1, 1, 3, 3, 2, 2, 3, 5, 6, 2, 3, 3, 4, 0, 1, 1, 1, 1, 1, 2, 4, 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, 4, 1, 2, 2, 1, 3, 3, 2, 1, 0, 5, 2, 5, 2, 1, 3, 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, 3, 3, 3, 2, 2, 3, 3, 2, 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, 1, 3, 2, 2, 3, 3, 3, 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, 1, 4, 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, 3, 3, 4, 2, 2, 5, 0, 5, 0, 2, 0, 1, 3, 3, 2, 2, 0, 6, 1, 0, 3, 0, 3, 3, 3, 0, 1, 4, 2, 2, 2, 2, 2, 3, 2, 2, 3, 0, 4, 3, 5, 4, 3, 5, 1, 1, 1, 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, 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, 0, 1, 2, 0, 2, 1, 0, 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, 5, 1, 1, 1, 1, 1, 1, 2, 2, 1, 1, 1, 1, 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, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 827 "gram.y" /* yacc.c:1646 */ { pg_yyget_extra(yyscanner)->parsetree = (yyvsp[0].list); } #line 26334 "gram.c" /* yacc.c:1646 */ break; case 3: #line 843 "gram.y" /* yacc.c:1646 */ { if ((yyvsp[-2].list) != NIL) { /* update length of previous stmt */ updateRawStmtEnd(llast_node(RawStmt, (yyvsp[-2].list)), (yylsp[-1])); } if ((yyvsp[0].node) != NULL) (yyval.list) = lappend((yyvsp[-2].list), makeRawStmt((yyvsp[0].node), (yylsp[-1]) + 1)); else (yyval.list) = (yyvsp[-2].list); } #line 26350 "gram.c" /* yacc.c:1646 */ break; case 4: #line 855 "gram.y" /* yacc.c:1646 */ { if ((yyvsp[0].node) != NULL) (yyval.list) = list_make1(makeRawStmt((yyvsp[0].node), 0)); else (yyval.list) = NIL; } #line 26361 "gram.c" /* yacc.c:1646 */ break; case 128: #line 988 "gram.y" /* yacc.c:1646 */ { (yyval.node) = NULL; } #line 26367 "gram.c" /* yacc.c:1646 */ break; case 129: #line 998 "gram.y" /* yacc.c:1646 */ { CallStmt *n = makeNode(CallStmt); n->funccall = castNode(FuncCall, (yyvsp[0].node)); (yyval.node) = (Node *)n; } #line 26377 "gram.c" /* yacc.c:1646 */ break; case 130: #line 1013 "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 26389 "gram.c" /* yacc.c:1646 */ break; case 131: #line 1023 "gram.y" /* yacc.c:1646 */ {} #line 26395 "gram.c" /* yacc.c:1646 */ break; case 132: #line 1024 "gram.y" /* yacc.c:1646 */ {} #line 26401 "gram.c" /* yacc.c:1646 */ break; case 133: #line 1025 "gram.y" /* yacc.c:1646 */ {} #line 26407 "gram.c" /* yacc.c:1646 */ break; case 134: #line 1034 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-1].list), (yyvsp[0].defelt)); } #line 26413 "gram.c" /* yacc.c:1646 */ break; case 135: #line 1035 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 26419 "gram.c" /* yacc.c:1646 */ break; case 136: #line 1039 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-1].list), (yyvsp[0].defelt)); } #line 26425 "gram.c" /* yacc.c:1646 */ break; case 137: #line 1040 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 26431 "gram.c" /* yacc.c:1646 */ break; case 138: #line 1045 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("password", (Node *)makeString((yyvsp[0].str)), (yylsp[-1])); } #line 26440 "gram.c" /* yacc.c:1646 */ break; case 139: #line 1050 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("password", NULL, (yylsp[-1])); } #line 26448 "gram.c" /* yacc.c:1646 */ break; case 140: #line 1054 "gram.y" /* yacc.c:1646 */ { /* * These days, passwords are always stored in encrypted * form, so there is no difference between PASSWORD and * ENCRYPTED PASSWORD. */ (yyval.defelt) = makeDefElem("password", (Node *)makeString((yyvsp[0].str)), (yylsp[-2])); } #line 26462 "gram.c" /* yacc.c:1646 */ break; case 141: #line 1064 "gram.y" /* yacc.c:1646 */ { ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), errmsg("UNENCRYPTED PASSWORD is no longer supported"), errhint("Remove UNENCRYPTED to store the password in encrypted form instead."), parser_errposition((yylsp[-2])))); } #line 26474 "gram.c" /* yacc.c:1646 */ break; case 142: #line 1072 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("inherit", (Node *)makeInteger(true), (yylsp[0])); } #line 26482 "gram.c" /* yacc.c:1646 */ break; case 143: #line 1076 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("connectionlimit", (Node *)makeInteger((yyvsp[0].ival)), (yylsp[-2])); } #line 26490 "gram.c" /* yacc.c:1646 */ break; case 144: #line 1080 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("validUntil", (Node *)makeString((yyvsp[0].str)), (yylsp[-2])); } #line 26498 "gram.c" /* yacc.c:1646 */ break; case 145: #line 1085 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("rolemembers", (Node *)(yyvsp[0].list), (yylsp[-1])); } #line 26506 "gram.c" /* yacc.c:1646 */ break; case 146: #line 1089 "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), (yylsp[0])); else if (strcmp((yyvsp[0].str), "nosuperuser") == 0) (yyval.defelt) = makeDefElem("superuser", (Node *)makeInteger(false), (yylsp[0])); else if (strcmp((yyvsp[0].str), "createrole") == 0) (yyval.defelt) = makeDefElem("createrole", (Node *)makeInteger(true), (yylsp[0])); else if (strcmp((yyvsp[0].str), "nocreaterole") == 0) (yyval.defelt) = makeDefElem("createrole", (Node *)makeInteger(false), (yylsp[0])); else if (strcmp((yyvsp[0].str), "replication") == 0) (yyval.defelt) = makeDefElem("isreplication", (Node *)makeInteger(true), (yylsp[0])); else if (strcmp((yyvsp[0].str), "noreplication") == 0) (yyval.defelt) = makeDefElem("isreplication", (Node *)makeInteger(false), (yylsp[0])); else if (strcmp((yyvsp[0].str), "createdb") == 0) (yyval.defelt) = makeDefElem("createdb", (Node *)makeInteger(true), (yylsp[0])); else if (strcmp((yyvsp[0].str), "nocreatedb") == 0) (yyval.defelt) = makeDefElem("createdb", (Node *)makeInteger(false), (yylsp[0])); else if (strcmp((yyvsp[0].str), "login") == 0) (yyval.defelt) = makeDefElem("canlogin", (Node *)makeInteger(true), (yylsp[0])); else if (strcmp((yyvsp[0].str), "nologin") == 0) (yyval.defelt) = makeDefElem("canlogin", (Node *)makeInteger(false), (yylsp[0])); else if (strcmp((yyvsp[0].str), "bypassrls") == 0) (yyval.defelt) = makeDefElem("bypassrls", (Node *)makeInteger(true), (yylsp[0])); else if (strcmp((yyvsp[0].str), "nobypassrls") == 0) (yyval.defelt) = makeDefElem("bypassrls", (Node *)makeInteger(false), (yylsp[0])); 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), (yylsp[0])); } else ereport(ERROR, (errcode(ERRCODE_SYNTAX_ERROR), errmsg("unrecognized role option \"%s\"", (yyvsp[0].str)), parser_errposition((yylsp[0])))); } #line 26555 "gram.c" /* yacc.c:1646 */ break; case 147: #line 1136 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = (yyvsp[0].defelt); } #line 26561 "gram.c" /* yacc.c:1646 */ break; case 148: #line 1139 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("sysid", (Node *)makeInteger((yyvsp[0].ival)), (yylsp[-1])); } #line 26569 "gram.c" /* yacc.c:1646 */ break; case 149: #line 1143 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("adminmembers", (Node *)(yyvsp[0].list), (yylsp[-1])); } #line 26577 "gram.c" /* yacc.c:1646 */ break; case 150: #line 1147 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("rolemembers", (Node *)(yyvsp[0].list), (yylsp[-1])); } #line 26585 "gram.c" /* yacc.c:1646 */ break; case 151: #line 1151 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("addroleto", (Node *)(yyvsp[0].list), (yylsp[-2])); } #line 26593 "gram.c" /* yacc.c:1646 */ break; case 152: #line 1155 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("addroleto", (Node *)(yyvsp[0].list), (yylsp[-2])); } #line 26601 "gram.c" /* yacc.c:1646 */ break; case 153: #line 1169 "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 26613 "gram.c" /* yacc.c:1646 */ break; case 154: #line 1187 "gram.y" /* yacc.c:1646 */ { AlterRoleStmt *n = makeNode(AlterRoleStmt); n->role = (yyvsp[-2].rolespec); n->action = +1; /* add, if there are members */ n->options = (yyvsp[0].list); (yyval.node) = (Node *)n; } #line 26625 "gram.c" /* yacc.c:1646 */ break; case 155: #line 1195 "gram.y" /* yacc.c:1646 */ { AlterRoleStmt *n = makeNode(AlterRoleStmt); n->role = (yyvsp[-2].rolespec); n->action = +1; /* add, if there are members */ n->options = (yyvsp[0].list); (yyval.node) = (Node *)n; } #line 26637 "gram.c" /* yacc.c:1646 */ break; case 156: #line 1205 "gram.y" /* yacc.c:1646 */ { (yyval.str) = NULL; } #line 26643 "gram.c" /* yacc.c:1646 */ break; case 157: #line 1206 "gram.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 26649 "gram.c" /* yacc.c:1646 */ break; case 158: #line 1211 "gram.y" /* yacc.c:1646 */ { AlterRoleSetStmt *n = makeNode(AlterRoleSetStmt); n->role = (yyvsp[-2].rolespec); n->database = (yyvsp[-1].str); n->setstmt = (yyvsp[0].vsetstmt); (yyval.node) = (Node *)n; } #line 26661 "gram.c" /* yacc.c:1646 */ break; case 159: #line 1219 "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 26673 "gram.c" /* yacc.c:1646 */ break; case 160: #line 1227 "gram.y" /* yacc.c:1646 */ { AlterRoleSetStmt *n = makeNode(AlterRoleSetStmt); n->role = (yyvsp[-2].rolespec); n->database = (yyvsp[-1].str); n->setstmt = (yyvsp[0].vsetstmt); (yyval.node) = (Node *)n; } #line 26685 "gram.c" /* yacc.c:1646 */ break; case 161: #line 1235 "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 26697 "gram.c" /* yacc.c:1646 */ break; case 162: #line 1256 "gram.y" /* yacc.c:1646 */ { DropRoleStmt *n = makeNode(DropRoleStmt); n->missing_ok = false; n->roles = (yyvsp[0].list); (yyval.node) = (Node *)n; } #line 26708 "gram.c" /* yacc.c:1646 */ break; case 163: #line 1263 "gram.y" /* yacc.c:1646 */ { DropRoleStmt *n = makeNode(DropRoleStmt); n->missing_ok = true; n->roles = (yyvsp[0].list); (yyval.node) = (Node *)n; } #line 26719 "gram.c" /* yacc.c:1646 */ break; case 164: #line 1270 "gram.y" /* yacc.c:1646 */ { DropRoleStmt *n = makeNode(DropRoleStmt); n->missing_ok = false; n->roles = (yyvsp[0].list); (yyval.node) = (Node *)n; } #line 26730 "gram.c" /* yacc.c:1646 */ break; case 165: #line 1277 "gram.y" /* yacc.c:1646 */ { DropRoleStmt *n = makeNode(DropRoleStmt); n->roles = (yyvsp[0].list); n->missing_ok = true; (yyval.node) = (Node *)n; } #line 26741 "gram.c" /* yacc.c:1646 */ break; case 166: #line 1284 "gram.y" /* yacc.c:1646 */ { DropRoleStmt *n = makeNode(DropRoleStmt); n->missing_ok = false; n->roles = (yyvsp[0].list); (yyval.node) = (Node *)n; } #line 26752 "gram.c" /* yacc.c:1646 */ break; case 167: #line 1291 "gram.y" /* yacc.c:1646 */ { DropRoleStmt *n = makeNode(DropRoleStmt); n->missing_ok = true; n->roles = (yyvsp[0].list); (yyval.node) = (Node *)n; } #line 26763 "gram.c" /* yacc.c:1646 */ break; case 168: #line 1308 "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 26775 "gram.c" /* yacc.c:1646 */ break; case 169: #line 1326 "gram.y" /* yacc.c:1646 */ { AlterRoleStmt *n = makeNode(AlterRoleStmt); n->role = (yyvsp[-3].rolespec); n->action = (yyvsp[-2].ival); n->options = list_make1(makeDefElem("rolemembers", (Node *)(yyvsp[0].list), (yylsp[0]))); (yyval.node) = (Node *)n; } #line 26788 "gram.c" /* yacc.c:1646 */ break; case 170: #line 1336 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = +1; } #line 26794 "gram.c" /* yacc.c:1646 */ break; case 171: #line 1337 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = -1; } #line 26800 "gram.c" /* yacc.c:1646 */ break; case 172: #line 1349 "gram.y" /* yacc.c:1646 */ { CreateSchemaStmt *n = makeNode(CreateSchemaStmt); /* One can omit the schema name or the authorization id. */ n->schemaname = (yyvsp[-3].str); n->authrole = (yyvsp[-1].rolespec); n->schemaElts = (yyvsp[0].list); n->if_not_exists = false; (yyval.node) = (Node *)n; } #line 26814 "gram.c" /* yacc.c:1646 */ break; case 173: #line 1359 "gram.y" /* yacc.c:1646 */ { CreateSchemaStmt *n = makeNode(CreateSchemaStmt); /* ...but not both */ n->schemaname = (yyvsp[-1].str); n->authrole = NULL; n->schemaElts = (yyvsp[0].list); n->if_not_exists = false; (yyval.node) = (Node *)n; } #line 26828 "gram.c" /* yacc.c:1646 */ break; case 174: #line 1369 "gram.y" /* yacc.c:1646 */ { CreateSchemaStmt *n = makeNode(CreateSchemaStmt); /* schema name can be omitted here, too */ n->schemaname = (yyvsp[-3].str); n->authrole = (yyvsp[-1].rolespec); 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 26847 "gram.c" /* yacc.c:1646 */ break; case 175: #line 1384 "gram.y" /* yacc.c:1646 */ { CreateSchemaStmt *n = makeNode(CreateSchemaStmt); /* ...but not here */ n->schemaname = (yyvsp[-1].str); n->authrole = 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 26866 "gram.c" /* yacc.c:1646 */ break; case 176: #line 1401 "gram.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 26872 "gram.c" /* yacc.c:1646 */ break; case 177: #line 1402 "gram.y" /* yacc.c:1646 */ { (yyval.str) = NULL; } #line 26878 "gram.c" /* yacc.c:1646 */ break; case 178: #line 1407 "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 26888 "gram.c" /* yacc.c:1646 */ break; case 179: #line 1413 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 26894 "gram.c" /* yacc.c:1646 */ break; case 186: #line 1441 "gram.y" /* yacc.c:1646 */ { VariableSetStmt *n = (yyvsp[0].vsetstmt); n->type = T_PgpoolVariableSetStmt; /* Hack to keep changes minumum */ n->is_local = false; (yyval.node) = (Node *) n; } #line 26905 "gram.c" /* yacc.c:1646 */ break; case 187: #line 1448 "gram.y" /* yacc.c:1646 */ { VariableSetStmt *n = (yyvsp[0].vsetstmt); n->is_local = false; (yyval.node) = (Node *) n; } #line 26915 "gram.c" /* yacc.c:1646 */ break; case 188: #line 1454 "gram.y" /* yacc.c:1646 */ { VariableSetStmt *n = (yyvsp[0].vsetstmt); n->is_local = true; (yyval.node) = (Node *) n; } #line 26925 "gram.c" /* yacc.c:1646 */ break; case 189: #line 1460 "gram.y" /* yacc.c:1646 */ { VariableSetStmt *n = (yyvsp[0].vsetstmt); n->is_local = false; (yyval.node) = (Node *) n; } #line 26935 "gram.c" /* yacc.c:1646 */ break; case 190: #line 1469 "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 26947 "gram.c" /* yacc.c:1646 */ break; case 191: #line 1477 "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 26959 "gram.c" /* yacc.c:1646 */ break; case 193: #line 1489 "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 26971 "gram.c" /* yacc.c:1646 */ break; case 194: #line 1497 "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 26983 "gram.c" /* yacc.c:1646 */ break; case 195: #line 1505 "gram.y" /* yacc.c:1646 */ { VariableSetStmt *n = makeNode(VariableSetStmt); n->kind = VAR_SET_DEFAULT; n->name = (yyvsp[-2].str); (yyval.vsetstmt) = n; } #line 26994 "gram.c" /* yacc.c:1646 */ break; case 196: #line 1512 "gram.y" /* yacc.c:1646 */ { VariableSetStmt *n = makeNode(VariableSetStmt); n->kind = VAR_SET_DEFAULT; n->name = (yyvsp[-2].str); (yyval.vsetstmt) = n; } #line 27005 "gram.c" /* yacc.c:1646 */ break; case 197: #line 1521 "gram.y" /* yacc.c:1646 */ {(yyval.vsetstmt) = (yyvsp[0].vsetstmt);} #line 27011 "gram.c" /* yacc.c:1646 */ break; case 198: #line 1523 "gram.y" /* yacc.c:1646 */ { VariableSetStmt *n = makeNode(VariableSetStmt); n->kind = VAR_SET_CURRENT; n->name = (yyvsp[-2].str); (yyval.vsetstmt) = n; } #line 27022 "gram.c" /* yacc.c:1646 */ break; case 199: #line 1531 "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 27037 "gram.c" /* yacc.c:1646 */ break; case 200: #line 1542 "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 27049 "gram.c" /* yacc.c:1646 */ break; case 201: #line 1550 "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 27061 "gram.c" /* yacc.c:1646 */ break; case 202: #line 1558 "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 27076 "gram.c" /* yacc.c:1646 */ break; case 203: #line 1569 "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 27088 "gram.c" /* yacc.c:1646 */ break; case 204: #line 1577 "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 27100 "gram.c" /* yacc.c:1646 */ break; case 205: #line 1585 "gram.y" /* yacc.c:1646 */ { VariableSetStmt *n = makeNode(VariableSetStmt); n->kind = VAR_SET_DEFAULT; n->name = "session_authorization"; (yyval.vsetstmt) = n; } #line 27111 "gram.c" /* yacc.c:1646 */ break; case 206: #line 1592 "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 27123 "gram.c" /* yacc.c:1646 */ break; case 207: #line 1601 "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 27135 "gram.c" /* yacc.c:1646 */ break; case 208: #line 1610 "gram.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 27141 "gram.c" /* yacc.c:1646 */ break; case 209: #line 1612 "gram.y" /* yacc.c:1646 */ { (yyval.str) = psprintf("%s.%s", (yyvsp[-2].str), (yyvsp[0].str)); } #line 27147 "gram.c" /* yacc.c:1646 */ break; case 210: #line 1615 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].node)); } #line 27153 "gram.c" /* yacc.c:1646 */ break; case 211: #line 1616 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].node)); } #line 27159 "gram.c" /* yacc.c:1646 */ break; case 212: #line 1620 "gram.y" /* yacc.c:1646 */ { (yyval.node) = makeStringConst((yyvsp[0].str), (yylsp[0])); } #line 27165 "gram.c" /* yacc.c:1646 */ break; case 213: #line 1622 "gram.y" /* yacc.c:1646 */ { (yyval.node) = makeAConst((yyvsp[0].value), (yylsp[0])); } #line 27171 "gram.c" /* yacc.c:1646 */ break; case 214: #line 1625 "gram.y" /* yacc.c:1646 */ { (yyval.str) = "read uncommitted"; } #line 27177 "gram.c" /* yacc.c:1646 */ break; case 215: #line 1626 "gram.y" /* yacc.c:1646 */ { (yyval.str) = "read committed"; } #line 27183 "gram.c" /* yacc.c:1646 */ break; case 216: #line 1627 "gram.y" /* yacc.c:1646 */ { (yyval.str) = "repeatable read"; } #line 27189 "gram.c" /* yacc.c:1646 */ break; case 217: #line 1628 "gram.y" /* yacc.c:1646 */ { (yyval.str) = "serializable"; } #line 27195 "gram.c" /* yacc.c:1646 */ break; case 218: #line 1632 "gram.y" /* yacc.c:1646 */ { (yyval.str) = "true"; } #line 27201 "gram.c" /* yacc.c:1646 */ break; case 219: #line 1633 "gram.y" /* yacc.c:1646 */ { (yyval.str) = "false"; } #line 27207 "gram.c" /* yacc.c:1646 */ break; case 220: #line 1634 "gram.y" /* yacc.c:1646 */ { (yyval.str) = "on"; } #line 27213 "gram.c" /* yacc.c:1646 */ break; case 221: #line 1640 "gram.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 27219 "gram.c" /* yacc.c:1646 */ break; case 222: #line 1653 "gram.y" /* yacc.c:1646 */ { (yyval.node) = makeStringConst((yyvsp[0].str), (yylsp[0])); } #line 27227 "gram.c" /* yacc.c:1646 */ break; case 223: #line 1657 "gram.y" /* yacc.c:1646 */ { (yyval.node) = makeStringConst((yyvsp[0].str), (yylsp[0])); } #line 27235 "gram.c" /* yacc.c:1646 */ break; case 224: #line 1661 "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 27254 "gram.c" /* yacc.c:1646 */ break; case 225: #line 1676 "gram.y" /* yacc.c:1646 */ { TypeName *t = (yyvsp[-4].typnam); t->typmods = list_make2(makeIntConst(INTERVAL_FULL_RANGE, -1), makeIntConst((yyvsp[-2].ival), (yylsp[-2]))); (yyval.node) = makeStringConstCast((yyvsp[0].str), (yylsp[0]), t); } #line 27265 "gram.c" /* yacc.c:1646 */ break; case 226: #line 1682 "gram.y" /* yacc.c:1646 */ { (yyval.node) = makeAConst((yyvsp[0].value), (yylsp[0])); } #line 27271 "gram.c" /* yacc.c:1646 */ break; case 227: #line 1683 "gram.y" /* yacc.c:1646 */ { (yyval.node) = NULL; } #line 27277 "gram.c" /* yacc.c:1646 */ break; case 228: #line 1684 "gram.y" /* yacc.c:1646 */ { (yyval.node) = NULL; } #line 27283 "gram.c" /* yacc.c:1646 */ break; case 229: #line 1688 "gram.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 27289 "gram.c" /* yacc.c:1646 */ break; case 230: #line 1689 "gram.y" /* yacc.c:1646 */ { (yyval.str) = NULL; } #line 27295 "gram.c" /* yacc.c:1646 */ break; case 231: #line 1690 "gram.y" /* yacc.c:1646 */ { (yyval.str) = NULL; } #line 27301 "gram.c" /* yacc.c:1646 */ break; case 232: #line 1694 "gram.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 27307 "gram.c" /* yacc.c:1646 */ break; case 233: #line 1695 "gram.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 27313 "gram.c" /* yacc.c:1646 */ break; case 234: #line 1699 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) (yyvsp[0].vsetstmt); } #line 27319 "gram.c" /* yacc.c:1646 */ break; case 235: #line 1701 "gram.y" /* yacc.c:1646 */ { VariableSetStmt *n = (yyvsp[0].vsetstmt); n->type = T_PgpoolVariableSetStmt; /* Hack to keep the changes minumum */ (yyval.node) = (Node *) n; } #line 27329 "gram.c" /* yacc.c:1646 */ break; case 236: #line 1709 "gram.y" /* yacc.c:1646 */ { (yyval.vsetstmt) = (yyvsp[0].vsetstmt); } #line 27335 "gram.c" /* yacc.c:1646 */ break; case 237: #line 1711 "gram.y" /* yacc.c:1646 */ { VariableSetStmt *n = makeNode(VariableSetStmt); n->kind = VAR_RESET; n->name = "timezone"; (yyval.vsetstmt) = n; } #line 27346 "gram.c" /* yacc.c:1646 */ break; case 238: #line 1718 "gram.y" /* yacc.c:1646 */ { VariableSetStmt *n = makeNode(VariableSetStmt); n->kind = VAR_RESET; n->name = "transaction_isolation"; (yyval.vsetstmt) = n; } #line 27357 "gram.c" /* yacc.c:1646 */ break; case 239: #line 1725 "gram.y" /* yacc.c:1646 */ { VariableSetStmt *n = makeNode(VariableSetStmt); n->kind = VAR_RESET; n->name = "session_authorization"; (yyval.vsetstmt) = n; } #line 27368 "gram.c" /* yacc.c:1646 */ break; case 240: #line 1735 "gram.y" /* yacc.c:1646 */ { VariableSetStmt *n = makeNode(VariableSetStmt); n->kind = VAR_RESET; n->name = (yyvsp[0].str); (yyval.vsetstmt) = n; } #line 27379 "gram.c" /* yacc.c:1646 */ break; case 241: #line 1742 "gram.y" /* yacc.c:1646 */ { VariableSetStmt *n = makeNode(VariableSetStmt); n->kind = VAR_RESET_ALL; (yyval.vsetstmt) = n; } #line 27389 "gram.c" /* yacc.c:1646 */ break; case 242: #line 1751 "gram.y" /* yacc.c:1646 */ { (yyval.vsetstmt) = (yyvsp[0].vsetstmt); } #line 27395 "gram.c" /* yacc.c:1646 */ break; case 243: #line 1752 "gram.y" /* yacc.c:1646 */ { (yyval.vsetstmt) = (VariableSetStmt *) (yyvsp[0].node); } #line 27401 "gram.c" /* yacc.c:1646 */ break; case 244: #line 1757 "gram.y" /* yacc.c:1646 */ { (yyval.vsetstmt) = (yyvsp[0].vsetstmt); } #line 27407 "gram.c" /* yacc.c:1646 */ break; case 245: #line 1758 "gram.y" /* yacc.c:1646 */ { (yyval.vsetstmt) = (VariableSetStmt *) (yyvsp[0].node); } #line 27413 "gram.c" /* yacc.c:1646 */ break; case 246: #line 1765 "gram.y" /* yacc.c:1646 */ { VariableShowStmt *n = (VariableShowStmt *)newNode(sizeof(VariableShowStmt),T_PgpoolVariableShowStmt); n->name = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 27423 "gram.c" /* yacc.c:1646 */ break; case 247: #line 1771 "gram.y" /* yacc.c:1646 */ { VariableShowStmt *n = (VariableShowStmt *)newNode(sizeof(VariableShowStmt),T_PgpoolVariableShowStmt); n->name = "all"; (yyval.node) = (Node *) n; } #line 27433 "gram.c" /* yacc.c:1646 */ break; case 248: #line 1777 "gram.y" /* yacc.c:1646 */ { VariableShowStmt *n = makeNode(VariableShowStmt); n->name = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 27443 "gram.c" /* yacc.c:1646 */ break; case 249: #line 1783 "gram.y" /* yacc.c:1646 */ { VariableShowStmt *n = makeNode(VariableShowStmt); n->name = "timezone"; (yyval.node) = (Node *) n; } #line 27453 "gram.c" /* yacc.c:1646 */ break; case 250: #line 1789 "gram.y" /* yacc.c:1646 */ { VariableShowStmt *n = makeNode(VariableShowStmt); n->name = "transaction_isolation"; (yyval.node) = (Node *) n; } #line 27463 "gram.c" /* yacc.c:1646 */ break; case 251: #line 1795 "gram.y" /* yacc.c:1646 */ { VariableShowStmt *n = makeNode(VariableShowStmt); n->name = "session_authorization"; (yyval.node) = (Node *) n; } #line 27473 "gram.c" /* yacc.c:1646 */ break; case 252: #line 1801 "gram.y" /* yacc.c:1646 */ { VariableShowStmt *n = makeNode(VariableShowStmt); n->name = "all"; (yyval.node) = (Node *) n; } #line 27483 "gram.c" /* yacc.c:1646 */ break; case 253: #line 1811 "gram.y" /* yacc.c:1646 */ { ConstraintsSetStmt *n = makeNode(ConstraintsSetStmt); n->constraints = (yyvsp[-1].list); n->deferred = (yyvsp[0].boolean); (yyval.node) = (Node *) n; } #line 27494 "gram.c" /* yacc.c:1646 */ break; case 254: #line 1820 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 27500 "gram.c" /* yacc.c:1646 */ break; case 255: #line 1821 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 27506 "gram.c" /* yacc.c:1646 */ break; case 256: #line 1825 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = true; } #line 27512 "gram.c" /* yacc.c:1646 */ break; case 257: #line 1826 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = false; } #line 27518 "gram.c" /* yacc.c:1646 */ break; case 258: #line 1835 "gram.y" /* yacc.c:1646 */ { CheckPointStmt *n = makeNode(CheckPointStmt); (yyval.node) = (Node *)n; } #line 27527 "gram.c" /* yacc.c:1646 */ break; case 259: #line 1850 "gram.y" /* yacc.c:1646 */ { DiscardStmt *n = makeNode(DiscardStmt); n->target = DISCARD_ALL; (yyval.node) = (Node *) n; } #line 27537 "gram.c" /* yacc.c:1646 */ break; case 260: #line 1856 "gram.y" /* yacc.c:1646 */ { DiscardStmt *n = makeNode(DiscardStmt); n->target = DISCARD_TEMP; (yyval.node) = (Node *) n; } #line 27547 "gram.c" /* yacc.c:1646 */ break; case 261: #line 1862 "gram.y" /* yacc.c:1646 */ { DiscardStmt *n = makeNode(DiscardStmt); n->target = DISCARD_TEMP; (yyval.node) = (Node *) n; } #line 27557 "gram.c" /* yacc.c:1646 */ break; case 262: #line 1868 "gram.y" /* yacc.c:1646 */ { DiscardStmt *n = makeNode(DiscardStmt); n->target = DISCARD_PLANS; (yyval.node) = (Node *) n; } #line 27567 "gram.c" /* yacc.c:1646 */ break; case 263: #line 1874 "gram.y" /* yacc.c:1646 */ { DiscardStmt *n = makeNode(DiscardStmt); n->target = DISCARD_SEQUENCES; (yyval.node) = (Node *) n; } #line 27577 "gram.c" /* yacc.c:1646 */ break; case 264: #line 1893 "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 27590 "gram.c" /* yacc.c:1646 */ break; case 265: #line 1902 "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 27603 "gram.c" /* yacc.c:1646 */ break; case 266: #line 1911 "gram.y" /* yacc.c:1646 */ { AlterTableStmt *n = makeNode(AlterTableStmt); n->relation = (yyvsp[-1].range); n->cmds = list_make1((yyvsp[0].node)); n->relkind = OBJECT_TABLE; n->missing_ok = false; (yyval.node) = (Node *)n; } #line 27616 "gram.c" /* yacc.c:1646 */ break; case 267: #line 1920 "gram.y" /* yacc.c:1646 */ { AlterTableStmt *n = makeNode(AlterTableStmt); n->relation = (yyvsp[-1].range); n->cmds = list_make1((yyvsp[0].node)); n->relkind = OBJECT_TABLE; n->missing_ok = true; (yyval.node) = (Node *)n; } #line 27629 "gram.c" /* yacc.c:1646 */ break; case 268: #line 1929 "gram.y" /* yacc.c:1646 */ { AlterTableMoveAllStmt *n = makeNode(AlterTableMoveAllStmt); n->orig_tablespacename = (yyvsp[-4].str); n->objtype = OBJECT_TABLE; n->roles = NIL; n->new_tablespacename = (yyvsp[-1].str); n->nowait = (yyvsp[0].boolean); (yyval.node) = (Node *)n; } #line 27644 "gram.c" /* yacc.c:1646 */ break; case 269: #line 1940 "gram.y" /* yacc.c:1646 */ { AlterTableMoveAllStmt *n = makeNode(AlterTableMoveAllStmt); n->orig_tablespacename = (yyvsp[-7].str); n->objtype = OBJECT_TABLE; n->roles = (yyvsp[-4].list); n->new_tablespacename = (yyvsp[-1].str); n->nowait = (yyvsp[0].boolean); (yyval.node) = (Node *)n; } #line 27659 "gram.c" /* yacc.c:1646 */ break; case 270: #line 1951 "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 27672 "gram.c" /* yacc.c:1646 */ break; case 271: #line 1960 "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 27685 "gram.c" /* yacc.c:1646 */ break; case 272: #line 1969 "gram.y" /* yacc.c:1646 */ { AlterTableStmt *n = makeNode(AlterTableStmt); n->relation = (yyvsp[-1].range); n->cmds = list_make1((yyvsp[0].node)); n->relkind = OBJECT_INDEX; n->missing_ok = false; (yyval.node) = (Node *)n; } #line 27698 "gram.c" /* yacc.c:1646 */ break; case 273: #line 1978 "gram.y" /* yacc.c:1646 */ { AlterTableMoveAllStmt *n = makeNode(AlterTableMoveAllStmt); n->orig_tablespacename = (yyvsp[-4].str); n->objtype = OBJECT_INDEX; n->roles = NIL; n->new_tablespacename = (yyvsp[-1].str); n->nowait = (yyvsp[0].boolean); (yyval.node) = (Node *)n; } #line 27713 "gram.c" /* yacc.c:1646 */ break; case 274: #line 1989 "gram.y" /* yacc.c:1646 */ { AlterTableMoveAllStmt *n = makeNode(AlterTableMoveAllStmt); n->orig_tablespacename = (yyvsp[-7].str); n->objtype = OBJECT_INDEX; n->roles = (yyvsp[-4].list); n->new_tablespacename = (yyvsp[-1].str); n->nowait = (yyvsp[0].boolean); (yyval.node) = (Node *)n; } #line 27728 "gram.c" /* yacc.c:1646 */ break; case 275: #line 2000 "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 27741 "gram.c" /* yacc.c:1646 */ break; case 276: #line 2009 "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 27754 "gram.c" /* yacc.c:1646 */ break; case 277: #line 2018 "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 27767 "gram.c" /* yacc.c:1646 */ break; case 278: #line 2027 "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 27780 "gram.c" /* yacc.c:1646 */ break; case 279: #line 2036 "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 27793 "gram.c" /* yacc.c:1646 */ break; case 280: #line 2045 "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 27806 "gram.c" /* yacc.c:1646 */ break; case 281: #line 2054 "gram.y" /* yacc.c:1646 */ { AlterTableMoveAllStmt *n = makeNode(AlterTableMoveAllStmt); n->orig_tablespacename = (yyvsp[-4].str); n->objtype = OBJECT_MATVIEW; n->roles = NIL; n->new_tablespacename = (yyvsp[-1].str); n->nowait = (yyvsp[0].boolean); (yyval.node) = (Node *)n; } #line 27821 "gram.c" /* yacc.c:1646 */ break; case 282: #line 2065 "gram.y" /* yacc.c:1646 */ { AlterTableMoveAllStmt *n = makeNode(AlterTableMoveAllStmt); n->orig_tablespacename = (yyvsp[-7].str); n->objtype = OBJECT_MATVIEW; n->roles = (yyvsp[-4].list); n->new_tablespacename = (yyvsp[-1].str); n->nowait = (yyvsp[0].boolean); (yyval.node) = (Node *)n; } #line 27836 "gram.c" /* yacc.c:1646 */ break; case 283: #line 2078 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].node)); } #line 27842 "gram.c" /* yacc.c:1646 */ break; case 284: #line 2079 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].node)); } #line 27848 "gram.c" /* yacc.c:1646 */ break; case 285: #line 2085 "gram.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); PartitionCmd *cmd = makeNode(PartitionCmd); n->subtype = AT_AttachPartition; cmd->name = (yyvsp[-1].range); cmd->bound = (yyvsp[0].partboundspec); n->def = (Node *) cmd; (yyval.node) = (Node *) n; } #line 27864 "gram.c" /* yacc.c:1646 */ break; case 286: #line 2098 "gram.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); PartitionCmd *cmd = makeNode(PartitionCmd); n->subtype = AT_DetachPartition; cmd->name = (yyvsp[0].range); cmd->bound = NULL; n->def = (Node *) cmd; (yyval.node) = (Node *) n; } #line 27880 "gram.c" /* yacc.c:1646 */ break; case 287: #line 2114 "gram.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); PartitionCmd *cmd = makeNode(PartitionCmd); n->subtype = AT_AttachPartition; cmd->name = (yyvsp[0].range); cmd->bound = NULL; n->def = (Node *) cmd; (yyval.node) = (Node *) n; } #line 27896 "gram.c" /* yacc.c:1646 */ break; case 288: #line 2130 "gram.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_AddColumn; n->def = (yyvsp[0].node); n->missing_ok = false; (yyval.node) = (Node *)n; } #line 27908 "gram.c" /* yacc.c:1646 */ break; case 289: #line 2139 "gram.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_AddColumn; n->def = (yyvsp[0].node); n->missing_ok = true; (yyval.node) = (Node *)n; } #line 27920 "gram.c" /* yacc.c:1646 */ break; case 290: #line 2148 "gram.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_AddColumn; n->def = (yyvsp[0].node); n->missing_ok = false; (yyval.node) = (Node *)n; } #line 27932 "gram.c" /* yacc.c:1646 */ break; case 291: #line 2157 "gram.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_AddColumn; n->def = (yyvsp[0].node); n->missing_ok = true; (yyval.node) = (Node *)n; } #line 27944 "gram.c" /* yacc.c:1646 */ break; case 292: #line 2166 "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 27956 "gram.c" /* yacc.c:1646 */ break; case 293: #line 2175 "gram.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_DropNotNull; n->name = (yyvsp[-3].str); (yyval.node) = (Node *)n; } #line 27967 "gram.c" /* yacc.c:1646 */ break; case 294: #line 2183 "gram.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_SetNotNull; n->name = (yyvsp[-3].str); (yyval.node) = (Node *)n; } #line 27978 "gram.c" /* yacc.c:1646 */ break; case 295: #line 2191 "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 27990 "gram.c" /* yacc.c:1646 */ break; case 296: #line 2200 "gram.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); if ((yyvsp[-3].ival) <= 0 || (yyvsp[-3].ival) > PG_INT16_MAX) ereport(ERROR, (errcode(ERRCODE_INVALID_PARAMETER_VALUE), errmsg("column number must be in range from 1 to %d", PG_INT16_MAX), parser_errposition((yylsp[-3])))); n->subtype = AT_SetStatistics; n->num = (int16) (yyvsp[-3].ival); n->def = (Node *) makeInteger((yyvsp[0].ival)); (yyval.node) = (Node *)n; } #line 28009 "gram.c" /* yacc.c:1646 */ break; case 297: #line 2216 "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 28021 "gram.c" /* yacc.c:1646 */ break; case 298: #line 2225 "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 28033 "gram.c" /* yacc.c:1646 */ break; case 299: #line 2234 "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 28045 "gram.c" /* yacc.c:1646 */ break; case 300: #line 2243 "gram.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); Constraint *c = makeNode(Constraint); c->contype = CONSTR_IDENTITY; c->generated_when = (yyvsp[-3].ival); c->options = (yyvsp[0].list); c->location = (yylsp[-4]); n->subtype = AT_AddIdentity; n->name = (yyvsp[-6].str); n->def = (Node *) c; (yyval.node) = (Node *)n; } #line 28065 "gram.c" /* yacc.c:1646 */ break; case 301: #line 2260 "gram.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_SetIdentity; n->name = (yyvsp[-1].str); n->def = (Node *) (yyvsp[0].list); (yyval.node) = (Node *)n; } #line 28077 "gram.c" /* yacc.c:1646 */ break; case 302: #line 2269 "gram.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_DropIdentity; n->name = (yyvsp[-2].str); n->missing_ok = false; (yyval.node) = (Node *)n; } #line 28089 "gram.c" /* yacc.c:1646 */ break; case 303: #line 2278 "gram.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_DropIdentity; n->name = (yyvsp[-4].str); n->missing_ok = true; (yyval.node) = (Node *)n; } #line 28101 "gram.c" /* yacc.c:1646 */ break; case 304: #line 2287 "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 28114 "gram.c" /* yacc.c:1646 */ break; case 305: #line 2297 "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 28127 "gram.c" /* yacc.c:1646 */ break; case 306: #line 2310 "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 28145 "gram.c" /* yacc.c:1646 */ break; case 307: #line 2325 "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 28157 "gram.c" /* yacc.c:1646 */ break; case 308: #line 2334 "gram.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_AddConstraint; n->def = (yyvsp[0].node); n->missing_ok = false; (yyval.node) = (Node *)n; } #line 28169 "gram.c" /* yacc.c:1646 */ break; case 309: #line 2343 "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 28187 "gram.c" /* yacc.c:1646 */ break; case 310: #line 2358 "gram.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_ValidateConstraint; n->name = (yyvsp[0].str); (yyval.node) = (Node *)n; } #line 28198 "gram.c" /* yacc.c:1646 */ break; case 311: #line 2366 "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 28211 "gram.c" /* yacc.c:1646 */ break; case 312: #line 2376 "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 28224 "gram.c" /* yacc.c:1646 */ break; case 313: #line 2386 "gram.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_DropOids; (yyval.node) = (Node *)n; } #line 28234 "gram.c" /* yacc.c:1646 */ break; case 314: #line 2393 "gram.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_ClusterOn; n->name = (yyvsp[0].str); (yyval.node) = (Node *)n; } #line 28245 "gram.c" /* yacc.c:1646 */ break; case 315: #line 2401 "gram.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_DropCluster; n->name = NULL; (yyval.node) = (Node *)n; } #line 28256 "gram.c" /* yacc.c:1646 */ break; case 316: #line 2409 "gram.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_SetLogged; (yyval.node) = (Node *)n; } #line 28266 "gram.c" /* yacc.c:1646 */ break; case 317: #line 2416 "gram.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_SetUnLogged; (yyval.node) = (Node *)n; } #line 28276 "gram.c" /* yacc.c:1646 */ break; case 318: #line 2423 "gram.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_EnableTrig; n->name = (yyvsp[0].str); (yyval.node) = (Node *)n; } #line 28287 "gram.c" /* yacc.c:1646 */ break; case 319: #line 2431 "gram.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_EnableAlwaysTrig; n->name = (yyvsp[0].str); (yyval.node) = (Node *)n; } #line 28298 "gram.c" /* yacc.c:1646 */ break; case 320: #line 2439 "gram.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_EnableReplicaTrig; n->name = (yyvsp[0].str); (yyval.node) = (Node *)n; } #line 28309 "gram.c" /* yacc.c:1646 */ break; case 321: #line 2447 "gram.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_EnableTrigAll; (yyval.node) = (Node *)n; } #line 28319 "gram.c" /* yacc.c:1646 */ break; case 322: #line 2454 "gram.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_EnableTrigUser; (yyval.node) = (Node *)n; } #line 28329 "gram.c" /* yacc.c:1646 */ break; case 323: #line 2461 "gram.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_DisableTrig; n->name = (yyvsp[0].str); (yyval.node) = (Node *)n; } #line 28340 "gram.c" /* yacc.c:1646 */ break; case 324: #line 2469 "gram.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_DisableTrigAll; (yyval.node) = (Node *)n; } #line 28350 "gram.c" /* yacc.c:1646 */ break; case 325: #line 2476 "gram.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_DisableTrigUser; (yyval.node) = (Node *)n; } #line 28360 "gram.c" /* yacc.c:1646 */ break; case 326: #line 2483 "gram.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_EnableRule; n->name = (yyvsp[0].str); (yyval.node) = (Node *)n; } #line 28371 "gram.c" /* yacc.c:1646 */ break; case 327: #line 2491 "gram.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_EnableAlwaysRule; n->name = (yyvsp[0].str); (yyval.node) = (Node *)n; } #line 28382 "gram.c" /* yacc.c:1646 */ break; case 328: #line 2499 "gram.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_EnableReplicaRule; n->name = (yyvsp[0].str); (yyval.node) = (Node *)n; } #line 28393 "gram.c" /* yacc.c:1646 */ break; case 329: #line 2507 "gram.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_DisableRule; n->name = (yyvsp[0].str); (yyval.node) = (Node *)n; } #line 28404 "gram.c" /* yacc.c:1646 */ break; case 330: #line 2515 "gram.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_AddInherit; n->def = (Node *) (yyvsp[0].range); (yyval.node) = (Node *)n; } #line 28415 "gram.c" /* yacc.c:1646 */ break; case 331: #line 2523 "gram.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_DropInherit; n->def = (Node *) (yyvsp[0].range); (yyval.node) = (Node *)n; } #line 28426 "gram.c" /* yacc.c:1646 */ break; case 332: #line 2531 "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 28439 "gram.c" /* yacc.c:1646 */ break; case 333: #line 2541 "gram.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_DropOf; (yyval.node) = (Node *)n; } #line 28449 "gram.c" /* yacc.c:1646 */ break; case 334: #line 2548 "gram.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_ChangeOwner; n->newowner = (yyvsp[0].rolespec); (yyval.node) = (Node *)n; } #line 28460 "gram.c" /* yacc.c:1646 */ break; case 335: #line 2556 "gram.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_SetTableSpace; n->name = (yyvsp[0].str); (yyval.node) = (Node *)n; } #line 28471 "gram.c" /* yacc.c:1646 */ break; case 336: #line 2564 "gram.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_SetRelOptions; n->def = (Node *)(yyvsp[0].list); (yyval.node) = (Node *)n; } #line 28482 "gram.c" /* yacc.c:1646 */ break; case 337: #line 2572 "gram.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_ResetRelOptions; n->def = (Node *)(yyvsp[0].list); (yyval.node) = (Node *)n; } #line 28493 "gram.c" /* yacc.c:1646 */ break; case 338: #line 2580 "gram.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_ReplicaIdentity; n->def = (yyvsp[0].node); (yyval.node) = (Node *)n; } #line 28504 "gram.c" /* yacc.c:1646 */ break; case 339: #line 2588 "gram.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_EnableRowSecurity; (yyval.node) = (Node *)n; } #line 28514 "gram.c" /* yacc.c:1646 */ break; case 340: #line 2595 "gram.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_DisableRowSecurity; (yyval.node) = (Node *)n; } #line 28524 "gram.c" /* yacc.c:1646 */ break; case 341: #line 2602 "gram.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_ForceRowSecurity; (yyval.node) = (Node *)n; } #line 28534 "gram.c" /* yacc.c:1646 */ break; case 342: #line 2609 "gram.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_NoForceRowSecurity; (yyval.node) = (Node *)n; } #line 28544 "gram.c" /* yacc.c:1646 */ break; case 343: #line 2615 "gram.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_GenericOptions; n->def = (Node *)(yyvsp[0].list); (yyval.node) = (Node *) n; } #line 28555 "gram.c" /* yacc.c:1646 */ break; case 344: #line 2624 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 28561 "gram.c" /* yacc.c:1646 */ break; case 345: #line 2625 "gram.y" /* yacc.c:1646 */ { (yyval.node) = NULL; } #line 28567 "gram.c" /* yacc.c:1646 */ break; case 346: #line 2629 "gram.y" /* yacc.c:1646 */ { (yyval.dbehavior) = DROP_CASCADE; } #line 28573 "gram.c" /* yacc.c:1646 */ break; case 347: #line 2630 "gram.y" /* yacc.c:1646 */ { (yyval.dbehavior) = DROP_RESTRICT; } #line 28579 "gram.c" /* yacc.c:1646 */ break; case 348: #line 2631 "gram.y" /* yacc.c:1646 */ { (yyval.dbehavior) = DROP_RESTRICT; /* default */ } #line 28585 "gram.c" /* yacc.c:1646 */ break; case 349: #line 2636 "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 28597 "gram.c" /* yacc.c:1646 */ break; case 350: #line 2643 "gram.y" /* yacc.c:1646 */ { (yyval.node) = NULL; } #line 28603 "gram.c" /* yacc.c:1646 */ break; case 351: #line 2647 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 28609 "gram.c" /* yacc.c:1646 */ break; case 352: #line 2648 "gram.y" /* yacc.c:1646 */ { (yyval.node) = NULL; } #line 28615 "gram.c" /* yacc.c:1646 */ break; case 353: #line 2653 "gram.y" /* yacc.c:1646 */ { ReplicaIdentityStmt *n = makeNode(ReplicaIdentityStmt); n->identity_type = REPLICA_IDENTITY_NOTHING; n->name = NULL; (yyval.node) = (Node *) n; } #line 28626 "gram.c" /* yacc.c:1646 */ break; case 354: #line 2660 "gram.y" /* yacc.c:1646 */ { ReplicaIdentityStmt *n = makeNode(ReplicaIdentityStmt); n->identity_type = REPLICA_IDENTITY_FULL; n->name = NULL; (yyval.node) = (Node *) n; } #line 28637 "gram.c" /* yacc.c:1646 */ break; case 355: #line 2667 "gram.y" /* yacc.c:1646 */ { ReplicaIdentityStmt *n = makeNode(ReplicaIdentityStmt); n->identity_type = REPLICA_IDENTITY_DEFAULT; n->name = NULL; (yyval.node) = (Node *) n; } #line 28648 "gram.c" /* yacc.c:1646 */ break; case 356: #line 2674 "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 28659 "gram.c" /* yacc.c:1646 */ break; case 357: #line 2683 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[-1].list); } #line 28665 "gram.c" /* yacc.c:1646 */ break; case 358: #line 2686 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 28671 "gram.c" /* yacc.c:1646 */ break; case 359: #line 2687 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 28677 "gram.c" /* yacc.c:1646 */ break; case 360: #line 2691 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].defelt)); } #line 28683 "gram.c" /* yacc.c:1646 */ break; case 361: #line 2692 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].defelt)); } #line 28689 "gram.c" /* yacc.c:1646 */ break; case 362: #line 2698 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem((yyvsp[-2].str), (Node *) (yyvsp[0].node), (yylsp[-2])); } #line 28697 "gram.c" /* yacc.c:1646 */ break; case 363: #line 2702 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem((yyvsp[0].str), NULL, (yylsp[0])); } #line 28705 "gram.c" /* yacc.c:1646 */ break; case 364: #line 2706 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElemExtended((yyvsp[-4].str), (yyvsp[-2].str), (Node *) (yyvsp[0].node), DEFELEM_UNSPEC, (yylsp[-4])); } #line 28714 "gram.c" /* yacc.c:1646 */ break; case 365: #line 2711 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElemExtended((yyvsp[-2].str), (yyvsp[0].str), NULL, DEFELEM_UNSPEC, (yylsp[-2])); } #line 28722 "gram.c" /* yacc.c:1646 */ break; case 366: #line 2718 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].defelt)); } #line 28728 "gram.c" /* yacc.c:1646 */ break; case 367: #line 2720 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-1].list), (yyvsp[0].defelt)); } #line 28734 "gram.c" /* yacc.c:1646 */ break; case 368: #line 2725 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("restart", NULL, (yylsp[0])); } #line 28742 "gram.c" /* yacc.c:1646 */ break; case 369: #line 2729 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("restart", (Node *)(yyvsp[0].value), (yylsp[-2])); } #line 28750 "gram.c" /* yacc.c:1646 */ break; case 370: #line 2733 "gram.y" /* yacc.c:1646 */ { if (strcmp((yyvsp[0].defelt)->defname, "as") == 0 || strcmp((yyvsp[0].defelt)->defname, "restart") == 0 || strcmp((yyvsp[0].defelt)->defname, "owned_by") == 0) ereport(ERROR, (errcode(ERRCODE_SYNTAX_ERROR), errmsg("sequence option \"%s\" not supported here", (yyvsp[0].defelt)->defname), parser_errposition((yylsp[0])))); (yyval.defelt) = (yyvsp[0].defelt); } #line 28765 "gram.c" /* yacc.c:1646 */ break; case 371: #line 2744 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("generated", (Node *) makeInteger((yyvsp[0].ival)), (yylsp[-2])); } #line 28773 "gram.c" /* yacc.c:1646 */ break; case 372: #line 2752 "gram.y" /* yacc.c:1646 */ { ListCell *lc; PartitionBoundSpec *n = makeNode(PartitionBoundSpec); n->strategy = PARTITION_STRATEGY_HASH; n->modulus = n->remainder = -1; foreach (lc, (yyvsp[-1].list)) { DefElem *opt = lfirst_node(DefElem, lc); if (strcmp(opt->defname, "modulus") == 0) { if (n->modulus != -1) ereport(ERROR, (errcode(ERRCODE_DUPLICATE_OBJECT), errmsg("modulus for hash partition provided more than once"), parser_errposition(opt->location))); n->modulus = defGetInt32(opt); } else if (strcmp(opt->defname, "remainder") == 0) { if (n->remainder != -1) ereport(ERROR, (errcode(ERRCODE_DUPLICATE_OBJECT), errmsg("remainder for hash partition provided more than once"), parser_errposition(opt->location))); n->remainder = defGetInt32(opt); } else ereport(ERROR, (errcode(ERRCODE_SYNTAX_ERROR), errmsg("unrecognized hash partition bound specification \"%s\"", opt->defname), parser_errposition(opt->location))); } if (n->modulus == -1) ereport(ERROR, (errcode(ERRCODE_SYNTAX_ERROR), errmsg("modulus for hash partition must be specified"))); if (n->remainder == -1) ereport(ERROR, (errcode(ERRCODE_SYNTAX_ERROR), errmsg("remainder for hash partition must be specified"))); n->location = (yylsp[-3]); (yyval.partboundspec) = n; } #line 28828 "gram.c" /* yacc.c:1646 */ break; case 373: #line 2805 "gram.y" /* yacc.c:1646 */ { PartitionBoundSpec *n = makeNode(PartitionBoundSpec); n->strategy = PARTITION_STRATEGY_LIST; n->is_default = false; n->listdatums = (yyvsp[-1].list); n->location = (yylsp[-3]); (yyval.partboundspec) = n; } #line 28843 "gram.c" /* yacc.c:1646 */ break; case 374: #line 2818 "gram.y" /* yacc.c:1646 */ { PartitionBoundSpec *n = makeNode(PartitionBoundSpec); n->strategy = PARTITION_STRATEGY_RANGE; n->is_default = false; n->lowerdatums = (yyvsp[-5].list); n->upperdatums = (yyvsp[-1].list); n->location = (yylsp[-7]); (yyval.partboundspec) = n; } #line 28859 "gram.c" /* yacc.c:1646 */ break; case 375: #line 2832 "gram.y" /* yacc.c:1646 */ { PartitionBoundSpec *n = makeNode(PartitionBoundSpec); n->is_default = true; n->location = (yylsp[0]); (yyval.partboundspec) = n; } #line 28872 "gram.c" /* yacc.c:1646 */ break; case 376: #line 2844 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem((yyvsp[-1].str), (Node *)makeInteger((yyvsp[0].ival)), (yylsp[-1])); } #line 28880 "gram.c" /* yacc.c:1646 */ break; case 377: #line 2851 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].defelt)); } #line 28888 "gram.c" /* yacc.c:1646 */ break; case 378: #line 2855 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].defelt)); } #line 28896 "gram.c" /* yacc.c:1646 */ break; case 379: #line 2869 "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 28910 "gram.c" /* yacc.c:1646 */ break; case 380: #line 2881 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].node)); } #line 28916 "gram.c" /* yacc.c:1646 */ break; case 381: #line 2882 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].node)); } #line 28922 "gram.c" /* yacc.c:1646 */ break; case 382: #line 2888 "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 28934 "gram.c" /* yacc.c:1646 */ break; case 383: #line 2897 "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 28947 "gram.c" /* yacc.c:1646 */ break; case 384: #line 2907 "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 28960 "gram.c" /* yacc.c:1646 */ break; case 385: #line 2917 "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 28979 "gram.c" /* yacc.c:1646 */ break; case 386: #line 2943 "gram.y" /* yacc.c:1646 */ { ClosePortalStmt *n = makeNode(ClosePortalStmt); n->portalname = (yyvsp[0].str); (yyval.node) = (Node *)n; } #line 28989 "gram.c" /* yacc.c:1646 */ break; case 387: #line 2949 "gram.y" /* yacc.c:1646 */ { ClosePortalStmt *n = makeNode(ClosePortalStmt); n->portalname = NULL; (yyval.node) = (Node *)n; } #line 28999 "gram.c" /* yacc.c:1646 */ break; case 388: #line 2984 "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[-6].boolean); n->is_program = (yyvsp[-5].boolean); n->filename = (yyvsp[-4].str); n->whereClause = (yyvsp[0].node); if (n->is_program && n->filename == NULL) ereport(ERROR, (errcode(ERRCODE_SYNTAX_ERROR), errmsg("STDIN/STDOUT not allowed with PROGRAM"), parser_errposition((yylsp[-3])))); if (!n->is_from && n->whereClause != NULL) ereport(ERROR, (errcode(ERRCODE_SYNTAX_ERROR), errmsg("WHERE clause not allowed with COPY TO"), parser_errposition((yylsp[0])))); n->options = NIL; /* Concatenate user-supplied flags */ if ((yyvsp[-9].defelt)) n->options = lappend(n->options, (yyvsp[-9].defelt)); if ((yyvsp[-3].defelt)) n->options = lappend(n->options, (yyvsp[-3].defelt)); if ((yyvsp[-1].list)) n->options = list_concat(n->options, (yyvsp[-1].list)); (yyval.node) = (Node *)n; } #line 29036 "gram.c" /* yacc.c:1646 */ break; case 389: #line 3017 "gram.y" /* yacc.c:1646 */ { CopyStmt *n = makeNode(CopyStmt); n->relation = NULL; n->query = (yyvsp[-6].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[-4])))); (yyval.node) = (Node *)n; } #line 29059 "gram.c" /* yacc.c:1646 */ break; case 390: #line 3038 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = true; } #line 29065 "gram.c" /* yacc.c:1646 */ break; case 391: #line 3039 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = false; } #line 29071 "gram.c" /* yacc.c:1646 */ break; case 392: #line 3043 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = true; } #line 29077 "gram.c" /* yacc.c:1646 */ break; case 393: #line 3044 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = false; } #line 29083 "gram.c" /* yacc.c:1646 */ break; case 394: #line 3053 "gram.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 29089 "gram.c" /* yacc.c:1646 */ break; case 395: #line 3054 "gram.y" /* yacc.c:1646 */ { (yyval.str) = NULL; } #line 29095 "gram.c" /* yacc.c:1646 */ break; case 396: #line 3055 "gram.y" /* yacc.c:1646 */ { (yyval.str) = NULL; } #line 29101 "gram.c" /* yacc.c:1646 */ break; case 397: #line 3058 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 29107 "gram.c" /* yacc.c:1646 */ break; case 398: #line 3059 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[-1].list); } #line 29113 "gram.c" /* yacc.c:1646 */ break; case 399: #line 3064 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-1].list), (yyvsp[0].defelt)); } #line 29119 "gram.c" /* yacc.c:1646 */ break; case 400: #line 3065 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 29125 "gram.c" /* yacc.c:1646 */ break; case 401: #line 3070 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("format", (Node *)makeString("binary"), (yylsp[0])); } #line 29133 "gram.c" /* yacc.c:1646 */ break; case 402: #line 3074 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("freeze", (Node *)makeInteger(true), (yylsp[0])); } #line 29141 "gram.c" /* yacc.c:1646 */ break; case 403: #line 3078 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("delimiter", (Node *)makeString((yyvsp[0].str)), (yylsp[-2])); } #line 29149 "gram.c" /* yacc.c:1646 */ break; case 404: #line 3082 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("null", (Node *)makeString((yyvsp[0].str)), (yylsp[-2])); } #line 29157 "gram.c" /* yacc.c:1646 */ break; case 405: #line 3086 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("format", (Node *)makeString("csv"), (yylsp[0])); } #line 29165 "gram.c" /* yacc.c:1646 */ break; case 406: #line 3090 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("header", (Node *)makeInteger(true), (yylsp[0])); } #line 29173 "gram.c" /* yacc.c:1646 */ break; case 407: #line 3094 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("quote", (Node *)makeString((yyvsp[0].str)), (yylsp[-2])); } #line 29181 "gram.c" /* yacc.c:1646 */ break; case 408: #line 3098 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("escape", (Node *)makeString((yyvsp[0].str)), (yylsp[-2])); } #line 29189 "gram.c" /* yacc.c:1646 */ break; case 409: #line 3102 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("force_quote", (Node *)(yyvsp[0].list), (yylsp[-2])); } #line 29197 "gram.c" /* yacc.c:1646 */ break; case 410: #line 3106 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("force_quote", (Node *)makeNode(A_Star), (yylsp[-2])); } #line 29205 "gram.c" /* yacc.c:1646 */ break; case 411: #line 3110 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("force_not_null", (Node *)(yyvsp[0].list), (yylsp[-3])); } #line 29213 "gram.c" /* yacc.c:1646 */ break; case 412: #line 3114 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("force_null", (Node *)(yyvsp[0].list), (yylsp[-2])); } #line 29221 "gram.c" /* yacc.c:1646 */ break; case 413: #line 3118 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("encoding", (Node *)makeString((yyvsp[0].str)), (yylsp[-1])); } #line 29229 "gram.c" /* yacc.c:1646 */ break; case 414: #line 3127 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("format", (Node *)makeString("binary"), (yylsp[0])); } #line 29237 "gram.c" /* yacc.c:1646 */ break; case 415: #line 3130 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = NULL; } #line 29243 "gram.c" /* yacc.c:1646 */ break; case 416: #line 3135 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("delimiter", (Node *)makeString((yyvsp[0].str)), (yylsp[-1])); } #line 29251 "gram.c" /* yacc.c:1646 */ break; case 417: #line 3138 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = NULL; } #line 29257 "gram.c" /* yacc.c:1646 */ break; case 418: #line 3142 "gram.y" /* yacc.c:1646 */ {} #line 29263 "gram.c" /* yacc.c:1646 */ break; case 419: #line 3143 "gram.y" /* yacc.c:1646 */ {} #line 29269 "gram.c" /* yacc.c:1646 */ break; case 420: #line 3149 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].defelt)); } #line 29277 "gram.c" /* yacc.c:1646 */ break; case 421: #line 3153 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].defelt)); } #line 29285 "gram.c" /* yacc.c:1646 */ break; case 422: #line 3160 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem((yyvsp[-1].str), (yyvsp[0].node), (yylsp[-1])); } #line 29293 "gram.c" /* yacc.c:1646 */ break; case 423: #line 3166 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeString((yyvsp[0].str)); } #line 29299 "gram.c" /* yacc.c:1646 */ break; case 424: #line 3167 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) (yyvsp[0].value); } #line 29305 "gram.c" /* yacc.c:1646 */ break; case 425: #line 3168 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeNode(A_Star); } #line 29311 "gram.c" /* yacc.c:1646 */ break; case 426: #line 3169 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) (yyvsp[-1].list); } #line 29317 "gram.c" /* yacc.c:1646 */ break; case 427: #line 3170 "gram.y" /* yacc.c:1646 */ { (yyval.node) = NULL; } #line 29323 "gram.c" /* yacc.c:1646 */ break; case 428: #line 3175 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].node)); } #line 29331 "gram.c" /* yacc.c:1646 */ break; case 429: #line 3179 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].node)); } #line 29339 "gram.c" /* yacc.c:1646 */ break; case 430: #line 3186 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeString((yyvsp[0].str)); } #line 29345 "gram.c" /* yacc.c:1646 */ break; case 431: #line 3200 "gram.y" /* yacc.c:1646 */ { CreateStmt *n = makeNode(CreateStmt); (yyvsp[-9].range)->relpersistence = (yyvsp[-11].ival); n->relation = (yyvsp[-9].range); n->tableElts = (yyvsp[-7].list); n->inhRelations = (yyvsp[-5].list); n->partspec = (yyvsp[-4].partspec); n->ofTypename = NULL; n->constraints = NIL; n->accessMethod = (yyvsp[-3].str); 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 29366 "gram.c" /* yacc.c:1646 */ break; case 432: #line 3219 "gram.y" /* yacc.c:1646 */ { CreateStmt *n = makeNode(CreateStmt); (yyvsp[-9].range)->relpersistence = (yyvsp[-14].ival); n->relation = (yyvsp[-9].range); n->tableElts = (yyvsp[-7].list); n->inhRelations = (yyvsp[-5].list); n->partspec = (yyvsp[-4].partspec); n->ofTypename = NULL; n->constraints = NIL; n->accessMethod = (yyvsp[-3].str); 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 29387 "gram.c" /* yacc.c:1646 */ break; case 433: #line 3238 "gram.y" /* yacc.c:1646 */ { CreateStmt *n = makeNode(CreateStmt); (yyvsp[-8].range)->relpersistence = (yyvsp[-10].ival); n->relation = (yyvsp[-8].range); n->tableElts = (yyvsp[-5].list); n->inhRelations = NIL; n->partspec = (yyvsp[-4].partspec); n->ofTypename = makeTypeNameFromNameList((yyvsp[-6].list)); n->ofTypename->location = (yylsp[-6]); n->constraints = NIL; n->accessMethod = (yyvsp[-3].str); 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 29409 "gram.c" /* yacc.c:1646 */ break; case 434: #line 3258 "gram.y" /* yacc.c:1646 */ { CreateStmt *n = makeNode(CreateStmt); (yyvsp[-8].range)->relpersistence = (yyvsp[-13].ival); n->relation = (yyvsp[-8].range); n->tableElts = (yyvsp[-5].list); n->inhRelations = NIL; n->partspec = (yyvsp[-4].partspec); n->ofTypename = makeTypeNameFromNameList((yyvsp[-6].list)); n->ofTypename->location = (yylsp[-6]); n->constraints = NIL; n->accessMethod = (yyvsp[-3].str); 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 29431 "gram.c" /* yacc.c:1646 */ break; case 435: #line 3278 "gram.y" /* yacc.c:1646 */ { CreateStmt *n = makeNode(CreateStmt); (yyvsp[-10].range)->relpersistence = (yyvsp[-12].ival); n->relation = (yyvsp[-10].range); n->tableElts = (yyvsp[-6].list); n->inhRelations = list_make1((yyvsp[-7].range)); n->partbound = (yyvsp[-5].partboundspec); n->partspec = (yyvsp[-4].partspec); n->ofTypename = NULL; n->constraints = NIL; n->accessMethod = (yyvsp[-3].str); 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 29453 "gram.c" /* yacc.c:1646 */ break; case 436: #line 3298 "gram.y" /* yacc.c:1646 */ { CreateStmt *n = makeNode(CreateStmt); (yyvsp[-10].range)->relpersistence = (yyvsp[-15].ival); n->relation = (yyvsp[-10].range); n->tableElts = (yyvsp[-6].list); n->inhRelations = list_make1((yyvsp[-7].range)); n->partbound = (yyvsp[-5].partboundspec); n->partspec = (yyvsp[-4].partspec); n->ofTypename = NULL; n->constraints = NIL; n->accessMethod = (yyvsp[-3].str); 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 29475 "gram.c" /* yacc.c:1646 */ break; case 437: #line 3328 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = RELPERSISTENCE_TEMP; } #line 29481 "gram.c" /* yacc.c:1646 */ break; case 438: #line 3329 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = RELPERSISTENCE_TEMP; } #line 29487 "gram.c" /* yacc.c:1646 */ break; case 439: #line 3330 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = RELPERSISTENCE_TEMP; } #line 29493 "gram.c" /* yacc.c:1646 */ break; case 440: #line 3331 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = RELPERSISTENCE_TEMP; } #line 29499 "gram.c" /* yacc.c:1646 */ break; case 441: #line 3333 "gram.y" /* yacc.c:1646 */ { ereport(WARNING, (errmsg("GLOBAL is deprecated in temporary table creation"), parser_errposition((yylsp[-1])))); (yyval.ival) = RELPERSISTENCE_TEMP; } #line 29510 "gram.c" /* yacc.c:1646 */ break; case 442: #line 3340 "gram.y" /* yacc.c:1646 */ { ereport(WARNING, (errmsg("GLOBAL is deprecated in temporary table creation"), parser_errposition((yylsp[-1])))); (yyval.ival) = RELPERSISTENCE_TEMP; } #line 29521 "gram.c" /* yacc.c:1646 */ break; case 443: #line 3346 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = RELPERSISTENCE_UNLOGGED; } #line 29527 "gram.c" /* yacc.c:1646 */ break; case 444: #line 3347 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = RELPERSISTENCE_PERMANENT; } #line 29533 "gram.c" /* yacc.c:1646 */ break; case 445: #line 3351 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 29539 "gram.c" /* yacc.c:1646 */ break; case 446: #line 3352 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 29545 "gram.c" /* yacc.c:1646 */ break; case 447: #line 3356 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[-1].list); } #line 29551 "gram.c" /* yacc.c:1646 */ break; case 448: #line 3357 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 29557 "gram.c" /* yacc.c:1646 */ break; case 449: #line 3362 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].node)); } #line 29565 "gram.c" /* yacc.c:1646 */ break; case 450: #line 3366 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].node)); } #line 29573 "gram.c" /* yacc.c:1646 */ break; case 451: #line 3373 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].node)); } #line 29581 "gram.c" /* yacc.c:1646 */ break; case 452: #line 3377 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].node)); } #line 29589 "gram.c" /* yacc.c:1646 */ break; case 453: #line 3383 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 29595 "gram.c" /* yacc.c:1646 */ break; case 454: #line 3384 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 29601 "gram.c" /* yacc.c:1646 */ break; case 455: #line 3385 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 29607 "gram.c" /* yacc.c:1646 */ break; case 456: #line 3389 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 29613 "gram.c" /* yacc.c:1646 */ break; case 457: #line 3390 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 29619 "gram.c" /* yacc.c:1646 */ break; case 458: #line 3394 "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 29642 "gram.c" /* yacc.c:1646 */ break; case 459: #line 3415 "gram.y" /* yacc.c:1646 */ { ColumnDef *n = makeNode(ColumnDef); n->colname = (yyvsp[-1].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[-1]); (yyval.node) = (Node *)n; } #line 29664 "gram.c" /* yacc.c:1646 */ break; case 460: #line 3433 "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 29686 "gram.c" /* yacc.c:1646 */ break; case 461: #line 3453 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-1].list), (yyvsp[0].node)); } #line 29692 "gram.c" /* yacc.c:1646 */ break; case 462: #line 3454 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 29698 "gram.c" /* yacc.c:1646 */ break; case 463: #line 3459 "gram.y" /* yacc.c:1646 */ { Constraint *n = castNode(Constraint, (yyvsp[0].node)); n->conname = (yyvsp[-1].str); n->location = (yylsp[-2]); (yyval.node) = (Node *) n; } #line 29709 "gram.c" /* yacc.c:1646 */ break; case 464: #line 3465 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 29715 "gram.c" /* yacc.c:1646 */ break; case 465: #line 3466 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 29721 "gram.c" /* yacc.c:1646 */ break; case 466: #line 3468 "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 29738 "gram.c" /* yacc.c:1646 */ break; case 467: #line 3499 "gram.y" /* yacc.c:1646 */ { Constraint *n = makeNode(Constraint); n->contype = CONSTR_NOTNULL; n->location = (yylsp[-1]); (yyval.node) = (Node *)n; } #line 29749 "gram.c" /* yacc.c:1646 */ break; case 468: #line 3506 "gram.y" /* yacc.c:1646 */ { Constraint *n = makeNode(Constraint); n->contype = CONSTR_NULL; n->location = (yylsp[0]); (yyval.node) = (Node *)n; } #line 29760 "gram.c" /* yacc.c:1646 */ break; case 469: #line 3513 "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 29775 "gram.c" /* yacc.c:1646 */ break; case 470: #line 3524 "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 29790 "gram.c" /* yacc.c:1646 */ break; case 471: #line 3535 "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; n->skip_validation = false; n->initially_valid = true; (yyval.node) = (Node *)n; } #line 29806 "gram.c" /* yacc.c:1646 */ break; case 472: #line 3547 "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; n->skip_validation = false; n->initially_valid = true; (yyval.node) = (Node *)n; } #line 29821 "gram.c" /* yacc.c:1646 */ break; case 473: #line 3558 "gram.y" /* yacc.c:1646 */ { Constraint *n = makeNode(Constraint); n->contype = CONSTR_IDENTITY; n->generated_when = (yyvsp[-3].ival); n->options = (yyvsp[0].list); n->location = (yylsp[-4]); (yyval.node) = (Node *)n; } #line 29834 "gram.c" /* yacc.c:1646 */ break; case 474: #line 3567 "gram.y" /* yacc.c:1646 */ { Constraint *n = makeNode(Constraint); n->contype = CONSTR_GENERATED; n->generated_when = (yyvsp[-5].ival); n->raw_expr = (yyvsp[-2].node); n->cooked_expr = NULL; n->location = (yylsp[-6]); /* * Can't do this in the grammar because of shift/reduce * conflicts. (IDENTITY allows both ALWAYS and BY * DEFAULT, but generated columns only allow ALWAYS.) We * can also give a more useful error message and location. */ if ((yyvsp[-5].ival) != ATTRIBUTE_IDENTITY_ALWAYS) ereport(ERROR, (errcode(ERRCODE_SYNTAX_ERROR), errmsg("for a generated column, GENERATED ALWAYS must be specified"), parser_errposition((yylsp[-5])))); (yyval.node) = (Node *)n; } #line 29861 "gram.c" /* yacc.c:1646 */ break; case 475: #line 3590 "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 29880 "gram.c" /* yacc.c:1646 */ break; case 476: #line 3607 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = ATTRIBUTE_IDENTITY_ALWAYS; } #line 29886 "gram.c" /* yacc.c:1646 */ break; case 477: #line 3608 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = ATTRIBUTE_IDENTITY_BY_DEFAULT; } #line 29892 "gram.c" /* yacc.c:1646 */ break; case 478: #line 3628 "gram.y" /* yacc.c:1646 */ { Constraint *n = makeNode(Constraint); n->contype = CONSTR_ATTR_DEFERRABLE; n->location = (yylsp[0]); (yyval.node) = (Node *)n; } #line 29903 "gram.c" /* yacc.c:1646 */ break; case 479: #line 3635 "gram.y" /* yacc.c:1646 */ { Constraint *n = makeNode(Constraint); n->contype = CONSTR_ATTR_NOT_DEFERRABLE; n->location = (yylsp[-1]); (yyval.node) = (Node *)n; } #line 29914 "gram.c" /* yacc.c:1646 */ break; case 480: #line 3642 "gram.y" /* yacc.c:1646 */ { Constraint *n = makeNode(Constraint); n->contype = CONSTR_ATTR_DEFERRED; n->location = (yylsp[-1]); (yyval.node) = (Node *)n; } #line 29925 "gram.c" /* yacc.c:1646 */ break; case 481: #line 3649 "gram.y" /* yacc.c:1646 */ { Constraint *n = makeNode(Constraint); n->contype = CONSTR_ATTR_IMMEDIATE; n->location = (yylsp[-1]); (yyval.node) = (Node *)n; } #line 29936 "gram.c" /* yacc.c:1646 */ break; case 482: #line 3660 "gram.y" /* yacc.c:1646 */ { TableLikeClause *n = makeNode(TableLikeClause); n->relation = (yyvsp[-1].range); n->options = (yyvsp[0].ival); (yyval.node) = (Node *)n; } #line 29947 "gram.c" /* yacc.c:1646 */ break; case 483: #line 3669 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = (yyvsp[-2].ival) | (yyvsp[0].ival); } #line 29953 "gram.c" /* yacc.c:1646 */ break; case 484: #line 3670 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = (yyvsp[-2].ival) & ~(yyvsp[0].ival); } #line 29959 "gram.c" /* yacc.c:1646 */ break; case 485: #line 3671 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = 0; } #line 29965 "gram.c" /* yacc.c:1646 */ break; case 486: #line 3675 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = CREATE_TABLE_LIKE_COMMENTS; } #line 29971 "gram.c" /* yacc.c:1646 */ break; case 487: #line 3676 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = CREATE_TABLE_LIKE_CONSTRAINTS; } #line 29977 "gram.c" /* yacc.c:1646 */ break; case 488: #line 3677 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = CREATE_TABLE_LIKE_DEFAULTS; } #line 29983 "gram.c" /* yacc.c:1646 */ break; case 489: #line 3678 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = CREATE_TABLE_LIKE_IDENTITY; } #line 29989 "gram.c" /* yacc.c:1646 */ break; case 490: #line 3679 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = CREATE_TABLE_LIKE_GENERATED; } #line 29995 "gram.c" /* yacc.c:1646 */ break; case 491: #line 3680 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = CREATE_TABLE_LIKE_INDEXES; } #line 30001 "gram.c" /* yacc.c:1646 */ break; case 492: #line 3681 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = CREATE_TABLE_LIKE_STATISTICS; } #line 30007 "gram.c" /* yacc.c:1646 */ break; case 493: #line 3682 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = CREATE_TABLE_LIKE_STORAGE; } #line 30013 "gram.c" /* yacc.c:1646 */ break; case 494: #line 3683 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = CREATE_TABLE_LIKE_ALL; } #line 30019 "gram.c" /* yacc.c:1646 */ break; case 495: #line 3693 "gram.y" /* yacc.c:1646 */ { Constraint *n = castNode(Constraint, (yyvsp[0].node)); n->conname = (yyvsp[-1].str); n->location = (yylsp[-2]); (yyval.node) = (Node *) n; } #line 30030 "gram.c" /* yacc.c:1646 */ break; case 496: #line 3699 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 30036 "gram.c" /* yacc.c:1646 */ break; case 497: #line 3704 "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 30053 "gram.c" /* yacc.c:1646 */ break; case 498: #line 3718 "gram.y" /* yacc.c:1646 */ { Constraint *n = makeNode(Constraint); n->contype = CONSTR_UNIQUE; n->location = (yylsp[-7]); n->keys = (yyvsp[-5].list); n->including = (yyvsp[-3].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 30072 "gram.c" /* yacc.c:1646 */ break; case 499: #line 3733 "gram.y" /* yacc.c:1646 */ { Constraint *n = makeNode(Constraint); n->contype = CONSTR_UNIQUE; n->location = (yylsp[-2]); n->keys = NIL; n->including = 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 30091 "gram.c" /* yacc.c:1646 */ break; case 500: #line 3749 "gram.y" /* yacc.c:1646 */ { Constraint *n = makeNode(Constraint); n->contype = CONSTR_PRIMARY; n->location = (yylsp[-8]); n->keys = (yyvsp[-5].list); n->including = (yyvsp[-3].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 30110 "gram.c" /* yacc.c:1646 */ break; case 501: #line 3764 "gram.y" /* yacc.c:1646 */ { Constraint *n = makeNode(Constraint); n->contype = CONSTR_PRIMARY; n->location = (yylsp[-3]); n->keys = NIL; n->including = 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 30129 "gram.c" /* yacc.c:1646 */ break; case 502: #line 3781 "gram.y" /* yacc.c:1646 */ { Constraint *n = makeNode(Constraint); n->contype = CONSTR_EXCLUSION; n->location = (yylsp[-9]); n->access_method = (yyvsp[-8].str); n->exclusions = (yyvsp[-6].list); n->including = (yyvsp[-4].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 30150 "gram.c" /* yacc.c:1646 */ break; case 503: #line 3799 "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 30172 "gram.c" /* yacc.c:1646 */ break; case 504: #line 3818 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = true; } #line 30178 "gram.c" /* yacc.c:1646 */ break; case 505: #line 3819 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = false; } #line 30184 "gram.c" /* yacc.c:1646 */ break; case 506: #line 3823 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[-1].list); } #line 30190 "gram.c" /* yacc.c:1646 */ break; case 507: #line 3824 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 30196 "gram.c" /* yacc.c:1646 */ break; case 508: #line 3828 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].node)); } #line 30202 "gram.c" /* yacc.c:1646 */ break; case 509: #line 3829 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].node)); } #line 30208 "gram.c" /* yacc.c:1646 */ break; case 510: #line 3833 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeString((yyvsp[0].str)); } #line 30216 "gram.c" /* yacc.c:1646 */ break; case 511: #line 3838 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[-1].list); } #line 30222 "gram.c" /* yacc.c:1646 */ break; case 512: #line 3839 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 30228 "gram.c" /* yacc.c:1646 */ break; case 513: #line 3843 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = FKCONSTR_MATCH_FULL; } #line 30236 "gram.c" /* yacc.c:1646 */ break; case 514: #line 3847 "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 30248 "gram.c" /* yacc.c:1646 */ break; case 515: #line 3855 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = FKCONSTR_MATCH_SIMPLE; } #line 30256 "gram.c" /* yacc.c:1646 */ break; case 516: #line 3859 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = FKCONSTR_MATCH_SIMPLE; } #line 30264 "gram.c" /* yacc.c:1646 */ break; case 517: #line 3865 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].list)); } #line 30270 "gram.c" /* yacc.c:1646 */ break; case 518: #line 3867 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].list)); } #line 30276 "gram.c" /* yacc.c:1646 */ break; case 519: #line 3871 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make2((yyvsp[-2].ielem), (yyvsp[0].list)); } #line 30284 "gram.c" /* yacc.c:1646 */ break; case 520: #line 3876 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make2((yyvsp[-5].ielem), (yyvsp[-1].list)); } #line 30292 "gram.c" /* yacc.c:1646 */ break; case 521: #line 3882 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[-1].node); } #line 30298 "gram.c" /* yacc.c:1646 */ break; case 522: #line 3883 "gram.y" /* yacc.c:1646 */ { (yyval.node) = NULL; } #line 30304 "gram.c" /* yacc.c:1646 */ break; case 523: #line 3894 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = ((yyvsp[0].ival) << 8) | (FKCONSTR_ACTION_NOACTION & 0xFF); } #line 30310 "gram.c" /* yacc.c:1646 */ break; case 524: #line 3896 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = (FKCONSTR_ACTION_NOACTION << 8) | ((yyvsp[0].ival) & 0xFF); } #line 30316 "gram.c" /* yacc.c:1646 */ break; case 525: #line 3898 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = ((yyvsp[-1].ival) << 8) | ((yyvsp[0].ival) & 0xFF); } #line 30322 "gram.c" /* yacc.c:1646 */ break; case 526: #line 3900 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = ((yyvsp[0].ival) << 8) | ((yyvsp[-1].ival) & 0xFF); } #line 30328 "gram.c" /* yacc.c:1646 */ break; case 527: #line 3902 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = (FKCONSTR_ACTION_NOACTION << 8) | (FKCONSTR_ACTION_NOACTION & 0xFF); } #line 30334 "gram.c" /* yacc.c:1646 */ break; case 528: #line 3905 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = (yyvsp[0].ival); } #line 30340 "gram.c" /* yacc.c:1646 */ break; case 529: #line 3908 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = (yyvsp[0].ival); } #line 30346 "gram.c" /* yacc.c:1646 */ break; case 530: #line 3912 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = FKCONSTR_ACTION_NOACTION; } #line 30352 "gram.c" /* yacc.c:1646 */ break; case 531: #line 3913 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = FKCONSTR_ACTION_RESTRICT; } #line 30358 "gram.c" /* yacc.c:1646 */ break; case 532: #line 3914 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = FKCONSTR_ACTION_CASCADE; } #line 30364 "gram.c" /* yacc.c:1646 */ break; case 533: #line 3915 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = FKCONSTR_ACTION_SETNULL; } #line 30370 "gram.c" /* yacc.c:1646 */ break; case 534: #line 3916 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = FKCONSTR_ACTION_SETDEFAULT; } #line 30376 "gram.c" /* yacc.c:1646 */ break; case 535: #line 3919 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[-1].list); } #line 30382 "gram.c" /* yacc.c:1646 */ break; case 536: #line 3920 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 30388 "gram.c" /* yacc.c:1646 */ break; case 537: #line 3924 "gram.y" /* yacc.c:1646 */ { (yyval.partspec) = (yyvsp[0].partspec); } #line 30394 "gram.c" /* yacc.c:1646 */ break; case 538: #line 3925 "gram.y" /* yacc.c:1646 */ { (yyval.partspec) = NULL; } #line 30400 "gram.c" /* yacc.c:1646 */ break; case 539: #line 3929 "gram.y" /* yacc.c:1646 */ { PartitionSpec *n = makeNode(PartitionSpec); n->strategy = (yyvsp[-3].str); n->partParams = (yyvsp[-1].list); n->location = (yylsp[-5]); (yyval.partspec) = n; } #line 30414 "gram.c" /* yacc.c:1646 */ break; case 540: #line 3940 "gram.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 30420 "gram.c" /* yacc.c:1646 */ break; case 541: #line 3941 "gram.y" /* yacc.c:1646 */ { (yyval.str) = pstrdup((yyvsp[0].keyword)); } #line 30426 "gram.c" /* yacc.c:1646 */ break; case 542: #line 3944 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].partelem)); } #line 30432 "gram.c" /* yacc.c:1646 */ break; case 543: #line 3945 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].partelem)); } #line 30438 "gram.c" /* yacc.c:1646 */ break; case 544: #line 3949 "gram.y" /* yacc.c:1646 */ { PartitionElem *n = makeNode(PartitionElem); n->name = (yyvsp[-2].str); n->expr = NULL; n->collation = (yyvsp[-1].list); n->opclass = (yyvsp[0].list); n->location = (yylsp[-2]); (yyval.partelem) = n; } #line 30453 "gram.c" /* yacc.c:1646 */ break; case 545: #line 3960 "gram.y" /* yacc.c:1646 */ { PartitionElem *n = makeNode(PartitionElem); n->name = NULL; n->expr = (yyvsp[-2].node); n->collation = (yyvsp[-1].list); n->opclass = (yyvsp[0].list); n->location = (yylsp[-2]); (yyval.partelem) = n; } #line 30468 "gram.c" /* yacc.c:1646 */ break; case 546: #line 3971 "gram.y" /* yacc.c:1646 */ { PartitionElem *n = makeNode(PartitionElem); n->name = NULL; n->expr = (yyvsp[-3].node); n->collation = (yyvsp[-1].list); n->opclass = (yyvsp[0].list); n->location = (yylsp[-4]); (yyval.partelem) = n; } #line 30483 "gram.c" /* yacc.c:1646 */ break; case 547: #line 3984 "gram.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 30489 "gram.c" /* yacc.c:1646 */ break; case 548: #line 3985 "gram.y" /* yacc.c:1646 */ { (yyval.str) = NULL; } #line 30495 "gram.c" /* yacc.c:1646 */ break; case 549: #line 3990 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 30501 "gram.c" /* yacc.c:1646 */ break; case 550: #line 3991 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 30507 "gram.c" /* yacc.c:1646 */ break; case 551: #line 3992 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 30513 "gram.c" /* yacc.c:1646 */ break; case 552: #line 3995 "gram.y" /* yacc.c:1646 */ { (yyval.oncommit) = ONCOMMIT_DROP; } #line 30519 "gram.c" /* yacc.c:1646 */ break; case 553: #line 3996 "gram.y" /* yacc.c:1646 */ { (yyval.oncommit) = ONCOMMIT_DELETE_ROWS; } #line 30525 "gram.c" /* yacc.c:1646 */ break; case 554: #line 3997 "gram.y" /* yacc.c:1646 */ { (yyval.oncommit) = ONCOMMIT_PRESERVE_ROWS; } #line 30531 "gram.c" /* yacc.c:1646 */ break; case 555: #line 3998 "gram.y" /* yacc.c:1646 */ { (yyval.oncommit) = ONCOMMIT_NOOP; } #line 30537 "gram.c" /* yacc.c:1646 */ break; case 556: #line 4001 "gram.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 30543 "gram.c" /* yacc.c:1646 */ break; case 557: #line 4002 "gram.y" /* yacc.c:1646 */ { (yyval.str) = NULL; } #line 30549 "gram.c" /* yacc.c:1646 */ break; case 558: #line 4005 "gram.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 30555 "gram.c" /* yacc.c:1646 */ break; case 559: #line 4006 "gram.y" /* yacc.c:1646 */ { (yyval.str) = NULL; } #line 30561 "gram.c" /* yacc.c:1646 */ break; case 560: #line 4009 "gram.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 30567 "gram.c" /* yacc.c:1646 */ break; case 561: #line 4029 "gram.y" /* yacc.c:1646 */ { CreateStatsStmt *n = makeNode(CreateStatsStmt); n->defnames = (yyvsp[-5].list); n->stat_types = (yyvsp[-4].list); n->exprs = (yyvsp[-2].list); n->relations = (yyvsp[0].list); n->stxcomment = NULL; n->if_not_exists = false; (yyval.node) = (Node *)n; } #line 30582 "gram.c" /* yacc.c:1646 */ break; case 562: #line 4041 "gram.y" /* yacc.c:1646 */ { CreateStatsStmt *n = makeNode(CreateStatsStmt); n->defnames = (yyvsp[-5].list); n->stat_types = (yyvsp[-4].list); n->exprs = (yyvsp[-2].list); n->relations = (yyvsp[0].list); n->stxcomment = NULL; n->if_not_exists = true; (yyval.node) = (Node *)n; } #line 30597 "gram.c" /* yacc.c:1646 */ break; case 563: #line 4065 "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; ctas->if_not_exists = 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 30614 "gram.c" /* yacc.c:1646 */ break; case 564: #line 4078 "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; ctas->if_not_exists = true; /* cram additional flags into the IntoClause */ (yyvsp[-3].into)->rel->relpersistence = (yyvsp[-8].ival); (yyvsp[-3].into)->skipData = !((yyvsp[0].boolean)); (yyval.node) = (Node *) ctas; } #line 30631 "gram.c" /* yacc.c:1646 */ break; case 565: #line 4095 "gram.y" /* yacc.c:1646 */ { (yyval.into) = makeNode(IntoClause); (yyval.into)->rel = (yyvsp[-5].range); (yyval.into)->colNames = (yyvsp[-4].list); (yyval.into)->accessMethod = (yyvsp[-3].str); (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 30647 "gram.c" /* yacc.c:1646 */ break; case 566: #line 4109 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = true; } #line 30653 "gram.c" /* yacc.c:1646 */ break; case 567: #line 4110 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = false; } #line 30659 "gram.c" /* yacc.c:1646 */ break; case 568: #line 4111 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = true; } #line 30665 "gram.c" /* yacc.c:1646 */ break; case 569: #line 4124 "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; ctas->if_not_exists = 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 30682 "gram.c" /* yacc.c:1646 */ break; case 570: #line 4137 "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; ctas->if_not_exists = true; /* cram additional flags into the IntoClause */ (yyvsp[-3].into)->rel->relpersistence = (yyvsp[-9].ival); (yyvsp[-3].into)->skipData = !((yyvsp[0].boolean)); (yyval.node) = (Node *) ctas; } #line 30699 "gram.c" /* yacc.c:1646 */ break; case 571: #line 4153 "gram.y" /* yacc.c:1646 */ { (yyval.into) = makeNode(IntoClause); (yyval.into)->rel = (yyvsp[-4].range); (yyval.into)->colNames = (yyvsp[-3].list); (yyval.into)->accessMethod = (yyvsp[-2].str); (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 30715 "gram.c" /* yacc.c:1646 */ break; case 572: #line 4166 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = RELPERSISTENCE_UNLOGGED; } #line 30721 "gram.c" /* yacc.c:1646 */ break; case 573: #line 4167 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = RELPERSISTENCE_PERMANENT; } #line 30727 "gram.c" /* yacc.c:1646 */ break; case 574: #line 4180 "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 30739 "gram.c" /* yacc.c:1646 */ break; case 575: #line 4200 "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; n->if_not_exists = false; (yyval.node) = (Node *)n; } #line 30753 "gram.c" /* yacc.c:1646 */ break; case 576: #line 4210 "gram.y" /* yacc.c:1646 */ { CreateSeqStmt *n = makeNode(CreateSeqStmt); (yyvsp[-1].range)->relpersistence = (yyvsp[-6].ival); n->sequence = (yyvsp[-1].range); n->options = (yyvsp[0].list); n->ownerId = InvalidOid; n->if_not_exists = true; (yyval.node) = (Node *)n; } #line 30767 "gram.c" /* yacc.c:1646 */ break; case 577: #line 4223 "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 30779 "gram.c" /* yacc.c:1646 */ break; case 578: #line 4231 "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 30791 "gram.c" /* yacc.c:1646 */ break; case 579: #line 4241 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 30797 "gram.c" /* yacc.c:1646 */ break; case 580: #line 4242 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 30803 "gram.c" /* yacc.c:1646 */ break; case 581: #line 4245 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[-1].list); } #line 30809 "gram.c" /* yacc.c:1646 */ break; case 582: #line 4246 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 30815 "gram.c" /* yacc.c:1646 */ break; case 583: #line 4249 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].defelt)); } #line 30821 "gram.c" /* yacc.c:1646 */ break; case 584: #line 4250 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-1].list), (yyvsp[0].defelt)); } #line 30827 "gram.c" /* yacc.c:1646 */ break; case 585: #line 4254 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("as", (Node *)(yyvsp[0].typnam), (yylsp[-1])); } #line 30835 "gram.c" /* yacc.c:1646 */ break; case 586: #line 4258 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("cache", (Node *)(yyvsp[0].value), (yylsp[-1])); } #line 30843 "gram.c" /* yacc.c:1646 */ break; case 587: #line 4262 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("cycle", (Node *)makeInteger(true), (yylsp[0])); } #line 30851 "gram.c" /* yacc.c:1646 */ break; case 588: #line 4266 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("cycle", (Node *)makeInteger(false), (yylsp[-1])); } #line 30859 "gram.c" /* yacc.c:1646 */ break; case 589: #line 4270 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("increment", (Node *)(yyvsp[0].value), (yylsp[-2])); } #line 30867 "gram.c" /* yacc.c:1646 */ break; case 590: #line 4274 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("maxvalue", (Node *)(yyvsp[0].value), (yylsp[-1])); } #line 30875 "gram.c" /* yacc.c:1646 */ break; case 591: #line 4278 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("minvalue", (Node *)(yyvsp[0].value), (yylsp[-1])); } #line 30883 "gram.c" /* yacc.c:1646 */ break; case 592: #line 4282 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("maxvalue", NULL, (yylsp[-1])); } #line 30891 "gram.c" /* yacc.c:1646 */ break; case 593: #line 4286 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("minvalue", NULL, (yylsp[-1])); } #line 30899 "gram.c" /* yacc.c:1646 */ break; case 594: #line 4290 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("owned_by", (Node *)(yyvsp[0].list), (yylsp[-2])); } #line 30907 "gram.c" /* yacc.c:1646 */ break; case 595: #line 4294 "gram.y" /* yacc.c:1646 */ { /* not documented, only used by pg_dump */ (yyval.defelt) = makeDefElem("sequence_name", (Node *)(yyvsp[0].list), (yylsp[-2])); } #line 30916 "gram.c" /* yacc.c:1646 */ break; case 596: #line 4299 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("start", (Node *)(yyvsp[0].value), (yylsp[-2])); } #line 30924 "gram.c" /* yacc.c:1646 */ break; case 597: #line 4303 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("restart", NULL, (yylsp[0])); } #line 30932 "gram.c" /* yacc.c:1646 */ break; case 598: #line 4307 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("restart", (Node *)(yyvsp[0].value), (yylsp[-2])); } #line 30940 "gram.c" /* yacc.c:1646 */ break; case 599: #line 4312 "gram.y" /* yacc.c:1646 */ {} #line 30946 "gram.c" /* yacc.c:1646 */ break; case 600: #line 4313 "gram.y" /* yacc.c:1646 */ {} #line 30952 "gram.c" /* yacc.c:1646 */ break; case 601: #line 4317 "gram.y" /* yacc.c:1646 */ { (yyval.value) = makeFloat((yyvsp[0].str)); } #line 30958 "gram.c" /* yacc.c:1646 */ break; case 602: #line 4318 "gram.y" /* yacc.c:1646 */ { (yyval.value) = makeFloat((yyvsp[0].str)); } #line 30964 "gram.c" /* yacc.c:1646 */ break; case 603: #line 4320 "gram.y" /* yacc.c:1646 */ { (yyval.value) = makeFloat((yyvsp[0].str)); doNegateFloat((yyval.value)); } #line 30973 "gram.c" /* yacc.c:1646 */ break; case 604: #line 4324 "gram.y" /* yacc.c:1646 */ { (yyval.value) = makeInteger((yyvsp[0].ival)); } #line 30979 "gram.c" /* yacc.c:1646 */ break; case 605: #line 4327 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].value)); } #line 30985 "gram.c" /* yacc.c:1646 */ break; case 606: #line 4328 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].value)); } #line 30991 "gram.c" /* yacc.c:1646 */ break; case 607: #line 4341 "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 31007 "gram.c" /* yacc.c:1646 */ break; case 608: #line 4354 "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 31022 "gram.c" /* yacc.c:1646 */ break; case 609: #line 4367 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = true; } #line 31028 "gram.c" /* yacc.c:1646 */ break; case 610: #line 4368 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = false; } #line 31034 "gram.c" /* yacc.c:1646 */ break; case 611: #line 4376 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1(makeString((yyvsp[0].str))); } #line 31040 "gram.c" /* yacc.c:1646 */ break; case 612: #line 4377 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lcons(makeString((yyvsp[-1].str)), (yyvsp[0].list)); } #line 31046 "gram.c" /* yacc.c:1646 */ break; case 613: #line 4381 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 31052 "gram.c" /* yacc.c:1646 */ break; case 614: #line 4382 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 31058 "gram.c" /* yacc.c:1646 */ break; case 615: #line 4386 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 31064 "gram.c" /* yacc.c:1646 */ break; case 616: #line 4387 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 31070 "gram.c" /* yacc.c:1646 */ break; case 617: #line 4391 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 31076 "gram.c" /* yacc.c:1646 */ break; case 618: #line 4392 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 31082 "gram.c" /* yacc.c:1646 */ break; case 619: #line 4397 "gram.y" /* yacc.c:1646 */ { DropStmt *n = makeNode(DropStmt); n->removeType = OBJECT_LANGUAGE; n->objects = list_make1(makeString((yyvsp[-1].str))); n->behavior = (yyvsp[0].dbehavior); n->missing_ok = false; n->concurrent = false; (yyval.node) = (Node *)n; } #line 31096 "gram.c" /* yacc.c:1646 */ break; case 620: #line 4407 "gram.y" /* yacc.c:1646 */ { DropStmt *n = makeNode(DropStmt); n->removeType = OBJECT_LANGUAGE; n->objects = list_make1(makeString((yyvsp[-1].str))); n->behavior = (yyvsp[0].dbehavior); n->missing_ok = true; n->concurrent = false; (yyval.node) = (Node *)n; } #line 31110 "gram.c" /* yacc.c:1646 */ break; case 621: #line 4419 "gram.y" /* yacc.c:1646 */ {} #line 31116 "gram.c" /* yacc.c:1646 */ break; case 622: #line 4420 "gram.y" /* yacc.c:1646 */ {} #line 31122 "gram.c" /* yacc.c:1646 */ break; case 623: #line 4431 "gram.y" /* yacc.c:1646 */ { CreateTableSpaceStmt *n = makeNode(CreateTableSpaceStmt); n->tablespacename = (yyvsp[-4].str); n->owner = (yyvsp[-3].rolespec); n->location = (yyvsp[-1].str); n->options = (yyvsp[0].list); (yyval.node) = (Node *) n; } #line 31135 "gram.c" /* yacc.c:1646 */ break; case 624: #line 4441 "gram.y" /* yacc.c:1646 */ { (yyval.rolespec) = (yyvsp[0].rolespec); } #line 31141 "gram.c" /* yacc.c:1646 */ break; case 625: #line 4442 "gram.y" /* yacc.c:1646 */ { (yyval.rolespec) = NULL; } #line 31147 "gram.c" /* yacc.c:1646 */ break; case 626: #line 4456 "gram.y" /* yacc.c:1646 */ { DropTableSpaceStmt *n = makeNode(DropTableSpaceStmt); n->tablespacename = (yyvsp[0].str); n->missing_ok = false; (yyval.node) = (Node *) n; } #line 31158 "gram.c" /* yacc.c:1646 */ break; case 627: #line 4463 "gram.y" /* yacc.c:1646 */ { DropTableSpaceStmt *n = makeNode(DropTableSpaceStmt); n->tablespacename = (yyvsp[0].str); n->missing_ok = true; (yyval.node) = (Node *) n; } #line 31169 "gram.c" /* yacc.c:1646 */ break; case 628: #line 4480 "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 31181 "gram.c" /* yacc.c:1646 */ break; case 629: #line 4488 "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 31193 "gram.c" /* yacc.c:1646 */ break; case 630: #line 4499 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-1].list), (yyvsp[0].defelt)); } #line 31199 "gram.c" /* yacc.c:1646 */ break; case 631: #line 4501 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 31205 "gram.c" /* yacc.c:1646 */ break; case 632: #line 4506 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("schema", (Node *)makeString((yyvsp[0].str)), (yylsp[-1])); } #line 31213 "gram.c" /* yacc.c:1646 */ break; case 633: #line 4510 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("new_version", (Node *)makeString((yyvsp[0].str)), (yylsp[-1])); } #line 31221 "gram.c" /* yacc.c:1646 */ break; case 634: #line 4514 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("old_version", (Node *)makeString((yyvsp[0].str)), (yylsp[-1])); } #line 31229 "gram.c" /* yacc.c:1646 */ break; case 635: #line 4518 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("cascade", (Node *)makeInteger(true), (yylsp[0])); } #line 31237 "gram.c" /* yacc.c:1646 */ break; case 636: #line 4530 "gram.y" /* yacc.c:1646 */ { AlterExtensionStmt *n = makeNode(AlterExtensionStmt); n->extname = (yyvsp[-2].str); n->options = (yyvsp[0].list); (yyval.node) = (Node *) n; } #line 31248 "gram.c" /* yacc.c:1646 */ break; case 637: #line 4540 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-1].list), (yyvsp[0].defelt)); } #line 31254 "gram.c" /* yacc.c:1646 */ break; case 638: #line 4542 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 31260 "gram.c" /* yacc.c:1646 */ break; case 639: #line 4547 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("new_version", (Node *)makeString((yyvsp[0].str)), (yylsp[-1])); } #line 31268 "gram.c" /* yacc.c:1646 */ break; case 640: #line 4560 "gram.y" /* yacc.c:1646 */ { AlterExtensionContentsStmt *n = makeNode(AlterExtensionContentsStmt); n->extname = (yyvsp[-4].str); n->action = (yyvsp[-3].ival); n->objtype = OBJECT_ACCESS_METHOD; n->object = (Node *) makeString((yyvsp[0].str)); (yyval.node) = (Node *)n; } #line 31281 "gram.c" /* yacc.c:1646 */ break; case 641: #line 4569 "gram.y" /* yacc.c:1646 */ { AlterExtensionContentsStmt *n = makeNode(AlterExtensionContentsStmt); n->extname = (yyvsp[-3].str); n->action = (yyvsp[-2].ival); n->objtype = OBJECT_AGGREGATE; n->object = (Node *) (yyvsp[0].objwithargs); (yyval.node) = (Node *)n; } #line 31294 "gram.c" /* yacc.c:1646 */ break; case 642: #line 4578 "gram.y" /* yacc.c:1646 */ { AlterExtensionContentsStmt *n = makeNode(AlterExtensionContentsStmt); n->extname = (yyvsp[-7].str); n->action = (yyvsp[-6].ival); n->objtype = OBJECT_CAST; n->object = (Node *) list_make2((yyvsp[-3].typnam), (yyvsp[-1].typnam)); (yyval.node) = (Node *) n; } #line 31307 "gram.c" /* yacc.c:1646 */ break; case 643: #line 4587 "gram.y" /* yacc.c:1646 */ { AlterExtensionContentsStmt *n = makeNode(AlterExtensionContentsStmt); n->extname = (yyvsp[-3].str); n->action = (yyvsp[-2].ival); n->objtype = OBJECT_COLLATION; n->object = (Node *) (yyvsp[0].list); (yyval.node) = (Node *)n; } #line 31320 "gram.c" /* yacc.c:1646 */ break; case 644: #line 4596 "gram.y" /* yacc.c:1646 */ { AlterExtensionContentsStmt *n = makeNode(AlterExtensionContentsStmt); n->extname = (yyvsp[-3].str); n->action = (yyvsp[-2].ival); n->objtype = OBJECT_CONVERSION; n->object = (Node *) (yyvsp[0].list); (yyval.node) = (Node *)n; } #line 31333 "gram.c" /* yacc.c:1646 */ break; case 645: #line 4605 "gram.y" /* yacc.c:1646 */ { AlterExtensionContentsStmt *n = makeNode(AlterExtensionContentsStmt); n->extname = (yyvsp[-3].str); n->action = (yyvsp[-2].ival); n->objtype = OBJECT_DOMAIN; n->object = (Node *) (yyvsp[0].typnam); (yyval.node) = (Node *)n; } #line 31346 "gram.c" /* yacc.c:1646 */ break; case 646: #line 4614 "gram.y" /* yacc.c:1646 */ { AlterExtensionContentsStmt *n = makeNode(AlterExtensionContentsStmt); n->extname = (yyvsp[-3].str); n->action = (yyvsp[-2].ival); n->objtype = OBJECT_FUNCTION; n->object = (Node *) (yyvsp[0].objwithargs); (yyval.node) = (Node *)n; } #line 31359 "gram.c" /* yacc.c:1646 */ break; case 647: #line 4623 "gram.y" /* yacc.c:1646 */ { AlterExtensionContentsStmt *n = makeNode(AlterExtensionContentsStmt); n->extname = (yyvsp[-4].str); n->action = (yyvsp[-3].ival); n->objtype = OBJECT_LANGUAGE; n->object = (Node *) makeString((yyvsp[0].str)); (yyval.node) = (Node *)n; } #line 31372 "gram.c" /* yacc.c:1646 */ break; case 648: #line 4632 "gram.y" /* yacc.c:1646 */ { AlterExtensionContentsStmt *n = makeNode(AlterExtensionContentsStmt); n->extname = (yyvsp[-3].str); n->action = (yyvsp[-2].ival); n->objtype = OBJECT_OPERATOR; n->object = (Node *) (yyvsp[0].objwithargs); (yyval.node) = (Node *)n; } #line 31385 "gram.c" /* yacc.c:1646 */ break; case 649: #line 4641 "gram.y" /* yacc.c:1646 */ { AlterExtensionContentsStmt *n = makeNode(AlterExtensionContentsStmt); n->extname = (yyvsp[-6].str); n->action = (yyvsp[-5].ival); n->objtype = OBJECT_OPCLASS; n->object = (Node *) lcons(makeString((yyvsp[0].str)), (yyvsp[-2].list)); (yyval.node) = (Node *)n; } #line 31398 "gram.c" /* yacc.c:1646 */ break; case 650: #line 4650 "gram.y" /* yacc.c:1646 */ { AlterExtensionContentsStmt *n = makeNode(AlterExtensionContentsStmt); n->extname = (yyvsp[-6].str); n->action = (yyvsp[-5].ival); n->objtype = OBJECT_OPFAMILY; n->object = (Node *) lcons(makeString((yyvsp[0].str)), (yyvsp[-2].list)); (yyval.node) = (Node *)n; } #line 31411 "gram.c" /* yacc.c:1646 */ break; case 651: #line 4659 "gram.y" /* yacc.c:1646 */ { AlterExtensionContentsStmt *n = makeNode(AlterExtensionContentsStmt); n->extname = (yyvsp[-3].str); n->action = (yyvsp[-2].ival); n->objtype = OBJECT_PROCEDURE; n->object = (Node *) (yyvsp[0].objwithargs); (yyval.node) = (Node *)n; } #line 31424 "gram.c" /* yacc.c:1646 */ break; case 652: #line 4668 "gram.y" /* yacc.c:1646 */ { AlterExtensionContentsStmt *n = makeNode(AlterExtensionContentsStmt); n->extname = (yyvsp[-3].str); n->action = (yyvsp[-2].ival); n->objtype = OBJECT_ROUTINE; n->object = (Node *) (yyvsp[0].objwithargs); (yyval.node) = (Node *)n; } #line 31437 "gram.c" /* yacc.c:1646 */ break; case 653: #line 4677 "gram.y" /* yacc.c:1646 */ { AlterExtensionContentsStmt *n = makeNode(AlterExtensionContentsStmt); n->extname = (yyvsp[-3].str); n->action = (yyvsp[-2].ival); n->objtype = OBJECT_SCHEMA; n->object = (Node *) makeString((yyvsp[0].str)); (yyval.node) = (Node *)n; } #line 31450 "gram.c" /* yacc.c:1646 */ break; case 654: #line 4686 "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->object = (Node *) makeString((yyvsp[0].str)); (yyval.node) = (Node *)n; } #line 31463 "gram.c" /* yacc.c:1646 */ break; case 655: #line 4695 "gram.y" /* yacc.c:1646 */ { AlterExtensionContentsStmt *n = makeNode(AlterExtensionContentsStmt); n->extname = (yyvsp[-3].str); n->action = (yyvsp[-2].ival); n->objtype = OBJECT_TABLE; n->object = (Node *) (yyvsp[0].list); (yyval.node) = (Node *)n; } #line 31476 "gram.c" /* yacc.c:1646 */ break; case 656: #line 4704 "gram.y" /* yacc.c:1646 */ { AlterExtensionContentsStmt *n = makeNode(AlterExtensionContentsStmt); n->extname = (yyvsp[-5].str); n->action = (yyvsp[-4].ival); n->objtype = OBJECT_TSPARSER; n->object = (Node *) (yyvsp[0].list); (yyval.node) = (Node *)n; } #line 31489 "gram.c" /* yacc.c:1646 */ break; case 657: #line 4713 "gram.y" /* yacc.c:1646 */ { AlterExtensionContentsStmt *n = makeNode(AlterExtensionContentsStmt); n->extname = (yyvsp[-5].str); n->action = (yyvsp[-4].ival); n->objtype = OBJECT_TSDICTIONARY; n->object = (Node *) (yyvsp[0].list); (yyval.node) = (Node *)n; } #line 31502 "gram.c" /* yacc.c:1646 */ break; case 658: #line 4722 "gram.y" /* yacc.c:1646 */ { AlterExtensionContentsStmt *n = makeNode(AlterExtensionContentsStmt); n->extname = (yyvsp[-5].str); n->action = (yyvsp[-4].ival); n->objtype = OBJECT_TSTEMPLATE; n->object = (Node *) (yyvsp[0].list); (yyval.node) = (Node *)n; } #line 31515 "gram.c" /* yacc.c:1646 */ break; case 659: #line 4731 "gram.y" /* yacc.c:1646 */ { AlterExtensionContentsStmt *n = makeNode(AlterExtensionContentsStmt); n->extname = (yyvsp[-5].str); n->action = (yyvsp[-4].ival); n->objtype = OBJECT_TSCONFIGURATION; n->object = (Node *) (yyvsp[0].list); (yyval.node) = (Node *)n; } #line 31528 "gram.c" /* yacc.c:1646 */ break; case 660: #line 4740 "gram.y" /* yacc.c:1646 */ { AlterExtensionContentsStmt *n = makeNode(AlterExtensionContentsStmt); n->extname = (yyvsp[-3].str); n->action = (yyvsp[-2].ival); n->objtype = OBJECT_SEQUENCE; n->object = (Node *) (yyvsp[0].list); (yyval.node) = (Node *)n; } #line 31541 "gram.c" /* yacc.c:1646 */ break; case 661: #line 4749 "gram.y" /* yacc.c:1646 */ { AlterExtensionContentsStmt *n = makeNode(AlterExtensionContentsStmt); n->extname = (yyvsp[-3].str); n->action = (yyvsp[-2].ival); n->objtype = OBJECT_VIEW; n->object = (Node *) (yyvsp[0].list); (yyval.node) = (Node *)n; } #line 31554 "gram.c" /* yacc.c:1646 */ break; case 662: #line 4758 "gram.y" /* yacc.c:1646 */ { AlterExtensionContentsStmt *n = makeNode(AlterExtensionContentsStmt); n->extname = (yyvsp[-4].str); n->action = (yyvsp[-3].ival); n->objtype = OBJECT_MATVIEW; n->object = (Node *) (yyvsp[0].list); (yyval.node) = (Node *)n; } #line 31567 "gram.c" /* yacc.c:1646 */ break; case 663: #line 4767 "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->object = (Node *) (yyvsp[0].list); (yyval.node) = (Node *)n; } #line 31580 "gram.c" /* yacc.c:1646 */ break; case 664: #line 4776 "gram.y" /* yacc.c:1646 */ { AlterExtensionContentsStmt *n = makeNode(AlterExtensionContentsStmt); n->extname = (yyvsp[-5].str); n->action = (yyvsp[-4].ival); n->objtype = OBJECT_FDW; n->object = (Node *) makeString((yyvsp[0].str)); (yyval.node) = (Node *)n; } #line 31593 "gram.c" /* yacc.c:1646 */ break; case 665: #line 4785 "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->object = (Node *) makeString((yyvsp[0].str)); (yyval.node) = (Node *)n; } #line 31606 "gram.c" /* yacc.c:1646 */ break; case 666: #line 4794 "gram.y" /* yacc.c:1646 */ { AlterExtensionContentsStmt *n = makeNode(AlterExtensionContentsStmt); n->extname = (yyvsp[-6].str); n->action = (yyvsp[-5].ival); n->objtype = OBJECT_TRANSFORM; n->object = (Node *) list_make2((yyvsp[-2].typnam), makeString((yyvsp[0].str))); (yyval.node) = (Node *)n; } #line 31619 "gram.c" /* yacc.c:1646 */ break; case 667: #line 4803 "gram.y" /* yacc.c:1646 */ { AlterExtensionContentsStmt *n = makeNode(AlterExtensionContentsStmt); n->extname = (yyvsp[-3].str); n->action = (yyvsp[-2].ival); n->objtype = OBJECT_TYPE; n->object = (Node *) (yyvsp[0].typnam); (yyval.node) = (Node *)n; } #line 31632 "gram.c" /* yacc.c:1646 */ break; case 668: #line 4821 "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 31644 "gram.c" /* yacc.c:1646 */ break; case 669: #line 4831 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("handler", (Node *)(yyvsp[0].list), (yylsp[-1])); } #line 31650 "gram.c" /* yacc.c:1646 */ break; case 670: #line 4832 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("handler", NULL, (yylsp[-1])); } #line 31656 "gram.c" /* yacc.c:1646 */ break; case 671: #line 4833 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("validator", (Node *)(yyvsp[0].list), (yylsp[-1])); } #line 31662 "gram.c" /* yacc.c:1646 */ break; case 672: #line 4834 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("validator", NULL, (yylsp[-1])); } #line 31668 "gram.c" /* yacc.c:1646 */ break; case 673: #line 4838 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].defelt)); } #line 31674 "gram.c" /* yacc.c:1646 */ break; case 674: #line 4839 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-1].list), (yyvsp[0].defelt)); } #line 31680 "gram.c" /* yacc.c:1646 */ break; case 675: #line 4843 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 31686 "gram.c" /* yacc.c:1646 */ break; case 676: #line 4844 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 31692 "gram.c" /* yacc.c:1646 */ break; case 677: #line 4855 "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 31704 "gram.c" /* yacc.c:1646 */ break; case 678: #line 4863 "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 31716 "gram.c" /* yacc.c:1646 */ break; case 679: #line 4874 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[-1].list); } #line 31722 "gram.c" /* yacc.c:1646 */ break; case 680: #line 4875 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 31728 "gram.c" /* yacc.c:1646 */ break; case 681: #line 4880 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].defelt)); } #line 31736 "gram.c" /* yacc.c:1646 */ break; case 682: #line 4884 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].defelt)); } #line 31744 "gram.c" /* yacc.c:1646 */ break; case 683: #line 4891 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[-1].list); } #line 31750 "gram.c" /* yacc.c:1646 */ break; case 684: #line 4896 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].defelt)); } #line 31758 "gram.c" /* yacc.c:1646 */ break; case 685: #line 4900 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].defelt)); } #line 31766 "gram.c" /* yacc.c:1646 */ break; case 686: #line 4907 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = (yyvsp[0].defelt); } #line 31774 "gram.c" /* yacc.c:1646 */ break; case 687: #line 4911 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = (yyvsp[0].defelt); (yyval.defelt)->defaction = DEFELEM_SET; } #line 31783 "gram.c" /* yacc.c:1646 */ break; case 688: #line 4916 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = (yyvsp[0].defelt); (yyval.defelt)->defaction = DEFELEM_ADD; } #line 31792 "gram.c" /* yacc.c:1646 */ break; case 689: #line 4921 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElemExtended(NULL, (yyvsp[0].str), NULL, DEFELEM_DROP, (yylsp[0])); } #line 31800 "gram.c" /* yacc.c:1646 */ break; case 690: #line 4928 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem((yyvsp[-1].str), (yyvsp[0].node), (yylsp[-1])); } #line 31808 "gram.c" /* yacc.c:1646 */ break; case 691: #line 4934 "gram.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 31814 "gram.c" /* yacc.c:1646 */ break; case 692: #line 4939 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeString((yyvsp[0].str)); } #line 31820 "gram.c" /* yacc.c:1646 */ break; case 693: #line 4951 "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); n->if_not_exists = false; (yyval.node) = (Node *) n; } #line 31835 "gram.c" /* yacc.c:1646 */ break; case 694: #line 4963 "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); n->if_not_exists = true; (yyval.node) = (Node *) n; } #line 31850 "gram.c" /* yacc.c:1646 */ break; case 695: #line 4976 "gram.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 31856 "gram.c" /* yacc.c:1646 */ break; case 696: #line 4977 "gram.y" /* yacc.c:1646 */ { (yyval.str) = NULL; } #line 31862 "gram.c" /* yacc.c:1646 */ break; case 697: #line 4982 "gram.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 31868 "gram.c" /* yacc.c:1646 */ break; case 698: #line 4983 "gram.y" /* yacc.c:1646 */ { (yyval.str) = NULL; } #line 31874 "gram.c" /* yacc.c:1646 */ break; case 699: #line 4987 "gram.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 31880 "gram.c" /* yacc.c:1646 */ break; case 700: #line 4988 "gram.y" /* yacc.c:1646 */ { (yyval.str) = NULL; } #line 31886 "gram.c" /* yacc.c:1646 */ break; case 701: #line 4999 "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 31899 "gram.c" /* yacc.c:1646 */ break; case 702: #line 5008 "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 31911 "gram.c" /* yacc.c:1646 */ break; case 703: #line 5016 "gram.y" /* yacc.c:1646 */ { AlterForeignServerStmt *n = makeNode(AlterForeignServerStmt); n->servername = (yyvsp[-1].str); n->options = (yyvsp[0].list); (yyval.node) = (Node *) n; } #line 31922 "gram.c" /* yacc.c:1646 */ break; case 704: #line 5035 "gram.y" /* yacc.c:1646 */ { CreateForeignTableStmt *n = makeNode(CreateForeignTableStmt); (yyvsp[-7].range)->relpersistence = RELPERSISTENCE_PERMANENT; n->base.relation = (yyvsp[-7].range); n->base.tableElts = (yyvsp[-5].list); n->base.inhRelations = (yyvsp[-3].list); n->base.ofTypename = NULL; n->base.constraints = NIL; n->base.options = NIL; n->base.oncommit = ONCOMMIT_NOOP; n->base.tablespacename = NULL; n->base.if_not_exists = false; /* FDW-specific data */ n->servername = (yyvsp[-1].str); n->options = (yyvsp[0].list); (yyval.node) = (Node *) n; } #line 31944 "gram.c" /* yacc.c:1646 */ break; case 705: #line 5055 "gram.y" /* yacc.c:1646 */ { CreateForeignTableStmt *n = makeNode(CreateForeignTableStmt); (yyvsp[-7].range)->relpersistence = RELPERSISTENCE_PERMANENT; n->base.relation = (yyvsp[-7].range); n->base.tableElts = (yyvsp[-5].list); n->base.inhRelations = (yyvsp[-3].list); n->base.ofTypename = NULL; n->base.constraints = NIL; n->base.options = NIL; n->base.oncommit = ONCOMMIT_NOOP; n->base.tablespacename = NULL; n->base.if_not_exists = true; /* FDW-specific data */ n->servername = (yyvsp[-1].str); n->options = (yyvsp[0].list); (yyval.node) = (Node *) n; } #line 31966 "gram.c" /* yacc.c:1646 */ break; case 706: #line 5075 "gram.y" /* yacc.c:1646 */ { CreateForeignTableStmt *n = makeNode(CreateForeignTableStmt); (yyvsp[-8].range)->relpersistence = RELPERSISTENCE_PERMANENT; n->base.relation = (yyvsp[-8].range); n->base.inhRelations = list_make1((yyvsp[-5].range)); n->base.tableElts = (yyvsp[-4].list); n->base.partbound = (yyvsp[-3].partboundspec); n->base.ofTypename = NULL; n->base.constraints = NIL; n->base.options = NIL; n->base.oncommit = ONCOMMIT_NOOP; n->base.tablespacename = NULL; n->base.if_not_exists = false; /* FDW-specific data */ n->servername = (yyvsp[-1].str); n->options = (yyvsp[0].list); (yyval.node) = (Node *) n; } #line 31989 "gram.c" /* yacc.c:1646 */ break; case 707: #line 5096 "gram.y" /* yacc.c:1646 */ { CreateForeignTableStmt *n = makeNode(CreateForeignTableStmt); (yyvsp[-8].range)->relpersistence = RELPERSISTENCE_PERMANENT; n->base.relation = (yyvsp[-8].range); n->base.inhRelations = list_make1((yyvsp[-5].range)); n->base.tableElts = (yyvsp[-4].list); n->base.partbound = (yyvsp[-3].partboundspec); n->base.ofTypename = NULL; n->base.constraints = NIL; n->base.options = NIL; n->base.oncommit = ONCOMMIT_NOOP; n->base.tablespacename = NULL; n->base.if_not_exists = true; /* FDW-specific data */ n->servername = (yyvsp[-1].str); n->options = (yyvsp[0].list); (yyval.node) = (Node *) n; } #line 32012 "gram.c" /* yacc.c:1646 */ break; case 708: #line 5125 "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 32025 "gram.c" /* yacc.c:1646 */ break; case 709: #line 5134 "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 32038 "gram.c" /* yacc.c:1646 */ break; case 710: #line 5156 "gram.y" /* yacc.c:1646 */ { ImportForeignSchemaStmt *n = makeNode(ImportForeignSchemaStmt); n->server_name = (yyvsp[-3].str); n->remote_schema = (yyvsp[-7].str); n->local_schema = (yyvsp[-1].str); n->list_type = (yyvsp[-6].importqual)->type; n->table_list = (yyvsp[-6].importqual)->table_names; n->options = (yyvsp[0].list); (yyval.node) = (Node *) n; } #line 32053 "gram.c" /* yacc.c:1646 */ break; case 711: #line 5169 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = FDW_IMPORT_SCHEMA_LIMIT_TO; } #line 32059 "gram.c" /* yacc.c:1646 */ break; case 712: #line 5170 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = FDW_IMPORT_SCHEMA_EXCEPT; } #line 32065 "gram.c" /* yacc.c:1646 */ break; case 713: #line 5175 "gram.y" /* yacc.c:1646 */ { ImportQual *n = (ImportQual *) palloc(sizeof(ImportQual)); n->type = (yyvsp[-3].ival); n->table_names = (yyvsp[-1].list); (yyval.importqual) = n; } #line 32076 "gram.c" /* yacc.c:1646 */ break; case 714: #line 5182 "gram.y" /* yacc.c:1646 */ { ImportQual *n = (ImportQual *) palloc(sizeof(ImportQual)); n->type = FDW_IMPORT_SCHEMA_ALL; n->table_names = NIL; (yyval.importqual) = n; } #line 32087 "gram.c" /* yacc.c:1646 */ break; case 715: #line 5198 "gram.y" /* yacc.c:1646 */ { CreateUserMappingStmt *n = makeNode(CreateUserMappingStmt); n->user = (yyvsp[-3].rolespec); n->servername = (yyvsp[-1].str); n->options = (yyvsp[0].list); n->if_not_exists = false; (yyval.node) = (Node *) n; } #line 32100 "gram.c" /* yacc.c:1646 */ break; case 716: #line 5207 "gram.y" /* yacc.c:1646 */ { CreateUserMappingStmt *n = makeNode(CreateUserMappingStmt); n->user = (yyvsp[-3].rolespec); n->servername = (yyvsp[-1].str); n->options = (yyvsp[0].list); n->if_not_exists = true; (yyval.node) = (Node *) n; } #line 32113 "gram.c" /* yacc.c:1646 */ break; case 717: #line 5218 "gram.y" /* yacc.c:1646 */ { (yyval.rolespec) = (yyvsp[0].rolespec); } #line 32119 "gram.c" /* yacc.c:1646 */ break; case 718: #line 5219 "gram.y" /* yacc.c:1646 */ { (yyval.rolespec) = makeRoleSpec(ROLESPEC_CURRENT_USER, (yylsp[0])); } #line 32125 "gram.c" /* yacc.c:1646 */ break; case 719: #line 5232 "gram.y" /* yacc.c:1646 */ { DropUserMappingStmt *n = makeNode(DropUserMappingStmt); n->user = (yyvsp[-2].rolespec); n->servername = (yyvsp[0].str); n->missing_ok = false; (yyval.node) = (Node *) n; } #line 32137 "gram.c" /* yacc.c:1646 */ break; case 720: #line 5240 "gram.y" /* yacc.c:1646 */ { DropUserMappingStmt *n = makeNode(DropUserMappingStmt); n->user = (yyvsp[-2].rolespec); n->servername = (yyvsp[0].str); n->missing_ok = true; (yyval.node) = (Node *) n; } #line 32149 "gram.c" /* yacc.c:1646 */ break; case 721: #line 5257 "gram.y" /* yacc.c:1646 */ { AlterUserMappingStmt *n = makeNode(AlterUserMappingStmt); n->user = (yyvsp[-3].rolespec); n->servername = (yyvsp[-1].str); n->options = (yyvsp[0].list); (yyval.node) = (Node *) n; } #line 32161 "gram.c" /* yacc.c:1646 */ break; case 722: #line 5283 "gram.y" /* yacc.c:1646 */ { CreatePolicyStmt *n = makeNode(CreatePolicyStmt); n->policy_name = (yyvsp[-7].str); n->table = (yyvsp[-5].range); n->permissive = (yyvsp[-4].boolean); n->cmd_name = (yyvsp[-3].str); n->roles = (yyvsp[-2].list); n->qual = (yyvsp[-1].node); n->with_check = (yyvsp[0].node); (yyval.node) = (Node *) n; } #line 32177 "gram.c" /* yacc.c:1646 */ break; case 723: #line 5299 "gram.y" /* yacc.c:1646 */ { AlterPolicyStmt *n = makeNode(AlterPolicyStmt); n->policy_name = (yyvsp[-5].str); n->table = (yyvsp[-3].range); n->roles = (yyvsp[-2].list); n->qual = (yyvsp[-1].node); n->with_check = (yyvsp[0].node); (yyval.node) = (Node *) n; } #line 32191 "gram.c" /* yacc.c:1646 */ break; case 724: #line 5311 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[-1].node); } #line 32197 "gram.c" /* yacc.c:1646 */ break; case 725: #line 5312 "gram.y" /* yacc.c:1646 */ { (yyval.node) = NULL; } #line 32203 "gram.c" /* yacc.c:1646 */ break; case 726: #line 5316 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[-1].node); } #line 32209 "gram.c" /* yacc.c:1646 */ break; case 727: #line 5317 "gram.y" /* yacc.c:1646 */ { (yyval.node) = NULL; } #line 32215 "gram.c" /* yacc.c:1646 */ break; case 728: #line 5321 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 32221 "gram.c" /* yacc.c:1646 */ break; case 729: #line 5322 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1(makeRoleSpec(ROLESPEC_PUBLIC, -1)); } #line 32227 "gram.c" /* yacc.c:1646 */ break; case 730: #line 5326 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 32233 "gram.c" /* yacc.c:1646 */ break; case 731: #line 5327 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NULL; } #line 32239 "gram.c" /* yacc.c:1646 */ break; case 732: #line 5332 "gram.y" /* yacc.c:1646 */ { if (strcmp((yyvsp[0].str), "permissive") == 0) (yyval.boolean) = true; else if (strcmp((yyvsp[0].str), "restrictive") == 0) (yyval.boolean) = false; else ereport(ERROR, (errcode(ERRCODE_SYNTAX_ERROR), errmsg("unrecognized row security option \"%s\"", (yyvsp[0].str)), errhint("Only PERMISSIVE or RESTRICTIVE policies are supported currently."), parser_errposition((yylsp[0])))); } #line 32257 "gram.c" /* yacc.c:1646 */ break; case 733: #line 5345 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = true; } #line 32263 "gram.c" /* yacc.c:1646 */ break; case 734: #line 5349 "gram.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 32269 "gram.c" /* yacc.c:1646 */ break; case 735: #line 5350 "gram.y" /* yacc.c:1646 */ { (yyval.str) = "all"; } #line 32275 "gram.c" /* yacc.c:1646 */ break; case 736: #line 5354 "gram.y" /* yacc.c:1646 */ { (yyval.str) = "all"; } #line 32281 "gram.c" /* yacc.c:1646 */ break; case 737: #line 5355 "gram.y" /* yacc.c:1646 */ { (yyval.str) = "select"; } #line 32287 "gram.c" /* yacc.c:1646 */ break; case 738: #line 5356 "gram.y" /* yacc.c:1646 */ { (yyval.str) = "insert"; } #line 32293 "gram.c" /* yacc.c:1646 */ break; case 739: #line 5357 "gram.y" /* yacc.c:1646 */ { (yyval.str) = "update"; } #line 32299 "gram.c" /* yacc.c:1646 */ break; case 740: #line 5358 "gram.y" /* yacc.c:1646 */ { (yyval.str) = "delete"; } #line 32305 "gram.c" /* yacc.c:1646 */ break; case 741: #line 5369 "gram.y" /* yacc.c:1646 */ { CreateAmStmt *n = makeNode(CreateAmStmt); n->amname = (yyvsp[-4].str); n->handler_name = (yyvsp[0].list); n->amtype = (yyvsp[-2].chr); (yyval.node) = (Node *) n; } #line 32317 "gram.c" /* yacc.c:1646 */ break; case 742: #line 5379 "gram.y" /* yacc.c:1646 */ { (yyval.chr) = AMTYPE_INDEX; } #line 32323 "gram.c" /* yacc.c:1646 */ break; case 743: #line 5380 "gram.y" /* yacc.c:1646 */ { (yyval.chr) = AMTYPE_TABLE; } #line 32329 "gram.c" /* yacc.c:1646 */ break; case 744: #line 5394 "gram.y" /* yacc.c:1646 */ { CreateTrigStmt *n = makeNode(CreateTrigStmt); n->trigname = (yyvsp[-13].str); n->relation = (yyvsp[-9].range); n->funcname = (yyvsp[-3].list); n->args = (yyvsp[-1].list); n->row = (yyvsp[-7].boolean); n->timing = (yyvsp[-12].ival); n->events = intVal(linitial((yyvsp[-11].list))); n->columns = (List *) lsecond((yyvsp[-11].list)); n->whenClause = (yyvsp[-6].node); n->transitionRels = (yyvsp[-8].list); n->isconstraint = false; n->deferrable = false; n->initdeferred = false; n->constrrel = NULL; (yyval.node) = (Node *)n; } #line 32352 "gram.c" /* yacc.c:1646 */ break; case 745: #line 5416 "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->transitionRels = NIL; 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 32376 "gram.c" /* yacc.c:1646 */ break; case 746: #line 5438 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = TRIGGER_TYPE_BEFORE; } #line 32382 "gram.c" /* yacc.c:1646 */ break; case 747: #line 5439 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = TRIGGER_TYPE_AFTER; } #line 32388 "gram.c" /* yacc.c:1646 */ break; case 748: #line 5440 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = TRIGGER_TYPE_INSTEAD; } #line 32394 "gram.c" /* yacc.c:1646 */ break; case 749: #line 5445 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 32400 "gram.c" /* yacc.c:1646 */ break; case 750: #line 5447 "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 32423 "gram.c" /* yacc.c:1646 */ break; case 751: #line 5469 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make2(makeInteger(TRIGGER_TYPE_INSERT), NIL); } #line 32429 "gram.c" /* yacc.c:1646 */ break; case 752: #line 5471 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make2(makeInteger(TRIGGER_TYPE_DELETE), NIL); } #line 32435 "gram.c" /* yacc.c:1646 */ break; case 753: #line 5473 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make2(makeInteger(TRIGGER_TYPE_UPDATE), NIL); } #line 32441 "gram.c" /* yacc.c:1646 */ break; case 754: #line 5475 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make2(makeInteger(TRIGGER_TYPE_UPDATE), (yyvsp[0].list)); } #line 32447 "gram.c" /* yacc.c:1646 */ break; case 755: #line 5477 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make2(makeInteger(TRIGGER_TYPE_TRUNCATE), NIL); } #line 32453 "gram.c" /* yacc.c:1646 */ break; case 756: #line 5481 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 32459 "gram.c" /* yacc.c:1646 */ break; case 757: #line 5482 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 32465 "gram.c" /* yacc.c:1646 */ break; case 758: #line 5486 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].node)); } #line 32471 "gram.c" /* yacc.c:1646 */ break; case 759: #line 5487 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-1].list), (yyvsp[0].node)); } #line 32477 "gram.c" /* yacc.c:1646 */ break; case 760: #line 5492 "gram.y" /* yacc.c:1646 */ { TriggerTransition *n = makeNode(TriggerTransition); n->name = (yyvsp[0].str); n->isNew = (yyvsp[-3].boolean); n->isTable = (yyvsp[-2].boolean); (yyval.node) = (Node *)n; } #line 32489 "gram.c" /* yacc.c:1646 */ break; case 761: #line 5502 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = true; } #line 32495 "gram.c" /* yacc.c:1646 */ break; case 762: #line 5503 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = false; } #line 32501 "gram.c" /* yacc.c:1646 */ break; case 763: #line 5507 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = true; } #line 32507 "gram.c" /* yacc.c:1646 */ break; case 764: #line 5516 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = false; } #line 32513 "gram.c" /* yacc.c:1646 */ break; case 765: #line 5520 "gram.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 32519 "gram.c" /* yacc.c:1646 */ break; case 766: #line 5525 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = (yyvsp[0].boolean); } #line 32527 "gram.c" /* yacc.c:1646 */ break; case 767: #line 5529 "gram.y" /* yacc.c:1646 */ { /* * If ROW/STATEMENT not specified, default to * STATEMENT, per SQL */ (yyval.boolean) = false; } #line 32539 "gram.c" /* yacc.c:1646 */ break; case 768: #line 5539 "gram.y" /* yacc.c:1646 */ {} #line 32545 "gram.c" /* yacc.c:1646 */ break; case 769: #line 5540 "gram.y" /* yacc.c:1646 */ {} #line 32551 "gram.c" /* yacc.c:1646 */ break; case 770: #line 5544 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = true; } #line 32557 "gram.c" /* yacc.c:1646 */ break; case 771: #line 5545 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = false; } #line 32563 "gram.c" /* yacc.c:1646 */ break; case 772: #line 5549 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[-1].node); } #line 32569 "gram.c" /* yacc.c:1646 */ break; case 773: #line 5550 "gram.y" /* yacc.c:1646 */ { (yyval.node) = NULL; } #line 32575 "gram.c" /* yacc.c:1646 */ break; case 776: #line 5559 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].value)); } #line 32581 "gram.c" /* yacc.c:1646 */ break; case 777: #line 5560 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].value)); } #line 32587 "gram.c" /* yacc.c:1646 */ break; case 778: #line 5561 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 32593 "gram.c" /* yacc.c:1646 */ break; case 779: #line 5566 "gram.y" /* yacc.c:1646 */ { (yyval.value) = makeString(psprintf("%d", (yyvsp[0].ival))); } #line 32601 "gram.c" /* yacc.c:1646 */ break; case 780: #line 5569 "gram.y" /* yacc.c:1646 */ { (yyval.value) = makeString((yyvsp[0].str)); } #line 32607 "gram.c" /* yacc.c:1646 */ break; case 781: #line 5570 "gram.y" /* yacc.c:1646 */ { (yyval.value) = makeString((yyvsp[0].str)); } #line 32613 "gram.c" /* yacc.c:1646 */ break; case 782: #line 5571 "gram.y" /* yacc.c:1646 */ { (yyval.value) = makeString((yyvsp[0].str)); } #line 32619 "gram.c" /* yacc.c:1646 */ break; case 783: #line 5575 "gram.y" /* yacc.c:1646 */ { (yyval.range) = (yyvsp[0].range); } #line 32625 "gram.c" /* yacc.c:1646 */ break; case 784: #line 5576 "gram.y" /* yacc.c:1646 */ { (yyval.range) = NULL; } #line 32631 "gram.c" /* yacc.c:1646 */ break; case 785: #line 5581 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = 0; } #line 32637 "gram.c" /* yacc.c:1646 */ break; case 786: #line 5583 "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 32665 "gram.c" /* yacc.c:1646 */ break; case 787: #line 5609 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = CAS_NOT_DEFERRABLE; } #line 32671 "gram.c" /* yacc.c:1646 */ break; case 788: #line 5610 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = CAS_DEFERRABLE; } #line 32677 "gram.c" /* yacc.c:1646 */ break; case 789: #line 5611 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = CAS_INITIALLY_IMMEDIATE; } #line 32683 "gram.c" /* yacc.c:1646 */ break; case 790: #line 5612 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = CAS_INITIALLY_DEFERRED; } #line 32689 "gram.c" /* yacc.c:1646 */ break; case 791: #line 5613 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = CAS_NOT_VALID; } #line 32695 "gram.c" /* yacc.c:1646 */ break; case 792: #line 5614 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = CAS_NO_INHERIT; } #line 32701 "gram.c" /* yacc.c:1646 */ break; case 793: #line 5629 "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 32714 "gram.c" /* yacc.c:1646 */ break; case 794: #line 5640 "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 32727 "gram.c" /* yacc.c:1646 */ break; case 795: #line 5652 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].defelt)); } #line 32733 "gram.c" /* yacc.c:1646 */ break; case 796: #line 5654 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].defelt)); } #line 32739 "gram.c" /* yacc.c:1646 */ break; case 797: #line 5659 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem((yyvsp[-4].str), (Node *) (yyvsp[-1].list), (yylsp[-4])); } #line 32745 "gram.c" /* yacc.c:1646 */ break; case 798: #line 5664 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1(makeString((yyvsp[0].str))); } #line 32751 "gram.c" /* yacc.c:1646 */ break; case 799: #line 5666 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), makeString((yyvsp[0].str))); } #line 32757 "gram.c" /* yacc.c:1646 */ break; case 800: #line 5671 "gram.y" /* yacc.c:1646 */ { AlterEventTrigStmt *n = makeNode(AlterEventTrigStmt); n->trigname = (yyvsp[-1].str); n->tgenabled = (yyvsp[0].chr); (yyval.node) = (Node *) n; } #line 32768 "gram.c" /* yacc.c:1646 */ break; case 801: #line 5680 "gram.y" /* yacc.c:1646 */ { (yyval.chr) = TRIGGER_FIRES_ON_ORIGIN; } #line 32774 "gram.c" /* yacc.c:1646 */ break; case 802: #line 5681 "gram.y" /* yacc.c:1646 */ { (yyval.chr) = TRIGGER_FIRES_ON_REPLICA; } #line 32780 "gram.c" /* yacc.c:1646 */ break; case 803: #line 5682 "gram.y" /* yacc.c:1646 */ { (yyval.chr) = TRIGGER_FIRES_ALWAYS; } #line 32786 "gram.c" /* yacc.c:1646 */ break; case 804: #line 5683 "gram.y" /* yacc.c:1646 */ { (yyval.chr) = TRIGGER_DISABLED; } #line 32792 "gram.c" /* yacc.c:1646 */ break; case 805: #line 5695 "gram.y" /* yacc.c:1646 */ { ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), errmsg("CREATE ASSERTION is not yet implemented"))); (yyval.node) = NULL; } #line 32804 "gram.c" /* yacc.c:1646 */ break; case 806: #line 5714 "gram.y" /* yacc.c:1646 */ { DefineStmt *n = makeNode(DefineStmt); n->kind = OBJECT_AGGREGATE; n->oldstyle = false; n->replace = (yyvsp[-4].boolean); n->defnames = (yyvsp[-2].list); n->args = (yyvsp[-1].list); n->definition = (yyvsp[0].list); (yyval.node) = (Node *)n; } #line 32819 "gram.c" /* yacc.c:1646 */ break; case 807: #line 5725 "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->replace = (yyvsp[-3].boolean); n->defnames = (yyvsp[-1].list); n->args = NIL; n->definition = (yyvsp[0].list); (yyval.node) = (Node *)n; } #line 32835 "gram.c" /* yacc.c:1646 */ break; case 808: #line 5737 "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 32849 "gram.c" /* yacc.c:1646 */ break; case 809: #line 5747 "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 32863 "gram.c" /* yacc.c:1646 */ break; case 810: #line 5757 "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 32878 "gram.c" /* yacc.c:1646 */ break; case 811: #line 5768 "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 32891 "gram.c" /* yacc.c:1646 */ break; case 812: #line 5777 "gram.y" /* yacc.c:1646 */ { CreateEnumStmt *n = makeNode(CreateEnumStmt); n->typeName = (yyvsp[-5].list); n->vals = (yyvsp[-1].list); (yyval.node) = (Node *)n; } #line 32902 "gram.c" /* yacc.c:1646 */ break; case 813: #line 5784 "gram.y" /* yacc.c:1646 */ { CreateRangeStmt *n = makeNode(CreateRangeStmt); n->typeName = (yyvsp[-3].list); n->params = (yyvsp[0].list); (yyval.node) = (Node *)n; } #line 32913 "gram.c" /* yacc.c:1646 */ break; case 814: #line 5791 "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 32926 "gram.c" /* yacc.c:1646 */ break; case 815: #line 5800 "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 32939 "gram.c" /* yacc.c:1646 */ break; case 816: #line 5809 "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 32952 "gram.c" /* yacc.c:1646 */ break; case 817: #line 5818 "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 32965 "gram.c" /* yacc.c:1646 */ break; case 818: #line 5827 "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 32978 "gram.c" /* yacc.c:1646 */ break; case 819: #line 5836 "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); n->if_not_exists = true; (yyval.node) = (Node *)n; } #line 32992 "gram.c" /* yacc.c:1646 */ break; case 820: #line 5846 "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), (yylsp[0]))); (yyval.node) = (Node *)n; } #line 33005 "gram.c" /* yacc.c:1646 */ break; case 821: #line 5855 "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), (yylsp[0]))); n->if_not_exists = true; (yyval.node) = (Node *)n; } #line 33019 "gram.c" /* yacc.c:1646 */ break; case 822: #line 5866 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[-1].list); } #line 33025 "gram.c" /* yacc.c:1646 */ break; case 823: #line 5869 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].defelt)); } #line 33031 "gram.c" /* yacc.c:1646 */ break; case 824: #line 5870 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].defelt)); } #line 33037 "gram.c" /* yacc.c:1646 */ break; case 825: #line 5874 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem((yyvsp[-2].str), (Node *) (yyvsp[0].node), (yylsp[-2])); } #line 33045 "gram.c" /* yacc.c:1646 */ break; case 826: #line 5878 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem((yyvsp[0].str), NULL, (yylsp[0])); } #line 33053 "gram.c" /* yacc.c:1646 */ break; case 827: #line 5884 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *)(yyvsp[0].typnam); } #line 33059 "gram.c" /* yacc.c:1646 */ break; case 828: #line 5885 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *)makeString(pstrdup((yyvsp[0].keyword))); } #line 33065 "gram.c" /* yacc.c:1646 */ break; case 829: #line 5886 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *)(yyvsp[0].list); } #line 33071 "gram.c" /* yacc.c:1646 */ break; case 830: #line 5887 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *)(yyvsp[0].value); } #line 33077 "gram.c" /* yacc.c:1646 */ break; case 831: #line 5888 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *)makeString((yyvsp[0].str)); } #line 33083 "gram.c" /* yacc.c:1646 */ break; case 832: #line 5889 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *)makeString(pstrdup((yyvsp[0].keyword))); } #line 33089 "gram.c" /* yacc.c:1646 */ break; case 833: #line 5892 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[-1].list); } #line 33095 "gram.c" /* yacc.c:1646 */ break; case 834: #line 5895 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].defelt)); } #line 33101 "gram.c" /* yacc.c:1646 */ break; case 835: #line 5896 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].defelt)); } #line 33107 "gram.c" /* yacc.c:1646 */ break; case 836: #line 5905 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem((yyvsp[-2].str), (Node *)(yyvsp[0].node), (yylsp[-2])); } #line 33115 "gram.c" /* yacc.c:1646 */ break; case 837: #line 5911 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 33121 "gram.c" /* yacc.c:1646 */ break; case 838: #line 5912 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 33127 "gram.c" /* yacc.c:1646 */ break; case 839: #line 5916 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1(makeString((yyvsp[0].str))); } #line 33133 "gram.c" /* yacc.c:1646 */ break; case 840: #line 5918 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), makeString((yyvsp[0].str))); } #line 33139 "gram.c" /* yacc.c:1646 */ break; case 841: #line 5929 "gram.y" /* yacc.c:1646 */ { AlterEnumStmt *n = makeNode(AlterEnumStmt); n->typeName = (yyvsp[-4].list); n->oldVal = NULL; n->newVal = (yyvsp[0].str); n->newValNeighbor = NULL; n->newValIsAfter = true; n->skipIfNewValExists = (yyvsp[-1].boolean); (yyval.node) = (Node *) n; } #line 33154 "gram.c" /* yacc.c:1646 */ break; case 842: #line 5940 "gram.y" /* yacc.c:1646 */ { AlterEnumStmt *n = makeNode(AlterEnumStmt); n->typeName = (yyvsp[-6].list); n->oldVal = NULL; n->newVal = (yyvsp[-2].str); n->newValNeighbor = (yyvsp[0].str); n->newValIsAfter = false; n->skipIfNewValExists = (yyvsp[-3].boolean); (yyval.node) = (Node *) n; } #line 33169 "gram.c" /* yacc.c:1646 */ break; case 843: #line 5951 "gram.y" /* yacc.c:1646 */ { AlterEnumStmt *n = makeNode(AlterEnumStmt); n->typeName = (yyvsp[-6].list); n->oldVal = NULL; n->newVal = (yyvsp[-2].str); n->newValNeighbor = (yyvsp[0].str); n->newValIsAfter = true; n->skipIfNewValExists = (yyvsp[-3].boolean); (yyval.node) = (Node *) n; } #line 33184 "gram.c" /* yacc.c:1646 */ break; case 844: #line 5962 "gram.y" /* yacc.c:1646 */ { AlterEnumStmt *n = makeNode(AlterEnumStmt); n->typeName = (yyvsp[-5].list); n->oldVal = (yyvsp[-2].str); n->newVal = (yyvsp[0].str); n->newValNeighbor = NULL; n->newValIsAfter = false; n->skipIfNewValExists = false; (yyval.node) = (Node *) n; } #line 33199 "gram.c" /* yacc.c:1646 */ break; case 845: #line 5974 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = true; } #line 33205 "gram.c" /* yacc.c:1646 */ break; case 846: #line 5975 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = false; } #line 33211 "gram.c" /* yacc.c:1646 */ break; case 847: #line 5993 "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 33226 "gram.c" /* yacc.c:1646 */ break; case 848: #line 6006 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].node)); } #line 33232 "gram.c" /* yacc.c:1646 */ break; case 849: #line 6007 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].node)); } #line 33238 "gram.c" /* yacc.c:1646 */ break; case 850: #line 6012 "gram.y" /* yacc.c:1646 */ { CreateOpClassItem *n = makeNode(CreateOpClassItem); ObjectWithArgs *owa = makeNode(ObjectWithArgs); owa->objname = (yyvsp[-2].list); owa->objargs = NIL; n->itemtype = OPCLASS_ITEM_OPERATOR; n->name = owa; n->number = (yyvsp[-3].ival); n->order_family = (yyvsp[-1].list); (yyval.node) = (Node *) n; } #line 33254 "gram.c" /* yacc.c:1646 */ break; case 851: #line 6025 "gram.y" /* yacc.c:1646 */ { CreateOpClassItem *n = makeNode(CreateOpClassItem); n->itemtype = OPCLASS_ITEM_OPERATOR; n->name = (yyvsp[-2].objwithargs); n->number = (yyvsp[-3].ival); n->order_family = (yyvsp[-1].list); (yyval.node) = (Node *) n; } #line 33267 "gram.c" /* yacc.c:1646 */ break; case 852: #line 6034 "gram.y" /* yacc.c:1646 */ { CreateOpClassItem *n = makeNode(CreateOpClassItem); n->itemtype = OPCLASS_ITEM_FUNCTION; n->name = (yyvsp[0].objwithargs); n->number = (yyvsp[-1].ival); (yyval.node) = (Node *) n; } #line 33279 "gram.c" /* yacc.c:1646 */ break; case 853: #line 6042 "gram.y" /* yacc.c:1646 */ { CreateOpClassItem *n = makeNode(CreateOpClassItem); n->itemtype = OPCLASS_ITEM_FUNCTION; n->name = (yyvsp[0].objwithargs); n->number = (yyvsp[-4].ival); n->class_args = (yyvsp[-2].list); (yyval.node) = (Node *) n; } #line 33292 "gram.c" /* yacc.c:1646 */ break; case 854: #line 6051 "gram.y" /* yacc.c:1646 */ { CreateOpClassItem *n = makeNode(CreateOpClassItem); n->itemtype = OPCLASS_ITEM_STORAGETYPE; n->storedtype = (yyvsp[0].typnam); (yyval.node) = (Node *) n; } #line 33303 "gram.c" /* yacc.c:1646 */ break; case 855: #line 6059 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = true; } #line 33309 "gram.c" /* yacc.c:1646 */ break; case 856: #line 6060 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = false; } #line 33315 "gram.c" /* yacc.c:1646 */ break; case 857: #line 6063 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 33321 "gram.c" /* yacc.c:1646 */ break; case 858: #line 6064 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 33327 "gram.c" /* yacc.c:1646 */ break; case 859: #line 6067 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 33333 "gram.c" /* yacc.c:1646 */ break; case 860: #line 6068 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 33339 "gram.c" /* yacc.c:1646 */ break; case 861: #line 6069 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 33345 "gram.c" /* yacc.c:1646 */ break; case 862: #line 6073 "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 33363 "gram.c" /* yacc.c:1646 */ break; case 863: #line 6086 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = false; } #line 33369 "gram.c" /* yacc.c:1646 */ break; case 864: #line 6092 "gram.y" /* yacc.c:1646 */ { CreateOpFamilyStmt *n = makeNode(CreateOpFamilyStmt); n->opfamilyname = (yyvsp[-2].list); n->amname = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 33380 "gram.c" /* yacc.c:1646 */ break; case 865: #line 6102 "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 33393 "gram.c" /* yacc.c:1646 */ break; case 866: #line 6111 "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 33406 "gram.c" /* yacc.c:1646 */ break; case 867: #line 6122 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].node)); } #line 33412 "gram.c" /* yacc.c:1646 */ break; case 868: #line 6123 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].node)); } #line 33418 "gram.c" /* yacc.c:1646 */ break; case 869: #line 6128 "gram.y" /* yacc.c:1646 */ { CreateOpClassItem *n = makeNode(CreateOpClassItem); n->itemtype = OPCLASS_ITEM_OPERATOR; n->number = (yyvsp[-3].ival); n->class_args = (yyvsp[-1].list); (yyval.node) = (Node *) n; } #line 33430 "gram.c" /* yacc.c:1646 */ break; case 870: #line 6136 "gram.y" /* yacc.c:1646 */ { CreateOpClassItem *n = makeNode(CreateOpClassItem); n->itemtype = OPCLASS_ITEM_FUNCTION; n->number = (yyvsp[-3].ival); n->class_args = (yyvsp[-1].list); (yyval.node) = (Node *) n; } #line 33442 "gram.c" /* yacc.c:1646 */ break; case 871: #line 6148 "gram.y" /* yacc.c:1646 */ { DropStmt *n = makeNode(DropStmt); n->objects = list_make1(lcons(makeString((yyvsp[-1].str)), (yyvsp[-3].list))); n->removeType = OBJECT_OPCLASS; n->behavior = (yyvsp[0].dbehavior); n->missing_ok = false; n->concurrent = false; (yyval.node) = (Node *) n; } #line 33456 "gram.c" /* yacc.c:1646 */ break; case 872: #line 6158 "gram.y" /* yacc.c:1646 */ { DropStmt *n = makeNode(DropStmt); n->objects = list_make1(lcons(makeString((yyvsp[-1].str)), (yyvsp[-3].list))); n->removeType = OBJECT_OPCLASS; n->behavior = (yyvsp[0].dbehavior); n->missing_ok = true; n->concurrent = false; (yyval.node) = (Node *) n; } #line 33470 "gram.c" /* yacc.c:1646 */ break; case 873: #line 6171 "gram.y" /* yacc.c:1646 */ { DropStmt *n = makeNode(DropStmt); n->objects = list_make1(lcons(makeString((yyvsp[-1].str)), (yyvsp[-3].list))); n->removeType = OBJECT_OPFAMILY; n->behavior = (yyvsp[0].dbehavior); n->missing_ok = false; n->concurrent = false; (yyval.node) = (Node *) n; } #line 33484 "gram.c" /* yacc.c:1646 */ break; case 874: #line 6181 "gram.y" /* yacc.c:1646 */ { DropStmt *n = makeNode(DropStmt); n->objects = list_make1(lcons(makeString((yyvsp[-1].str)), (yyvsp[-3].list))); n->removeType = OBJECT_OPFAMILY; n->behavior = (yyvsp[0].dbehavior); n->missing_ok = true; n->concurrent = false; (yyval.node) = (Node *) n; } #line 33498 "gram.c" /* yacc.c:1646 */ break; case 875: #line 6203 "gram.y" /* yacc.c:1646 */ { DropOwnedStmt *n = makeNode(DropOwnedStmt); n->roles = (yyvsp[-1].list); n->behavior = (yyvsp[0].dbehavior); (yyval.node) = (Node *)n; } #line 33509 "gram.c" /* yacc.c:1646 */ break; case 876: #line 6213 "gram.y" /* yacc.c:1646 */ { ReassignOwnedStmt *n = makeNode(ReassignOwnedStmt); n->roles = (yyvsp[-2].list); n->newrole = (yyvsp[0].rolespec); (yyval.node) = (Node *)n; } #line 33520 "gram.c" /* yacc.c:1646 */ break; case 877: #line 6231 "gram.y" /* yacc.c:1646 */ { DropStmt *n = makeNode(DropStmt); n->removeType = (yyvsp[-4].objtype); n->missing_ok = true; n->objects = (yyvsp[-1].list); n->behavior = (yyvsp[0].dbehavior); n->concurrent = false; (yyval.node) = (Node *)n; } #line 33534 "gram.c" /* yacc.c:1646 */ break; case 878: #line 6241 "gram.y" /* yacc.c:1646 */ { DropStmt *n = makeNode(DropStmt); n->removeType = (yyvsp[-2].objtype); n->missing_ok = false; n->objects = (yyvsp[-1].list); n->behavior = (yyvsp[0].dbehavior); n->concurrent = false; (yyval.node) = (Node *)n; } #line 33548 "gram.c" /* yacc.c:1646 */ break; case 879: #line 6251 "gram.y" /* yacc.c:1646 */ { DropStmt *n = makeNode(DropStmt); n->removeType = (yyvsp[-4].objtype); n->missing_ok = true; n->objects = (yyvsp[-1].list); n->behavior = (yyvsp[0].dbehavior); n->concurrent = false; (yyval.node) = (Node *)n; } #line 33562 "gram.c" /* yacc.c:1646 */ break; case 880: #line 6261 "gram.y" /* yacc.c:1646 */ { DropStmt *n = makeNode(DropStmt); n->removeType = (yyvsp[-2].objtype); n->missing_ok = false; n->objects = (yyvsp[-1].list); n->behavior = (yyvsp[0].dbehavior); n->concurrent = false; (yyval.node) = (Node *)n; } #line 33576 "gram.c" /* yacc.c:1646 */ break; case 881: #line 6271 "gram.y" /* yacc.c:1646 */ { DropStmt *n = makeNode(DropStmt); n->removeType = (yyvsp[-4].objtype); n->objects = list_make1(lappend((yyvsp[-1].list), makeString((yyvsp[-3].str)))); n->behavior = (yyvsp[0].dbehavior); n->missing_ok = false; n->concurrent = false; (yyval.node) = (Node *) n; } #line 33590 "gram.c" /* yacc.c:1646 */ break; case 882: #line 6281 "gram.y" /* yacc.c:1646 */ { DropStmt *n = makeNode(DropStmt); n->removeType = (yyvsp[-6].objtype); n->objects = list_make1(lappend((yyvsp[-1].list), makeString((yyvsp[-3].str)))); n->behavior = (yyvsp[0].dbehavior); n->missing_ok = true; n->concurrent = false; (yyval.node) = (Node *) n; } #line 33604 "gram.c" /* yacc.c:1646 */ break; case 883: #line 6291 "gram.y" /* yacc.c:1646 */ { DropStmt *n = makeNode(DropStmt); n->removeType = OBJECT_TYPE; n->missing_ok = false; n->objects = (yyvsp[-1].list); n->behavior = (yyvsp[0].dbehavior); n->concurrent = false; (yyval.node) = (Node *) n; } #line 33618 "gram.c" /* yacc.c:1646 */ break; case 884: #line 6301 "gram.y" /* yacc.c:1646 */ { DropStmt *n = makeNode(DropStmt); n->removeType = OBJECT_TYPE; n->missing_ok = true; n->objects = (yyvsp[-1].list); n->behavior = (yyvsp[0].dbehavior); n->concurrent = false; (yyval.node) = (Node *) n; } #line 33632 "gram.c" /* yacc.c:1646 */ break; case 885: #line 6311 "gram.y" /* yacc.c:1646 */ { DropStmt *n = makeNode(DropStmt); n->removeType = OBJECT_DOMAIN; n->missing_ok = false; n->objects = (yyvsp[-1].list); n->behavior = (yyvsp[0].dbehavior); n->concurrent = false; (yyval.node) = (Node *) n; } #line 33646 "gram.c" /* yacc.c:1646 */ break; case 886: #line 6321 "gram.y" /* yacc.c:1646 */ { DropStmt *n = makeNode(DropStmt); n->removeType = OBJECT_DOMAIN; n->missing_ok = true; n->objects = (yyvsp[-1].list); n->behavior = (yyvsp[0].dbehavior); n->concurrent = false; (yyval.node) = (Node *) n; } #line 33660 "gram.c" /* yacc.c:1646 */ break; case 887: #line 6331 "gram.y" /* yacc.c:1646 */ { DropStmt *n = makeNode(DropStmt); n->removeType = OBJECT_INDEX; n->missing_ok = false; n->objects = (yyvsp[-1].list); n->behavior = (yyvsp[0].dbehavior); n->concurrent = true; (yyval.node) = (Node *)n; } #line 33674 "gram.c" /* yacc.c:1646 */ break; case 888: #line 6341 "gram.y" /* yacc.c:1646 */ { DropStmt *n = makeNode(DropStmt); n->removeType = OBJECT_INDEX; n->missing_ok = true; n->objects = (yyvsp[-1].list); n->behavior = (yyvsp[0].dbehavior); n->concurrent = true; (yyval.node) = (Node *)n; } #line 33688 "gram.c" /* yacc.c:1646 */ break; case 889: #line 6354 "gram.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_TABLE; } #line 33694 "gram.c" /* yacc.c:1646 */ break; case 890: #line 6355 "gram.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_SEQUENCE; } #line 33700 "gram.c" /* yacc.c:1646 */ break; case 891: #line 6356 "gram.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_VIEW; } #line 33706 "gram.c" /* yacc.c:1646 */ break; case 892: #line 6357 "gram.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_MATVIEW; } #line 33712 "gram.c" /* yacc.c:1646 */ break; case 893: #line 6358 "gram.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_INDEX; } #line 33718 "gram.c" /* yacc.c:1646 */ break; case 894: #line 6359 "gram.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_FOREIGN_TABLE; } #line 33724 "gram.c" /* yacc.c:1646 */ break; case 895: #line 6360 "gram.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_COLLATION; } #line 33730 "gram.c" /* yacc.c:1646 */ break; case 896: #line 6361 "gram.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_CONVERSION; } #line 33736 "gram.c" /* yacc.c:1646 */ break; case 897: #line 6362 "gram.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_STATISTIC_EXT; } #line 33742 "gram.c" /* yacc.c:1646 */ break; case 898: #line 6363 "gram.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_TSPARSER; } #line 33748 "gram.c" /* yacc.c:1646 */ break; case 899: #line 6364 "gram.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_TSDICTIONARY; } #line 33754 "gram.c" /* yacc.c:1646 */ break; case 900: #line 6365 "gram.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_TSTEMPLATE; } #line 33760 "gram.c" /* yacc.c:1646 */ break; case 901: #line 6366 "gram.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_TSCONFIGURATION; } #line 33766 "gram.c" /* yacc.c:1646 */ break; case 902: #line 6371 "gram.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_ACCESS_METHOD; } #line 33772 "gram.c" /* yacc.c:1646 */ break; case 903: #line 6372 "gram.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_EVENT_TRIGGER; } #line 33778 "gram.c" /* yacc.c:1646 */ break; case 904: #line 6373 "gram.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_EXTENSION; } #line 33784 "gram.c" /* yacc.c:1646 */ break; case 905: #line 6374 "gram.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_FDW; } #line 33790 "gram.c" /* yacc.c:1646 */ break; case 906: #line 6375 "gram.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_PUBLICATION; } #line 33796 "gram.c" /* yacc.c:1646 */ break; case 907: #line 6376 "gram.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_SCHEMA; } #line 33802 "gram.c" /* yacc.c:1646 */ break; case 908: #line 6377 "gram.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_FOREIGN_SERVER; } #line 33808 "gram.c" /* yacc.c:1646 */ break; case 909: #line 6382 "gram.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_POLICY; } #line 33814 "gram.c" /* yacc.c:1646 */ break; case 910: #line 6383 "gram.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_RULE; } #line 33820 "gram.c" /* yacc.c:1646 */ break; case 911: #line 6384 "gram.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_TRIGGER; } #line 33826 "gram.c" /* yacc.c:1646 */ break; case 912: #line 6388 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].list)); } #line 33832 "gram.c" /* yacc.c:1646 */ break; case 913: #line 6389 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].list)); } #line 33838 "gram.c" /* yacc.c:1646 */ break; case 914: #line 6392 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1(makeString((yyvsp[0].str))); } #line 33844 "gram.c" /* yacc.c:1646 */ break; case 915: #line 6393 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lcons(makeString((yyvsp[-1].str)), (yyvsp[0].list)); } #line 33850 "gram.c" /* yacc.c:1646 */ break; case 916: #line 6397 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1(makeString((yyvsp[0].str))); } #line 33856 "gram.c" /* yacc.c:1646 */ break; case 917: #line 6399 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), makeString((yyvsp[0].str))); } #line 33862 "gram.c" /* yacc.c:1646 */ break; case 918: #line 6403 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].typnam)); } #line 33868 "gram.c" /* yacc.c:1646 */ break; case 919: #line 6404 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].typnam)); } #line 33874 "gram.c" /* yacc.c:1646 */ break; case 920: #line 6416 "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 33886 "gram.c" /* yacc.c:1646 */ break; case 921: #line 6426 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = false; } #line 33892 "gram.c" /* yacc.c:1646 */ break; case 922: #line 6427 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = true; } #line 33898 "gram.c" /* yacc.c:1646 */ break; case 923: #line 6428 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = false; } #line 33904 "gram.c" /* yacc.c:1646 */ break; case 924: #line 6463 "gram.y" /* yacc.c:1646 */ { CommentStmt *n = makeNode(CommentStmt); n->objtype = (yyvsp[-3].objtype); n->object = (Node *) (yyvsp[-2].list); n->comment = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 33916 "gram.c" /* yacc.c:1646 */ break; case 925: #line 6471 "gram.y" /* yacc.c:1646 */ { CommentStmt *n = makeNode(CommentStmt); n->objtype = (yyvsp[-3].objtype); n->object = (Node *) makeString((yyvsp[-2].str)); n->comment = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 33928 "gram.c" /* yacc.c:1646 */ break; case 926: #line 6479 "gram.y" /* yacc.c:1646 */ { CommentStmt *n = makeNode(CommentStmt); n->objtype = OBJECT_TYPE; n->object = (Node *) (yyvsp[-2].typnam); n->comment = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 33940 "gram.c" /* yacc.c:1646 */ break; case 927: #line 6487 "gram.y" /* yacc.c:1646 */ { CommentStmt *n = makeNode(CommentStmt); n->objtype = OBJECT_DOMAIN; n->object = (Node *) (yyvsp[-2].typnam); n->comment = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 33952 "gram.c" /* yacc.c:1646 */ break; case 928: #line 6495 "gram.y" /* yacc.c:1646 */ { CommentStmt *n = makeNode(CommentStmt); n->objtype = OBJECT_AGGREGATE; n->object = (Node *) (yyvsp[-2].objwithargs); n->comment = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 33964 "gram.c" /* yacc.c:1646 */ break; case 929: #line 6503 "gram.y" /* yacc.c:1646 */ { CommentStmt *n = makeNode(CommentStmt); n->objtype = OBJECT_FUNCTION; n->object = (Node *) (yyvsp[-2].objwithargs); n->comment = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 33976 "gram.c" /* yacc.c:1646 */ break; case 930: #line 6511 "gram.y" /* yacc.c:1646 */ { CommentStmt *n = makeNode(CommentStmt); n->objtype = OBJECT_OPERATOR; n->object = (Node *) (yyvsp[-2].objwithargs); n->comment = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 33988 "gram.c" /* yacc.c:1646 */ break; case 931: #line 6519 "gram.y" /* yacc.c:1646 */ { CommentStmt *n = makeNode(CommentStmt); n->objtype = OBJECT_TABCONSTRAINT; n->object = (Node *) lappend((yyvsp[-2].list), makeString((yyvsp[-4].str))); n->comment = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 34000 "gram.c" /* yacc.c:1646 */ break; case 932: #line 6527 "gram.y" /* yacc.c:1646 */ { CommentStmt *n = makeNode(CommentStmt); n->objtype = OBJECT_DOMCONSTRAINT; /* * should use Typename not any_name in the production, but * there's a shift/reduce conflict if we do that, so fix it * up here. */ n->object = (Node *) list_make2(makeTypeNameFromNameList((yyvsp[-2].list)), makeString((yyvsp[-5].str))); n->comment = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 34017 "gram.c" /* yacc.c:1646 */ break; case 933: #line 6540 "gram.y" /* yacc.c:1646 */ { CommentStmt *n = makeNode(CommentStmt); n->objtype = OBJECT_POLICY; n->object = (Node *) lappend((yyvsp[-2].list), makeString((yyvsp[-4].str))); n->comment = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 34029 "gram.c" /* yacc.c:1646 */ break; case 934: #line 6548 "gram.y" /* yacc.c:1646 */ { CommentStmt *n = makeNode(CommentStmt); n->objtype = OBJECT_PROCEDURE; n->object = (Node *) (yyvsp[-2].objwithargs); n->comment = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 34041 "gram.c" /* yacc.c:1646 */ break; case 935: #line 6556 "gram.y" /* yacc.c:1646 */ { CommentStmt *n = makeNode(CommentStmt); n->objtype = OBJECT_ROUTINE; n->object = (Node *) (yyvsp[-2].objwithargs); n->comment = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 34053 "gram.c" /* yacc.c:1646 */ break; case 936: #line 6564 "gram.y" /* yacc.c:1646 */ { CommentStmt *n = makeNode(CommentStmt); n->objtype = OBJECT_RULE; n->object = (Node *) lappend((yyvsp[-2].list), makeString((yyvsp[-4].str))); n->comment = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 34065 "gram.c" /* yacc.c:1646 */ break; case 937: #line 6572 "gram.y" /* yacc.c:1646 */ { CommentStmt *n = makeNode(CommentStmt); n->objtype = OBJECT_TRANSFORM; n->object = (Node *) list_make2((yyvsp[-4].typnam), makeString((yyvsp[-2].str))); n->comment = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 34077 "gram.c" /* yacc.c:1646 */ break; case 938: #line 6580 "gram.y" /* yacc.c:1646 */ { CommentStmt *n = makeNode(CommentStmt); n->objtype = OBJECT_TRIGGER; n->object = (Node *) lappend((yyvsp[-2].list), makeString((yyvsp[-4].str))); n->comment = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 34089 "gram.c" /* yacc.c:1646 */ break; case 939: #line 6588 "gram.y" /* yacc.c:1646 */ { CommentStmt *n = makeNode(CommentStmt); n->objtype = OBJECT_OPCLASS; n->object = (Node *) lcons(makeString((yyvsp[-2].str)), (yyvsp[-4].list)); n->comment = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 34101 "gram.c" /* yacc.c:1646 */ break; case 940: #line 6596 "gram.y" /* yacc.c:1646 */ { CommentStmt *n = makeNode(CommentStmt); n->objtype = OBJECT_OPFAMILY; n->object = (Node *) lcons(makeString((yyvsp[-2].str)), (yyvsp[-4].list)); n->comment = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 34113 "gram.c" /* yacc.c:1646 */ break; case 941: #line 6604 "gram.y" /* yacc.c:1646 */ { CommentStmt *n = makeNode(CommentStmt); n->objtype = OBJECT_LARGEOBJECT; n->object = (Node *) (yyvsp[-2].value); n->comment = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 34125 "gram.c" /* yacc.c:1646 */ break; case 942: #line 6612 "gram.y" /* yacc.c:1646 */ { CommentStmt *n = makeNode(CommentStmt); n->objtype = OBJECT_CAST; n->object = (Node *) list_make2((yyvsp[-5].typnam), (yyvsp[-3].typnam)); n->comment = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 34137 "gram.c" /* yacc.c:1646 */ break; case 943: #line 6623 "gram.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_COLUMN; } #line 34143 "gram.c" /* yacc.c:1646 */ break; case 944: #line 6624 "gram.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_INDEX; } #line 34149 "gram.c" /* yacc.c:1646 */ break; case 945: #line 6625 "gram.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_SEQUENCE; } #line 34155 "gram.c" /* yacc.c:1646 */ break; case 946: #line 6626 "gram.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_STATISTIC_EXT; } #line 34161 "gram.c" /* yacc.c:1646 */ break; case 947: #line 6627 "gram.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_TABLE; } #line 34167 "gram.c" /* yacc.c:1646 */ break; case 948: #line 6628 "gram.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_VIEW; } #line 34173 "gram.c" /* yacc.c:1646 */ break; case 949: #line 6629 "gram.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_MATVIEW; } #line 34179 "gram.c" /* yacc.c:1646 */ break; case 950: #line 6630 "gram.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_COLLATION; } #line 34185 "gram.c" /* yacc.c:1646 */ break; case 951: #line 6631 "gram.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_CONVERSION; } #line 34191 "gram.c" /* yacc.c:1646 */ break; case 952: #line 6632 "gram.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_FOREIGN_TABLE; } #line 34197 "gram.c" /* yacc.c:1646 */ break; case 953: #line 6633 "gram.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_TSCONFIGURATION; } #line 34203 "gram.c" /* yacc.c:1646 */ break; case 954: #line 6634 "gram.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_TSDICTIONARY; } #line 34209 "gram.c" /* yacc.c:1646 */ break; case 955: #line 6635 "gram.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_TSPARSER; } #line 34215 "gram.c" /* yacc.c:1646 */ break; case 956: #line 6636 "gram.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_TSTEMPLATE; } #line 34221 "gram.c" /* yacc.c:1646 */ break; case 957: #line 6641 "gram.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_ACCESS_METHOD; } #line 34227 "gram.c" /* yacc.c:1646 */ break; case 958: #line 6642 "gram.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_DATABASE; } #line 34233 "gram.c" /* yacc.c:1646 */ break; case 959: #line 6643 "gram.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_EVENT_TRIGGER; } #line 34239 "gram.c" /* yacc.c:1646 */ break; case 960: #line 6644 "gram.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_EXTENSION; } #line 34245 "gram.c" /* yacc.c:1646 */ break; case 961: #line 6645 "gram.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_FDW; } #line 34251 "gram.c" /* yacc.c:1646 */ break; case 962: #line 6646 "gram.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_LANGUAGE; } #line 34257 "gram.c" /* yacc.c:1646 */ break; case 963: #line 6647 "gram.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_PUBLICATION; } #line 34263 "gram.c" /* yacc.c:1646 */ break; case 964: #line 6648 "gram.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_ROLE; } #line 34269 "gram.c" /* yacc.c:1646 */ break; case 965: #line 6649 "gram.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_SCHEMA; } #line 34275 "gram.c" /* yacc.c:1646 */ break; case 966: #line 6650 "gram.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_FOREIGN_SERVER; } #line 34281 "gram.c" /* yacc.c:1646 */ break; case 967: #line 6651 "gram.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_SUBSCRIPTION; } #line 34287 "gram.c" /* yacc.c:1646 */ break; case 968: #line 6652 "gram.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_TABLESPACE; } #line 34293 "gram.c" /* yacc.c:1646 */ break; case 969: #line 6656 "gram.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 34299 "gram.c" /* yacc.c:1646 */ break; case 970: #line 6657 "gram.y" /* yacc.c:1646 */ { (yyval.str) = NULL; } #line 34305 "gram.c" /* yacc.c:1646 */ break; case 971: #line 6673 "gram.y" /* yacc.c:1646 */ { SecLabelStmt *n = makeNode(SecLabelStmt); n->provider = (yyvsp[-5].str); n->objtype = (yyvsp[-3].objtype); n->object = (Node *) (yyvsp[-2].list); n->label = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 34318 "gram.c" /* yacc.c:1646 */ break; case 972: #line 6683 "gram.y" /* yacc.c:1646 */ { SecLabelStmt *n = makeNode(SecLabelStmt); n->provider = (yyvsp[-5].str); n->objtype = (yyvsp[-3].objtype); n->object = (Node *) makeString((yyvsp[-2].str)); n->label = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 34331 "gram.c" /* yacc.c:1646 */ break; case 973: #line 6693 "gram.y" /* yacc.c:1646 */ { SecLabelStmt *n = makeNode(SecLabelStmt); n->provider = (yyvsp[-5].str); n->objtype = OBJECT_TYPE; n->object = (Node *) (yyvsp[-2].typnam); n->label = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 34344 "gram.c" /* yacc.c:1646 */ break; case 974: #line 6703 "gram.y" /* yacc.c:1646 */ { SecLabelStmt *n = makeNode(SecLabelStmt); n->provider = (yyvsp[-5].str); n->objtype = OBJECT_DOMAIN; n->object = (Node *) (yyvsp[-2].typnam); n->label = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 34357 "gram.c" /* yacc.c:1646 */ break; case 975: #line 6713 "gram.y" /* yacc.c:1646 */ { SecLabelStmt *n = makeNode(SecLabelStmt); n->provider = (yyvsp[-5].str); n->objtype = OBJECT_AGGREGATE; n->object = (Node *) (yyvsp[-2].objwithargs); n->label = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 34370 "gram.c" /* yacc.c:1646 */ break; case 976: #line 6723 "gram.y" /* yacc.c:1646 */ { SecLabelStmt *n = makeNode(SecLabelStmt); n->provider = (yyvsp[-5].str); n->objtype = OBJECT_FUNCTION; n->object = (Node *) (yyvsp[-2].objwithargs); n->label = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 34383 "gram.c" /* yacc.c:1646 */ break; case 977: #line 6733 "gram.y" /* yacc.c:1646 */ { SecLabelStmt *n = makeNode(SecLabelStmt); n->provider = (yyvsp[-6].str); n->objtype = OBJECT_LARGEOBJECT; n->object = (Node *) (yyvsp[-2].value); n->label = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 34396 "gram.c" /* yacc.c:1646 */ break; case 978: #line 6743 "gram.y" /* yacc.c:1646 */ { SecLabelStmt *n = makeNode(SecLabelStmt); n->provider = (yyvsp[-5].str); n->objtype = OBJECT_PROCEDURE; n->object = (Node *) (yyvsp[-2].objwithargs); n->label = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 34409 "gram.c" /* yacc.c:1646 */ break; case 979: #line 6753 "gram.y" /* yacc.c:1646 */ { SecLabelStmt *n = makeNode(SecLabelStmt); n->provider = (yyvsp[-5].str); n->objtype = OBJECT_ROUTINE; n->object = (Node *) (yyvsp[-2].objwithargs); n->label = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 34422 "gram.c" /* yacc.c:1646 */ break; case 980: #line 6763 "gram.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 34428 "gram.c" /* yacc.c:1646 */ break; case 981: #line 6764 "gram.y" /* yacc.c:1646 */ { (yyval.str) = NULL; } #line 34434 "gram.c" /* yacc.c:1646 */ break; case 982: #line 6769 "gram.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_COLUMN; } #line 34440 "gram.c" /* yacc.c:1646 */ break; case 983: #line 6770 "gram.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_FOREIGN_TABLE; } #line 34446 "gram.c" /* yacc.c:1646 */ break; case 984: #line 6771 "gram.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_SEQUENCE; } #line 34452 "gram.c" /* yacc.c:1646 */ break; case 985: #line 6772 "gram.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_TABLE; } #line 34458 "gram.c" /* yacc.c:1646 */ break; case 986: #line 6773 "gram.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_VIEW; } #line 34464 "gram.c" /* yacc.c:1646 */ break; case 987: #line 6774 "gram.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_MATVIEW; } #line 34470 "gram.c" /* yacc.c:1646 */ break; case 988: #line 6779 "gram.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_DATABASE; } #line 34476 "gram.c" /* yacc.c:1646 */ break; case 989: #line 6780 "gram.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_EVENT_TRIGGER; } #line 34482 "gram.c" /* yacc.c:1646 */ break; case 990: #line 6781 "gram.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_LANGUAGE; } #line 34488 "gram.c" /* yacc.c:1646 */ break; case 991: #line 6782 "gram.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_PUBLICATION; } #line 34494 "gram.c" /* yacc.c:1646 */ break; case 992: #line 6783 "gram.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_ROLE; } #line 34500 "gram.c" /* yacc.c:1646 */ break; case 993: #line 6784 "gram.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_SCHEMA; } #line 34506 "gram.c" /* yacc.c:1646 */ break; case 994: #line 6785 "gram.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_SUBSCRIPTION; } #line 34512 "gram.c" /* yacc.c:1646 */ break; case 995: #line 6786 "gram.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_TABLESPACE; } #line 34518 "gram.c" /* yacc.c:1646 */ break; case 996: #line 6789 "gram.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 34524 "gram.c" /* yacc.c:1646 */ break; case 997: #line 6790 "gram.y" /* yacc.c:1646 */ { (yyval.str) = NULL; } #line 34530 "gram.c" /* yacc.c:1646 */ break; case 998: #line 6801 "gram.y" /* yacc.c:1646 */ { FetchStmt *n = (FetchStmt *) (yyvsp[0].node); n->ismove = false; (yyval.node) = (Node *)n; } #line 34540 "gram.c" /* yacc.c:1646 */ break; case 999: #line 6807 "gram.y" /* yacc.c:1646 */ { FetchStmt *n = (FetchStmt *) (yyvsp[0].node); n->ismove = true; (yyval.node) = (Node *)n; } #line 34550 "gram.c" /* yacc.c:1646 */ break; case 1000: #line 6815 "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 34562 "gram.c" /* yacc.c:1646 */ break; case 1001: #line 6823 "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 34574 "gram.c" /* yacc.c:1646 */ break; case 1002: #line 6831 "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 34586 "gram.c" /* yacc.c:1646 */ break; case 1003: #line 6839 "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 34598 "gram.c" /* yacc.c:1646 */ break; case 1004: #line 6847 "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 34610 "gram.c" /* yacc.c:1646 */ break; case 1005: #line 6855 "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 34622 "gram.c" /* yacc.c:1646 */ break; case 1006: #line 6863 "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 34634 "gram.c" /* yacc.c:1646 */ break; case 1007: #line 6871 "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 34646 "gram.c" /* yacc.c:1646 */ break; case 1008: #line 6879 "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 34658 "gram.c" /* yacc.c:1646 */ break; case 1009: #line 6887 "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 34670 "gram.c" /* yacc.c:1646 */ break; case 1010: #line 6895 "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 34682 "gram.c" /* yacc.c:1646 */ break; case 1011: #line 6903 "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 34694 "gram.c" /* yacc.c:1646 */ break; case 1012: #line 6911 "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 34706 "gram.c" /* yacc.c:1646 */ break; case 1013: #line 6919 "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 34718 "gram.c" /* yacc.c:1646 */ break; case 1014: #line 6927 "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 34730 "gram.c" /* yacc.c:1646 */ break; case 1015: #line 6935 "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 34742 "gram.c" /* yacc.c:1646 */ break; case 1016: #line 6944 "gram.y" /* yacc.c:1646 */ {} #line 34748 "gram.c" /* yacc.c:1646 */ break; case 1017: #line 6945 "gram.y" /* yacc.c:1646 */ {} #line 34754 "gram.c" /* yacc.c:1646 */ break; case 1018: #line 6948 "gram.y" /* yacc.c:1646 */ {} #line 34760 "gram.c" /* yacc.c:1646 */ break; case 1019: #line 6949 "gram.y" /* yacc.c:1646 */ {} #line 34766 "gram.c" /* yacc.c:1646 */ break; case 1020: #line 6961 "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 34782 "gram.c" /* yacc.c:1646 */ break; case 1021: #line 6977 "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 34799 "gram.c" /* yacc.c:1646 */ break; case 1022: #line 6991 "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 34816 "gram.c" /* yacc.c:1646 */ break; case 1023: #line 7016 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 34822 "gram.c" /* yacc.c:1646 */ break; case 1024: #line 7018 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 34828 "gram.c" /* yacc.c:1646 */ break; case 1025: #line 7020 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 34834 "gram.c" /* yacc.c:1646 */ break; case 1026: #line 7022 "gram.y" /* yacc.c:1646 */ { AccessPriv *n = makeNode(AccessPriv); n->priv_name = NULL; n->cols = (yyvsp[-1].list); (yyval.list) = list_make1(n); } #line 34845 "gram.c" /* yacc.c:1646 */ break; case 1027: #line 7029 "gram.y" /* yacc.c:1646 */ { AccessPriv *n = makeNode(AccessPriv); n->priv_name = NULL; n->cols = (yyvsp[-1].list); (yyval.list) = list_make1(n); } #line 34856 "gram.c" /* yacc.c:1646 */ break; case 1028: #line 7037 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].accesspriv)); } #line 34862 "gram.c" /* yacc.c:1646 */ break; case 1029: #line 7038 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].accesspriv)); } #line 34868 "gram.c" /* yacc.c:1646 */ break; case 1030: #line 7042 "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 34879 "gram.c" /* yacc.c:1646 */ break; case 1031: #line 7049 "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 34890 "gram.c" /* yacc.c:1646 */ break; case 1032: #line 7056 "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 34901 "gram.c" /* yacc.c:1646 */ break; case 1033: #line 7063 "gram.y" /* yacc.c:1646 */ { AccessPriv *n = makeNode(AccessPriv); n->priv_name = (yyvsp[-1].str); n->cols = (yyvsp[0].list); (yyval.accesspriv) = n; } #line 34912 "gram.c" /* yacc.c:1646 */ break; case 1034: #line 7077 "gram.y" /* yacc.c:1646 */ { PrivTarget *n = (PrivTarget *) palloc(sizeof(PrivTarget)); n->targtype = ACL_TARGET_OBJECT; n->objtype = OBJECT_TABLE; n->objs = (yyvsp[0].list); (yyval.privtarget) = n; } #line 34924 "gram.c" /* yacc.c:1646 */ break; case 1035: #line 7085 "gram.y" /* yacc.c:1646 */ { PrivTarget *n = (PrivTarget *) palloc(sizeof(PrivTarget)); n->targtype = ACL_TARGET_OBJECT; n->objtype = OBJECT_TABLE; n->objs = (yyvsp[0].list); (yyval.privtarget) = n; } #line 34936 "gram.c" /* yacc.c:1646 */ break; case 1036: #line 7093 "gram.y" /* yacc.c:1646 */ { PrivTarget *n = (PrivTarget *) palloc(sizeof(PrivTarget)); n->targtype = ACL_TARGET_OBJECT; n->objtype = OBJECT_SEQUENCE; n->objs = (yyvsp[0].list); (yyval.privtarget) = n; } #line 34948 "gram.c" /* yacc.c:1646 */ break; case 1037: #line 7101 "gram.y" /* yacc.c:1646 */ { PrivTarget *n = (PrivTarget *) palloc(sizeof(PrivTarget)); n->targtype = ACL_TARGET_OBJECT; n->objtype = OBJECT_FDW; n->objs = (yyvsp[0].list); (yyval.privtarget) = n; } #line 34960 "gram.c" /* yacc.c:1646 */ break; case 1038: #line 7109 "gram.y" /* yacc.c:1646 */ { PrivTarget *n = (PrivTarget *) palloc(sizeof(PrivTarget)); n->targtype = ACL_TARGET_OBJECT; n->objtype = OBJECT_FOREIGN_SERVER; n->objs = (yyvsp[0].list); (yyval.privtarget) = n; } #line 34972 "gram.c" /* yacc.c:1646 */ break; case 1039: #line 7117 "gram.y" /* yacc.c:1646 */ { PrivTarget *n = (PrivTarget *) palloc(sizeof(PrivTarget)); n->targtype = ACL_TARGET_OBJECT; n->objtype = OBJECT_FUNCTION; n->objs = (yyvsp[0].list); (yyval.privtarget) = n; } #line 34984 "gram.c" /* yacc.c:1646 */ break; case 1040: #line 7125 "gram.y" /* yacc.c:1646 */ { PrivTarget *n = (PrivTarget *) palloc(sizeof(PrivTarget)); n->targtype = ACL_TARGET_OBJECT; n->objtype = OBJECT_PROCEDURE; n->objs = (yyvsp[0].list); (yyval.privtarget) = n; } #line 34996 "gram.c" /* yacc.c:1646 */ break; case 1041: #line 7133 "gram.y" /* yacc.c:1646 */ { PrivTarget *n = (PrivTarget *) palloc(sizeof(PrivTarget)); n->targtype = ACL_TARGET_OBJECT; n->objtype = OBJECT_ROUTINE; n->objs = (yyvsp[0].list); (yyval.privtarget) = n; } #line 35008 "gram.c" /* yacc.c:1646 */ break; case 1042: #line 7141 "gram.y" /* yacc.c:1646 */ { PrivTarget *n = (PrivTarget *) palloc(sizeof(PrivTarget)); n->targtype = ACL_TARGET_OBJECT; n->objtype = OBJECT_DATABASE; n->objs = (yyvsp[0].list); (yyval.privtarget) = n; } #line 35020 "gram.c" /* yacc.c:1646 */ break; case 1043: #line 7149 "gram.y" /* yacc.c:1646 */ { PrivTarget *n = (PrivTarget *) palloc(sizeof(PrivTarget)); n->targtype = ACL_TARGET_OBJECT; n->objtype = OBJECT_DOMAIN; n->objs = (yyvsp[0].list); (yyval.privtarget) = n; } #line 35032 "gram.c" /* yacc.c:1646 */ break; case 1044: #line 7157 "gram.y" /* yacc.c:1646 */ { PrivTarget *n = (PrivTarget *) palloc(sizeof(PrivTarget)); n->targtype = ACL_TARGET_OBJECT; n->objtype = OBJECT_LANGUAGE; n->objs = (yyvsp[0].list); (yyval.privtarget) = n; } #line 35044 "gram.c" /* yacc.c:1646 */ break; case 1045: #line 7165 "gram.y" /* yacc.c:1646 */ { PrivTarget *n = (PrivTarget *) palloc(sizeof(PrivTarget)); n->targtype = ACL_TARGET_OBJECT; n->objtype = OBJECT_LARGEOBJECT; n->objs = (yyvsp[0].list); (yyval.privtarget) = n; } #line 35056 "gram.c" /* yacc.c:1646 */ break; case 1046: #line 7173 "gram.y" /* yacc.c:1646 */ { PrivTarget *n = (PrivTarget *) palloc(sizeof(PrivTarget)); n->targtype = ACL_TARGET_OBJECT; n->objtype = OBJECT_SCHEMA; n->objs = (yyvsp[0].list); (yyval.privtarget) = n; } #line 35068 "gram.c" /* yacc.c:1646 */ break; case 1047: #line 7181 "gram.y" /* yacc.c:1646 */ { PrivTarget *n = (PrivTarget *) palloc(sizeof(PrivTarget)); n->targtype = ACL_TARGET_OBJECT; n->objtype = OBJECT_TABLESPACE; n->objs = (yyvsp[0].list); (yyval.privtarget) = n; } #line 35080 "gram.c" /* yacc.c:1646 */ break; case 1048: #line 7189 "gram.y" /* yacc.c:1646 */ { PrivTarget *n = (PrivTarget *) palloc(sizeof(PrivTarget)); n->targtype = ACL_TARGET_OBJECT; n->objtype = OBJECT_TYPE; n->objs = (yyvsp[0].list); (yyval.privtarget) = n; } #line 35092 "gram.c" /* yacc.c:1646 */ break; case 1049: #line 7197 "gram.y" /* yacc.c:1646 */ { PrivTarget *n = (PrivTarget *) palloc(sizeof(PrivTarget)); n->targtype = ACL_TARGET_ALL_IN_SCHEMA; n->objtype = OBJECT_TABLE; n->objs = (yyvsp[0].list); (yyval.privtarget) = n; } #line 35104 "gram.c" /* yacc.c:1646 */ break; case 1050: #line 7205 "gram.y" /* yacc.c:1646 */ { PrivTarget *n = (PrivTarget *) palloc(sizeof(PrivTarget)); n->targtype = ACL_TARGET_ALL_IN_SCHEMA; n->objtype = OBJECT_SEQUENCE; n->objs = (yyvsp[0].list); (yyval.privtarget) = n; } #line 35116 "gram.c" /* yacc.c:1646 */ break; case 1051: #line 7213 "gram.y" /* yacc.c:1646 */ { PrivTarget *n = (PrivTarget *) palloc(sizeof(PrivTarget)); n->targtype = ACL_TARGET_ALL_IN_SCHEMA; n->objtype = OBJECT_FUNCTION; n->objs = (yyvsp[0].list); (yyval.privtarget) = n; } #line 35128 "gram.c" /* yacc.c:1646 */ break; case 1052: #line 7221 "gram.y" /* yacc.c:1646 */ { PrivTarget *n = (PrivTarget *) palloc(sizeof(PrivTarget)); n->targtype = ACL_TARGET_ALL_IN_SCHEMA; n->objtype = OBJECT_PROCEDURE; n->objs = (yyvsp[0].list); (yyval.privtarget) = n; } #line 35140 "gram.c" /* yacc.c:1646 */ break; case 1053: #line 7229 "gram.y" /* yacc.c:1646 */ { PrivTarget *n = (PrivTarget *) palloc(sizeof(PrivTarget)); n->targtype = ACL_TARGET_ALL_IN_SCHEMA; n->objtype = OBJECT_ROUTINE; n->objs = (yyvsp[0].list); (yyval.privtarget) = n; } #line 35152 "gram.c" /* yacc.c:1646 */ break; case 1054: #line 7240 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].rolespec)); } #line 35158 "gram.c" /* yacc.c:1646 */ break; case 1055: #line 7241 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].rolespec)); } #line 35164 "gram.c" /* yacc.c:1646 */ break; case 1056: #line 7245 "gram.y" /* yacc.c:1646 */ { (yyval.rolespec) = (yyvsp[0].rolespec); } #line 35170 "gram.c" /* yacc.c:1646 */ break; case 1057: #line 7246 "gram.y" /* yacc.c:1646 */ { (yyval.rolespec) = (yyvsp[0].rolespec); } #line 35176 "gram.c" /* yacc.c:1646 */ break; case 1058: #line 7251 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = true; } #line 35182 "gram.c" /* yacc.c:1646 */ break; case 1059: #line 7252 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = false; } #line 35188 "gram.c" /* yacc.c:1646 */ break; case 1060: #line 7263 "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].rolespec); (yyval.node) = (Node*)n; } #line 35202 "gram.c" /* yacc.c:1646 */ break; case 1061: #line 7276 "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 35216 "gram.c" /* yacc.c:1646 */ break; case 1062: #line 7286 "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 35230 "gram.c" /* yacc.c:1646 */ break; case 1063: #line 7297 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = true; } #line 35236 "gram.c" /* yacc.c:1646 */ break; case 1064: #line 7298 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = false; } #line 35242 "gram.c" /* yacc.c:1646 */ break; case 1065: #line 7301 "gram.y" /* yacc.c:1646 */ { (yyval.rolespec) = (yyvsp[0].rolespec); } #line 35248 "gram.c" /* yacc.c:1646 */ break; case 1066: #line 7302 "gram.y" /* yacc.c:1646 */ { (yyval.rolespec) = NULL; } #line 35254 "gram.c" /* yacc.c:1646 */ break; case 1067: #line 7313 "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 35265 "gram.c" /* yacc.c:1646 */ break; case 1068: #line 7322 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-1].list), (yyvsp[0].defelt)); } #line 35271 "gram.c" /* yacc.c:1646 */ break; case 1069: #line 7323 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 35277 "gram.c" /* yacc.c:1646 */ break; case 1070: #line 7328 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("schemas", (Node *)(yyvsp[0].list), (yylsp[-2])); } #line 35285 "gram.c" /* yacc.c:1646 */ break; case 1071: #line 7332 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("roles", (Node *)(yyvsp[0].list), (yylsp[-2])); } #line 35293 "gram.c" /* yacc.c:1646 */ break; case 1072: #line 7336 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("roles", (Node *)(yyvsp[0].list), (yylsp[-2])); } #line 35301 "gram.c" /* yacc.c:1646 */ break; case 1073: #line 7348 "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 35317 "gram.c" /* yacc.c:1646 */ break; case 1074: #line 7361 "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 35334 "gram.c" /* yacc.c:1646 */ break; case 1075: #line 7375 "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 35351 "gram.c" /* yacc.c:1646 */ break; case 1076: #line 7390 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = OBJECT_TABLE; } #line 35357 "gram.c" /* yacc.c:1646 */ break; case 1077: #line 7391 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = OBJECT_FUNCTION; } #line 35363 "gram.c" /* yacc.c:1646 */ break; case 1078: #line 7392 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = OBJECT_FUNCTION; } #line 35369 "gram.c" /* yacc.c:1646 */ break; case 1079: #line 7393 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = OBJECT_SEQUENCE; } #line 35375 "gram.c" /* yacc.c:1646 */ break; case 1080: #line 7394 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = OBJECT_TYPE; } #line 35381 "gram.c" /* yacc.c:1646 */ break; case 1081: #line 7395 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = OBJECT_SCHEMA; } #line 35387 "gram.c" /* yacc.c:1646 */ break; case 1082: #line 7410 "gram.y" /* yacc.c:1646 */ { IndexStmt *n = makeNode(IndexStmt); n->unique = (yyvsp[-13].boolean); n->concurrent = (yyvsp[-11].boolean); n->idxname = (yyvsp[-10].str); n->relation = (yyvsp[-8].range); n->accessMethod = (yyvsp[-7].str); n->indexParams = (yyvsp[-5].list); n->indexIncludingParams = (yyvsp[-3].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; n->transformed = false; n->if_not_exists = false; n->reset_default_tblspc = false; (yyval.node) = (Node *)n; } #line 35417 "gram.c" /* yacc.c:1646 */ break; case 1083: #line 7438 "gram.y" /* yacc.c:1646 */ { IndexStmt *n = makeNode(IndexStmt); n->unique = (yyvsp[-16].boolean); n->concurrent = (yyvsp[-14].boolean); n->idxname = (yyvsp[-10].str); n->relation = (yyvsp[-8].range); n->accessMethod = (yyvsp[-7].str); n->indexParams = (yyvsp[-5].list); n->indexIncludingParams = (yyvsp[-3].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; n->transformed = false; n->if_not_exists = true; n->reset_default_tblspc = false; (yyval.node) = (Node *)n; } #line 35447 "gram.c" /* yacc.c:1646 */ break; case 1084: #line 7466 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = true; } #line 35453 "gram.c" /* yacc.c:1646 */ break; case 1085: #line 7467 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = false; } #line 35459 "gram.c" /* yacc.c:1646 */ break; case 1086: #line 7471 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = true; } #line 35465 "gram.c" /* yacc.c:1646 */ break; case 1087: #line 7472 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = false; } #line 35471 "gram.c" /* yacc.c:1646 */ break; case 1088: #line 7476 "gram.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 35477 "gram.c" /* yacc.c:1646 */ break; case 1089: #line 7477 "gram.y" /* yacc.c:1646 */ { (yyval.str) = NULL; } #line 35483 "gram.c" /* yacc.c:1646 */ break; case 1090: #line 7481 "gram.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 35489 "gram.c" /* yacc.c:1646 */ break; case 1091: #line 7482 "gram.y" /* yacc.c:1646 */ { (yyval.str) = DEFAULT_INDEX_TYPE; } #line 35495 "gram.c" /* yacc.c:1646 */ break; case 1092: #line 7485 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].ielem)); } #line 35501 "gram.c" /* yacc.c:1646 */ break; case 1093: #line 7486 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].ielem)); } #line 35507 "gram.c" /* yacc.c:1646 */ break; case 1094: #line 7495 "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 35522 "gram.c" /* yacc.c:1646 */ break; case 1095: #line 7506 "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 35537 "gram.c" /* yacc.c:1646 */ break; case 1096: #line 7517 "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 35552 "gram.c" /* yacc.c:1646 */ break; case 1097: #line 7529 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[-1].list); } #line 35558 "gram.c" /* yacc.c:1646 */ break; case 1098: #line 7530 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 35564 "gram.c" /* yacc.c:1646 */ break; case 1099: #line 7533 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].ielem)); } #line 35570 "gram.c" /* yacc.c:1646 */ break; case 1100: #line 7534 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].ielem)); } #line 35576 "gram.c" /* yacc.c:1646 */ break; case 1101: #line 7537 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 35582 "gram.c" /* yacc.c:1646 */ break; case 1102: #line 7538 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 35588 "gram.c" /* yacc.c:1646 */ break; case 1103: #line 7541 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 35594 "gram.c" /* yacc.c:1646 */ break; case 1104: #line 7542 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 35600 "gram.c" /* yacc.c:1646 */ break; case 1105: #line 7545 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = SORTBY_ASC; } #line 35606 "gram.c" /* yacc.c:1646 */ break; case 1106: #line 7546 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = SORTBY_DESC; } #line 35612 "gram.c" /* yacc.c:1646 */ break; case 1107: #line 7547 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = SORTBY_DEFAULT; } #line 35618 "gram.c" /* yacc.c:1646 */ break; case 1108: #line 7550 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = SORTBY_NULLS_FIRST; } #line 35624 "gram.c" /* yacc.c:1646 */ break; case 1109: #line 7551 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = SORTBY_NULLS_LAST; } #line 35630 "gram.c" /* yacc.c:1646 */ break; case 1110: #line 7552 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = SORTBY_NULLS_DEFAULT; } #line 35636 "gram.c" /* yacc.c:1646 */ break; case 1111: #line 7570 "gram.y" /* yacc.c:1646 */ { CreateFunctionStmt *n = makeNode(CreateFunctionStmt); n->is_procedure = false; n->replace = (yyvsp[-6].boolean); n->funcname = (yyvsp[-4].list); n->parameters = (yyvsp[-3].list); n->returnType = (yyvsp[-1].typnam); n->options = (yyvsp[0].list); (yyval.node) = (Node *)n; } #line 35651 "gram.c" /* yacc.c:1646 */ break; case 1112: #line 7582 "gram.y" /* yacc.c:1646 */ { CreateFunctionStmt *n = makeNode(CreateFunctionStmt); n->is_procedure = false; n->replace = (yyvsp[-9].boolean); n->funcname = (yyvsp[-7].list); n->parameters = mergeTableFuncParameters((yyvsp[-6].list), (yyvsp[-2].list)); n->returnType = TableFuncTypeName((yyvsp[-2].list)); n->returnType->location = (yylsp[-4]); n->options = (yyvsp[0].list); (yyval.node) = (Node *)n; } #line 35667 "gram.c" /* yacc.c:1646 */ break; case 1113: #line 7595 "gram.y" /* yacc.c:1646 */ { CreateFunctionStmt *n = makeNode(CreateFunctionStmt); n->is_procedure = false; n->replace = (yyvsp[-4].boolean); n->funcname = (yyvsp[-2].list); n->parameters = (yyvsp[-1].list); n->returnType = NULL; n->options = (yyvsp[0].list); (yyval.node) = (Node *)n; } #line 35682 "gram.c" /* yacc.c:1646 */ break; case 1114: #line 7607 "gram.y" /* yacc.c:1646 */ { CreateFunctionStmt *n = makeNode(CreateFunctionStmt); n->is_procedure = true; n->replace = (yyvsp[-4].boolean); n->funcname = (yyvsp[-2].list); n->parameters = (yyvsp[-1].list); n->returnType = NULL; n->options = (yyvsp[0].list); (yyval.node) = (Node *)n; } #line 35697 "gram.c" /* yacc.c:1646 */ break; case 1115: #line 7620 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = true; } #line 35703 "gram.c" /* yacc.c:1646 */ break; case 1116: #line 7621 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = false; } #line 35709 "gram.c" /* yacc.c:1646 */ break; case 1117: #line 7624 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[-1].list); } #line 35715 "gram.c" /* yacc.c:1646 */ break; case 1118: #line 7625 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 35721 "gram.c" /* yacc.c:1646 */ break; case 1119: #line 7629 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].fun_param)); } #line 35727 "gram.c" /* yacc.c:1646 */ break; case 1120: #line 7630 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].fun_param)); } #line 35733 "gram.c" /* yacc.c:1646 */ break; case 1121: #line 7634 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].objwithargs)); } #line 35739 "gram.c" /* yacc.c:1646 */ break; case 1122: #line 7636 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].objwithargs)); } #line 35745 "gram.c" /* yacc.c:1646 */ break; case 1123: #line 7641 "gram.y" /* yacc.c:1646 */ { ObjectWithArgs *n = makeNode(ObjectWithArgs); n->objname = (yyvsp[-1].list); n->objargs = extractArgTypes((yyvsp[0].list)); (yyval.objwithargs) = n; } #line 35756 "gram.c" /* yacc.c:1646 */ break; case 1124: #line 7653 "gram.y" /* yacc.c:1646 */ { ObjectWithArgs *n = makeNode(ObjectWithArgs); n->objname = list_make1(makeString(pstrdup((yyvsp[0].keyword)))); n->args_unspecified = true; (yyval.objwithargs) = n; } #line 35767 "gram.c" /* yacc.c:1646 */ break; case 1125: #line 7660 "gram.y" /* yacc.c:1646 */ { ObjectWithArgs *n = makeNode(ObjectWithArgs); n->objname = list_make1(makeString((yyvsp[0].str))); n->args_unspecified = true; (yyval.objwithargs) = n; } #line 35778 "gram.c" /* yacc.c:1646 */ break; case 1126: #line 7667 "gram.y" /* yacc.c:1646 */ { ObjectWithArgs *n = makeNode(ObjectWithArgs); n->objname = check_func_name(lcons(makeString((yyvsp[-1].str)), (yyvsp[0].list)), yyscanner); n->args_unspecified = true; (yyval.objwithargs) = n; } #line 35790 "gram.c" /* yacc.c:1646 */ break; case 1127: #line 7681 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[-1].list); } #line 35796 "gram.c" /* yacc.c:1646 */ break; case 1128: #line 7682 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 35802 "gram.c" /* yacc.c:1646 */ break; case 1129: #line 7686 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].fun_param)); } #line 35808 "gram.c" /* yacc.c:1646 */ break; case 1130: #line 7688 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].fun_param)); } #line 35814 "gram.c" /* yacc.c:1646 */ break; case 1131: #line 7703 "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 35827 "gram.c" /* yacc.c:1646 */ break; case 1132: #line 7712 "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 35840 "gram.c" /* yacc.c:1646 */ break; case 1133: #line 7721 "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 35853 "gram.c" /* yacc.c:1646 */ break; case 1134: #line 7730 "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 35866 "gram.c" /* yacc.c:1646 */ break; case 1135: #line 7739 "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 35879 "gram.c" /* yacc.c:1646 */ break; case 1136: #line 7750 "gram.y" /* yacc.c:1646 */ { (yyval.fun_param_mode) = FUNC_PARAM_IN; } #line 35885 "gram.c" /* yacc.c:1646 */ break; case 1137: #line 7751 "gram.y" /* yacc.c:1646 */ { (yyval.fun_param_mode) = FUNC_PARAM_OUT; } #line 35891 "gram.c" /* yacc.c:1646 */ break; case 1138: #line 7752 "gram.y" /* yacc.c:1646 */ { (yyval.fun_param_mode) = FUNC_PARAM_INOUT; } #line 35897 "gram.c" /* yacc.c:1646 */ break; case 1139: #line 7753 "gram.y" /* yacc.c:1646 */ { (yyval.fun_param_mode) = FUNC_PARAM_INOUT; } #line 35903 "gram.c" /* yacc.c:1646 */ break; case 1140: #line 7754 "gram.y" /* yacc.c:1646 */ { (yyval.fun_param_mode) = FUNC_PARAM_VARIADIC; } #line 35909 "gram.c" /* yacc.c:1646 */ break; case 1142: #line 7765 "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 35921 "gram.c" /* yacc.c:1646 */ break; case 1143: #line 7779 "gram.y" /* yacc.c:1646 */ { (yyval.typnam) = (yyvsp[0].typnam); } #line 35927 "gram.c" /* yacc.c:1646 */ break; case 1144: #line 7781 "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 35937 "gram.c" /* yacc.c:1646 */ break; case 1145: #line 7787 "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 35948 "gram.c" /* yacc.c:1646 */ break; case 1146: #line 7797 "gram.y" /* yacc.c:1646 */ { (yyval.fun_param) = (yyvsp[0].fun_param); } #line 35956 "gram.c" /* yacc.c:1646 */ break; case 1147: #line 7801 "gram.y" /* yacc.c:1646 */ { (yyval.fun_param) = (yyvsp[-2].fun_param); (yyval.fun_param)->defexpr = (yyvsp[0].node); } #line 35965 "gram.c" /* yacc.c:1646 */ break; case 1148: #line 7806 "gram.y" /* yacc.c:1646 */ { (yyval.fun_param) = (yyvsp[-2].fun_param); (yyval.fun_param)->defexpr = (yyvsp[0].node); } #line 35974 "gram.c" /* yacc.c:1646 */ break; case 1149: #line 7814 "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 35988 "gram.c" /* yacc.c:1646 */ break; case 1150: #line 7855 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make2(NIL, makeInteger(-1)); } #line 35996 "gram.c" /* yacc.c:1646 */ break; case 1151: #line 7859 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make2((yyvsp[-1].list), makeInteger(-1)); } #line 36004 "gram.c" /* yacc.c:1646 */ break; case 1152: #line 7863 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make2((yyvsp[-1].list), makeInteger(0)); } #line 36012 "gram.c" /* yacc.c:1646 */ break; case 1153: #line 7867 "gram.y" /* yacc.c:1646 */ { /* this is the only case requiring consistency checking */ (yyval.list) = makeOrderedSetArgs((yyvsp[-4].list), (yyvsp[-1].list), yyscanner); } #line 36021 "gram.c" /* yacc.c:1646 */ break; case 1154: #line 7874 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].fun_param)); } #line 36027 "gram.c" /* yacc.c:1646 */ break; case 1155: #line 7875 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].fun_param)); } #line 36033 "gram.c" /* yacc.c:1646 */ break; case 1156: #line 7880 "gram.y" /* yacc.c:1646 */ { ObjectWithArgs *n = makeNode(ObjectWithArgs); n->objname = (yyvsp[-1].list); n->objargs = extractAggrArgTypes((yyvsp[0].list)); (yyval.objwithargs) = n; } #line 36044 "gram.c" /* yacc.c:1646 */ break; case 1157: #line 7889 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].objwithargs)); } #line 36050 "gram.c" /* yacc.c:1646 */ break; case 1158: #line 7891 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].objwithargs)); } #line 36056 "gram.c" /* yacc.c:1646 */ break; case 1159: #line 7896 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].defelt)); } #line 36062 "gram.c" /* yacc.c:1646 */ break; case 1160: #line 7897 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-1].list), (yyvsp[0].defelt)); } #line 36068 "gram.c" /* yacc.c:1646 */ break; case 1161: #line 7905 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("strict", (Node *)makeInteger(false), (yylsp[-3])); } #line 36076 "gram.c" /* yacc.c:1646 */ break; case 1162: #line 7909 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("strict", (Node *)makeInteger(true), (yylsp[-4])); } #line 36084 "gram.c" /* yacc.c:1646 */ break; case 1163: #line 7913 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("strict", (Node *)makeInteger(true), (yylsp[0])); } #line 36092 "gram.c" /* yacc.c:1646 */ break; case 1164: #line 7917 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("volatility", (Node *)makeString("immutable"), (yylsp[0])); } #line 36100 "gram.c" /* yacc.c:1646 */ break; case 1165: #line 7921 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("volatility", (Node *)makeString("stable"), (yylsp[0])); } #line 36108 "gram.c" /* yacc.c:1646 */ break; case 1166: #line 7925 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("volatility", (Node *)makeString("volatile"), (yylsp[0])); } #line 36116 "gram.c" /* yacc.c:1646 */ break; case 1167: #line 7929 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("security", (Node *)makeInteger(true), (yylsp[-2])); } #line 36124 "gram.c" /* yacc.c:1646 */ break; case 1168: #line 7933 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("security", (Node *)makeInteger(false), (yylsp[-2])); } #line 36132 "gram.c" /* yacc.c:1646 */ break; case 1169: #line 7937 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("security", (Node *)makeInteger(true), (yylsp[-1])); } #line 36140 "gram.c" /* yacc.c:1646 */ break; case 1170: #line 7941 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("security", (Node *)makeInteger(false), (yylsp[-1])); } #line 36148 "gram.c" /* yacc.c:1646 */ break; case 1171: #line 7945 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("leakproof", (Node *)makeInteger(true), (yylsp[0])); } #line 36156 "gram.c" /* yacc.c:1646 */ break; case 1172: #line 7949 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("leakproof", (Node *)makeInteger(false), (yylsp[-1])); } #line 36164 "gram.c" /* yacc.c:1646 */ break; case 1173: #line 7953 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("cost", (Node *)(yyvsp[0].value), (yylsp[-1])); } #line 36172 "gram.c" /* yacc.c:1646 */ break; case 1174: #line 7957 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("rows", (Node *)(yyvsp[0].value), (yylsp[-1])); } #line 36180 "gram.c" /* yacc.c:1646 */ break; case 1175: #line 7961 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("support", (Node *)(yyvsp[0].list), (yylsp[-1])); } #line 36188 "gram.c" /* yacc.c:1646 */ break; case 1176: #line 7965 "gram.y" /* yacc.c:1646 */ { /* we abuse the normal content of a DefElem here */ (yyval.defelt) = makeDefElem("set", (Node *)(yyvsp[0].vsetstmt), (yylsp[0])); } #line 36197 "gram.c" /* yacc.c:1646 */ break; case 1177: #line 7970 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("parallel", (Node *)makeString((yyvsp[0].str)), (yylsp[-1])); } #line 36205 "gram.c" /* yacc.c:1646 */ break; case 1178: #line 7977 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("as", (Node *)(yyvsp[0].list), (yylsp[-1])); } #line 36213 "gram.c" /* yacc.c:1646 */ break; case 1179: #line 7981 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("language", (Node *)makeString((yyvsp[0].str)), (yylsp[-1])); } #line 36221 "gram.c" /* yacc.c:1646 */ break; case 1180: #line 7985 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("transform", (Node *)(yyvsp[0].list), (yylsp[-1])); } #line 36229 "gram.c" /* yacc.c:1646 */ break; case 1181: #line 7989 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("window", (Node *)makeInteger(true), (yylsp[0])); } #line 36237 "gram.c" /* yacc.c:1646 */ break; case 1182: #line 7993 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = (yyvsp[0].defelt); } #line 36245 "gram.c" /* yacc.c:1646 */ break; case 1183: #line 7998 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1(makeString((yyvsp[0].str))); } #line 36251 "gram.c" /* yacc.c:1646 */ break; case 1184: #line 8000 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make2(makeString((yyvsp[-2].str)), makeString((yyvsp[0].str))); } #line 36259 "gram.c" /* yacc.c:1646 */ break; case 1185: #line 8006 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].typnam)); } #line 36265 "gram.c" /* yacc.c:1646 */ break; case 1186: #line 8007 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-4].list), (yyvsp[0].typnam)); } #line 36271 "gram.c" /* yacc.c:1646 */ break; case 1187: #line 8011 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 36277 "gram.c" /* yacc.c:1646 */ break; case 1188: #line 8012 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 36283 "gram.c" /* yacc.c:1646 */ break; case 1189: #line 8016 "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 36296 "gram.c" /* yacc.c:1646 */ break; case 1190: #line 8028 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].fun_param)); } #line 36304 "gram.c" /* yacc.c:1646 */ break; case 1191: #line 8032 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].fun_param)); } #line 36312 "gram.c" /* yacc.c:1646 */ break; case 1192: #line 8047 "gram.y" /* yacc.c:1646 */ { AlterFunctionStmt *n = makeNode(AlterFunctionStmt); n->objtype = OBJECT_FUNCTION; n->func = (yyvsp[-2].objwithargs); n->actions = (yyvsp[-1].list); (yyval.node) = (Node *) n; } #line 36324 "gram.c" /* yacc.c:1646 */ break; case 1193: #line 8055 "gram.y" /* yacc.c:1646 */ { AlterFunctionStmt *n = makeNode(AlterFunctionStmt); n->objtype = OBJECT_PROCEDURE; n->func = (yyvsp[-2].objwithargs); n->actions = (yyvsp[-1].list); (yyval.node) = (Node *) n; } #line 36336 "gram.c" /* yacc.c:1646 */ break; case 1194: #line 8063 "gram.y" /* yacc.c:1646 */ { AlterFunctionStmt *n = makeNode(AlterFunctionStmt); n->objtype = OBJECT_ROUTINE; n->func = (yyvsp[-2].objwithargs); n->actions = (yyvsp[-1].list); (yyval.node) = (Node *) n; } #line 36348 "gram.c" /* yacc.c:1646 */ break; case 1195: #line 8074 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].defelt)); } #line 36354 "gram.c" /* yacc.c:1646 */ break; case 1196: #line 8075 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-1].list), (yyvsp[0].defelt)); } #line 36360 "gram.c" /* yacc.c:1646 */ break; case 1199: #line 8099 "gram.y" /* yacc.c:1646 */ { DropStmt *n = makeNode(DropStmt); n->removeType = OBJECT_FUNCTION; n->objects = (yyvsp[-1].list); n->behavior = (yyvsp[0].dbehavior); n->missing_ok = false; n->concurrent = false; (yyval.node) = (Node *)n; } #line 36374 "gram.c" /* yacc.c:1646 */ break; case 1200: #line 8109 "gram.y" /* yacc.c:1646 */ { DropStmt *n = makeNode(DropStmt); n->removeType = OBJECT_FUNCTION; n->objects = (yyvsp[-1].list); n->behavior = (yyvsp[0].dbehavior); n->missing_ok = true; n->concurrent = false; (yyval.node) = (Node *)n; } #line 36388 "gram.c" /* yacc.c:1646 */ break; case 1201: #line 8119 "gram.y" /* yacc.c:1646 */ { DropStmt *n = makeNode(DropStmt); n->removeType = OBJECT_PROCEDURE; n->objects = (yyvsp[-1].list); n->behavior = (yyvsp[0].dbehavior); n->missing_ok = false; n->concurrent = false; (yyval.node) = (Node *)n; } #line 36402 "gram.c" /* yacc.c:1646 */ break; case 1202: #line 8129 "gram.y" /* yacc.c:1646 */ { DropStmt *n = makeNode(DropStmt); n->removeType = OBJECT_PROCEDURE; n->objects = (yyvsp[-1].list); n->behavior = (yyvsp[0].dbehavior); n->missing_ok = true; n->concurrent = false; (yyval.node) = (Node *)n; } #line 36416 "gram.c" /* yacc.c:1646 */ break; case 1203: #line 8139 "gram.y" /* yacc.c:1646 */ { DropStmt *n = makeNode(DropStmt); n->removeType = OBJECT_ROUTINE; n->objects = (yyvsp[-1].list); n->behavior = (yyvsp[0].dbehavior); n->missing_ok = false; n->concurrent = false; (yyval.node) = (Node *)n; } #line 36430 "gram.c" /* yacc.c:1646 */ break; case 1204: #line 8149 "gram.y" /* yacc.c:1646 */ { DropStmt *n = makeNode(DropStmt); n->removeType = OBJECT_ROUTINE; n->objects = (yyvsp[-1].list); n->behavior = (yyvsp[0].dbehavior); n->missing_ok = true; n->concurrent = false; (yyval.node) = (Node *)n; } #line 36444 "gram.c" /* yacc.c:1646 */ break; case 1205: #line 8162 "gram.y" /* yacc.c:1646 */ { DropStmt *n = makeNode(DropStmt); n->removeType = OBJECT_AGGREGATE; n->objects = (yyvsp[-1].list); n->behavior = (yyvsp[0].dbehavior); n->missing_ok = false; n->concurrent = false; (yyval.node) = (Node *)n; } #line 36458 "gram.c" /* yacc.c:1646 */ break; case 1206: #line 8172 "gram.y" /* yacc.c:1646 */ { DropStmt *n = makeNode(DropStmt); n->removeType = OBJECT_AGGREGATE; n->objects = (yyvsp[-1].list); n->behavior = (yyvsp[0].dbehavior); n->missing_ok = true; n->concurrent = false; (yyval.node) = (Node *)n; } #line 36472 "gram.c" /* yacc.c:1646 */ break; case 1207: #line 8185 "gram.y" /* yacc.c:1646 */ { DropStmt *n = makeNode(DropStmt); n->removeType = OBJECT_OPERATOR; n->objects = (yyvsp[-1].list); n->behavior = (yyvsp[0].dbehavior); n->missing_ok = false; n->concurrent = false; (yyval.node) = (Node *)n; } #line 36486 "gram.c" /* yacc.c:1646 */ break; case 1208: #line 8195 "gram.y" /* yacc.c:1646 */ { DropStmt *n = makeNode(DropStmt); n->removeType = OBJECT_OPERATOR; n->objects = (yyvsp[-1].list); n->behavior = (yyvsp[0].dbehavior); n->missing_ok = true; n->concurrent = false; (yyval.node) = (Node *)n; } #line 36500 "gram.c" /* yacc.c:1646 */ break; case 1209: #line 8208 "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 36512 "gram.c" /* yacc.c:1646 */ break; case 1210: #line 8216 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make2((yyvsp[-3].typnam), (yyvsp[-1].typnam)); } #line 36518 "gram.c" /* yacc.c:1646 */ break; case 1211: #line 8218 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make2(NULL, (yyvsp[-1].typnam)); } #line 36524 "gram.c" /* yacc.c:1646 */ break; case 1212: #line 8220 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make2((yyvsp[-3].typnam), NULL); } #line 36530 "gram.c" /* yacc.c:1646 */ break; case 1213: #line 8225 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1(makeString((yyvsp[0].str))); } #line 36536 "gram.c" /* yacc.c:1646 */ break; case 1214: #line 8227 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lcons(makeString((yyvsp[-2].str)), (yyvsp[0].list)); } #line 36542 "gram.c" /* yacc.c:1646 */ break; case 1215: #line 8231 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].objwithargs)); } #line 36548 "gram.c" /* yacc.c:1646 */ break; case 1216: #line 8233 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].objwithargs)); } #line 36554 "gram.c" /* yacc.c:1646 */ break; case 1217: #line 8238 "gram.y" /* yacc.c:1646 */ { ObjectWithArgs *n = makeNode(ObjectWithArgs); n->objname = (yyvsp[-1].list); n->objargs = (yyvsp[0].list); (yyval.objwithargs) = n; } #line 36565 "gram.c" /* yacc.c:1646 */ break; case 1218: #line 8256 "gram.y" /* yacc.c:1646 */ { DoStmt *n = makeNode(DoStmt); n->args = (yyvsp[0].list); (yyval.node) = (Node *)n; } #line 36575 "gram.c" /* yacc.c:1646 */ break; case 1219: #line 8264 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].defelt)); } #line 36581 "gram.c" /* yacc.c:1646 */ break; case 1220: #line 8265 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-1].list), (yyvsp[0].defelt)); } #line 36587 "gram.c" /* yacc.c:1646 */ break; case 1221: #line 8270 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("as", (Node *)makeString((yyvsp[0].str)), (yylsp[0])); } #line 36595 "gram.c" /* yacc.c:1646 */ break; case 1222: #line 8274 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("language", (Node *)makeString((yyvsp[0].str)), (yylsp[-1])); } #line 36603 "gram.c" /* yacc.c:1646 */ break; case 1223: #line 8287 "gram.y" /* yacc.c:1646 */ { CreateCastStmt *n = makeNode(CreateCastStmt); n->sourcetype = (yyvsp[-7].typnam); n->targettype = (yyvsp[-5].typnam); n->func = (yyvsp[-1].objwithargs); n->context = (CoercionContext) (yyvsp[0].ival); n->inout = false; (yyval.node) = (Node *)n; } #line 36617 "gram.c" /* yacc.c:1646 */ break; case 1224: #line 8298 "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 36631 "gram.c" /* yacc.c:1646 */ break; case 1225: #line 8309 "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 36645 "gram.c" /* yacc.c:1646 */ break; case 1226: #line 8320 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = COERCION_IMPLICIT; } #line 36651 "gram.c" /* yacc.c:1646 */ break; case 1227: #line 8321 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = COERCION_ASSIGNMENT; } #line 36657 "gram.c" /* yacc.c:1646 */ break; case 1228: #line 8322 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = COERCION_EXPLICIT; } #line 36663 "gram.c" /* yacc.c:1646 */ break; case 1229: #line 8327 "gram.y" /* yacc.c:1646 */ { DropStmt *n = makeNode(DropStmt); n->removeType = OBJECT_CAST; n->objects = list_make1(list_make2((yyvsp[-4].typnam), (yyvsp[-2].typnam))); n->behavior = (yyvsp[0].dbehavior); n->missing_ok = (yyvsp[-6].boolean); n->concurrent = false; (yyval.node) = (Node *)n; } #line 36677 "gram.c" /* yacc.c:1646 */ break; case 1230: #line 8338 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = true; } #line 36683 "gram.c" /* yacc.c:1646 */ break; case 1231: #line 8339 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = false; } #line 36689 "gram.c" /* yacc.c:1646 */ break; case 1232: #line 8350 "gram.y" /* yacc.c:1646 */ { CreateTransformStmt *n = makeNode(CreateTransformStmt); n->replace = (yyvsp[-8].boolean); n->type_name = (yyvsp[-5].typnam); n->lang = (yyvsp[-3].str); n->fromsql = linitial((yyvsp[-1].list)); n->tosql = lsecond((yyvsp[-1].list)); (yyval.node) = (Node *)n; } #line 36703 "gram.c" /* yacc.c:1646 */ break; case 1233: #line 8362 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make2((yyvsp[-6].objwithargs), (yyvsp[0].objwithargs)); } #line 36711 "gram.c" /* yacc.c:1646 */ break; case 1234: #line 8366 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make2((yyvsp[0].objwithargs), (yyvsp[-6].objwithargs)); } #line 36719 "gram.c" /* yacc.c:1646 */ break; case 1235: #line 8370 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make2((yyvsp[0].objwithargs), NULL); } #line 36727 "gram.c" /* yacc.c:1646 */ break; case 1236: #line 8374 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make2(NULL, (yyvsp[0].objwithargs)); } #line 36735 "gram.c" /* yacc.c:1646 */ break; case 1237: #line 8381 "gram.y" /* yacc.c:1646 */ { DropStmt *n = makeNode(DropStmt); n->removeType = OBJECT_TRANSFORM; n->objects = list_make1(list_make2((yyvsp[-3].typnam), makeString((yyvsp[-1].str)))); n->behavior = (yyvsp[0].dbehavior); n->missing_ok = (yyvsp[-5].boolean); (yyval.node) = (Node *)n; } #line 36748 "gram.c" /* yacc.c:1646 */ break; case 1238: #line 8401 "gram.y" /* yacc.c:1646 */ { ReindexStmt *n = makeNode(ReindexStmt); n->kind = (yyvsp[-2].ival); n->concurrent = (yyvsp[-1].boolean); n->relation = (yyvsp[0].range); n->name = NULL; n->options = 0; (yyval.node) = (Node *)n; } #line 36762 "gram.c" /* yacc.c:1646 */ break; case 1239: #line 8411 "gram.y" /* yacc.c:1646 */ { ReindexStmt *n = makeNode(ReindexStmt); n->kind = (yyvsp[-2].ival); n->concurrent = (yyvsp[-1].boolean); n->name = (yyvsp[0].str); n->relation = NULL; n->options = 0; (yyval.node) = (Node *)n; } #line 36776 "gram.c" /* yacc.c:1646 */ break; case 1240: #line 8421 "gram.y" /* yacc.c:1646 */ { ReindexStmt *n = makeNode(ReindexStmt); n->kind = (yyvsp[-2].ival); n->concurrent = (yyvsp[-1].boolean); n->relation = (yyvsp[0].range); n->name = NULL; n->options = (yyvsp[-4].ival); (yyval.node) = (Node *)n; } #line 36790 "gram.c" /* yacc.c:1646 */ break; case 1241: #line 8431 "gram.y" /* yacc.c:1646 */ { ReindexStmt *n = makeNode(ReindexStmt); n->kind = (yyvsp[-2].ival); n->concurrent = (yyvsp[-1].boolean); n->name = (yyvsp[0].str); n->relation = NULL; n->options = (yyvsp[-4].ival); (yyval.node) = (Node *)n; } #line 36804 "gram.c" /* yacc.c:1646 */ break; case 1242: #line 8442 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = REINDEX_OBJECT_INDEX; } #line 36810 "gram.c" /* yacc.c:1646 */ break; case 1243: #line 8443 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = REINDEX_OBJECT_TABLE; } #line 36816 "gram.c" /* yacc.c:1646 */ break; case 1244: #line 8446 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = REINDEX_OBJECT_SCHEMA; } #line 36822 "gram.c" /* yacc.c:1646 */ break; case 1245: #line 8447 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = REINDEX_OBJECT_SYSTEM; } #line 36828 "gram.c" /* yacc.c:1646 */ break; case 1246: #line 8448 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = REINDEX_OBJECT_DATABASE; } #line 36834 "gram.c" /* yacc.c:1646 */ break; case 1247: #line 8451 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = (yyvsp[0].ival); } #line 36840 "gram.c" /* yacc.c:1646 */ break; case 1248: #line 8452 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = (yyvsp[-2].ival) | (yyvsp[0].ival); } #line 36846 "gram.c" /* yacc.c:1646 */ break; case 1249: #line 8455 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = REINDEXOPT_VERBOSE; } #line 36852 "gram.c" /* yacc.c:1646 */ break; case 1250: #line 8466 "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 36865 "gram.c" /* yacc.c:1646 */ break; case 1251: #line 8475 "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 36878 "gram.c" /* yacc.c:1646 */ break; case 1252: #line 8492 "gram.y" /* yacc.c:1646 */ { RenameStmt *n = makeNode(RenameStmt); n->renameType = OBJECT_AGGREGATE; n->object = (Node *) (yyvsp[-3].objwithargs); n->newname = (yyvsp[0].str); n->missing_ok = false; (yyval.node) = (Node *)n; } #line 36891 "gram.c" /* yacc.c:1646 */ break; case 1253: #line 8501 "gram.y" /* yacc.c:1646 */ { RenameStmt *n = makeNode(RenameStmt); n->renameType = OBJECT_COLLATION; n->object = (Node *) (yyvsp[-3].list); n->newname = (yyvsp[0].str); n->missing_ok = false; (yyval.node) = (Node *)n; } #line 36904 "gram.c" /* yacc.c:1646 */ break; case 1254: #line 8510 "gram.y" /* yacc.c:1646 */ { RenameStmt *n = makeNode(RenameStmt); n->renameType = OBJECT_CONVERSION; n->object = (Node *) (yyvsp[-3].list); n->newname = (yyvsp[0].str); n->missing_ok = false; (yyval.node) = (Node *)n; } #line 36917 "gram.c" /* yacc.c:1646 */ break; case 1255: #line 8519 "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 36930 "gram.c" /* yacc.c:1646 */ break; case 1256: #line 8528 "gram.y" /* yacc.c:1646 */ { RenameStmt *n = makeNode(RenameStmt); n->renameType = OBJECT_DOMAIN; n->object = (Node *) (yyvsp[-3].list); n->newname = (yyvsp[0].str); n->missing_ok = false; (yyval.node) = (Node *)n; } #line 36943 "gram.c" /* yacc.c:1646 */ break; case 1257: #line 8537 "gram.y" /* yacc.c:1646 */ { RenameStmt *n = makeNode(RenameStmt); n->renameType = OBJECT_DOMCONSTRAINT; n->object = (Node *) (yyvsp[-5].list); n->subname = (yyvsp[-2].str); n->newname = (yyvsp[0].str); (yyval.node) = (Node *)n; } #line 36956 "gram.c" /* yacc.c:1646 */ break; case 1258: #line 8546 "gram.y" /* yacc.c:1646 */ { RenameStmt *n = makeNode(RenameStmt); n->renameType = OBJECT_FDW; n->object = (Node *) makeString((yyvsp[-3].str)); n->newname = (yyvsp[0].str); n->missing_ok = false; (yyval.node) = (Node *)n; } #line 36969 "gram.c" /* yacc.c:1646 */ break; case 1259: #line 8555 "gram.y" /* yacc.c:1646 */ { RenameStmt *n = makeNode(RenameStmt); n->renameType = OBJECT_FUNCTION; n->object = (Node *) (yyvsp[-3].objwithargs); n->newname = (yyvsp[0].str); n->missing_ok = false; (yyval.node) = (Node *)n; } #line 36982 "gram.c" /* yacc.c:1646 */ break; case 1260: #line 8564 "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 36995 "gram.c" /* yacc.c:1646 */ break; case 1261: #line 8573 "gram.y" /* yacc.c:1646 */ { RenameStmt *n = makeNode(RenameStmt); n->renameType = OBJECT_LANGUAGE; n->object = (Node *) makeString((yyvsp[-3].str)); n->newname = (yyvsp[0].str); n->missing_ok = false; (yyval.node) = (Node *)n; } #line 37008 "gram.c" /* yacc.c:1646 */ break; case 1262: #line 8582 "gram.y" /* yacc.c:1646 */ { RenameStmt *n = makeNode(RenameStmt); n->renameType = OBJECT_OPCLASS; n->object = (Node *) lcons(makeString((yyvsp[-3].str)), (yyvsp[-5].list)); n->newname = (yyvsp[0].str); n->missing_ok = false; (yyval.node) = (Node *)n; } #line 37021 "gram.c" /* yacc.c:1646 */ break; case 1263: #line 8591 "gram.y" /* yacc.c:1646 */ { RenameStmt *n = makeNode(RenameStmt); n->renameType = OBJECT_OPFAMILY; n->object = (Node *) lcons(makeString((yyvsp[-3].str)), (yyvsp[-5].list)); n->newname = (yyvsp[0].str); n->missing_ok = false; (yyval.node) = (Node *)n; } #line 37034 "gram.c" /* yacc.c:1646 */ break; case 1264: #line 8600 "gram.y" /* yacc.c:1646 */ { RenameStmt *n = makeNode(RenameStmt); n->renameType = OBJECT_POLICY; n->relation = (yyvsp[-3].range); n->subname = (yyvsp[-5].str); n->newname = (yyvsp[0].str); n->missing_ok = false; (yyval.node) = (Node *)n; } #line 37048 "gram.c" /* yacc.c:1646 */ break; case 1265: #line 8610 "gram.y" /* yacc.c:1646 */ { RenameStmt *n = makeNode(RenameStmt); n->renameType = OBJECT_POLICY; n->relation = (yyvsp[-3].range); n->subname = (yyvsp[-5].str); n->newname = (yyvsp[0].str); n->missing_ok = true; (yyval.node) = (Node *)n; } #line 37062 "gram.c" /* yacc.c:1646 */ break; case 1266: #line 8620 "gram.y" /* yacc.c:1646 */ { RenameStmt *n = makeNode(RenameStmt); n->renameType = OBJECT_PROCEDURE; n->object = (Node *) (yyvsp[-3].objwithargs); n->newname = (yyvsp[0].str); n->missing_ok = false; (yyval.node) = (Node *)n; } #line 37075 "gram.c" /* yacc.c:1646 */ break; case 1267: #line 8629 "gram.y" /* yacc.c:1646 */ { RenameStmt *n = makeNode(RenameStmt); n->renameType = OBJECT_PUBLICATION; n->object = (Node *) makeString((yyvsp[-3].str)); n->newname = (yyvsp[0].str); n->missing_ok = false; (yyval.node) = (Node *)n; } #line 37088 "gram.c" /* yacc.c:1646 */ break; case 1268: #line 8638 "gram.y" /* yacc.c:1646 */ { RenameStmt *n = makeNode(RenameStmt); n->renameType = OBJECT_ROUTINE; n->object = (Node *) (yyvsp[-3].objwithargs); n->newname = (yyvsp[0].str); n->missing_ok = false; (yyval.node) = (Node *)n; } #line 37101 "gram.c" /* yacc.c:1646 */ break; case 1269: #line 8647 "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 37114 "gram.c" /* yacc.c:1646 */ break; case 1270: #line 8656 "gram.y" /* yacc.c:1646 */ { RenameStmt *n = makeNode(RenameStmt); n->renameType = OBJECT_FOREIGN_SERVER; n->object = (Node *) makeString((yyvsp[-3].str)); n->newname = (yyvsp[0].str); n->missing_ok = false; (yyval.node) = (Node *)n; } #line 37127 "gram.c" /* yacc.c:1646 */ break; case 1271: #line 8665 "gram.y" /* yacc.c:1646 */ { RenameStmt *n = makeNode(RenameStmt); n->renameType = OBJECT_SUBSCRIPTION; n->object = (Node *) makeString((yyvsp[-3].str)); n->newname = (yyvsp[0].str); n->missing_ok = false; (yyval.node) = (Node *)n; } #line 37140 "gram.c" /* yacc.c:1646 */ break; case 1272: #line 8674 "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 37154 "gram.c" /* yacc.c:1646 */ break; case 1273: #line 8684 "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 37168 "gram.c" /* yacc.c:1646 */ break; case 1274: #line 8694 "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 37182 "gram.c" /* yacc.c:1646 */ break; case 1275: #line 8704 "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 37196 "gram.c" /* yacc.c:1646 */ break; case 1276: #line 8714 "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 37210 "gram.c" /* yacc.c:1646 */ break; case 1277: #line 8724 "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 37224 "gram.c" /* yacc.c:1646 */ break; case 1278: #line 8734 "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 37238 "gram.c" /* yacc.c:1646 */ break; case 1279: #line 8744 "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 37252 "gram.c" /* yacc.c:1646 */ break; case 1280: #line 8754 "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 37266 "gram.c" /* yacc.c:1646 */ break; case 1281: #line 8764 "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 37280 "gram.c" /* yacc.c:1646 */ break; case 1282: #line 8774 "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 37294 "gram.c" /* yacc.c:1646 */ break; case 1283: #line 8784 "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 37308 "gram.c" /* yacc.c:1646 */ break; case 1284: #line 8794 "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 37323 "gram.c" /* yacc.c:1646 */ break; case 1285: #line 8805 "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 37338 "gram.c" /* yacc.c:1646 */ break; case 1286: #line 8816 "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 37353 "gram.c" /* yacc.c:1646 */ break; case 1287: #line 8827 "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 37368 "gram.c" /* yacc.c:1646 */ break; case 1288: #line 8838 "gram.y" /* yacc.c:1646 */ { RenameStmt *n = makeNode(RenameStmt); n->renameType = OBJECT_TABCONSTRAINT; n->relation = (yyvsp[-5].range); n->subname = (yyvsp[-2].str); n->newname = (yyvsp[0].str); n->missing_ok = false; (yyval.node) = (Node *)n; } #line 37382 "gram.c" /* yacc.c:1646 */ break; case 1289: #line 8848 "gram.y" /* yacc.c:1646 */ { RenameStmt *n = makeNode(RenameStmt); n->renameType = OBJECT_TABCONSTRAINT; n->relation = (yyvsp[-5].range); n->subname = (yyvsp[-2].str); n->newname = (yyvsp[0].str); n->missing_ok = true; (yyval.node) = (Node *)n; } #line 37396 "gram.c" /* yacc.c:1646 */ break; case 1290: #line 8858 "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 37411 "gram.c" /* yacc.c:1646 */ break; case 1291: #line 8869 "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 37426 "gram.c" /* yacc.c:1646 */ break; case 1292: #line 8880 "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 37440 "gram.c" /* yacc.c:1646 */ break; case 1293: #line 8890 "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 37454 "gram.c" /* yacc.c:1646 */ break; case 1294: #line 8900 "gram.y" /* yacc.c:1646 */ { RenameStmt *n = makeNode(RenameStmt); n->renameType = OBJECT_EVENT_TRIGGER; n->object = (Node *) makeString((yyvsp[-3].str)); n->newname = (yyvsp[0].str); (yyval.node) = (Node *)n; } #line 37466 "gram.c" /* yacc.c:1646 */ break; case 1295: #line 8908 "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 37479 "gram.c" /* yacc.c:1646 */ break; case 1296: #line 8917 "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 37492 "gram.c" /* yacc.c:1646 */ break; case 1297: #line 8926 "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 37505 "gram.c" /* yacc.c:1646 */ break; case 1298: #line 8935 "gram.y" /* yacc.c:1646 */ { RenameStmt *n = makeNode(RenameStmt); n->renameType = OBJECT_STATISTIC_EXT; n->object = (Node *) (yyvsp[-3].list); n->newname = (yyvsp[0].str); n->missing_ok = false; (yyval.node) = (Node *)n; } #line 37518 "gram.c" /* yacc.c:1646 */ break; case 1299: #line 8944 "gram.y" /* yacc.c:1646 */ { RenameStmt *n = makeNode(RenameStmt); n->renameType = OBJECT_TSPARSER; n->object = (Node *) (yyvsp[-3].list); n->newname = (yyvsp[0].str); n->missing_ok = false; (yyval.node) = (Node *)n; } #line 37531 "gram.c" /* yacc.c:1646 */ break; case 1300: #line 8953 "gram.y" /* yacc.c:1646 */ { RenameStmt *n = makeNode(RenameStmt); n->renameType = OBJECT_TSDICTIONARY; n->object = (Node *) (yyvsp[-3].list); n->newname = (yyvsp[0].str); n->missing_ok = false; (yyval.node) = (Node *)n; } #line 37544 "gram.c" /* yacc.c:1646 */ break; case 1301: #line 8962 "gram.y" /* yacc.c:1646 */ { RenameStmt *n = makeNode(RenameStmt); n->renameType = OBJECT_TSTEMPLATE; n->object = (Node *) (yyvsp[-3].list); n->newname = (yyvsp[0].str); n->missing_ok = false; (yyval.node) = (Node *)n; } #line 37557 "gram.c" /* yacc.c:1646 */ break; case 1302: #line 8971 "gram.y" /* yacc.c:1646 */ { RenameStmt *n = makeNode(RenameStmt); n->renameType = OBJECT_TSCONFIGURATION; n->object = (Node *) (yyvsp[-3].list); n->newname = (yyvsp[0].str); n->missing_ok = false; (yyval.node) = (Node *)n; } #line 37570 "gram.c" /* yacc.c:1646 */ break; case 1303: #line 8980 "gram.y" /* yacc.c:1646 */ { RenameStmt *n = makeNode(RenameStmt); n->renameType = OBJECT_TYPE; n->object = (Node *) (yyvsp[-3].list); n->newname = (yyvsp[0].str); n->missing_ok = false; (yyval.node) = (Node *)n; } #line 37583 "gram.c" /* yacc.c:1646 */ break; case 1304: #line 8989 "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 37599 "gram.c" /* yacc.c:1646 */ break; case 1305: #line 9002 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = COLUMN; } #line 37605 "gram.c" /* yacc.c:1646 */ break; case 1306: #line 9003 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = 0; } #line 37611 "gram.c" /* yacc.c:1646 */ break; case 1307: #line 9006 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = 1; } #line 37617 "gram.c" /* yacc.c:1646 */ break; case 1308: #line 9007 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = 0; } #line 37623 "gram.c" /* yacc.c:1646 */ break; case 1309: #line 9018 "gram.y" /* yacc.c:1646 */ { AlterObjectDependsStmt *n = makeNode(AlterObjectDependsStmt); n->objectType = OBJECT_FUNCTION; n->object = (Node *) (yyvsp[-4].objwithargs); n->extname = makeString((yyvsp[0].str)); (yyval.node) = (Node *)n; } #line 37635 "gram.c" /* yacc.c:1646 */ break; case 1310: #line 9026 "gram.y" /* yacc.c:1646 */ { AlterObjectDependsStmt *n = makeNode(AlterObjectDependsStmt); n->objectType = OBJECT_PROCEDURE; n->object = (Node *) (yyvsp[-4].objwithargs); n->extname = makeString((yyvsp[0].str)); (yyval.node) = (Node *)n; } #line 37647 "gram.c" /* yacc.c:1646 */ break; case 1311: #line 9034 "gram.y" /* yacc.c:1646 */ { AlterObjectDependsStmt *n = makeNode(AlterObjectDependsStmt); n->objectType = OBJECT_ROUTINE; n->object = (Node *) (yyvsp[-4].objwithargs); n->extname = makeString((yyvsp[0].str)); (yyval.node) = (Node *)n; } #line 37659 "gram.c" /* yacc.c:1646 */ break; case 1312: #line 9042 "gram.y" /* yacc.c:1646 */ { AlterObjectDependsStmt *n = makeNode(AlterObjectDependsStmt); n->objectType = OBJECT_TRIGGER; n->relation = (yyvsp[-4].range); n->object = (Node *) list_make1(makeString((yyvsp[-6].str))); n->extname = makeString((yyvsp[0].str)); (yyval.node) = (Node *)n; } #line 37672 "gram.c" /* yacc.c:1646 */ break; case 1313: #line 9051 "gram.y" /* yacc.c:1646 */ { AlterObjectDependsStmt *n = makeNode(AlterObjectDependsStmt); n->objectType = OBJECT_MATVIEW; n->relation = (yyvsp[-4].range); n->extname = makeString((yyvsp[0].str)); (yyval.node) = (Node *)n; } #line 37684 "gram.c" /* yacc.c:1646 */ break; case 1314: #line 9059 "gram.y" /* yacc.c:1646 */ { AlterObjectDependsStmt *n = makeNode(AlterObjectDependsStmt); n->objectType = OBJECT_INDEX; n->relation = (yyvsp[-4].range); n->extname = makeString((yyvsp[0].str)); (yyval.node) = (Node *)n; } #line 37696 "gram.c" /* yacc.c:1646 */ break; case 1315: #line 9076 "gram.y" /* yacc.c:1646 */ { AlterObjectSchemaStmt *n = makeNode(AlterObjectSchemaStmt); n->objectType = OBJECT_AGGREGATE; n->object = (Node *) (yyvsp[-3].objwithargs); n->newschema = (yyvsp[0].str); n->missing_ok = false; (yyval.node) = (Node *)n; } #line 37709 "gram.c" /* yacc.c:1646 */ break; case 1316: #line 9085 "gram.y" /* yacc.c:1646 */ { AlterObjectSchemaStmt *n = makeNode(AlterObjectSchemaStmt); n->objectType = OBJECT_COLLATION; n->object = (Node *) (yyvsp[-3].list); n->newschema = (yyvsp[0].str); n->missing_ok = false; (yyval.node) = (Node *)n; } #line 37722 "gram.c" /* yacc.c:1646 */ break; case 1317: #line 9094 "gram.y" /* yacc.c:1646 */ { AlterObjectSchemaStmt *n = makeNode(AlterObjectSchemaStmt); n->objectType = OBJECT_CONVERSION; n->object = (Node *) (yyvsp[-3].list); n->newschema = (yyvsp[0].str); n->missing_ok = false; (yyval.node) = (Node *)n; } #line 37735 "gram.c" /* yacc.c:1646 */ break; case 1318: #line 9103 "gram.y" /* yacc.c:1646 */ { AlterObjectSchemaStmt *n = makeNode(AlterObjectSchemaStmt); n->objectType = OBJECT_DOMAIN; n->object = (Node *) (yyvsp[-3].list); n->newschema = (yyvsp[0].str); n->missing_ok = false; (yyval.node) = (Node *)n; } #line 37748 "gram.c" /* yacc.c:1646 */ break; case 1319: #line 9112 "gram.y" /* yacc.c:1646 */ { AlterObjectSchemaStmt *n = makeNode(AlterObjectSchemaStmt); n->objectType = OBJECT_EXTENSION; n->object = (Node *) makeString((yyvsp[-3].str)); n->newschema = (yyvsp[0].str); n->missing_ok = false; (yyval.node) = (Node *)n; } #line 37761 "gram.c" /* yacc.c:1646 */ break; case 1320: #line 9121 "gram.y" /* yacc.c:1646 */ { AlterObjectSchemaStmt *n = makeNode(AlterObjectSchemaStmt); n->objectType = OBJECT_FUNCTION; n->object = (Node *) (yyvsp[-3].objwithargs); n->newschema = (yyvsp[0].str); n->missing_ok = false; (yyval.node) = (Node *)n; } #line 37774 "gram.c" /* yacc.c:1646 */ break; case 1321: #line 9130 "gram.y" /* yacc.c:1646 */ { AlterObjectSchemaStmt *n = makeNode(AlterObjectSchemaStmt); n->objectType = OBJECT_OPERATOR; n->object = (Node *) (yyvsp[-3].objwithargs); n->newschema = (yyvsp[0].str); n->missing_ok = false; (yyval.node) = (Node *)n; } #line 37787 "gram.c" /* yacc.c:1646 */ break; case 1322: #line 9139 "gram.y" /* yacc.c:1646 */ { AlterObjectSchemaStmt *n = makeNode(AlterObjectSchemaStmt); n->objectType = OBJECT_OPCLASS; n->object = (Node *) lcons(makeString((yyvsp[-3].str)), (yyvsp[-5].list)); n->newschema = (yyvsp[0].str); n->missing_ok = false; (yyval.node) = (Node *)n; } #line 37800 "gram.c" /* yacc.c:1646 */ break; case 1323: #line 9148 "gram.y" /* yacc.c:1646 */ { AlterObjectSchemaStmt *n = makeNode(AlterObjectSchemaStmt); n->objectType = OBJECT_OPFAMILY; n->object = (Node *) lcons(makeString((yyvsp[-3].str)), (yyvsp[-5].list)); n->newschema = (yyvsp[0].str); n->missing_ok = false; (yyval.node) = (Node *)n; } #line 37813 "gram.c" /* yacc.c:1646 */ break; case 1324: #line 9157 "gram.y" /* yacc.c:1646 */ { AlterObjectSchemaStmt *n = makeNode(AlterObjectSchemaStmt); n->objectType = OBJECT_PROCEDURE; n->object = (Node *) (yyvsp[-3].objwithargs); n->newschema = (yyvsp[0].str); n->missing_ok = false; (yyval.node) = (Node *)n; } #line 37826 "gram.c" /* yacc.c:1646 */ break; case 1325: #line 9166 "gram.y" /* yacc.c:1646 */ { AlterObjectSchemaStmt *n = makeNode(AlterObjectSchemaStmt); n->objectType = OBJECT_ROUTINE; n->object = (Node *) (yyvsp[-3].objwithargs); n->newschema = (yyvsp[0].str); n->missing_ok = false; (yyval.node) = (Node *)n; } #line 37839 "gram.c" /* yacc.c:1646 */ break; case 1326: #line 9175 "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 37852 "gram.c" /* yacc.c:1646 */ break; case 1327: #line 9184 "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 37865 "gram.c" /* yacc.c:1646 */ break; case 1328: #line 9193 "gram.y" /* yacc.c:1646 */ { AlterObjectSchemaStmt *n = makeNode(AlterObjectSchemaStmt); n->objectType = OBJECT_STATISTIC_EXT; n->object = (Node *) (yyvsp[-3].list); n->newschema = (yyvsp[0].str); n->missing_ok = false; (yyval.node) = (Node *)n; } #line 37878 "gram.c" /* yacc.c:1646 */ break; case 1329: #line 9202 "gram.y" /* yacc.c:1646 */ { AlterObjectSchemaStmt *n = makeNode(AlterObjectSchemaStmt); n->objectType = OBJECT_TSPARSER; n->object = (Node *) (yyvsp[-3].list); n->newschema = (yyvsp[0].str); n->missing_ok = false; (yyval.node) = (Node *)n; } #line 37891 "gram.c" /* yacc.c:1646 */ break; case 1330: #line 9211 "gram.y" /* yacc.c:1646 */ { AlterObjectSchemaStmt *n = makeNode(AlterObjectSchemaStmt); n->objectType = OBJECT_TSDICTIONARY; n->object = (Node *) (yyvsp[-3].list); n->newschema = (yyvsp[0].str); n->missing_ok = false; (yyval.node) = (Node *)n; } #line 37904 "gram.c" /* yacc.c:1646 */ break; case 1331: #line 9220 "gram.y" /* yacc.c:1646 */ { AlterObjectSchemaStmt *n = makeNode(AlterObjectSchemaStmt); n->objectType = OBJECT_TSTEMPLATE; n->object = (Node *) (yyvsp[-3].list); n->newschema = (yyvsp[0].str); n->missing_ok = false; (yyval.node) = (Node *)n; } #line 37917 "gram.c" /* yacc.c:1646 */ break; case 1332: #line 9229 "gram.y" /* yacc.c:1646 */ { AlterObjectSchemaStmt *n = makeNode(AlterObjectSchemaStmt); n->objectType = OBJECT_TSCONFIGURATION; n->object = (Node *) (yyvsp[-3].list); n->newschema = (yyvsp[0].str); n->missing_ok = false; (yyval.node) = (Node *)n; } #line 37930 "gram.c" /* yacc.c:1646 */ break; case 1333: #line 9238 "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 37943 "gram.c" /* yacc.c:1646 */ break; case 1334: #line 9247 "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 37956 "gram.c" /* yacc.c:1646 */ break; case 1335: #line 9256 "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 37969 "gram.c" /* yacc.c:1646 */ break; case 1336: #line 9265 "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 37982 "gram.c" /* yacc.c:1646 */ break; case 1337: #line 9274 "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 37995 "gram.c" /* yacc.c:1646 */ break; case 1338: #line 9283 "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 38008 "gram.c" /* yacc.c:1646 */ break; case 1339: #line 9292 "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 38021 "gram.c" /* yacc.c:1646 */ break; case 1340: #line 9301 "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 38034 "gram.c" /* yacc.c:1646 */ break; case 1341: #line 9310 "gram.y" /* yacc.c:1646 */ { AlterObjectSchemaStmt *n = makeNode(AlterObjectSchemaStmt); n->objectType = OBJECT_TYPE; n->object = (Node *) (yyvsp[-3].list); n->newschema = (yyvsp[0].str); n->missing_ok = false; (yyval.node) = (Node *)n; } #line 38047 "gram.c" /* yacc.c:1646 */ break; case 1342: #line 9328 "gram.y" /* yacc.c:1646 */ { AlterOperatorStmt *n = makeNode(AlterOperatorStmt); n->opername = (yyvsp[-4].objwithargs); n->options = (yyvsp[-1].list); (yyval.node) = (Node *)n; } #line 38058 "gram.c" /* yacc.c:1646 */ break; case 1343: #line 9336 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].defelt)); } #line 38064 "gram.c" /* yacc.c:1646 */ break; case 1344: #line 9337 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].defelt)); } #line 38070 "gram.c" /* yacc.c:1646 */ break; case 1345: #line 9341 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem((yyvsp[-2].str), NULL, (yylsp[-2])); } #line 38076 "gram.c" /* yacc.c:1646 */ break; case 1346: #line 9343 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem((yyvsp[-2].str), (Node *) (yyvsp[0].node), (yylsp[-2])); } #line 38082 "gram.c" /* yacc.c:1646 */ break; case 1347: #line 9348 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *)(yyvsp[0].typnam); } #line 38088 "gram.c" /* yacc.c:1646 */ break; case 1348: #line 9349 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *)makeString(pstrdup((yyvsp[0].keyword))); } #line 38094 "gram.c" /* yacc.c:1646 */ break; case 1349: #line 9350 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *)(yyvsp[0].list); } #line 38100 "gram.c" /* yacc.c:1646 */ break; case 1350: #line 9351 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *)(yyvsp[0].value); } #line 38106 "gram.c" /* yacc.c:1646 */ break; case 1351: #line 9352 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *)makeString((yyvsp[0].str)); } #line 38112 "gram.c" /* yacc.c:1646 */ break; case 1352: #line 9362 "gram.y" /* yacc.c:1646 */ { AlterOwnerStmt *n = makeNode(AlterOwnerStmt); n->objectType = OBJECT_AGGREGATE; n->object = (Node *) (yyvsp[-3].objwithargs); n->newowner = (yyvsp[0].rolespec); (yyval.node) = (Node *)n; } #line 38124 "gram.c" /* yacc.c:1646 */ break; case 1353: #line 9370 "gram.y" /* yacc.c:1646 */ { AlterOwnerStmt *n = makeNode(AlterOwnerStmt); n->objectType = OBJECT_COLLATION; n->object = (Node *) (yyvsp[-3].list); n->newowner = (yyvsp[0].rolespec); (yyval.node) = (Node *)n; } #line 38136 "gram.c" /* yacc.c:1646 */ break; case 1354: #line 9378 "gram.y" /* yacc.c:1646 */ { AlterOwnerStmt *n = makeNode(AlterOwnerStmt); n->objectType = OBJECT_CONVERSION; n->object = (Node *) (yyvsp[-3].list); n->newowner = (yyvsp[0].rolespec); (yyval.node) = (Node *)n; } #line 38148 "gram.c" /* yacc.c:1646 */ break; case 1355: #line 9386 "gram.y" /* yacc.c:1646 */ { AlterOwnerStmt *n = makeNode(AlterOwnerStmt); n->objectType = OBJECT_DATABASE; n->object = (Node *) makeString((yyvsp[-3].str)); n->newowner = (yyvsp[0].rolespec); (yyval.node) = (Node *)n; } #line 38160 "gram.c" /* yacc.c:1646 */ break; case 1356: #line 9394 "gram.y" /* yacc.c:1646 */ { AlterOwnerStmt *n = makeNode(AlterOwnerStmt); n->objectType = OBJECT_DOMAIN; n->object = (Node *) (yyvsp[-3].list); n->newowner = (yyvsp[0].rolespec); (yyval.node) = (Node *)n; } #line 38172 "gram.c" /* yacc.c:1646 */ break; case 1357: #line 9402 "gram.y" /* yacc.c:1646 */ { AlterOwnerStmt *n = makeNode(AlterOwnerStmt); n->objectType = OBJECT_FUNCTION; n->object = (Node *) (yyvsp[-3].objwithargs); n->newowner = (yyvsp[0].rolespec); (yyval.node) = (Node *)n; } #line 38184 "gram.c" /* yacc.c:1646 */ break; case 1358: #line 9410 "gram.y" /* yacc.c:1646 */ { AlterOwnerStmt *n = makeNode(AlterOwnerStmt); n->objectType = OBJECT_LANGUAGE; n->object = (Node *) makeString((yyvsp[-3].str)); n->newowner = (yyvsp[0].rolespec); (yyval.node) = (Node *)n; } #line 38196 "gram.c" /* yacc.c:1646 */ break; case 1359: #line 9418 "gram.y" /* yacc.c:1646 */ { AlterOwnerStmt *n = makeNode(AlterOwnerStmt); n->objectType = OBJECT_LARGEOBJECT; n->object = (Node *) (yyvsp[-3].value); n->newowner = (yyvsp[0].rolespec); (yyval.node) = (Node *)n; } #line 38208 "gram.c" /* yacc.c:1646 */ break; case 1360: #line 9426 "gram.y" /* yacc.c:1646 */ { AlterOwnerStmt *n = makeNode(AlterOwnerStmt); n->objectType = OBJECT_OPERATOR; n->object = (Node *) (yyvsp[-3].objwithargs); n->newowner = (yyvsp[0].rolespec); (yyval.node) = (Node *)n; } #line 38220 "gram.c" /* yacc.c:1646 */ break; case 1361: #line 9434 "gram.y" /* yacc.c:1646 */ { AlterOwnerStmt *n = makeNode(AlterOwnerStmt); n->objectType = OBJECT_OPCLASS; n->object = (Node *) lcons(makeString((yyvsp[-3].str)), (yyvsp[-5].list)); n->newowner = (yyvsp[0].rolespec); (yyval.node) = (Node *)n; } #line 38232 "gram.c" /* yacc.c:1646 */ break; case 1362: #line 9442 "gram.y" /* yacc.c:1646 */ { AlterOwnerStmt *n = makeNode(AlterOwnerStmt); n->objectType = OBJECT_OPFAMILY; n->object = (Node *) lcons(makeString((yyvsp[-3].str)), (yyvsp[-5].list)); n->newowner = (yyvsp[0].rolespec); (yyval.node) = (Node *)n; } #line 38244 "gram.c" /* yacc.c:1646 */ break; case 1363: #line 9450 "gram.y" /* yacc.c:1646 */ { AlterOwnerStmt *n = makeNode(AlterOwnerStmt); n->objectType = OBJECT_PROCEDURE; n->object = (Node *) (yyvsp[-3].objwithargs); n->newowner = (yyvsp[0].rolespec); (yyval.node) = (Node *)n; } #line 38256 "gram.c" /* yacc.c:1646 */ break; case 1364: #line 9458 "gram.y" /* yacc.c:1646 */ { AlterOwnerStmt *n = makeNode(AlterOwnerStmt); n->objectType = OBJECT_ROUTINE; n->object = (Node *) (yyvsp[-3].objwithargs); n->newowner = (yyvsp[0].rolespec); (yyval.node) = (Node *)n; } #line 38268 "gram.c" /* yacc.c:1646 */ break; case 1365: #line 9466 "gram.y" /* yacc.c:1646 */ { AlterOwnerStmt *n = makeNode(AlterOwnerStmt); n->objectType = OBJECT_SCHEMA; n->object = (Node *) makeString((yyvsp[-3].str)); n->newowner = (yyvsp[0].rolespec); (yyval.node) = (Node *)n; } #line 38280 "gram.c" /* yacc.c:1646 */ break; case 1366: #line 9474 "gram.y" /* yacc.c:1646 */ { AlterOwnerStmt *n = makeNode(AlterOwnerStmt); n->objectType = OBJECT_TYPE; n->object = (Node *) (yyvsp[-3].list); n->newowner = (yyvsp[0].rolespec); (yyval.node) = (Node *)n; } #line 38292 "gram.c" /* yacc.c:1646 */ break; case 1367: #line 9482 "gram.y" /* yacc.c:1646 */ { AlterOwnerStmt *n = makeNode(AlterOwnerStmt); n->objectType = OBJECT_TABLESPACE; n->object = (Node *) makeString((yyvsp[-3].str)); n->newowner = (yyvsp[0].rolespec); (yyval.node) = (Node *)n; } #line 38304 "gram.c" /* yacc.c:1646 */ break; case 1368: #line 9490 "gram.y" /* yacc.c:1646 */ { AlterOwnerStmt *n = makeNode(AlterOwnerStmt); n->objectType = OBJECT_STATISTIC_EXT; n->object = (Node *) (yyvsp[-3].list); n->newowner = (yyvsp[0].rolespec); (yyval.node) = (Node *)n; } #line 38316 "gram.c" /* yacc.c:1646 */ break; case 1369: #line 9498 "gram.y" /* yacc.c:1646 */ { AlterOwnerStmt *n = makeNode(AlterOwnerStmt); n->objectType = OBJECT_TSDICTIONARY; n->object = (Node *) (yyvsp[-3].list); n->newowner = (yyvsp[0].rolespec); (yyval.node) = (Node *)n; } #line 38328 "gram.c" /* yacc.c:1646 */ break; case 1370: #line 9506 "gram.y" /* yacc.c:1646 */ { AlterOwnerStmt *n = makeNode(AlterOwnerStmt); n->objectType = OBJECT_TSCONFIGURATION; n->object = (Node *) (yyvsp[-3].list); n->newowner = (yyvsp[0].rolespec); (yyval.node) = (Node *)n; } #line 38340 "gram.c" /* yacc.c:1646 */ break; case 1371: #line 9514 "gram.y" /* yacc.c:1646 */ { AlterOwnerStmt *n = makeNode(AlterOwnerStmt); n->objectType = OBJECT_FDW; n->object = (Node *) makeString((yyvsp[-3].str)); n->newowner = (yyvsp[0].rolespec); (yyval.node) = (Node *)n; } #line 38352 "gram.c" /* yacc.c:1646 */ break; case 1372: #line 9522 "gram.y" /* yacc.c:1646 */ { AlterOwnerStmt *n = makeNode(AlterOwnerStmt); n->objectType = OBJECT_FOREIGN_SERVER; n->object = (Node *) makeString((yyvsp[-3].str)); n->newowner = (yyvsp[0].rolespec); (yyval.node) = (Node *)n; } #line 38364 "gram.c" /* yacc.c:1646 */ break; case 1373: #line 9530 "gram.y" /* yacc.c:1646 */ { AlterOwnerStmt *n = makeNode(AlterOwnerStmt); n->objectType = OBJECT_EVENT_TRIGGER; n->object = (Node *) makeString((yyvsp[-3].str)); n->newowner = (yyvsp[0].rolespec); (yyval.node) = (Node *)n; } #line 38376 "gram.c" /* yacc.c:1646 */ break; case 1374: #line 9538 "gram.y" /* yacc.c:1646 */ { AlterOwnerStmt *n = makeNode(AlterOwnerStmt); n->objectType = OBJECT_PUBLICATION; n->object = (Node *) makeString((yyvsp[-3].str)); n->newowner = (yyvsp[0].rolespec); (yyval.node) = (Node *)n; } #line 38388 "gram.c" /* yacc.c:1646 */ break; case 1375: #line 9546 "gram.y" /* yacc.c:1646 */ { AlterOwnerStmt *n = makeNode(AlterOwnerStmt); n->objectType = OBJECT_SUBSCRIPTION; n->object = (Node *) makeString((yyvsp[-3].str)); n->newowner = (yyvsp[0].rolespec); (yyval.node) = (Node *)n; } #line 38400 "gram.c" /* yacc.c:1646 */ break; case 1376: #line 9564 "gram.y" /* yacc.c:1646 */ { CreatePublicationStmt *n = makeNode(CreatePublicationStmt); n->pubname = (yyvsp[-2].str); n->options = (yyvsp[0].list); if ((yyvsp[-1].node) != NULL) { /* FOR TABLE */ if (IsA((yyvsp[-1].node), List)) n->tables = (List *)(yyvsp[-1].node); /* FOR ALL TABLES */ else n->for_all_tables = true; } (yyval.node) = (Node *)n; } #line 38420 "gram.c" /* yacc.c:1646 */ break; case 1377: #line 9582 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 38426 "gram.c" /* yacc.c:1646 */ break; case 1378: #line 9583 "gram.y" /* yacc.c:1646 */ { (yyval.node) = NULL; } #line 38432 "gram.c" /* yacc.c:1646 */ break; case 1379: #line 9588 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) (yyvsp[0].list); } #line 38440 "gram.c" /* yacc.c:1646 */ break; case 1380: #line 9592 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeInteger(true); } #line 38448 "gram.c" /* yacc.c:1646 */ break; case 1381: #line 9612 "gram.y" /* yacc.c:1646 */ { AlterPublicationStmt *n = makeNode(AlterPublicationStmt); n->pubname = (yyvsp[-2].str); n->options = (yyvsp[0].list); (yyval.node) = (Node *)n; } #line 38459 "gram.c" /* yacc.c:1646 */ break; case 1382: #line 9619 "gram.y" /* yacc.c:1646 */ { AlterPublicationStmt *n = makeNode(AlterPublicationStmt); n->pubname = (yyvsp[-3].str); n->tables = (yyvsp[0].list); n->tableAction = DEFELEM_ADD; (yyval.node) = (Node *)n; } #line 38471 "gram.c" /* yacc.c:1646 */ break; case 1383: #line 9627 "gram.y" /* yacc.c:1646 */ { AlterPublicationStmt *n = makeNode(AlterPublicationStmt); n->pubname = (yyvsp[-3].str); n->tables = (yyvsp[0].list); n->tableAction = DEFELEM_SET; (yyval.node) = (Node *)n; } #line 38483 "gram.c" /* yacc.c:1646 */ break; case 1384: #line 9635 "gram.y" /* yacc.c:1646 */ { AlterPublicationStmt *n = makeNode(AlterPublicationStmt); n->pubname = (yyvsp[-3].str); n->tables = (yyvsp[0].list); n->tableAction = DEFELEM_DROP; (yyval.node) = (Node *)n; } #line 38495 "gram.c" /* yacc.c:1646 */ break; case 1385: #line 9652 "gram.y" /* yacc.c:1646 */ { CreateSubscriptionStmt *n = makeNode(CreateSubscriptionStmt); n->subname = (yyvsp[-5].str); n->conninfo = (yyvsp[-3].str); n->publication = (yyvsp[-1].list); n->options = (yyvsp[0].list); (yyval.node) = (Node *)n; } #line 38509 "gram.c" /* yacc.c:1646 */ break; case 1386: #line 9665 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].value)); } #line 38517 "gram.c" /* yacc.c:1646 */ break; case 1387: #line 9669 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].value)); } #line 38525 "gram.c" /* yacc.c:1646 */ break; case 1388: #line 9675 "gram.y" /* yacc.c:1646 */ { (yyval.value) = makeString((yyvsp[0].str)); } #line 38531 "gram.c" /* yacc.c:1646 */ break; case 1389: #line 9685 "gram.y" /* yacc.c:1646 */ { AlterSubscriptionStmt *n = makeNode(AlterSubscriptionStmt); n->kind = ALTER_SUBSCRIPTION_OPTIONS; n->subname = (yyvsp[-2].str); n->options = (yyvsp[0].list); (yyval.node) = (Node *)n; } #line 38544 "gram.c" /* yacc.c:1646 */ break; case 1390: #line 9694 "gram.y" /* yacc.c:1646 */ { AlterSubscriptionStmt *n = makeNode(AlterSubscriptionStmt); n->kind = ALTER_SUBSCRIPTION_CONNECTION; n->subname = (yyvsp[-2].str); n->conninfo = (yyvsp[0].str); (yyval.node) = (Node *)n; } #line 38557 "gram.c" /* yacc.c:1646 */ break; case 1391: #line 9703 "gram.y" /* yacc.c:1646 */ { AlterSubscriptionStmt *n = makeNode(AlterSubscriptionStmt); n->kind = ALTER_SUBSCRIPTION_REFRESH; n->subname = (yyvsp[-3].str); n->options = (yyvsp[0].list); (yyval.node) = (Node *)n; } #line 38570 "gram.c" /* yacc.c:1646 */ break; case 1392: #line 9712 "gram.y" /* yacc.c:1646 */ { AlterSubscriptionStmt *n = makeNode(AlterSubscriptionStmt); n->kind = ALTER_SUBSCRIPTION_PUBLICATION; n->subname = (yyvsp[-4].str); n->publication = (yyvsp[-1].list); n->options = (yyvsp[0].list); (yyval.node) = (Node *)n; } #line 38584 "gram.c" /* yacc.c:1646 */ break; case 1393: #line 9722 "gram.y" /* yacc.c:1646 */ { AlterSubscriptionStmt *n = makeNode(AlterSubscriptionStmt); n->kind = ALTER_SUBSCRIPTION_ENABLED; n->subname = (yyvsp[-1].str); n->options = list_make1(makeDefElem("enabled", (Node *)makeInteger(true), (yylsp[-3]))); (yyval.node) = (Node *)n; } #line 38598 "gram.c" /* yacc.c:1646 */ break; case 1394: #line 9732 "gram.y" /* yacc.c:1646 */ { AlterSubscriptionStmt *n = makeNode(AlterSubscriptionStmt); n->kind = ALTER_SUBSCRIPTION_ENABLED; n->subname = (yyvsp[-1].str); n->options = list_make1(makeDefElem("enabled", (Node *)makeInteger(false), (yylsp[-3]))); (yyval.node) = (Node *)n; } #line 38612 "gram.c" /* yacc.c:1646 */ break; case 1395: #line 9750 "gram.y" /* yacc.c:1646 */ { DropSubscriptionStmt *n = makeNode(DropSubscriptionStmt); n->subname = (yyvsp[-1].str); n->missing_ok = false; n->behavior = (yyvsp[0].dbehavior); (yyval.node) = (Node *) n; } #line 38624 "gram.c" /* yacc.c:1646 */ break; case 1396: #line 9758 "gram.y" /* yacc.c:1646 */ { DropSubscriptionStmt *n = makeNode(DropSubscriptionStmt); n->subname = (yyvsp[-1].str); n->missing_ok = true; n->behavior = (yyvsp[0].dbehavior); (yyval.node) = (Node *) n; } #line 38636 "gram.c" /* yacc.c:1646 */ break; case 1397: #line 9776 "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 38652 "gram.c" /* yacc.c:1646 */ break; case 1398: #line 9790 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 38658 "gram.c" /* yacc.c:1646 */ break; case 1399: #line 9791 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].node)); } #line 38664 "gram.c" /* yacc.c:1646 */ break; case 1400: #line 9792 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[-1].list); } #line 38670 "gram.c" /* yacc.c:1646 */ break; case 1401: #line 9798 "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 38680 "gram.c" /* yacc.c:1646 */ break; case 1402: #line 9804 "gram.y" /* yacc.c:1646 */ { if ((yyvsp[0].node) != NULL) (yyval.list) = list_make1((yyvsp[0].node)); else (yyval.list) = NIL; } #line 38690 "gram.c" /* yacc.c:1646 */ break; case 1408: #line 9820 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 38696 "gram.c" /* yacc.c:1646 */ break; case 1409: #line 9821 "gram.y" /* yacc.c:1646 */ { (yyval.node) = NULL; } #line 38702 "gram.c" /* yacc.c:1646 */ break; case 1410: #line 9824 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = CMD_SELECT; } #line 38708 "gram.c" /* yacc.c:1646 */ break; case 1411: #line 9825 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = CMD_UPDATE; } #line 38714 "gram.c" /* yacc.c:1646 */ break; case 1412: #line 9826 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = CMD_DELETE; } #line 38720 "gram.c" /* yacc.c:1646 */ break; case 1413: #line 9827 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = CMD_INSERT; } #line 38726 "gram.c" /* yacc.c:1646 */ break; case 1414: #line 9831 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = true; } #line 38732 "gram.c" /* yacc.c:1646 */ break; case 1415: #line 9832 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = false; } #line 38738 "gram.c" /* yacc.c:1646 */ break; case 1416: #line 9833 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = false; } #line 38744 "gram.c" /* yacc.c:1646 */ break; case 1417: #line 9846 "gram.y" /* yacc.c:1646 */ { NotifyStmt *n = makeNode(NotifyStmt); n->conditionname = (yyvsp[-1].str); n->payload = (yyvsp[0].str); (yyval.node) = (Node *)n; } #line 38755 "gram.c" /* yacc.c:1646 */ break; case 1418: #line 9855 "gram.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 38761 "gram.c" /* yacc.c:1646 */ break; case 1419: #line 9856 "gram.y" /* yacc.c:1646 */ { (yyval.str) = NULL; } #line 38767 "gram.c" /* yacc.c:1646 */ break; case 1420: #line 9860 "gram.y" /* yacc.c:1646 */ { ListenStmt *n = makeNode(ListenStmt); n->conditionname = (yyvsp[0].str); (yyval.node) = (Node *)n; } #line 38777 "gram.c" /* yacc.c:1646 */ break; case 1421: #line 9869 "gram.y" /* yacc.c:1646 */ { UnlistenStmt *n = makeNode(UnlistenStmt); n->conditionname = (yyvsp[0].str); (yyval.node) = (Node *)n; } #line 38787 "gram.c" /* yacc.c:1646 */ break; case 1422: #line 9875 "gram.y" /* yacc.c:1646 */ { UnlistenStmt *n = makeNode(UnlistenStmt); n->conditionname = NULL; (yyval.node) = (Node *)n; } #line 38797 "gram.c" /* yacc.c:1646 */ break; case 1423: #line 9894 "gram.y" /* yacc.c:1646 */ { TransactionStmt *n = makeNode(TransactionStmt); n->kind = TRANS_STMT_ROLLBACK; n->options = NIL; n->chain = (yyvsp[0].boolean); (yyval.node) = (Node *)n; } #line 38809 "gram.c" /* yacc.c:1646 */ break; case 1424: #line 9902 "gram.y" /* yacc.c:1646 */ { TransactionStmt *n = makeNode(TransactionStmt); n->kind = TRANS_STMT_BEGIN; n->options = (yyvsp[0].list); (yyval.node) = (Node *)n; } #line 38820 "gram.c" /* yacc.c:1646 */ break; case 1425: #line 9909 "gram.y" /* yacc.c:1646 */ { TransactionStmt *n = makeNode(TransactionStmt); n->kind = TRANS_STMT_START; n->options = (yyvsp[0].list); (yyval.node) = (Node *)n; } #line 38831 "gram.c" /* yacc.c:1646 */ break; case 1426: #line 9916 "gram.y" /* yacc.c:1646 */ { TransactionStmt *n = makeNode(TransactionStmt); n->kind = TRANS_STMT_COMMIT; n->options = NIL; n->chain = (yyvsp[0].boolean); (yyval.node) = (Node *)n; } #line 38843 "gram.c" /* yacc.c:1646 */ break; case 1427: #line 9924 "gram.y" /* yacc.c:1646 */ { TransactionStmt *n = makeNode(TransactionStmt); n->kind = TRANS_STMT_COMMIT; n->options = NIL; n->chain = (yyvsp[0].boolean); (yyval.node) = (Node *)n; } #line 38855 "gram.c" /* yacc.c:1646 */ break; case 1428: #line 9932 "gram.y" /* yacc.c:1646 */ { TransactionStmt *n = makeNode(TransactionStmt); n->kind = TRANS_STMT_ROLLBACK; n->options = NIL; n->chain = (yyvsp[0].boolean); (yyval.node) = (Node *)n; } #line 38867 "gram.c" /* yacc.c:1646 */ break; case 1429: #line 9940 "gram.y" /* yacc.c:1646 */ { TransactionStmt *n = makeNode(TransactionStmt); n->kind = TRANS_STMT_SAVEPOINT; n->savepoint_name = (yyvsp[0].str); (yyval.node) = (Node *)n; } #line 38878 "gram.c" /* yacc.c:1646 */ break; case 1430: #line 9947 "gram.y" /* yacc.c:1646 */ { TransactionStmt *n = makeNode(TransactionStmt); n->kind = TRANS_STMT_RELEASE; n->savepoint_name = (yyvsp[0].str); (yyval.node) = (Node *)n; } #line 38889 "gram.c" /* yacc.c:1646 */ break; case 1431: #line 9954 "gram.y" /* yacc.c:1646 */ { TransactionStmt *n = makeNode(TransactionStmt); n->kind = TRANS_STMT_RELEASE; n->savepoint_name = (yyvsp[0].str); (yyval.node) = (Node *)n; } #line 38900 "gram.c" /* yacc.c:1646 */ break; case 1432: #line 9961 "gram.y" /* yacc.c:1646 */ { TransactionStmt *n = makeNode(TransactionStmt); n->kind = TRANS_STMT_ROLLBACK_TO; n->savepoint_name = (yyvsp[0].str); (yyval.node) = (Node *)n; } #line 38911 "gram.c" /* yacc.c:1646 */ break; case 1433: #line 9968 "gram.y" /* yacc.c:1646 */ { TransactionStmt *n = makeNode(TransactionStmt); n->kind = TRANS_STMT_ROLLBACK_TO; n->savepoint_name = (yyvsp[0].str); (yyval.node) = (Node *)n; } #line 38922 "gram.c" /* yacc.c:1646 */ break; case 1434: #line 9975 "gram.y" /* yacc.c:1646 */ { TransactionStmt *n = makeNode(TransactionStmt); n->kind = TRANS_STMT_PREPARE; n->gid = (yyvsp[0].str); (yyval.node) = (Node *)n; } #line 38933 "gram.c" /* yacc.c:1646 */ break; case 1435: #line 9982 "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 38944 "gram.c" /* yacc.c:1646 */ break; case 1436: #line 9989 "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 38955 "gram.c" /* yacc.c:1646 */ break; case 1437: #line 9997 "gram.y" /* yacc.c:1646 */ {} #line 38961 "gram.c" /* yacc.c:1646 */ break; case 1438: #line 9998 "gram.y" /* yacc.c:1646 */ {} #line 38967 "gram.c" /* yacc.c:1646 */ break; case 1439: #line 9999 "gram.y" /* yacc.c:1646 */ {} #line 38973 "gram.c" /* yacc.c:1646 */ break; case 1440: #line 10004 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("transaction_isolation", makeStringConst((yyvsp[0].str), (yylsp[0])), (yylsp[-2])); } #line 38980 "gram.c" /* yacc.c:1646 */ break; case 1441: #line 10007 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("transaction_read_only", makeIntConst(true, (yylsp[-1])), (yylsp[-1])); } #line 38987 "gram.c" /* yacc.c:1646 */ break; case 1442: #line 10010 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("transaction_read_only", makeIntConst(false, (yylsp[-1])), (yylsp[-1])); } #line 38994 "gram.c" /* yacc.c:1646 */ break; case 1443: #line 10013 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("transaction_deferrable", makeIntConst(true, (yylsp[0])), (yylsp[0])); } #line 39001 "gram.c" /* yacc.c:1646 */ break; case 1444: #line 10016 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("transaction_deferrable", makeIntConst(false, (yylsp[-1])), (yylsp[-1])); } #line 39008 "gram.c" /* yacc.c:1646 */ break; case 1445: #line 10023 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].defelt)); } #line 39014 "gram.c" /* yacc.c:1646 */ break; case 1446: #line 10025 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].defelt)); } #line 39020 "gram.c" /* yacc.c:1646 */ break; case 1447: #line 10027 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-1].list), (yyvsp[0].defelt)); } #line 39026 "gram.c" /* yacc.c:1646 */ break; case 1449: #line 10033 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 39032 "gram.c" /* yacc.c:1646 */ break; case 1450: #line 10037 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = true; } #line 39038 "gram.c" /* yacc.c:1646 */ break; case 1451: #line 10038 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = false; } #line 39044 "gram.c" /* yacc.c:1646 */ break; case 1452: #line 10039 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = false; } #line 39050 "gram.c" /* yacc.c:1646 */ break; case 1453: #line 10053 "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 39066 "gram.c" /* yacc.c:1646 */ break; case 1454: #line 10066 "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 39082 "gram.c" /* yacc.c:1646 */ break; case 1455: #line 10079 "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 39103 "gram.c" /* yacc.c:1646 */ break; case 1456: #line 10097 "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 39124 "gram.c" /* yacc.c:1646 */ break; case 1457: #line 10116 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = CASCADED_CHECK_OPTION; } #line 39130 "gram.c" /* yacc.c:1646 */ break; case 1458: #line 10117 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = CASCADED_CHECK_OPTION; } #line 39136 "gram.c" /* yacc.c:1646 */ break; case 1459: #line 10118 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = LOCAL_CHECK_OPTION; } #line 39142 "gram.c" /* yacc.c:1646 */ break; case 1460: #line 10119 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = NO_CHECK_OPTION; } #line 39148 "gram.c" /* yacc.c:1646 */ break; case 1461: #line 10130 "gram.y" /* yacc.c:1646 */ { LoadStmt *n = makeNode(LoadStmt); n->filename = (yyvsp[0].str); (yyval.node) = (Node *)n; } #line 39158 "gram.c" /* yacc.c:1646 */ break; case 1462: #line 10146 "gram.y" /* yacc.c:1646 */ { CreatedbStmt *n = makeNode(CreatedbStmt); n->dbname = (yyvsp[-2].str); n->options = (yyvsp[0].list); (yyval.node) = (Node *)n; } #line 39169 "gram.c" /* yacc.c:1646 */ break; case 1463: #line 10155 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 39175 "gram.c" /* yacc.c:1646 */ break; case 1464: #line 10156 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 39181 "gram.c" /* yacc.c:1646 */ break; case 1465: #line 10160 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].defelt)); } #line 39187 "gram.c" /* yacc.c:1646 */ break; case 1466: #line 10161 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-1].list), (yyvsp[0].defelt)); } #line 39193 "gram.c" /* yacc.c:1646 */ break; case 1467: #line 10166 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem((yyvsp[-2].str), (Node *)makeInteger((yyvsp[0].ival)), (yylsp[-2])); } #line 39201 "gram.c" /* yacc.c:1646 */ break; case 1468: #line 10170 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem((yyvsp[-2].str), (Node *)makeString((yyvsp[0].str)), (yylsp[-2])); } #line 39209 "gram.c" /* yacc.c:1646 */ break; case 1469: #line 10174 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem((yyvsp[-2].str), NULL, (yylsp[-2])); } #line 39217 "gram.c" /* yacc.c:1646 */ break; case 1470: #line 10191 "gram.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 39223 "gram.c" /* yacc.c:1646 */ break; case 1471: #line 10192 "gram.y" /* yacc.c:1646 */ { (yyval.str) = pstrdup("connection_limit"); } #line 39229 "gram.c" /* yacc.c:1646 */ break; case 1472: #line 10193 "gram.y" /* yacc.c:1646 */ { (yyval.str) = pstrdup((yyvsp[0].keyword)); } #line 39235 "gram.c" /* yacc.c:1646 */ break; case 1473: #line 10194 "gram.y" /* yacc.c:1646 */ { (yyval.str) = pstrdup((yyvsp[0].keyword)); } #line 39241 "gram.c" /* yacc.c:1646 */ break; case 1474: #line 10195 "gram.y" /* yacc.c:1646 */ { (yyval.str) = pstrdup((yyvsp[0].keyword)); } #line 39247 "gram.c" /* yacc.c:1646 */ break; case 1475: #line 10196 "gram.y" /* yacc.c:1646 */ { (yyval.str) = pstrdup((yyvsp[0].keyword)); } #line 39253 "gram.c" /* yacc.c:1646 */ break; case 1476: #line 10197 "gram.y" /* yacc.c:1646 */ { (yyval.str) = pstrdup((yyvsp[0].keyword)); } #line 39259 "gram.c" /* yacc.c:1646 */ break; case 1477: #line 10204 "gram.y" /* yacc.c:1646 */ {} #line 39265 "gram.c" /* yacc.c:1646 */ break; case 1478: #line 10205 "gram.y" /* yacc.c:1646 */ {} #line 39271 "gram.c" /* yacc.c:1646 */ break; case 1479: #line 10217 "gram.y" /* yacc.c:1646 */ { AlterDatabaseStmt *n = makeNode(AlterDatabaseStmt); n->dbname = (yyvsp[-2].str); n->options = (yyvsp[0].list); (yyval.node) = (Node *)n; } #line 39282 "gram.c" /* yacc.c:1646 */ break; case 1480: #line 10224 "gram.y" /* yacc.c:1646 */ { AlterDatabaseStmt *n = makeNode(AlterDatabaseStmt); n->dbname = (yyvsp[-1].str); n->options = (yyvsp[0].list); (yyval.node) = (Node *)n; } #line 39293 "gram.c" /* yacc.c:1646 */ break; case 1481: #line 10231 "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)), (yylsp[0]))); (yyval.node) = (Node *)n; } #line 39305 "gram.c" /* yacc.c:1646 */ break; case 1482: #line 10242 "gram.y" /* yacc.c:1646 */ { AlterDatabaseSetStmt *n = makeNode(AlterDatabaseSetStmt); n->dbname = (yyvsp[-1].str); n->setstmt = (yyvsp[0].vsetstmt); (yyval.node) = (Node *)n; } #line 39316 "gram.c" /* yacc.c:1646 */ break; case 1483: #line 10259 "gram.y" /* yacc.c:1646 */ { DropdbStmt *n = makeNode(DropdbStmt); n->dbname = (yyvsp[0].str); n->missing_ok = false; (yyval.node) = (Node *)n; } #line 39327 "gram.c" /* yacc.c:1646 */ break; case 1484: #line 10266 "gram.y" /* yacc.c:1646 */ { DropdbStmt *n = makeNode(DropdbStmt); n->dbname = (yyvsp[0].str); n->missing_ok = true; (yyval.node) = (Node *)n; } #line 39338 "gram.c" /* yacc.c:1646 */ break; case 1485: #line 10282 "gram.y" /* yacc.c:1646 */ { AlterCollationStmt *n = makeNode(AlterCollationStmt); n->collname = (yyvsp[-2].list); (yyval.node) = (Node *)n; } #line 39348 "gram.c" /* yacc.c:1646 */ break; case 1486: #line 10299 "gram.y" /* yacc.c:1646 */ { AlterSystemStmt *n = makeNode(AlterSystemStmt); n->setstmt = (yyvsp[0].vsetstmt); (yyval.node) = (Node *)n; } #line 39358 "gram.c" /* yacc.c:1646 */ break; case 1487: #line 10305 "gram.y" /* yacc.c:1646 */ { AlterSystemStmt *n = makeNode(AlterSystemStmt); n->setstmt = (yyvsp[0].vsetstmt); (yyval.node) = (Node *)n; } #line 39368 "gram.c" /* yacc.c:1646 */ break; case 1488: #line 10321 "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 39381 "gram.c" /* yacc.c:1646 */ break; case 1489: #line 10334 "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 39393 "gram.c" /* yacc.c:1646 */ break; case 1490: #line 10343 "gram.y" /* yacc.c:1646 */ { AlterDomainStmt *n = makeNode(AlterDomainStmt); n->subtype = 'N'; n->typeName = (yyvsp[-3].list); (yyval.node) = (Node *)n; } #line 39404 "gram.c" /* yacc.c:1646 */ break; case 1491: #line 10351 "gram.y" /* yacc.c:1646 */ { AlterDomainStmt *n = makeNode(AlterDomainStmt); n->subtype = 'O'; n->typeName = (yyvsp[-3].list); (yyval.node) = (Node *)n; } #line 39415 "gram.c" /* yacc.c:1646 */ break; case 1492: #line 10359 "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 39427 "gram.c" /* yacc.c:1646 */ break; case 1493: #line 10368 "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 39441 "gram.c" /* yacc.c:1646 */ break; case 1494: #line 10379 "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 39455 "gram.c" /* yacc.c:1646 */ break; case 1495: #line 10390 "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 39467 "gram.c" /* yacc.c:1646 */ break; case 1496: #line 10399 "gram.y" /* yacc.c:1646 */ {} #line 39473 "gram.c" /* yacc.c:1646 */ break; case 1497: #line 10400 "gram.y" /* yacc.c:1646 */ {} #line 39479 "gram.c" /* yacc.c:1646 */ break; case 1498: #line 10412 "gram.y" /* yacc.c:1646 */ { AlterTSDictionaryStmt *n = makeNode(AlterTSDictionaryStmt); n->dictname = (yyvsp[-1].list); n->options = (yyvsp[0].list); (yyval.node) = (Node *)n; } #line 39490 "gram.c" /* yacc.c:1646 */ break; case 1499: #line 10422 "gram.y" /* yacc.c:1646 */ { AlterTSConfigurationStmt *n = makeNode(AlterTSConfigurationStmt); n->kind = ALTER_TSCONFIG_ADD_MAPPING; 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 39505 "gram.c" /* yacc.c:1646 */ break; case 1500: #line 10433 "gram.y" /* yacc.c:1646 */ { AlterTSConfigurationStmt *n = makeNode(AlterTSConfigurationStmt); n->kind = ALTER_TSCONFIG_ALTER_MAPPING_FOR_TOKEN; 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 39520 "gram.c" /* yacc.c:1646 */ break; case 1501: #line 10444 "gram.y" /* yacc.c:1646 */ { AlterTSConfigurationStmt *n = makeNode(AlterTSConfigurationStmt); n->kind = ALTER_TSCONFIG_REPLACE_DICT; 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 39535 "gram.c" /* yacc.c:1646 */ break; case 1502: #line 10455 "gram.y" /* yacc.c:1646 */ { AlterTSConfigurationStmt *n = makeNode(AlterTSConfigurationStmt); n->kind = ALTER_TSCONFIG_REPLACE_DICT_FOR_TOKEN; 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 39550 "gram.c" /* yacc.c:1646 */ break; case 1503: #line 10466 "gram.y" /* yacc.c:1646 */ { AlterTSConfigurationStmt *n = makeNode(AlterTSConfigurationStmt); n->kind = ALTER_TSCONFIG_DROP_MAPPING; n->cfgname = (yyvsp[-4].list); n->tokentype = (yyvsp[0].list); n->missing_ok = false; (yyval.node) = (Node*)n; } #line 39563 "gram.c" /* yacc.c:1646 */ break; case 1504: #line 10475 "gram.y" /* yacc.c:1646 */ { AlterTSConfigurationStmt *n = makeNode(AlterTSConfigurationStmt); n->kind = ALTER_TSCONFIG_DROP_MAPPING; n->cfgname = (yyvsp[-6].list); n->tokentype = (yyvsp[0].list); n->missing_ok = true; (yyval.node) = (Node*)n; } #line 39576 "gram.c" /* yacc.c:1646 */ break; case 1505: #line 10486 "gram.y" /* yacc.c:1646 */ {} #line 39582 "gram.c" /* yacc.c:1646 */ break; case 1506: #line 10487 "gram.y" /* yacc.c:1646 */ {} #line 39588 "gram.c" /* yacc.c:1646 */ break; case 1507: #line 10503 "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 39602 "gram.c" /* yacc.c:1646 */ break; case 1508: #line 10525 "gram.y" /* yacc.c:1646 */ { ClusterStmt *n = makeNode(ClusterStmt); n->relation = (yyvsp[-1].range); n->indexname = (yyvsp[0].str); n->options = 0; if ((yyvsp[-2].boolean)) n->options |= CLUOPT_VERBOSE; (yyval.node) = (Node*)n; } #line 39616 "gram.c" /* yacc.c:1646 */ break; case 1509: #line 10535 "gram.y" /* yacc.c:1646 */ { ClusterStmt *n = makeNode(ClusterStmt); n->relation = NULL; n->indexname = NULL; n->options = 0; if ((yyvsp[0].boolean)) n->options |= CLUOPT_VERBOSE; (yyval.node) = (Node*)n; } #line 39630 "gram.c" /* yacc.c:1646 */ break; case 1510: #line 10546 "gram.y" /* yacc.c:1646 */ { ClusterStmt *n = makeNode(ClusterStmt); n->relation = (yyvsp[0].range); n->indexname = (yyvsp[-2].str); n->options = 0; if ((yyvsp[-3].boolean)) n->options |= CLUOPT_VERBOSE; (yyval.node) = (Node*)n; } #line 39644 "gram.c" /* yacc.c:1646 */ break; case 1511: #line 10558 "gram.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 39650 "gram.c" /* yacc.c:1646 */ break; case 1512: #line 10559 "gram.y" /* yacc.c:1646 */ { (yyval.str) = NULL; } #line 39656 "gram.c" /* yacc.c:1646 */ break; case 1513: #line 10572 "gram.y" /* yacc.c:1646 */ { VacuumStmt *n = makeNode(VacuumStmt); n->options = NIL; if ((yyvsp[-4].boolean)) n->options = lappend(n->options, makeDefElem("full", NULL, (yylsp[-4]))); if ((yyvsp[-3].boolean)) n->options = lappend(n->options, makeDefElem("freeze", NULL, (yylsp[-3]))); if ((yyvsp[-2].boolean)) n->options = lappend(n->options, makeDefElem("verbose", NULL, (yylsp[-2]))); if ((yyvsp[-1].boolean)) n->options = lappend(n->options, makeDefElem("analyze", NULL, (yylsp[-1]))); n->rels = (yyvsp[0].list); n->is_vacuumcmd = true; (yyval.node) = (Node *)n; } #line 39680 "gram.c" /* yacc.c:1646 */ break; case 1514: #line 10592 "gram.y" /* yacc.c:1646 */ { VacuumStmt *n = makeNode(VacuumStmt); n->options = (yyvsp[-2].list); n->rels = (yyvsp[0].list); n->is_vacuumcmd = true; (yyval.node) = (Node *) n; } #line 39692 "gram.c" /* yacc.c:1646 */ break; case 1515: #line 10602 "gram.y" /* yacc.c:1646 */ { VacuumStmt *n = makeNode(VacuumStmt); n->options = NIL; if ((yyvsp[-1].boolean)) n->options = lappend(n->options, makeDefElem("verbose", NULL, (yylsp[-1]))); n->rels = (yyvsp[0].list); n->is_vacuumcmd = false; (yyval.node) = (Node *)n; } #line 39707 "gram.c" /* yacc.c:1646 */ break; case 1516: #line 10613 "gram.y" /* yacc.c:1646 */ { VacuumStmt *n = makeNode(VacuumStmt); n->options = (yyvsp[-2].list); n->rels = (yyvsp[0].list); n->is_vacuumcmd = false; (yyval.node) = (Node *) n; } #line 39719 "gram.c" /* yacc.c:1646 */ break; case 1517: #line 10624 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].defelt)); } #line 39727 "gram.c" /* yacc.c:1646 */ break; case 1518: #line 10628 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].defelt)); } #line 39735 "gram.c" /* yacc.c:1646 */ break; case 1519: #line 10634 "gram.y" /* yacc.c:1646 */ {} #line 39741 "gram.c" /* yacc.c:1646 */ break; case 1520: #line 10635 "gram.y" /* yacc.c:1646 */ {} #line 39747 "gram.c" /* yacc.c:1646 */ break; case 1521: #line 10640 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem((yyvsp[-1].str), (yyvsp[0].node), (yylsp[-1])); } #line 39755 "gram.c" /* yacc.c:1646 */ break; case 1522: #line 10646 "gram.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 39761 "gram.c" /* yacc.c:1646 */ break; case 1523: #line 10647 "gram.y" /* yacc.c:1646 */ { (yyval.str) = "analyze"; } #line 39767 "gram.c" /* yacc.c:1646 */ break; case 1524: #line 10651 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeString((yyvsp[0].str)); } #line 39773 "gram.c" /* yacc.c:1646 */ break; case 1525: #line 10652 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) (yyvsp[0].value); } #line 39779 "gram.c" /* yacc.c:1646 */ break; case 1526: #line 10653 "gram.y" /* yacc.c:1646 */ { (yyval.node) = NULL; } #line 39785 "gram.c" /* yacc.c:1646 */ break; case 1527: #line 10657 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = true; } #line 39791 "gram.c" /* yacc.c:1646 */ break; case 1528: #line 10658 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = false; } #line 39797 "gram.c" /* yacc.c:1646 */ break; case 1529: #line 10662 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = true; } #line 39803 "gram.c" /* yacc.c:1646 */ break; case 1530: #line 10663 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = false; } #line 39809 "gram.c" /* yacc.c:1646 */ break; case 1531: #line 10666 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = true; } #line 39815 "gram.c" /* yacc.c:1646 */ break; case 1532: #line 10667 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = false; } #line 39821 "gram.c" /* yacc.c:1646 */ break; case 1533: #line 10670 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = true; } #line 39827 "gram.c" /* yacc.c:1646 */ break; case 1534: #line 10671 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = false; } #line 39833 "gram.c" /* yacc.c:1646 */ break; case 1535: #line 10675 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[-1].list); } #line 39839 "gram.c" /* yacc.c:1646 */ break; case 1536: #line 10676 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 39845 "gram.c" /* yacc.c:1646 */ break; case 1537: #line 10681 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeVacuumRelation((yyvsp[-1].range), InvalidOid, (yyvsp[0].list)); } #line 39853 "gram.c" /* yacc.c:1646 */ break; case 1538: #line 10688 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].node)); } #line 39859 "gram.c" /* yacc.c:1646 */ break; case 1539: #line 10690 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].node)); } #line 39865 "gram.c" /* yacc.c:1646 */ break; case 1540: #line 10694 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 39871 "gram.c" /* yacc.c:1646 */ break; case 1541: #line 10695 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 39877 "gram.c" /* yacc.c:1646 */ break; case 1542: #line 10709 "gram.y" /* yacc.c:1646 */ { ExplainStmt *n = makeNode(ExplainStmt); n->query = (yyvsp[0].node); n->options = NIL; (yyval.node) = (Node *) n; } #line 39888 "gram.c" /* yacc.c:1646 */ break; case 1543: #line 10716 "gram.y" /* yacc.c:1646 */ { ExplainStmt *n = makeNode(ExplainStmt); n->query = (yyvsp[0].node); n->options = list_make1(makeDefElem("analyze", NULL, (yylsp[-2]))); if ((yyvsp[-1].boolean)) n->options = lappend(n->options, makeDefElem("verbose", NULL, (yylsp[-1]))); (yyval.node) = (Node *) n; } #line 39902 "gram.c" /* yacc.c:1646 */ break; case 1544: #line 10726 "gram.y" /* yacc.c:1646 */ { ExplainStmt *n = makeNode(ExplainStmt); n->query = (yyvsp[0].node); n->options = list_make1(makeDefElem("verbose", NULL, (yylsp[-1]))); (yyval.node) = (Node *) n; } #line 39913 "gram.c" /* yacc.c:1646 */ break; case 1545: #line 10733 "gram.y" /* yacc.c:1646 */ { ExplainStmt *n = makeNode(ExplainStmt); n->query = (yyvsp[0].node); n->options = (yyvsp[-2].list); (yyval.node) = (Node *) n; } #line 39924 "gram.c" /* yacc.c:1646 */ break; case 1555: #line 10755 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].defelt)); } #line 39932 "gram.c" /* yacc.c:1646 */ break; case 1556: #line 10759 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].defelt)); } #line 39940 "gram.c" /* yacc.c:1646 */ break; case 1557: #line 10766 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem((yyvsp[-1].str), (yyvsp[0].node), (yylsp[-1])); } #line 39948 "gram.c" /* yacc.c:1646 */ break; case 1558: #line 10772 "gram.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 39954 "gram.c" /* yacc.c:1646 */ break; case 1559: #line 10773 "gram.y" /* yacc.c:1646 */ { (yyval.str) = "analyze"; } #line 39960 "gram.c" /* yacc.c:1646 */ break; case 1560: #line 10777 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeString((yyvsp[0].str)); } #line 39966 "gram.c" /* yacc.c:1646 */ break; case 1561: #line 10778 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) (yyvsp[0].value); } #line 39972 "gram.c" /* yacc.c:1646 */ break; case 1562: #line 10779 "gram.y" /* yacc.c:1646 */ { (yyval.node) = NULL; } #line 39978 "gram.c" /* yacc.c:1646 */ break; case 1563: #line 10790 "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 39990 "gram.c" /* yacc.c:1646 */ break; case 1564: #line 10799 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[-1].list); } #line 39996 "gram.c" /* yacc.c:1646 */ break; case 1565: #line 10800 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 40002 "gram.c" /* yacc.c:1646 */ break; case 1570: #line 10818 "gram.y" /* yacc.c:1646 */ { ExecuteStmt *n = makeNode(ExecuteStmt); n->name = (yyvsp[-1].str); n->params = (yyvsp[0].list); (yyval.node) = (Node *) n; } #line 40013 "gram.c" /* yacc.c:1646 */ break; case 1571: #line 10826 "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; ctas->if_not_exists = 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 40033 "gram.c" /* yacc.c:1646 */ break; case 1572: #line 10843 "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; ctas->if_not_exists = true; /* cram additional flags into the IntoClause */ (yyvsp[-5].into)->rel->relpersistence = (yyvsp[-10].ival); (yyvsp[-5].into)->skipData = !((yyvsp[0].boolean)); (yyval.node) = (Node *) ctas; } #line 40053 "gram.c" /* yacc.c:1646 */ break; case 1573: #line 10860 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[-1].list); } #line 40059 "gram.c" /* yacc.c:1646 */ break; case 1574: #line 10861 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 40065 "gram.c" /* yacc.c:1646 */ break; case 1575: #line 10872 "gram.y" /* yacc.c:1646 */ { DeallocateStmt *n = makeNode(DeallocateStmt); n->name = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 40075 "gram.c" /* yacc.c:1646 */ break; case 1576: #line 10878 "gram.y" /* yacc.c:1646 */ { DeallocateStmt *n = makeNode(DeallocateStmt); n->name = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 40085 "gram.c" /* yacc.c:1646 */ break; case 1577: #line 10884 "gram.y" /* yacc.c:1646 */ { DeallocateStmt *n = makeNode(DeallocateStmt); n->name = NULL; (yyval.node) = (Node *) n; } #line 40095 "gram.c" /* yacc.c:1646 */ break; case 1578: #line 10890 "gram.y" /* yacc.c:1646 */ { DeallocateStmt *n = makeNode(DeallocateStmt); n->name = NULL; (yyval.node) = (Node *) n; } #line 40105 "gram.c" /* yacc.c:1646 */ break; case 1579: #line 10907 "gram.y" /* yacc.c:1646 */ { (yyvsp[-2].istmt)->relation = (yyvsp[-3].range); (yyvsp[-2].istmt)->onConflictClause = (yyvsp[-1].onconflict); (yyvsp[-2].istmt)->returningList = (yyvsp[0].list); (yyvsp[-2].istmt)->withClause = (yyvsp[-6].with); (yyval.node) = (Node *) (yyvsp[-2].istmt); } #line 40117 "gram.c" /* yacc.c:1646 */ break; case 1580: #line 10924 "gram.y" /* yacc.c:1646 */ { (yyval.range) = (yyvsp[0].range); } #line 40125 "gram.c" /* yacc.c:1646 */ break; case 1581: #line 10928 "gram.y" /* yacc.c:1646 */ { (yyvsp[-2].range)->alias = makeAlias((yyvsp[0].str), NIL); (yyval.range) = (yyvsp[-2].range); } #line 40134 "gram.c" /* yacc.c:1646 */ break; case 1582: #line 10936 "gram.y" /* yacc.c:1646 */ { (yyval.istmt) = makeNode(InsertStmt); (yyval.istmt)->cols = NIL; (yyval.istmt)->selectStmt = (yyvsp[0].node); } #line 40144 "gram.c" /* yacc.c:1646 */ break; case 1583: #line 10942 "gram.y" /* yacc.c:1646 */ { (yyval.istmt) = makeNode(InsertStmt); (yyval.istmt)->cols = NIL; (yyval.istmt)->override = (yyvsp[-2].ival); (yyval.istmt)->selectStmt = (yyvsp[0].node); } #line 40155 "gram.c" /* yacc.c:1646 */ break; case 1584: #line 10949 "gram.y" /* yacc.c:1646 */ { (yyval.istmt) = makeNode(InsertStmt); (yyval.istmt)->cols = (yyvsp[-2].list); (yyval.istmt)->selectStmt = (yyvsp[0].node); } #line 40165 "gram.c" /* yacc.c:1646 */ break; case 1585: #line 10955 "gram.y" /* yacc.c:1646 */ { (yyval.istmt) = makeNode(InsertStmt); (yyval.istmt)->cols = (yyvsp[-5].list); (yyval.istmt)->override = (yyvsp[-2].ival); (yyval.istmt)->selectStmt = (yyvsp[0].node); } #line 40176 "gram.c" /* yacc.c:1646 */ break; case 1586: #line 10962 "gram.y" /* yacc.c:1646 */ { (yyval.istmt) = makeNode(InsertStmt); (yyval.istmt)->cols = NIL; (yyval.istmt)->selectStmt = NULL; } #line 40186 "gram.c" /* yacc.c:1646 */ break; case 1587: #line 10970 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = OVERRIDING_USER_VALUE; } #line 40192 "gram.c" /* yacc.c:1646 */ break; case 1588: #line 10971 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = OVERRIDING_SYSTEM_VALUE; } #line 40198 "gram.c" /* yacc.c:1646 */ break; case 1589: #line 10976 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].target)); } #line 40204 "gram.c" /* yacc.c:1646 */ break; case 1590: #line 10978 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].target)); } #line 40210 "gram.c" /* yacc.c:1646 */ break; case 1591: #line 10983 "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 40222 "gram.c" /* yacc.c:1646 */ break; case 1592: #line 10994 "gram.y" /* yacc.c:1646 */ { (yyval.onconflict) = makeNode(OnConflictClause); (yyval.onconflict)->action = ONCONFLICT_UPDATE; (yyval.onconflict)->infer = (yyvsp[-5].infer); (yyval.onconflict)->targetList = (yyvsp[-1].list); (yyval.onconflict)->whereClause = (yyvsp[0].node); (yyval.onconflict)->location = (yylsp[-7]); } #line 40235 "gram.c" /* yacc.c:1646 */ break; case 1593: #line 11004 "gram.y" /* yacc.c:1646 */ { (yyval.onconflict) = makeNode(OnConflictClause); (yyval.onconflict)->action = ONCONFLICT_NOTHING; (yyval.onconflict)->infer = (yyvsp[-2].infer); (yyval.onconflict)->targetList = NIL; (yyval.onconflict)->whereClause = NULL; (yyval.onconflict)->location = (yylsp[-4]); } #line 40248 "gram.c" /* yacc.c:1646 */ break; case 1594: #line 11013 "gram.y" /* yacc.c:1646 */ { (yyval.onconflict) = NULL; } #line 40256 "gram.c" /* yacc.c:1646 */ break; case 1595: #line 11020 "gram.y" /* yacc.c:1646 */ { (yyval.infer) = makeNode(InferClause); (yyval.infer)->indexElems = (yyvsp[-2].list); (yyval.infer)->whereClause = (yyvsp[0].node); (yyval.infer)->conname = NULL; (yyval.infer)->location = (yylsp[-3]); } #line 40268 "gram.c" /* yacc.c:1646 */ break; case 1596: #line 11029 "gram.y" /* yacc.c:1646 */ { (yyval.infer) = makeNode(InferClause); (yyval.infer)->indexElems = NIL; (yyval.infer)->whereClause = NULL; (yyval.infer)->conname = (yyvsp[0].str); (yyval.infer)->location = (yylsp[-2]); } #line 40280 "gram.c" /* yacc.c:1646 */ break; case 1597: #line 11037 "gram.y" /* yacc.c:1646 */ { (yyval.infer) = NULL; } #line 40288 "gram.c" /* yacc.c:1646 */ break; case 1598: #line 11043 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 40294 "gram.c" /* yacc.c:1646 */ break; case 1599: #line 11044 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 40300 "gram.c" /* yacc.c:1646 */ break; case 1600: #line 11057 "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 40314 "gram.c" /* yacc.c:1646 */ break; case 1601: #line 11069 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 40320 "gram.c" /* yacc.c:1646 */ break; case 1602: #line 11070 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 40326 "gram.c" /* yacc.c:1646 */ break; case 1603: #line 11082 "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 40339 "gram.c" /* yacc.c:1646 */ break; case 1604: #line 11092 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = (yyvsp[-1].ival); } #line 40345 "gram.c" /* yacc.c:1646 */ break; case 1605: #line 11093 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = AccessExclusiveLock; } #line 40351 "gram.c" /* yacc.c:1646 */ break; case 1606: #line 11096 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = AccessShareLock; } #line 40357 "gram.c" /* yacc.c:1646 */ break; case 1607: #line 11097 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = RowShareLock; } #line 40363 "gram.c" /* yacc.c:1646 */ break; case 1608: #line 11098 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = RowExclusiveLock; } #line 40369 "gram.c" /* yacc.c:1646 */ break; case 1609: #line 11099 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = ShareUpdateExclusiveLock; } #line 40375 "gram.c" /* yacc.c:1646 */ break; case 1610: #line 11100 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = ShareLock; } #line 40381 "gram.c" /* yacc.c:1646 */ break; case 1611: #line 11101 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = ShareRowExclusiveLock; } #line 40387 "gram.c" /* yacc.c:1646 */ break; case 1612: #line 11102 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = ExclusiveLock; } #line 40393 "gram.c" /* yacc.c:1646 */ break; case 1613: #line 11103 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = AccessExclusiveLock; } #line 40399 "gram.c" /* yacc.c:1646 */ break; case 1614: #line 11106 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = true; } #line 40405 "gram.c" /* yacc.c:1646 */ break; case 1615: #line 11107 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = false; } #line 40411 "gram.c" /* yacc.c:1646 */ break; case 1616: #line 11111 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = LockWaitError; } #line 40417 "gram.c" /* yacc.c:1646 */ break; case 1617: #line 11112 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = LockWaitSkip; } #line 40423 "gram.c" /* yacc.c:1646 */ break; case 1618: #line 11113 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = LockWaitBlock; } #line 40429 "gram.c" /* yacc.c:1646 */ break; case 1619: #line 11129 "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 40444 "gram.c" /* yacc.c:1646 */ break; case 1620: #line 11141 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 40450 "gram.c" /* yacc.c:1646 */ break; case 1621: #line 11142 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_concat((yyvsp[-2].list),(yyvsp[0].list)); } #line 40456 "gram.c" /* yacc.c:1646 */ break; case 1622: #line 11147 "gram.y" /* yacc.c:1646 */ { (yyvsp[-2].target)->val = (Node *) (yyvsp[0].node); (yyval.list) = list_make1((yyvsp[-2].target)); } #line 40465 "gram.c" /* yacc.c:1646 */ break; case 1623: #line 11152 "gram.y" /* yacc.c:1646 */ { int ncolumns = list_length((yyvsp[-3].list)); int i = 1; ListCell *col_cell; /* Create a MultiAssignRef source for each target */ foreach(col_cell, (yyvsp[-3].list)) { ResTarget *res_col = (ResTarget *) lfirst(col_cell); MultiAssignRef *r = makeNode(MultiAssignRef); r->source = (Node *) (yyvsp[0].node); r->colno = i; r->ncolumns = ncolumns; res_col->val = (Node *) r; i++; } (yyval.list) = (yyvsp[-3].list); } #line 40490 "gram.c" /* yacc.c:1646 */ break; case 1624: #line 11176 "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 40502 "gram.c" /* yacc.c:1646 */ break; case 1625: #line 11186 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].target)); } #line 40508 "gram.c" /* yacc.c:1646 */ break; case 1626: #line 11187 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list),(yyvsp[0].target)); } #line 40514 "gram.c" /* yacc.c:1646 */ break; case 1627: #line 11198 "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 40527 "gram.c" /* yacc.c:1646 */ break; case 1628: #line 11208 "gram.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 40533 "gram.c" /* yacc.c:1646 */ break; case 1629: #line 11211 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = 0; } #line 40539 "gram.c" /* yacc.c:1646 */ break; case 1630: #line 11212 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = (yyvsp[-2].ival) | CURSOR_OPT_NO_SCROLL; } #line 40545 "gram.c" /* yacc.c:1646 */ break; case 1631: #line 11213 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = (yyvsp[-1].ival) | CURSOR_OPT_SCROLL; } #line 40551 "gram.c" /* yacc.c:1646 */ break; case 1632: #line 11214 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = (yyvsp[-1].ival) | CURSOR_OPT_BINARY; } #line 40557 "gram.c" /* yacc.c:1646 */ break; case 1633: #line 11215 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = (yyvsp[-1].ival) | CURSOR_OPT_INSENSITIVE; } #line 40563 "gram.c" /* yacc.c:1646 */ break; case 1634: #line 11218 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = 0; } #line 40569 "gram.c" /* yacc.c:1646 */ break; case 1635: #line 11219 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = CURSOR_OPT_HOLD; } #line 40575 "gram.c" /* yacc.c:1646 */ break; case 1636: #line 11220 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = 0; } #line 40581 "gram.c" /* yacc.c:1646 */ break; case 1639: #line 11273 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[-1].node); } #line 40587 "gram.c" /* yacc.c:1646 */ break; case 1640: #line 11274 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[-1].node); } #line 40593 "gram.c" /* yacc.c:1646 */ break; case 1641: #line 11289 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 40599 "gram.c" /* yacc.c:1646 */ break; case 1642: #line 11291 "gram.y" /* yacc.c:1646 */ { insertSelectOptions((SelectStmt *) (yyvsp[-1].node), (yyvsp[0].list), NIL, NULL, NULL, NULL, yyscanner); (yyval.node) = (yyvsp[-1].node); } #line 40610 "gram.c" /* yacc.c:1646 */ break; case 1643: #line 11298 "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 40622 "gram.c" /* yacc.c:1646 */ break; case 1644: #line 11306 "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 40634 "gram.c" /* yacc.c:1646 */ break; case 1645: #line 11314 "gram.y" /* yacc.c:1646 */ { insertSelectOptions((SelectStmt *) (yyvsp[0].node), NULL, NIL, NULL, NULL, (yyvsp[-1].with), yyscanner); (yyval.node) = (yyvsp[0].node); } #line 40646 "gram.c" /* yacc.c:1646 */ break; case 1646: #line 11322 "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 40658 "gram.c" /* yacc.c:1646 */ break; case 1647: #line 11330 "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 40670 "gram.c" /* yacc.c:1646 */ break; case 1648: #line 11338 "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 40682 "gram.c" /* yacc.c:1646 */ break; case 1649: #line 11348 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 40688 "gram.c" /* yacc.c:1646 */ break; case 1650: #line 11349 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 40694 "gram.c" /* yacc.c:1646 */ break; case 1651: #line 11379 "gram.y" /* yacc.c:1646 */ { SelectStmt *n = makeNode(SelectStmt); 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 40710 "gram.c" /* yacc.c:1646 */ break; case 1652: #line 11393 "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 40727 "gram.c" /* yacc.c:1646 */ break; case 1653: #line 11405 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 40733 "gram.c" /* yacc.c:1646 */ break; case 1654: #line 11407 "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 40756 "gram.c" /* yacc.c:1646 */ break; case 1655: #line 11426 "gram.y" /* yacc.c:1646 */ { (yyval.node) = makeSetOp(SETOP_UNION, (yyvsp[-1].boolean), (yyvsp[-3].node), (yyvsp[0].node)); } #line 40764 "gram.c" /* yacc.c:1646 */ break; case 1656: #line 11430 "gram.y" /* yacc.c:1646 */ { (yyval.node) = makeSetOp(SETOP_INTERSECT, (yyvsp[-1].boolean), (yyvsp[-3].node), (yyvsp[0].node)); } #line 40772 "gram.c" /* yacc.c:1646 */ break; case 1657: #line 11434 "gram.y" /* yacc.c:1646 */ { (yyval.node) = makeSetOp(SETOP_EXCEPT, (yyvsp[-1].boolean), (yyvsp[-3].node), (yyvsp[0].node)); } #line 40780 "gram.c" /* yacc.c:1646 */ break; case 1658: #line 11451 "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 40791 "gram.c" /* yacc.c:1646 */ break; case 1659: #line 11458 "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 40802 "gram.c" /* yacc.c:1646 */ break; case 1660: #line 11465 "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 40813 "gram.c" /* yacc.c:1646 */ break; case 1661: #line 11474 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].node)); } #line 40819 "gram.c" /* yacc.c:1646 */ break; case 1662: #line 11475 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].node)); } #line 40825 "gram.c" /* yacc.c:1646 */ break; case 1663: #line 11479 "gram.y" /* yacc.c:1646 */ { CommonTableExpr *n = makeNode(CommonTableExpr); n->ctename = (yyvsp[-6].str); n->aliascolnames = (yyvsp[-5].list); n->ctematerialized = (yyvsp[-3].ival); n->ctequery = (yyvsp[-1].node); n->location = (yylsp[-6]); (yyval.node) = (Node *) n; } #line 40839 "gram.c" /* yacc.c:1646 */ break; case 1664: #line 11491 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = CTEMaterializeAlways; } #line 40845 "gram.c" /* yacc.c:1646 */ break; case 1665: #line 11492 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = CTEMaterializeNever; } #line 40851 "gram.c" /* yacc.c:1646 */ break; case 1666: #line 11493 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = CTEMaterializeDefault; } #line 40857 "gram.c" /* yacc.c:1646 */ break; case 1667: #line 11497 "gram.y" /* yacc.c:1646 */ { (yyval.with) = (yyvsp[0].with); } #line 40863 "gram.c" /* yacc.c:1646 */ break; case 1668: #line 11498 "gram.y" /* yacc.c:1646 */ { (yyval.with) = NULL; } #line 40869 "gram.c" /* yacc.c:1646 */ break; case 1669: #line 11503 "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 40884 "gram.c" /* yacc.c:1646 */ break; case 1670: #line 11514 "gram.y" /* yacc.c:1646 */ { (yyval.into) = NULL; } #line 40890 "gram.c" /* yacc.c:1646 */ break; case 1671: #line 11523 "gram.y" /* yacc.c:1646 */ { (yyval.range) = (yyvsp[0].range); (yyval.range)->relpersistence = RELPERSISTENCE_TEMP; } #line 40899 "gram.c" /* yacc.c:1646 */ break; case 1672: #line 11528 "gram.y" /* yacc.c:1646 */ { (yyval.range) = (yyvsp[0].range); (yyval.range)->relpersistence = RELPERSISTENCE_TEMP; } #line 40908 "gram.c" /* yacc.c:1646 */ break; case 1673: #line 11533 "gram.y" /* yacc.c:1646 */ { (yyval.range) = (yyvsp[0].range); (yyval.range)->relpersistence = RELPERSISTENCE_TEMP; } #line 40917 "gram.c" /* yacc.c:1646 */ break; case 1674: #line 11538 "gram.y" /* yacc.c:1646 */ { (yyval.range) = (yyvsp[0].range); (yyval.range)->relpersistence = RELPERSISTENCE_TEMP; } #line 40926 "gram.c" /* yacc.c:1646 */ break; case 1675: #line 11543 "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 40938 "gram.c" /* yacc.c:1646 */ break; case 1676: #line 11551 "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 40950 "gram.c" /* yacc.c:1646 */ break; case 1677: #line 11559 "gram.y" /* yacc.c:1646 */ { (yyval.range) = (yyvsp[0].range); (yyval.range)->relpersistence = RELPERSISTENCE_UNLOGGED; } #line 40959 "gram.c" /* yacc.c:1646 */ break; case 1678: #line 11564 "gram.y" /* yacc.c:1646 */ { (yyval.range) = (yyvsp[0].range); (yyval.range)->relpersistence = RELPERSISTENCE_PERMANENT; } #line 40968 "gram.c" /* yacc.c:1646 */ break; case 1679: #line 11569 "gram.y" /* yacc.c:1646 */ { (yyval.range) = (yyvsp[0].range); (yyval.range)->relpersistence = RELPERSISTENCE_PERMANENT; } #line 40977 "gram.c" /* yacc.c:1646 */ break; case 1680: #line 11575 "gram.y" /* yacc.c:1646 */ {} #line 40983 "gram.c" /* yacc.c:1646 */ break; case 1681: #line 11576 "gram.y" /* yacc.c:1646 */ {} #line 40989 "gram.c" /* yacc.c:1646 */ break; case 1682: #line 11580 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = true; } #line 40995 "gram.c" /* yacc.c:1646 */ break; case 1683: #line 11581 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = false; } #line 41001 "gram.c" /* yacc.c:1646 */ break; case 1684: #line 11582 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = false; } #line 41007 "gram.c" /* yacc.c:1646 */ break; case 1685: #line 11589 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1(NIL); } #line 41013 "gram.c" /* yacc.c:1646 */ break; case 1686: #line 11590 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[-1].list); } #line 41019 "gram.c" /* yacc.c:1646 */ break; case 1687: #line 11594 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL;} #line 41025 "gram.c" /* yacc.c:1646 */ break; case 1688: #line 11595 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 41031 "gram.c" /* yacc.c:1646 */ break; case 1689: #line 11599 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list);} #line 41037 "gram.c" /* yacc.c:1646 */ break; case 1690: #line 11600 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 41043 "gram.c" /* yacc.c:1646 */ break; case 1691: #line 11604 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 41049 "gram.c" /* yacc.c:1646 */ break; case 1692: #line 11608 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].sortby)); } #line 41055 "gram.c" /* yacc.c:1646 */ break; case 1693: #line 11609 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].sortby)); } #line 41061 "gram.c" /* yacc.c:1646 */ break; case 1694: #line 11613 "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 41074 "gram.c" /* yacc.c:1646 */ break; case 1695: #line 11622 "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 41087 "gram.c" /* yacc.c:1646 */ break; case 1696: #line 11634 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make2((yyvsp[0].node), (yyvsp[-1].node)); } #line 41093 "gram.c" /* yacc.c:1646 */ break; case 1697: #line 11635 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make2((yyvsp[-1].node), (yyvsp[0].node)); } #line 41099 "gram.c" /* yacc.c:1646 */ break; case 1698: #line 11636 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make2(NULL, (yyvsp[0].node)); } #line 41105 "gram.c" /* yacc.c:1646 */ break; case 1699: #line 11637 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make2((yyvsp[0].node), NULL); } #line 41111 "gram.c" /* yacc.c:1646 */ break; case 1700: #line 11641 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 41117 "gram.c" /* yacc.c:1646 */ break; case 1701: #line 11642 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make2(NULL,NULL); } #line 41123 "gram.c" /* yacc.c:1646 */ break; case 1702: #line 11647 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 41129 "gram.c" /* yacc.c:1646 */ break; case 1703: #line 11649 "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 41142 "gram.c" /* yacc.c:1646 */ break; case 1704: #line 11665 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[-2].node); } #line 41148 "gram.c" /* yacc.c:1646 */ break; case 1705: #line 11667 "gram.y" /* yacc.c:1646 */ { (yyval.node) = makeIntConst(1, -1); } #line 41154 "gram.c" /* yacc.c:1646 */ break; case 1706: #line 11672 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 41160 "gram.c" /* yacc.c:1646 */ break; case 1707: #line 11675 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[-1].node); } #line 41166 "gram.c" /* yacc.c:1646 */ break; case 1708: #line 11679 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 41172 "gram.c" /* yacc.c:1646 */ break; case 1709: #line 11681 "gram.y" /* yacc.c:1646 */ { /* LIMIT ALL is represented as a NULL constant */ (yyval.node) = makeNullAConst((yylsp[0])); } #line 41181 "gram.c" /* yacc.c:1646 */ break; case 1710: #line 11688 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 41187 "gram.c" /* yacc.c:1646 */ break; case 1711: #line 11708 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 41193 "gram.c" /* yacc.c:1646 */ break; case 1712: #line 11710 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OP, "+", NULL, (yyvsp[0].node), (yylsp[-1])); } #line 41199 "gram.c" /* yacc.c:1646 */ break; case 1713: #line 11712 "gram.y" /* yacc.c:1646 */ { (yyval.node) = doNegate((yyvsp[0].node), (yylsp[-1])); } #line 41205 "gram.c" /* yacc.c:1646 */ break; case 1714: #line 11716 "gram.y" /* yacc.c:1646 */ { (yyval.node) = makeIntConst((yyvsp[0].ival),(yylsp[0])); } #line 41211 "gram.c" /* yacc.c:1646 */ break; case 1715: #line 11717 "gram.y" /* yacc.c:1646 */ { (yyval.node) = makeFloatConst((yyvsp[0].str),(yylsp[0])); } #line 41217 "gram.c" /* yacc.c:1646 */ break; case 1716: #line 11721 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = 0; } #line 41223 "gram.c" /* yacc.c:1646 */ break; case 1717: #line 11722 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = 0; } #line 41229 "gram.c" /* yacc.c:1646 */ break; case 1718: #line 11725 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = 0; } #line 41235 "gram.c" /* yacc.c:1646 */ break; case 1719: #line 11726 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = 0; } #line 41241 "gram.c" /* yacc.c:1646 */ break; case 1720: #line 11751 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 41247 "gram.c" /* yacc.c:1646 */ break; case 1721: #line 11752 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 41253 "gram.c" /* yacc.c:1646 */ break; case 1722: #line 11756 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].node)); } #line 41259 "gram.c" /* yacc.c:1646 */ break; case 1723: #line 11757 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list),(yyvsp[0].node)); } #line 41265 "gram.c" /* yacc.c:1646 */ break; case 1724: #line 11761 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 41271 "gram.c" /* yacc.c:1646 */ break; case 1725: #line 11762 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 41277 "gram.c" /* yacc.c:1646 */ break; case 1726: #line 11763 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 41283 "gram.c" /* yacc.c:1646 */ break; case 1727: #line 11764 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 41289 "gram.c" /* yacc.c:1646 */ break; case 1728: #line 11765 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 41295 "gram.c" /* yacc.c:1646 */ break; case 1729: #line 11770 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeGroupingSet(GROUPING_SET_EMPTY, NIL, (yylsp[-1])); } #line 41303 "gram.c" /* yacc.c:1646 */ break; case 1730: #line 11783 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeGroupingSet(GROUPING_SET_ROLLUP, (yyvsp[-1].list), (yylsp[-3])); } #line 41311 "gram.c" /* yacc.c:1646 */ break; case 1731: #line 11790 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeGroupingSet(GROUPING_SET_CUBE, (yyvsp[-1].list), (yylsp[-3])); } #line 41319 "gram.c" /* yacc.c:1646 */ break; case 1732: #line 11797 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeGroupingSet(GROUPING_SET_SETS, (yyvsp[-1].list), (yylsp[-4])); } #line 41327 "gram.c" /* yacc.c:1646 */ break; case 1733: #line 11803 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 41333 "gram.c" /* yacc.c:1646 */ break; case 1734: #line 11804 "gram.y" /* yacc.c:1646 */ { (yyval.node) = NULL; } #line 41339 "gram.c" /* yacc.c:1646 */ break; case 1735: #line 11808 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 41345 "gram.c" /* yacc.c:1646 */ break; case 1736: #line 11809 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 41351 "gram.c" /* yacc.c:1646 */ break; case 1737: #line 11813 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 41357 "gram.c" /* yacc.c:1646 */ break; case 1738: #line 11814 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 41363 "gram.c" /* yacc.c:1646 */ break; case 1739: #line 11818 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].node)); } #line 41369 "gram.c" /* yacc.c:1646 */ break; case 1740: #line 11819 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-1].list), (yyvsp[0].node)); } #line 41375 "gram.c" /* yacc.c:1646 */ break; case 1741: #line 11824 "gram.y" /* yacc.c:1646 */ { LockingClause *n = makeNode(LockingClause); n->lockedRels = (yyvsp[-1].list); n->strength = (yyvsp[-2].ival); n->waitPolicy = (yyvsp[0].ival); (yyval.node) = (Node *) n; } #line 41387 "gram.c" /* yacc.c:1646 */ break; case 1742: #line 11834 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = LCS_FORUPDATE; } #line 41393 "gram.c" /* yacc.c:1646 */ break; case 1743: #line 11835 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = LCS_FORNOKEYUPDATE; } #line 41399 "gram.c" /* yacc.c:1646 */ break; case 1744: #line 11836 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = LCS_FORSHARE; } #line 41405 "gram.c" /* yacc.c:1646 */ break; case 1745: #line 11837 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = LCS_FORKEYSHARE; } #line 41411 "gram.c" /* yacc.c:1646 */ break; case 1746: #line 11841 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 41417 "gram.c" /* yacc.c:1646 */ break; case 1747: #line 11842 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 41423 "gram.c" /* yacc.c:1646 */ break; case 1748: #line 11853 "gram.y" /* yacc.c:1646 */ { SelectStmt *n = makeNode(SelectStmt); n->valuesLists = list_make1((yyvsp[-1].list)); (yyval.node) = (Node *) n; } #line 41433 "gram.c" /* yacc.c:1646 */ break; case 1749: #line 11859 "gram.y" /* yacc.c:1646 */ { SelectStmt *n = (SelectStmt *) (yyvsp[-4].node); n->valuesLists = lappend(n->valuesLists, (yyvsp[-1].list)); (yyval.node) = (Node *) n; } #line 41443 "gram.c" /* yacc.c:1646 */ break; case 1750: #line 11876 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 41449 "gram.c" /* yacc.c:1646 */ break; case 1751: #line 11877 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 41455 "gram.c" /* yacc.c:1646 */ break; case 1752: #line 11881 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].node)); } #line 41461 "gram.c" /* yacc.c:1646 */ break; case 1753: #line 11882 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].node)); } #line 41467 "gram.c" /* yacc.c:1646 */ break; case 1754: #line 11889 "gram.y" /* yacc.c:1646 */ { (yyvsp[-1].range)->alias = (yyvsp[0].alias); (yyval.node) = (Node *) (yyvsp[-1].range); } #line 41476 "gram.c" /* yacc.c:1646 */ break; case 1755: #line 11894 "gram.y" /* yacc.c:1646 */ { RangeTableSample *n = (RangeTableSample *) (yyvsp[0].node); (yyvsp[-2].range)->alias = (yyvsp[-1].alias); /* relation_expr goes inside the RangeTableSample node */ n->relation = (Node *) (yyvsp[-2].range); (yyval.node) = (Node *) n; } #line 41488 "gram.c" /* yacc.c:1646 */ break; case 1756: #line 11902 "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 41499 "gram.c" /* yacc.c:1646 */ break; case 1757: #line 11909 "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 41511 "gram.c" /* yacc.c:1646 */ break; case 1758: #line 11917 "gram.y" /* yacc.c:1646 */ { RangeTableFunc *n = (RangeTableFunc *) (yyvsp[-1].node); n->alias = (yyvsp[0].alias); (yyval.node) = (Node *) n; } #line 41521 "gram.c" /* yacc.c:1646 */ break; case 1759: #line 11923 "gram.y" /* yacc.c:1646 */ { RangeTableFunc *n = (RangeTableFunc *) (yyvsp[-1].node); n->lateral = true; n->alias = (yyvsp[0].alias); (yyval.node) = (Node *) n; } #line 41532 "gram.c" /* yacc.c:1646 */ break; case 1760: #line 11930 "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 41571 "gram.c" /* yacc.c:1646 */ break; case 1761: #line 11965 "gram.y" /* yacc.c:1646 */ { RangeSubselect *n = makeNode(RangeSubselect); n->lateral = true; n->subquery = (yyvsp[-1].node); n->alias = (yyvsp[0].alias); /* same comment 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 41600 "gram.c" /* yacc.c:1646 */ break; case 1762: #line 11990 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) (yyvsp[0].jexpr); } #line 41608 "gram.c" /* yacc.c:1646 */ break; case 1763: #line 11994 "gram.y" /* yacc.c:1646 */ { (yyvsp[-2].jexpr)->alias = (yyvsp[0].alias); (yyval.node) = (Node *) (yyvsp[-2].jexpr); } #line 41617 "gram.c" /* yacc.c:1646 */ break; case 1764: #line 12020 "gram.y" /* yacc.c:1646 */ { (yyval.jexpr) = (yyvsp[-1].jexpr); } #line 41625 "gram.c" /* yacc.c:1646 */ break; case 1765: #line 12024 "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 41641 "gram.c" /* yacc.c:1646 */ break; case 1766: #line 12036 "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 41658 "gram.c" /* yacc.c:1646 */ break; case 1767: #line 12049 "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 41676 "gram.c" /* yacc.c:1646 */ break; case 1768: #line 12063 "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 41691 "gram.c" /* yacc.c:1646 */ break; case 1769: #line 12074 "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 41707 "gram.c" /* yacc.c:1646 */ break; case 1770: #line 12089 "gram.y" /* yacc.c:1646 */ { (yyval.alias) = makeNode(Alias); (yyval.alias)->aliasname = (yyvsp[-3].str); (yyval.alias)->colnames = (yyvsp[-1].list); } #line 41717 "gram.c" /* yacc.c:1646 */ break; case 1771: #line 12095 "gram.y" /* yacc.c:1646 */ { (yyval.alias) = makeNode(Alias); (yyval.alias)->aliasname = (yyvsp[0].str); } #line 41726 "gram.c" /* yacc.c:1646 */ break; case 1772: #line 12100 "gram.y" /* yacc.c:1646 */ { (yyval.alias) = makeNode(Alias); (yyval.alias)->aliasname = (yyvsp[-3].str); (yyval.alias)->colnames = (yyvsp[-1].list); } #line 41736 "gram.c" /* yacc.c:1646 */ break; case 1773: #line 12106 "gram.y" /* yacc.c:1646 */ { (yyval.alias) = makeNode(Alias); (yyval.alias)->aliasname = (yyvsp[0].str); } #line 41745 "gram.c" /* yacc.c:1646 */ break; case 1774: #line 12112 "gram.y" /* yacc.c:1646 */ { (yyval.alias) = (yyvsp[0].alias); } #line 41751 "gram.c" /* yacc.c:1646 */ break; case 1775: #line 12113 "gram.y" /* yacc.c:1646 */ { (yyval.alias) = NULL; } #line 41757 "gram.c" /* yacc.c:1646 */ break; case 1776: #line 12122 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make2((yyvsp[0].alias), NIL); } #line 41765 "gram.c" /* yacc.c:1646 */ break; case 1777: #line 12126 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make2(NULL, (yyvsp[-1].list)); } #line 41773 "gram.c" /* yacc.c:1646 */ break; case 1778: #line 12130 "gram.y" /* yacc.c:1646 */ { Alias *a = makeNode(Alias); a->aliasname = (yyvsp[-3].str); (yyval.list) = list_make2(a, (yyvsp[-1].list)); } #line 41783 "gram.c" /* yacc.c:1646 */ break; case 1779: #line 12136 "gram.y" /* yacc.c:1646 */ { Alias *a = makeNode(Alias); a->aliasname = (yyvsp[-3].str); (yyval.list) = list_make2(a, (yyvsp[-1].list)); } #line 41793 "gram.c" /* yacc.c:1646 */ break; case 1780: #line 12142 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make2(NULL, NIL); } #line 41801 "gram.c" /* yacc.c:1646 */ break; case 1781: #line 12147 "gram.y" /* yacc.c:1646 */ { (yyval.jtype) = JOIN_FULL; } #line 41807 "gram.c" /* yacc.c:1646 */ break; case 1782: #line 12148 "gram.y" /* yacc.c:1646 */ { (yyval.jtype) = JOIN_LEFT; } #line 41813 "gram.c" /* yacc.c:1646 */ break; case 1783: #line 12149 "gram.y" /* yacc.c:1646 */ { (yyval.jtype) = JOIN_RIGHT; } #line 41819 "gram.c" /* yacc.c:1646 */ break; case 1784: #line 12150 "gram.y" /* yacc.c:1646 */ { (yyval.jtype) = JOIN_INNER; } #line 41825 "gram.c" /* yacc.c:1646 */ break; case 1785: #line 12154 "gram.y" /* yacc.c:1646 */ { (yyval.node) = NULL; } #line 41831 "gram.c" /* yacc.c:1646 */ break; case 1786: #line 12155 "gram.y" /* yacc.c:1646 */ { (yyval.node) = NULL; } #line 41837 "gram.c" /* yacc.c:1646 */ break; case 1787: #line 12167 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) (yyvsp[-1].list); } #line 41843 "gram.c" /* yacc.c:1646 */ break; case 1788: #line 12168 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 41849 "gram.c" /* yacc.c:1646 */ break; case 1789: #line 12174 "gram.y" /* yacc.c:1646 */ { /* inheritance query, implicitly */ (yyval.range) = (yyvsp[0].range); (yyval.range)->inh = true; (yyval.range)->alias = NULL; } #line 41860 "gram.c" /* yacc.c:1646 */ break; case 1790: #line 12181 "gram.y" /* yacc.c:1646 */ { /* inheritance query, explicitly */ (yyval.range) = (yyvsp[-1].range); (yyval.range)->inh = true; (yyval.range)->alias = NULL; } #line 41871 "gram.c" /* yacc.c:1646 */ break; case 1791: #line 12188 "gram.y" /* yacc.c:1646 */ { /* no inheritance */ (yyval.range) = (yyvsp[0].range); (yyval.range)->inh = false; (yyval.range)->alias = NULL; } #line 41882 "gram.c" /* yacc.c:1646 */ break; case 1792: #line 12195 "gram.y" /* yacc.c:1646 */ { /* no inheritance, SQL99-style syntax */ (yyval.range) = (yyvsp[-1].range); (yyval.range)->inh = false; (yyval.range)->alias = NULL; } #line 41893 "gram.c" /* yacc.c:1646 */ break; case 1793: #line 12205 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].range)); } #line 41899 "gram.c" /* yacc.c:1646 */ break; case 1794: #line 12206 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].range)); } #line 41905 "gram.c" /* yacc.c:1646 */ break; case 1795: #line 12220 "gram.y" /* yacc.c:1646 */ { (yyval.range) = (yyvsp[0].range); } #line 41913 "gram.c" /* yacc.c:1646 */ break; case 1796: #line 12224 "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 41924 "gram.c" /* yacc.c:1646 */ break; case 1797: #line 12231 "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 41935 "gram.c" /* yacc.c:1646 */ break; case 1798: #line 12244 "gram.y" /* yacc.c:1646 */ { RangeTableSample *n = makeNode(RangeTableSample); /* n->relation will be filled in later */ n->method = (yyvsp[-4].list); n->args = (yyvsp[-2].list); n->repeatable = (yyvsp[0].node); n->location = (yylsp[-4]); (yyval.node) = (Node *) n; } #line 41949 "gram.c" /* yacc.c:1646 */ break; case 1799: #line 12256 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) (yyvsp[-1].node); } #line 41955 "gram.c" /* yacc.c:1646 */ break; case 1800: #line 12257 "gram.y" /* yacc.c:1646 */ { (yyval.node) = NULL; } #line 41961 "gram.c" /* yacc.c:1646 */ break; case 1801: #line 12273 "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 41975 "gram.c" /* yacc.c:1646 */ break; case 1802: #line 12283 "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 41989 "gram.c" /* yacc.c:1646 */ break; case 1803: #line 12295 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make2((yyvsp[-1].node), (yyvsp[0].list)); } #line 41995 "gram.c" /* yacc.c:1646 */ break; case 1804: #line 12299 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].list)); } #line 42001 "gram.c" /* yacc.c:1646 */ break; case 1805: #line 12300 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].list)); } #line 42007 "gram.c" /* yacc.c:1646 */ break; case 1806: #line 12303 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[-1].list); } #line 42013 "gram.c" /* yacc.c:1646 */ break; case 1807: #line 12304 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 42019 "gram.c" /* yacc.c:1646 */ break; case 1808: #line 12307 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = true; } #line 42025 "gram.c" /* yacc.c:1646 */ break; case 1809: #line 12308 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = false; } #line 42031 "gram.c" /* yacc.c:1646 */ break; case 1810: #line 12313 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 42037 "gram.c" /* yacc.c:1646 */ break; case 1811: #line 12314 "gram.y" /* yacc.c:1646 */ { (yyval.node) = NULL; } #line 42043 "gram.c" /* yacc.c:1646 */ break; case 1812: #line 12319 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 42049 "gram.c" /* yacc.c:1646 */ break; case 1813: #line 12321 "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 42061 "gram.c" /* yacc.c:1646 */ break; case 1814: #line 12328 "gram.y" /* yacc.c:1646 */ { (yyval.node) = NULL; } #line 42067 "gram.c" /* yacc.c:1646 */ break; case 1815: #line 12333 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 42073 "gram.c" /* yacc.c:1646 */ break; case 1816: #line 12334 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 42079 "gram.c" /* yacc.c:1646 */ break; case 1817: #line 12339 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].node)); } #line 42087 "gram.c" /* yacc.c:1646 */ break; case 1818: #line 12343 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].node)); } #line 42095 "gram.c" /* yacc.c:1646 */ break; case 1819: #line 12349 "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 42117 "gram.c" /* yacc.c:1646 */ break; case 1820: #line 12373 "gram.y" /* yacc.c:1646 */ { RangeTableFunc *n = makeNode(RangeTableFunc); n->rowexpr = (yyvsp[-4].node); n->docexpr = (yyvsp[-3].node); n->columns = (yyvsp[-1].list); n->namespaces = NIL; n->location = (yylsp[-6]); (yyval.node) = (Node *)n; } #line 42131 "gram.c" /* yacc.c:1646 */ break; case 1821: #line 12384 "gram.y" /* yacc.c:1646 */ { RangeTableFunc *n = makeNode(RangeTableFunc); n->rowexpr = (yyvsp[-4].node); n->docexpr = (yyvsp[-3].node); n->columns = (yyvsp[-1].list); n->namespaces = (yyvsp[-7].list); n->location = (yylsp[-11]); (yyval.node) = (Node *)n; } #line 42145 "gram.c" /* yacc.c:1646 */ break; case 1822: #line 12395 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].node)); } #line 42151 "gram.c" /* yacc.c:1646 */ break; case 1823: #line 12396 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].node)); } #line 42157 "gram.c" /* yacc.c:1646 */ break; case 1824: #line 12401 "gram.y" /* yacc.c:1646 */ { RangeTableFuncCol *fc = makeNode(RangeTableFuncCol); fc->colname = (yyvsp[-1].str); fc->for_ordinality = false; fc->typeName = (yyvsp[0].typnam); fc->is_not_null = false; fc->colexpr = NULL; fc->coldefexpr = NULL; fc->location = (yylsp[-1]); (yyval.node) = (Node *) fc; } #line 42175 "gram.c" /* yacc.c:1646 */ break; case 1825: #line 12415 "gram.y" /* yacc.c:1646 */ { RangeTableFuncCol *fc = makeNode(RangeTableFuncCol); ListCell *option; bool nullability_seen = false; fc->colname = (yyvsp[-2].str); fc->typeName = (yyvsp[-1].typnam); fc->for_ordinality = false; fc->is_not_null = false; fc->colexpr = NULL; fc->coldefexpr = NULL; fc->location = (yylsp[-2]); foreach(option, (yyvsp[0].list)) { DefElem *defel = (DefElem *) lfirst(option); if (strcmp(defel->defname, "default") == 0) { if (fc->coldefexpr != NULL) ereport(ERROR, (errcode(ERRCODE_SYNTAX_ERROR), errmsg("only one DEFAULT value is allowed"), parser_errposition(defel->location))); fc->coldefexpr = defel->arg; } else if (strcmp(defel->defname, "path") == 0) { if (fc->colexpr != NULL) ereport(ERROR, (errcode(ERRCODE_SYNTAX_ERROR), errmsg("only one PATH value per column is allowed"), parser_errposition(defel->location))); fc->colexpr = defel->arg; } else if (strcmp(defel->defname, "is_not_null") == 0) { if (nullability_seen) ereport(ERROR, (errcode(ERRCODE_SYNTAX_ERROR), errmsg("conflicting or redundant NULL / NOT NULL declarations for column \"%s\"", fc->colname), parser_errposition(defel->location))); fc->is_not_null = intVal(defel->arg); nullability_seen = true; } else { ereport(ERROR, (errcode(ERRCODE_SYNTAX_ERROR), errmsg("unrecognized column option \"%s\"", defel->defname), parser_errposition(defel->location))); } } (yyval.node) = (Node *) fc; } #line 42236 "gram.c" /* yacc.c:1646 */ break; case 1826: #line 12472 "gram.y" /* yacc.c:1646 */ { RangeTableFuncCol *fc = makeNode(RangeTableFuncCol); fc->colname = (yyvsp[-2].str); fc->for_ordinality = true; /* other fields are ignored, initialized by makeNode */ fc->location = (yylsp[-2]); (yyval.node) = (Node *) fc; } #line 42251 "gram.c" /* yacc.c:1646 */ break; case 1827: #line 12486 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].defelt)); } #line 42257 "gram.c" /* yacc.c:1646 */ break; case 1828: #line 12488 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-1].list), (yyvsp[0].defelt)); } #line 42263 "gram.c" /* yacc.c:1646 */ break; case 1829: #line 12493 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem((yyvsp[-1].str), (yyvsp[0].node), (yylsp[-1])); } #line 42269 "gram.c" /* yacc.c:1646 */ break; case 1830: #line 12495 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("default", (yyvsp[0].node), (yylsp[-1])); } #line 42275 "gram.c" /* yacc.c:1646 */ break; case 1831: #line 12497 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("is_not_null", (Node *) makeInteger(true), (yylsp[-1])); } #line 42281 "gram.c" /* yacc.c:1646 */ break; case 1832: #line 12499 "gram.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("is_not_null", (Node *) makeInteger(false), (yylsp[0])); } #line 42287 "gram.c" /* yacc.c:1646 */ break; case 1833: #line 12504 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].target)); } #line 42293 "gram.c" /* yacc.c:1646 */ break; case 1834: #line 12506 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].target)); } #line 42299 "gram.c" /* yacc.c:1646 */ break; case 1835: #line 12511 "gram.y" /* yacc.c:1646 */ { (yyval.target) = makeNode(ResTarget); (yyval.target)->name = (yyvsp[0].str); (yyval.target)->indirection = NIL; (yyval.target)->val = (yyvsp[-2].node); (yyval.target)->location = (yylsp[-2]); } #line 42311 "gram.c" /* yacc.c:1646 */ break; case 1836: #line 12519 "gram.y" /* yacc.c:1646 */ { (yyval.target) = makeNode(ResTarget); (yyval.target)->name = NULL; (yyval.target)->indirection = NIL; (yyval.target)->val = (yyvsp[0].node); (yyval.target)->location = (yylsp[-1]); } #line 42323 "gram.c" /* yacc.c:1646 */ break; case 1837: #line 12539 "gram.y" /* yacc.c:1646 */ { (yyval.typnam) = (yyvsp[-1].typnam); (yyval.typnam)->arrayBounds = (yyvsp[0].list); } #line 42332 "gram.c" /* yacc.c:1646 */ break; case 1838: #line 12544 "gram.y" /* yacc.c:1646 */ { (yyval.typnam) = (yyvsp[-1].typnam); (yyval.typnam)->arrayBounds = (yyvsp[0].list); (yyval.typnam)->setof = true; } #line 42342 "gram.c" /* yacc.c:1646 */ break; case 1839: #line 12551 "gram.y" /* yacc.c:1646 */ { (yyval.typnam) = (yyvsp[-4].typnam); (yyval.typnam)->arrayBounds = list_make1(makeInteger((yyvsp[-1].ival))); } #line 42351 "gram.c" /* yacc.c:1646 */ break; case 1840: #line 12556 "gram.y" /* yacc.c:1646 */ { (yyval.typnam) = (yyvsp[-4].typnam); (yyval.typnam)->arrayBounds = list_make1(makeInteger((yyvsp[-1].ival))); (yyval.typnam)->setof = true; } #line 42361 "gram.c" /* yacc.c:1646 */ break; case 1841: #line 12562 "gram.y" /* yacc.c:1646 */ { (yyval.typnam) = (yyvsp[-1].typnam); (yyval.typnam)->arrayBounds = list_make1(makeInteger(-1)); } #line 42370 "gram.c" /* yacc.c:1646 */ break; case 1842: #line 12567 "gram.y" /* yacc.c:1646 */ { (yyval.typnam) = (yyvsp[-1].typnam); (yyval.typnam)->arrayBounds = list_make1(makeInteger(-1)); (yyval.typnam)->setof = true; } #line 42380 "gram.c" /* yacc.c:1646 */ break; case 1843: #line 12576 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), makeInteger(-1)); } #line 42386 "gram.c" /* yacc.c:1646 */ break; case 1844: #line 12578 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-3].list), makeInteger((yyvsp[-1].ival))); } #line 42392 "gram.c" /* yacc.c:1646 */ break; case 1845: #line 12580 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 42398 "gram.c" /* yacc.c:1646 */ break; case 1846: #line 12584 "gram.y" /* yacc.c:1646 */ { (yyval.typnam) = (yyvsp[0].typnam); } #line 42404 "gram.c" /* yacc.c:1646 */ break; case 1847: #line 12585 "gram.y" /* yacc.c:1646 */ { (yyval.typnam) = (yyvsp[0].typnam); } #line 42410 "gram.c" /* yacc.c:1646 */ break; case 1848: #line 12586 "gram.y" /* yacc.c:1646 */ { (yyval.typnam) = (yyvsp[0].typnam); } #line 42416 "gram.c" /* yacc.c:1646 */ break; case 1849: #line 12587 "gram.y" /* yacc.c:1646 */ { (yyval.typnam) = (yyvsp[0].typnam); } #line 42422 "gram.c" /* yacc.c:1646 */ break; case 1850: #line 12588 "gram.y" /* yacc.c:1646 */ { (yyval.typnam) = (yyvsp[0].typnam); } #line 42428 "gram.c" /* yacc.c:1646 */ break; case 1851: #line 12590 "gram.y" /* yacc.c:1646 */ { (yyval.typnam) = (yyvsp[-1].typnam); (yyval.typnam)->typmods = (yyvsp[0].list); } #line 42437 "gram.c" /* yacc.c:1646 */ break; case 1852: #line 12595 "gram.y" /* yacc.c:1646 */ { (yyval.typnam) = (yyvsp[-3].typnam); (yyval.typnam)->typmods = list_make2(makeIntConst(INTERVAL_FULL_RANGE, -1), makeIntConst((yyvsp[-1].ival), (yylsp[-1]))); } #line 42447 "gram.c" /* yacc.c:1646 */ break; case 1853: #line 12614 "gram.y" /* yacc.c:1646 */ { (yyval.typnam) = (yyvsp[0].typnam); } #line 42453 "gram.c" /* yacc.c:1646 */ break; case 1854: #line 12615 "gram.y" /* yacc.c:1646 */ { (yyval.typnam) = (yyvsp[0].typnam); } #line 42459 "gram.c" /* yacc.c:1646 */ break; case 1855: #line 12616 "gram.y" /* yacc.c:1646 */ { (yyval.typnam) = (yyvsp[0].typnam); } #line 42465 "gram.c" /* yacc.c:1646 */ break; case 1856: #line 12617 "gram.y" /* yacc.c:1646 */ { (yyval.typnam) = (yyvsp[0].typnam); } #line 42471 "gram.c" /* yacc.c:1646 */ break; case 1857: #line 12629 "gram.y" /* yacc.c:1646 */ { (yyval.typnam) = makeTypeName((yyvsp[-1].str)); (yyval.typnam)->typmods = (yyvsp[0].list); (yyval.typnam)->location = (yylsp[-1]); } #line 42481 "gram.c" /* yacc.c:1646 */ break; case 1858: #line 12635 "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 42491 "gram.c" /* yacc.c:1646 */ break; case 1859: #line 12642 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[-1].list); } #line 42497 "gram.c" /* yacc.c:1646 */ break; case 1860: #line 12643 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 42503 "gram.c" /* yacc.c:1646 */ break; case 1861: #line 12650 "gram.y" /* yacc.c:1646 */ { (yyval.typnam) = SystemTypeName("int4"); (yyval.typnam)->location = (yylsp[0]); } #line 42512 "gram.c" /* yacc.c:1646 */ break; case 1862: #line 12655 "gram.y" /* yacc.c:1646 */ { (yyval.typnam) = SystemTypeName("int4"); (yyval.typnam)->location = (yylsp[0]); } #line 42521 "gram.c" /* yacc.c:1646 */ break; case 1863: #line 12660 "gram.y" /* yacc.c:1646 */ { (yyval.typnam) = SystemTypeName("int2"); (yyval.typnam)->location = (yylsp[0]); } #line 42530 "gram.c" /* yacc.c:1646 */ break; case 1864: #line 12665 "gram.y" /* yacc.c:1646 */ { (yyval.typnam) = SystemTypeName("int8"); (yyval.typnam)->location = (yylsp[0]); } #line 42539 "gram.c" /* yacc.c:1646 */ break; case 1865: #line 12670 "gram.y" /* yacc.c:1646 */ { (yyval.typnam) = SystemTypeName("float4"); (yyval.typnam)->location = (yylsp[0]); } #line 42548 "gram.c" /* yacc.c:1646 */ break; case 1866: #line 12675 "gram.y" /* yacc.c:1646 */ { (yyval.typnam) = (yyvsp[0].typnam); (yyval.typnam)->location = (yylsp[-1]); } #line 42557 "gram.c" /* yacc.c:1646 */ break; case 1867: #line 12680 "gram.y" /* yacc.c:1646 */ { (yyval.typnam) = SystemTypeName("float8"); (yyval.typnam)->location = (yylsp[-1]); } #line 42566 "gram.c" /* yacc.c:1646 */ break; case 1868: #line 12685 "gram.y" /* yacc.c:1646 */ { (yyval.typnam) = SystemTypeName("numeric"); (yyval.typnam)->typmods = (yyvsp[0].list); (yyval.typnam)->location = (yylsp[-1]); } #line 42576 "gram.c" /* yacc.c:1646 */ break; case 1869: #line 12691 "gram.y" /* yacc.c:1646 */ { (yyval.typnam) = SystemTypeName("numeric"); (yyval.typnam)->typmods = (yyvsp[0].list); (yyval.typnam)->location = (yylsp[-1]); } #line 42586 "gram.c" /* yacc.c:1646 */ break; case 1870: #line 12697 "gram.y" /* yacc.c:1646 */ { (yyval.typnam) = SystemTypeName("numeric"); (yyval.typnam)->typmods = (yyvsp[0].list); (yyval.typnam)->location = (yylsp[-1]); } #line 42596 "gram.c" /* yacc.c:1646 */ break; case 1871: #line 12703 "gram.y" /* yacc.c:1646 */ { (yyval.typnam) = SystemTypeName("bool"); (yyval.typnam)->location = (yylsp[0]); } #line 42605 "gram.c" /* yacc.c:1646 */ break; case 1872: #line 12710 "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 42630 "gram.c" /* yacc.c:1646 */ break; case 1873: #line 12731 "gram.y" /* yacc.c:1646 */ { (yyval.typnam) = SystemTypeName("float8"); } #line 42638 "gram.c" /* yacc.c:1646 */ break; case 1874: #line 12741 "gram.y" /* yacc.c:1646 */ { (yyval.typnam) = (yyvsp[0].typnam); } #line 42646 "gram.c" /* yacc.c:1646 */ break; case 1875: #line 12745 "gram.y" /* yacc.c:1646 */ { (yyval.typnam) = (yyvsp[0].typnam); } #line 42654 "gram.c" /* yacc.c:1646 */ break; case 1876: #line 12753 "gram.y" /* yacc.c:1646 */ { (yyval.typnam) = (yyvsp[0].typnam); } #line 42662 "gram.c" /* yacc.c:1646 */ break; case 1877: #line 12757 "gram.y" /* yacc.c:1646 */ { (yyval.typnam) = (yyvsp[0].typnam); (yyval.typnam)->typmods = NIL; } #line 42671 "gram.c" /* yacc.c:1646 */ break; case 1878: #line 12765 "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 42684 "gram.c" /* yacc.c:1646 */ break; case 1879: #line 12777 "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 42702 "gram.c" /* yacc.c:1646 */ break; case 1880: #line 12798 "gram.y" /* yacc.c:1646 */ { (yyval.typnam) = (yyvsp[0].typnam); } #line 42710 "gram.c" /* yacc.c:1646 */ break; case 1881: #line 12802 "gram.y" /* yacc.c:1646 */ { (yyval.typnam) = (yyvsp[0].typnam); } #line 42718 "gram.c" /* yacc.c:1646 */ break; case 1882: #line 12808 "gram.y" /* yacc.c:1646 */ { (yyval.typnam) = (yyvsp[0].typnam); } #line 42726 "gram.c" /* yacc.c:1646 */ break; case 1883: #line 12812 "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 42741 "gram.c" /* yacc.c:1646 */ break; case 1884: #line 12825 "gram.y" /* yacc.c:1646 */ { (yyval.typnam) = SystemTypeName((yyvsp[-3].str)); (yyval.typnam)->typmods = list_make1(makeIntConst((yyvsp[-1].ival), (yylsp[-1]))); (yyval.typnam)->location = (yylsp[-3]); } #line 42751 "gram.c" /* yacc.c:1646 */ break; case 1885: #line 12833 "gram.y" /* yacc.c:1646 */ { (yyval.typnam) = SystemTypeName((yyvsp[0].str)); /* char defaults to char(1), varchar to no limit */ if (strcmp((yyvsp[0].str), "bpchar") == 0) (yyval.typnam)->typmods = list_make1(makeIntConst(1, -1)); (yyval.typnam)->location = (yylsp[0]); } #line 42763 "gram.c" /* yacc.c:1646 */ break; case 1886: #line 12843 "gram.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].boolean) ? "varchar": "bpchar"; } #line 42769 "gram.c" /* yacc.c:1646 */ break; case 1887: #line 12845 "gram.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].boolean) ? "varchar": "bpchar"; } #line 42775 "gram.c" /* yacc.c:1646 */ break; case 1888: #line 12847 "gram.y" /* yacc.c:1646 */ { (yyval.str) = "varchar"; } #line 42781 "gram.c" /* yacc.c:1646 */ break; case 1889: #line 12849 "gram.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].boolean) ? "varchar": "bpchar"; } #line 42787 "gram.c" /* yacc.c:1646 */ break; case 1890: #line 12851 "gram.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].boolean) ? "varchar": "bpchar"; } #line 42793 "gram.c" /* yacc.c:1646 */ break; case 1891: #line 12853 "gram.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].boolean) ? "varchar": "bpchar"; } #line 42799 "gram.c" /* yacc.c:1646 */ break; case 1892: #line 12857 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = true; } #line 42805 "gram.c" /* yacc.c:1646 */ break; case 1893: #line 12858 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = false; } #line 42811 "gram.c" /* yacc.c:1646 */ break; case 1894: #line 12866 "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 42824 "gram.c" /* yacc.c:1646 */ break; case 1895: #line 12875 "gram.y" /* yacc.c:1646 */ { if ((yyvsp[0].boolean)) (yyval.typnam) = SystemTypeName("timestamptz"); else (yyval.typnam) = SystemTypeName("timestamp"); (yyval.typnam)->location = (yylsp[-1]); } #line 42836 "gram.c" /* yacc.c:1646 */ break; case 1896: #line 12883 "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 42849 "gram.c" /* yacc.c:1646 */ break; case 1897: #line 12892 "gram.y" /* yacc.c:1646 */ { if ((yyvsp[0].boolean)) (yyval.typnam) = SystemTypeName("timetz"); else (yyval.typnam) = SystemTypeName("time"); (yyval.typnam)->location = (yylsp[-1]); } #line 42861 "gram.c" /* yacc.c:1646 */ break; case 1898: #line 12903 "gram.y" /* yacc.c:1646 */ { (yyval.typnam) = SystemTypeName("interval"); (yyval.typnam)->location = (yylsp[0]); } #line 42870 "gram.c" /* yacc.c:1646 */ break; case 1899: #line 12910 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = true; } #line 42876 "gram.c" /* yacc.c:1646 */ break; case 1900: #line 12911 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = false; } #line 42882 "gram.c" /* yacc.c:1646 */ break; case 1901: #line 12912 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = false; } #line 42888 "gram.c" /* yacc.c:1646 */ break; case 1902: #line 12917 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1(makeIntConst(INTERVAL_MASK(YEAR), (yylsp[0]))); } #line 42894 "gram.c" /* yacc.c:1646 */ break; case 1903: #line 12919 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1(makeIntConst(INTERVAL_MASK(MONTH), (yylsp[0]))); } #line 42900 "gram.c" /* yacc.c:1646 */ break; case 1904: #line 12921 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1(makeIntConst(INTERVAL_MASK(DAY), (yylsp[0]))); } #line 42906 "gram.c" /* yacc.c:1646 */ break; case 1905: #line 12923 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1(makeIntConst(INTERVAL_MASK(HOUR), (yylsp[0]))); } #line 42912 "gram.c" /* yacc.c:1646 */ break; case 1906: #line 12925 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1(makeIntConst(INTERVAL_MASK(MINUTE), (yylsp[0]))); } #line 42918 "gram.c" /* yacc.c:1646 */ break; case 1907: #line 12927 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 42924 "gram.c" /* yacc.c:1646 */ break; case 1908: #line 12929 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1(makeIntConst(INTERVAL_MASK(YEAR) | INTERVAL_MASK(MONTH), (yylsp[-2]))); } #line 42933 "gram.c" /* yacc.c:1646 */ break; case 1909: #line 12934 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1(makeIntConst(INTERVAL_MASK(DAY) | INTERVAL_MASK(HOUR), (yylsp[-2]))); } #line 42942 "gram.c" /* yacc.c:1646 */ break; case 1910: #line 12939 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1(makeIntConst(INTERVAL_MASK(DAY) | INTERVAL_MASK(HOUR) | INTERVAL_MASK(MINUTE), (yylsp[-2]))); } #line 42952 "gram.c" /* yacc.c:1646 */ break; case 1911: #line 12945 "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 42964 "gram.c" /* yacc.c:1646 */ break; case 1912: #line 12953 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1(makeIntConst(INTERVAL_MASK(HOUR) | INTERVAL_MASK(MINUTE), (yylsp[-2]))); } #line 42973 "gram.c" /* yacc.c:1646 */ break; case 1913: #line 12958 "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 42984 "gram.c" /* yacc.c:1646 */ break; case 1914: #line 12965 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); linitial((yyval.list)) = makeIntConst(INTERVAL_MASK(MINUTE) | INTERVAL_MASK(SECOND), (yylsp[-2])); } #line 42994 "gram.c" /* yacc.c:1646 */ break; case 1915: #line 12971 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 43000 "gram.c" /* yacc.c:1646 */ break; case 1916: #line 12976 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1(makeIntConst(INTERVAL_MASK(SECOND), (yylsp[0]))); } #line 43008 "gram.c" /* yacc.c:1646 */ break; case 1917: #line 12980 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make2(makeIntConst(INTERVAL_MASK(SECOND), (yylsp[-3])), makeIntConst((yyvsp[-1].ival), (yylsp[-1]))); } #line 43017 "gram.c" /* yacc.c:1646 */ break; case 1918: #line 13015 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 43023 "gram.c" /* yacc.c:1646 */ break; case 1919: #line 13017 "gram.y" /* yacc.c:1646 */ { (yyval.node) = makeTypeCast((yyvsp[-2].node), (yyvsp[0].typnam), (yylsp[-1])); } #line 43029 "gram.c" /* yacc.c:1646 */ break; case 1920: #line 13019 "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 43041 "gram.c" /* yacc.c:1646 */ break; case 1921: #line 13027 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeFuncCall(SystemFuncName("timezone"), list_make2((yyvsp[0].node), (yyvsp[-4].node)), (yylsp[-3])); } #line 43051 "gram.c" /* yacc.c:1646 */ break; case 1922: #line 13042 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OP, "+", NULL, (yyvsp[0].node), (yylsp[-1])); } #line 43057 "gram.c" /* yacc.c:1646 */ break; case 1923: #line 13044 "gram.y" /* yacc.c:1646 */ { (yyval.node) = doNegate((yyvsp[0].node), (yylsp[-1])); } #line 43063 "gram.c" /* yacc.c:1646 */ break; case 1924: #line 13046 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OP, "+", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 43069 "gram.c" /* yacc.c:1646 */ break; case 1925: #line 13048 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OP, "-", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 43075 "gram.c" /* yacc.c:1646 */ break; case 1926: #line 13050 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OP, "*", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 43081 "gram.c" /* yacc.c:1646 */ break; case 1927: #line 13052 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OP, "/", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 43087 "gram.c" /* yacc.c:1646 */ break; case 1928: #line 13054 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OP, "%", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 43093 "gram.c" /* yacc.c:1646 */ break; case 1929: #line 13056 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OP, "^", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 43099 "gram.c" /* yacc.c:1646 */ break; case 1930: #line 13058 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OP, "<", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 43105 "gram.c" /* yacc.c:1646 */ break; case 1931: #line 13060 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OP, ">", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 43111 "gram.c" /* yacc.c:1646 */ break; case 1932: #line 13062 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OP, "=", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 43117 "gram.c" /* yacc.c:1646 */ break; case 1933: #line 13064 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OP, "<=", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 43123 "gram.c" /* yacc.c:1646 */ break; case 1934: #line 13066 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OP, ">=", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 43129 "gram.c" /* yacc.c:1646 */ break; case 1935: #line 13068 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OP, "<>", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 43135 "gram.c" /* yacc.c:1646 */ break; case 1936: #line 13071 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeA_Expr(AEXPR_OP, (yyvsp[-1].list), (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 43141 "gram.c" /* yacc.c:1646 */ break; case 1937: #line 13073 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeA_Expr(AEXPR_OP, (yyvsp[-1].list), NULL, (yyvsp[0].node), (yylsp[-1])); } #line 43147 "gram.c" /* yacc.c:1646 */ break; case 1938: #line 13075 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeA_Expr(AEXPR_OP, (yyvsp[0].list), (yyvsp[-1].node), NULL, (yylsp[0])); } #line 43153 "gram.c" /* yacc.c:1646 */ break; case 1939: #line 13078 "gram.y" /* yacc.c:1646 */ { (yyval.node) = makeAndExpr((yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 43159 "gram.c" /* yacc.c:1646 */ break; case 1940: #line 13080 "gram.y" /* yacc.c:1646 */ { (yyval.node) = makeOrExpr((yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 43165 "gram.c" /* yacc.c:1646 */ break; case 1941: #line 13082 "gram.y" /* yacc.c:1646 */ { (yyval.node) = makeNotExpr((yyvsp[0].node), (yylsp[-1])); } #line 43171 "gram.c" /* yacc.c:1646 */ break; case 1942: #line 13084 "gram.y" /* yacc.c:1646 */ { (yyval.node) = makeNotExpr((yyvsp[0].node), (yylsp[-1])); } #line 43177 "gram.c" /* yacc.c:1646 */ break; case 1943: #line 13087 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_LIKE, "~~", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 43186 "gram.c" /* yacc.c:1646 */ break; case 1944: #line 13092 "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_LIKE, "~~", (yyvsp[-4].node), (Node *) n, (yylsp[-3])); } #line 43198 "gram.c" /* yacc.c:1646 */ break; case 1945: #line 13100 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_LIKE, "!~~", (yyvsp[-3].node), (yyvsp[0].node), (yylsp[-2])); } #line 43207 "gram.c" /* yacc.c:1646 */ break; case 1946: #line 13105 "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_LIKE, "!~~", (yyvsp[-5].node), (Node *) n, (yylsp[-4])); } #line 43219 "gram.c" /* yacc.c:1646 */ break; case 1947: #line 13113 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_ILIKE, "~~*", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 43228 "gram.c" /* yacc.c:1646 */ break; case 1948: #line 13118 "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_ILIKE, "~~*", (yyvsp[-4].node), (Node *) n, (yylsp[-3])); } #line 43240 "gram.c" /* yacc.c:1646 */ break; case 1949: #line 13126 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_ILIKE, "!~~*", (yyvsp[-3].node), (yyvsp[0].node), (yylsp[-2])); } #line 43249 "gram.c" /* yacc.c:1646 */ break; case 1950: #line 13131 "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_ILIKE, "!~~*", (yyvsp[-5].node), (Node *) n, (yylsp[-4])); } #line 43261 "gram.c" /* yacc.c:1646 */ break; case 1951: #line 13140 "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_SIMILAR, "~", (yyvsp[-3].node), (Node *) n, (yylsp[-2])); } #line 43273 "gram.c" /* yacc.c:1646 */ break; case 1952: #line 13148 "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_SIMILAR, "~", (yyvsp[-5].node), (Node *) n, (yylsp[-4])); } #line 43285 "gram.c" /* yacc.c:1646 */ break; case 1953: #line 13156 "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_SIMILAR, "!~", (yyvsp[-4].node), (Node *) n, (yylsp[-3])); } #line 43297 "gram.c" /* yacc.c:1646 */ break; case 1954: #line 13164 "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_SIMILAR, "!~", (yyvsp[-6].node), (Node *) n, (yylsp[-5])); } #line 43309 "gram.c" /* yacc.c:1646 */ break; case 1955: #line 13182 "gram.y" /* yacc.c:1646 */ { NullTest *n = makeNode(NullTest); n->arg = (Expr *) (yyvsp[-2].node); n->nulltesttype = IS_NULL; n->location = (yylsp[-1]); (yyval.node) = (Node *)n; } #line 43321 "gram.c" /* yacc.c:1646 */ break; case 1956: #line 13190 "gram.y" /* yacc.c:1646 */ { NullTest *n = makeNode(NullTest); n->arg = (Expr *) (yyvsp[-1].node); n->nulltesttype = IS_NULL; n->location = (yylsp[0]); (yyval.node) = (Node *)n; } #line 43333 "gram.c" /* yacc.c:1646 */ break; case 1957: #line 13198 "gram.y" /* yacc.c:1646 */ { NullTest *n = makeNode(NullTest); n->arg = (Expr *) (yyvsp[-3].node); n->nulltesttype = IS_NOT_NULL; n->location = (yylsp[-2]); (yyval.node) = (Node *)n; } #line 43345 "gram.c" /* yacc.c:1646 */ break; case 1958: #line 13206 "gram.y" /* yacc.c:1646 */ { NullTest *n = makeNode(NullTest); n->arg = (Expr *) (yyvsp[-1].node); n->nulltesttype = IS_NOT_NULL; n->location = (yylsp[0]); (yyval.node) = (Node *)n; } #line 43357 "gram.c" /* yacc.c:1646 */ break; case 1959: #line 13214 "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 43377 "gram.c" /* yacc.c:1646 */ break; case 1960: #line 13230 "gram.y" /* yacc.c:1646 */ { BooleanTest *b = makeNode(BooleanTest); b->arg = (Expr *) (yyvsp[-2].node); b->booltesttype = IS_TRUE; b->location = (yylsp[-1]); (yyval.node) = (Node *)b; } #line 43389 "gram.c" /* yacc.c:1646 */ break; case 1961: #line 13238 "gram.y" /* yacc.c:1646 */ { BooleanTest *b = makeNode(BooleanTest); b->arg = (Expr *) (yyvsp[-3].node); b->booltesttype = IS_NOT_TRUE; b->location = (yylsp[-2]); (yyval.node) = (Node *)b; } #line 43401 "gram.c" /* yacc.c:1646 */ break; case 1962: #line 13246 "gram.y" /* yacc.c:1646 */ { BooleanTest *b = makeNode(BooleanTest); b->arg = (Expr *) (yyvsp[-2].node); b->booltesttype = IS_FALSE; b->location = (yylsp[-1]); (yyval.node) = (Node *)b; } #line 43413 "gram.c" /* yacc.c:1646 */ break; case 1963: #line 13254 "gram.y" /* yacc.c:1646 */ { BooleanTest *b = makeNode(BooleanTest); b->arg = (Expr *) (yyvsp[-3].node); b->booltesttype = IS_NOT_FALSE; b->location = (yylsp[-2]); (yyval.node) = (Node *)b; } #line 43425 "gram.c" /* yacc.c:1646 */ break; case 1964: #line 13262 "gram.y" /* yacc.c:1646 */ { BooleanTest *b = makeNode(BooleanTest); b->arg = (Expr *) (yyvsp[-2].node); b->booltesttype = IS_UNKNOWN; b->location = (yylsp[-1]); (yyval.node) = (Node *)b; } #line 43437 "gram.c" /* yacc.c:1646 */ break; case 1965: #line 13270 "gram.y" /* yacc.c:1646 */ { BooleanTest *b = makeNode(BooleanTest); b->arg = (Expr *) (yyvsp[-3].node); b->booltesttype = IS_NOT_UNKNOWN; b->location = (yylsp[-2]); (yyval.node) = (Node *)b; } #line 43449 "gram.c" /* yacc.c:1646 */ break; case 1966: #line 13278 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_DISTINCT, "=", (yyvsp[-4].node), (yyvsp[0].node), (yylsp[-3])); } #line 43457 "gram.c" /* yacc.c:1646 */ break; case 1967: #line 13282 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_NOT_DISTINCT, "=", (yyvsp[-5].node), (yyvsp[0].node), (yylsp[-4])); } #line 43465 "gram.c" /* yacc.c:1646 */ break; case 1968: #line 13286 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OF, "=", (yyvsp[-5].node), (Node *) (yyvsp[-1].list), (yylsp[-4])); } #line 43473 "gram.c" /* yacc.c:1646 */ break; case 1969: #line 13290 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OF, "<>", (yyvsp[-6].node), (Node *) (yyvsp[-1].list), (yylsp[-5])); } #line 43481 "gram.c" /* yacc.c:1646 */ break; case 1970: #line 13294 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_BETWEEN, "BETWEEN", (yyvsp[-5].node), (Node *) list_make2((yyvsp[-2].node), (yyvsp[0].node)), (yylsp[-4])); } #line 43493 "gram.c" /* yacc.c:1646 */ break; case 1971: #line 13302 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_NOT_BETWEEN, "NOT BETWEEN", (yyvsp[-6].node), (Node *) list_make2((yyvsp[-2].node), (yyvsp[0].node)), (yylsp[-5])); } #line 43505 "gram.c" /* yacc.c:1646 */ break; case 1972: #line 13310 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_BETWEEN_SYM, "BETWEEN SYMMETRIC", (yyvsp[-5].node), (Node *) list_make2((yyvsp[-2].node), (yyvsp[0].node)), (yylsp[-4])); } #line 43517 "gram.c" /* yacc.c:1646 */ break; case 1973: #line 13318 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_NOT_BETWEEN_SYM, "NOT BETWEEN SYMMETRIC", (yyvsp[-6].node), (Node *) list_make2((yyvsp[-2].node), (yyvsp[0].node)), (yylsp[-5])); } #line 43529 "gram.c" /* yacc.c:1646 */ break; case 1974: #line 13326 "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->subLinkId = 0; n->testexpr = (yyvsp[-2].node); n->operName = NIL; /* show it's IN not = ANY */ 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 43553 "gram.c" /* yacc.c:1646 */ break; case 1975: #line 13346 "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->subLinkId = 0; n->testexpr = (yyvsp[-3].node); n->operName = NIL; /* show it's IN not = ANY */ n->location = (yylsp[-2]); /* Stick a NOT on top; must have same parse location */ (yyval.node) = makeNotExpr((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 43579 "gram.c" /* yacc.c:1646 */ break; case 1976: #line 13368 "gram.y" /* yacc.c:1646 */ { SubLink *n = makeNode(SubLink); n->subLinkType = (yyvsp[-1].ival); n->subLinkId = 0; n->testexpr = (yyvsp[-3].node); n->operName = (yyvsp[-2].list); n->subselect = (yyvsp[0].node); n->location = (yylsp[-2]); (yyval.node) = (Node *)n; } #line 43594 "gram.c" /* yacc.c:1646 */ break; case 1977: #line 13379 "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 43605 "gram.c" /* yacc.c:1646 */ break; case 1978: #line 13386 "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 43625 "gram.c" /* yacc.c:1646 */ break; case 1979: #line 13402 "gram.y" /* yacc.c:1646 */ { (yyval.node) = makeXmlExpr(IS_DOCUMENT, NULL, NIL, list_make1((yyvsp[-2].node)), (yylsp[-1])); } #line 43634 "gram.c" /* yacc.c:1646 */ break; case 1980: #line 13407 "gram.y" /* yacc.c:1646 */ { (yyval.node) = makeNotExpr(makeXmlExpr(IS_DOCUMENT, NULL, NIL, list_make1((yyvsp[-3].node)), (yylsp[-2])), (yylsp[-2])); } #line 43644 "gram.c" /* yacc.c:1646 */ break; case 1981: #line 13413 "gram.y" /* yacc.c:1646 */ { /* * The SQL spec only allows DEFAULT in "contextually typed * expressions", but for us, it's easier to allow it in * any a_expr and then throw error during parse analysis * if it's in an inappropriate context. This way also * lets us say something smarter than "syntax error". */ SetToDefault *n = makeNode(SetToDefault); /* parse analysis will fill in the rest */ n->location = (yylsp[0]); (yyval.node) = (Node *)n; } #line 43662 "gram.c" /* yacc.c:1646 */ break; case 1982: #line 13438 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 43668 "gram.c" /* yacc.c:1646 */ break; case 1983: #line 13440 "gram.y" /* yacc.c:1646 */ { (yyval.node) = makeTypeCast((yyvsp[-2].node), (yyvsp[0].typnam), (yylsp[-1])); } #line 43674 "gram.c" /* yacc.c:1646 */ break; case 1984: #line 13442 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OP, "+", NULL, (yyvsp[0].node), (yylsp[-1])); } #line 43680 "gram.c" /* yacc.c:1646 */ break; case 1985: #line 13444 "gram.y" /* yacc.c:1646 */ { (yyval.node) = doNegate((yyvsp[0].node), (yylsp[-1])); } #line 43686 "gram.c" /* yacc.c:1646 */ break; case 1986: #line 13446 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OP, "+", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 43692 "gram.c" /* yacc.c:1646 */ break; case 1987: #line 13448 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OP, "-", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 43698 "gram.c" /* yacc.c:1646 */ break; case 1988: #line 13450 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OP, "*", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 43704 "gram.c" /* yacc.c:1646 */ break; case 1989: #line 13452 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OP, "/", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 43710 "gram.c" /* yacc.c:1646 */ break; case 1990: #line 13454 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OP, "%", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 43716 "gram.c" /* yacc.c:1646 */ break; case 1991: #line 13456 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OP, "^", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 43722 "gram.c" /* yacc.c:1646 */ break; case 1992: #line 13458 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OP, "<", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 43728 "gram.c" /* yacc.c:1646 */ break; case 1993: #line 13460 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OP, ">", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 43734 "gram.c" /* yacc.c:1646 */ break; case 1994: #line 13462 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OP, "=", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 43740 "gram.c" /* yacc.c:1646 */ break; case 1995: #line 13464 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OP, "<=", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 43746 "gram.c" /* yacc.c:1646 */ break; case 1996: #line 13466 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OP, ">=", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 43752 "gram.c" /* yacc.c:1646 */ break; case 1997: #line 13468 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OP, "<>", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 43758 "gram.c" /* yacc.c:1646 */ break; case 1998: #line 13470 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeA_Expr(AEXPR_OP, (yyvsp[-1].list), (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 43764 "gram.c" /* yacc.c:1646 */ break; case 1999: #line 13472 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeA_Expr(AEXPR_OP, (yyvsp[-1].list), NULL, (yyvsp[0].node), (yylsp[-1])); } #line 43770 "gram.c" /* yacc.c:1646 */ break; case 2000: #line 13474 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeA_Expr(AEXPR_OP, (yyvsp[0].list), (yyvsp[-1].node), NULL, (yylsp[0])); } #line 43776 "gram.c" /* yacc.c:1646 */ break; case 2001: #line 13476 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_DISTINCT, "=", (yyvsp[-4].node), (yyvsp[0].node), (yylsp[-3])); } #line 43784 "gram.c" /* yacc.c:1646 */ break; case 2002: #line 13480 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_NOT_DISTINCT, "=", (yyvsp[-5].node), (yyvsp[0].node), (yylsp[-4])); } #line 43792 "gram.c" /* yacc.c:1646 */ break; case 2003: #line 13484 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OF, "=", (yyvsp[-5].node), (Node *) (yyvsp[-1].list), (yylsp[-4])); } #line 43800 "gram.c" /* yacc.c:1646 */ break; case 2004: #line 13488 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OF, "<>", (yyvsp[-6].node), (Node *) (yyvsp[-1].list), (yylsp[-5])); } #line 43808 "gram.c" /* yacc.c:1646 */ break; case 2005: #line 13492 "gram.y" /* yacc.c:1646 */ { (yyval.node) = makeXmlExpr(IS_DOCUMENT, NULL, NIL, list_make1((yyvsp[-2].node)), (yylsp[-1])); } #line 43817 "gram.c" /* yacc.c:1646 */ break; case 2006: #line 13497 "gram.y" /* yacc.c:1646 */ { (yyval.node) = makeNotExpr(makeXmlExpr(IS_DOCUMENT, NULL, NIL, list_make1((yyvsp[-3].node)), (yylsp[-2])), (yylsp[-2])); } #line 43827 "gram.c" /* yacc.c:1646 */ break; case 2007: #line 13512 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 43833 "gram.c" /* yacc.c:1646 */ break; case 2008: #line 13513 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 43839 "gram.c" /* yacc.c:1646 */ break; case 2009: #line 13515 "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 43858 "gram.c" /* yacc.c:1646 */ break; case 2010: #line 13530 "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 if (operator_precedence_warning) { /* * If precedence warnings are enabled, insert * AEXPR_PAREN nodes wrapping all explicitly * parenthesized subexpressions; this prevents bogus * warnings from being issued when the ordering has * been forced by parentheses. Take care that an * AEXPR_PAREN node has the same exprLocation as its * child, so as not to cause surprising changes in * error cursor positioning. * * In principle we should not be relying on a GUC to * decide whether to insert AEXPR_PAREN nodes. * However, since they have no effect except to * suppress warnings, it's probably safe enough; and * we'd just as soon not waste cycles on dummy parse * nodes if we don't have to. */ (yyval.node) = (Node *) makeA_Expr(AEXPR_PAREN, NIL, (yyvsp[-2].node), NULL, exprLocation((yyvsp[-2].node))); } else (yyval.node) = (yyvsp[-2].node); } #line 43896 "gram.c" /* yacc.c:1646 */ break; case 2011: #line 13564 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 43902 "gram.c" /* yacc.c:1646 */ break; case 2012: #line 13566 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 43908 "gram.c" /* yacc.c:1646 */ break; case 2013: #line 13568 "gram.y" /* yacc.c:1646 */ { SubLink *n = makeNode(SubLink); n->subLinkType = EXPR_SUBLINK; n->subLinkId = 0; n->testexpr = NULL; n->operName = NIL; n->subselect = (yyvsp[0].node); n->location = (yylsp[0]); (yyval.node) = (Node *)n; } #line 43923 "gram.c" /* yacc.c:1646 */ break; case 2014: #line 13579 "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->subLinkId = 0; 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 43951 "gram.c" /* yacc.c:1646 */ break; case 2015: #line 13603 "gram.y" /* yacc.c:1646 */ { SubLink *n = makeNode(SubLink); n->subLinkType = EXISTS_SUBLINK; n->subLinkId = 0; n->testexpr = NULL; n->operName = NIL; n->subselect = (yyvsp[0].node); n->location = (yylsp[-1]); (yyval.node) = (Node *)n; } #line 43966 "gram.c" /* yacc.c:1646 */ break; case 2016: #line 13614 "gram.y" /* yacc.c:1646 */ { SubLink *n = makeNode(SubLink); n->subLinkType = ARRAY_SUBLINK; n->subLinkId = 0; n->testexpr = NULL; n->operName = NIL; n->subselect = (yyvsp[0].node); n->location = (yylsp[-1]); (yyval.node) = (Node *)n; } #line 43981 "gram.c" /* yacc.c:1646 */ break; case 2017: #line 13625 "gram.y" /* yacc.c:1646 */ { A_ArrayExpr *n = castNode(A_ArrayExpr, (yyvsp[0].node)); /* point outermost A_ArrayExpr to the ARRAY keyword */ n->location = (yylsp[-1]); (yyval.node) = (Node *)n; } #line 43992 "gram.c" /* yacc.c:1646 */ break; case 2018: #line 13632 "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->row_format = COERCE_EXPLICIT_CALL; /* abuse */ r->location = (yylsp[0]); (yyval.node) = (Node *)r; } #line 44006 "gram.c" /* yacc.c:1646 */ break; case 2019: #line 13642 "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->row_format = COERCE_IMPLICIT_CAST; /* abuse */ r->location = (yylsp[0]); (yyval.node) = (Node *)r; } #line 44020 "gram.c" /* yacc.c:1646 */ break; case 2020: #line 13652 "gram.y" /* yacc.c:1646 */ { GroupingFunc *g = makeNode(GroupingFunc); g->args = (yyvsp[-1].list); g->location = (yylsp[-3]); (yyval.node) = (Node *)g; } #line 44031 "gram.c" /* yacc.c:1646 */ break; case 2021: #line 13661 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeFuncCall((yyvsp[-2].list), NIL, (yylsp[-2])); } #line 44039 "gram.c" /* yacc.c:1646 */ break; case 2022: #line 13665 "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 44049 "gram.c" /* yacc.c:1646 */ break; case 2023: #line 13671 "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 44060 "gram.c" /* yacc.c:1646 */ break; case 2024: #line 13678 "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 44071 "gram.c" /* yacc.c:1646 */ break; case 2025: #line 13685 "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 44085 "gram.c" /* yacc.c:1646 */ break; case 2026: #line 13695 "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 44096 "gram.c" /* yacc.c:1646 */ break; case 2027: #line 13702 "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 44116 "gram.c" /* yacc.c:1646 */ break; case 2028: #line 13730 "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 44155 "gram.c" /* yacc.c:1646 */ break; case 2029: #line 13765 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 44161 "gram.c" /* yacc.c:1646 */ break; case 2030: #line 13775 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 44167 "gram.c" /* yacc.c:1646 */ break; case 2031: #line 13776 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 44173 "gram.c" /* yacc.c:1646 */ break; case 2032: #line 13784 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeFuncCall(SystemFuncName("pg_collation_for"), list_make1((yyvsp[-1].node)), (yylsp[-4])); } #line 44183 "gram.c" /* yacc.c:1646 */ break; case 2033: #line 13790 "gram.y" /* yacc.c:1646 */ { (yyval.node) = makeSQLValueFunction(SVFOP_CURRENT_DATE, -1, (yylsp[0])); } #line 44191 "gram.c" /* yacc.c:1646 */ break; case 2034: #line 13794 "gram.y" /* yacc.c:1646 */ { (yyval.node) = makeSQLValueFunction(SVFOP_CURRENT_TIME, -1, (yylsp[0])); } #line 44199 "gram.c" /* yacc.c:1646 */ break; case 2035: #line 13798 "gram.y" /* yacc.c:1646 */ { (yyval.node) = makeSQLValueFunction(SVFOP_CURRENT_TIME_N, (yyvsp[-1].ival), (yylsp[-3])); } #line 44207 "gram.c" /* yacc.c:1646 */ break; case 2036: #line 13802 "gram.y" /* yacc.c:1646 */ { (yyval.node) = makeSQLValueFunction(SVFOP_CURRENT_TIMESTAMP, -1, (yylsp[0])); } #line 44215 "gram.c" /* yacc.c:1646 */ break; case 2037: #line 13806 "gram.y" /* yacc.c:1646 */ { (yyval.node) = makeSQLValueFunction(SVFOP_CURRENT_TIMESTAMP_N, (yyvsp[-1].ival), (yylsp[-3])); } #line 44223 "gram.c" /* yacc.c:1646 */ break; case 2038: #line 13810 "gram.y" /* yacc.c:1646 */ { (yyval.node) = makeSQLValueFunction(SVFOP_LOCALTIME, -1, (yylsp[0])); } #line 44231 "gram.c" /* yacc.c:1646 */ break; case 2039: #line 13814 "gram.y" /* yacc.c:1646 */ { (yyval.node) = makeSQLValueFunction(SVFOP_LOCALTIME_N, (yyvsp[-1].ival), (yylsp[-3])); } #line 44239 "gram.c" /* yacc.c:1646 */ break; case 2040: #line 13818 "gram.y" /* yacc.c:1646 */ { (yyval.node) = makeSQLValueFunction(SVFOP_LOCALTIMESTAMP, -1, (yylsp[0])); } #line 44247 "gram.c" /* yacc.c:1646 */ break; case 2041: #line 13822 "gram.y" /* yacc.c:1646 */ { (yyval.node) = makeSQLValueFunction(SVFOP_LOCALTIMESTAMP_N, (yyvsp[-1].ival), (yylsp[-3])); } #line 44255 "gram.c" /* yacc.c:1646 */ break; case 2042: #line 13826 "gram.y" /* yacc.c:1646 */ { (yyval.node) = makeSQLValueFunction(SVFOP_CURRENT_ROLE, -1, (yylsp[0])); } #line 44263 "gram.c" /* yacc.c:1646 */ break; case 2043: #line 13830 "gram.y" /* yacc.c:1646 */ { (yyval.node) = makeSQLValueFunction(SVFOP_CURRENT_USER, -1, (yylsp[0])); } #line 44271 "gram.c" /* yacc.c:1646 */ break; case 2044: #line 13834 "gram.y" /* yacc.c:1646 */ { (yyval.node) = makeSQLValueFunction(SVFOP_SESSION_USER, -1, (yylsp[0])); } #line 44279 "gram.c" /* yacc.c:1646 */ break; case 2045: #line 13838 "gram.y" /* yacc.c:1646 */ { (yyval.node) = makeSQLValueFunction(SVFOP_USER, -1, (yylsp[0])); } #line 44287 "gram.c" /* yacc.c:1646 */ break; case 2046: #line 13842 "gram.y" /* yacc.c:1646 */ { (yyval.node) = makeSQLValueFunction(SVFOP_CURRENT_CATALOG, -1, (yylsp[0])); } #line 44295 "gram.c" /* yacc.c:1646 */ break; case 2047: #line 13846 "gram.y" /* yacc.c:1646 */ { (yyval.node) = makeSQLValueFunction(SVFOP_CURRENT_SCHEMA, -1, (yylsp[0])); } #line 44303 "gram.c" /* yacc.c:1646 */ break; case 2048: #line 13850 "gram.y" /* yacc.c:1646 */ { (yyval.node) = makeTypeCast((yyvsp[-3].node), (yyvsp[-1].typnam), (yylsp[-5])); } #line 44309 "gram.c" /* yacc.c:1646 */ break; case 2049: #line 13852 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeFuncCall(SystemFuncName("date_part"), (yyvsp[-1].list), (yylsp[-3])); } #line 44317 "gram.c" /* yacc.c:1646 */ break; case 2050: #line 13856 "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 44330 "gram.c" /* yacc.c:1646 */ break; case 2051: #line 13865 "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 44339 "gram.c" /* yacc.c:1646 */ break; case 2052: #line 13870 "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 44350 "gram.c" /* yacc.c:1646 */ break; case 2053: #line 13877 "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 44369 "gram.c" /* yacc.c:1646 */ break; case 2054: #line 13892 "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 44380 "gram.c" /* yacc.c:1646 */ break; case 2055: #line 13899 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeFuncCall(SystemFuncName("ltrim"), (yyvsp[-1].list), (yylsp[-4])); } #line 44388 "gram.c" /* yacc.c:1646 */ break; case 2056: #line 13903 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeFuncCall(SystemFuncName("rtrim"), (yyvsp[-1].list), (yylsp[-4])); } #line 44396 "gram.c" /* yacc.c:1646 */ break; case 2057: #line 13907 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeFuncCall(SystemFuncName("btrim"), (yyvsp[-1].list), (yylsp[-3])); } #line 44404 "gram.c" /* yacc.c:1646 */ break; case 2058: #line 13911 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_NULLIF, "=", (yyvsp[-3].node), (yyvsp[-1].node), (yylsp[-5])); } #line 44412 "gram.c" /* yacc.c:1646 */ break; case 2059: #line 13915 "gram.y" /* yacc.c:1646 */ { CoalesceExpr *c = makeNode(CoalesceExpr); c->args = (yyvsp[-1].list); c->location = (yylsp[-3]); (yyval.node) = (Node *)c; } #line 44423 "gram.c" /* yacc.c:1646 */ break; case 2060: #line 13922 "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 44435 "gram.c" /* yacc.c:1646 */ break; case 2061: #line 13930 "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 44447 "gram.c" /* yacc.c:1646 */ break; case 2062: #line 13938 "gram.y" /* yacc.c:1646 */ { (yyval.node) = makeXmlExpr(IS_XMLCONCAT, NULL, NIL, (yyvsp[-1].list), (yylsp[-3])); } #line 44455 "gram.c" /* yacc.c:1646 */ break; case 2063: #line 13942 "gram.y" /* yacc.c:1646 */ { (yyval.node) = makeXmlExpr(IS_XMLELEMENT, (yyvsp[-1].str), NIL, NIL, (yylsp[-4])); } #line 44463 "gram.c" /* yacc.c:1646 */ break; case 2064: #line 13946 "gram.y" /* yacc.c:1646 */ { (yyval.node) = makeXmlExpr(IS_XMLELEMENT, (yyvsp[-3].str), (yyvsp[-1].list), NIL, (yylsp[-6])); } #line 44471 "gram.c" /* yacc.c:1646 */ break; case 2065: #line 13950 "gram.y" /* yacc.c:1646 */ { (yyval.node) = makeXmlExpr(IS_XMLELEMENT, (yyvsp[-3].str), NIL, (yyvsp[-1].list), (yylsp[-6])); } #line 44479 "gram.c" /* yacc.c:1646 */ break; case 2066: #line 13954 "gram.y" /* yacc.c:1646 */ { (yyval.node) = makeXmlExpr(IS_XMLELEMENT, (yyvsp[-5].str), (yyvsp[-3].list), (yyvsp[-1].list), (yylsp[-8])); } #line 44487 "gram.c" /* yacc.c:1646 */ break; case 2067: #line 13958 "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 44497 "gram.c" /* yacc.c:1646 */ break; case 2068: #line 13964 "gram.y" /* yacc.c:1646 */ { (yyval.node) = makeXmlExpr(IS_XMLFOREST, NULL, (yyvsp[-1].list), NIL, (yylsp[-3])); } #line 44505 "gram.c" /* yacc.c:1646 */ break; case 2069: #line 13968 "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 44518 "gram.c" /* yacc.c:1646 */ break; case 2070: #line 13977 "gram.y" /* yacc.c:1646 */ { (yyval.node) = makeXmlExpr(IS_XMLPI, (yyvsp[-1].str), NULL, NIL, (yylsp[-4])); } #line 44526 "gram.c" /* yacc.c:1646 */ break; case 2071: #line 13981 "gram.y" /* yacc.c:1646 */ { (yyval.node) = makeXmlExpr(IS_XMLPI, (yyvsp[-3].str), NULL, list_make1((yyvsp[-1].node)), (yylsp[-6])); } #line 44534 "gram.c" /* yacc.c:1646 */ break; case 2072: #line 13985 "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 44543 "gram.c" /* yacc.c:1646 */ break; case 2073: #line 13990 "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 44556 "gram.c" /* yacc.c:1646 */ break; case 2074: #line 14004 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 44562 "gram.c" /* yacc.c:1646 */ break; case 2075: #line 14006 "gram.y" /* yacc.c:1646 */ { (yyval.node) = makeNullAConst(-1); } #line 44568 "gram.c" /* yacc.c:1646 */ break; case 2076: #line 14010 "gram.y" /* yacc.c:1646 */ { (yyval.node) = makeIntConst(XML_STANDALONE_YES, -1); } #line 44574 "gram.c" /* yacc.c:1646 */ break; case 2077: #line 14012 "gram.y" /* yacc.c:1646 */ { (yyval.node) = makeIntConst(XML_STANDALONE_NO, -1); } #line 44580 "gram.c" /* yacc.c:1646 */ break; case 2078: #line 14014 "gram.y" /* yacc.c:1646 */ { (yyval.node) = makeIntConst(XML_STANDALONE_NO_VALUE, -1); } #line 44586 "gram.c" /* yacc.c:1646 */ break; case 2079: #line 14016 "gram.y" /* yacc.c:1646 */ { (yyval.node) = makeIntConst(XML_STANDALONE_OMITTED, -1); } #line 44592 "gram.c" /* yacc.c:1646 */ break; case 2080: #line 14019 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[-1].list); } #line 44598 "gram.c" /* yacc.c:1646 */ break; case 2081: #line 14022 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].target)); } #line 44604 "gram.c" /* yacc.c:1646 */ break; case 2082: #line 14023 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].target)); } #line 44610 "gram.c" /* yacc.c:1646 */ break; case 2083: #line 14027 "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 44622 "gram.c" /* yacc.c:1646 */ break; case 2084: #line 14035 "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 44634 "gram.c" /* yacc.c:1646 */ break; case 2085: #line 14044 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = XMLOPTION_DOCUMENT; } #line 44640 "gram.c" /* yacc.c:1646 */ break; case 2086: #line 14045 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = XMLOPTION_CONTENT; } #line 44646 "gram.c" /* yacc.c:1646 */ break; case 2087: #line 14048 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = true; } #line 44652 "gram.c" /* yacc.c:1646 */ break; case 2088: #line 14049 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = false; } #line 44658 "gram.c" /* yacc.c:1646 */ break; case 2089: #line 14050 "gram.y" /* yacc.c:1646 */ { (yyval.boolean) = false; } #line 44664 "gram.c" /* yacc.c:1646 */ break; case 2090: #line 14056 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 44672 "gram.c" /* yacc.c:1646 */ break; case 2091: #line 14060 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[-1].node); } #line 44680 "gram.c" /* yacc.c:1646 */ break; case 2092: #line 14064 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 44688 "gram.c" /* yacc.c:1646 */ break; case 2093: #line 14068 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[-1].node); } #line 44696 "gram.c" /* yacc.c:1646 */ break; case 2096: #line 14083 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[-1].list); } #line 44702 "gram.c" /* yacc.c:1646 */ break; case 2097: #line 14084 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 44708 "gram.c" /* yacc.c:1646 */ break; case 2098: #line 14088 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[-1].node); } #line 44714 "gram.c" /* yacc.c:1646 */ break; case 2099: #line 14089 "gram.y" /* yacc.c:1646 */ { (yyval.node) = NULL; } #line 44720 "gram.c" /* yacc.c:1646 */ break; case 2100: #line 14097 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 44726 "gram.c" /* yacc.c:1646 */ break; case 2101: #line 14098 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 44732 "gram.c" /* yacc.c:1646 */ break; case 2102: #line 14102 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].windef)); } #line 44738 "gram.c" /* yacc.c:1646 */ break; case 2103: #line 14104 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].windef)); } #line 44744 "gram.c" /* yacc.c:1646 */ break; case 2104: #line 14109 "gram.y" /* yacc.c:1646 */ { WindowDef *n = (yyvsp[0].windef); n->name = (yyvsp[-2].str); (yyval.windef) = n; } #line 44754 "gram.c" /* yacc.c:1646 */ break; case 2105: #line 14117 "gram.y" /* yacc.c:1646 */ { (yyval.windef) = (yyvsp[0].windef); } #line 44760 "gram.c" /* yacc.c:1646 */ break; case 2106: #line 14119 "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 44777 "gram.c" /* yacc.c:1646 */ break; case 2107: #line 14132 "gram.y" /* yacc.c:1646 */ { (yyval.windef) = NULL; } #line 44783 "gram.c" /* yacc.c:1646 */ break; case 2108: #line 14137 "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 44801 "gram.c" /* yacc.c:1646 */ break; case 2109: #line 14162 "gram.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 44807 "gram.c" /* yacc.c:1646 */ break; case 2110: #line 14163 "gram.y" /* yacc.c:1646 */ { (yyval.str) = NULL; } #line 44813 "gram.c" /* yacc.c:1646 */ break; case 2111: #line 14166 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 44819 "gram.c" /* yacc.c:1646 */ break; case 2112: #line 14167 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 44825 "gram.c" /* yacc.c:1646 */ break; case 2113: #line 14176 "gram.y" /* yacc.c:1646 */ { WindowDef *n = (yyvsp[-1].windef); n->frameOptions |= FRAMEOPTION_NONDEFAULT | FRAMEOPTION_RANGE; n->frameOptions |= (yyvsp[0].ival); (yyval.windef) = n; } #line 44836 "gram.c" /* yacc.c:1646 */ break; case 2114: #line 14183 "gram.y" /* yacc.c:1646 */ { WindowDef *n = (yyvsp[-1].windef); n->frameOptions |= FRAMEOPTION_NONDEFAULT | FRAMEOPTION_ROWS; n->frameOptions |= (yyvsp[0].ival); (yyval.windef) = n; } #line 44847 "gram.c" /* yacc.c:1646 */ break; case 2115: #line 14190 "gram.y" /* yacc.c:1646 */ { WindowDef *n = (yyvsp[-1].windef); n->frameOptions |= FRAMEOPTION_NONDEFAULT | FRAMEOPTION_GROUPS; n->frameOptions |= (yyvsp[0].ival); (yyval.windef) = n; } #line 44858 "gram.c" /* yacc.c:1646 */ break; case 2116: #line 14197 "gram.y" /* yacc.c:1646 */ { WindowDef *n = makeNode(WindowDef); n->frameOptions = FRAMEOPTION_DEFAULTS; n->startOffset = NULL; n->endOffset = NULL; (yyval.windef) = n; } #line 44870 "gram.c" /* yacc.c:1646 */ break; case 2117: #line 14207 "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_OFFSET_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 44891 "gram.c" /* yacc.c:1646 */ break; case 2118: #line 14224 "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_OFFSET_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_OFFSET_FOLLOWING) && (frameOptions & (FRAMEOPTION_END_OFFSET_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 44932 "gram.c" /* yacc.c:1646 */ break; case 2119: #line 14269 "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 44944 "gram.c" /* yacc.c:1646 */ break; case 2120: #line 14277 "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 44956 "gram.c" /* yacc.c:1646 */ break; case 2121: #line 14285 "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 44968 "gram.c" /* yacc.c:1646 */ break; case 2122: #line 14293 "gram.y" /* yacc.c:1646 */ { WindowDef *n = makeNode(WindowDef); n->frameOptions = FRAMEOPTION_START_OFFSET_PRECEDING; n->startOffset = (yyvsp[-1].node); n->endOffset = NULL; (yyval.windef) = n; } #line 44980 "gram.c" /* yacc.c:1646 */ break; case 2123: #line 14301 "gram.y" /* yacc.c:1646 */ { WindowDef *n = makeNode(WindowDef); n->frameOptions = FRAMEOPTION_START_OFFSET_FOLLOWING; n->startOffset = (yyvsp[-1].node); n->endOffset = NULL; (yyval.windef) = n; } #line 44992 "gram.c" /* yacc.c:1646 */ break; case 2124: #line 14311 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = FRAMEOPTION_EXCLUDE_CURRENT_ROW; } #line 44998 "gram.c" /* yacc.c:1646 */ break; case 2125: #line 14312 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = FRAMEOPTION_EXCLUDE_GROUP; } #line 45004 "gram.c" /* yacc.c:1646 */ break; case 2126: #line 14313 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = FRAMEOPTION_EXCLUDE_TIES; } #line 45010 "gram.c" /* yacc.c:1646 */ break; case 2127: #line 14314 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = 0; } #line 45016 "gram.c" /* yacc.c:1646 */ break; case 2128: #line 14315 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = 0; } #line 45022 "gram.c" /* yacc.c:1646 */ break; case 2129: #line 14329 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[-1].list); } #line 45028 "gram.c" /* yacc.c:1646 */ break; case 2130: #line 14330 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 45034 "gram.c" /* yacc.c:1646 */ break; case 2131: #line 14331 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-3].list), (yyvsp[-1].node)); } #line 45040 "gram.c" /* yacc.c:1646 */ break; case 2132: #line 14334 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[-1].list); } #line 45046 "gram.c" /* yacc.c:1646 */ break; case 2133: #line 14335 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 45052 "gram.c" /* yacc.c:1646 */ break; case 2134: #line 14338 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-3].list), (yyvsp[-1].node)); } #line 45058 "gram.c" /* yacc.c:1646 */ break; case 2135: #line 14341 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = ANY_SUBLINK; } #line 45064 "gram.c" /* yacc.c:1646 */ break; case 2136: #line 14342 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = ANY_SUBLINK; } #line 45070 "gram.c" /* yacc.c:1646 */ break; case 2137: #line 14343 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = ALL_SUBLINK; } #line 45076 "gram.c" /* yacc.c:1646 */ break; case 2138: #line 14346 "gram.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 45082 "gram.c" /* yacc.c:1646 */ break; case 2139: #line 14347 "gram.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 45088 "gram.c" /* yacc.c:1646 */ break; case 2140: #line 14350 "gram.y" /* yacc.c:1646 */ { (yyval.str) = "+"; } #line 45094 "gram.c" /* yacc.c:1646 */ break; case 2141: #line 14351 "gram.y" /* yacc.c:1646 */ { (yyval.str) = "-"; } #line 45100 "gram.c" /* yacc.c:1646 */ break; case 2142: #line 14352 "gram.y" /* yacc.c:1646 */ { (yyval.str) = "*"; } #line 45106 "gram.c" /* yacc.c:1646 */ break; case 2143: #line 14353 "gram.y" /* yacc.c:1646 */ { (yyval.str) = "/"; } #line 45112 "gram.c" /* yacc.c:1646 */ break; case 2144: #line 14354 "gram.y" /* yacc.c:1646 */ { (yyval.str) = "%"; } #line 45118 "gram.c" /* yacc.c:1646 */ break; case 2145: #line 14355 "gram.y" /* yacc.c:1646 */ { (yyval.str) = "^"; } #line 45124 "gram.c" /* yacc.c:1646 */ break; case 2146: #line 14356 "gram.y" /* yacc.c:1646 */ { (yyval.str) = "<"; } #line 45130 "gram.c" /* yacc.c:1646 */ break; case 2147: #line 14357 "gram.y" /* yacc.c:1646 */ { (yyval.str) = ">"; } #line 45136 "gram.c" /* yacc.c:1646 */ break; case 2148: #line 14358 "gram.y" /* yacc.c:1646 */ { (yyval.str) = "="; } #line 45142 "gram.c" /* yacc.c:1646 */ break; case 2149: #line 14359 "gram.y" /* yacc.c:1646 */ { (yyval.str) = "<="; } #line 45148 "gram.c" /* yacc.c:1646 */ break; case 2150: #line 14360 "gram.y" /* yacc.c:1646 */ { (yyval.str) = ">="; } #line 45154 "gram.c" /* yacc.c:1646 */ break; case 2151: #line 14361 "gram.y" /* yacc.c:1646 */ { (yyval.str) = "<>"; } #line 45160 "gram.c" /* yacc.c:1646 */ break; case 2152: #line 14365 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1(makeString((yyvsp[0].str))); } #line 45166 "gram.c" /* yacc.c:1646 */ break; case 2153: #line 14367 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[-1].list); } #line 45172 "gram.c" /* yacc.c:1646 */ break; case 2154: #line 14372 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1(makeString((yyvsp[0].str))); } #line 45178 "gram.c" /* yacc.c:1646 */ break; case 2155: #line 14374 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[-1].list); } #line 45184 "gram.c" /* yacc.c:1646 */ break; case 2156: #line 14379 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1(makeString((yyvsp[0].str))); } #line 45190 "gram.c" /* yacc.c:1646 */ break; case 2157: #line 14381 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[-1].list); } #line 45196 "gram.c" /* yacc.c:1646 */ break; case 2158: #line 14383 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1(makeString("~~")); } #line 45202 "gram.c" /* yacc.c:1646 */ break; case 2159: #line 14385 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1(makeString("!~~")); } #line 45208 "gram.c" /* yacc.c:1646 */ break; case 2160: #line 14387 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1(makeString("~~*")); } #line 45214 "gram.c" /* yacc.c:1646 */ break; case 2161: #line 14389 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1(makeString("!~~*")); } #line 45220 "gram.c" /* yacc.c:1646 */ break; case 2162: #line 14401 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].node)); } #line 45228 "gram.c" /* yacc.c:1646 */ break; case 2163: #line 14405 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].node)); } #line 45236 "gram.c" /* yacc.c:1646 */ break; case 2164: #line 14412 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].node)); } #line 45244 "gram.c" /* yacc.c:1646 */ break; case 2165: #line 14416 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].node)); } #line 45252 "gram.c" /* yacc.c:1646 */ break; case 2166: #line 14422 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 45260 "gram.c" /* yacc.c:1646 */ break; case 2167: #line 14426 "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 45273 "gram.c" /* yacc.c:1646 */ break; case 2168: #line 14435 "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 45286 "gram.c" /* yacc.c:1646 */ break; case 2169: #line 14445 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].typnam)); } #line 45292 "gram.c" /* yacc.c:1646 */ break; case 2170: #line 14446 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].typnam)); } #line 45298 "gram.c" /* yacc.c:1646 */ break; case 2171: #line 14450 "gram.y" /* yacc.c:1646 */ { (yyval.node) = makeAArrayExpr((yyvsp[-1].list), (yylsp[-2])); } #line 45306 "gram.c" /* yacc.c:1646 */ break; case 2172: #line 14454 "gram.y" /* yacc.c:1646 */ { (yyval.node) = makeAArrayExpr((yyvsp[-1].list), (yylsp[-2])); } #line 45314 "gram.c" /* yacc.c:1646 */ break; case 2173: #line 14458 "gram.y" /* yacc.c:1646 */ { (yyval.node) = makeAArrayExpr(NIL, (yylsp[-1])); } #line 45322 "gram.c" /* yacc.c:1646 */ break; case 2174: #line 14463 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].node)); } #line 45328 "gram.c" /* yacc.c:1646 */ break; case 2175: #line 14464 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].node)); } #line 45334 "gram.c" /* yacc.c:1646 */ break; case 2176: #line 14470 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make2(makeStringConst((yyvsp[-2].str), (yylsp[-2])), (yyvsp[0].node)); } #line 45342 "gram.c" /* yacc.c:1646 */ break; case 2177: #line 14473 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 45348 "gram.c" /* yacc.c:1646 */ break; case 2178: #line 14480 "gram.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 45354 "gram.c" /* yacc.c:1646 */ break; case 2179: #line 14481 "gram.y" /* yacc.c:1646 */ { (yyval.str) = "year"; } #line 45360 "gram.c" /* yacc.c:1646 */ break; case 2180: #line 14482 "gram.y" /* yacc.c:1646 */ { (yyval.str) = "month"; } #line 45366 "gram.c" /* yacc.c:1646 */ break; case 2181: #line 14483 "gram.y" /* yacc.c:1646 */ { (yyval.str) = "day"; } #line 45372 "gram.c" /* yacc.c:1646 */ break; case 2182: #line 14484 "gram.y" /* yacc.c:1646 */ { (yyval.str) = "hour"; } #line 45378 "gram.c" /* yacc.c:1646 */ break; case 2183: #line 14485 "gram.y" /* yacc.c:1646 */ { (yyval.str) = "minute"; } #line 45384 "gram.c" /* yacc.c:1646 */ break; case 2184: #line 14486 "gram.y" /* yacc.c:1646 */ { (yyval.str) = "second"; } #line 45390 "gram.c" /* yacc.c:1646 */ break; case 2185: #line 14487 "gram.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 45396 "gram.c" /* yacc.c:1646 */ break; case 2186: #line 14498 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make4((yyvsp[-3].node), (yyvsp[-2].node), (yyvsp[-1].node), (yyvsp[0].node)); } #line 45404 "gram.c" /* yacc.c:1646 */ break; case 2187: #line 14502 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make3((yyvsp[-2].node), (yyvsp[-1].node), (yyvsp[0].node)); } #line 45412 "gram.c" /* yacc.c:1646 */ break; case 2188: #line 14509 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 45418 "gram.c" /* yacc.c:1646 */ break; case 2189: #line 14515 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make2((yyvsp[0].node), (yyvsp[-2].node)); } #line 45424 "gram.c" /* yacc.c:1646 */ break; case 2190: #line 14516 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 45430 "gram.c" /* yacc.c:1646 */ break; case 2191: #line 14533 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make3((yyvsp[-2].node), (yyvsp[-1].node), (yyvsp[0].node)); } #line 45438 "gram.c" /* yacc.c:1646 */ break; case 2192: #line 14537 "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 45447 "gram.c" /* yacc.c:1646 */ break; case 2193: #line 14542 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make2((yyvsp[-1].node), (yyvsp[0].node)); } #line 45455 "gram.c" /* yacc.c:1646 */ break; case 2194: #line 14546 "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 45474 "gram.c" /* yacc.c:1646 */ break; case 2195: #line 14561 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 45482 "gram.c" /* yacc.c:1646 */ break; case 2196: #line 14565 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 45488 "gram.c" /* yacc.c:1646 */ break; case 2197: #line 14569 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 45494 "gram.c" /* yacc.c:1646 */ break; case 2198: #line 14572 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 45500 "gram.c" /* yacc.c:1646 */ break; case 2199: #line 14575 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[0].list), (yyvsp[-2].node)); } #line 45506 "gram.c" /* yacc.c:1646 */ break; case 2200: #line 14576 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 45512 "gram.c" /* yacc.c:1646 */ break; case 2201: #line 14577 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 45518 "gram.c" /* yacc.c:1646 */ break; case 2202: #line 14581 "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 45529 "gram.c" /* yacc.c:1646 */ break; case 2203: #line 14587 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *)(yyvsp[-1].list); } #line 45535 "gram.c" /* yacc.c:1646 */ break; case 2204: #line 14598 "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 45549 "gram.c" /* yacc.c:1646 */ break; case 2205: #line 14611 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].node)); } #line 45555 "gram.c" /* yacc.c:1646 */ break; case 2206: #line 14612 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-1].list), (yyvsp[0].node)); } #line 45561 "gram.c" /* yacc.c:1646 */ break; case 2207: #line 14617 "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 45573 "gram.c" /* yacc.c:1646 */ break; case 2208: #line 14627 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 45579 "gram.c" /* yacc.c:1646 */ break; case 2209: #line 14628 "gram.y" /* yacc.c:1646 */ { (yyval.node) = NULL; } #line 45585 "gram.c" /* yacc.c:1646 */ break; case 2210: #line 14631 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 45591 "gram.c" /* yacc.c:1646 */ break; case 2211: #line 14632 "gram.y" /* yacc.c:1646 */ { (yyval.node) = NULL; } #line 45597 "gram.c" /* yacc.c:1646 */ break; case 2212: #line 14636 "gram.y" /* yacc.c:1646 */ { (yyval.node) = makeColumnRef((yyvsp[0].str), NIL, (yylsp[0]), yyscanner); } #line 45605 "gram.c" /* yacc.c:1646 */ break; case 2213: #line 14640 "gram.y" /* yacc.c:1646 */ { (yyval.node) = makeColumnRef((yyvsp[-1].str), (yyvsp[0].list), (yylsp[-1]), yyscanner); } #line 45613 "gram.c" /* yacc.c:1646 */ break; case 2214: #line 14647 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeString((yyvsp[0].str)); } #line 45621 "gram.c" /* yacc.c:1646 */ break; case 2215: #line 14651 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeNode(A_Star); } #line 45629 "gram.c" /* yacc.c:1646 */ break; case 2216: #line 14655 "gram.y" /* yacc.c:1646 */ { A_Indices *ai = makeNode(A_Indices); ai->is_slice = false; ai->lidx = NULL; ai->uidx = (yyvsp[-1].node); (yyval.node) = (Node *) ai; } #line 45641 "gram.c" /* yacc.c:1646 */ break; case 2217: #line 14663 "gram.y" /* yacc.c:1646 */ { A_Indices *ai = makeNode(A_Indices); ai->is_slice = true; ai->lidx = (yyvsp[-3].node); ai->uidx = (yyvsp[-1].node); (yyval.node) = (Node *) ai; } #line 45653 "gram.c" /* yacc.c:1646 */ break; case 2218: #line 14673 "gram.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 45659 "gram.c" /* yacc.c:1646 */ break; case 2219: #line 14674 "gram.y" /* yacc.c:1646 */ { (yyval.node) = NULL; } #line 45665 "gram.c" /* yacc.c:1646 */ break; case 2220: #line 14678 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].node)); } #line 45671 "gram.c" /* yacc.c:1646 */ break; case 2221: #line 14679 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-1].list), (yyvsp[0].node)); } #line 45677 "gram.c" /* yacc.c:1646 */ break; case 2222: #line 14683 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 45683 "gram.c" /* yacc.c:1646 */ break; case 2223: #line 14684 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-1].list), (yyvsp[0].node)); } #line 45689 "gram.c" /* yacc.c:1646 */ break; case 2226: #line 14698 "gram.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 45695 "gram.c" /* yacc.c:1646 */ break; case 2227: #line 14699 "gram.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 45701 "gram.c" /* yacc.c:1646 */ break; case 2228: #line 14703 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].target)); } #line 45707 "gram.c" /* yacc.c:1646 */ break; case 2229: #line 14704 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].target)); } #line 45713 "gram.c" /* yacc.c:1646 */ break; case 2230: #line 14708 "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 45725 "gram.c" /* yacc.c:1646 */ break; case 2231: #line 14724 "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 45737 "gram.c" /* yacc.c:1646 */ break; case 2232: #line 14732 "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 45749 "gram.c" /* yacc.c:1646 */ break; case 2233: #line 14740 "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 45765 "gram.c" /* yacc.c:1646 */ break; case 2234: #line 14761 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].range)); } #line 45771 "gram.c" /* yacc.c:1646 */ break; case 2235: #line 14762 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].range)); } #line 45777 "gram.c" /* yacc.c:1646 */ break; case 2236: #line 14774 "gram.y" /* yacc.c:1646 */ { (yyval.range) = makeRangeVar(NULL, (yyvsp[0].str), (yylsp[0])); } #line 45785 "gram.c" /* yacc.c:1646 */ break; case 2237: #line 14778 "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 45814 "gram.c" /* yacc.c:1646 */ break; case 2238: #line 14805 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1(makeString((yyvsp[0].str))); } #line 45820 "gram.c" /* yacc.c:1646 */ break; case 2239: #line 14807 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), makeString((yyvsp[0].str))); } #line 45826 "gram.c" /* yacc.c:1646 */ break; case 2240: #line 14811 "gram.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 45832 "gram.c" /* yacc.c:1646 */ break; case 2241: #line 14814 "gram.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 45838 "gram.c" /* yacc.c:1646 */ break; case 2242: #line 14817 "gram.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 45844 "gram.c" /* yacc.c:1646 */ break; case 2243: #line 14819 "gram.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 45850 "gram.c" /* yacc.c:1646 */ break; case 2244: #line 14821 "gram.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 45856 "gram.c" /* yacc.c:1646 */ break; case 2245: #line 14823 "gram.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 45862 "gram.c" /* yacc.c:1646 */ break; case 2246: #line 14834 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1(makeString((yyvsp[0].str))); } #line 45868 "gram.c" /* yacc.c:1646 */ break; case 2247: #line 14836 "gram.y" /* yacc.c:1646 */ { (yyval.list) = check_func_name(lcons(makeString((yyvsp[-1].str)), (yyvsp[0].list)), yyscanner); } #line 45877 "gram.c" /* yacc.c:1646 */ break; case 2248: #line 14847 "gram.y" /* yacc.c:1646 */ { (yyval.node) = makeIntConst((yyvsp[0].ival), (yylsp[0])); } #line 45885 "gram.c" /* yacc.c:1646 */ break; case 2249: #line 14851 "gram.y" /* yacc.c:1646 */ { (yyval.node) = makeFloatConst((yyvsp[0].str), (yylsp[0])); } #line 45893 "gram.c" /* yacc.c:1646 */ break; case 2250: #line 14855 "gram.y" /* yacc.c:1646 */ { (yyval.node) = makeStringConst((yyvsp[0].str), (yylsp[0])); } #line 45901 "gram.c" /* yacc.c:1646 */ break; case 2251: #line 14859 "gram.y" /* yacc.c:1646 */ { (yyval.node) = makeBitStringConst((yyvsp[0].str), (yylsp[0])); } #line 45909 "gram.c" /* yacc.c:1646 */ break; case 2252: #line 14863 "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 45922 "gram.c" /* yacc.c:1646 */ break; case 2253: #line 14872 "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 45933 "gram.c" /* yacc.c:1646 */ break; case 2254: #line 14879 "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 45969 "gram.c" /* yacc.c:1646 */ break; case 2255: #line 14911 "gram.y" /* yacc.c:1646 */ { (yyval.node) = makeStringConstCast((yyvsp[0].str), (yylsp[0]), (yyvsp[-1].typnam)); } #line 45977 "gram.c" /* yacc.c:1646 */ break; case 2256: #line 14915 "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 45987 "gram.c" /* yacc.c:1646 */ break; case 2257: #line 14921 "gram.y" /* yacc.c:1646 */ { TypeName *t = (yyvsp[-4].typnam); t->typmods = list_make2(makeIntConst(INTERVAL_FULL_RANGE, -1), makeIntConst((yyvsp[-2].ival), (yylsp[-2]))); (yyval.node) = makeStringConstCast((yyvsp[0].str), (yylsp[0]), t); } #line 45998 "gram.c" /* yacc.c:1646 */ break; case 2258: #line 14928 "gram.y" /* yacc.c:1646 */ { (yyval.node) = makeBoolAConst(true, (yylsp[0])); } #line 46006 "gram.c" /* yacc.c:1646 */ break; case 2259: #line 14932 "gram.y" /* yacc.c:1646 */ { (yyval.node) = makeBoolAConst(false, (yylsp[0])); } #line 46014 "gram.c" /* yacc.c:1646 */ break; case 2260: #line 14936 "gram.y" /* yacc.c:1646 */ { (yyval.node) = makeNullAConst((yylsp[0])); } #line 46022 "gram.c" /* yacc.c:1646 */ break; case 2261: #line 14941 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = (yyvsp[0].ival); } #line 46028 "gram.c" /* yacc.c:1646 */ break; case 2262: #line 14942 "gram.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 46034 "gram.c" /* yacc.c:1646 */ break; case 2263: #line 14944 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = (yyvsp[0].ival); } #line 46040 "gram.c" /* yacc.c:1646 */ break; case 2264: #line 14945 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = + (yyvsp[0].ival); } #line 46046 "gram.c" /* yacc.c:1646 */ break; case 2265: #line 14946 "gram.y" /* yacc.c:1646 */ { (yyval.ival) = - (yyvsp[0].ival); } #line 46052 "gram.c" /* yacc.c:1646 */ break; case 2266: #line 14951 "gram.y" /* yacc.c:1646 */ { RoleSpec *spc = (RoleSpec *) (yyvsp[0].rolespec); switch (spc->roletype) { case ROLESPEC_CSTRING: (yyval.str) = spc->rolename; break; case ROLESPEC_PUBLIC: ereport(ERROR, (errcode(ERRCODE_RESERVED_NAME), errmsg("role name \"%s\" is reserved", "public"), parser_errposition((yylsp[0])))); break; case ROLESPEC_SESSION_USER: ereport(ERROR, (errcode(ERRCODE_RESERVED_NAME), errmsg("%s cannot be used as a role name here", "SESSION_USER"), parser_errposition((yylsp[0])))); break; case ROLESPEC_CURRENT_USER: ereport(ERROR, (errcode(ERRCODE_RESERVED_NAME), errmsg("%s cannot be used as a role name here", "CURRENT_USER"), parser_errposition((yylsp[0])))); break; } } #line 46087 "gram.c" /* yacc.c:1646 */ break; case 2267: #line 14984 "gram.y" /* yacc.c:1646 */ { /* * "public" and "none" are not keywords, but they must * be treated specially here. */ RoleSpec *n; if (strcmp((yyvsp[0].str), "public") == 0) { n = (RoleSpec *) makeRoleSpec(ROLESPEC_PUBLIC, (yylsp[0])); n->roletype = ROLESPEC_PUBLIC; } else if (strcmp((yyvsp[0].str), "none") == 0) { ereport(ERROR, (errcode(ERRCODE_RESERVED_NAME), errmsg("role name \"%s\" is reserved", "none"), parser_errposition((yylsp[0])))); } else { n = makeRoleSpec(ROLESPEC_CSTRING, (yylsp[0])); n->rolename = pstrdup((yyvsp[0].str)); } (yyval.rolespec) = n; } #line 46118 "gram.c" /* yacc.c:1646 */ break; case 2268: #line 15011 "gram.y" /* yacc.c:1646 */ { (yyval.rolespec) = makeRoleSpec(ROLESPEC_CURRENT_USER, (yylsp[0])); } #line 46126 "gram.c" /* yacc.c:1646 */ break; case 2269: #line 15015 "gram.y" /* yacc.c:1646 */ { (yyval.rolespec) = makeRoleSpec(ROLESPEC_SESSION_USER, (yylsp[0])); } #line 46134 "gram.c" /* yacc.c:1646 */ break; case 2270: #line 15021 "gram.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].rolespec)); } #line 46140 "gram.c" /* yacc.c:1646 */ break; case 2271: #line 15023 "gram.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].rolespec)); } #line 46146 "gram.c" /* yacc.c:1646 */ break; case 2272: #line 15039 "gram.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 46152 "gram.c" /* yacc.c:1646 */ break; case 2273: #line 15040 "gram.y" /* yacc.c:1646 */ { (yyval.str) = pstrdup((yyvsp[0].keyword)); } #line 46158 "gram.c" /* yacc.c:1646 */ break; case 2274: #line 15041 "gram.y" /* yacc.c:1646 */ { (yyval.str) = pstrdup((yyvsp[0].keyword)); } #line 46164 "gram.c" /* yacc.c:1646 */ break; case 2275: #line 15046 "gram.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 46170 "gram.c" /* yacc.c:1646 */ break; case 2276: #line 15047 "gram.y" /* yacc.c:1646 */ { (yyval.str) = pstrdup((yyvsp[0].keyword)); } #line 46176 "gram.c" /* yacc.c:1646 */ break; case 2277: #line 15048 "gram.y" /* yacc.c:1646 */ { (yyval.str) = pstrdup((yyvsp[0].keyword)); } #line 46182 "gram.c" /* yacc.c:1646 */ break; case 2278: #line 15053 "gram.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 46188 "gram.c" /* yacc.c:1646 */ break; case 2279: #line 15054 "gram.y" /* yacc.c:1646 */ { (yyval.str) = pstrdup((yyvsp[0].keyword)); } #line 46194 "gram.c" /* yacc.c:1646 */ break; case 2280: #line 15055 "gram.y" /* yacc.c:1646 */ { (yyval.str) = pstrdup((yyvsp[0].keyword)); } #line 46200 "gram.c" /* yacc.c:1646 */ break; case 2281: #line 15056 "gram.y" /* yacc.c:1646 */ { (yyval.str) = pstrdup((yyvsp[0].keyword)); } #line 46206 "gram.c" /* yacc.c:1646 */ break; case 2282: #line 15062 "gram.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 46212 "gram.c" /* yacc.c:1646 */ break; case 2283: #line 15063 "gram.y" /* yacc.c:1646 */ { (yyval.str) = pstrdup((yyvsp[0].keyword)); } #line 46218 "gram.c" /* yacc.c:1646 */ break; case 2284: #line 15064 "gram.y" /* yacc.c:1646 */ { (yyval.str) = pstrdup((yyvsp[0].keyword)); } #line 46224 "gram.c" /* yacc.c:1646 */ break; case 2285: #line 15065 "gram.y" /* yacc.c:1646 */ { (yyval.str) = pstrdup((yyvsp[0].keyword)); } #line 46230 "gram.c" /* yacc.c:1646 */ break; case 2286: #line 15066 "gram.y" /* yacc.c:1646 */ { (yyval.str) = pstrdup((yyvsp[0].keyword)); } #line 46236 "gram.c" /* yacc.c:1646 */ break; #line 46240 "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 15565 "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 RawStmt * makeRawStmt(Node *stmt, int stmt_location) { RawStmt *rs = makeNode(RawStmt); rs->stmt = stmt; rs->stmt_location = stmt_location; rs->stmt_len = 0; /* might get changed later */ return rs; } /* Adjust a RawStmt to reflect that it doesn't run to the end of the string */ static void updateRawStmtEnd(RawStmt *rs, int end_location) { /* * If we already set the length, don't change it. This is for situations * like "select foo ;; select bar" where the same statement will be last * in the string for more than one semicolon. */ if (rs->stmt_len > 0) return; /* OK, update length of RawStmt */ rs->stmt_len = end_location - rs->stmt_location; } 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; } 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; } Node * makeStringConstCast(char *str, int location, TypeName *typename) { Node *s = makeStringConst(str, location); return makeTypeCast(s, typename, -1); } 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); } /* makeRoleSpec * Create a RoleSpec with the given type */ static RoleSpec * makeRoleSpec(RoleSpecType type, int location) { RoleSpec *spec = makeNode(RoleSpec); spec->roletype = type; spec->location = location; return spec; } /* 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 * makeAndExpr(Node *lexpr, Node *rexpr, int location) { Node *lexp = lexpr; /* Look through AEXPR_PAREN nodes so they don't affect flattening */ while (IsA(lexp, A_Expr) && ((A_Expr *) lexp)->kind == AEXPR_PAREN) lexp = ((A_Expr *) lexp)->lexpr; /* Flatten "a AND b AND c ..." to a single BoolExpr on sight */ if (IsA(lexp, BoolExpr)) { BoolExpr *blexpr = (BoolExpr *) lexp; if (blexpr->boolop == AND_EXPR) { blexpr->args = lappend(blexpr->args, rexpr); return (Node *) blexpr; } } return (Node *) makeBoolExpr(AND_EXPR, list_make2(lexpr, rexpr), location); } static Node * makeOrExpr(Node *lexpr, Node *rexpr, int location) { Node *lexp = lexpr; /* Look through AEXPR_PAREN nodes so they don't affect flattening */ while (IsA(lexp, A_Expr) && ((A_Expr *) lexp)->kind == AEXPR_PAREN) lexp = ((A_Expr *) lexp)->lexpr; /* Flatten "a OR b OR c ..." to a single BoolExpr on sight */ if (IsA(lexp, BoolExpr)) { BoolExpr *blexpr = (BoolExpr *) lexp; if (blexpr->boolop == OR_EXPR) { blexpr->args = lappend(blexpr->args, rexpr); return (Node *) blexpr; } } return (Node *) makeBoolExpr(OR_EXPR, list_make2(lexpr, rexpr), location); } static Node * makeNotExpr(Node *expr, int location) { return (Node *) makeBoolExpr(NOT_EXPR, list_make1(expr), location); } static Node * makeAArrayExpr(List *elements, int location) { A_ArrayExpr *n = makeNode(A_ArrayExpr); n->elements = elements; n->location = location; return (Node *) n; } static Node * makeSQLValueFunction(SQLValueFunctionOp op, int32 typmod, int location) { SQLValueFunction *svf = makeNode(SQLValueFunction); svf->op = op; /* svf->type will be filled during parse analysis */ svf->typmod = typmod; svf->location = location; return (Node *) svf; } 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 = 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->ctematerialized = CTEMaterializeDefault; 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 */ } pgpool-II-4.1.4/src/parser/gram_minimal.h0000664000175000017500000005173213730350127015143 00000000000000/* A Bison parser, made by GNU Bison 3.0.4. */ /* Bison interface for Yacc-like parsers in C Copyright (C) 1984, 1989-1990, 2000-2015 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_MINIMAL_BASE_YY_GRAM_MINIMAL_H_INCLUDED # define YY_MINIMAL_BASE_YY_GRAM_MINIMAL_H_INCLUDED /* Debug traces. */ #ifndef YYDEBUG # define YYDEBUG 0 #endif #if YYDEBUG extern int minimal_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, EQUALS_GREATER = 269, LESS_EQUALS = 270, GREATER_EQUALS = 271, NOT_EQUALS = 272, ABORT_P = 273, ABSOLUTE_P = 274, ACCESS = 275, ACTION = 276, ADD_P = 277, ADMIN = 278, AFTER = 279, AGGREGATE = 280, ALL = 281, ALSO = 282, ALTER = 283, ALWAYS = 284, ANALYSE = 285, ANALYZE = 286, AND = 287, ANY = 288, ARRAY = 289, AS = 290, ASC = 291, ASSERTION = 292, ASSIGNMENT = 293, ASYMMETRIC = 294, AT = 295, ATTACH = 296, ATTRIBUTE = 297, AUTHORIZATION = 298, BACKWARD = 299, BEFORE = 300, BEGIN_P = 301, BETWEEN = 302, BIGINT = 303, BINARY = 304, BIT = 305, BOOLEAN_P = 306, BOTH = 307, BY = 308, CACHE = 309, CALL = 310, CALLED = 311, CASCADE = 312, CASCADED = 313, CASE = 314, CAST = 315, CATALOG_P = 316, CHAIN = 317, CHAR_P = 318, CHARACTER = 319, CHARACTERISTICS = 320, CHECK = 321, CHECKPOINT = 322, CLASS = 323, CLOSE = 324, CLUSTER = 325, COALESCE = 326, COLLATE = 327, COLLATION = 328, COLUMN = 329, COLUMNS = 330, COMMENT = 331, COMMENTS = 332, COMMIT = 333, COMMITTED = 334, CONCURRENTLY = 335, CONFIGURATION = 336, CONFLICT = 337, CONNECTION = 338, CONSTRAINT = 339, CONSTRAINTS = 340, CONTENT_P = 341, CONTINUE_P = 342, CONVERSION_P = 343, COPY = 344, COST = 345, CREATE = 346, CROSS = 347, CSV = 348, CUBE = 349, CURRENT_P = 350, CURRENT_CATALOG = 351, CURRENT_DATE = 352, CURRENT_ROLE = 353, CURRENT_SCHEMA = 354, CURRENT_TIME = 355, CURRENT_TIMESTAMP = 356, CURRENT_USER = 357, CURSOR = 358, CYCLE = 359, DATA_P = 360, DATABASE = 361, DAY_P = 362, DEALLOCATE = 363, DEC = 364, DECIMAL_P = 365, DECLARE = 366, DEFAULT = 367, DEFAULTS = 368, DEFERRABLE = 369, DEFERRED = 370, DEFINER = 371, DELETE_P = 372, DELIMITER = 373, DELIMITERS = 374, DEPENDS = 375, DESC = 376, DETACH = 377, DICTIONARY = 378, DISABLE_P = 379, DISCARD = 380, DISTINCT = 381, DO = 382, DOCUMENT_P = 383, DOMAIN_P = 384, DOUBLE_P = 385, DROP = 386, EACH = 387, ELSE = 388, ENABLE_P = 389, ENCODING = 390, ENCRYPTED = 391, END_P = 392, ENUM_P = 393, ESCAPE = 394, EVENT = 395, EXCEPT = 396, EXCLUDE = 397, EXCLUDING = 398, EXCLUSIVE = 399, EXECUTE = 400, EXISTS = 401, EXPLAIN = 402, EXTENSION = 403, EXTERNAL = 404, EXTRACT = 405, FALSE_P = 406, FAMILY = 407, FETCH = 408, FILTER = 409, FIRST_P = 410, FLOAT_P = 411, FOLLOWING = 412, FOR = 413, FORCE = 414, FOREIGN = 415, FORWARD = 416, FREEZE = 417, FROM = 418, FULL = 419, FUNCTION = 420, FUNCTIONS = 421, GENERATED = 422, GLOBAL = 423, GRANT = 424, GRANTED = 425, GREATEST = 426, GROUP_P = 427, GROUPING = 428, GROUPS = 429, HANDLER = 430, HAVING = 431, HEADER_P = 432, HOLD = 433, HOUR_P = 434, IDENTITY_P = 435, IF_P = 436, ILIKE = 437, IMMEDIATE = 438, IMMUTABLE = 439, IMPLICIT_P = 440, IMPORT_P = 441, IN_P = 442, INCLUDE = 443, INCLUDING = 444, INCREMENT = 445, INDEX = 446, INDEXES = 447, INHERIT = 448, INHERITS = 449, INITIALLY = 450, INLINE_P = 451, INNER_P = 452, INOUT = 453, INPUT_P = 454, INSENSITIVE = 455, INSERT = 456, INSTEAD = 457, INT_P = 458, INTEGER = 459, INTERSECT = 460, INTERVAL = 461, INTO = 462, INVOKER = 463, IS = 464, ISNULL = 465, ISOLATION = 466, JOIN = 467, KEY = 468, LABEL = 469, LANGUAGE = 470, LARGE_P = 471, LAST_P = 472, LATERAL_P = 473, LEADING = 474, LEAKPROOF = 475, LEAST = 476, LEFT = 477, LEVEL = 478, LIKE = 479, LIMIT = 480, LISTEN = 481, LOAD = 482, LOCAL = 483, LOCALTIME = 484, LOCALTIMESTAMP = 485, LOCATION = 486, LOCK_P = 487, LOCKED = 488, LOGGED = 489, MAPPING = 490, MATCH = 491, MATERIALIZED = 492, MAXVALUE = 493, METHOD = 494, MINUTE_P = 495, MINVALUE = 496, MODE = 497, MONTH_P = 498, MOVE = 499, NAME_P = 500, NAMES = 501, NATIONAL = 502, NATURAL = 503, NCHAR = 504, NEW = 505, NEXT = 506, NO = 507, NONE = 508, NOT = 509, NOTHING = 510, NOTIFY = 511, NOTNULL = 512, NOWAIT = 513, NULL_P = 514, NULLIF = 515, NULLS_P = 516, NUMERIC = 517, OBJECT_P = 518, OF = 519, OFF = 520, OFFSET = 521, OIDS = 522, OLD = 523, ON = 524, ONLY = 525, OPERATOR = 526, OPTION = 527, OPTIONS = 528, OR = 529, ORDER = 530, ORDINALITY = 531, OTHERS = 532, OUT_P = 533, OUTER_P = 534, OVER = 535, OVERLAPS = 536, OVERLAY = 537, OVERRIDING = 538, OWNED = 539, OWNER = 540, PARALLEL = 541, PARSER = 542, PARTIAL = 543, PARTITION = 544, PASSING = 545, PASSWORD = 546, PGPOOL = 547, PLACING = 548, PLANS = 549, POLICY = 550, POSITION = 551, PRECEDING = 552, PRECISION = 553, PRESERVE = 554, PREPARE = 555, PREPARED = 556, PRIMARY = 557, PRIOR = 558, PRIVILEGES = 559, PROCEDURAL = 560, PROCEDURE = 561, PROCEDURES = 562, PROGRAM = 563, PUBLICATION = 564, QUOTE = 565, RANGE = 566, READ = 567, REAL = 568, REASSIGN = 569, RECHECK = 570, RECURSIVE = 571, REF = 572, REFERENCES = 573, REFERENCING = 574, REFRESH = 575, REINDEX = 576, RELATIVE_P = 577, RELEASE = 578, RENAME = 579, REPEATABLE = 580, REPLACE = 581, REPLICA = 582, RESET = 583, RESTART = 584, RESTRICT = 585, RETURNING = 586, RETURNS = 587, REVOKE = 588, RIGHT = 589, ROLE = 590, ROLLBACK = 591, ROLLUP = 592, ROUTINE = 593, ROUTINES = 594, ROW = 595, ROWS = 596, RULE = 597, SAVEPOINT = 598, SCHEMA = 599, SCHEMAS = 600, SCROLL = 601, SEARCH = 602, SECOND_P = 603, SECURITY = 604, SELECT = 605, SEQUENCE = 606, SEQUENCES = 607, SERIALIZABLE = 608, SERVER = 609, SESSION = 610, SESSION_USER = 611, SET = 612, SETS = 613, SETOF = 614, SHARE = 615, SHOW = 616, SIMILAR = 617, SIMPLE = 618, SKIP = 619, SMALLINT = 620, SNAPSHOT = 621, SOME = 622, SQL_P = 623, STABLE = 624, STANDALONE_P = 625, START = 626, STATEMENT = 627, STATISTICS = 628, STDIN = 629, STDOUT = 630, STORAGE = 631, STORED = 632, STRICT_P = 633, STRIP_P = 634, SUBSCRIPTION = 635, SUBSTRING = 636, SUPPORT = 637, SYMMETRIC = 638, SYSID = 639, SYSTEM_P = 640, TABLE = 641, TABLES = 642, TABLESAMPLE = 643, TABLESPACE = 644, TEMP = 645, TEMPLATE = 646, TEMPORARY = 647, TEXT_P = 648, THEN = 649, TIES = 650, TIME = 651, TIMESTAMP = 652, TO = 653, TRAILING = 654, TRANSACTION = 655, TRANSFORM = 656, TREAT = 657, TRIGGER = 658, TRIM = 659, TRUE_P = 660, TRUNCATE = 661, TRUSTED = 662, TYPE_P = 663, TYPES_P = 664, UNBOUNDED = 665, UNCOMMITTED = 666, UNENCRYPTED = 667, UNION = 668, UNIQUE = 669, UNKNOWN = 670, UNLISTEN = 671, UNLOGGED = 672, UNTIL = 673, UPDATE = 674, USER = 675, USING = 676, VACUUM = 677, VALID = 678, VALIDATE = 679, VALIDATOR = 680, VALUE_P = 681, VALUES = 682, VARCHAR = 683, VARIADIC = 684, VARYING = 685, VERBOSE = 686, VERSION_P = 687, VIEW = 688, VIEWS = 689, VOLATILE = 690, WHEN = 691, WHERE = 692, WHITESPACE_P = 693, WINDOW = 694, WITH = 695, WITHIN = 696, WITHOUT = 697, WORK = 698, WRAPPER = 699, WRITE = 700, XML_P = 701, XMLATTRIBUTES = 702, XMLCONCAT = 703, XMLELEMENT = 704, XMLEXISTS = 705, XMLFOREST = 706, XMLNAMESPACES = 707, XMLPARSE = 708, XMLPI = 709, XMLROOT = 710, XMLSERIALIZE = 711, XMLTABLE = 712, YEAR_P = 713, YES_P = 714, ZONE = 715, NOT_LA = 716, NULLS_LA = 717, WITH_LA = 718, POSTFIXOP = 719, UMINUS = 720 }; #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 EQUALS_GREATER 269 #define LESS_EQUALS 270 #define GREATER_EQUALS 271 #define NOT_EQUALS 272 #define ABORT_P 273 #define ABSOLUTE_P 274 #define ACCESS 275 #define ACTION 276 #define ADD_P 277 #define ADMIN 278 #define AFTER 279 #define AGGREGATE 280 #define ALL 281 #define ALSO 282 #define ALTER 283 #define ALWAYS 284 #define ANALYSE 285 #define ANALYZE 286 #define AND 287 #define ANY 288 #define ARRAY 289 #define AS 290 #define ASC 291 #define ASSERTION 292 #define ASSIGNMENT 293 #define ASYMMETRIC 294 #define AT 295 #define ATTACH 296 #define ATTRIBUTE 297 #define AUTHORIZATION 298 #define BACKWARD 299 #define BEFORE 300 #define BEGIN_P 301 #define BETWEEN 302 #define BIGINT 303 #define BINARY 304 #define BIT 305 #define BOOLEAN_P 306 #define BOTH 307 #define BY 308 #define CACHE 309 #define CALL 310 #define CALLED 311 #define CASCADE 312 #define CASCADED 313 #define CASE 314 #define CAST 315 #define CATALOG_P 316 #define CHAIN 317 #define CHAR_P 318 #define CHARACTER 319 #define CHARACTERISTICS 320 #define CHECK 321 #define CHECKPOINT 322 #define CLASS 323 #define CLOSE 324 #define CLUSTER 325 #define COALESCE 326 #define COLLATE 327 #define COLLATION 328 #define COLUMN 329 #define COLUMNS 330 #define COMMENT 331 #define COMMENTS 332 #define COMMIT 333 #define COMMITTED 334 #define CONCURRENTLY 335 #define CONFIGURATION 336 #define CONFLICT 337 #define CONNECTION 338 #define CONSTRAINT 339 #define CONSTRAINTS 340 #define CONTENT_P 341 #define CONTINUE_P 342 #define CONVERSION_P 343 #define COPY 344 #define COST 345 #define CREATE 346 #define CROSS 347 #define CSV 348 #define CUBE 349 #define CURRENT_P 350 #define CURRENT_CATALOG 351 #define CURRENT_DATE 352 #define CURRENT_ROLE 353 #define CURRENT_SCHEMA 354 #define CURRENT_TIME 355 #define CURRENT_TIMESTAMP 356 #define CURRENT_USER 357 #define CURSOR 358 #define CYCLE 359 #define DATA_P 360 #define DATABASE 361 #define DAY_P 362 #define DEALLOCATE 363 #define DEC 364 #define DECIMAL_P 365 #define DECLARE 366 #define DEFAULT 367 #define DEFAULTS 368 #define DEFERRABLE 369 #define DEFERRED 370 #define DEFINER 371 #define DELETE_P 372 #define DELIMITER 373 #define DELIMITERS 374 #define DEPENDS 375 #define DESC 376 #define DETACH 377 #define DICTIONARY 378 #define DISABLE_P 379 #define DISCARD 380 #define DISTINCT 381 #define DO 382 #define DOCUMENT_P 383 #define DOMAIN_P 384 #define DOUBLE_P 385 #define DROP 386 #define EACH 387 #define ELSE 388 #define ENABLE_P 389 #define ENCODING 390 #define ENCRYPTED 391 #define END_P 392 #define ENUM_P 393 #define ESCAPE 394 #define EVENT 395 #define EXCEPT 396 #define EXCLUDE 397 #define EXCLUDING 398 #define EXCLUSIVE 399 #define EXECUTE 400 #define EXISTS 401 #define EXPLAIN 402 #define EXTENSION 403 #define EXTERNAL 404 #define EXTRACT 405 #define FALSE_P 406 #define FAMILY 407 #define FETCH 408 #define FILTER 409 #define FIRST_P 410 #define FLOAT_P 411 #define FOLLOWING 412 #define FOR 413 #define FORCE 414 #define FOREIGN 415 #define FORWARD 416 #define FREEZE 417 #define FROM 418 #define FULL 419 #define FUNCTION 420 #define FUNCTIONS 421 #define GENERATED 422 #define GLOBAL 423 #define GRANT 424 #define GRANTED 425 #define GREATEST 426 #define GROUP_P 427 #define GROUPING 428 #define GROUPS 429 #define HANDLER 430 #define HAVING 431 #define HEADER_P 432 #define HOLD 433 #define HOUR_P 434 #define IDENTITY_P 435 #define IF_P 436 #define ILIKE 437 #define IMMEDIATE 438 #define IMMUTABLE 439 #define IMPLICIT_P 440 #define IMPORT_P 441 #define IN_P 442 #define INCLUDE 443 #define INCLUDING 444 #define INCREMENT 445 #define INDEX 446 #define INDEXES 447 #define INHERIT 448 #define INHERITS 449 #define INITIALLY 450 #define INLINE_P 451 #define INNER_P 452 #define INOUT 453 #define INPUT_P 454 #define INSENSITIVE 455 #define INSERT 456 #define INSTEAD 457 #define INT_P 458 #define INTEGER 459 #define INTERSECT 460 #define INTERVAL 461 #define INTO 462 #define INVOKER 463 #define IS 464 #define ISNULL 465 #define ISOLATION 466 #define JOIN 467 #define KEY 468 #define LABEL 469 #define LANGUAGE 470 #define LARGE_P 471 #define LAST_P 472 #define LATERAL_P 473 #define LEADING 474 #define LEAKPROOF 475 #define LEAST 476 #define LEFT 477 #define LEVEL 478 #define LIKE 479 #define LIMIT 480 #define LISTEN 481 #define LOAD 482 #define LOCAL 483 #define LOCALTIME 484 #define LOCALTIMESTAMP 485 #define LOCATION 486 #define LOCK_P 487 #define LOCKED 488 #define LOGGED 489 #define MAPPING 490 #define MATCH 491 #define MATERIALIZED 492 #define MAXVALUE 493 #define METHOD 494 #define MINUTE_P 495 #define MINVALUE 496 #define MODE 497 #define MONTH_P 498 #define MOVE 499 #define NAME_P 500 #define NAMES 501 #define NATIONAL 502 #define NATURAL 503 #define NCHAR 504 #define NEW 505 #define NEXT 506 #define NO 507 #define NONE 508 #define NOT 509 #define NOTHING 510 #define NOTIFY 511 #define NOTNULL 512 #define NOWAIT 513 #define NULL_P 514 #define NULLIF 515 #define NULLS_P 516 #define NUMERIC 517 #define OBJECT_P 518 #define OF 519 #define OFF 520 #define OFFSET 521 #define OIDS 522 #define OLD 523 #define ON 524 #define ONLY 525 #define OPERATOR 526 #define OPTION 527 #define OPTIONS 528 #define OR 529 #define ORDER 530 #define ORDINALITY 531 #define OTHERS 532 #define OUT_P 533 #define OUTER_P 534 #define OVER 535 #define OVERLAPS 536 #define OVERLAY 537 #define OVERRIDING 538 #define OWNED 539 #define OWNER 540 #define PARALLEL 541 #define PARSER 542 #define PARTIAL 543 #define PARTITION 544 #define PASSING 545 #define PASSWORD 546 #define PGPOOL 547 #define PLACING 548 #define PLANS 549 #define POLICY 550 #define POSITION 551 #define PRECEDING 552 #define PRECISION 553 #define PRESERVE 554 #define PREPARE 555 #define PREPARED 556 #define PRIMARY 557 #define PRIOR 558 #define PRIVILEGES 559 #define PROCEDURAL 560 #define PROCEDURE 561 #define PROCEDURES 562 #define PROGRAM 563 #define PUBLICATION 564 #define QUOTE 565 #define RANGE 566 #define READ 567 #define REAL 568 #define REASSIGN 569 #define RECHECK 570 #define RECURSIVE 571 #define REF 572 #define REFERENCES 573 #define REFERENCING 574 #define REFRESH 575 #define REINDEX 576 #define RELATIVE_P 577 #define RELEASE 578 #define RENAME 579 #define REPEATABLE 580 #define REPLACE 581 #define REPLICA 582 #define RESET 583 #define RESTART 584 #define RESTRICT 585 #define RETURNING 586 #define RETURNS 587 #define REVOKE 588 #define RIGHT 589 #define ROLE 590 #define ROLLBACK 591 #define ROLLUP 592 #define ROUTINE 593 #define ROUTINES 594 #define ROW 595 #define ROWS 596 #define RULE 597 #define SAVEPOINT 598 #define SCHEMA 599 #define SCHEMAS 600 #define SCROLL 601 #define SEARCH 602 #define SECOND_P 603 #define SECURITY 604 #define SELECT 605 #define SEQUENCE 606 #define SEQUENCES 607 #define SERIALIZABLE 608 #define SERVER 609 #define SESSION 610 #define SESSION_USER 611 #define SET 612 #define SETS 613 #define SETOF 614 #define SHARE 615 #define SHOW 616 #define SIMILAR 617 #define SIMPLE 618 #define SKIP 619 #define SMALLINT 620 #define SNAPSHOT 621 #define SOME 622 #define SQL_P 623 #define STABLE 624 #define STANDALONE_P 625 #define START 626 #define STATEMENT 627 #define STATISTICS 628 #define STDIN 629 #define STDOUT 630 #define STORAGE 631 #define STORED 632 #define STRICT_P 633 #define STRIP_P 634 #define SUBSCRIPTION 635 #define SUBSTRING 636 #define SUPPORT 637 #define SYMMETRIC 638 #define SYSID 639 #define SYSTEM_P 640 #define TABLE 641 #define TABLES 642 #define TABLESAMPLE 643 #define TABLESPACE 644 #define TEMP 645 #define TEMPLATE 646 #define TEMPORARY 647 #define TEXT_P 648 #define THEN 649 #define TIES 650 #define TIME 651 #define TIMESTAMP 652 #define TO 653 #define TRAILING 654 #define TRANSACTION 655 #define TRANSFORM 656 #define TREAT 657 #define TRIGGER 658 #define TRIM 659 #define TRUE_P 660 #define TRUNCATE 661 #define TRUSTED 662 #define TYPE_P 663 #define TYPES_P 664 #define UNBOUNDED 665 #define UNCOMMITTED 666 #define UNENCRYPTED 667 #define UNION 668 #define UNIQUE 669 #define UNKNOWN 670 #define UNLISTEN 671 #define UNLOGGED 672 #define UNTIL 673 #define UPDATE 674 #define USER 675 #define USING 676 #define VACUUM 677 #define VALID 678 #define VALIDATE 679 #define VALIDATOR 680 #define VALUE_P 681 #define VALUES 682 #define VARCHAR 683 #define VARIADIC 684 #define VARYING 685 #define VERBOSE 686 #define VERSION_P 687 #define VIEW 688 #define VIEWS 689 #define VOLATILE 690 #define WHEN 691 #define WHERE 692 #define WHITESPACE_P 693 #define WINDOW 694 #define WITH 695 #define WITHIN 696 #define WITHOUT 697 #define WORK 698 #define WRAPPER 699 #define WRITE 700 #define XML_P 701 #define XMLATTRIBUTES 702 #define XMLCONCAT 703 #define XMLELEMENT 704 #define XMLEXISTS 705 #define XMLFOREST 706 #define XMLNAMESPACES 707 #define XMLPARSE 708 #define XMLPI 709 #define XMLROOT 710 #define XMLSERIALIZE 711 #define XMLTABLE 712 #define YEAR_P 713 #define YES_P 714 #define ZONE 715 #define NOT_LA 716 #define NULLS_LA 717 #define WITH_LA 718 #define POSTFIXOP 719 #define UMINUS 720 /* Value type. */ #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED union YYSTYPE { #line 239 "gram_minimal.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; ObjectWithArgs *objwithargs; DefElem *defelt; SortBy *sortby; WindowDef *windef; JoinExpr *jexpr; IndexElem *ielem; Alias *alias; RangeVar *range; IntoClause *into; WithClause *with; InferClause *infer; OnConflictClause *onconflict; A_Indices *aind; ResTarget *target; struct PrivTarget *privtarget; AccessPriv *accesspriv; struct ImportQual *importqual; InsertStmt *istmt; VariableSetStmt *vsetstmt; PartitionElem *partelem; PartitionSpec *partspec; PartitionBoundSpec *partboundspec; RoleSpec *rolespec; #line 1028 "gram_minimal.h" /* yacc.c:1909 */ }; typedef union YYSTYPE YYSTYPE; # 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 minimal_base_yyparse (core_yyscan_t yyscanner); #endif /* !YY_MINIMAL_BASE_YY_GRAM_MINIMAL_H_INCLUDED */ pgpool-II-4.1.4/src/parser/gram_minimal.c0000664000175000017500001101672313730350127015141 00000000000000/* A Bison parser, made by GNU Bison 3.0.4. */ /* Bison implementation for Yacc-like parsers in C Copyright (C) 1984, 1989-1990, 2000-2015 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.4" /* 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 minimal_base_yyparse #define yylex minimal_base_yylex #define yyerror minimal_base_yyerror #define yydebug minimal_base_yydebug #define yynerrs minimal_base_yynerrs /* Copy the first part of user declarations. */ #line 1 "gram_minimal.y" /* yacc.c:339 */ /*#define YYDEBUG 1*/ /*------------------------------------------------------------------------- * * gram.y * POSTGRESQL BISON rules/actions * * Portions Copyright (c) 2003-2019, PgPool Global Development Group * Portions Copyright (c) 1996-2019, 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 constraint_exclusion 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. * * 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" /* This is a configuration parameter since PostgreSQL 9.5. * We set this false in pgpool-II. This is default in PostgreSQL. */ static bool operator_precedence_warning = false; /* * 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/catalog/pg_attribute.h */ #define ATTRIBUTE_IDENTITY_ALWAYS 'a' #define ATTRIBUTE_IDENTITY_BY_DEFAULT 'd' /* * 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; /* * 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, or whose leftmost * component 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.) * * A cleaner answer would be to make YYLLOC_DEFAULT scan all the Rhs * locations until it's found one that's not -1. Then we'd get a correct * location for any nonterminal that isn't entirely empty. But this way * would add overhead to every rule reduction, and so far there's not been * a compelling reason to pay that overhead. */ /* * 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; ObjectType objtype; List *objs; } PrivTarget; /* Private struct for the result of import_qualification production */ typedef struct ImportQual { ImportForeignSchemaType type; List *table_names; } ImportQual; /* 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 minimal_base_yyerror(YYLTYPE *yylloc, core_yyscan_t yyscanner, const char *msg); static RawStmt *makeRawStmt(Node *stmt, int stmt_location); static void updateRawStmtEnd(RawStmt *rs, int end_location); static Node *makeColumnRef(char *colname, List *indirection, int location, core_yyscan_t yyscanner); static Node *makeStringConst(char *str, 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 RoleSpec *makeRoleSpec(RoleSpecType type, 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 *makeAndExpr(Node *lexpr, Node *rexpr, int location); static Node *makeOrExpr(Node *lexpr, Node *rexpr, int location); static Node *makeNotExpr(Node *expr, int location); static Node *makeAArrayExpr(List *elements, int location); static Node *makeSQLValueFunction(SQLValueFunctionOp op, int32 typmod, 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 301 "gram_minimal.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_MINIMAL_BASE_YY_Y_TAB_H_INCLUDED # define YY_MINIMAL_BASE_YY_Y_TAB_H_INCLUDED /* Debug traces. */ #ifndef YYDEBUG # define YYDEBUG 0 #endif #if YYDEBUG extern int minimal_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, EQUALS_GREATER = 269, LESS_EQUALS = 270, GREATER_EQUALS = 271, NOT_EQUALS = 272, ABORT_P = 273, ABSOLUTE_P = 274, ACCESS = 275, ACTION = 276, ADD_P = 277, ADMIN = 278, AFTER = 279, AGGREGATE = 280, ALL = 281, ALSO = 282, ALTER = 283, ALWAYS = 284, ANALYSE = 285, ANALYZE = 286, AND = 287, ANY = 288, ARRAY = 289, AS = 290, ASC = 291, ASSERTION = 292, ASSIGNMENT = 293, ASYMMETRIC = 294, AT = 295, ATTACH = 296, ATTRIBUTE = 297, AUTHORIZATION = 298, BACKWARD = 299, BEFORE = 300, BEGIN_P = 301, BETWEEN = 302, BIGINT = 303, BINARY = 304, BIT = 305, BOOLEAN_P = 306, BOTH = 307, BY = 308, CACHE = 309, CALL = 310, CALLED = 311, CASCADE = 312, CASCADED = 313, CASE = 314, CAST = 315, CATALOG_P = 316, CHAIN = 317, CHAR_P = 318, CHARACTER = 319, CHARACTERISTICS = 320, CHECK = 321, CHECKPOINT = 322, CLASS = 323, CLOSE = 324, CLUSTER = 325, COALESCE = 326, COLLATE = 327, COLLATION = 328, COLUMN = 329, COLUMNS = 330, COMMENT = 331, COMMENTS = 332, COMMIT = 333, COMMITTED = 334, CONCURRENTLY = 335, CONFIGURATION = 336, CONFLICT = 337, CONNECTION = 338, CONSTRAINT = 339, CONSTRAINTS = 340, CONTENT_P = 341, CONTINUE_P = 342, CONVERSION_P = 343, COPY = 344, COST = 345, CREATE = 346, CROSS = 347, CSV = 348, CUBE = 349, CURRENT_P = 350, CURRENT_CATALOG = 351, CURRENT_DATE = 352, CURRENT_ROLE = 353, CURRENT_SCHEMA = 354, CURRENT_TIME = 355, CURRENT_TIMESTAMP = 356, CURRENT_USER = 357, CURSOR = 358, CYCLE = 359, DATA_P = 360, DATABASE = 361, DAY_P = 362, DEALLOCATE = 363, DEC = 364, DECIMAL_P = 365, DECLARE = 366, DEFAULT = 367, DEFAULTS = 368, DEFERRABLE = 369, DEFERRED = 370, DEFINER = 371, DELETE_P = 372, DELIMITER = 373, DELIMITERS = 374, DEPENDS = 375, DESC = 376, DETACH = 377, DICTIONARY = 378, DISABLE_P = 379, DISCARD = 380, DISTINCT = 381, DO = 382, DOCUMENT_P = 383, DOMAIN_P = 384, DOUBLE_P = 385, DROP = 386, EACH = 387, ELSE = 388, ENABLE_P = 389, ENCODING = 390, ENCRYPTED = 391, END_P = 392, ENUM_P = 393, ESCAPE = 394, EVENT = 395, EXCEPT = 396, EXCLUDE = 397, EXCLUDING = 398, EXCLUSIVE = 399, EXECUTE = 400, EXISTS = 401, EXPLAIN = 402, EXTENSION = 403, EXTERNAL = 404, EXTRACT = 405, FALSE_P = 406, FAMILY = 407, FETCH = 408, FILTER = 409, FIRST_P = 410, FLOAT_P = 411, FOLLOWING = 412, FOR = 413, FORCE = 414, FOREIGN = 415, FORWARD = 416, FREEZE = 417, FROM = 418, FULL = 419, FUNCTION = 420, FUNCTIONS = 421, GENERATED = 422, GLOBAL = 423, GRANT = 424, GRANTED = 425, GREATEST = 426, GROUP_P = 427, GROUPING = 428, GROUPS = 429, HANDLER = 430, HAVING = 431, HEADER_P = 432, HOLD = 433, HOUR_P = 434, IDENTITY_P = 435, IF_P = 436, ILIKE = 437, IMMEDIATE = 438, IMMUTABLE = 439, IMPLICIT_P = 440, IMPORT_P = 441, IN_P = 442, INCLUDE = 443, INCLUDING = 444, INCREMENT = 445, INDEX = 446, INDEXES = 447, INHERIT = 448, INHERITS = 449, INITIALLY = 450, INLINE_P = 451, INNER_P = 452, INOUT = 453, INPUT_P = 454, INSENSITIVE = 455, INSERT = 456, INSTEAD = 457, INT_P = 458, INTEGER = 459, INTERSECT = 460, INTERVAL = 461, INTO = 462, INVOKER = 463, IS = 464, ISNULL = 465, ISOLATION = 466, JOIN = 467, KEY = 468, LABEL = 469, LANGUAGE = 470, LARGE_P = 471, LAST_P = 472, LATERAL_P = 473, LEADING = 474, LEAKPROOF = 475, LEAST = 476, LEFT = 477, LEVEL = 478, LIKE = 479, LIMIT = 480, LISTEN = 481, LOAD = 482, LOCAL = 483, LOCALTIME = 484, LOCALTIMESTAMP = 485, LOCATION = 486, LOCK_P = 487, LOCKED = 488, LOGGED = 489, MAPPING = 490, MATCH = 491, MATERIALIZED = 492, MAXVALUE = 493, METHOD = 494, MINUTE_P = 495, MINVALUE = 496, MODE = 497, MONTH_P = 498, MOVE = 499, NAME_P = 500, NAMES = 501, NATIONAL = 502, NATURAL = 503, NCHAR = 504, NEW = 505, NEXT = 506, NO = 507, NONE = 508, NOT = 509, NOTHING = 510, NOTIFY = 511, NOTNULL = 512, NOWAIT = 513, NULL_P = 514, NULLIF = 515, NULLS_P = 516, NUMERIC = 517, OBJECT_P = 518, OF = 519, OFF = 520, OFFSET = 521, OIDS = 522, OLD = 523, ON = 524, ONLY = 525, OPERATOR = 526, OPTION = 527, OPTIONS = 528, OR = 529, ORDER = 530, ORDINALITY = 531, OTHERS = 532, OUT_P = 533, OUTER_P = 534, OVER = 535, OVERLAPS = 536, OVERLAY = 537, OVERRIDING = 538, OWNED = 539, OWNER = 540, PARALLEL = 541, PARSER = 542, PARTIAL = 543, PARTITION = 544, PASSING = 545, PASSWORD = 546, PGPOOL = 547, PLACING = 548, PLANS = 549, POLICY = 550, POSITION = 551, PRECEDING = 552, PRECISION = 553, PRESERVE = 554, PREPARE = 555, PREPARED = 556, PRIMARY = 557, PRIOR = 558, PRIVILEGES = 559, PROCEDURAL = 560, PROCEDURE = 561, PROCEDURES = 562, PROGRAM = 563, PUBLICATION = 564, QUOTE = 565, RANGE = 566, READ = 567, REAL = 568, REASSIGN = 569, RECHECK = 570, RECURSIVE = 571, REF = 572, REFERENCES = 573, REFERENCING = 574, REFRESH = 575, REINDEX = 576, RELATIVE_P = 577, RELEASE = 578, RENAME = 579, REPEATABLE = 580, REPLACE = 581, REPLICA = 582, RESET = 583, RESTART = 584, RESTRICT = 585, RETURNING = 586, RETURNS = 587, REVOKE = 588, RIGHT = 589, ROLE = 590, ROLLBACK = 591, ROLLUP = 592, ROUTINE = 593, ROUTINES = 594, ROW = 595, ROWS = 596, RULE = 597, SAVEPOINT = 598, SCHEMA = 599, SCHEMAS = 600, SCROLL = 601, SEARCH = 602, SECOND_P = 603, SECURITY = 604, SELECT = 605, SEQUENCE = 606, SEQUENCES = 607, SERIALIZABLE = 608, SERVER = 609, SESSION = 610, SESSION_USER = 611, SET = 612, SETS = 613, SETOF = 614, SHARE = 615, SHOW = 616, SIMILAR = 617, SIMPLE = 618, SKIP = 619, SMALLINT = 620, SNAPSHOT = 621, SOME = 622, SQL_P = 623, STABLE = 624, STANDALONE_P = 625, START = 626, STATEMENT = 627, STATISTICS = 628, STDIN = 629, STDOUT = 630, STORAGE = 631, STORED = 632, STRICT_P = 633, STRIP_P = 634, SUBSCRIPTION = 635, SUBSTRING = 636, SUPPORT = 637, SYMMETRIC = 638, SYSID = 639, SYSTEM_P = 640, TABLE = 641, TABLES = 642, TABLESAMPLE = 643, TABLESPACE = 644, TEMP = 645, TEMPLATE = 646, TEMPORARY = 647, TEXT_P = 648, THEN = 649, TIES = 650, TIME = 651, TIMESTAMP = 652, TO = 653, TRAILING = 654, TRANSACTION = 655, TRANSFORM = 656, TREAT = 657, TRIGGER = 658, TRIM = 659, TRUE_P = 660, TRUNCATE = 661, TRUSTED = 662, TYPE_P = 663, TYPES_P = 664, UNBOUNDED = 665, UNCOMMITTED = 666, UNENCRYPTED = 667, UNION = 668, UNIQUE = 669, UNKNOWN = 670, UNLISTEN = 671, UNLOGGED = 672, UNTIL = 673, UPDATE = 674, USER = 675, USING = 676, VACUUM = 677, VALID = 678, VALIDATE = 679, VALIDATOR = 680, VALUE_P = 681, VALUES = 682, VARCHAR = 683, VARIADIC = 684, VARYING = 685, VERBOSE = 686, VERSION_P = 687, VIEW = 688, VIEWS = 689, VOLATILE = 690, WHEN = 691, WHERE = 692, WHITESPACE_P = 693, WINDOW = 694, WITH = 695, WITHIN = 696, WITHOUT = 697, WORK = 698, WRAPPER = 699, WRITE = 700, XML_P = 701, XMLATTRIBUTES = 702, XMLCONCAT = 703, XMLELEMENT = 704, XMLEXISTS = 705, XMLFOREST = 706, XMLNAMESPACES = 707, XMLPARSE = 708, XMLPI = 709, XMLROOT = 710, XMLSERIALIZE = 711, XMLTABLE = 712, YEAR_P = 713, YES_P = 714, ZONE = 715, NOT_LA = 716, NULLS_LA = 717, WITH_LA = 718, POSTFIXOP = 719, UMINUS = 720 }; #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 EQUALS_GREATER 269 #define LESS_EQUALS 270 #define GREATER_EQUALS 271 #define NOT_EQUALS 272 #define ABORT_P 273 #define ABSOLUTE_P 274 #define ACCESS 275 #define ACTION 276 #define ADD_P 277 #define ADMIN 278 #define AFTER 279 #define AGGREGATE 280 #define ALL 281 #define ALSO 282 #define ALTER 283 #define ALWAYS 284 #define ANALYSE 285 #define ANALYZE 286 #define AND 287 #define ANY 288 #define ARRAY 289 #define AS 290 #define ASC 291 #define ASSERTION 292 #define ASSIGNMENT 293 #define ASYMMETRIC 294 #define AT 295 #define ATTACH 296 #define ATTRIBUTE 297 #define AUTHORIZATION 298 #define BACKWARD 299 #define BEFORE 300 #define BEGIN_P 301 #define BETWEEN 302 #define BIGINT 303 #define BINARY 304 #define BIT 305 #define BOOLEAN_P 306 #define BOTH 307 #define BY 308 #define CACHE 309 #define CALL 310 #define CALLED 311 #define CASCADE 312 #define CASCADED 313 #define CASE 314 #define CAST 315 #define CATALOG_P 316 #define CHAIN 317 #define CHAR_P 318 #define CHARACTER 319 #define CHARACTERISTICS 320 #define CHECK 321 #define CHECKPOINT 322 #define CLASS 323 #define CLOSE 324 #define CLUSTER 325 #define COALESCE 326 #define COLLATE 327 #define COLLATION 328 #define COLUMN 329 #define COLUMNS 330 #define COMMENT 331 #define COMMENTS 332 #define COMMIT 333 #define COMMITTED 334 #define CONCURRENTLY 335 #define CONFIGURATION 336 #define CONFLICT 337 #define CONNECTION 338 #define CONSTRAINT 339 #define CONSTRAINTS 340 #define CONTENT_P 341 #define CONTINUE_P 342 #define CONVERSION_P 343 #define COPY 344 #define COST 345 #define CREATE 346 #define CROSS 347 #define CSV 348 #define CUBE 349 #define CURRENT_P 350 #define CURRENT_CATALOG 351 #define CURRENT_DATE 352 #define CURRENT_ROLE 353 #define CURRENT_SCHEMA 354 #define CURRENT_TIME 355 #define CURRENT_TIMESTAMP 356 #define CURRENT_USER 357 #define CURSOR 358 #define CYCLE 359 #define DATA_P 360 #define DATABASE 361 #define DAY_P 362 #define DEALLOCATE 363 #define DEC 364 #define DECIMAL_P 365 #define DECLARE 366 #define DEFAULT 367 #define DEFAULTS 368 #define DEFERRABLE 369 #define DEFERRED 370 #define DEFINER 371 #define DELETE_P 372 #define DELIMITER 373 #define DELIMITERS 374 #define DEPENDS 375 #define DESC 376 #define DETACH 377 #define DICTIONARY 378 #define DISABLE_P 379 #define DISCARD 380 #define DISTINCT 381 #define DO 382 #define DOCUMENT_P 383 #define DOMAIN_P 384 #define DOUBLE_P 385 #define DROP 386 #define EACH 387 #define ELSE 388 #define ENABLE_P 389 #define ENCODING 390 #define ENCRYPTED 391 #define END_P 392 #define ENUM_P 393 #define ESCAPE 394 #define EVENT 395 #define EXCEPT 396 #define EXCLUDE 397 #define EXCLUDING 398 #define EXCLUSIVE 399 #define EXECUTE 400 #define EXISTS 401 #define EXPLAIN 402 #define EXTENSION 403 #define EXTERNAL 404 #define EXTRACT 405 #define FALSE_P 406 #define FAMILY 407 #define FETCH 408 #define FILTER 409 #define FIRST_P 410 #define FLOAT_P 411 #define FOLLOWING 412 #define FOR 413 #define FORCE 414 #define FOREIGN 415 #define FORWARD 416 #define FREEZE 417 #define FROM 418 #define FULL 419 #define FUNCTION 420 #define FUNCTIONS 421 #define GENERATED 422 #define GLOBAL 423 #define GRANT 424 #define GRANTED 425 #define GREATEST 426 #define GROUP_P 427 #define GROUPING 428 #define GROUPS 429 #define HANDLER 430 #define HAVING 431 #define HEADER_P 432 #define HOLD 433 #define HOUR_P 434 #define IDENTITY_P 435 #define IF_P 436 #define ILIKE 437 #define IMMEDIATE 438 #define IMMUTABLE 439 #define IMPLICIT_P 440 #define IMPORT_P 441 #define IN_P 442 #define INCLUDE 443 #define INCLUDING 444 #define INCREMENT 445 #define INDEX 446 #define INDEXES 447 #define INHERIT 448 #define INHERITS 449 #define INITIALLY 450 #define INLINE_P 451 #define INNER_P 452 #define INOUT 453 #define INPUT_P 454 #define INSENSITIVE 455 #define INSERT 456 #define INSTEAD 457 #define INT_P 458 #define INTEGER 459 #define INTERSECT 460 #define INTERVAL 461 #define INTO 462 #define INVOKER 463 #define IS 464 #define ISNULL 465 #define ISOLATION 466 #define JOIN 467 #define KEY 468 #define LABEL 469 #define LANGUAGE 470 #define LARGE_P 471 #define LAST_P 472 #define LATERAL_P 473 #define LEADING 474 #define LEAKPROOF 475 #define LEAST 476 #define LEFT 477 #define LEVEL 478 #define LIKE 479 #define LIMIT 480 #define LISTEN 481 #define LOAD 482 #define LOCAL 483 #define LOCALTIME 484 #define LOCALTIMESTAMP 485 #define LOCATION 486 #define LOCK_P 487 #define LOCKED 488 #define LOGGED 489 #define MAPPING 490 #define MATCH 491 #define MATERIALIZED 492 #define MAXVALUE 493 #define METHOD 494 #define MINUTE_P 495 #define MINVALUE 496 #define MODE 497 #define MONTH_P 498 #define MOVE 499 #define NAME_P 500 #define NAMES 501 #define NATIONAL 502 #define NATURAL 503 #define NCHAR 504 #define NEW 505 #define NEXT 506 #define NO 507 #define NONE 508 #define NOT 509 #define NOTHING 510 #define NOTIFY 511 #define NOTNULL 512 #define NOWAIT 513 #define NULL_P 514 #define NULLIF 515 #define NULLS_P 516 #define NUMERIC 517 #define OBJECT_P 518 #define OF 519 #define OFF 520 #define OFFSET 521 #define OIDS 522 #define OLD 523 #define ON 524 #define ONLY 525 #define OPERATOR 526 #define OPTION 527 #define OPTIONS 528 #define OR 529 #define ORDER 530 #define ORDINALITY 531 #define OTHERS 532 #define OUT_P 533 #define OUTER_P 534 #define OVER 535 #define OVERLAPS 536 #define OVERLAY 537 #define OVERRIDING 538 #define OWNED 539 #define OWNER 540 #define PARALLEL 541 #define PARSER 542 #define PARTIAL 543 #define PARTITION 544 #define PASSING 545 #define PASSWORD 546 #define PGPOOL 547 #define PLACING 548 #define PLANS 549 #define POLICY 550 #define POSITION 551 #define PRECEDING 552 #define PRECISION 553 #define PRESERVE 554 #define PREPARE 555 #define PREPARED 556 #define PRIMARY 557 #define PRIOR 558 #define PRIVILEGES 559 #define PROCEDURAL 560 #define PROCEDURE 561 #define PROCEDURES 562 #define PROGRAM 563 #define PUBLICATION 564 #define QUOTE 565 #define RANGE 566 #define READ 567 #define REAL 568 #define REASSIGN 569 #define RECHECK 570 #define RECURSIVE 571 #define REF 572 #define REFERENCES 573 #define REFERENCING 574 #define REFRESH 575 #define REINDEX 576 #define RELATIVE_P 577 #define RELEASE 578 #define RENAME 579 #define REPEATABLE 580 #define REPLACE 581 #define REPLICA 582 #define RESET 583 #define RESTART 584 #define RESTRICT 585 #define RETURNING 586 #define RETURNS 587 #define REVOKE 588 #define RIGHT 589 #define ROLE 590 #define ROLLBACK 591 #define ROLLUP 592 #define ROUTINE 593 #define ROUTINES 594 #define ROW 595 #define ROWS 596 #define RULE 597 #define SAVEPOINT 598 #define SCHEMA 599 #define SCHEMAS 600 #define SCROLL 601 #define SEARCH 602 #define SECOND_P 603 #define SECURITY 604 #define SELECT 605 #define SEQUENCE 606 #define SEQUENCES 607 #define SERIALIZABLE 608 #define SERVER 609 #define SESSION 610 #define SESSION_USER 611 #define SET 612 #define SETS 613 #define SETOF 614 #define SHARE 615 #define SHOW 616 #define SIMILAR 617 #define SIMPLE 618 #define SKIP 619 #define SMALLINT 620 #define SNAPSHOT 621 #define SOME 622 #define SQL_P 623 #define STABLE 624 #define STANDALONE_P 625 #define START 626 #define STATEMENT 627 #define STATISTICS 628 #define STDIN 629 #define STDOUT 630 #define STORAGE 631 #define STORED 632 #define STRICT_P 633 #define STRIP_P 634 #define SUBSCRIPTION 635 #define SUBSTRING 636 #define SUPPORT 637 #define SYMMETRIC 638 #define SYSID 639 #define SYSTEM_P 640 #define TABLE 641 #define TABLES 642 #define TABLESAMPLE 643 #define TABLESPACE 644 #define TEMP 645 #define TEMPLATE 646 #define TEMPORARY 647 #define TEXT_P 648 #define THEN 649 #define TIES 650 #define TIME 651 #define TIMESTAMP 652 #define TO 653 #define TRAILING 654 #define TRANSACTION 655 #define TRANSFORM 656 #define TREAT 657 #define TRIGGER 658 #define TRIM 659 #define TRUE_P 660 #define TRUNCATE 661 #define TRUSTED 662 #define TYPE_P 663 #define TYPES_P 664 #define UNBOUNDED 665 #define UNCOMMITTED 666 #define UNENCRYPTED 667 #define UNION 668 #define UNIQUE 669 #define UNKNOWN 670 #define UNLISTEN 671 #define UNLOGGED 672 #define UNTIL 673 #define UPDATE 674 #define USER 675 #define USING 676 #define VACUUM 677 #define VALID 678 #define VALIDATE 679 #define VALIDATOR 680 #define VALUE_P 681 #define VALUES 682 #define VARCHAR 683 #define VARIADIC 684 #define VARYING 685 #define VERBOSE 686 #define VERSION_P 687 #define VIEW 688 #define VIEWS 689 #define VOLATILE 690 #define WHEN 691 #define WHERE 692 #define WHITESPACE_P 693 #define WINDOW 694 #define WITH 695 #define WITHIN 696 #define WITHOUT 697 #define WORK 698 #define WRAPPER 699 #define WRITE 700 #define XML_P 701 #define XMLATTRIBUTES 702 #define XMLCONCAT 703 #define XMLELEMENT 704 #define XMLEXISTS 705 #define XMLFOREST 706 #define XMLNAMESPACES 707 #define XMLPARSE 708 #define XMLPI 709 #define XMLROOT 710 #define XMLSERIALIZE 711 #define XMLTABLE 712 #define YEAR_P 713 #define YES_P 714 #define ZONE 715 #define NOT_LA 716 #define NULLS_LA 717 #define WITH_LA 718 #define POSTFIXOP 719 #define UMINUS 720 /* Value type. */ #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED union YYSTYPE { #line 239 "gram_minimal.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; ObjectWithArgs *objwithargs; DefElem *defelt; SortBy *sortby; WindowDef *windef; JoinExpr *jexpr; IndexElem *ielem; Alias *alias; RangeVar *range; IntoClause *into; WithClause *with; InferClause *infer; OnConflictClause *onconflict; A_Indices *aind; ResTarget *target; struct PrivTarget *privtarget; AccessPriv *accesspriv; struct ImportQual *importqual; InsertStmt *istmt; VariableSetStmt *vsetstmt; PartitionElem *partelem; PartitionSpec *partspec; PartitionBoundSpec *partboundspec; RoleSpec *rolespec; #line 1315 "gram_minimal.c" /* yacc.c:355 */ }; typedef union YYSTYPE YYSTYPE; # 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 minimal_base_yyparse (core_yyscan_t yyscanner); #endif /* !YY_MINIMAL_BASE_YY_Y_TAB_H_INCLUDED */ /* Copy the second part of user declarations. */ #line 1345 "gram_minimal.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 832 /* YYLAST -- Last index in YYTABLE. */ #define YYLAST 102535 /* YYNTOKENS -- Number of terminals. */ #define YYNTOKENS 483 /* YYNNTS -- Number of nonterminals. */ #define YYNNTS 669 /* YYNRULES -- Number of rules. */ #define YYNRULES 2730 /* YYNSTATES -- Number of states. */ #define YYNSTATES 5503 /* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned by yylex, with out-of-bounds checking. */ #define YYUNDEFTOK 2 #define YYMAXUTOK 720 #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, 472, 2, 2, 477, 478, 470, 468, 481, 469, 479, 471, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 482, 480, 464, 466, 465, 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, 475, 2, 476, 473, 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, 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, 467, 474 }; #if YYDEBUG /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ static const yytype_uint16 yyrline[] = { 0, 828, 828, 844, 856, 866, 867, 868, 869, 870, 871, 872, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882, 883, 884, 885, 886, 887, 888, 889, 890, 891, 892, 893, 894, 895, 896, 897, 898, 899, 900, 901, 902, 903, 904, 905, 906, 907, 908, 909, 910, 911, 912, 913, 914, 915, 916, 917, 918, 919, 920, 921, 922, 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 956, 957, 958, 959, 960, 961, 962, 963, 964, 965, 966, 967, 968, 969, 970, 971, 972, 973, 974, 975, 976, 977, 978, 979, 980, 981, 982, 983, 984, 985, 986, 987, 988, 990, 999, 1014, 1025, 1026, 1027, 1036, 1037, 1041, 1042, 1046, 1051, 1055, 1065, 1073, 1077, 1081, 1086, 1090, 1138, 1140, 1144, 1148, 1152, 1156, 1170, 1188, 1196, 1207, 1208, 1212, 1220, 1228, 1236, 1257, 1264, 1271, 1278, 1285, 1292, 1309, 1327, 1338, 1339, 1350, 1360, 1370, 1385, 1403, 1404, 1408, 1415, 1423, 1424, 1425, 1426, 1427, 1428, 1442, 1449, 1455, 1461, 1470, 1478, 1486, 1490, 1498, 1506, 1513, 1523, 1524, 1532, 1543, 1551, 1559, 1570, 1578, 1586, 1593, 1602, 1612, 1613, 1617, 1618, 1621, 1623, 1627, 1628, 1629, 1630, 1634, 1635, 1636, 1642, 1654, 1658, 1662, 1677, 1684, 1685, 1686, 1690, 1691, 1692, 1696, 1697, 1701, 1702, 1711, 1712, 1719, 1726, 1736, 1743, 1753, 1754, 1759, 1760, 1766, 1772, 1778, 1784, 1790, 1796, 1802, 1812, 1822, 1823, 1827, 1828, 1836, 1851, 1857, 1863, 1869, 1875, 1894, 1903, 1912, 1921, 1930, 1941, 1952, 1961, 1970, 1979, 1990, 2001, 2010, 2019, 2028, 2037, 2046, 2055, 2066, 2080, 2081, 2086, 2099, 2115, 2131, 2140, 2149, 2158, 2167, 2176, 2184, 2192, 2201, 2217, 2226, 2235, 2244, 2261, 2270, 2279, 2288, 2298, 2311, 2326, 2335, 2344, 2359, 2367, 2377, 2387, 2394, 2402, 2410, 2417, 2424, 2432, 2440, 2448, 2455, 2462, 2470, 2477, 2484, 2492, 2500, 2508, 2516, 2524, 2532, 2542, 2549, 2557, 2565, 2573, 2581, 2589, 2596, 2603, 2610, 2616, 2626, 2627, 2631, 2632, 2633, 2637, 2645, 2649, 2650, 2654, 2661, 2668, 2675, 2685, 2688, 2689, 2693, 2694, 2699, 2703, 2707, 2712, 2719, 2721, 2726, 2730, 2734, 2745, 2753, 2806, 2819, 2833, 2845, 2852, 2856, 2870, 2883, 2884, 2889, 2898, 2908, 2918, 2944, 2950, 2983, 3018, 3040, 3041, 3045, 3046, 3055, 3056, 3057, 3060, 3061, 3066, 3067, 3071, 3075, 3079, 3083, 3087, 3091, 3095, 3099, 3103, 3107, 3111, 3115, 3119, 3128, 3132, 3136, 3140, 3144, 3145, 3150, 3154, 3161, 3168, 3169, 3170, 3171, 3172, 3176, 3180, 3188, 3199, 3218, 3237, 3257, 3277, 3297, 3330, 3331, 3332, 3333, 3334, 3341, 3348, 3349, 3353, 3354, 3358, 3359, 3363, 3367, 3374, 3378, 3385, 3386, 3387, 3391, 3392, 3395, 3416, 3434, 3455, 3456, 3460, 3467, 3468, 3469, 3500, 3507, 3514, 3525, 3536, 3548, 3559, 3568, 3591, 3609, 3610, 3629, 3636, 3643, 3650, 3661, 3671, 3672, 3673, 3677, 3678, 3679, 3680, 3681, 3682, 3683, 3684, 3685, 3694, 3701, 3705, 3718, 3734, 3749, 3765, 3780, 3799, 3820, 3821, 3825, 3826, 3830, 3831, 3834, 3840, 3841, 3844, 3848, 3856, 3861, 3867, 3868, 3872, 3877, 3884, 3885, 3895, 3897, 3899, 3901, 3904, 3907, 3910, 3914, 3915, 3916, 3917, 3918, 3921, 3922, 3926, 3927, 3930, 3942, 3943, 3946, 3947, 3950, 3961, 3972, 3986, 3987, 3992, 3993, 3994, 3997, 3998, 3999, 4000, 4003, 4004, 4007, 4008, 4011, 4029, 4041, 4066, 4079, 4095, 4111, 4112, 4113, 4125, 4138, 4154, 4168, 4169, 4181, 4201, 4211, 4224, 4232, 4243, 4244, 4247, 4248, 4251, 4252, 4255, 4259, 4263, 4267, 4271, 4275, 4279, 4283, 4287, 4291, 4295, 4300, 4304, 4308, 4314, 4315, 4319, 4320, 4321, 4326, 4329, 4330, 4342, 4354, 4369, 4370, 4378, 4379, 4383, 4384, 4388, 4389, 4393, 4394, 4398, 4408, 4421, 4422, 4432, 4443, 4444, 4457, 4464, 4481, 4489, 4500, 4503, 4507, 4511, 4515, 4519, 4531, 4541, 4544, 4548, 4561, 4570, 4579, 4588, 4597, 4606, 4615, 4624, 4633, 4642, 4651, 4660, 4669, 4678, 4687, 4696, 4705, 4714, 4723, 4732, 4741, 4750, 4759, 4768, 4777, 4786, 4795, 4804, 4822, 4833, 4834, 4835, 4836, 4840, 4841, 4845, 4846, 4856, 4864, 4876, 4877, 4881, 4885, 4893, 4897, 4901, 4908, 4912, 4917, 4922, 4929, 4936, 4941, 4951, 4963, 4978, 4979, 4984, 4985, 4989, 4990, 5000, 5009, 5017, 5034, 5054, 5074, 5095, 5126, 5135, 5156, 5171, 5172, 5176, 5184, 5199, 5208, 5220, 5221, 5233, 5241, 5258, 5282, 5299, 5313, 5314, 5318, 5319, 5323, 5324, 5328, 5329, 5333, 5347, 5351, 5352, 5356, 5357, 5358, 5359, 5360, 5370, 5381, 5382, 5393, 5414, 5440, 5441, 5442, 5446, 5448, 5470, 5472, 5474, 5476, 5478, 5483, 5484, 5488, 5489, 5493, 5504, 5505, 5509, 5518, 5522, 5526, 5531, 5541, 5542, 5546, 5547, 5551, 5552, 5556, 5557, 5561, 5562, 5563, 5567, 5571, 5572, 5573, 5577, 5578, 5583, 5584, 5611, 5612, 5613, 5614, 5615, 5616, 5629, 5639, 5653, 5655, 5660, 5665, 5667, 5672, 5682, 5683, 5684, 5685, 5696, 5715, 5726, 5738, 5748, 5758, 5769, 5778, 5785, 5792, 5801, 5810, 5819, 5828, 5837, 5847, 5856, 5868, 5871, 5872, 5875, 5879, 5886, 5887, 5888, 5889, 5890, 5891, 5894, 5897, 5898, 5906, 5913, 5914, 5917, 5919, 5930, 5941, 5952, 5963, 5976, 5977, 5993, 6008, 6009, 6013, 6025, 6035, 6043, 6052, 6061, 6062, 6065, 6066, 6069, 6070, 6071, 6074, 6088, 6093, 6103, 6112, 6124, 6125, 6129, 6137, 6149, 6159, 6172, 6182, 6204, 6214, 6232, 6242, 6252, 6262, 6272, 6282, 6292, 6302, 6312, 6322, 6332, 6342, 6356, 6357, 6358, 6359, 6360, 6361, 6362, 6363, 6364, 6365, 6366, 6367, 6368, 6373, 6374, 6375, 6376, 6377, 6378, 6379, 6384, 6385, 6386, 6390, 6391, 6394, 6395, 6398, 6400, 6405, 6406, 6417, 6428, 6429, 6430, 6464, 6472, 6480, 6488, 6496, 6504, 6512, 6520, 6528, 6541, 6549, 6557, 6565, 6573, 6581, 6589, 6597, 6605, 6613, 6625, 6626, 6627, 6628, 6629, 6630, 6631, 6632, 6633, 6634, 6635, 6636, 6637, 6638, 6643, 6644, 6645, 6646, 6647, 6648, 6649, 6650, 6651, 6652, 6653, 6654, 6658, 6659, 6673, 6683, 6693, 6703, 6713, 6723, 6733, 6743, 6753, 6765, 6766, 6771, 6772, 6773, 6774, 6775, 6776, 6781, 6782, 6783, 6784, 6785, 6786, 6787, 6788, 6791, 6792, 6802, 6808, 6816, 6824, 6832, 6840, 6848, 6856, 6864, 6872, 6880, 6888, 6896, 6904, 6912, 6920, 6928, 6936, 6946, 6947, 6950, 6951, 6961, 6977, 6991, 7017, 7019, 7021, 7023, 7030, 7039, 7040, 7043, 7050, 7057, 7064, 7078, 7086, 7094, 7102, 7110, 7118, 7126, 7134, 7142, 7150, 7158, 7166, 7174, 7182, 7190, 7198, 7206, 7214, 7222, 7230, 7242, 7243, 7247, 7248, 7253, 7254, 7264, 7277, 7287, 7299, 7300, 7303, 7304, 7314, 7324, 7325, 7329, 7333, 7337, 7348, 7361, 7375, 7392, 7393, 7394, 7395, 7396, 7397, 7409, 7437, 7468, 7469, 7473, 7474, 7478, 7479, 7483, 7484, 7487, 7488, 7496, 7507, 7518, 7531, 7532, 7535, 7536, 7539, 7540, 7543, 7544, 7547, 7548, 7549, 7552, 7553, 7554, 7570, 7582, 7595, 7607, 7622, 7623, 7626, 7627, 7631, 7632, 7636, 7637, 7642, 7654, 7661, 7668, 7683, 7684, 7688, 7689, 7704, 7713, 7722, 7731, 7740, 7752, 7753, 7754, 7755, 7756, 7762, 7766, 7781, 7782, 7788, 7798, 7802, 7807, 7815, 7856, 7860, 7864, 7868, 7876, 7877, 7881, 7891, 7892, 7898, 7899, 7906, 7910, 7914, 7918, 7922, 7926, 7930, 7934, 7938, 7942, 7946, 7950, 7954, 7958, 7962, 7966, 7971, 7978, 7982, 7986, 7990, 7994, 8000, 8001, 8008, 8009, 8013, 8014, 8017, 8029, 8033, 8048, 8056, 8064, 8076, 8077, 8082, 8083, 8100, 8110, 8120, 8130, 8140, 8150, 8163, 8173, 8186, 8196, 8209, 8217, 8219, 8221, 8226, 8228, 8233, 8234, 8239, 8257, 8266, 8267, 8271, 8275, 8287, 8298, 8309, 8322, 8323, 8324, 8328, 8340, 8341, 8351, 8363, 8367, 8371, 8375, 8382, 8402, 8412, 8422, 8432, 8444, 8445, 8448, 8449, 8450, 8453, 8454, 8457, 8467, 8476, 8493, 8502, 8511, 8520, 8529, 8538, 8547, 8556, 8565, 8574, 8583, 8592, 8601, 8611, 8621, 8630, 8639, 8648, 8657, 8666, 8675, 8685, 8695, 8705, 8715, 8725, 8735, 8745, 8755, 8765, 8775, 8785, 8795, 8806, 8817, 8828, 8839, 8849, 8859, 8870, 8881, 8891, 8901, 8909, 8918, 8927, 8936, 8945, 8954, 8963, 8972, 8981, 8990, 9004, 9005, 9008, 9009, 9019, 9027, 9035, 9043, 9052, 9060, 9077, 9086, 9095, 9104, 9113, 9122, 9131, 9140, 9149, 9158, 9167, 9176, 9185, 9194, 9203, 9212, 9221, 9230, 9239, 9248, 9257, 9266, 9275, 9284, 9293, 9302, 9311, 9329, 9338, 9339, 9342, 9344, 9350, 9351, 9352, 9353, 9354, 9363, 9371, 9379, 9387, 9395, 9403, 9411, 9419, 9427, 9435, 9443, 9451, 9459, 9467, 9475, 9483, 9491, 9499, 9507, 9515, 9523, 9531, 9539, 9547, 9565, 9584, 9585, 9589, 9593, 9613, 9620, 9628, 9636, 9653, 9666, 9670, 9677, 9686, 9695, 9704, 9713, 9723, 9733, 9751, 9759, 9775, 9792, 9793, 9794, 9799, 9805, 9814, 9815, 9816, 9817, 9818, 9822, 9823, 9826, 9827, 9828, 9829, 9833, 9834, 9835, 9847, 9857, 9858, 9861, 9870, 9876, 9895, 9903, 9910, 9917, 9925, 9933, 9941, 9948, 9955, 9962, 9969, 9976, 9983, 9990, 9999, 10000, 10001, 10005, 10008, 10011, 10014, 10017, 10024, 10026, 10028, 10033, 10035, 10039, 10040, 10041, 10053, 10066, 10079, 10097, 10118, 10119, 10120, 10121, 10131, 10147, 10157, 10158, 10162, 10163, 10167, 10171, 10175, 10193, 10194, 10195, 10196, 10197, 10198, 10199, 10206, 10207, 10218, 10225, 10232, 10243, 10260, 10267, 10283, 10300, 10306, 10322, 10335, 10344, 10352, 10360, 10369, 10380, 10391, 10401, 10402, 10413, 10423, 10434, 10445, 10456, 10467, 10476, 10488, 10489, 10503, 10526, 10536, 10547, 10560, 10561, 10573, 10593, 10603, 10614, 10625, 10629, 10636, 10637, 10641, 10648, 10649, 10653, 10654, 10655, 10659, 10660, 10664, 10665, 10668, 10669, 10672, 10673, 10677, 10678, 10682, 10689, 10691, 10696, 10697, 10710, 10717, 10727, 10734, 10744, 10745, 10746, 10747, 10748, 10749, 10750, 10751, 10752, 10756, 10760, 10767, 10774, 10775, 10779, 10780, 10781, 10791, 10801, 10802, 10806, 10807, 10808, 10809, 10819, 10826, 10843, 10862, 10863, 10873, 10879, 10885, 10891, 10907, 10918, 10940, 10944, 10952, 10958, 10965, 10971, 10978, 10987, 10988, 10992, 10994, 10999, 11010, 11020, 11030, 11036, 11045, 11054, 11060, 11061, 11072, 11086, 11087, 11098, 11109, 11110, 11113, 11114, 11115, 11116, 11117, 11118, 11119, 11120, 11123, 11124, 11128, 11129, 11130, 11141, 11157, 11172, 11173, 11177, 11182, 11206, 11217, 11218, 11228, 11239, 11242, 11243, 11244, 11245, 11246, 11249, 11250, 11251, 11299, 11300, 11304, 11305, 11320, 11321, 11328, 11336, 11344, 11352, 11360, 11368, 11379, 11380, 11407, 11421, 11436, 11437, 11456, 11460, 11464, 11481, 11488, 11495, 11505, 11506, 11509, 11522, 11523, 11524, 11528, 11529, 11533, 11545, 11553, 11558, 11563, 11568, 11573, 11581, 11589, 11594, 11599, 11606, 11607, 11611, 11612, 11613, 11620, 11621, 11625, 11626, 11630, 11631, 11635, 11639, 11640, 11643, 11652, 11665, 11666, 11667, 11668, 11672, 11673, 11677, 11679, 11695, 11697, 11702, 11705, 11710, 11711, 11719, 11739, 11740, 11742, 11747, 11748, 11752, 11753, 11756, 11757, 11782, 11783, 11787, 11788, 11792, 11793, 11794, 11795, 11796, 11800, 11813, 11820, 11827, 11834, 11835, 11839, 11840, 11844, 11845, 11849, 11850, 11854, 11865, 11866, 11867, 11868, 11872, 11873, 11883, 11889, 11907, 11908, 11912, 11913, 11919, 11924, 11932, 11939, 11947, 11953, 11960, 11995, 12020, 12024, 12050, 12054, 12066, 12079, 12093, 12104, 12119, 12125, 12130, 12136, 12143, 12144, 12152, 12156, 12160, 12166, 12173, 12178, 12179, 12180, 12181, 12185, 12186, 12198, 12199, 12204, 12211, 12218, 12225, 12236, 12237, 12250, 12254, 12261, 12274, 12287, 12288, 12303, 12313, 12325, 12330, 12331, 12334, 12335, 12338, 12339, 12344, 12345, 12350, 12351, 12359, 12364, 12365, 12369, 12373, 12379, 12403, 12413, 12426, 12427, 12431, 12445, 12502, 12516, 12518, 12523, 12525, 12527, 12529, 12534, 12536, 12541, 12549, 12569, 12574, 12581, 12586, 12592, 12597, 12606, 12608, 12611, 12615, 12616, 12617, 12618, 12619, 12620, 12625, 12645, 12646, 12647, 12648, 12659, 12665, 12673, 12674, 12680, 12685, 12690, 12695, 12700, 12705, 12710, 12715, 12721, 12727, 12733, 12740, 12762, 12771, 12775, 12783, 12787, 12795, 12807, 12828, 12832, 12838, 12842, 12855, 12863, 12873, 12875, 12877, 12879, 12881, 12883, 12888, 12889, 12896, 12905, 12913, 12922, 12933, 12941, 12942, 12943, 12947, 12949, 12951, 12953, 12955, 12957, 12959, 12964, 12969, 12975, 12983, 12988, 12995, 13002, 13006, 13010, 13046, 13047, 13049, 13057, 13072, 13074, 13076, 13078, 13080, 13082, 13084, 13086, 13088, 13090, 13092, 13094, 13096, 13098, 13101, 13103, 13105, 13108, 13110, 13112, 13114, 13117, 13122, 13130, 13135, 13143, 13148, 13156, 13161, 13170, 13178, 13186, 13194, 13212, 13220, 13228, 13236, 13244, 13260, 13268, 13276, 13284, 13292, 13300, 13308, 13312, 13316, 13320, 13324, 13332, 13340, 13348, 13356, 13376, 13398, 13409, 13416, 13432, 13437, 13443, 13468, 13470, 13472, 13474, 13476, 13478, 13480, 13482, 13484, 13486, 13488, 13490, 13492, 13494, 13496, 13498, 13500, 13502, 13504, 13506, 13510, 13514, 13518, 13522, 13527, 13543, 13544, 13545, 13560, 13594, 13596, 13598, 13609, 13633, 13644, 13655, 13662, 13672, 13682, 13691, 13695, 13701, 13708, 13715, 13725, 13732, 13760, 13795, 13806, 13807, 13814, 13820, 13824, 13828, 13832, 13836, 13840, 13844, 13848, 13852, 13856, 13860, 13864, 13868, 13872, 13876, 13880, 13882, 13886, 13895, 13900, 13907, 13922, 13929, 13933, 13937, 13941, 13945, 13952, 13960, 13968, 13972, 13976, 13980, 13984, 13988, 13994, 13998, 14007, 14011, 14015, 14020, 14034, 14036, 14040, 14042, 14044, 14047, 14050, 14053, 14054, 14057, 14065, 14075, 14076, 14079, 14080, 14081, 14086, 14090, 14094, 14098, 14105, 14106, 14114, 14115, 14119, 14120, 14128, 14129, 14133, 14134, 14139, 14147, 14149, 14163, 14166, 14193, 14194, 14197, 14198, 14206, 14213, 14220, 14228, 14237, 14254, 14299, 14307, 14315, 14323, 14331, 14342, 14343, 14344, 14345, 14346, 14360, 14361, 14362, 14365, 14366, 14369, 14372, 14373, 14374, 14377, 14378, 14381, 14382, 14383, 14384, 14385, 14386, 14387, 14388, 14389, 14390, 14391, 14392, 14395, 14397, 14402, 14404, 14409, 14411, 14413, 14415, 14417, 14419, 14431, 14435, 14442, 14446, 14452, 14456, 14465, 14476, 14477, 14480, 14484, 14488, 14494, 14495, 14500, 14504, 14511, 14512, 14513, 14514, 14515, 14516, 14517, 14518, 14528, 14532, 14539, 14546, 14547, 14563, 14567, 14572, 14576, 14591, 14596, 14600, 14603, 14606, 14607, 14608, 14611, 14618, 14628, 14642, 14643, 14647, 14658, 14659, 14662, 14663, 14666, 14670, 14677, 14681, 14685, 14693, 14704, 14705, 14709, 14710, 14714, 14715, 14718, 14719, 14729, 14730, 14734, 14735, 14738, 14754, 14762, 14770, 14792, 14793, 14804, 14808, 14835, 14837, 14842, 14845, 14848, 14850, 14852, 14854, 14864, 14866, 14877, 14881, 14885, 14889, 14893, 14902, 14909, 14941, 14945, 14951, 14958, 14962, 14966, 14972, 14973, 14975, 14976, 14977, 14981, 15014, 15041, 15045, 15051, 15053, 15070, 15071, 15072, 15077, 15078, 15079, 15084, 15085, 15086, 15087, 15093, 15094, 15095, 15096, 15097, 15117, 15118, 15119, 15120, 15121, 15122, 15123, 15124, 15125, 15126, 15127, 15128, 15129, 15130, 15131, 15132, 15133, 15134, 15135, 15136, 15137, 15138, 15139, 15140, 15141, 15142, 15143, 15144, 15145, 15146, 15147, 15148, 15149, 15150, 15151, 15152, 15153, 15154, 15155, 15156, 15157, 15158, 15159, 15160, 15161, 15162, 15163, 15164, 15165, 15166, 15167, 15168, 15169, 15170, 15171, 15172, 15173, 15174, 15175, 15176, 15177, 15178, 15179, 15180, 15181, 15182, 15183, 15184, 15185, 15186, 15187, 15188, 15189, 15190, 15191, 15192, 15193, 15194, 15195, 15196, 15197, 15198, 15199, 15200, 15201, 15202, 15203, 15204, 15205, 15206, 15207, 15208, 15209, 15210, 15211, 15212, 15213, 15214, 15215, 15216, 15217, 15218, 15219, 15220, 15221, 15222, 15223, 15224, 15225, 15226, 15227, 15228, 15229, 15230, 15231, 15232, 15233, 15234, 15235, 15236, 15237, 15238, 15239, 15240, 15241, 15242, 15243, 15244, 15245, 15246, 15247, 15248, 15249, 15250, 15251, 15252, 15253, 15254, 15255, 15256, 15257, 15258, 15259, 15260, 15261, 15262, 15263, 15264, 15265, 15266, 15267, 15268, 15269, 15270, 15271, 15272, 15273, 15274, 15275, 15276, 15277, 15278, 15279, 15280, 15281, 15282, 15283, 15284, 15285, 15286, 15287, 15288, 15289, 15290, 15291, 15292, 15293, 15294, 15295, 15296, 15297, 15298, 15299, 15300, 15301, 15302, 15303, 15304, 15305, 15306, 15307, 15308, 15309, 15310, 15311, 15312, 15313, 15314, 15315, 15316, 15317, 15318, 15319, 15320, 15321, 15322, 15323, 15324, 15325, 15326, 15327, 15328, 15329, 15330, 15331, 15332, 15333, 15334, 15335, 15336, 15337, 15338, 15339, 15340, 15341, 15342, 15343, 15344, 15345, 15346, 15347, 15348, 15349, 15350, 15351, 15352, 15353, 15354, 15355, 15356, 15357, 15358, 15359, 15360, 15361, 15362, 15363, 15364, 15365, 15366, 15367, 15368, 15369, 15370, 15371, 15372, 15373, 15374, 15375, 15376, 15377, 15378, 15379, 15380, 15381, 15382, 15383, 15384, 15385, 15386, 15387, 15388, 15389, 15390, 15391, 15392, 15393, 15394, 15395, 15396, 15397, 15398, 15399, 15400, 15401, 15402, 15403, 15404, 15405, 15406, 15407, 15408, 15422, 15423, 15424, 15425, 15426, 15427, 15428, 15429, 15430, 15431, 15432, 15433, 15434, 15435, 15436, 15437, 15438, 15439, 15440, 15441, 15442, 15443, 15444, 15445, 15446, 15447, 15448, 15449, 15450, 15451, 15452, 15453, 15454, 15455, 15456, 15457, 15458, 15459, 15460, 15461, 15462, 15463, 15464, 15465, 15466, 15467, 15468, 15469, 15470, 15471, 15485, 15486, 15487, 15488, 15489, 15490, 15491, 15492, 15493, 15494, 15495, 15496, 15497, 15498, 15499, 15500, 15501, 15502, 15503, 15504, 15505, 15506, 15507, 15517, 15518, 15519, 15520, 15521, 15522, 15523, 15524, 15525, 15526, 15527, 15528, 15529, 15530, 15531, 15532, 15533, 15534, 15535, 15536, 15537, 15538, 15539, 15540, 15541, 15542, 15543, 15544, 15545, 15546, 15547, 15548, 15549, 15550, 15551, 15552, 15553, 15554, 15555, 15556, 15557, 15558, 15559, 15560, 15561, 15562, 15563, 15564, 15565, 15566, 15567, 15568, 15569, 15570, 15571, 15572, 15573, 15574, 15575, 15576, 15577, 15578, 15579, 15580, 15581, 15582, 15583, 15584, 15585, 15586, 15587, 15588, 15589, 15590, 15591, 15592, 15593 }; #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", "EQUALS_GREATER", "LESS_EQUALS", "GREATER_EQUALS", "NOT_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", "ATTACH", "ATTRIBUTE", "AUTHORIZATION", "BACKWARD", "BEFORE", "BEGIN_P", "BETWEEN", "BIGINT", "BINARY", "BIT", "BOOLEAN_P", "BOTH", "BY", "CACHE", "CALL", "CALLED", "CASCADE", "CASCADED", "CASE", "CAST", "CATALOG_P", "CHAIN", "CHAR_P", "CHARACTER", "CHARACTERISTICS", "CHECK", "CHECKPOINT", "CLASS", "CLOSE", "CLUSTER", "COALESCE", "COLLATE", "COLLATION", "COLUMN", "COLUMNS", "COMMENT", "COMMENTS", "COMMIT", "COMMITTED", "CONCURRENTLY", "CONFIGURATION", "CONFLICT", "CONNECTION", "CONSTRAINT", "CONSTRAINTS", "CONTENT_P", "CONTINUE_P", "CONVERSION_P", "COPY", "COST", "CREATE", "CROSS", "CSV", "CUBE", "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", "DEPENDS", "DESC", "DETACH", "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", "GENERATED", "GLOBAL", "GRANT", "GRANTED", "GREATEST", "GROUP_P", "GROUPING", "GROUPS", "HANDLER", "HAVING", "HEADER_P", "HOLD", "HOUR_P", "IDENTITY_P", "IF_P", "ILIKE", "IMMEDIATE", "IMMUTABLE", "IMPLICIT_P", "IMPORT_P", "IN_P", "INCLUDE", "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", "LEADING", "LEAKPROOF", "LEAST", "LEFT", "LEVEL", "LIKE", "LIMIT", "LISTEN", "LOAD", "LOCAL", "LOCALTIME", "LOCALTIMESTAMP", "LOCATION", "LOCK_P", "LOCKED", "LOGGED", "MAPPING", "MATCH", "MATERIALIZED", "MAXVALUE", "METHOD", "MINUTE_P", "MINVALUE", "MODE", "MONTH_P", "MOVE", "NAME_P", "NAMES", "NATIONAL", "NATURAL", "NCHAR", "NEW", "NEXT", "NO", "NONE", "NOT", "NOTHING", "NOTIFY", "NOTNULL", "NOWAIT", "NULL_P", "NULLIF", "NULLS_P", "NUMERIC", "OBJECT_P", "OF", "OFF", "OFFSET", "OIDS", "OLD", "ON", "ONLY", "OPERATOR", "OPTION", "OPTIONS", "OR", "ORDER", "ORDINALITY", "OTHERS", "OUT_P", "OUTER_P", "OVER", "OVERLAPS", "OVERLAY", "OVERRIDING", "OWNED", "OWNER", "PARALLEL", "PARSER", "PARTIAL", "PARTITION", "PASSING", "PASSWORD", "PGPOOL", "PLACING", "PLANS", "POLICY", "POSITION", "PRECEDING", "PRECISION", "PRESERVE", "PREPARE", "PREPARED", "PRIMARY", "PRIOR", "PRIVILEGES", "PROCEDURAL", "PROCEDURE", "PROCEDURES", "PROGRAM", "PUBLICATION", "QUOTE", "RANGE", "READ", "REAL", "REASSIGN", "RECHECK", "RECURSIVE", "REF", "REFERENCES", "REFERENCING", "REFRESH", "REINDEX", "RELATIVE_P", "RELEASE", "RENAME", "REPEATABLE", "REPLACE", "REPLICA", "RESET", "RESTART", "RESTRICT", "RETURNING", "RETURNS", "REVOKE", "RIGHT", "ROLE", "ROLLBACK", "ROLLUP", "ROUTINE", "ROUTINES", "ROW", "ROWS", "RULE", "SAVEPOINT", "SCHEMA", "SCHEMAS", "SCROLL", "SEARCH", "SECOND_P", "SECURITY", "SELECT", "SEQUENCE", "SEQUENCES", "SERIALIZABLE", "SERVER", "SESSION", "SESSION_USER", "SET", "SETS", "SETOF", "SHARE", "SHOW", "SIMILAR", "SIMPLE", "SKIP", "SMALLINT", "SNAPSHOT", "SOME", "SQL_P", "STABLE", "STANDALONE_P", "START", "STATEMENT", "STATISTICS", "STDIN", "STDOUT", "STORAGE", "STORED", "STRICT_P", "STRIP_P", "SUBSCRIPTION", "SUBSTRING", "SUPPORT", "SYMMETRIC", "SYSID", "SYSTEM_P", "TABLE", "TABLES", "TABLESAMPLE", "TABLESPACE", "TEMP", "TEMPLATE", "TEMPORARY", "TEXT_P", "THEN", "TIES", "TIME", "TIMESTAMP", "TO", "TRAILING", "TRANSACTION", "TRANSFORM", "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", "XMLNAMESPACES", "XMLPARSE", "XMLPI", "XMLROOT", "XMLSERIALIZE", "XMLTABLE", "YEAR_P", "YES_P", "ZONE", "NOT_LA", "NULLS_LA", "WITH_LA", "'<'", "'>'", "'='", "POSTFIXOP", "'+'", "'-'", "'*'", "'/'", "'%'", "'^'", "UMINUS", "'['", "']'", "'('", "')'", "'.'", "';'", "','", "':'", "$accept", "stmtblock", "stmtmulti", "stmt", "CallStmt", "CreateRoleStmt", "opt_with", "OptRoleList", "AlterOptRoleList", "AlterOptRoleElem", "CreateOptRoleElem", "CreateUserStmt", "AlterRoleStmt", "opt_in_database", "AlterRoleSetStmt", "DropRoleStmt", "CreateGroupStmt", "AlterGroupStmt", "add_drop", "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", "reset_rest", "generic_reset", "SetResetClause", "FunctionSetResetClause", "VariableShowStmt", "ConstraintsSetStmt", "constraints_set_list", "constraints_set_mode", "CheckPointStmt", "DiscardStmt", "AlterTableStmt", "alter_table_cmds", "partition_cmd", "index_partition_cmd", "alter_table_cmd", "alter_column_default", "opt_drop_behavior", "opt_collate_clause", "alter_using", "replica_identity", "reloptions", "opt_reloptions", "reloption_list", "reloption_elem", "alter_identity_column_option_list", "alter_identity_column_option", "PartitionBoundSpec", "hash_partbound_elem", "hash_partbound", "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", "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", "generated_when", "ConstraintAttr", "TableLikeClause", "TableLikeOptionList", "TableLikeOption", "TableConstraint", "ConstraintElem", "opt_no_inherit", "opt_column_list", "columnList", "columnElem", "opt_c_include", "key_match", "ExclusionConstraintList", "ExclusionConstraintElem", "ExclusionWhereClause", "key_actions", "key_update", "key_delete", "key_action", "OptInherit", "OptPartitionSpec", "PartitionSpec", "part_strategy", "part_params", "part_elem", "table_access_method_clause", "OptWith", "OnCommitOption", "OptTableSpace", "OptConsTableSpace", "ExistingIndex", "CreateStatsStmt", "CreateAsStmt", "create_as_target", "opt_with_data", "CreateMatViewStmt", "create_mv_target", "OptNoLog", "RefreshMatViewStmt", "CreateSeqStmt", "AlterSeqStmt", "OptSeqOptList", "OptParenthesizedSeqOptList", "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", "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", "AlterForeignServerStmt", "CreateForeignTableStmt", "AlterForeignTableStmt", "ImportForeignSchemaStmt", "import_qualification_type", "import_qualification", "CreateUserMappingStmt", "auth_ident", "DropUserMappingStmt", "AlterUserMappingStmt", "CreatePolicyStmt", "AlterPolicyStmt", "RowSecurityOptionalExpr", "RowSecurityOptionalWithCheck", "RowSecurityDefaultToRole", "RowSecurityOptionalToRole", "RowSecurityDefaultPermissive", "RowSecurityDefaultForCmd", "row_security_cmd", "CreateAmStmt", "am_type", "CreateTrigStmt", "TriggerActionTime", "TriggerEvents", "TriggerOneEvent", "TriggerReferencing", "TriggerTransitions", "TriggerTransition", "TransitionOldOrNew", "TransitionRowOrTable", "TransitionRelName", "TriggerForSpec", "TriggerForOptEach", "TriggerForType", "TriggerWhen", "FUNCTION_or_PROCEDURE", "TriggerFuncArgs", "TriggerFuncArg", "OptConstrFromTable", "ConstraintAttributeSpec", "ConstraintAttributeElem", "CreateEventTrigStmt", "event_trigger_when_list", "event_trigger_when_item", "event_trigger_value_list", "AlterEventTrigStmt", "enable_trigger", "CreateAssertionStmt", "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", "drop_type_name", "drop_type_name_on_any_name", "any_name_list", "any_name", "attrs", "type_name_list", "TruncateStmt", "opt_restart_seqs", "CommentStmt", "comment_type_any_name", "comment_type_name", "comment_text", "SecLabelStmt", "opt_provider", "security_label_type_any_name", "security_label_type_name", "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", "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_include", "index_including_params", "opt_collate", "opt_class", "opt_asc_desc", "opt_nulls_order", "CreateFunctionStmt", "opt_or_replace", "func_args", "func_args_list", "function_with_argtypes_list", "function_with_argtypes", "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", "aggregate_with_argtypes", "aggregate_with_argtypes_list", "createfunc_opt_list", "common_func_opt_item", "createfunc_opt_item", "func_as", "transform_type_list", "opt_definition", "table_func_column", "table_func_column_list", "AlterFunctionStmt", "alterfunc_opt_list", "opt_restrict", "RemoveFuncStmt", "RemoveAggrStmt", "RemoveOperStmt", "oper_argtypes", "any_operator", "operator_with_argtypes_list", "operator_with_argtypes", "DoStmt", "dostmt_opt_list", "dostmt_opt_item", "CreateCastStmt", "cast_context", "DropCastStmt", "opt_if_exists", "CreateTransformStmt", "transform_element_list", "DropTransformStmt", "ReindexStmt", "reindex_target_type", "reindex_target_multitable", "reindex_option_list", "reindex_option_elem", "AlterTblSpcStmt", "RenameStmt", "opt_column", "opt_set_data", "AlterObjectDependsStmt", "AlterObjectSchemaStmt", "AlterOperatorStmt", "operator_def_list", "operator_def_elem", "operator_def_arg", "AlterOwnerStmt", "CreatePublicationStmt", "opt_publication_for_tables", "publication_for_tables", "AlterPublicationStmt", "CreateSubscriptionStmt", "publication_name_list", "publication_name_item", "AlterSubscriptionStmt", "DropSubscriptionStmt", "RuleStmt", "RuleActionList", "RuleActionMulti", "RuleActionStmt", "RuleActionStmtOrEmpty", "event", "opt_instead", "NotifyStmt", "notify_payload", "ListenStmt", "UnlistenStmt", "TransactionStmt", "opt_transaction", "transaction_mode_item", "transaction_mode_list", "transaction_mode_list_or_empty", "opt_transaction_chain", "ViewStmt", "opt_check_option", "LoadStmt", "CreatedbStmt", "createdb_opt_list", "createdb_opt_items", "createdb_opt_item", "createdb_opt_name", "opt_equal", "AlterDatabaseStmt", "AlterDatabaseSetStmt", "DropdbStmt", "AlterCollationStmt", "AlterSystemStmt", "CreateDomainStmt", "AlterDomainStmt", "opt_as", "AlterTSDictionaryStmt", "AlterTSConfigurationStmt", "any_with", "CreateConversionStmt", "ClusterStmt", "cluster_index_specification", "VacuumStmt", "AnalyzeStmt", "vac_analyze_option_list", "analyze_keyword", "vac_analyze_option_elem", "vac_analyze_option_name", "vac_analyze_option_arg", "opt_analyze", "opt_verbose", "opt_full", "opt_freeze", "opt_name_list", "vacuum_relation", "vacuum_relation_list", "opt_vacuum_relation_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", "InsertStmtShort", "insert_target", "insert_rest", "override_kind", "insert_column_list", "insert_column_item", "opt_on_conflict", "opt_conf_expr", "returning_clause", "DeleteStmt", "using_clause", "LockStmt", "opt_lock", "lock_type", "opt_nowait", "opt_nowait_or_skip", "UpdateStmt", "UpdateStmtShort", "set_clause_list", "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_materialized", "opt_with_clause", "into_clause", "OptTempTableName", "opt_table", "all_or_distinct", "distinct_clause", "opt_all_clause", "opt_sort_clause", "sort_clause", "sortby_list", "sortby", "select_limit", "opt_select_limit", "limit_clause", "offset_clause", "select_limit_value", "select_offset_value", "select_fetch_first_value", "I_or_F_const", "row_or_rows", "first_or_next", "group_clause", "group_by_list", "group_by_item", "empty_grouping_set", "rollup_clause", "cube_clause", "grouping_sets_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", "tablesample_clause", "opt_repeatable_clause", "func_table", "rowsfrom_item", "rowsfrom_list", "opt_col_def_list", "opt_ordinality", "where_clause", "where_or_current_clause", "OptTableFuncElementList", "TableFuncElementList", "TableFuncElement", "xmltable", "xmltable_column_list", "xmltable_column_el", "xmltable_column_option_list", "xmltable_column_option_el", "xml_namespace_list", "xml_namespace_el", "Typename", "opt_array_bounds", "SimpleTypename", "ConstTypename", "GenericType", "opt_type_modifiers", "Numeric", "opt_float", "Bit", "ConstBit", "BitWithLength", "BitWithoutLength", "Character", "ConstCharacter", "CharacterWithLength", "CharacterWithoutLength", "character", "opt_varying", "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", "xml_passing_mech", "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", "opt_window_exclusion_clause", "row", "explicit_row", "implicit_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", "opt_slice_bound", "indirection", "opt_indirection", "opt_asymmetric", "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", "SignedIconst", "RoleId", "RoleSpec", "role_list", "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, 678, 679, 680, 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, 691, 692, 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, 703, 704, 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, 715, 716, 717, 718, 60, 62, 61, 719, 43, 45, 42, 47, 37, 94, 720, 91, 93, 40, 41, 46, 59, 44, 58 }; # endif #define YYPACT_NINF -4710 #define yypact_value_is_default(Yystate) \ (!!((Yystate) == (-4710))) #define YYTABLE_NINF -2637 #define yytable_value_is_error(Yytable_value) \ (!!((Yytable_value) == (-2637))) /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing STATE-NUM. */ static const int yypact[] = { 5509, 1326, 13151, -4710, -4710, 1326, 61009, -4710, 68795, 29, 202, 1112, 204, 17131, 69253, 77039, 548, 1035, 17829, 1326, 77039, 2136, 52307, 66047, 915, 77039, 1429, 896, 52307, 77039, 1815, 77497, 1195, 1331, 759, 77955, 69711, 64673, 1177, 77039, 1495, 1008, 78413, 70169, 1492, 70627, 896, 48671, 149, 1523, 78871, 77039, 2505, 1721, 1447, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, 1192, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, 1648, -4710, 1150, 2866, 1408, 384, 1543, -4710, -4710, 1937, 61009, 77039, 77039, 77039, 1771, 77039, 1685, 77039, 771, 61009, 56887, 71085, 1910, 1776, 45001, 79329, -4710, 61009, 77039, 55055, 61009, 77039, 77039, 79787, 77039, 77039, 77039, 1615, 67421, 77039, 1877, 77039, 77039, 55513, 80245, 2071, 1321, 258, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, 1845, 1769, -4710, 262, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, 77039, 17945, 1429, 1937, -4710, 2505, 77039, 2087, 77039, 1853, 80703, 1951, 77039, -4710, 77039, 1956, 81161, 819, 2107, 56887, 2122, 45460, 2037, 77039, 77039, 56887, 81619, 82077, 82535, 77039, 77039, -4710, -4710, 2022, 77039, 77039, -4710, 2139, 57345, 1777, 2147, 2301, 2211, 781, -4710, 71543, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, 60093, 1035, -4710, -4710, 2177, 61467, 2246, -4710, -4710, 82993, 99411, 2029, -4710, 831, 61925, 57803, 2366, 2041, 45919, 2431, -4710, 62383, -4710, 58261, 62841, -4710, -4710, -4710, -4710, -4710, 83451, -4710, 83909, 2145, 2246, -4710, 99855, 58719, -4710, 2292, 84367, 84825, 85283, 1937, 2052, 1794, 1132, 40846, -4710, -4710, -4710, 29, -4710, -4710, -4710, -4710, -4710, -4710, -4710, 808, -4710, 331, 285, 277, 206, 302, -4710, -4710, 219, 223, 237, 331, 2530, 2530, -4710, 77039, -4710, -4710, 285, 73, 2091, 2091, 2091, 2300, 22, -4710, 2091, 2230, -4710, -4710, -4710, -4710, 70627, -4710, 2098, 72001, 77039, 72459, 1429, 2118, 2522, 2175, -4710, -4710, -4710, -4710, -4710, 2202, 2500, 2500, 77039, -4710, -4710, 2555, 2182, 2442, 2186, -4710, -4710, -4710, 2394, 2403, 2411, 122, 1429, 280, -4710, 2534, -4710, 2429, 27707, 27707, 1429, 72917, 85741, 234, 60093, 1429, 73375, 2275, 1244, 2482, -4710, -4710, -4710, 117, -4710, 2656, 2298, 2562, 2186, 1321, 42228, -4710, 2311, 1769, 70627, -4710, -4710, -4710, 59177, 2630, 29607, 77039, 2317, -4710, 2320, 2317, 2326, 2327, 1408, -4710, 5509, 59177, 77039, 1379, 1379, 2760, 1379, 1962, 2000, -4710, 2973, -4710, 2668, 2640, 70627, 2391, 318, -4710, 1669, 2416, 1644, 2443, 1706, 2894, -4710, -4710, 765, 77039, 453, 2457, 73833, 6940, 2432, 1769, 2440, -4710, -4710, -4710, 2597, 996, -4710, -4710, -4710, -4710, 2739, 2792, 5733, 326, 74291, -4710, -4710, -4710, -4710, 77039, 77039, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, 2484, 145, -4710, -4710, 2499, 2838, 2723, 9846, 839, 2807, 2675, 1753, 11929, 2732, 1613, 2860, 11346, 1548, 1714, 1413, 72001, 77039, 2846, 2879, 7179, 1802, 864, 2768, 1093, 2807, 2883, 2724, 1753, 2906, 6677, 77039, -4710, 2836, 2947, 118, -4710, 180, -4710, 22567, 29607, 48213, -4710, 1769, 2642, 2800, 79, 2835, 61009, 2607, -4710, -4710, 77039, -4710, -4710,100299, 2676, -4710, 876, 61009, -4710, 2825, 2662, 46378, 77039, 61009, -4710, -4710, 61009, 77039, -4710, -4710, -4710, -4710, -4710, -4710, -4710, 2758, 2950, 77039,100299, -4710, 2895, 77039, 77039, -4710, -4710, 2631, -4710, -4710, -4710, -4710, 2091, 77039, 3045,100299, 2858, 153, 77039, 23, 3078, 77039, 2864, 23, 2678, 86199, -4710, -4710, 23, -4710, -4710, -4710, 77039, 77039, 2646, 1941, 2855, 2969, 23, 2875, 3087, 3091, 2881, 2729, 2882, 2320, 3056, 2857, 962, 1028, 216, 1860, 23, 2707, 86657, 87115, 77039, 2710, 77039, 2500, 61009, 61009, 61009, 77039, 2988, -4710, 2843, -4710, -4710, 913, -4710, -4710, -4710, -4710, -4710, 3003, -4710, 187, 3004, 2679, 3006, -4710, -4710, -4710, 2733, -4710, 2733, 2733, 2687, 2687, 2867, 2690, 3020, -4710, -4710, -4710, 1401, 2733, 2687, -4710,101187, -4710, -4, 1384, -4710, 211, -4710, 3134, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, 2692, -4710, 889, 2048, -4710, -4710, 2727, -4710, 3026, 252, -4710, 3027, -4710, 2694, 87573, -4710, 88031, 88489, 3030, 316, -4710, 56887, 3031, 252, 3035, 2694, 3036, 252, 3038, 263, 3041, -4710, 1018, 3032, 3043, 211, 3046, 1927, 2694, 60551, 3047, 317, -4710, 3048, 337, -4710, 3053, 2932, -4710, 29607, -4710, 2816, -4710, 1523, -4710, 1333, -4710, 51391, -4710, 1132, 2996, 70627, 285, -4710, 77039, 285, 77039, 285, 77039, 285, 77039, 285, 77039, 77039, 77039, 285, -4710, -4710, -4710, 77039, 2730, 77039, 77039, -4710, -4710, -4710, 66505, 56887, 66963, -4710, 77039, -4710, 408, 1429, -4710, -4710, -4710, 1302, -4710, 2186, -4710,100299, 3169, 56887, 2500, -4710, 1745, -4710, -4710, 77039, 77039, -4710, -4710, -4710, 2983, 77039, 3050, 3051, 66505, 56887, -4710, 88947, -4710, 60093, 2942, 2737, -4710, -4710, -4710, -4710, -4710, 2072, 3210, 229, 3212, 29607, 2742, 229, 229, 2744, 3062, -4710, -4710, -4710, 265, 2747, 2749, -4710, 210, 210, -4710, 2751, 2752, -4710, 247, 2755, 2756, 3229, 3230, 278, 2759, 2761, 2763, 1401, 229, 29607, -4710, 2765, 210, 2766, 2769, 2770, 3232, 2775, -4710, 3240, 2776, 195, 242, 2777, 2779, -4710, 2751, -4710, 282, 2782, 2783, 2784, 2791, 2793, 2794, 2797, 2798, 29607, 29607, 29607, -4710, 26282, 1769, 1429, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, 291, 6438, -4710, 2837, -4710, -4710, 2995, -4710, -4710, 29607, -4710, -4710, 702, -4710, 295, -4710, -4710, -4710, 1769, 3073, 2803, -4710, -4710, 1275, 2805, -4710, 2117, -4710, -4710, -4710, -4710, -4710, -4710, 59635, 3246, -4710, 333, 1429, 180, 355, 3194, 50475, 50933, -4710, -4710, 3069, -4710, 77039, -4710, -4710, 1769, 175, 1780, -4710, -4710, 51391, -4710, -4710, 29, 16616, 1792, 2317, 77039, 77039, 3258, -4710, -4710, -4710, 1804, -4710, 2817, -4710, 2320, -4710, -4710, 1408, 1408, 29607, 1408, 1414, 1547, 28182, 30082, 3141, 3042, 1251, 259, 3143, -4710, 3049, 1962, 2000, 70627, 77039, 89405, -4710, 29607, -4710, 3245, 2904, 2911, 2966, 49587, -4710, 2913, 2885, 2920, 2977, 53223, 2845, 2924, 2929, 2984, -4710, 3104, -4710, -4710, 2933, 3002, 2935, 89863, -4710, -4710, 1111, -4710, -4710, -4710, 1111, -4710, 2869, 1210, 1119, 1215, 2939, 434, 840, 3254, -4710, 1277, -4710, -4710, 2998, -4710, 6461, 77039, 3193, 7814, 3076, 326, 3079, 3001, -4710, -4710, 3135, 2956, 77039, 2958, 3098, 326, 1426, 90321, -4710, -4710, 77039, -4710, -4710, -4710, -4710, 8080, 25393, -4710, 1862, 2961, 2940, 2976, 77039, 63757, 2130, 3075, 3093, 3099, 1377, 2138, 225, 3029, 77039, 283, 3103, 77039, 2893, 2974, 2981, 3195, 2896, 1068, 3303, 2909, -4710, -4710, -4710, -4710, 2080, 2242, 3106, -4710, 3205, 3249, 5016, 2978, 2980, 98079, -4710, 3000, 806, 46837, 77039, 77039, 3127, 3005, 3008, 90779, 8080, 3018, 3021, 3010, 3011, 28, 3304, 1526, 3015, -4710, -4710, -4710, 1526, 3147, 3019, 3023, 91237, 8080, 77039, 3024, 3025, 77039,101187, 326, -4710, 3365, 326, 326, 1572, 3366, 3028, 351, 3179, 1488, 23, 2909, 3339, -4710, 3033, 3034, 349, -4710, 3152, 3037, 3039, 3083, 1429, -4710, -4710, 3040, 3121, 3054, 810, -4710, -4710, 3044, 70627, 3150, 3157, 245, 1544, 2909, -4710, 3058, 3065, 2896, 2896, 77039, 77039, 77039, 77039, 77039, 215, 3394, 3405, 3066, 251, 3105, 2967, -4710, 1526, 55971, 3067, -4710, 1526, 77039, 3070, 1758, 2909, 1696, 1475, -4710, -4710, -4710, 1321, -4710, 29607, 29607, 29607, 2989, -4710, 1750, 16616, 644, -4710, 296, 11866, 2990, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, 77039, -4710, 77039, -4710, 3261,100299, 3204, 3265, -4710, 3052, -4710, 3267, 326, -4710, 77039, 77039, 3268, 3209, 3270, 3271, 3215, 1236,100299, 3216, 3278, -4710, 3279, 3281, 3097, 755, 3100, 3057, 3472, 3363, 77039, 53223, -4710, 3488, 1111, -4710, 100299, 3244, 3368, -4710, 77039, 3263, 70, -4710, 3403, 3101, -4710, -4710, 1003, 77039, 256, 3081, -4710, -4710, 3373, 56887, 1294, 3379, 1429, 3095, 3387, 3266, 1429, 56887, 3306, 77039, 77039, 77039, 77039, -4710, -4710, 3274, 887, 135, -4710, 55971, 3286, -4710, 77039, 3289, 3339, 3290, 3511, 89, 2091, 91695, 3389, 92153, 3072, 3080, 3080, 3517,100299, 3341, -4710, 2206, -4710, 3214, -4710, 61009, -4710, -4710, 61009, -4710, -4710,100299, 77039, -4710, 3084, -4710, -4710, 29607, -4710, -4710, -4710, 2530, -4710,100299, 2733, 2733, -4710, -4710, 3528, 3168, 3171, 2530, -4710, 2530, -4710,100299, -4710, 3094, 3107, 2530, 3170, 3172, 3178, -4710, 3115, 3183, 2530, -4710, -4710, 2250, -4710, -4710, 61009, 61009, -4710, 56887, 56887, 3447, 317, 3448, 3174, 3450, 3176, 46837, 46837, -4710, 359, 61009, -4710, 56887, 61009, -4710, 77039, -4710, 77039, -4710, -4710, -4710, -4710,100299,100299, -4710, 56887, 55971, 3452, 3453, 263, 77039, 77039, -4710, 77039, 77039, -4710, 77039, 77039, 1907, 92611, 1132, 59177, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, 77039, 3243, 77039, -4710, 77039, -4710, 77039, -4710, 77039, -4710, 77039, -4710, -4710, -4710, 77039, -4710, 77039, 1912, -4710, -4710, 1919, 1500, 77039, 77039, 801, 61009, 77039, 3340, 61009, 61009, 77039, 77039, 77039, 77039, 77039, 3208, 2805, 1431, -4710, 281, 871, 70627, 3352, -4710, -4710, 1936, 2505, 678, 77039, 1360, 2202, -4710, -4710, -4710, -4710, 66963, 66047, 3449, 140, 77039, -4710, -4710, 5286, 29607, 1769, 27232, -4710, -4710, 16616, 3177, 29607, 29607, 3137, 2530, 2530, -4710, 952, 29607, 29607, 29607, 2530, 2530, 8169, 29607, 46837, 29607, 34832, 23519, 29607, 29607, 26757, -4710, 29607, 3371, 36245, 29607, 355, 3372, 29607, 355, 8169, 3608, 3608, 1550, 6357, 3139, 1769, -4710, 2530, 250, -4710, 395,100299, 29607, 29607, 29607, 29607, 53223, 3225, 366, 77039, 29607, 3148, 2127, -4710, 29607, -4710, 3154, 29607, 3226, 1020, 29607, 29607, 29607, 29607, 29607, 29607, 29607, 29607, 29607, -4710, 37625, 417, 3457, 3478, 43, 576, 74749, 27707, 3474, 22567, -4710, 253, 3474, -4710, -4710, -4710, 77039, 3246, -4710, -4710, 3239, -4710, -4710, -4710, -4710, -4710, 299, -4710, -4710, -4710, -4710, -4710, -4710, -4710, 3160, -4710, -4710, -4710, -4710, 3160, -4710, 3164, 3463, 3467, 263, 77039, 59177, -4710, -4710, -4710, 2165, -4710, 29607, -4710, 1945, 1836, 77039, 77039, -4710, 3454, -4710, 3173, -4710, 12366, 3454, -4710, -4710, 35301, 3300, 3451, 3391, -4710, -4710, -4710, 3181, 16616, 30557, 30557, -4710, 1793, 16616, 1955, -4710, -4710, -4710, -4710, -4710, -4710, 1483, -4710, 77039, 1103, 3141, 259, 3242, -4710, 3631, 77039, -4710, 1967, -4710, 56887, 77039, 77039, 3392, -4710, 3614, -4710,101187, -4710, 3191, -4710,100743, 96733, -4710, -4710, 835, -4710, 967, 56887, -4710, 77039, 77039, -4710, 53223, 56887, 77039, 77039, -4710, 56887, 77039, 77039, -4710, -4710, -4710, -4710, -4710, 51849, 91, 66047, 3327, 65131, -4710, -4710, 3197, 77039, 3251, 3462, 3464, 651, -4710, -4710, 93069, -4710, 3419, 56887, 77039, 77039, 29607, 3421, 77039, 77039, -4710, 298, 3283, 3284, -4710, 77039, 3285, 3446, 61009, 3217, 77039, 77039, 100299, 3292, 917, 61009, 3260, 47296, 61009, 61009, 77039, 77039, 77039, 77039, 3349, 3529,100299, 77039, 3483, 1354, 70627, 407, 2109, 2909, 3440, -4710, 3552, 1481, -4710, 56887, -4710, 77039, 3432, -4710, -4710, -4710, 75207, 3659, 3343, -4710, -4710, -4710, 93527, -4710, -4710, -4710, 1982, -4710, 56887, 56887, 77039, 8528, 93985, 1273, 3468, -4710, -4710,100299, -4710, 77039, 75665, 77039, 77039, 3558, 3484, 77039, 67879, 94443, 94901, 715, 1216, 3498, 77039, 68337, 3500, -4710, 3384, 77039, -4710, -4710, 53681, 56887, 77039, 232, 53223, -4710, -4710, 77039, -4710, 305, -4710, 77039, 9138, -4710, -4710, 3328, 3338, 77039, 3456, 426, 2161, 2909, 77039, 77039, 3248, 1984, 56887, 77039, 53223, -4710, 3459, 111, 3582, 56887, 77039, 75207, -4710, 70627, 70627, 56887, 77039, 70627, -4710, 77039, 85741, -4710, 56887, 1083, -4710, 3583, 56887, 77039, 75207, -4710, 3410, 56887, 77039, 11354, -4710, -4710, -4710, 326, -4710, -4710, -4710, -4710, -4710, 77039, 77039, 326, 77039, 77039, 326, 1436, -4710, 56887, 77039, -4710, -4710, -4710, 56887, 77039, 77039, -4710, 56887, 3081, 77039, 53223, -4710, 77039, 7970, 77039, 77039, 77039, 77039, 77039, 77039, 56887, 77039, -4710, -4710, 1114, 1300, 1435, 1538, 238, 77039, 3554, 77039, 95359, 56887, 77039, 77039, 1429, 77039, 391, -4710, -4710, 3382, -4710, 56887, 1083, -4710, 9039, 77039, 77039, 3342, 3344, 220, 3425, -4710, -4710, -4710, 799, 799, 3479, -4710, 29607, 29607, 28657, 3277, -4710, -4710, 29607, -4710, -4710, -4710, 922, 3703, 95817, 922, -4710, 922, 3530, 3322, 3335, 922, 77039, 922, 922, 77039, -4710, -4710, -4710, -4710, 3542, 77039, 922, 922, 922, 3460, -4710, -4710, 3460, 740, 29607,100299, 77039, -4710, 1989, -4710, 3293, 887, -4710, -4710, 53223, 77039, 358, 151, 3615, 3496, 64215, 2441, 3604, 77039, 3332, 77039, 3732, 3383, 70627, 2646, -4710, 2441, 77039, -4710, 2180, 66047, -4710, -4710, -4710, -4710, -4710, -4710, -4710, 77039, -4710, -4710, 3609, 77039, 29607, 3465, -4710, 1429, 2646, 2646, 2646, 2646, -4710, -4710, -4710, -4710, 3507, 2003, -4710, 3295, 2646, 77039, 3423, 3627, 2441, 3301, 3633, -4710, 3339, 3635, 1144, 77039, 3518, 64215, 3362, 3345, 3533, 3749, 2091, 1429, 3537, 3523, -4710, 50031, -4710, 2646, 25837, 6594, 7222, 3524, 3579, 60093, 3617, 3618, 3639, -4710, 187, -4710, 3764, -4710, 29607, 1995, 3325, 211, -4710, -4710, 3337, 3107, 3350, 3353, 3346, 3348, -4710, 2530, 218, 3351, 899, 734, 3466, 2530, 3573, 3354, -4710, 252, -4710, 2694, -4710, 77039, -4710, 77039, 77039, 77039, 77039, 316, -4710, -4710, 252, 2694, 252, 263, -4710, 3606, 211, 2694, 3469, 3661, 60093, -4710, 317, -4710, 337, -4710, 3553, 263, -4710, 3574, 2091, -4710, -4710, 1441, 42688, -4710, -4710, -4710, -4710, -4710, -4710, 2001, -4710, 77039, -4710, 3640, 3644, 3646, 3647, 3648, 3355, 3356, 3395, 77039, 3357, 3355, 326, 3357, 3357, 3355, 2805, 2805, 3355, 3356, 56429, 3817, 3671, -4710, 3444, 3367, 3683, 226, -4710, 228, 78, 3607, -4710, -4710, -4710, -4710,100299, -4710, 56887, 3408, 2500, 2500, -4710, 294, 3584, 3370, 56429, 3799, 263, -4710, 61009, -4710, -4710,100299, 3455, 3470, 61009, 3592, 3424, 61009, -4710, -4710, 61009, -4710, -4710, -4710, -4710, -4710,100299, -4710, 3650, 77039, 77039, 2002, -4710, -4710, 1834, -4710, 1835, 29607, 442, -4710, 13176, 2007, 29607, 3381, 3385, -4710, -4710, -4710, -4710, -4710, -4710, -4710, 3388, 3698, -4710, 2015, 2062, 2063, 3393, 3396, 5772, 3397, 13960, 3398, 3390, 34832, 34832, 26282, 2574, -4710, 34832, 3399, 3581, 2083, 7443, 3400, 3401, 13835, 29132, 29607, 29132, 29132, 14996, 3400, 3402, 2103, 53223, 3588, 15362, 2144, -4710, 29607, 53223, 5888, 29607, -4710, 29607, 3404, -4710, -4710, 3247, 3247, 3247, 8169, -4710, 3409, -4710, 34832, 34832, -4710, 3593, 26282, -4710, -4710, 3710, -4710, -4710, 2236, -4710, 3406, -4710, -4710, 3778, 46837, 12072, 29607, 370, 29607, 3148, 29607, 3486, 3247, 3247, 3247, 397, 397, 323, 323, 323, 422, 576, -4710, -4710, -4710, 3411, 3414, 3417, 3616, 3418, 29607, -4710, 2167, 2395, 77039, 2975, 3872, 5524, -4710, -4710, -4710, 38546, 3473, 644, 3473, -4710, 1321, 2530, 250, 51391, -4710, -4710, -4710, -4710, -4710, -4710, -4710, 77039, 16616, -4710, -4710, 3649, 3420, -4710, -4710, 29607, -4710, -4710, 1833, 3438, 643, 3632, 2316, 2316, 1793, 3634, -4710, -4710, 3482, -4710, 29607, 2004, -4710, 2065, -4710, -4710, -4710, -4710, 2805, -4710, 3654, -4710, -4710, -4710, 38546, 3475, 77039, -4710, -4710, -4710, -4710, -4710, -4710, 96733, 2048, -4710, 100743, -4710,100743, -4710, 2048, 3850, -4710, 96733, 1757, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, 56887, 56887, 3636, 77039, 3637, 3638, 29607, 951, 77039, 3429, 3434, 1416, 3722, 77039, -4710, 3768, 263, -4710, -4710, 3521, -4710, 16616, -4710, -4710, -4710, -4710, -4710, 56887, 77039, -4710, 60093, -4710, 77039, -4710,100299, -4710, -4710, -4710, 77039, 3471, 77039, -4710, 77039, 77039, 77039, -4710, -4710, -4710, -4710, -4710, -4710, -4710, 1349,100299, -4710, -4710, 77039, 77039, 723, 3522, 3526, 77039, -4710, 1155, 3152, 9655, 77039, 77039, 77039, 3717, 77039, -4710, -4710, -4710, -4710, 3662, -4710, -4710, 96733, -4710, 2694, 1299, 3534, 2909, 3672, -4710, 3781, 3655, -4710, 3576, 1094, -4710, -4710, 77039, 3585, -4710, -4710, -4710, -4710, 3785, 263, 3789, 263, 77039, 77039, 77039, 77039, 3589, -4710, -4710, -4710, -4710, 3590, 3714, -4710, 53223, 53223, 53223, 2146, -4710, -4710, 1429, -4710, -4710, -4710, -4710, -4710, -4710, 3751, -4710, 2148, -4710, -5, -4710, -4710, -4710, -4710, -4710, 56887, 77039, 9911, 3792, 77039, 77039, 77039, 1774, -4710, 875, 100299, -4710, 98523, -4710, -4710, 2154, -4710, 3477, 77039, 3547, 56887, 3525, 77039, -4710, -4710, -4710, 3480, 3480, -4710, -4710, 3480, -4710, -4710, -4710, 3723, 3656, -4710, 975, 3663, 56887, 3532, -4710, 77039, -4710, -4710, -4710, 3564, -4710, -4710, 3566, 2260, 2909, 3339, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, 1444, -4710, -4710, 1358, 343, 2279, 2909, -4710, 1650, -4710, 3569, -4710, 3570, -4710, -4710, -4710, 3721, 3734, 3736, 3575, 3577, 3630, 3578, 3586, 3641, -4710, 3591, 3642, 3594, 3643, 3708, 3595, 263,100299, 3725, 1429, 3624, 3806, 263, -4710, 3597, -4710, 3598, -4710, 3946, -4710, 77039, -4710, 3599, 2427, 2909, -4710, -4710, 56887, 77039, -4710, -4710, -4710, 29607, 3512, 3513, 3520, 16616, 16616, 29607, -4710, -4710, 16616, 3531, -4710, -4710, -4710, 100299, 77039, 3790, -4710, -4710, 922, 77039, 77039, -4710, 3795, -4710, -4710, 3796, 77039, 3797, -4710, -4710, -4710, -4710, 260, 260, -4710, -4710, 3826, 7117, 3536, 382, -4710, 53223, 44071, 2054, 1480, 452, 23, -4710, 60093, 77039, 60093, -4710, 151, 3655, 77039, 77039, 77039, 3539, 3538, -4710, -4710, -4710, -4710, 56887, 811, 56887, 2530, -4710, -4710, 3601, -4710, 77039, 2091, 4007, 3853, -4710, 3480, -4710, 3972, 3091, 1294, 3692, 1805, 2729, 3917, 2320, 390, 53223, 3345, -4710, -4710, -4710, -4710, 77039, 77039, 887, 1429, -4710, 3545, 3543, -4710, 77039, 3868, 77039, 77039, 77039, 77039, 3408, 3555, 77039, 3551,100299, 77039, 2381, 2896, 3998, 3888, 2505, 3362, 3657, 3890, 70627, 3571, 2159, -4710, -4710, -4710, 2181, 272, -4710, 1429, 60093, 97635, 3880, -4710, 7222, -4710, -4710, 7222, 1131, 77039, 3864, -4710, -4710, 2505, -4710,100299, 2192, -4710, -4710, -4710, 2530, -4710, -4710, 1186, 1186, 3580, -4710, 3596, -4710, -4710, -4710, -4710, -4710, -4710, -4710, 3562, -4710, -4710, -4710, 317, 3621, 263, 3626, 263, -4710, -4710, -4710, -4710, 77039, -4710, 77039, 55971, 263, -4710, -4710, 77039, -4710, 3899, 3651, 686, 41767, 3784, -4710, 77039, 406, -4710, 3605, -4710, -4710, -4710, 3715, 3729, 3735, 3738, 3740, 77039, 3355, -4710, 3610, 56887, 1531, -4710, -4710, 3786, -4710, -4710, 70627, 3713, -4710, -4710, -4710, -4710, 3942, 3948, -4710, -4710, -4710, 999, -4710, 77039, 77039, 56887, 66505, 368, 56887, -4710, 3881, 3886, -4710, -4710, 3887, 326, -4710, 3889, 3895, 3896, -4710, 3901, 3904, -4710, -4710, -4710, 3645, 15747, 29607, -4710, 3977,100299, -4710, 7170, -4710, -4710, -4710, 29607, -4710, -4710, -4710, -4710, -4710, 29607, -4710, 29607, 3953, -4710, 23995, 4106, 4106, 3652,100299, 34832, 34832, 34832, 34832, 1662, 2766, 34832, 34832, 34832, 34832, 34832, 34832, 34832, 34832, 34832, 35776, 593, -4710, 3837, 29607, 29607, 3963, 3953, -4710,100299, 3653, 3400, 3658, 3664, 29607, -4710, -4710, 2203, 36705, 3665, 53223, -4710, 29607, 12636, 2208, 3690, 16482, 1769, 7662, 1429, 29607, 2628, 2912, 29607, 2210, 29607, 3961, -4710, -4710, -4710, 3660, -4710, -4710,100299, 29607, 3667, 4253, 34832, 34832, 4559, -4710, 4636, 29607, 26282, -4710, 3479, 3691, 43148, -4710, 24471, 3668, 896, 896, 896, 896, -4710, 77039, 77039, 77039, 39006, 3964, 3675, 38085, 76123, 3674, 2743, -4710, 76123, 76581, 76123, -4710, 3669, -4710, 1769, 29607, 3958, 3670, 3958, 180, 3678, -4710, -4710, -4710, -4710, 2505, -4710, 3676, -4710, 3438, 1365, -4710, -4710, -4710, 3865, -4710, -4710, -4710, -4710, 3674, 31032, 3803, -4710, 2212, 1788, -4710, -4710, 96733, -4710, 3731, 2694, 2694, 1343, 3355, 4000, 1343, 7850, -4710, -4710, 39466, 77039, 77039, -4710, 77039, 2233, 1497, 77039, -4710, 77039, -4710, -4710, -4710, -4710, 4124, -4710, 77039, -4710, -4710, 3739, 3741, 77039, 77039, 77039, 77039, 3950, -4710, -4710, 2443, -4710, -4710, 56887, 77039, -4710, -4710, -4710, 436, 2643, 2909, -4710, 3763, -4710, -4710, -4710, 3967, -4710, 4110, 3780, 77039, 4026, 77039, 3696, -4710, 1497, 3801, 4009, 1303, 2896, 351, 3916, -4710, 1708, -4710, -4710, 3769, -4710, -4710, 77039, -4710, 77039, -4710, -4710, -4710, -4710, -4710, -4710, -4710, 3829, -4710, -4710, -4710, -4710, 53681, -4710, -4710, 77039, -4710, 53223, 44071, 53223, -4710, 1409, 449, 2728, 2909, 77039, -4710, 3782, -4710, 3783, 3794, 3835, 1295, 1296, 3798, 3800, 3838, 3705, 3712, 3716, -4710, 53223, 44542, 3869, 77039, 2694, 3718, 3757, -4710, 331, 1429, -4710, -4710, 1429, 2694, 1429, -4710, 77039, 77039, 77039, 53223, -4710, 4146, 3812, 77039, 77039, 77039, 77039, -4710, 3775, -4710, 77039, 77039, 4048, 1113, 1980, 56887, 77039, 77039, 56887, 77039, 77039, 77039, 77039, 77039, 77039, 4059, 77039, -4710, 4136, 4063, 1887, 4105, 3804, 77039, -4710, 77039, 1429, 3152, 77039, 77039, -4710, -4710, -4710, -4710, -4710, 3479, -4710, 3733, 4004, 922, -4710, 4006, 4008, 922, 922, 4011, 922, -4710, -4710, 23, -4710, 224, 77039, -4710, 2400, 77039, -4710, -4710, -4710, 3676, 2080, 2242, -4710, -4710, -4710, -4710, -4710, -4710, 77039, 3744, 77039, 77039, 34832, -4710, 1718, 1419, 284, -4710, 4003, 77039, 3081, -4710, -4710, -4710, 227, 77039, -4710, -4710, -4710, -4710, -4710, 100, 3555, -4710, 4024, 64215, 2694, 56887, 56887, 2694, -4710,100299, 3745, 3345, -4710, 454, 3827, 56887, 1294, 1100, 96275, 3095, 3787, 3955, 38546, 1444, -4710, 3746, 3907, -4710, 3750, 3748, -4710, -4710, 77039, 3655, 55971, 2237, 3339, 4195, 115, 2052, -4710, 65589, 3945, 3555, 4024, -4710, 2896, 3968, 3969, -4710, 2505, 77039, 3408, 3345, 1429, 77039, 3251, 44071, -4710, 4237, -4710, 96733, 29607, 29607, -4710, 3762, -4710, 3776, 7222, -4710, 3844, 3773, -4710, -4710, -4710, -4710, -4710, 3857, 3779, 77039, -4710, 3788, -4710, 3793, -4710, -4710, -4710, -4710, -4710, -4710, 77039, -4710, 77039, -4710, 263, -4710, 3903, -4710, 263, 77039, -4710, -4710, -4710, 3833, 2239, -4710, -4710, 4178, 3803, -4710, 2244, 42688, 3475, 29607, 1769, 77039, 77039, 77039, 77039, 77039, 3355, 326, -4710, 4093, 56429, -4710, -4710, 2245, 77039, -4710, -4710, -4710, 4158, -4710, -4710, 140, 4102, -4710, -4710, 1007, 1007, 1007, 4062, 1007, 1007, 1007, 1007, 1007, -4710, 29607, 16616, -4710, 3802, -4710, 16616, 8210, 16616, 3963, -4710, 2253, 29607, -4710, 2689, 2689, 2689, 2585, 4111, -4710, 1592, 3805, 2689, 2689, 2689, 412, 412, 306, 306, 306, 4106, 593, 16616, 16616, -4710, -4710, 3808, -4710, -4710, -4710, 3400, -4710, 31507, 1071, 4220, 36245, -4710, -4710, -4710, 3839, 3840, 3810, -4710, 29607, 31982, 3813,101187, 3994, -4710, 1701, 29607, 29607, 1182, -4710, 8904, 29607,100299, 2261, 1182, 425, 29607, 3180, 3280, 29607, 29607, 5138, 8758, 3818, 29607, 97177, -4710, -4710, -4710, 2262, 29607, 77039, 77039, 77039, 77039, -4710, -4710, -4710, 76123, 76581, 76123, 3807, 37165, 24932, 2743, 3819, 77039, -4710, -4710, 3814, 38546, 4064, 4016, -4710, 38546, 4016, 1645, 4016, 4071, 3910, 43608, -4710, -4710, 3822, -4710, 4025, -4710, 1862, 16616, 4249, 4128, 1429, 4128, 1429, 3830, 46837, -4710, -4710, -4710, -4710, 4043, 16616, 27707, -4710, -4710, 3902, 2266, -4710, -4710, -4710, -4710, -4710, -4710, -4710, 3915, 66047, 4151, -4710, 29607, 2267, -4710, 3876, 4246, 381, 2272, 2274, 1497, -4710, 4133, -4710, 1439, 4129, 200, -4710, 263, -4710,100299, -4710, 77039, 77039, -4710, -4710, -4710, -4710, 77039, 2845, -4710, -4710, 77039, 77039, 77039, 77039, -4710, 56887, 77039, -4710, 77039, -4710, 53223, 1480, 331, 1718, 4142, 4065, -4710, 326, -4710, 1718, 4067, 331, 77039, -4710, -4710, 2629, -4710, 100299, 263, 263, -4710, -4710, -4710, -4710, -4710, 3861, 4275, 3940, 77039, 77039, 77039, -4710, 77039, 56887, 77039, 77039, 2530, 2530,100299, 3849, -4710, 2530, 2530, 3852, -4710, 56887, 77039, 77039, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, 3933, -4710, 29607, 4268, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, 56887, 77039, 3941, -4710, 3943, -4710, 160, -4710, -4710, 77039, 77039, 77039, 77039, 4194, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, 77039, -4710, 77039, -4710, -4710, 1429, 1429,100299, 263, 263, -4710, -4710, -4710, -4710, 3866, 4134, 922, -4710, 922, 922, -4710, -4710, 922, -4710, 3871, -4710, 23, 4223, -4710, 1497, 1724, 4180, -4710, 4183, 29607, -4710, 1381, 2585, -4710, 4243, 4314, -4710, -4710, -4710, -4710, 3081, 2091, 3935, -4710, -4710, 61009, 379, -4710, 4170, 358, 4096, 64215, 1650, 1697, 3884, 4010, -4710, 2694, 2694, 3944, 77039, 4328, -4710, -4710, -4710, -4710, -4710, -4710, 56887, 3525, -4710, 4112, 813, 4207, 77039, 29607, 3674, -4710, 1924, 4211, -4710, 1429, -4710, -4710, 4017, 3345, -4710, 1609, 77039, 4108, 64215, 3408, 2281, -4710, -4710, -4710, 3930, 4320, 3362, -4710, 1650, 3945, -4710, -4710, 4297, 3987, 3937, 4343, -4710, 3987, 4216, 4113, 3908, -4710, 3571, -4710, -4710, 16616, 16616, 1429,101631, 7222,100299, 4222, 77039, 842, 4188, 263, -4710, 263, 263, -4710, 77039, -4710, 2505, 1938, 77039, 1769, 72, -4710, 3920, 77039, -4710, 3803, 16616, 3355, 3355, 3355, 3355, 3355, -4710, 4115, -4710, -4710, 4181, -4710, 263, 56429, -4710, -4710, -4710, -4710, -4710, 1007, -4710, -4710, -4710, -4710, -4710, 16616, -4710, -4710, -4710, -4710, 9312, 34832, 4226, -4710, 3913,100299, -4710, 3914, 2289, 2308, -4710, -4710, 1071, -4710, 4220, -4710, -4710, -4710, 9641, 3971, 16616, 4029, 3922, 3923, 1182, 1182, 8904, 2321, -4710, 1182, 29607, 29607, 1182, 1182, 29607, -4710, -4710, 9686, 4116, -4710, -4710, 9814, -4710, -4710, -4710, -4710, -4710, -4710, -4710, 54139, 3918, 3588, 76123, 3925, 77039, 2743, 38546, -4710, -4710, 2560, -4710, 38546, 4182, -4710, 38546, 61009, -4710, 77039, 3927, 77039, -4710, 32457, 29607, 3970, -4710, 3970, -4710, -4710, 3928, 77039, 2803, -4710, -4710, 56429, 4138, 56429, 1497, 10036, 4133, 39466, 47755, 77039, 77039, 77039, 4090, 4133, 3934, 3081, -4710, -4710, -4710, -4710, -4710, -4710, 3932, -4710, -4710, -4710, -4710, 4014, -4710, -4710, 33, 3352, -4710, 2331, -4710, -4710, 4378, 4269, -4710, -4710, -4710, -4710, -4710, -4710, 4136, -4710, -4710, 44071, 56887, 77039, -4710, 4018, -4710, -4710, -4710, -4710, -4710, 41307, 46837, -4710, 1295, 3947, 3949, 1296, -4710, -4710, -4710, 77039, 10113, 3951, 1026, 3352, 77039, 77039, 3952, 3956, 3959, 15, 1450, 1705, 3355, 4256, -4710, -4710, -4710, -4710, 4136, -4710, -4710, -4710, 922, -4710, -4710, -4710, -4710, 53223, -4710, 2453, 3871, 1429, 61009, 4382, 4382, 77039, -4710, 10339, 4159, -4710, -4710, 400, 3935, 4186, 4228, -4710, 3960, 77039, 227, 3962, 77039, 3965, 4069, 1778, 1778, 77039, 77039, 77039, 2333, 2505, 2694, 3757, 1294, 4281, 64215, 4325, 3655, 427, -4710, -4710, 1924, -4710, 1511, 4309, 4012, -4710, 77039, 4407, 77039, 3408, 3555, 77039, 3974, -4710, -4710, 65589, 4172, 1480,102075, 2381, 3945, 3362, 911, 77039, -4710, 1283, -4710, 2505, -4710, 77039, 70627, 39466, -4710,100743, -4710, 2337, -4710, -4710, 4038, 3473, 4079, 4085, 3976, 77039, 713, -4710, -4710, -4710, -4710, -4710, 686, -4710, -4710, 4371, 39466, 4330, 29607, -4710, -4710, -4710, 77039, -4710, 368, -4710, -4710, 3336, 34832,100299, 2339, 29607, -4710, 29607, -4710, -4710, -4710, -4710, 97, -4710, -4710, -4710, 1182, 1182, 1182, -4710, 4405, 3479, -4710, -4710, 2352, 4424, 33882, 4385, -4710, 77039, 2358, -4710, 29607, 3984, -4710, -4710, 38546, 2560, 3985, 2360, 77039, 2368,100299, 3986, 49, 3990, 23043, 3983, -4710, -4710, -4710, -4710, -4710, 16616, 16616, 77039, -4710, -4710, -4710, -4710, 1531, 1343, 368, 4246, 3081, -4710, 3991, -4710, -4710, -4710, 1407, 1407, 77039, 3081, 77039, 3935, -4710, 77039, 4080, -4710, -4710, 53223, 4290, -4710, 4050, -4710, 1027, 3352, 77039,100299, -4710, 174, 4316, -4710,100299,100299, -4710, -4710, -4710, 29607, 4083, -4710, -4710, -4710, 29607, 29607, 63299, -4710, -4710, 77039, 77039, 77039, 77039, 77039, 263, -4710, 2373, -4710, 40386, -4710, -4710, 3078, 1429, 3078, 185, -4710, -4710, 3078, 3078, -4710, 3473, -4710, 4382, 361, -4710, -4710, -4710, 2084, 4227, 4001, 29607, -4710, 932, 4212, 4091, 4013, -4710, 61009, 4477, 3555, 4024, 77039, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, 2379, 3655, 4332, 3345, 3937, -4710, 77039, 4041, -4710, 38546, -4710, -4710, -4710, 3078, -4710, 1569, 4015, 4341, 3655, 2505, 2052, -4710, 3945, 3555, 4024, -4710, -4710, -4710, 4019, -4710, 3969, 3362, 2381, 4147, -4710, 4152, -4710, 4421, 4225, 4428, 3408, -4710, 3251, 2384, -4710, -4710, 7222,101631,100299, 4368, 4058, 4070, -4710, -4710, 4077, 77039, -4710, -4710, 4088, 77039, 2385, 121, 16616, 3655, -4710, 3336, 2407, -4710, 2408, 2409, 4089, -4710, 29607, 1224, 3669, 54139, 4034, -4710, 34832, 2422, -4710, 4035, 77039, 2424, -4710, 16616, 77039, -4710, -4710, 29607, -4710, 2437, -4710, 29607, 4040, 29607, -4710, 32457, 4039, -4710, 4484, -4710, 4358, -4710, 77039, 3935, 46837, 3438, 3438, 2091, 3935, 2438, -4710, -4710, 77039, -4710, 4001, 29607, -4710, 4137, -4710, -4710, 2456, 1239, 4208, 4208, 2461, 2468, 10422, 77039, 2469, 2470, -4710, 2475, 2530, 3356, 1705, 3356, -4710, 3355, -4710, -4710, 53223, -4710, 54597, -4710, -4710, -4710, 1429, -4710, 1429, 4263, 77039, 49129, 1429, 1429, -4710, -4710, -4710, -4710, 4393, 4334, -4710, 3339, -4710, 10440, -4710, -4710, -4710, 443, -4710, 4259, 4260, 77039, -4710, 4053, -4710, 2485, 1650, 4179, 3655, -4710, -4710, 77039, 4497, 4500, -4710, 820, 77039, 3674, 77039, -4710, -4710, -4710, 29607, 227, -4710, 3937, 3408, 3362, 1650, 3945, 1480, 39926, 3987, 2381, 3969, -4710, -4710, 4264, -4710, 4265, -4710, 4068, 4351, 39466, 7222, -4710, -4710, 945, 4375, 4376, -4710, -4710, 2505, -4710, 3473, -4710, 4185, -4710, -4710, -4710, -4710, -4710, 3400, 32932, 32932, 32932, 4066, -4710, -4710, 77039, 2585, 4074, 33882, 53223, 2489, -4710, 98967, -4710, 2491, 2493, -4710, 2498, 32457, 2515, -4710, 77039, 4073, 56429, 1407, 4122, 4082, -4710, -4710, 4186, -4710, -4710, 1497, 3352, -4710, 16616, 77039, 61009, 4495, -4710, -4710, -4710, -4710, -4710, -4710, -4710, 3352, 4154, -4710, -4710, 63299, -4710, 77039, -4710, -4710, 2540, -4710, -4710, -4710, 77039, 3746, -4710, 3746, -4710, -4710, 4221, -4710, 2417, 4187, 276, 276, 4445, -4710, 4150, -4710, -4710, 4087, -4710, 4561, 4224, 77039, -4710, -4710, 1295, 2505, 64215, 3655, -4710, -4710, 10970, 61009, -4710, -4710, 2381, 3945, 3362, 29607, 2542, -4710, 4246, 381, -4710, 3969, 3987, -4710, -4710, 39466, 4099, 3345, -4710, -4710, -4710, 1933, 61009, 61009, -4710, -4710, 42688, 34357, 4239, 1152, 13687, 4435, -4710, 4435, 4435, -4710, 2549, 36245, -4710, -4710, -4710, 77039, 4304, 1089, -4710, 4257, -4710, 2589, -4710, -4710, -4710, 368, 3438, 4104, -4710, -4710, 4212, 1497, -4710, 3352, -4710, 77039, -4710, 4107, -4710, -4710, -4710, 54597, 3746, 4012, -4710, -4710, -4710, 4564, -4710, 289, -4710, -4710, -4710, -4710, 77039, 3655, 3849, 3937, -4710, -4710, 4109, 3969, 3362, 2381, 11090, -4710, 39926, 77039, 77039, 3987, -4710, 2595, 39466, 3987, -4710, 2863, -4710, -4710, -4710, -4710, -4710, -4710, -4710, 4119, 4120, 10, 4556, -4710, -4710, -4710, -4710, -4710, 897, -4710, -4710, -4710, -4710, 3588, -4710, -4710, 34832, 34832, 4333, -4710, 1089, -4710, 4114, -4710, -4710, -4710, -4710, 29607, 1497, -4710, -4710, -4710, 29607, -4710, 4444, -4710, -4710, -4710, 3655, -4710, -4710, 52765, 3987, 2381, 3969, 4246, -4710, -4710, -4710, -4710, 4351, -4710, 2600, 3473, 2398, -4710, -4710, 2430, 2327, 4196, 4430, -4710, 33407, 4262, -4710, 4319, -4710, 4522, 2585, 2585, -4710, -4710, 29607, 11272, 1497, 2602, 227, -4710, -4710, 2608, -4710, -4710, -4710, -4710, -4710, 3969, 3987, 77039, 3345, -4710, 39466, -4710, -4710, 2863, 4235, 4236, -4710, -4710, -4710, 77039, 11564, -4710, -4710, 61009, -4710, 52765, 3987, -4710, -4710, 3987, -4710, -4710, 4165, 4167, 2625, -4710, 4131, -4710, -4710, 3473, 4446, 4447, -4710, 52765, -4710, 61009, 61009, 2626, -4710, -4710, -4710 }; /* 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[] = { 1670, 1439, 622, 1520, 1519, 1439, 0, 258, 0, 1530, 0, 1439, 415, 1116, 0, 0, 0, 0, 622, 1439, 0, 1670, 0, 0, 0, 0, 0, 1683, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1439, 0, 0, 1690, 0, 0, 0, 0, 1683, 0, 1532, 0, 0, 0, 0, 0, 2, 4, 37, 72, 73, 31, 30, 91, 55, 18, 63, 125, 124, 126, 42, 38, 80, 26, 28, 39, 43, 65, 67, 45, 56, 103, 64, 24, 62, 86, 68, 89, 50, 12, 13, 51, 14, 52, 15, 53, 16, 99, 74, 92, 35, 61, 23, 44, 70, 71, 5, 46, 78, 11, 57, 58, 60, 83, 84, 85, 108, 87, 120, 41, 117, 96, 97, 114, 98, 115, 9, 100, 54, 17, 111, 110, 112, 81, 47, 82, 69, 90, 109, 27, 113, 19, 20, 22, 21, 59, 29, 66, 32, 88, 116, 106, 102, 121, 119, 127, 104, 75, 7, 8, 93, 6, 25, 49, 10, 34, 33, 48, 40, 123, 36, 1530, 95, 107, 94, 76, 101, 79, 105, 122, 77, 118, 1640, 1639, 1692, 1643, 1669, 0, 1655, 1438, 1437, 1452, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 621, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1449, 2274, 2289, 2290, 2291, 2292, 2293, 2294, 2295, 2296, 2297, 2298, 2299, 2300, 2301, 2302, 2303, 2304, 2631, 2305, 2306, 2307, 2581, 2582, 2632, 2583, 2584, 2308, 2309, 2310, 2311, 2312, 2313, 2314, 2315, 2585, 2586, 2316, 2317, 2318, 2319, 2320, 2587, 2633, 2321, 2322, 2323, 2324, 2325, 2634, 2326, 2327, 2328, 2329, 2330, 2331, 2332, 2333, 2334, 2635, 2335, 2336, 2337, 2636, 2338, 2339, 2340, 2341, 2342, 2343, 2588, 2589, 2344, 2345, 2346, 2347, 2348, 2349, 2350, 2351, 2352, 2353, 2354, 2355, 2356, 2357, 2358, 2359, 2360, 2361, 2362, 2363, 2364, 2365, 2366, 2367, 2368, 2369, 2370, 2590, 2371, 2372, 2373, 2591, 2374, 2375, 2376, 2592, 2377, 2378, 2379, 2637, 2638, 2380, 2381, 2382, 2383, 2384, 2593, 2594, 2385, 2386, 2387, 2388, 2389, 2390, 2391, 2639, 2392, 2393, 2394, 2395, 2396, 2397, 2398, 2399, 2400, 2401, 2402, 2403, 2640, 2595, 2404, 2405, 2406, 2407, 2596, 2597, 2598, 2408, 2641, 2642, 2409, 2643, 2410, 2411, 2412, 2413, 2414, 2415, 2599, 2644, 2416, 2645, 2417, 2418, 2419, 2420, 2421, 2422, 2423, 2424, 2425, 2426, 2427, 2428, 2429, 2430, 2431, 2432, 2433, 2434, 2435, 2600, 2646, 2601, 2436, 2437, 2438, 2602, 2439, 2440, 2647, 2441, 2603, 2442, 2604, 2443, 2444, 2445, 2446, 2447, 2448, 2449, 2450, 2451, 2452, 2605, 2648, 2453, 2649, 2606, 2454, 2455, 2456, 2457, 2458, 2459, 2460, 2461, 2462, 2463, 2464, 2607, 2465, 2608, 2468, 2466, 2467, 2469, 2470, 2471, 2472, 2473, 2474, 2475, 2476, 2477, 2478, 2609, 2479, 2480, 2481, 2482, 2483, 2484, 2485, 2486, 2487, 2488, 2489, 2490, 2491, 2492, 2493, 2494, 2495, 2496, 2650, 2497, 2498, 2499, 2500, 2501, 2610, 2502, 2503, 2504, 2505, 2506, 2507, 2508, 2509, 2510, 2511, 2512, 2513, 2514, 2515, 2516, 2517, 2611, 2518, 2519, 2651, 2520, 2521, 2612, 2522, 2523, 2524, 2525, 2526, 2527, 2528, 2529, 2530, 2531, 2532, 2533, 2534, 2535, 2613, 2536, 2537, 2538, 2539, 2652, 2540, 2541, 2542, 2543, 2544, 2545, 2614, 2615, 2546, 2547, 2616, 2548, 2617, 2549, 2550, 2551, 2552, 2553, 2554, 2555, 2556, 2557, 2558, 2559, 2560, 2561, 2562, 2563, 2564, 2565, 2618, 2619, 2566, 2653, 2567, 2568, 2569, 2570, 2571, 2572, 2573, 2574, 2575, 2576, 2577, 2620, 2621, 2622, 2623, 2624, 2625, 2626, 2627, 2628, 2629, 2630, 2578, 2579, 2580, 129, 0, 0, 2248, 2275, 2276, 2279, 2274, 387, 386, 1630, 2242, 2275, 1529, 1509, 622, 0, 1452, 414, 1670, 0, 0, 0, 0, 0, 0, 0, 855, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 177, 0, 0, 0, 0, 438, 437, 0, 0, 0, 1084, 443, 0, 0, 0, 0, 0, 610, 1577, 2466, 1575, 1631, 259, 262, 263, 260, 261, 2264, 0, 1218, 1219, 1221, 0, 0, 1231, 895, 896, 0, 0, 0, 904, 0, 0, 0, 893, 0, 0, 0, 909, 0, 906, 0, 0, 910, 907, 890, 908, 897, 0, 889, 0, 0, 1231, 911, 0, 0, 891, 0, 0, 0, 0, 1452, 1574, 444, 1670, 0, 1551, 1552, 1553, 1530, 1542, 1554, 1547, 1549, 1548, 1550, 1546, 0, 2263, 2290, 1019, 1019, 1019, 1019, 1016, 1017, 1019, 1019, 1019, 2486, 0, 0, 998, 0, 1000, 2265, 1019, 1024, 507, 507, 507, 0, 1023, 1028, 507, 0, 1420, 1461, 2247, 1682, 0, 999, 1419, 0, 0, 0, 2546, 1565, 0, 0, 1246, 1242, 1244, 1245, 1243, 0, 1087, 1087, 2504, 1431, 241, 2515, 2614, 2546, 240, 234, 236, 208, 2294, 0, 0, 1023, 0, 1452, 1429, 981, 1689, 1687, 0, 2229, 2314, 2329, 2419, 231, 2497, 2505, 2515, 2614, 2546, 2577, 187, 197, 192, 0, 252, 2515, 2614, 2546, 248, 1449, 0, 1656, 1791, 2238, 0, 1422, 1421, 1531, 0, 1534, 0, 2481, 1660, 1663, 1536, 1661, 1652, 0, 0, 1, 1670, 0, 1541, 1686, 1686, 0, 1686, 0, 1644, 1652, 1647, 1651, 0, 0, 0, 0, 0, 1423, 0, 0, 0, 914, 0, 1464, 2243, 1069, 0, 0, 0, 0, 0, 0, 0, 1125, 1124, 2280, 2270, 2271, 0, 2268, 2269, 2281, 2282, 2283, 0, 2391, 0, 0, 0, 2140, 2151, 2152, 2153, 2318, 2374, 2148, 2149, 2150, 2142, 2143, 2144, 2145, 2146, 2147, 0, 0, 1213, 2141, 0, 2391, 0, 0, 0, 156, 0, 133, 0, 0, 0, 2391, 0, 0, 0, 0, 0, 0, 0, 2391, 0, 0, 0, 0, 0, 156, 2424, 0, 133, 2391, 0, 0, 1443, 0, 0, 0, 1445, 1448, 1424, 0, 2221, 0, 2222, 2249, 1512, 0, 2238, 0, 0, 0, 950, 943, 0, 951, 958, 0, 0, 960, 0, 0, 944, 0, 0, 0, 0, 0, 963, 964, 0, 0, 965, 945, 966, 946, 967, 947, 968, 0, 0, 0, 0, 948, 0, 0, 0, 1435, 1426, 0, 1567, 1569, 1568, 1566, 507, 0, 0, 0, 2391, 0, 0, 133, 1497, 0, 2391, 133, 0, 0, 442, 441, 133, 2268, 440, 439, 2318, 2374, 0, 1115, 0, 1378, 133, 2391, 0, 179, 2391, 696, 2391, 1536, 0, 625, 0, 0, 810, 2424, 133, 0, 0, 0, 0, 0, 0, 1087, 0, 0, 0, 0, 0, 609, 622, 1578, 1576, 0, 1222, 233, 232, 1220, 902, 2391, 1157, 348, 0, 0, 2391, 1483, 2277, 1866, 1895, 1873, 1895, 1895, 1862, 1862, 2358, 1875, 2391, 1863, 1864, 1900, 0, 1895, 1862, 1867, 0, 1865, 1903, 1903, 1890, 348, 918, 1847, 1848, 1849, 1850, 1876, 1877, 1851, 1882, 1883, 1887, 1852, 1917, 1862, 2278, 903, 0, 894, 2391, 348, 1121, 2391, 2272, 166, 0, 892, 2318, 2374, 2391, 348, 1215, 0, 2391, 348, 2391, 162, 2391, 348, 2391, 348, 2391, 626, 0, 0, 2391, 348, 2391, 2424, 164, 0, 2391, 348, 912, 2391, 348, 2240, 2391, 0, 1427, 0, 1570, 0, 1544, 2618, 1559, 0, 1555, 1562, 1558, 1670, 0, 0, 1019, 1018, 0, 1019, 0, 1019, 0, 1019, 0, 1019, 0, 0, 0, 1019, 2266, 2267, 1001, 0, 1025, 0, 0, 1032, 1031, 1030, 0, 0, 0, 1033, 0, 1795, 1606, 0, 1417, 235, 186, 0, 247, 246, 1434, 0, 0, 0, 1087, 1249, 0, 1247, 1086, 0, 0, 1430, 239, 237, 0, 0, 0, 0, 0, 0, 1436, 0, 1428, 0, 0, 0, 2251, 2253, 2254, 2154, 2224, 0, 2582, 2583, 2584, 2213, 0, 2585, 2586, 2587, 2633, 2048, 2035, 2044, 2049, 2036, 2038, 2045, 2588, 2589, 1983, 2590, 2591, 2261, 2592, 2593, 2594, 2596, 2597, 2598, 2599, 2040, 2042, 2600, 2601, 0, 2262, 2603, 2604, 2448, 2606, 2607, 2609, 2610, 2046, 2612, 2613, 2614, 2615, 2616, 2617, 2260, 0, 2047, 2619, 2621, 2622, 2623, 2624, 2626, 2627, 2628, 2629, 0, 0, 0, 2235, 0, 2015, 0, 1855, 1856, 1878, 1879, 1857, 1884, 1885, 1858, 0, 2234, 1920, 2099, 2014, 2031, 0, 2020, 2021, 0, 2013, 2009, 1672, 2230, 0, 2010, 2250, 2252, 2214, 1672, 2228, 200, 254, 0, 255, 2236, 2515, 188, 230, 202, 229, 203, 201, 0, 2316, 189, 0, 0, 190, 0, 0, 0, 0, 251, 249, 0, 1425, 0, 1793, 1792, 2239, 923, 0, 1523, 1517, 1526, 1522, 1533, 1530, 2164, 0, 1662, 0, 0, 0, 1642, 1641, 3, 0, 1538, 1540, 1515, 1536, 1684, 1685, 0, 0, 0, 0, 0, 0, 0, 0, 1740, 1700, 1701, 1703, 1737, 1741, 1749, 0, 1648, 0, 0, 1797, 1621, 0, 1450, 0, 0, 0, 0, 0, 1156, 0, 0, 0, 0, 0, 915, 0, 0, 0, 1470, 0, 1472, 1473, 1474, 0, 0, 0, 1475, 1476, 1464, 243, 1482, 1480, 1463, 1465, 1478, 0, 0, 0, 0, 0, 0, 0, 1489, 0, 170, 171, 0, 638, 622, 0, 2391, 0, 0, 0, 0, 0, 1164, 1171, 0, 0, 0, 0, 0, 0, 0, 0, 1165, 1163, 0, 1166, 245, 1176, 1195, 1198, 0, 1123, 1126, 0, 0, 0, 0, 0, 1306, 0, 0, 0, 0, 1306, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 270, 272, 283, 343, 601, 0, 0, 0, 604, 0, 2391, 0, 0, 0, 0, 1217, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1198, 0, 0, 0, 0, 0, 0, 0, 0, 131, 132, 137, 0, 0, 0, 0, 0, 1198, 0, 0, 0, 0, 0, 0, 587, 600, 0, 0, 0, 0, 0, 597, 0, 0, 133, 275, 577, 583, 0, 0, 0, 703, 702, 0, 0, 0, 0, 1394, 1393, 0, 0, 0, 0, 1487, 1486, 0, 0, 0, 0, 1306, 0, 264, 266, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 379, 380, 0, 0, 0, 137, 0, 0, 0, 0, 277, 0, 0, 1444, 1441, 1442, 0, 1447, 0, 0, 0, 0, 2023, 0, 2168, 1692, 2166, 1141, 2220, 0, 2284, 2654, 2655, 2656, 2657, 2658, 2659, 2660, 2661, 2662, 2663, 2664, 2665, 2666, 2667, 2668, 2669, 2670, 2671, 2672, 2673, 2674, 2675, 2676, 2677, 2678, 2679, 2680, 2681, 2682, 2683, 2684, 2685, 2686, 2687, 2688, 2689, 2690, 2691, 2692, 2693, 2694, 2695, 2696, 2697, 2698, 2699, 2700, 2701, 2702, 2703, 2704, 2705, 2706, 2707, 2708, 2709, 2710, 2711, 2712, 2713, 2714, 2715, 2716, 2717, 2718, 2719, 2720, 2721, 2722, 2723, 2724, 2725, 2726, 2727, 2728, 2729, 2730, 2217, 2216, 2245, 2285, 2286, 2287, 2288, 2223, 0, 1508, 0, 957, 0, 0, 0, 0, 959, 0, 952, 0, 0, 949, 2318, 2374, 0, 0, 0, 0, 0, 0, 0, 0, 0, 962, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 818, 0, 1464, 1496, 0, 0, 0, 631, 0, 2391, 0, 135, 856, 0, 808, 443, 0, 0, 0, 1188, 1377, 135, 0, 0, 173, 0, 0, 700, 0, 0, 0, 0, 0, 0, 0, 0, 0, 747, 746, 0, 0, 0, 809, 0, 0, 135, 0, 2391, 580, 2391, 0, 507, 507, 0, 0, 1089, 0, 0, 0, 0, 0, 0, 1634, 1636, 1635, 0, 1633, 0, 346, 347, 0, 1205, 1230, 0, 0, 1894, 1881, 1889, 1888, 0, 1871, 1870, 1869, 0, 1868, 0, 1895, 1895, 1893, 1872, 1847, 0, 0, 0, 1899, 0, 1897, 0, 885, 1843, 1839, 0, 1906, 1907, 1908, 1905, 1918, 1904, 0, 1853, 1909, 1862, 1859, 905, 0, 0, 1199, 0, 0, 2391, 348, 2391, 0, 2391, 0, 0, 0, 1207, 348, 0, 1201, 0, 0, 1203, 0, 1395, 0, 901, 899, 898, 900, 0, 0, 883, 0, 0, 0, 2391, 348, 0, 0, 878, 0, 0, 880, 0, 0, 0, 0, 1670, 0, 219, 220, 218, 1560, 221, 1561, 1557, 1543, 0, 0, 0, 1009, 0, 1013, 0, 1004, 0, 1010, 0, 1005, 1002, 1003, 0, 1008, 0, 0, 508, 510, 0, 0, 2341, 2357, 0, 2380, 2412, 2413, 2472, 2500, 2505, 2511, 0, 2540, 2551, 0, 1034, 1064, 1029, 714, 0, 0, 1616, 1418, 2171, 0, 1670, 0, 0, 0, 0, 1238, 1239, 238, 209, 0, 0, 0, 1066, 2504, 1433, 980, 622, 0, 2011, 0, 2018, 2019, 2212, 0, 0, 0, 0, 0, 0, 2017, 2179, 0, 0, 0, 0, 0, 1943, 0, 0, 0, 2192, 0, 2198, 0, 0, 1980, 0, 0, 0, 0, 0, 0, 0, 0, 1944, 1924, 1925, 2015, 2164, 0, 2016, 2257, 0, 1917, 2233, 2154, 0, 2151, 2152, 2153, 0, 0, 0, 2227, 0, 2162, 0, 0, 1958, 2160, 1960, 0, 0, 0, 0, 2148, 2149, 2150, 2142, 2143, 2144, 2145, 2146, 2147, 2158, 1940, 0, 0, 2101, 0, 1939, 0, 0, 1753, 0, 2255, 2215, 1753, 256, 257, 253, 0, 0, 205, 204, 0, 223, 227, 228, 199, 226, 0, 222, 207, 2088, 2087, 206, 198, 195, 193, 210, 212, 213, 196, 194, 250, 0, 0, 0, 348, 1541, 0, 1524, 1525, 1521, 1528, 1750, 0, 1664, 0, 1668, 1541, 0, 1537, 1659, 1658, 1693, 1694, 1107, 1657, 1720, 1721, 0, 0, 0, 0, 1746, 1744, 1711, 1704, 1710, 0, 0, 1708, 0, 1712, 1920, 1739, 1646, 1698, 1699, 1702, 1645, 0, 1742, 0, 1619, 1740, 1703, 1603, 1580, 1581, 0, 1798, 0, 1451, 0, 0, 0, 1136, 1138, 0, 1137, 0, 1140, 0, 1149, 0, 0, 1135, 1154, 0, 1143, 1141, 0, 1485, 0, 0, 916, 0, 0, 0, 0, 1471, 0, 0, 2540, 242, 1474, 1479, 1466, 1477, 0, 0, 0, 0, 0, 1068, 1067, 0, 0, 1091, 0, 0, 0, 1492, 496, 0, 345, 0, 0, 0, 0, 0, 0, 0, 0, 804, 801, 0, 0, 800, 0, 636, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 676, 0, 1306, 0, 708, 0, 1173, 0, 0, 1172, 0, 1177, 0, 0, 1174, 1169, 1170, 2505, 2515, 2546, 244, 1175, 1197, 0, 1196, 1192, 1118, 0, 1119, 0, 0, 0, 0, 0, 2367, 2391, 288, 308, 0, 1305, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 330, 0, 0, 333, 332, 0, 0, 0, 0, 0, 337, 316, 0, 317, 0, 336, 0, 0, 602, 603, 0, 0, 0, 0, 1306, 0, 279, 0, 0, 0, 0, 0, 0, 0, 1214, 0, 731, 0, 0, 0, 2505, 1193, 0, 0, 0, 0, 0, 1381, 0, 0, 159, 0, 154, 158, 0, 0, 0, 2505, 1194, 0, 0, 0, 0, 585, 586, 599, 0, 590, 591, 588, 592, 593, 0, 0, 0, 0, 0, 0, 0, 584, 0, 0, 698, 697, 701, 0, 0, 0, 1390, 0, 1188, 0, 0, 1389, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1251, 1250, 0, 0, 0, 0, 0, 0, 846, 0, 0, 0, 0, 0, 0, 0, 0, 161, 718, 0, 717, 0, 155, 160, 0, 0, 0, 0, 0, 0, 0, 217, 1440, 1446, 1692, 1692, 1692, 2029, 0, 0, 0, 0, 1691, 2218, 2221, 1511, 2246, 1510, 0, 0, 0, 0, 961, 0, 0, 0, 0, 0, 0, 0, 0, 0, 953, 954, 955, 956, 0, 0, 0, 0, 0, 393, 390, 391, 393, 0, 0, 0, 0, 820, 0, 823, 826, 0, 1462, 462, 0, 0, 628, 676, 0, 0, 446, 168, 0, 0, 0, 0, 733, 0, 0, 0, 1376, 130, 177, 179, 444, 0, 178, 180, 182, 183, 184, 181, 185, 0, 695, 699, 0, 0, 0, 0, 624, 0, 0, 0, 0, 0, 748, 752, 751, 755, 753, 0, 749, 0, 0, 1818, 0, 0, 153, 0, 0, 575, 579, 0, 0, 0, 0, 446, 548, 359, 2391, 0, 507, 0, 2391, 0, 1088, 0, 807, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1632, 348, 1158, 0, 1484, 0, 0, 0, 348, 1892, 1891, 1844, 1840, 0, 0, 0, 0, 919, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1860, 348, 1122, 167, 2273, 0, 887, 0, 0, 0, 0, 348, 1216, 875, 348, 163, 348, 348, 627, 0, 348, 165, 0, 0, 0, 619, 348, 913, 348, 2241, 0, 348, 1573, 2391, 507, 1545, 1556, 0, 0, 1006, 1015, 1014, 1012, 1011, 1007, 0, 1026, 0, 506, 0, 0, 0, 0, 0, 1042, 1043, 0, 0, 1039, 1044, 0, 1040, 1041, 1046, 1036, 1035, 1047, 1048, 0, 0, 1066, 712, 0, 0, 0, 0, 1613, 0, 1611, 0, 1796, 1615, 1604, 1564, 0, 1563, 0, 568, 1087, 1087, 1248, 0, 0, 1023, 0, 0, 348, 1432, 0, 982, 988, 0, 0, 0, 0, 0, 0, 0, 991, 992, 0, 993, 984, 994, 985, 995, 0, 986, 0, 0, 0, 0, 2225, 2175, 0, 2176, 0, 0, 2211, 2207, 0, 0, 0, 0, 0, 2180, 2183, 2184, 2185, 2182, 2186, 2181, 0, 0, 2187, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2610, 0, 0, 0, 0, 1984, 0, 0, 2135, 0, 2164, 2197, 0, 0, 0, 0, 0, 0, 2164, 2203, 0, 0, 0, 0, 2086, 0, 2083, 0, 0, 0, 0, 2224, 0, 0, 2258, 1921, 1935, 1936, 1937, 1941, 2232, 0, 2226, 0, 0, 1922, 1949, 0, 2204, 1976, 0, 1981, 1964, 0, 1957, 0, 1962, 1966, 1945, 0, 1942, 0, 2227, 2163, 0, 2161, 0, 1932, 1933, 1934, 1926, 1927, 1928, 1929, 1930, 1931, 1938, 2139, 2137, 2138, 0, 0, 0, 2109, 0, 0, 1961, 2383, 2419, 0, 1683, 1683, 1683, 1671, 1681, 2231, 0, 1813, 1692, 1813, 2237, 0, 0, 1917, 0, 1794, 921, 922, 920, 1514, 1518, 1527, 1541, 2165, 1535, 1666, 0, 0, 1516, 1539, 0, 1105, 1106, 0, 1110, 2610, 2502, 0, 0, 0, 0, 1713, 1747, 0, 1738, 0, 2251, 1714, 2250, 1715, 1718, 1719, 1709, 1748, 1617, 0, 1743, 1650, 1649, 0, 1816, 0, 1799, 1751, 1352, 1252, 1315, 1139, 0, 1862, 1150, 0, 1134, 0, 1133, 1862, 0, 1151, 0, 1862, 1353, 1253, 1316, 917, 1354, 1254, 1317, 1355, 1255, 1481, 1469, 1468, 1467, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 785, 2391, 348, 1490, 1356, 0, 1256, 344, 1491, 1318, 1495, 803, 802, 0, 0, 1319, 0, 637, 0, 641, 0, 643, 644, 645, 0, 0, 0, 646, 0, 2318, 2374, 648, 651, 652, 653, 660, 665, 655, 0, 0, 667, 661, 0, 0, 0, 0, 0, 0, 673, 678, 0, 0, 0, 0, 0, 0, 0, 1167, 1168, 1357, 1259, 0, 1320, 1117, 0, 1260, 169, 0, 0, 271, 2391, 290, 0, 680, 785, 0, 1308, 287, 314, 0, 0, 329, 324, 325, 323, 2391, 348, 2391, 348, 0, 0, 0, 0, 0, 326, 321, 322, 318, 0, 0, 331, 2293, 2359, 2516, 0, 684, 686, 0, 691, 334, 1280, 355, 354, 353, 0, 338, 0, 360, 363, 335, 315, 313, 310, 284, 0, 0, 0, 0, 0, 0, 0, 0, 2244, 0, 0, 1209, 0, 1360, 1321, 0, 1343, 0, 0, 0, 0, 725, 0, 1363, 1266, 1324, 1382, 1384, 1374, 1267, 1383, 157, 1295, 146, 0, 0, 142, 0, 0, 0, 0, 136, 0, 1364, 1268, 1325, 0, 1365, 1269, 0, 0, 276, 578, 589, 594, 1274, 598, 595, 1333, 596, 1372, 1270, 1368, 1298, 1328, 1375, 1391, 1271, 1188, 1386, 1388, 0, 1306, 0, 265, 267, 0, 286, 0, 1272, 0, 1326, 1367, 1297, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1498, 0, 0, 0, 0, 0, 0, 348, 0, 0, 0, 1308, 2391, 348, 1366, 0, 1303, 0, 1341, 0, 381, 0, 1296, 0, 0, 278, 1276, 1335, 0, 0, 215, 214, 216, 0, 0, 0, 0, 2169, 2170, 0, 2167, 2024, 2220, 0, 970, 928, 969, 0, 2357, 0, 927, 929, 0, 0, 0, 930, 0, 934, 935, 0, 0, 0, 926, 924, 925, 392, 0, 0, 742, 743, 0, 0, 0, 0, 822, 0, 0, 0, 1488, 0, 133, 635, 0, 0, 0, 630, 675, 680, 0, 0, 0, 0, 445, 449, 453, 454, 455, 0, 0, 0, 0, 147, 134, 0, 864, 0, 507, 0, 735, 1380, 1379, 1187, 0, 179, 172, 0, 0, 696, 0, 1536, 0, 0, 359, 817, 815, 814, 816, 0, 0, 0, 838, 813, 0, 1817, 1819, 0, 0, 0, 0, 0, 0, 568, 448, 0, 0, 510, 0, 551, 0, 0, 0, 0, 548, 0, 0, 0, 2277, 0, 834, 806, 1128, 0, 1146, 1129, 0, 0, 0, 0, 1181, 1113, 1182, 1159, 1114, 0, 0, 607, 1637, 1638, 0, 1206, 0, 0, 1861, 1874, 886, 0, 1902, 1901, 1903, 1903, 0, 1845, 0, 1886, 1911, 1912, 1913, 1914, 1915, 1916, 0, 1910, 1854, 1200, 348, 0, 348, 0, 348, 1208, 1202, 1204, 1396, 0, 884, 0, 0, 348, 877, 879, 0, 881, 0, 0, 0, 0, 1595, 1583, 0, 1753, 1622, 0, 2224, 1027, 509, 0, 0, 0, 0, 0, 0, 1038, 605, 1045, 0, 1059, 1054, 1056, 0, 1060, 711, 0, 0, 1614, 1607, 1609, 1608, 0, 0, 1605, 2172, 876, 0, 574, 0, 0, 0, 0, 348, 0, 1061, 0, 0, 989, 983, 0, 0, 987, 0, 0, 0, 990, 0, 0, 1688, 2173, 2174, 0, 0, 0, 2208, 0, 0, 2061, 0, 2037, 2039, 2051, 0, 2062, 2022, 2063, 2041, 2043, 0, 2155, 0, 0, 2052, 0, 1986, 1987, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2002, 2001, 2053, 2134, 0, 0, 2195, 2196, 2054, 0, 0, 2202, 0, 0, 0, 2059, 2064, 0, 0, 0, 0, 2070, 0, 2091, 0, 0, 0, 2012, 2165, 0, 0, 0, 0, 0, 0, 0, 0, 1982, 1965, 1959, 0, 1963, 1967, 0, 0, 0, 1953, 0, 0, 1951, 1977, 1947, 0, 0, 1978, 0, 0, 0, 2030, 0, 0, 1683, 1683, 1683, 1683, 1680, 0, 0, 0, 0, 2502, 2630, 0, 1777, 1752, 1754, 1764, 1777, 1782, 1777, 2032, 1811, 2033, 2238, 0, 1723, 0, 1723, 191, 0, 224, 211, 1513, 1667, 1670, 1695, 0, 2156, 1110, 0, 1697, 1717, 1716, 0, 1707, 1745, 1705, 1618, 1602, 0, 1600, 1582, 0, 1862, 1131, 1132, 0, 1155, 0, 1071, 1072, 0, 1070, 0, 0, 0, 495, 1090, 0, 0, 0, 785, 0, 0, 499, 0, 1493, 0, 1373, 1294, 639, 640, 0, 654, 0, 663, 662, 0, 0, 0, 0, 0, 0, 0, 647, 669, 611, 670, 672, 0, 0, 671, 674, 677, 1306, 0, 709, 1282, 0, 1339, 1161, 1309, 0, 1120, 0, 0, 0, 0, 0, 0, 462, 309, 0, 0, 0, 0, 368, 0, 292, 301, 366, 307, 0, 1314, 340, 0, 312, 0, 305, 327, 319, 328, 320, 339, 341, 0, 688, 689, 687, 683, 0, 690, 692, 0, 357, 0, 0, 0, 1359, 0, 1306, 0, 280, 0, 1278, 0, 1337, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1342, 0, 0, 0, 0, 730, 0, 727, 1310, 0, 0, 139, 138, 0, 145, 0, 1311, 0, 0, 0, 0, 1392, 0, 0, 0, 0, 0, 0, 375, 0, 285, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 382, 350, 0, 841, 0, 0, 0, 384, 0, 0, 0, 0, 0, 1358, 1261, 2027, 2028, 2025, 1692, 2219, 0, 0, 0, 941, 0, 0, 0, 0, 0, 0, 395, 396, 133, 394, 417, 0, 785, 0, 0, 819, 824, 832, 2448, 2142, 2143, 830, 825, 827, 829, 831, 828, 0, 0, 0, 0, 0, 478, 0, 0, 0, 468, 0, 0, 1188, 461, 464, 465, 0, 0, 631, 634, 632, 633, 668, 0, 448, 485, 536, 0, 149, 0, 0, 150, 148, 0, 0, 359, 732, 0, 729, 0, 175, 444, 0, 700, 0, 0, 0, 1188, 623, 754, 757, 750, 0, 837, 839, 811, 0, 680, 0, 0, 580, 0, 507, 1574, 563, 0, 538, 448, 536, 547, 0, 0, 555, 358, 0, 0, 568, 359, 0, 0, 1091, 0, 833, 0, 1127, 0, 0, 0, 1178, 1183, 1179, 0, 0, 1142, 0, 1180, 1160, 1412, 1413, 1410, 1411, 0, 0, 0, 1629, 0, 1880, 0, 1898, 1896, 1841, 1846, 1919, 888, 0, 871, 0, 873, 348, 719, 0, 620, 348, 0, 1587, 1589, 1588, 0, 0, 1590, 2224, 0, 1600, 1627, 0, 0, 1816, 0, 1626, 0, 0, 0, 0, 0, 1037, 0, 1057, 0, 0, 1020, 1063, 0, 0, 1612, 1610, 566, 0, 1240, 1241, 1066, 0, 1021, 1065, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2177, 0, 2210, 2206, 0, 2034, 2178, 0, 2190, 2189, 2135, 0, 0, 1985, 1997, 1998, 1999, 2191, 0, 2007, 0, 0, 1994, 1995, 1996, 1988, 1989, 1990, 1991, 1992, 1993, 2000, 2200, 2199, 2193, 2194, 0, 2056, 2057, 2058, 2201, 2065, 0, 2308, 2092, 0, 2069, 2085, 2084, 0, 0, 0, 2072, 0, 0, 2081, 0, 2136, 2259, 1923, 0, 0, 1950, 2205, 1968, 0, 0, 0, 1946, 2155, 0, 0, 0, 0, 0, 1955, 0, 0, 0, 2112, 2107, 2108, 2132, 0, 0, 0, 0, 0, 0, 1674, 1673, 1679, 1777, 1782, 1777, 0, 0, 1652, 0, 1764, 0, 1776, 1762, 1775, 0, 0, 1788, 1786, 0, 1788, 0, 1788, 0, 1756, 0, 1778, 1758, 1775, 1760, 0, 1803, 2239, 1812, 0, 1736, 2024, 1736, 0, 0, 0, 1696, 1108, 1109, 1706, 2337, 1814, 0, 1601, 1152, 0, 0, 1144, 1077, 1078, 1081, 1079, 1076, 1080, 0, 0, 0, 785, 0, 0, 517, 0, 1102, 1102, 0, 0, 501, 560, 512, 788, 0, 0, 0, 786, 348, 1257, 0, 664, 0, 0, 659, 657, 656, 658, 0, 612, 1371, 1258, 0, 0, 0, 0, 1162, 0, 0, 1281, 0, 289, 0, 458, 0, 0, 302, 0, 298, 0, 1307, 0, 0, 0, 0, 297, 370, 0, 367, 0, 348, 348, 342, 685, 356, 361, 362, 365, 0, 0, 0, 0, 0, 1313, 0, 0, 0, 0, 0, 0, 0, 865, 848, 0, 0, 866, 867, 0, 0, 0, 1211, 1212, 1210, 1344, 1345, 1350, 1347, 1346, 1349, 1351, 1348, 0, 1264, 0, 0, 723, 143, 140, 141, 144, 1292, 1275, 1334, 1387, 0, 0, 0, 1273, 0, 1327, 0, 1288, 1284, 0, 0, 0, 0, 0, 1370, 1302, 1332, 1369, 1300, 1330, 1299, 1329, 1301, 1331, 0, 1293, 0, 1821, 845, 0, 0, 0, 348, 348, 844, 721, 1277, 1336, 0, 0, 0, 931, 0, 0, 933, 936, 0, 938, 400, 418, 133, 0, 741, 805, 0, 0, 821, 784, 0, 466, 0, 472, 476, 0, 0, 480, 481, 479, 467, 1188, 507, 559, 774, 775, 0, 0, 795, 0, 629, 0, 446, 0, 482, 0, 0, 450, 152, 151, 0, 0, 0, 736, 740, 738, 737, 739, 734, 0, 725, 179, 2391, 0, 0, 0, 0, 561, 1385, 0, 767, 812, 0, 1820, 715, 0, 359, 576, 0, 0, 0, 446, 568, 0, 451, 456, 457, 462, 0, 548, 537, 0, 538, 549, 550, 0, 557, 1460, 0, 569, 557, 0, 0, 0, 836, 0, 835, 1130, 1147, 1148, 0, 0, 1111, 0, 0, 0, 0, 614, 348, 1842, 348, 348, 1237, 0, 882, 0, 0, 0, 1592, 1598, 1579, 0, 0, 1623, 1600, 1624, 1051, 1052, 1053, 1050, 1049, 606, 0, 1055, 713, 0, 567, 348, 0, 997, 975, 996, 974, 976, 0, 978, 979, 973, 971, 972, 2209, 2050, 2060, 2188, 2134, 2165, 0, 0, 2008, 0, 0, 2055, 2620, 0, 0, 2096, 2097, 0, 2093, 2094, 2089, 2090, 2071, 0, 2438, 2076, 0, 0, 0, 1974, 1972, 1969, 0, 1970, 1954, 0, 0, 1952, 1948, 0, 1979, 2098, 0, 2114, 2111, 2131, 2165, 1678, 1677, 1676, 1675, 1763, 1759, 1761, 0, 2625, 0, 1766, 1773, 0, 1755, 0, 1787, 1783, 0, 1784, 0, 0, 1785, 0, 0, 1757, 0, 1773, 0, 1810, 0, 0, 2103, 2256, 2103, 225, 1665, 0, 0, 1599, 1145, 1153, 0, 0, 0, 497, 0, 512, 0, 0, 0, 1104, 1104, 0, 512, 0, 1188, 790, 789, 792, 787, 791, 1494, 0, 649, 650, 666, 1283, 0, 1340, 1290, 0, 1616, 291, 0, 681, 296, 0, 0, 293, 369, 371, 294, 295, 299, 350, 311, 304, 0, 0, 0, 1279, 0, 1338, 1286, 1361, 1262, 1322, 0, 0, 854, 0, 0, 0, 0, 1362, 1263, 1323, 0, 0, 0, 0, 1616, 0, 0, 0, 0, 0, 0, 0, 0, 1503, 0, 1312, 349, 843, 842, 350, 383, 1304, 2026, 0, 932, 939, 940, 937, 0, 389, 397, 400, 0, 0, 1228, 1228, 0, 785, 0, 0, 463, 477, 0, 559, 516, 0, 469, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 728, 727, 174, 0, 446, 0, 680, 0, 761, 762, 756, 758, 0, 769, 773, 840, 0, 0, 0, 568, 448, 0, 0, 1571, 447, 0, 0, 459, 0, 551, 538, 548, 0, 0, 565, 0, 1453, 0, 571, 0, 0, 0, 1184, 0, 1190, 0, 1141, 1185, 0, 1813, 0, 0, 0, 0, 618, 1229, 872, 874, 720, 1584, 0, 1585, 1591, 0, 0, 0, 0, 1628, 1620, 1058, 0, 1062, 348, 977, 2136, 2003, 0, 0, 0, 0, 2066, 0, 2067, 2095, 2073, 2077, 0, 2074, 2075, 1971, 1975, 1973, 1956, 2100, 0, 1692, 2133, 1806, 0, 1809, 0, 0, 1765, 0, 0, 1767, 0, 0, 1769, 1771, 0, 0, 0, 0, 0, 0, 2242, 2336, 2594, 2499, 0, 1722, 1724, 1727, 1729, 1728, 1730, 1726, 1735, 0, 1654, 1653, 2157, 1815, 1059, 0, 348, 1102, 1188, 518, 2448, 519, 1101, 1103, 1107, 1107, 0, 1188, 0, 559, 642, 0, 0, 273, 679, 0, 0, 303, 352, 364, 0, 1616, 0, 0, 852, 861, 861, 849, 0, 0, 868, 1265, 724, 0, 0, 268, 1289, 1285, 0, 0, 0, 1505, 1506, 0, 0, 0, 0, 0, 348, 942, 0, 420, 427, 401, 405, 1497, 0, 1497, 0, 402, 406, 1497, 1497, 399, 1813, 416, 1228, 0, 1225, 1224, 783, 0, 505, 582, 0, 470, 0, 527, 0, 0, 796, 0, 0, 448, 536, 0, 494, 486, 487, 488, 490, 489, 491, 492, 493, 484, 483, 0, 680, 858, 359, 1460, 722, 0, 0, 693, 0, 759, 764, 763, 1497, 768, 0, 0, 0, 680, 0, 1574, 564, 538, 448, 536, 452, 462, 540, 0, 541, 555, 548, 551, 0, 552, 0, 556, 0, 0, 0, 568, 1507, 1091, 0, 1092, 1189, 0, 0, 0, 0, 0, 0, 1232, 613, 0, 0, 617, 608, 0, 0, 0, 0, 1625, 680, 1022, 2004, 0, 2005, 0, 0, 2079, 2078, 0, 2118, 1811, 0, 0, 1805, 0, 0, 1835, 0, 0, 0, 1774, 1790, 0, 1770, 1768, 0, 1779, 0, 1781, 0, 0, 0, 1731, 0, 2102, 2104, 0, 1073, 0, 1074, 1104, 559, 0, 1110, 1110, 507, 559, 0, 785, 1291, 0, 682, 582, 0, 306, 0, 281, 1287, 0, 0, 863, 863, 0, 0, 0, 0, 0, 0, 377, 0, 0, 1499, 0, 1500, 1501, 1504, 385, 398, 0, 425, 0, 423, 422, 424, 0, 413, 0, 0, 0, 0, 0, 0, 388, 1223, 1227, 1226, 0, 0, 471, 0, 473, 0, 513, 514, 515, 0, 475, 523, 524, 0, 793, 0, 798, 0, 0, 0, 680, 535, 704, 0, 0, 0, 1454, 0, 0, 562, 0, 770, 771, 766, 0, 0, 716, 1460, 568, 548, 0, 538, 460, 0, 557, 551, 555, 553, 554, 0, 1457, 0, 570, 0, 1098, 0, 1112, 1191, 1186, 1416, 0, 0, 616, 615, 0, 1597, 1813, 1594, 0, 710, 2006, 2082, 2068, 2080, 2113, 0, 0, 0, 0, 1804, 1807, 0, 1838, 0, 0, 0, 0, 1824, 0, 1772, 0, 0, 1780, 0, 0, 0, 1725, 0, 0, 0, 1107, 522, 0, 1095, 1094, 516, 785, 511, 498, 1616, 300, 351, 0, 0, 0, 859, 862, 850, 851, 870, 869, 726, 1616, 0, 373, 372, 0, 376, 0, 421, 430, 0, 428, 403, 408, 0, 412, 410, 409, 404, 407, 0, 504, 0, 0, 0, 0, 0, 525, 0, 526, 558, 0, 797, 0, 0, 0, 706, 857, 0, 0, 446, 680, 760, 765, 0, 0, 1455, 1572, 551, 538, 548, 0, 0, 542, 1102, 1102, 433, 555, 557, 1458, 1459, 0, 0, 359, 1093, 1415, 1414, 1670, 0, 0, 1586, 1596, 0, 2581, 2337, 2553, 0, 2130, 2119, 2130, 2130, 2110, 0, 0, 1836, 1837, 1822, 0, 0, 1826, 1789, 1802, 1733, 0, 1732, 2105, 2106, 348, 1110, 0, 785, 520, 527, 500, 274, 1616, 853, 0, 269, 0, 378, 1502, 426, 0, 411, 773, 581, 474, 532, 0, 531, 0, 529, 528, 794, 799, 0, 680, 847, 1460, 694, 772, 0, 555, 548, 551, 0, 539, 0, 1104, 1104, 557, 431, 0, 0, 557, 1398, 1670, 1397, 1399, 1407, 1404, 1406, 1405, 1403, 1235, 1236, 1813, 0, 2123, 2122, 2121, 2125, 2124, 0, 2117, 2115, 2116, 1808, 0, 1825, 1828, 0, 0, 0, 1834, 1827, 1829, 0, 1800, 1734, 1075, 1096, 0, 502, 785, 282, 860, 0, 429, 0, 530, 534, 533, 680, 705, 1456, 778, 557, 551, 555, 1102, 543, 545, 544, 435, 1098, 1099, 0, 1813, 0, 1408, 1402, 1652, 1639, 0, 0, 1593, 0, 0, 2127, 0, 2128, 0, 1831, 1832, 1833, 1830, 0, 0, 503, 0, 0, 707, 780, 0, 776, 779, 781, 782, 434, 555, 557, 1104, 359, 1097, 0, 1082, 1400, 1670, 0, 0, 2120, 2126, 2129, 0, 0, 521, 374, 0, 744, 0, 557, 432, 546, 557, 1100, 1401, 0, 0, 0, 1801, 0, 777, 436, 1813, 0, 0, 1823, 778, 1083, 0, 0, 0, 1233, 1234, 745 }; /* YYPGOTO[NTERM-NUM]. */ static const yytype_int16 yypgoto[] = { -4710, -4710, -4710, 3777, -4710, -4710, -895, 57, 3007, -866, -4710, -4710, -4710, -459, -4710, -4710, -4710, -4710, 3737, -4710, 2092, -2445, -4710, -4710, 154, -376, -1304, 137, 3272, 1741, -4710, -1143, -4710, -4710, -557, 126, -4710, 324, 264, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -685, 2209, -4710, 2288, 1578, 4301, -2989, -4710, -4710, -1410, -3166, -4710, 898, -4710, 923, -4169, -595, -4710, -4710, -4710, 2194, -4710, -4710, -4710, 2137, 1383, -39, -4710, -4710, -4710, -4710, -4710, -4710, -443, -4710, -4710, -694, 146, 30, -2455, -3750, -4710, -4710, 760, -86, -1436, -4710, -3567, -4710, 293, -2228, -4710, -4710, -4710, -53, -1398, 1681, -4710, -727, -1105, 1979, -2363, -558, -4710, 66, -4710, -673, -461, -458, -592, -3785, -4272, -4710, -4710, -4710, -703, -3256, -4501, -4709, -4260, -4089, 1690, -4710, 152, -3119, -3237, 155, 730, -4710, 156, 162, -4710, 746, -395, -907, -1534, -4710, -809, -4710, -4710, -4710, -2928, -4710, -4710, -4710, -4710, 83, -4710, -4710, -4710, -4710, 791, -4710, -4710, -4710, -4710, -4710, -4710, -1995, 2153, 2155, -4710, -3179, -4710, -872, -4710, 940, -2950, 1595, -4710, -4710, 1366, 3755, 773, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -1688, -4710, -4710, -4710, -4710, 287, -28, -4710, -4710, -4710, -4710, -4710, -4710, -4710, 164, -4710, 2172, 1361, -4710, -4710, -31, -4710, -4710, -4710, -4710, -4710, -4710, -653, -4511, -815, -796, -4710, -2933, -4710, -4710, -4710, 1, -4710, -4710, -4710, -4710, -4710, -881, -4710, 1427, -3591, -4710, -4710, 756, -4710, -4710, -4710, -4710, -4710, -564, 61, 2925, -4710, -172, -366, -4710, -4710, -4710, 62, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -1093, 11877, -810, -584, -4710, -4710, -4710, -4710, -4710, -2179, -4710, -4710, -4710, -4710, -3652, -4710, 4669, 2149, -195, 177, -4710, -24, 63, 3515, -1160, -2656, 704, -130, -4710, -4710, -4710, -2579, -4710, -4710, -4710, -4710, -3518, 178, -4710, -688, -4710, -3801, -4551, -3538, -719, -4710, -4057, -4440, -4521, -3521, -4710, -4710, -4710, -4710, -513, -40, 2890, -4710, -1417, 2527, -908, -4710, -2084, 775, 1770, 2898, -2707, -140, 2888, -2523, -640, -3271, -4710, -4710, -2335, -267, -4710, -4710, 1468, 599, -4710, -4710, -4710, -4710, -620, 2839, -203, -4710, -4710, 4054, -4710, -3669, -4710, 4023, -4710, -4710, -4710, -4710, 2745, 2753, -4710, 2754, -4710, -4710, -1420, 1534, -4710, -4710, -4710, -4710, 979, -4710, -4710, -4710, -4710, -4710, -4710, -4710, 1430, 966, -4710, -4710, -4710, -4710, -4710, -545, -726, -4710, -4710, 188, -4710, -4710, -4710, -4710, 2302, -891, -741, 3931, 894, 190, -4655, -4710, -4710, -1140, -4710, 3308, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -2501, -4710, -4710, -4389, -4710, -4710, -4710, -4710, -4710, 3911, 69, 2632, -4710, -4710, -4710, -29, -4710, -4710, -975, 2619, -4710, -1920, -4710, -597, -4710, 2831, -4710, -4710, -4710, -4710, -1901, 199, -3777, -4710, -609, -4710, 2823, -4710, -8, -4710, 301, -4710, -4710, -3746, 12, -4710, -4710, -4710, -4710, -4391, -4710, -608, -4710, -536, 769, -3275, -4710, 205, 168, -4710, -4710, 2, 108, -42, -57, -10, 5, 98, 3407, -4710, 208, 3433, -4710, 13, 2094, -4710, -4710, -821, -173, -4710, 1870, -626, 2601, 3374, 3376, -4710, 1857, 2633, -1990, -1951, -4710, 1163, -426, -265, -4710, -4710, -4710, -4710, 622, -615, 2612, -4710, 3380, -4710, -4710, -4710, -1998, -2844, -3454, 1193, -3457, -3359, 664, 648, -1147, -27, 11, -756, -808, -4710, -4710, 1199, -229, -4710, -4710, -225, -2819, 802, -4710, -4324, -2331, 1205, -683, -514, -4710, -602, -4710, -388, -625, 2948, -1041, -4710, -4710, -1004, 13038, -4710, -4710, -4710, 14447, 14467, -4710, -4710, 14954, 15593, -4710, -910, 16194, 11762, -1020, -1886, 0, 12899, -1069, -495, 46, -4710, -3524, -1462, -4710, -4710, -4710, 16, 1261, 398, -4710, -4395, -3822, -4710, -4710, 233, -4710, -393, -4710, -396, -4710, -4710, -4710, -2652, -4264, -2761, 2731, -4710, -4710, -4710, -197, -4710, 17112, -2750, -4710, -692, -1374, -1509, -3435, -1891, -4710, -4710, -4710, -4710, -4710, -4710, -4710, -1379, -3296, -374, 1970, -4710, -4710, 2057, -4710, -4710, -4710, -919, 2346, -768, -2678, 1978, -4710, -757, 2738, -770, 11204, -531, 8839, -523, -2238, -1262, -1657, -4710, 309, -4710, 5698, 6625, -1, -147, 6292, -606, -6, 12820, -516, -845, 4266, 11011, 10002, -3147 }; /* YYDEFGOTO[NTERM-NUM]. */ static const yytype_int16 yydefgoto[] = { -1, 53, 54, 55, 56, 57, 1537, 2510, 2365, 3284, 3285, 58, 59, 1533, 60, 61, 62, 63, 1448, 64, 1021, 1780, 2525, 65, 2198, 804, 805, 806, 2100, 2101, 2449, 2102, 2090, 1334, 1921, 1470, 778, 779, 1430, 1471, 67, 68, 1328, 2081, 69, 70, 71, 1501, 1588, 1502, 1503, 1442, 1827, 4312, 5053, 3081, 2328, 3332, 3082, 3083, 3701, 3702, 3780, 5067, 5068, 72, 1604, 1605, 73, 74, 2491, 3249, 3830, 4666, 4667, 4901, 613, 4335, 4336, 4888, 4889, 5081, 5226, 5227, 2526, 1772, 3327, 3915, 3275, 4406, 3276, 4407, 3277, 4408, 3261, 3862, 3863, 4349, 3864, 3278, 4367, 4933, 3279, 2217, 5097, 2567, 1945, 1943, 4585, 4915, 4174, 4175, 5316, 5105, 5106, 5107, 5338, 4369, 4412, 4413, 4963, 5268, 5269, 3330, 3921, 4419, 4732, 4683, 2966, 76, 709, 1806, 3446, 710, 2570, 647, 711, 2527, 81, 2560, 5099, 2561, 1563, 2379, 3843, 3426, 82, 1047, 3667, 4752, 4991, 4992, 83, 225, 84, 1788, 85, 86, 2505, 3268, 87, 2234, 2983, 88, 89, 3014, 3015, 3016, 90, 3692, 4603, 1504, 3070, 3071, 3072, 3073, 3723, 91, 1783, 2534, 2535, 92, 93, 94, 95, 2688, 2689, 96, 2436, 97, 98, 99, 100, 3757, 4276, 4383, 3111, 3291, 3887, 4381, 101, 3253, 2528, 1796, 2550, 2551, 4393, 4708, 4709, 4710, 4948, 5258, 4712, 4950, 5128, 4952, 4359, 5451, 5452, 4674, 3646, 4188, 103, 4360, 4361, 5112, 104, 2232, 105, 106, 1756, 2497, 2498, 3844, 2577, 3340, 3341, 3901, 3902, 107, 3193, 108, 4252, 4253, 648, 5119, 5059, 5212, 109, 110, 4256, 4257, 111, 112, 113, 114, 115, 701, 702, 703, 1138, 1139, 2938, 1086, 116, 2110, 117, 984, 985, 3228, 118, 1221, 2734, 2735, 4473, 119, 735, 1160, 1161, 2529, 121, 744, 2708, 746, 1960, 3428, 3429, 3998, 122, 123, 2685, 2711, 124, 1435, 2208, 2209, 4169, 2530, 649, 1206, 2574, 2961, 4978, 4979, 5279, 5424, 4580, 4842, 2893, 3612, 126, 650, 1475, 2284, 1106, 1107, 2580, 3344, 2177, 2178, 2179, 3941, 2180, 3346, 2181, 1408, 2182, 1057, 1058, 3352, 3353, 3354, 3937, 3944, 2519, 4742, 4743, 127, 1473, 2282, 128, 129, 130, 1516, 897, 1116, 1117, 131, 662, 663, 132, 4906, 133, 1060, 134, 4750, 135, 136, 769, 770, 1203, 1204, 137, 138, 2298, 3704, 139, 140, 141, 3105, 3106, 4268, 142, 143, 1775, 1776, 144, 145, 3158, 3159, 146, 147, 148, 5364, 5426, 5427, 5428, 3950, 5283, 5366, 1191, 150, 151, 152, 189, 937, 938, 939, 850, 2531, 4734, 154, 155, 1431, 1432, 1433, 1434, 2203, 156, 157, 158, 159, 160, 161, 162, 1760, 163, 164, 4881, 165, 166, 1721, 167, 168, 1357, 1358, 1359, 1360, 2115, 2881, 607, 822, 1363, 1369, 1374, 1375, 1376, 170, 713, 1152, 1153, 1154, 1923, 171, 1199, 988, 714, 1147, 173, 715, 174, 2161, 3409, 3976, 3977, 3978, 3981, 4763, 4158, 716, 2919, 176, 1967, 2694, 2697, 2915, 717, 177, 3412, 3413, 3414, 3983, 718, 737, 1050, 2587, 719, 1295, 181, 182, 183, 831, 825, 826, 2886, 720, 2074, 2862, 753, 1380, 791, 792, 840, 2459, 2127, 2128, 2152, 2153, 1389, 1390, 2140, 2144, 2145, 2906, 2899, 2133, 4145, 4819, 4820, 4821, 4822, 4823, 4824, 4561, 2148, 2149, 1392, 1393, 1394, 2157, 186, 2866, 3586, 3587, 3588, 4122, 4123, 4137, 4133, 4546, 4806, 3589, 1189, 1400, 4554, 5395, 3590, 4795, 4796, 5012, 4141, 3597, 3622, 3315, 3316, 3317, 3591, 5181, 5182, 5392, 5393, 5014, 5015, 2183, 1856, 1088, 1296, 1089, 1868, 1297, 1840, 1091, 1298, 1299, 1300, 1094, 1301, 1302, 1303, 1097, 1832, 1304, 1305, 1850, 1865, 1866, 1364, 5016, 1307, 1308, 1309, 3593, 1310, 4076, 4510, 4496, 2794, 2795, 2097, 4072, 3531, 4066, 2069, 2852, 4828, 5033, 5034, 3570, 4101, 4526, 4793, 5173, 5293, 5294, 5381, 1311, 1312, 1313, 2849, 2065, 900, 1314, 3846, 2067, 2788, 1629, 1630, 1970, 1992, 2741, 2757, 2758, 2768, 3490, 2776, 2781, 3518, 3519, 2789, 2818, 1315, 2743, 2744, 3474, 1994, 1316, 943, 1633, 944, 1989, 2813, 1324, 1317, 1318, 1961, 815, 4802, 1142, 856, 3097, 1713, 946, 750, 1319, 1320, 1321, 1322, 1509, 871, 1109, 1110, 604, 596, 873, 3074, 605, 598, 599, 1718 }; /* 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[] = { 595, 898, 179, 989, 991, 184, 1562, 899, 1015, 841, 830, 1920, 175, 783, 1180, 1181, 1182, 747, 1876, 749, 1186, 739, 1395, 755, 1329, 1719, 184, 739, 2392, 772, 780, 747, 1627, 787, 1609, 1325, 780, 780, 2216, 816, 1846, 819, 1567, 646, 1414, 2293, 1087, 1621, 1355, 3599, 851, 1785, 593, 3451, 3274, 1982, 814, 2285, 3355, 817, 1343, 1356, 907, 2462, 1852, 1836, 1837, 2306, 3156, 169, 2700, 1508, 1087, 1942, 3620, 1845, 928, 3297, 1122, 3926, 2868, 3945, 1207, 2294, 3945, 3673, 745, 3913, 2323, 4151, 712, 3871, 1135, 3190, 2931, 2933, 1000, 1714, 1476, 2740, 784, 700, 4176, 3099, 1051, 1758, 3432, 3693, 180, 1763, 1149, 2555, 3848, 1132, 1767, 2453, 4177, 3718, 4171, 3720, 4088, 4581, 3539, 4366, 1777, 4214, 66, 843, 4426, 180, 4119, 1365, 4415, 4136, 1770, 4405, 3982, 4237, 1801, 3897, 835, 4843, 3610, 4729, 4799, 1053, 75, 1062, 2803, 828, 1798, 2189, 77, 2908, 2575, 78, 79, 1833, 1834, 864, 829, 2277, 80, 4736, 102, 2413, 4414, 904, 1844, 1120, 909, 1141, 1124, 777, 844, 4919, 602, 120, 125, 1355, 811, 2417, 2418, 654, 595, 854, 854, 857, 149, 854, 153, 2878, 1155, 866, 2911, 816, 803, 4690, 901, 172, -1903, 866, 2887, 3910, 866, 178, -2376, 816, 185, 854, 4851, 4995, 816, 2637, 1388, -1862, 854, 2113, 816, -2414, 3624, 2277, 4055, -2437, 1472, 1391, 4965, 721, 1561, 921, 4134, 4811, 4139, 4813, -1895, 4453, 1587, -2469, 2277, 660, 1336, 1836, 1837, 4501, 1824, 4728, 1614, -1903, 2451, 2452, 4873, 1797, -1875, 611, 2307, 1852, 5139, 2424, -2249, 4883, 4884, 1845, 2108, -2277, 1472, 660, 1749, -2278, 1824, 1472, -2636, -2277, -2277, 2552, 3287, -2278, -2278, -2305, -2636, -2636, 1345, 1053, 2516, -1900, 5121, 1216, 721, -1890, 2200, 3233, 1867, 3234, 842, 2429, 933, 3238, 660, 3240, 3241, 3213, 660, -2248, -2379, 1162, 660, 1361, 3245, 3246, 3247, 1824, 2710, 721, 849, 820, 4589, 594, 1754, 3496, 1361, 2296, 1824, 5042, 5043, 4644, 1833, 1834, 3009, 2977, 1166, 2411, 1505, 1727, 5058, 5334, 2037, 721, 2087, 1505, 660, 4427, 721, 4761, 721, -419, 3077, 1922, 1333, 4645, -2246, 5005, 1926, 1844, 1811, 2564, 660, -133, 1744, 1858, 3188, 2508, -133, 4475, 4476, 2043, 4478, 4479, 4480, 4481, 4482, 727, 3436, 1752, 3438, 1824, 1824, 3086, 5162, 1177, 2565, 4402, 1402, 1193, 727, 2853, 3935, 3389, 727, 3391, 1618, 4364, 4850, 934, 4357, 728, 1824, 2045, 3078, -2435, 4352, 5093, 727, 5408, 2124, 3010, 4403, 2811, 728, 5029, 2037, 2811, 728, 4685, 1384, 3202, 2359, 3264, 1824, 2296, 3440, 1599, 1184, -2140, 2686, 3496, 728, 1824, 2952, 3774, -2140, 1859, 1517, 899, 5274, 2037, 935, 3109, 1719, 2043, 1847, 5086, 727, 2095, 2314, 2846, 5087, 2088, 2553, 3596, 727, 1538, 2847, -2159, 1621, 4579, 1913, 4879, 4966, 3449, -2159, 1848, 606, 3728, 2043, 1535, 728, 727, 5141, 1606, 5055, 2045, 1610, 608, 728, 1849, 3729, 1444, 2315, 5262, 4880, 1009, 4376, 2296, 899, 2096, 1386, 1019, 1536, 3079, 5026, 728, 1860, 3984, 936, 1861, 2045, 5088, 1909, 3441, 1033, 852, 2296, 845, 1518, 1185, 2109, 1755, 2687, 2376, 865, 3110, 2296, 2953, 1884, 1973, 1874, 1346, 865, 1825, 2222, 865, 2854, 3265, 1600, 2296, 4686, 1387, 2003, 2031, 5335, 1163, 1165, 1167, 2091, 4358, 1169, 1170, 1171, 2103, 2103, 1076, 5163, 1825, 1580, 4353, 1176, 3836, 5094, 2509, 5409, 4762, 1178, 2114, 2308, 3895, 941, 2077, 5006, 1719, 942, 1924, 5240, 2089, 3189, 1619, 5357, 2309, 2566, 2310, 1714, 2865, 1403, 4377, 3087, 1969, 655, 3472, 3013, 4365, 1962, 1904, 4911, 3848, 1825, 1347, 1445, 846, 3437, 2037, 3439, 2160, 4944, 4913, 4404, 1825, 1972, 1965, 1212, 3865, 1862, 5195, 4646, 947, 2030, 1185, 3496, 4271, 5336, 816, 2395, 854, 1983, 854, 2554, 857, 992, 854, 2043, 184, 2501, 5261, 1053, 1874, 901, 4590, 990, 2978, 821, 1022, 2311, 854, 1755, 3214, -2435, 5337, 3828, 3829, 854, 1847, 1053, 5273, 5414, 2425, 2517, 2412, 2263, 4334, 1825, 1825, 2045, 2430, 2360, 1515, 4515, 3080, 2271, 4378, 1966, 4136, 1848, 1831, 595, 1620, 2387, 1986, 857, 2390, 830, 1825, 1826, 866, 1396, 4543, 1849, 901, 5314, 4547, 866, 2431, 1218, 866, 4781, 612, 5223, 1156, 1847, 5134, -2376, 1835, 4422, 1825, 5412, 983, 1853, 1755, 3374, 854, 2397, 2406, 1825, -2414, -2435, 2867, 3266, -2437, 1053, 1848, -1895, 5458, 1863, 2165, 4181, 4766, 184, -2435, 1627, 1627, 1627, -2469, 4375, 1851, 180, 1159, 3639, 1164, 1839, 1168, 5359, 4397, 941, 2450, -2249, 1172, 942, 1871, 4486, -2277, 1148, 3987, 3936, -2278, 2377, 3775, -2636, 2380, 2381, 733, 734, 816, 5478, 2812, 780, 780, 780, 3559, 4534, -1900, 4536, -2305, 5047, -1890, 4423, 1736, -2140, 5349, 1188, 1208, 2261, 899, 2033, 2158, 733, 734, 2075, -2248, 843, 1185, 2871, 1151, 5039, 3511, 2159, 2085, -2379, 3848, 2848, 1323, 1323, 1436, 816, 780, 3267, 1535, -2159, 780, 1506, 1507, 2064, 1882, 1906, 733, 734, 1506, 1507, 847, 4379, 3018, 1041, 816, 2458, 1724, 1446, 816, 2641, 5320, 1536, 180, 829, 1323, 1909, -133, -133, 844, 1053, 3771, 3094, 4771, 5324, 2339, 1188, 816, 1053, 1053, 2223, 2281, 4203, 179, 2660, 2120, 184, 3019, 1874, 816, 656, 4725, 1053, 175, 3626, 4241, 3627, 3997, 5416, 3889, 5298, 3910, 3037, 2670, 941, 816, 1399, 1755, 942, 1527, 5241, 2615, 5266, 763, 2682, 2061, 2062, 2063, 2064, 2118, 1447, 4380, 1451, 816, 862, 4912, 2742, 5272, 854, 854, 3508, 3509, 3510, 3511, 2281, 3984, 3866, 1966, 2343, 2690, 2147, 777, 1194, 1196, 1437, 3742, 3669, 2347, 657, 4338, 169, 2281, 1175, 4337, 2671, 2908, 2118, 2072, 2499, 780, 780, -1718, 5457, 5419, 5420, 3095, 2489, 838, 1731, 4161, 1366, 2471, 1005, 845, 1738, 660, 2942, 1739, 5402, 3251, 2597, 2598, 1323, 1323, 1103, 5475, 658, 842, 659, 180, 2773, 595, 5250, 1593, 1042, 3615, 3223, 1332, 764, 5196, 2224, 1340, 866, 2750, 5201, 660, 901, 66, 866, 3604, 1818, 866, 1927, 4989, 5265, 1929, 4957, 1931, 1528, 1933, 5281, 1935, 3380, 852, 2277, 1939, 854, 75, 660, 1729, 1429, 3878, 865, 77, 3602, 1594, 78, 79, 5439, 865, 5435, 5350, 865, 80, 1858, 102, 3822, 3823, 816, -1862, 4269, 4907, 2546, 4748, 3743, 854, 854, 1157, 120, 125, 660, 4797, 5358, 2691, 1819, 2210, 1444, 5480, 3674, 149, 2991, 153, 4440, 5374, 4857, 2392, 4968, 816, 816, 816, 172, 854, 789, 595, 595, 595, 178, 4176, 660, 185, 4969, 1789, 2059, 2060, 2061, 2062, 2063, 2064, 1438, 4390, 1793, 4177, 777, 1194, 3821, 3055, 4776, 2751, 2950, 3506, 3507, 3508, 3509, 3510, 3511, 2831, 1859, 5436, 2737, 3974, 2964, 1794, 838, 748, 2701, 2564, 3377, -1862, 1192, 2568, 1862, 4800, 4402, 1790, 3123, 1043, 2547, 1439, 4803, 3918, 5388, 2212, 2225, 4807, 5101, 5421, 4809, 1893, 2466, 5425, 2565, 765, 4004, 854, 3975, 854, 854, 4403, 2935, 2213, 1719, 1820, 1418, 1598, 3695, 2483, 3056, 2405, 3492, 1599, 1440, 1044, 1529, 2457, 3252, 1445, 2965, 1860, 1817, 2752, 1861, 1846, 790, 2502, 3174, 5114, 4990, 3378, 1323, 1894, 3175, 2594, 766, 767, 3879, 5282, 3670, 5437, 2345, 1595, 816, 2490, 5456, 2672, 4727, 863, 1719, 1874, 3744, 184, 3345, 1530, 3945, 1821, 3124, 1627, 4721, 1399, 5468, 5113, 1944, 1944, 5136, 3845, 5148, 816, 5133, 747, 4765, 3227, 1045, 2073, 2226, 2210, 2679, 2680, 1046, 1441, 2036, 2583, 2753, 2037, 1419, 2754, 1531, 2809, 5479, 3745, 816, 5389, 2832, 2211, 2591, 1006, 1979, 2833, 5135, 816, 4970, 2692, 1985, 5355, 5356, 4177, 1087, 1104, 5490, 3125, 5102, 5491, 2043, 706, 1600, 3696, 1323, 1158, 2605, -2637, 1795, 2693, 3746, 4715, 3761, 5092, 768, 1862, 4177, 4574, 4749, 1579, -1862, 15, 2834, 3176, 1420, 1862, 3946, 1791, 661, 4005, 830, 2214, 2045, 1596, 1323, 2596, 852, 1822, 2031, 2212, 1730, 4604, 180, 3942, 4472, 2618, 625, 865, 2930, 4295, 2634, 1087, 3674, 865, 3126, 20, 865, 2213, 3216, 2630, 752, 2346, 1323, 1323, 1323, 1755, 1323, 3323, 4702, 836, 5438, 2548, 2636, 5103, 2736, 5256, 2739, 2218, 2755, 4451, 2324, 2992, 2746, 1895, 2549, 2592, 1323, 5376, 2760, 2761, 2762, 2936, 2635, 5037, 2937, 2479, 2650, 2513, 2778, 2780, 899, 2125, 2126, 2790, 2130, 2219, 627, 1928, 3009, 1930, 3947, 1932, 2116, 1934, 1991, 1936, 1937, 1938, 5001, 4972, 1421, 5390, 1940, 1714, 816, 1863, 5391, 4973, 1812, 1813, 1814, 1792, 5022, 837, 2000, 2616, 933, 2480, 5459, 2913, 989, 991, -2637, 2215, 1864, 1494, 2204, -2637, 844, 844, 2629, 844, 3127, 2631, 1323, 2643, 1601, 2205, 1323, 1323, 2835, 4872, 5054, 2523, 2912, 2016, 4498, 2766, 2079, 816, 816, 2164, 5137, 1323, 2199, 2206, 5170, 3177, 1155, 2228, 2028, 3594, 1384, 1378, -2637, 3010, 1399, 1896, 2756, 2229, 2804, 609, 3985, 2219, 2669, 1602, 4435, 780, 2674, 2214, 3697, 3698, 2678, 838, 5057, 2681, -675, 4470, 3661, 5061, 5062, -1862, 660, 933, 2514, 2673, 3178, 4296, 2676, 2677, -1862, 2890, 1835, -1862, 1413, 3850, -1862, 5377, 1603, 3699, 33, 2052, 2268, 934, 3594, 2325, 2080, 780, 4249, 4254, 854, 2524, 1842, 1843, 763, 2914, 3142, 2220, 3848, 3179, 3662, 4967, 816, 2295, 1386, 3084, 785, 761, 4956, 3948, 41, 4217, 816, 2326, 4797, 854, 842, 842, 638, 842, 639, 3853, 41, 3128, 1572, 4499, 935, 3131, 1426, 3107, 1427, 3129, 987, 1379, 3130, 1874, 1874, 4163, 2327, 4974, 187, 901, 5209, 816, 2774, 1771, 45, 780, 4152, 5198, 5199, 2481, 2792, 4943, 4356, 3387, 2891, 3009, 45, 2256, 934, 2215, 4350, 5171, 780, 1573, 816, 3183, 2382, 816, 2272, 2207, -2637, 2322, 3850, 1574, 3855, 1627, 3949, 764, 3851, 3406, 4586, 188, 936, 4218, 3057, 49, 3160, 4391, 2230, 839, 3852, 5172, 4250, 4255, 762, 2131, 3143, 49, 50, 3131, 4396, 935, 816, 187, 3146, 4021, 3013, 3149, 4153, 3686, 50, 3180, 5210, 854, 854, 854, 854, 816, 3853, 2408, 3854, 51, 1361, 3023, 1145, 3116, 3117, 2231, 4351, 3120, 3035, 816, 3010, 51, 2392, 52, 1342, 4184, 5280, 3685, 5270, 2989, 1323, 1323, 1323, 3058, 188, 52, 4587, 606, 3181, 4856, 4177, 2482, 1847, 3006, 3217, 3218, 3219, 936, 2273, 4676, 3663, 3294, 2900, 3011, 3858, 4326, 3772, -2637, 3845, 4329, 4330, 3855, 4332, 1848, 2059, 2060, 2061, 2062, 2063, 2064, 3687, 3182, 3262, 1429, 3306, 3307, 3308, 3309, 1429, 2132, 2664, 4886, 4267, 834, 3039, 4251, 3314, 2947, 2383, 3856, 2382, 2384, 3012, 2627, 1219, 3032, 4164, 3859, 899, 899, 2590, 1053, 4165, 3024, 3141, -1652, 4185, 4239, 2960, 4166, 2134, 3342, 1575, 3860, 1346, 3493, 3494, -1652, 765, 4149, 3513, 3223, -1652, 788, 5140, 3969, 2037, 3816, 2463, 3773, 816, 2302, 4490, 2303, 4491, 832, 2324, 3164, 3407, 4443, 187, 4444, 854, 854, 4167, 2314, 1429, 1576, 3857, 2135, 1429, 1577, 5147, 3858, 3664, 4909, 3776, 3543, 3544, 766, 767, 4347, 854, 4186, -1091, 4187, 4168, 4177, 4716, -1652, 3208, 5117, 41, 3184, 2134, 3293, 3778, 2455, 2456, 2315, 4240, 816, 1347, 188, 1578, 4348, 5120, 2045, 5131, -1652, 4882, 1755, 2324, 3013, 2304, 1212, 3859, 854, 854, 854, 854, 2446, 4039, -1652, 4040, 41, 3185, 5398, 45, 3861, 816, 2363, 3860, 2135, 2447, -1652, 2366, 816, 4924, 2463, -1652, 2665, 3779, 4127, 2383, 1915, 899, 2384, 1916, 4770, -1652, 595, 1423, 5164, 595, 1494, 5423, 4988, 857, -1652, 1847, 45, 2448, 1323, 5270, 2617, 2389, 1564, 2520, 49, 4177, 2964, 3121, 2666, 4691, 882, 4128, 2137, 3335, 3303, 3845, 1848, 883, 884, 885, 4946, 2667, -1652, 36, 4925, 4492, 4549, 2557, 2136, 3645, 1851, 3186, 4926, 866, 866, 3425, 4130, 49, 3255, 2434, 2684, 1565, -1652, 2440, 901, 901, 2325, 5264, 866, 3945, 50, 866, 2362, 2518, 52, 4692, 2668, 2414, 4670, 4879, 4927, 812, 3642, 3861, 3187, 5263, 4947, 1545, 854, 854, 3364, 2138, 5050, 51, 2326, 854, 2137, 816, 5126, 4689, 4314, 1874, 4880, -1652, 4832, 4041, 4834, 3408, 816, 184, 3922, 4671, -1652, 5482, 3770, 4042, 833, 4984, 1409, 2327, 1909, 4315, 2325, 2615, 1944, 5252, 1546, 4177, 4700, 1532, 5127, 854, 917, 866, 4928, 3529, 866, 866, 4720, 816, 816, 3536, 854, 1404, 4593, 4594, 2707, 4929, 41, 816, 2326, 625, -1652, 1410, 2322, 2138, 816, 1411, 849, 4930, 3996, 918, 992, 747, 747, 184, 2695, 2712, 4132, 1566, 2444, 1323, 990, 1323, 1151, 2327, 4182, 4606, 1323, 1323, 1415, 2324, 1405, 4610, 45, 1323, 1323, 1323, 1569, 823, 1412, 1323, 901, 1323, 1323, 1323, 1323, 1323, 1323, 5351, 1323, 3997, 1323, 1323, 3447, 3448, 1323, 1799, 4680, 2445, 2322, 627, 180, 848, 941, 1406, 3358, 1370, 942, 1416, -573, 1323, 1323, 1323, 1323, 49, 3698, 1570, 854, 1323, 1800, 2997, 2706, 1323, -156, 3598, 1323, 899, 50, 1323, 1323, 1323, 1323, 1323, 1323, 1323, 1323, 1323, 3739, 1323, -1652, 5158, 1417, 2103, 4228, 816, 1323, 1053, 1323, 2733, 1571, 51, 2884, 3443, 858, 816, -2268, 5346, 180, 3495, -156, 3400, 5091, 2331, 1901, 52, 1589, 860, 721, 2885, 3455, 3523, 1034, 5415, 2654, 2985, 2655, 3740, 2656, 5124, 2657, 2443, 2658, 3608, 816, 3463, 2659, 1902, 625, -156, 4030, 1323, 5361, 5203, 1384, 816, 816, 3625, 3594, 1385, 1034, 3594, 1053, 3546, 2354, 1590, 1323, 1035, 3600, 1591, 3741, 852, 2909, 2910, 852, 1323, 1323, 4297, 3031, 4056, 3424, 2371, 756, 3675, 4879, 4661, 2325, 4662, 4663, 816, 4931, 4664, -1691, 4932, 2817, 1035, 2921, -1691, 1592, 1338, 4298, 3572, 1036, 5411, 4227, 3, 4, 4880, 627, 3703, 736, 757, 880, 4706, 2326, 758, 736, 3594, 865, 865, 2954, 2083, 2957, 638, 2880, 639, 1386, 5362, 29, 857, 3891, 4707, 1535, 865, 3, 4, 865, 4184, 747, 2327, 747, 2951, 2993, 2296, 3898, 2998, 2999, 3557, 881, 1037, 644, 2296, 4836, 2297, 3908, 1536, 3122, 1323, 4398, 4845, 4758, 2305, 1974, 923, -1691, 1975, 706, 1387, 3630, 595, 5449, 854, 854, 1835, 2322, 2190, 866, 1037, 901, 866, 866, 5095, 854, 941, 854, 2332, 15, 942, 854, 4847, 721, 816, 2819, 4212, 2820, 4204, -444, 2111, 865, 4160, 2112, 865, 865, 618, 1835, -1691, 2190, 5319, 3017, 2117, 4425, 3311, 2118, 780, 2774, 2774, 3312, 2821, 4185, 2774, 20, 2122, 41, 2295, 2112, 932, 4219, 41, 4226, 4009, 3205, 3042, 816, 5481, -1713, -1713, 888, 889, 890, 3054, 891, 892, 893, 894, 895, 896, 226, 1627, 816, 3468, 3469, 4242, 610, 1627, 2118, 3470, 2774, 2774, 45, 3613, 704, 940, 3849, 45, 721, 994, 3894, 3312, 816, 996, 638, 3678, 639, 3098, 3098, 4186, 941, 4187, -2249, 786, 942, 5287, 2324, -1717, -1717, 3631, 3632, 625, 816, 816, 3957, 3958, 816, 999, 857, 780, 1053, 1771, 1002, 49, 3654, 3548, 1016, 3549, 49, 1188, 1188, 3867, 1029, 1188, -1085, 1526, 50, -444, 3837, -572, 1543, 50, 854, 3665, 2822, 854, 5400, 1038, 2647, 2823, 3550, 2118, 1039, 2661, 2824, 5083, 2662, 5085, 2324, 51, 2663, 5089, 5090, 2662, 51, 1040, 816, 816, -1716, -1716, 3734, 627, 3522, 5363, 3524, 3525, 2499, 2698, 52, 1055, 2699, 3191, 2796, 3194, 3196, 2799, 2883, 3634, 3652, 1909, 1059, 4035, 4036, 4037, 4038, 1102, 3594, 4043, 4044, 4045, 4046, 4047, 4048, 4049, 4050, 4051, 4052, 3123, 2922, 1111, 5125, 2118, 1323, 1323, 1323, 1548, 3020, 3298, 1323, 33, 4937, 5151, 3160, 3029, 854, 3101, 3030, 3280, 3102, 1053, 3257, 5446, 854, 3258, 1549, 854, 3365, 1112, 3747, 2118, 3749, 854, 3416, 3467, 4887, 2662, 2118, 1118, 3476, 41, 1323, 2118, 854, 4092, 4093, 1129, 3482, 2324, 3551, 2118, 1007, 2325, 1008, 3552, 5040, 4891, 2295, 3755, 3096, 3098, 1136, 816, 4416, 5045, 816, 1011, 2324, 1012, 3296, 4409, 3345, 747, 5295, 5296, 1550, 45, 3764, 3124, 1835, 2326, 1413, 1188, 1146, 854, 1323, 2825, 3845, 5382, 5383, 4179, 4180, 5313, 721, 3483, 3484, 2826, 2118, 2118, 852, 4892, 1990, 3191, 52, 2325, 2327, 865, 3299, 5433, 865, 865, 3573, 854, 3574, 3328, 3515, 3884, 49, 2118, 3324, 3799, 707, 1179, 1183, 638, 4893, 639, 3454, 1187, 1200, 50, 3125, 2326, 1190, 1205, 3528, 1226, 641, 2118, 3496, 2322, 1323, 4894, 3497, 3498, 3499, 4895, 1226, 643, 1198, 3496, 1771, 1209, 51, 3497, 3498, 3499, 2327, 3769, 3818, 5463, 1551, 1201, 3379, 3381, 3382, 4896, 708, 854, 4897, 854, 3098, 854, 3098, 2737, 2615, 3533, 3777, 3721, 3534, 3726, 3722, 3281, 3727, 4898, 899, 3750, 1202, 3126, 3751, 1226, 3931, 2322, 3496, 3932, 3553, 1210, 3497, 3498, 3499, 2585, 3415, 2586, 2325, 4015, 3554, 4126, 1211, 3410, 1552, 1944, 4980, 1553, 3933, 4081, 2324, 3934, 3594, 1548, 1212, 1213, 3594, 2325, 2391, 3955, 180, 5496, 2118, 3877, 1214, 3880, 2326, 4000, 3458, 1215, 4062, 3461, 1549, 4063, 3462, 4073, 4068, 4084, 4074, 4159, 2118, 1220, 2937, 4227, 3609, 2326, 1226, 1222, 1348, 3496, 1555, 2327, 3039, -2637, -2637, -2637, 595, 3868, 1621, 3870, 4183, 4899, 866, 2662, 4399, 866, 4449, 2662, 866, 4450, 2327, 4454, 4467, 4127, 4455, 1966, 1835, 854, 2190, 830, 4487, 3127, 1550, 2118, 1341, 1323, 2322, 3954, 4516, 4528, 1323, 2699, 2118, 4570, 4576, 1557, 2937, 4577, 1053, 4582, 1053, 4583, 2662, 1344, 2662, 2322, 4128, 1349, 4722, 180, 3500, 4723, 4900, 1323, 1323, 1323, 4778, 1558, 1323, 4779, 3810, 4129, 1350, 830, 4602, 3282, 1323, 1323, 1323, 1323, 1354, 4130, 3501, 4346, 3575, 4780, 3576, 1560, 2118, 1323, 3939, 1362, 1323, 3501, 1323, 4222, 1368, 1367, 4787, 4032, 4720, 2699, 4220, 1370, 1371, 1323, 1323, 4131, 4852, 1323, 4938, 4853, 1382, 2662, 4981, 2325, 5002, 4982, 1551, 2699, 3919, 901, 3920, 1323, 3283, 1323, 4142, 1323, 4804, 5009, 1397, 1053, 5010, 4061, 4126, 5019, 3501, 5025, 1909, 4339, 3905, 4340, 4008, 2326, 3502, 5027, 1398, 1323, 3905, 4025, 5076, 816, 3128, 5077, 41, 3502, 5116, 4200, 3595, 2082, 3129, 5149, 5161, 3130, 5150, 5150, 1552, 1401, 2327, 1553, 4034, 3578, 3579, 3580, 816, 5464, 2324, 5465, 4104, 2028, 2391, 3084, 1323, 4238, 5165, 5166, 5167, 2699, 3534, 2118, 45, 3993, 1407, 4132, 5332, 4057, 1418, 1323, 3502, 5178, 1449, 5184, 5179, 2322, 1909, 3107, 4127, 1370, 1474, -1640, 3592, 3595, 1555, 3623, 5187, 5202, -2279, 3905, 2662, 1226, 1477, 1413, 3496, 2028, 3160, 1479, 3497, 3498, 3499, 1969, 1381, 49, 1383, 5208, 4333, 4320, 2699, 1480, 5214, 4128, 2817, 2699, 4266, 4082, 50, 5215, 5218, 5219, 2699, 2118, 2118, 1323, 5220, 3098, 4129, 5221, 3566, 1557, 1944, 3502, 1515, 2324, 5248, 3592, 4130, 5249, 5302, 51, 5306, 5303, 5307, 1909, 3585, 2118, -2541, 5308, 1419, 1519, 2118, 1558, 4805, 52, 4548, 1520, 4551, 854, 4205, 854, 854, 854, 4131, 1521, 5310, 1532, 4323, 2118, 989, 991, 1534, 1560, 1544, 2774, 2774, 2774, 2774, 1547, -1651, 2774, 2774, 2774, 2774, 2774, 2774, 2774, 2774, 2774, 2774, 5328, -1651, 5353, 5329, 852, 5354, -1651, 1582, 3585, 5384, 865, 1420, 3905, 865, 2325, 1581, 865, 4065, 4511, 1597, 3503, 3504, 3505, 1607, 3506, 3507, 3508, 3509, 3510, 3511, 1608, 3503, 3504, 3505, 1611, 3506, 3507, 3508, 3509, 3510, 3511, 1616, 2326, 1617, 3609, 1720, 2774, 2774, -2541, 5396, 2737, 1722, 5032, -1651, 4243, 5422, 1723, 3594, 5150, 4132, 5461, 1728, 5474, 5462, 3594, 2118, 1725, 2327, 5476, 3594, 1732, 5477, 3594, -1651, 3503, 3504, 3505, 1733, 3506, 3507, 3508, 3509, 3510, 3511, 816, 5494, 5502, 1741, 5303, 5477, 1742, 1748, 1745, 1751, 1753, 1759, 836, 3594, -2541, 2325, 1762, 29, 2322, 3501, 1764, 1755, 1773, 1421, -1692, 1774, -2541, 1778, 1779, -1692, -1651, -2541, -176, 1781, 1784, 1782, -2541, 1786, 1802, -1651, 1787, 1809, -2541, 2326, 1816, -2541, 206, 1823, 1828, -2541, 1830, -2637, -2637, -2637, 1829, 3506, 3507, 3508, 3509, 3510, 3511, 1831, 1835, 1838, 1841, 1839, 1855, 1857, 2327, 1869, 1870, 1873, 594, 1874, 1881, 1885, 837, 1422, -2541, 1887, 1888, 3502, 1890, 4464, 1423, 1892, 1226, 1898, 1897, 3496, 1900, 1905, 1908, 3497, 3498, 3499, -1692, 1911, -2541, 1912, 1914, 1925, 1971, 2322, 1978, 1941, 1980, 1981, 1323, 1987, 4518, 41, 1988, -1866, 1323, -1873, 1424, 1995, 1997, 1996, 36, 1719, 1998, 854, 1999, 594, 52, 2001, 3098, 3098, 2002, 2003, -1863, -1864, 2004, -1867, 2005, -1692, 2006, -2541, 2008, 2009, -2541, -1865, 2010, 2011, 838, 45, -2541, 1425, 2012, 2013, 2014, 2036, 2015, 4373, 2037, 2017, 2018, 2019, -2637, -2637, -2637, 816, 816, 816, 2020, 4696, 2021, 2022, 4371, 4372, 2023, 2024, 2070, 3594, 2068, -1651, 2072, 2086, 816, 1426, 2073, 1427, 2082, 2043, 1226, 2098, 49, 3496, 2106, 2121, 2044, 3497, 3498, 3499, 2123, 1385, 3594, 2154, 2167, 50, 1944, 816, -2541, 2166, 1387, 2168, 2169, 2185, 4519, 2156, 1944, 816, 816, 2186, 2187, 2045, 816, 2188, 2191, 3098, 2190, 4409, 51, 2192, 2193, 2194, 756, 2195, 816, 2196, 1428, 2202, 3925, 2221, 2227, 2258, 52, -1409, 2233, -1409, 1226, 2262, 3594, 3496, 2264, 3929, 2265, 3497, 3498, 3499, 2267, 2266, 2269, 2270, 2774, 2286, 2287, 752, 2300, 3953, 2299, 2288, 830, 2316, 2301, 2312, 2318, 4497, 2319, 2322, 1548, 2321, 3503, 3504, 3505, 2320, 3506, 3507, 3508, 3509, 3510, 3511, 839, 2329, -2541, 3501, 2330, 2333, 2334, 1549, 4098, 2335, 2350, 854, 2344, 2340, 4568, 2341, 3979, 2351, 2355, 3415, 2352, 2356, 2357, 2358, 2361, 4609, -2541, 2364, -2541, -2541, 2367, 2368, 2378, 2385, 4773, 2369, 2373, 2374, 2388, 1494, 2386, 2400, 816, 2046, 2403, 2393, 2394, 2407, 2047, 2398, 2426, 2399, 2402, 2409, 4668, 816, 180, 1550, 816, 1188, 2410, 2427, 2433, 2432, -2541, 3502, 2404, -2541, -2541, -2541, 2415, 4459, 4460, 4461, 4462, 4463, 1969, 2416, 2428, 2438, 1323, 2454, 2442, 180, 2465, 2050, 2461, 2467, 2468, 1323, 2470, 2474, 2475, 2476, 2477, 1323, 3594, 1323, 2478, 2484, 1323, 2485, 2486, 3501, 2487, 1323, 1323, 1323, 1323, 2488, 2469, 1323, 1323, 1323, 1323, 1323, 1323, 1323, 1323, 1323, 1323, 2494, 2492, 2495, 1323, 1323, 2500, 2503, 2504, 620, 829, 2507, 2052, 2521, 1323, 2518, 2512, 830, 1323, 2532, 4741, 1566, 1323, 1551, 4566, 3609, 2737, 2536, 2493, 2537, 1323, 2540, 2545, 1323, 2556, 1323, 830, 2559, 2562, -2637, 2563, 2572, 3594, 2576, 1323, 3502, 2582, 1323, 1323, 3609, 2584, 2579, 1323, 1323, 2588, 2593, 2599, 4102, 2601, 1323, 4592, 2602, 2609, 2606, 2610, 4502, 816, 816, 816, 595, 2611, 1552, 3595, 4124, 1553, 2613, 2607, 4124, 4138, 4124, 4106, 4107, 4108, 4109, 1323, 2391, 2612, 2620, 2622, 2623, 2624, 2625, 2638, 2639, 2653, 2036, 4600, 2675, 2037, 4614, 2683, 3502, 992, 2054, 2696, 184, 2709, 2742, 2747, 1323, 2791, 2797, 990, 2037, 2801, 2810, 4539, 1555, 2830, 2816, 4629, 3592, 4681, 2850, 3592, 2828, 2851, 2043, 4178, 1944, 1944, 2865, 2463, 2870, -2637, 2873, 2874, 2875, 3503, 3504, 3505, 2876, 3506, 3507, 3508, 3509, 3510, 3511, 2889, 854, 854, 854, 854, 837, 2901, 2903, 2904, 2918, 2902, 2045, 2920, 2927, 1557, 2929, 2926, 2955, 2960, 2028, 2958, 2962, 3594, 2963, 2969, 4640, 2974, 2979, 2980, 2982, 2295, 2984, 3592, 3005, 3594, 4113, 1558, 4656, 4118, 2994, 2986, 2990, 3004, 4705, 3008, 3021, 3022, 3027, 1338, 4232, 2392, 5000, 3045, 3046, 2055, 1342, 1560, -2637, -2637, -2637, 180, 2059, 2060, 2061, 2062, 2063, 2064, 3059, 3038, 3064, 3065, 3093, 3090, 3091, 3108, 3100, 3112, 3132, 3545, 3609, 3136, 3192, 3204, 3215, 3230, 3235, 3211, 5046, 3212, 3236, 3503, 3504, 3505, 5080, 3506, 3507, 3508, 3509, 3510, 3511, 838, 3224, 3237, 3243, 4277, 3259, 3272, 3271, 3286, 4647, 4648, 3288, 4650, 3290, 3248, 3301, 3292, 3310, 3313, 3319, 3304, -2637, 4698, 3318, 3320, 3321, -2637, 3322, 3326, 3329, 3334, 3331, 2036, 3333, 5070, 2037, 5072, 3337, 3338, 3356, 3357, 3359, 3360, 3361, 4317, 3363, 3503, 3504, 3505, 3366, 3506, 3507, 3508, 3509, 3510, 3511, 3369, 4745, 3368, 3370, 1862, 3594, 3384, -2637, 2043, 3399, 4890, 3396, 3403, 3398, 3371, -2637, 3372, 3418, 3405, 3376, 854, 3419, 3385, 3420, 3421, 3422, 1909, 1906, 1871, 3423, 3431, 2710, 3433, 816, 3434, 854, 3435, 1323, 3445, 3442, 2045, 1185, 3452, 3450, 816, 3459, 3457, 3460, 3456, 3478, 4362, 3481, -2132, 3479, 2052, 3464, 3480, 3492, 1969, 3542, 2295, 3485, -2543, 3547, 3486, 3488, 3491, 3514, 3530, 3520, 3527, 2118, 3541, 3555, 3564, 816, 3605, 3619, 3565, 3595, 594, 3567, 3594, 594, 3568, 3571, 3569, 3606, 3594, 3191, 3611, 3617, -1719, 3628, 3616, 3633, 3640, 3636, 4410, 3635, 3596, 3641, 3621, 3644, 3647, 3656, 3682, 3556, 816, 3649, 3671, 3684, 2463, 4935, 3672, 4420, 3689, 3690, 3691, 1323, 1323, 3707, 3688, 3694, 3706, 3709, 5225, 3717, 3715, 3716, 3735, 3592, 3725, 3752, 5177, 3754, 3756, 3760, 3759, 594, 3765, 1548, 3804, 899, 3763, -2637, 3783, 3098, 4839, 3098, -2637, 1966, 3767, -2543, 3768, -2637, 816, 3781, 3782, 3784, 1549, 3785, 5008, 3786, 3788, 3787, 3789, 3796, 3415, 3800, 1323, 3802, 5231, 5233, 3790, 3791, 3793, 3795, 2424, 3792, 3813, 3814, 3794, 3797, 2774, 3806, 3807, 3809, 3815, 3820, 3594, 3833, -2637, 3585, 3824, 3825, 3827, 3817, 4863, 3882, 3885, 3886, 4858, -2543, 3835, 3888, 1323, 3875, 3890, 3876, 1550, 4221, 3893, 3904, 3905, -2543, 3907, 1323, 2224, 3917, -2543, 180, 3914, 3923, 3924, -2543, 3928, 3930, 3943, 3952, 3961, -2543, 3963, 1226, -2543, 3972, 3496, 3965, -2543, 2052, 3497, 3498, 3499, 3980, -2637, 3927, 3959, 1323, 3999, 3988, 1323, 2059, 2060, 2061, 2062, 2063, 2064, 4001, 1323, 1323, 5180, 3986, 3960, 3989, 4741, 1323, 1323, -2543, 3973, 3990, 1323, 5082, 3991, 4222, 3992, 1323, 4002, 5004, 1323, 1323, 4012, 3994, 4003, 1323, 4527, 4013, 4014, -2543, 4016, 1323, 816, 816, 816, 816, 4017, 4018, 1551, 4124, 4138, 4124, 4019, 1323, 4124, 4020, 4024, 4541, 3517, 3496, -2131, 3595, 1990, 3516, 4075, 3595, 4086, 5330, 2030, 4116, 4099, 4556, 4144, 4058, 4140, 4033, 4157, 4154, 4059, 4087, -2543, 4162, -2637, -2543, 4060, 4067, 901, 4090, 4572, -2543, 4146, 4105, 1969, 1323, 4117, 4150, 1552, 4125, 4148, 1553, 4170, 4191, 4193, 4206, 4194, 4208, 747, 4199, 4207, 1323, 2391, 4209, 4223, 3592, 4211, 4213, 4215, 3592, 4216, 4230, 4233, 4248, 4245, 4246, 4260, 4261, 5065, 5066, 5225, 3098, 3098, 3799, 4262, 5238, 4247, 4272, 4263, 4274, 4258, 4275, 4259, 4285, 1555, 4286, 4291, -2543, 594, 2295, 4294, 4309, 4311, 4313, 4221, 4324, 4316, 4325, 4605, 4327, 4354, 4328, 4368, 4613, 4331, 4343, 4374, 4612, 4389, 4382, 4392, 2662, 4394, 4395, 4401, 4388, 4890, 3585, 4411, 4417, 1969, 3585, 4418, -2637, 4428, 1969, 1969, 4433, 3501, 1557, 2059, 2060, 2061, 2062, 2063, 2064, 4436, 4434, 4437, 4438, 4439, 4446, 752, 4448, 4452, 2036, 4465, 4469, 2037, 4471, 4441, 1558, 1323, 4442, 5018, 4477, 597, 4500, 4489, -2133, 4544, 4503, 4504, 2774, 4484, 5018, 4493, 4552, 4537, -2543, 4494, 1560, 4505, 4224, 854, 4542, 4225, 2043, 4509, 4545, 4524, 4540, 4553, 4557, -2637, 4558, 4559, 2774, 4560, 854, 3502, 4567, 4565, -2543, 4569, -2543, -2543, 4571, 4573, 5169, 4578, 5200, 4579, 5440, 5441, 4584, 4588, 4607, 4608, 2045, 4611, 4617, 4618, 4619, 4630, 4637, 5186, 4633, 4639, 5301, 5188, 1323, 5190, 4642, 4651, 4643, 4669, 4660, 4659, 4672, 4673, -2543, 4665, 4679, -2543, -2543, -2543, 595, 5074, 4678, 4682, 4687, 5153, 2295, 4688, 4693, 5069, 4697, 4694, 4695, 4701, 4703, 1944, 4711, 4724, 4714, 4719, 4726, 1053, 4730, 4731, 4733, 4735, 4737, 4746, 899, 4738, 1323, 4751, 4739, 4764, 4767, 4768, 4774, 4775, 4777, 4091, 2322, 4808, 4798, 854, 4783, 3328, 4784, 4785, 4786, 4801, 4717, 4812, 4792, 4830, 4833, 4844, 4827, 4848, 4846, 4849, 4854, 4885, 4855, 4860, 4905, 4353, 4916, 3609, 5197, 4914, 4923, 4866, 4864, 4867, 4941, 4871, 4876, 4942, 899, 816, 4877, 594, -2637, 4878, 4917, 594, 4920, -2637, 4949, 4954, 4922, 3979, 4961, 4983, 4985, 4951, 3415, 4757, 4759, 4959, 4986, 4987, 4994, 597, 4996, 5007, 5011, 5017, 5021, 5024, 5028, 5032, 597, 874, 5030, 5041, 5049, 5051, 5052, 5064, 597, 5058, 874, 597, -2637, 5098, 5096, 5108, 5104, 5111, 1323, 5118, 5123, 5130, 5144, 5142, 874, 5185, 5109, 5129, 5143, 5146, 5154, 5138, 5145, 5155, 3503, 3504, 3505, 5157, 3506, 3507, 3508, 3509, 3510, 3511, 180, 5156, 5176, 1323, 1323, 5159, 5168, 1323, 5189, 2774, 5193, 5192, 5194, 5230, 5211, 2052, 5236, 5207, 5237, 5242, 5244, 5247, 595, 5254, 5251, 4124, 5255, 5275, 5276, 3595, 5278, 5284, 5285, 5288, 3595, 5297, 5277, 3595, 595, 5323, 3191, 4100, 4814, 5325, 1323, 1323, 5299, 180, 180, 5305, 5315, 5317, 5331, 5240, 1053, 5333, 5340, 5341, 2036, 5455, 5241, 2037, 4178, 901, 854, 854, 854, 5360, 5380, 5342, 5375, 5387, 5399, 5394, 3592, 5404, 5407, 5413, 4862, 5434, 5448, 3592, 5444, 5442, 5467, 5466, 3592, 5470, 5471, 3592, 2043, 5431, 5432, 5469, 5484, 5485, 5492, -2637, 5493, 5495, 1478, 1372, 5497, 5498, 3295, 3603, -2637, 2439, 3165, 3089, 2105, 3700, 866, 901, 3592, 4229, 4236, 5326, 3203, 3250, 4902, 4904, 2045, 5455, 3832, 5224, 5405, 4370, 4960, 4677, 4934, 3638, 3417, 5318, 4837, 2036, 5401, 5245, 2037, 5243, 5339, 5455, 5418, 3585, 3643, 4421, 4400, 5205, 3585, 4363, 3269, 3585, 3270, 4234, 3719, 866, 4387, 3892, 816, 4684, 1568, 4699, 4940, 3260, 3900, 5367, 5369, 2043, 4945, 5406, 4362, 5499, 5489, 816, -2637, 2774, 3838, 4918, 816, 4429, 3098, 5344, 4865, 5060, 2511, 5213, 4868, 2295, 754, 4094, 4939, 1963, 4466, 5036, 5460, 2581, 5069, 2932, 3629, 2045, 4430, 2578, 2589, 5447, 816, -2637, 5152, 1054, 4410, 1130, 2703, 2626, 2059, 2060, 2061, 2062, 2063, 2064, 2704, 3803, 2705, 4264, 854, 816, 4178, 3896, 4831, 4284, 4975, 5365, 5483, 2201, -2637, 2888, 1351, 2879, 1373, -2637, 2651, 2652, 4977, 4993, 4760, 5373, 4456, 5367, 5369, 4178, 2078, 1323, 3607, 2917, 3618, 4147, 5309, 2151, 2150, 2898, 5191, 1323, 4563, 2916, 1323, 2155, 1323, 2119, 4095, 830, 4120, 4535, 4550, 4114, 5175, 5023, -2637, 5174, 3592, 4115, 4457, 5486, 5386, 5443, 5300, 1323, 5003, 2600, 4069, 4829, 5312, 1323, 5311, 3473, 2855, 3595, 3562, 5385, 180, 4814, 3226, 3592, 3560, 0, 2864, 1323, 1053, 0, 0, 0, 0, -2637, 0, 0, 5035, 0, -2637, 0, 0, 0, 0, 0, 0, 2052, 0, 0, 0, 0, 0, 0, 0, 816, 0, 1944, 0, 0, 180, 899, 0, 594, 0, 0, 0, 0, 0, 0, 594, 3592, 0, 5367, 5369, 594, 0, -2637, 594, 4810, 0, 0, 1323, 0, 0, 0, 0, 1323, 1323, 0, 0, 0, 854, 854, 854, 854, 0, 0, 0, 0, 0, 0, 0, 594, 0, 0, 0, 0, 0, 874, 2774, 2774, 0, 0, 0, 874, 0, 0, 0, 0, 0, 0, 0, 1323, 2052, 0, 0, 0, 874, 0, 595, 0, 0, 3585, 0, 0, 0, 0, -2637, 0, 0, 0, 0, 2028, 874, 0, 0, 0, 0, 597, 0, 0, 816, 865, 1101, 3595, 0, 0, 597, 874, 0, 0, 0, 0, 0, 597, 0, 874, 597, 0, 0, 0, 0, 5132, 0, 0, 0, 0, 0, 0, 1101, 874, 0, 0, 0, 0, 0, 0, 0, 0, 0, 874, 0, 0, 0, 0, 865, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3592, 0, 0, 0, 0, 0, 0, 0, -2637, 0, 0, 1323, 0, 0, 595, 0, 0, 1323, 0, 0, 0, 5183, 0, 0, 0, 0, 0, 0, 1323, 0, -2637, 0, 1323, 0, 1323, 0, 1323, 2059, 2060, 2061, 2062, 2063, 2064, 854, 0, 901, 0, 0, 1481, 0, 0, 0, 0, 0, 1482, 0, 1323, 0, 594, 0, 0, 0, 3585, 0, 0, 0, 3592, 597, 597, 0, 0, 0, 180, 874, 0, 0, 0, 0, 0, 0, 0, 594, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1944, 1944, 0, 0, 0, 1484, 874, 0, 597, 0, 0, 0, 0, 0, 0, 0, -2637, 0, 0, 874, 0, 0, 0, 2059, 2060, 2061, 2062, 2063, 2064, 0, 0, 854, 0, 0, 0, 0, 594, 0, 5259, 0, 0, 0, 1323, 0, 0, 0, 0, 0, 0, 0, 0, 5271, 0, 0, 0, 2336, 0, 0, 0, 1486, 0, 0, 0, 4178, 0, 2036, 1487, 0, 2037, 1488, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5286, 0, 0, 1323, 1323, 1323, 0, 5322, 0, 3191, 0, 0, 1323, 0, 1489, 0, 0, 2043, 0, 0, 0, 0, 1323, 3592, -2637, 5035, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3592, 0, 0, 0, 0, 0, 866, 0, 0, 0, 597, 597, 1715, 1490, 2045, 0, 0, 0, 0, 597, 0, 854, 0, 0, 0, 0, 1101, 0, 1944, 0, 597, 0, 5110, 0, 0, 0, 597, 0, 0, 597, 0, 0, 0, 0, 0, 0, 0, 0, 5371, 5372, 0, 1101, 0, 0, 2295, 0, 0, 594, 0, 595, 0, 5345, 0, 0, 0, 1323, 1101, 0, 0, 0, 0, 180, 1491, 0, 1492, 4178, 0, 0, 0, 0, 0, 4522, 866, 866, 1493, 0, 3415, 1323, 0, 5370, 0, 0, 184, 1494, 0, 0, 0, 1323, 0, 5368, 0, 5183, 0, 0, 0, 1495, 0, 0, 0, 0, 0, 597, 597, 597, 0, 2713, 0, 0, 0, 0, 0, 854, 0, 594, -2637, 5430, 0, 3592, 0, -2637, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2337, 0, 0, 1497, 1498, 0, 0, 1101, 5271, 854, 854, 0, 0, 0, 4178, 0, 0, 0, 0, 0, 2714, 0, -2637, 180, 0, 5370, 0, 0, 184, 0, 0, 0, 0, 2338, 0, 5368, 0, 0, 0, 0, 0, 0, 1323, 1323, 874, 0, 0, 1854, 0, 0, 0, 180, 2715, 1323, 0, 0, 0, 0, 1323, 0, 3592, 0, 874, 0, 0, 0, 3592, 1872, 0, 2052, 0, 0, 597, 0, 0, 2716, 0, 1883, 0, 0, 874, 1886, 0, 0, 0, 1889, 2717, 1891, 1323, 0, 0, 0, 0, 1899, 0, 0, 0, 0, 1323, 1907, 1500, 0, 1910, 0, 0, 0, 2718, 594, 0, 0, 874, 2719, 0, 854, 0, 0, 4178, 5500, 5501, 594, 0, 0, 0, 0, 1101, 5183, 874, 5370, 0, 595, 184, 5429, 0, 0, 0, 0, 0, 5368, 0, 0, 0, 0, 874, 0, 0, 0, 874, 0, 0, 0, 0, 866, 866, 0, 0, 0, 0, 0, 597, 0, -2637, 0, 2720, 0, 0, 0, 0, 0, 3592, -128, 0, 0, 0, 0, 0, 0, 0, 865, 0, 0, 0, 0, 0, 2721, -2558, 0, 0, 1, 597, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 3, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 597, 597, 597, 0, 597, 0, 0, 0, 6, 0, 0, 0, 0, 0, 5348, 0, 0, 180, 0, 0, 7, 0, 8, 9, 597, 0, 0, 0, 0, 10, 594, 11, 0, 0, 0, 206, 2722, 865, 865, 2723, 0, 0, 12, -2637, 13, 0, 0, 0, 874, 0, 2059, 2060, 2061, 2062, 2063, 2064, 874, 874, 0, -2558, 0, 14, 0, 0, 15, 2724, 0, 0, 2725, 0, 874, 0, 0, 0, 2726, 0, 0, 0, 16, 0, 17, 2727, 0, 0, 18, 0, 0, 0, 0, 0, 19, 0, 597, 0, 0, 0, 597, 597, 20, 0, 21, 0, 0, 0, 0, 0, 22, 594, 0, -2558, 2728, 597, 0, 594, 0, 0, 2729, 1101, 0, 2730, 0, -2558, 23, 1715, 0, 0, -2558, 0, 0, 0, 0, -2558, 0, 0, 0, 0, 0, -2558, 2731, 24, -2558, 0, 0, 0, -2558, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2732, 738, 0, 0, 0, 0, 0, 738, 0, 0, -2558, 0, 0, 0, 0, 0, 25, 26, 0, 0, 0, 1101, 27, 0, 0, 0, 0, 0, 0, 0, -2558, 0, 0, 0, 28, 0, 1481, 0, 0, 0, 0, 0, 1482, 0, 0, 0, 29, 0, 0, 0, 0, 0, 594, 0, 0, 1483, 0, 0, 0, 0, 0, 2036, 1101, 0, 2037, 5488, 0, 0, 2038, 2039, 2040, -2558, 0, 0, -2558, 0, 0, 0, 0, 0, -2558, 0, 30, 0, 1484, 2041, 0, 865, 865, 0, 31, 0, 0, 2043, 0, 1101, 0, 0, 0, 0, 2044, 0, 0, 0, 32, 0, 0, 0, 0, 0, 33, 34, 0, 35, 0, 0, 0, 0, 36, 0, 0, 0, 0, 37, 0, 2045, 38, 0, 0, 0, 0, 0, 0, 39, 1485, 0, -2558, 0, 1486, 40, 41, 0, 0, 0, 0, 1487, 0, 42, 1488, 0, 0, 43, 0, 0, 874, 0, 0, 0, 0, 0, 0, 44, 0, 0, 0, 0, 0, 0, 0, 597, 597, 597, 0, 1489, 0, 0, 45, 2036, 0, 0, 2037, 0, 0, 0, 2038, 2039, 2040, 0, 0, 0, 0, 752, 0, 0, 0, 0, 46, 0, 0, 0, 0, 2041, 0, 0, 0, 0, 47, 1490, 0, 2043, 0, 0, 48, 0, 0, 0, 2044, 49, -2558, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 50, 0, 0, 0, 0, 2046, 0, 0, 0, 0, 2047, 2045, -2558, 0, -2558, -2558, 0, 0, 0, 0, 0, 0, 0, 51, 0, 0, 0, 0, 0, 0, 0, 0, 2048, 2049, 0, 0, 1491, 52, 1492, 0, -128, 0, 1101, 0, 0, 0, 0, 2050, 1493, 0, -2558, 0, 0, -2558, -2558, -2558, 0, 1494, 0, 1101, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1495, 0, 0, 1715, 0, 0, 0, 0, 1101, 0, 0, 2051, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2052, 0, 874, 2053, 0, 0, 0, 0, 0, 0, 874, 0, 0, 0, 1496, 0, 0, 1497, 1498, 0, 0, 0, 874, 0, 0, 0, 0, 2046, 0, 0, 0, 0, 2047, 0, 0, 0, 0, 0, 0, 1101, 0, 0, 0, 0, 0, 0, 597, 1499, 0, 597, 0, 0, 1101, 0, 2048, 2049, 0, 0, 597, 0, 0, 0, 0, 0, 1101, 0, 0, 0, 0, 2050, 0, 0, 0, 0, 0, 0, 1101, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2054, 0, 597, 597, 0, 874, 874, 0, 0, 0, 0, 2051, 0, 0, 0, 0, 0, 597, 0, 874, 597, 0, 0, 1500, 0, 2052, 0, 0, 2053, 1101, 1101, 0, 874, 874, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2621, 0, 0, 0, 0, 874, 0, 0, 2628, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2640, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 597, 0, 0, 597, 597, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2055, 0, 0, 2056, 2057, 2058, 0, 2059, 2060, 2061, 2062, 2063, 2064, 0, 0, 0, 0, 2054, 0, 0, 3487, 597, 0, 597, 0, 0, 0, 0, 597, 597, 0, 0, 0, 0, 0, 597, 597, 597, 0, 0, 0, 597, 0, 597, 597, 597, 597, 597, 597, 0, 597, 0, 597, 597, 0, 0, 597, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1101, 597, 597, 597, 597, 1715, 0, 0, 0, 597, 0, 0, 0, 597, 0, 0, 597, 0, 0, 597, 597, 597, 597, 597, 597, 597, 597, 597, 0, 597, 0, 0, 0, 0, 0, 0, 597, 0, 597, 0, 0, 0, 0, 0, 0, 0, 2055, 0, 0, 2056, 2057, 2058, 0, 2059, 2060, 2061, 2062, 2063, 2064, 0, 0, 0, 2036, 0, 0, 2037, 3537, 0, 0, 2038, 2039, 2040, 0, 0, 0, 874, 0, 0, 0, 0, 0, 597, 0, 0, 0, 0, 2041, 0, 0, 0, 0, 0, 0, 0, 2043, 0, 597, 0, 0, 0, 0, 2044, 0, 0, 0, 597, 597, 0, 2877, 0, 0, 0, 0, 0, 0, 0, 0, 738, 0, 738, 0, 738, 0, 0, 0, 0, 2045, 738, 1173, 1174, 874, 0, 0, 0, 0, 0, 0, 1101, 2035, 0, 0, 1101, 1101, 2036, 0, 0, 2037, 0, 874, 0, 2038, 2039, 2040, 1715, 874, 0, 0, 0, 874, 0, 0, 0, 0, 0, 0, 0, 874, 2041, 0, 0, 2042, 0, 0, 0, 0, 2043, 0, 0, 2235, 0, 0, 0, 2044, 2236, 874, 0, 0, 597, 0, 872, 0, 0, 0, 0, 0, 0, 0, 0, 908, 597, 0, 0, 0, 1101, 0, 0, 597, 2045, 0, 597, 597, 0, 929, 0, 0, 0, 0, 1101, 2237, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 874, 2238, 0, 0, 0, 0, 2046, 0, 0, 0, 0, 2047, 0, 0, 0, 0, 2239, 0, 0, 874, 874, 0, 0, 0, 0, 0, 0, 0, 1101, 0, 0, 0, 0, 2048, 2049, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 738, 0, 0, 2050, 0, 0, 1715, 874, 0, 0, 1715, 0, 2240, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2241, 0, 0, 0, 0, 0, 0, 0, 0, 874, 0, 1715, 0, 2051, 0, 0, 874, 0, 0, 2046, 2242, 0, 874, 0, 2047, 2243, 0, 2052, 3347, 874, 2053, 0, 0, 874, 0, 0, 0, 0, 874, 0, 0, 664, 0, 0, 0, 0, 2048, 2049, 0, 1452, 751, 0, 0, 0, 0, 0, 0, 0, 874, 0, 0, 2050, 0, 874, 0, 0, 0, 874, 0, 0, 1715, 0, 0, 0, 0, 0, 0, 0, 0, 0, 874, 0, 0, 1453, 0, 0, 0, 0, 0, 0, 0, 0, 0, 874, 2051, 0, 0, 2244, 1481, 0, 0, 0, 0, 874, 1482, 0, 0, 0, 2052, 0, 0, 2053, 0, 0, 0, 0, 0, 0, 2054, 0, 597, 597, 597, 0, 0, 0, 597, 0, 0, 0, 0, 2245, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1455, 0, 0, 0, 1484, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 597, 1101, 0, 0, 0, 0, 0, 206, 2246, 0, 1715, 0, 0, 0, 0, 0, 0, 0, 0, 1456, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2247, 2054, 1486, 0, 597, 0, 2248, 0, 0, 1487, 3348, 0, 1488, 2249, 0, 1457, 2250, 0, 0, 2055, 0, 0, 2056, 2057, 2058, 0, 2059, 2060, 2061, 2062, 2063, 2064, 0, 0, 0, 0, 2800, 1489, 0, 0, 0, 0, 0, 1101, 0, 0, 1101, 0, 2251, 1458, 0, 874, 0, 738, 0, 2252, 0, 0, 0, 0, 597, 0, 0, 2253, 0, 0, 0, 0, 0, 0, 2254, 1490, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1460, 0, 0, 0, 0, 0, 1423, 0, 0, 0, 3362, 0, 0, 0, 2255, 0, 0, 3367, 0, 2055, 0, 0, 2056, 2057, 2058, 874, 2059, 2060, 2061, 2062, 2063, 2064, 0, 0, 0, 0, 0, 3386, 1010, 0, 0, 0, 36, 0, 1010, 0, 3349, 3392, 0, 1491, 3393, 1492, 3394, 3395, 0, 1463, 3397, 1010, 0, 0, 0, 1493, 3401, 1464, 3402, 0, 0, 3404, 0, 874, 1494, 2280, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1495, 1466, 0, 1101, 0, 874, 0, 0, 0, 0, 1467, 0, 0, 874, 1468, 0, 0, 597, 0, 0, 1101, 0, 0, 597, 0, 0, 597, 0, 0, 597, 0, 0, 0, 3350, 1452, 1101, 0, 0, 0, 1612, 0, 0, 1497, 1498, 0, 0, 597, 0, 0, 0, 3453, 597, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1469, 1453, 0, 0, 3351, 1613, 0, 597, 597, 597, 738, 0, 597, 0, 0, 738, 738, 0, 0, 0, 597, 597, 597, 597, 0, 0, 0, 0, 1715, 738, 0, 1454, 0, 597, 1715, 0, 597, 0, 597, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 597, 597, 0, 0, 597, 0, 0, 0, 0, 0, 0, 1455, 0, 0, 0, 0, 0, 0, 597, 0, 597, 0, 597, 1500, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 597, 0, 0, 0, 1456, 2036, 0, 0, 2037, 0, 0, 597, 2038, 2039, 2040, 0, 0, 0, 0, 874, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2041, 0, 738, 0, 0, 0, 597, 0, 2043, 0, 0, 1457, 738, 0, 0, 2044, 0, 0, 0, 0, 0, 597, 0, 0, 0, 0, 0, 0, 0, 2036, 0, 0, 2037, 0, 0, 597, 2038, 2039, 2040, 0, 2045, 0, 0, 0, 1101, 1458, 0, 1101, 0, 1101, 0, 0, 1481, 2041, 1101, 1173, 1174, 0, 1482, 0, 0, 2043, 0, 0, 0, 0, 0, 0, 2044, 874, 874, 1583, 0, 0, 0, 597, 1459, 1460, 0, 0, 0, 0, 0, 1423, 0, 986, 0, 0, 0, 0, 0, 0, 0, 2045, 0, 0, 874, 0, 738, 874, 1484, 738, 738, 1101, 0, 0, 0, 0, 3347, 0, 0, 0, 0, 0, 0, 1461, 0, 0, 0, 36, 3648, 0, 1101, 1462, 0, 0, 0, 0, 0, 1452, 0, 0, 1463, 0, 0, 0, 0, 1052, 664, 0, 1464, 0, 0, 0, 0, 0, 0, 1101, 1465, 0, 2046, 0, 1584, 0, 1486, 2047, 0, 0, 0, 0, 1466, 1487, 0, 1453, 1488, 0, 0, 0, 0, 1467, 0, 0, 0, 1468, 0, 0, 0, 2048, 2049, 0, 0, 0, 0, 0, 1715, 1715, 1715, 0, 0, 1489, 0, 0, 2050, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2046, 3708, 0, 3710, 874, 2047, 0, 0, 0, 0, 0, 0, 0, 0, 1101, 0, 1101, 0, 0, 1455, 1490, 0, 2051, 1469, 874, 0, 0, 2048, 2049, 0, 0, 0, 1197, 0, 0, 0, 2052, 0, 0, 2053, 0, 0, 2050, 874, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1456, 0, 0, 0, 1217, 0, 0, 0, 0, 0, 0, 0, 1326, 0, 0, 1335, 1052, 1337, 0, 0, 0, 2051, 0, 0, 738, 1491, 0, 1492, 0, 0, 0, 3348, 0, 0, 0, 2052, 1457, 1493, 2053, 0, 0, 0, 0, 0, 0, 2036, 1494, 0, 2037, 0, 0, 1101, 2038, 2039, 2040, 0, 0, 0, 1495, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2041, 1458, 874, 0, 2054, 0, 0, 597, 2043, 0, 0, 0, 0, 597, 0, 2044, 3798, 0, 0, 0, 0, 1101, 3805, 0, 0, 0, 0, 0, 1585, 0, 0, 1497, 1498, 1460, 0, 0, 0, 0, 0, 1423, 2045, 0, 0, 0, 0, 0, 0, 0, 0, 1715, 1101, 0, 0, 0, 0, 0, 874, 2054, 874, 0, 0, 1586, 2595, 0, 0, 0, 0, 0, 0, 0, 0, 874, 2603, 874, 2604, 36, 0, 0, 0, 1462, 2608, 0, 0, 0, 0, 0, 0, 2614, 1463, 0, 0, 0, 0, 0, 0, 1715, 1464, 0, 0, 0, 0, 0, 0, 2055, 2280, 0, 2056, 2057, 2058, 0, 2059, 2060, 2061, 2062, 2063, 2064, 1466, 0, 0, 1101, 3834, 0, 0, 0, 0, 1467, 3516, 0, 1500, 1468, 0, 3517, 0, 0, 0, 0, 0, 0, 0, 874, 1101, 0, 0, 0, 0, 0, 0, 0, 3350, 0, 2046, 0, 0, 0, 1101, 2047, 2055, 0, 0, 2056, 2057, 2058, 0, 2059, 2060, 2061, 2062, 2063, 2064, 0, 0, 0, 0, 4026, 0, 0, 0, 2048, 2049, 0, 0, 0, 1469, 0, 0, 0, 3351, 0, 0, 0, 874, 0, 2050, 0, 0, 2036, 0, 0, 2037, 0, 0, 0, 2038, 2039, 2040, 0, 0, 0, 0, 0, 0, 0, 0, 3962, 0, 3964, 0, 3966, 874, 2041, 0, 2748, 2749, 0, 0, 2051, 3970, 2043, 2763, 2764, 0, 0, 0, 0, 2044, 0, 0, 0, 0, 2052, 874, 0, 2053, 874, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2802, 0, 0, 2045, 0, 0, 0, 597, 0, 0, 1101, 0, 0, 0, 0, 0, 597, 0, 0, 0, 0, 4010, 597, 0, 597, 0, 0, 597, 0, 0, 1052, 1101, 597, 597, 597, 597, 0, 0, 597, 597, 597, 597, 597, 597, 597, 597, 597, 597, 1052, 0, 0, 597, 597, 0, 0, 0, 1101, 0, 0, 0, 0, 597, 0, 0, 0, 597, 0, 1715, 0, 597, 0, 0, 0, 0, 2054, 0, 0, 597, 0, 0, 597, 0, 597, 0, 1968, 0, 0, 0, 0, 0, 1101, 597, 0, 0, 597, 597, 0, 0, 0, 597, 597, 0, 0, 0, 0, 1481, 597, 0, 0, 2907, 2907, 1482, 0, 2046, 1052, 0, 597, 0, 2047, 597, 0, 0, 0, 0, 0, 0, 0, 2036, 0, 0, 2037, 597, 0, 0, 2038, 2039, 2040, 0, 0, 0, 2048, 2049, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2041, 0, 1484, 0, 2050, 597, 0, 0, 2043, 0, 0, 0, 1101, 0, 0, 2044, 0, 2437, 0, 738, 0, 0, 2055, 0, 597, 2056, 2057, 2058, 0, 2059, 2060, 2061, 2062, 2063, 2064, 0, 0, 2051, 0, 2032, 2045, 0, 0, 0, 0, 0, 0, 0, 2034, 0, 0, 2052, 0, 0, 2053, 874, 1486, 0, 0, 0, 0, 0, 2076, 1487, 0, 0, 1488, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1052, 0, 0, 2093, 2094, 0, 0, 0, 1052, 1052, 1489, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1052, 0, 0, 1715, 0, 0, 0, 1481, 1715, 1101, 1715, 3041, 0, 1482, 0, 0, 0, 0, 0, 0, 0, 0, 1490, 0, 0, 0, 1583, 0, 0, 0, 0, 0, 1715, 1101, 0, 0, 0, 0, 0, 2054, 0, 0, 0, 0, 0, 0, 0, 2046, 0, 0, 0, 1715, 2047, 0, 0, 1484, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 874, 0, 0, 874, 0, 0, 0, 2048, 2049, 0, 0, 0, 0, 0, 1491, 0, 1492, 0, 0, 2522, 0, 0, 2050, 0, 0, 738, 1493, 2539, 0, 0, 0, 0, 0, 738, 0, 1494, 738, 0, 0, 2437, 1584, 0, 1486, 0, 0, 0, 0, 1495, 0, 1487, 0, 0, 1488, 0, 0, 2051, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 597, 0, 2052, 0, 2055, 2053, 0, 2056, 2057, 2058, 1489, 2059, 2060, 2061, 2062, 2063, 2064, 1452, 0, 2259, 0, 4078, 1497, 1498, 0, 874, 874, 0, 0, 1101, 0, 0, 0, 0, 0, 874, 0, 0, 0, 0, 0, 0, 597, 0, 1490, 0, 0, 2619, 0, 0, 0, 1453, 2260, 0, 874, 0, 0, 0, 2036, 0, 0, 2037, 0, 0, 0, 2038, 2039, 2040, 0, 0, 0, 0, 2396, 0, 2437, 0, 0, 1101, 2401, 0, 0, 1101, 597, 597, 0, 0, 0, 0, 0, 0, 2043, 0, 0, 2054, 0, 0, 0, 2044, 0, 2036, 0, 0, 2037, 1491, 0, 1492, 2038, 2039, 2040, 0, 1455, 0, 0, 0, 0, 1493, 0, 0, 0, 1500, 0, 0, 2045, 2041, 1494, 0, 0, 0, 0, 0, 0, 2043, 0, 597, 0, 0, 1495, 0, 2044, 0, 0, 0, 0, 0, 874, 1456, 0, 0, 0, 4445, 0, 0, 0, 4447, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2045, 0, 0, 0, 0, 0, 597, 0, 0, 0, 0, 0, 3162, 0, 0, 1497, 1498, 597, 1457, 0, 0, 0, 3373, 3375, 0, 0, 0, 0, 3383, 2055, 0, 0, 2056, 2057, 2058, 0, 2059, 2060, 2061, 2062, 2063, 2064, 0, 0, 0, 3163, 4172, 597, 0, 0, 597, 0, 1458, 0, 0, 0, 0, 0, 597, 597, 0, 1101, 0, 0, 0, 597, 597, 0, 0, 2046, 597, 1101, 0, 0, 2047, 597, 0, 0, 597, 597, 0, 0, 0, 597, 1460, 0, 0, 0, 0, 597, 1423, 738, 0, 0, 0, 0, 2048, 2049, 0, 0, 0, 597, 0, 0, 0, 0, 0, 0, 0, 597, 2046, 2050, 1500, 597, 0, 2047, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2533, 36, 0, 2279, 2538, 1462, 0, 0, 0, 0, 0, 0, 2048, 2049, 1463, 0, 597, 0, 0, 2051, 0, 0, 1464, 0, 0, 0, 0, 2050, 0, 0, 2280, 0, 597, 2052, 0, 0, 0, 0, 0, 0, 0, 0, 1466, 0, 0, 0, 0, 0, 0, 0, 1101, 1467, 2923, 0, 0, 1468, 0, 0, 0, 0, 2051, 0, 0, 0, 0, 0, 0, 874, 0, 0, 2939, 0, 1715, 0, 2052, 0, 2943, 2053, 0, 0, 2946, 0, 0, 4591, 0, 0, 0, 0, 0, 1101, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 874, 2970, 0, 1469, 0, 1101, 0, 0, 0, 0, 0, 0, 874, 0, 0, 0, 0, 0, 0, 2054, 4615, 4616, 0, 0, 0, 0, 0, 0, 597, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1481, 874, 0, 0, 0, 0, 1482, 0, 0, 3025, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3601, 0, 738, 2054, 0, 0, 0, 0, 0, 1010, 0, 0, 0, 1101, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3614, 3614, 0, 0, 1484, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 597, 0, 3075, 0, 0, 0, 0, 0, 0, 4657, 4658, 0, 0, 0, 0, 0, 597, 2759, 0, 0, 0, 2055, 0, 0, 2056, 2057, 2058, 3103, 2059, 2060, 2061, 2062, 2063, 2064, 3113, 0, 0, 0, 0, 874, 3118, 0, 0, 1486, 0, 0, 597, 1010, 0, 0, 1487, 3133, 0, 1488, 0, 0, 3137, 0, 0, 0, 0, 0, 2055, 0, 0, 2056, 2057, 2058, 0, 2059, 2060, 2061, 2062, 2063, 2064, 0, 3150, 0, 1489, 4485, 0, 3152, 0, 0, 0, 3155, 0, 0, 0, 0, 0, 1101, 0, 1101, 0, 0, 0, 0, 3172, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2872, 0, 0, 3197, 1490, 0, 0, 0, 0, 0, 0, 0, 0, 1010, 0, 0, 0, 0, 0, 0, 874, 0, 0, 0, 0, 4753, 0, 4754, 4755, 0, 0, 0, 0, 0, 0, 0, 0, 0, 597, 0, 0, 0, 1101, 0, 0, 0, 0, 0, 0, 2036, 0, 0, 2037, 0, 4769, 0, 2038, 2039, 2040, 0, 0, 0, 0, 1491, 0, 1492, 0, 597, 597, 0, 0, 597, 0, 2041, 0, 1493, 0, 0, 0, 0, 0, 2043, 0, 0, 1494, 0, 597, 0, 2044, 0, 0, 0, 0, 597, 0, 0, 1495, 0, 597, 0, 0, 597, 597, 0, 0, 0, 0, 0, 597, 597, 0, 1052, 0, 2045, 0, 0, 0, 0, 0, 0, 874, 0, 874, 0, 0, 0, 597, 0, 0, 0, 603, 0, 0, 0, 0, 3034, 653, 603, 1497, 1498, 0, 0, 705, 0, 603, 0, 0, 0, 0, 0, 603, 0, 0, 760, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1101, 874, 1499, 0, 0, 0, 827, 827, 0, 0, 597, 0, 0, 0, 0, 0, 1337, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2036, 0, 0, 2037, 0, 0, 0, 2038, 2039, 2040, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1715, 0, 0, 0, 0, 597, 0, 0, 0, 2046, 0, 0, 0, 2043, 2047, 0, 0, 0, 0, 0, 2044, 1500, 0, 0, 0, 0, 738, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2048, 2049, 0, 0, 0, 0, 0, 0, 3430, 2045, 0, 1337, 0, 0, 3881, 2050, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4964, 3444, 0, 1337, 0, 0, 0, 0, 0, 3430, 0, 0, 0, 597, 0, 1101, 0, 0, 0, 0, 0, 0, 0, 2051, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 597, 2052, 597, 0, 2053, 0, 0, 0, 861, 0, 0, 0, 597, 1101, 0, 597, 903, 597, 0, 905, 0, 0, 910, 911, 0, 914, 0, 916, 3200, 0, 922, 0, 924, 1481, 0, 0, 597, 0, 3956, 1482, 0, 0, 597, 4999, 0, 0, 597, 0, 0, 0, 0, 0, 1101, 0, 0, 0, 597, 0, 2046, 0, 0, 0, 3229, 2047, 0, 3229, 0, 3229, 0, 0, 0, 3229, 0, 3229, 3229, 0, 0, 0, 0, 0, 0, 1484, 3229, 3229, 3229, -2637, -2637, 0, 0, 0, 0, 1715, 2054, 0, 0, 0, 0, 0, 0, 1101, 2050, 0, 0, 0, 1101, 1101, 0, 5038, 0, 597, 0, 0, 0, 0, 597, 597, 874, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 874, 738, 0, 0, 1481, -2637, 0, 1486, 0, 3305, 1482, 0, 0, 0, 1487, 0, 0, 1488, 0, 2052, 0, 0, 597, 0, 0, 0, 0, 0, 0, 597, 0, 5075, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3336, 1489, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1484, 1052, 597, 0, 0, 0, 0, 0, 0, 0, 0, 2055, 0, 0, 2056, 2057, 2058, 0, 2059, 2060, 2061, 2062, 2063, 2064, 1490, 0, 0, 0, 4523, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1101, 1101, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1486, 0, 1052, 0, 2054, 0, 0, 1487, 0, 3650, 1488, 597, 0, 0, 597, 0, 0, 597, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 597, 1491, 0, 1492, 597, 0, 597, 1489, 597, 0, 0, 0, 0, 1493, 0, 0, 0, 0, 0, 0, 0, 0, 1494, 0, 0, 0, 0, 0, 597, 0, 2036, 0, 0, 2037, 1495, 0, 0, 2038, 2039, 2040, 0, 1490, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1715, 2041, 874, 0, 0, 0, 0, 0, 0, 2043, 0, 0, 0, 0, 0, 0, 2044, 0, 0, 0, 3206, 0, 2055, 1497, 1498, 2056, 2057, 2058, 0, 2059, 2060, 2061, 2062, 2063, 2064, 0, 0, 0, 0, 3730, 0, 2045, 0, 0, 0, 0, 0, 1491, 0, 1492, 0, 0, 597, 3207, 0, 0, 0, 0, 0, 1493, 0, 597, 0, 0, 0, 0, 0, 0, 1494, 0, 0, 0, 0, 597, 0, 0, 0, 0, 0, 0, 1495, 0, 0, 738, 0, 0, 0, 0, 0, 0, 0, 0, 0, 597, 597, 597, 0, 0, 0, 0, 0, 0, 597, 1715, 0, 0, 1101, 738, 0, 0, 0, 0, 597, 0, 738, 0, 0, 874, 0, 1004, 1500, 0, 1497, 1498, 0, 0, 1017, 1018, 0, 0, 1024, 597, 1027, 1028, 0, 0, 0, 1030, 0, 0, 0, 0, 0, 0, 874, 0, 0, 0, 1049, 0, 0, 2046, 1499, 0, 0, 1052, 2047, 0, 0, 0, 3811, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2048, 2049, 0, 0, 0, 0, 597, 0, 0, 1126, 0, 1128, 597, 0, 0, 2050, 0, 0, 1173, 1174, 0, 1144, 597, 0, 0, 0, 0, 0, 0, 597, 597, 0, 0, 0, 597, 0, 0, 0, 0, 0, 0, 1500, 0, 0, 597, 0, 0, 0, 2051, 0, 0, 0, 0, 0, 603, 0, 0, 0, 0, 0, 0, 0, 2052, 0, 0, 2053, 0, 0, 0, 0, 0, 0, 0, 0, 874, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1052, 0, 0, 0, 0, 0, 0, 5397, 0, 0, 0, 0, 0, 597, 0, 0, 0, 0, 0, 597, 0, 738, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2036, 0, 0, 2037, 0, 597, 597, 2038, 2039, 2040, 0, 0, 0, 0, 827, 0, 597, 0, 0, 0, 0, 597, 0, 0, 2041, 2054, 0, 0, 1481, 0, 1715, 0, 2043, 0, 1482, 0, 0, 0, 0, 2044, 0, 0, 2437, 738, 0, 2036, 0, 0, 2037, 3724, 1443, 597, 2038, 2039, 2040, 0, 0, 0, 0, 0, 0, 597, 0, 0, 2045, 0, 0, 0, 0, 2041, 3995, 0, 0, 0, 0, 0, 1484, 2043, 0, 597, 0, 0, 0, 0, 2044, 0, 0, 0, 0, 0, 0, 0, 597, 0, 1715, 4011, 0, 0, 0, 0, 0, 0, 0, 3762, 0, 0, 0, 0, 0, 2045, 0, 0, 1715, 0, 597, 597, 0, 0, 0, 0, 0, 0, 1615, 0, 2055, 0, 0, 2056, 2057, 2058, 1486, 2059, 2060, 2061, 2062, 2063, 2064, 1487, 0, 0, 1488, 4772, 0, 1726, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1737, 0, 0, 0, 0, 1740, 0, 0, 0, 0, 1489, 0, 0, 0, 3801, 1743, 0, 0, 2036, 2046, 1747, 2037, 0, 0, 2047, 2038, 2039, 2040, 0, 1750, 0, 0, 0, 0, 1757, 0, 0, 1761, 0, 0, 0, 0, 2041, 0, 1490, 0, 2048, 2049, 0, 0, 2043, 0, 0, 0, 0, 0, 3229, 2044, 0, 0, 0, 2050, 0, 0, 2046, 0, 0, 0, 0, 2047, 3831, 3831, 0, 0, 0, 0, 0, 0, 0, 1815, 3847, 0, 2045, 0, 0, 0, 1052, 0, 1052, 0, 0, 2048, 2049, 0, 2051, 0, 0, 0, 1452, 0, 0, 0, 0, 1491, 0, 1492, 2050, 0, 2052, 738, 0, 2053, 0, 0, 738, 1493, 0, 0, 738, 0, 0, 0, 0, 0, 1494, 0, 0, 0, 0, 1481, 0, 0, 1453, 0, 3903, 1482, 1495, 0, 0, 2051, 0, 0, 0, 4627, 4628, 0, 0, 0, 4631, 4632, 0, 0, 0, 2052, 0, 0, 2053, 0, 0, 4201, 0, 0, 1522, 0, 0, 0, 0, 0, 3938, 1052, 0, 0, 0, 0, 0, 3676, 0, 1484, 1497, 1498, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1455, 2046, 0, 0, 0, 603, 2047, 603, 2054, 603, 0, 603, 0, 603, 603, 603, 0, 3677, 0, 0, 603, 0, 0, 0, 0, 0, 0, 0, 2048, 2049, 0, 1964, 0, 0, 0, 1456, 0, 0, 0, 0, 1486, 0, 0, 2050, 0, 0, 0, 1487, 0, 2036, 1488, 1977, 2037, 2054, 0, 0, 2038, 2039, 2040, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1457, 0, 2041, 0, 1489, 2051, 0, 0, 0, 0, 2043, 0, 4299, 1500, 0, 4302, 0, 2044, 0, 2052, 0, 0, 2053, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1458, 0, 2055, 0, 1490, 2056, 2057, 2058, 2045, 2059, 2060, 2061, 2062, 2063, 2064, 0, 0, 0, 0, 4782, 0, 2036, 0, 0, 2037, 0, 0, 0, 2038, 2039, 2040, 1523, 1460, 0, 0, 0, 0, 0, 1423, 0, 0, 0, 0, 0, 0, 2041, 0, 2055, 0, 0, 2056, 2057, 2058, 2043, 2059, 2060, 2061, 2062, 2063, 2064, 2044, 0, 0, 1491, 4791, 1492, 4079, 0, 0, 0, 1524, 0, 0, 0, 36, 1493, 2054, 0, 1462, 0, 4384, 0, 0, 0, 1494, 2045, 0, 1463, 0, 0, 0, 0, 0, 0, 0, 1464, 1495, 0, 0, 2437, 0, 867, 876, 1525, 0, 0, 827, 0, 0, 867, 0, 876, 867, 0, 0, 1466, 0, 0, 2046, 0, 0, 0, 0, 2047, 1467, 876, 0, 0, 1468, 0, 0, 0, 0, 0, 0, 3732, 0, 0, 1497, 1498, 0, 0, 0, 0, 0, 2048, 2049, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2050, 0, 0, 0, 0, 0, 0, 0, 3733, 0, 0, 0, 0, 0, 0, 2055, 0, 0, 2056, 2057, 2058, 1469, 2059, 2060, 2061, 2062, 2063, 2064, 2257, 3430, 0, 0, 4794, 2051, 0, 2046, 0, 0, 0, 0, 2047, 0, 0, 0, 0, 0, 0, 2052, 0, 0, 2053, 0, 0, 0, 0, 738, 0, 0, 0, 0, 0, 0, 2048, 2049, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1500, 0, 2050, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2036, 0, 0, 2037, 0, 0, 3847, 2038, 2039, 2040, 0, 0, 2348, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2051, 2041, 0, 0, 0, 0, 0, 4270, 0, 2043, 0, 0, 0, 0, 2052, 4278, 2044, 2053, 4279, 0, 4280, 0, 0, 0, 0, 0, 0, 0, 2054, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2045, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2036, 0, 4319, 2037, 0, 0, 0, 2038, 2039, 2040, 0, 0, 0, 0, 0, 3229, 0, 0, 2036, 3229, 3229, 2037, 3229, 0, 2041, 2038, 2039, 2040, 0, 0, 0, 0, 2043, 0, 0, 0, 0, 0, 0, 2044, 0, 0, 2041, 0, 0, 2054, 0, 0, 0, 0, 2043, 0, 0, 0, 0, 0, 0, 2044, 0, 0, 0, 0, 0, 0, 2045, 0, 0, 2055, 0, 0, 2056, 2057, 2058, 0, 2059, 2060, 2061, 2062, 2063, 2064, 0, 0, 2045, 0, 4835, 0, 0, 0, 0, 0, 0, 2046, 0, 0, 0, 0, 2047, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4624, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2048, 2049, 4634, 0, 4424, 0, 0, 3847, 0, 0, 0, 0, 0, 0, 0, 2050, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2055, 0, 0, 2056, 2057, 2058, 0, 2059, 2060, 2061, 2062, 2063, 2064, 0, 738, 0, 0, 4870, 0, 0, 0, 0, 2051, 0, 0, 0, 0, 0, 0, 2506, 2046, 0, 0, 0, 0, 2047, 2052, 0, 0, 2053, 0, 0, 0, 0, 0, 0, 0, 0, 2046, 0, 0, 0, 0, 2047, 876, 0, 0, 2048, 2049, 0, 876, 0, 0, 4474, 4474, 4474, 0, 4474, 4474, 4474, 4474, 4474, 2050, 876, 0, 2048, 2049, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 876, 2050, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 867, 876, 2051, 0, 0, 0, 0, 867, 0, 876, 867, 0, 0, 0, 0, 0, 2052, 0, 0, 2053, 2051, 0, 0, 876, 2054, 0, 0, 0, 0, 0, 0, 0, 0, 876, 2052, 0, 0, 2053, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2632, 0, 2633, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2644, 0, 2645, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3430, 0, 0, 603, 5222, 603, 0, 603, 4562, 603, 4564, 603, 0, 0, 0, 603, 0, 0, 0, 0, 0, 2054, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 876, 2055, 0, 2054, 2056, 2057, 2058, 0, 2059, 2060, 2061, 2062, 2063, 2064, 0, 0, 0, 0, 4910, 0, 0, 0, 0, 0, 876, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 876, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3430, 0, 3430, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2055, 0, 0, 2056, 2057, 2058, 0, 2059, 2060, 2061, 2062, 2063, 2064, 0, 0, 0, 0, 5216, 2055, 0, 0, 2056, 2057, 2058, 0, 2059, 2060, 2061, 2062, 2063, 2064, 0, 0, 0, 0, 5239, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4654, 4655, 0, 0, 0, 1717, 0, 0, 0, 0, 0, 3229, 0, 3229, 3229, 0, 0, 3229, 0, 0, 0, 0, 0, 867, 0, 0, 0, 0, 0, 867, 0, 0, 867, 0, 0, 0, 0, 0, 0, 2036, 0, 0, 2037, 0, 0, 0, 2038, 2039, 2040, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2041, 0, 0, 0, 0, 2924, 2925, 0, 2043, 0, 0, 0, 0, 0, 0, 2044, 0, 0, 4713, 0, 0, 0, 0, 0, 2940, 2941, 0, 0, 0, 2944, 2945, 0, 0, 0, 2948, 0, 0, 0, 0, 0, 2045, 0, 0, 0, 0, 0, 0, 0, 2959, 0, 0, 0, 0, 0, 0, 2968, 4740, 0, 0, 2971, 2972, 0, 0, 2975, 2976, 0, 0, 0, 0, 0, 2981, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3000, 0, 3002, 0, 0, 0, 0, 0, 0, 0, 0, 2036, 0, 0, 2037, 4474, 0, 0, 2038, 2039, 2040, 3026, 0, 0, 5453, 0, 3028, 0, 0, 0, 0, 0, 0, 876, 0, 2041, 0, 0, 0, 0, 3033, 0, 0, 2043, 0, 0, 0, 0, 0, 3040, 2044, 876, 3044, 0, 0, 3047, 3050, 3052, 0, 0, 0, 0, 3060, 3063, 0, 2046, 0, 0, 0, 876, 2047, 0, 3076, 0, 0, 2045, 0, 3085, 0, 0, 0, 3088, 0, 0, 0, 0, 0, 0, 5453, 0, 0, 0, 2048, 2049, 0, 0, 0, 3104, 0, 876, 0, 0, 0, 0, 3114, 3115, 5453, 2050, 0, 0, 3119, 0, 0, 0, 0, 876, 0, 0, 0, 0, 0, 3134, 3135, 0, 875, 0, 3138, 0, 0, 0, 0, 876, 0, 875, 0, 876, 0, 0, 3145, 0, 2051, 3148, 0, 0, 0, 0, 3151, 875, 0, 0, 0, 3153, 3154, 0, 2052, 3847, 3157, 2053, 0, 3161, 0, 0, 0, 3168, 3169, 3170, 3171, 0, 3173, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3198, 3199, 0, 3201, 2046, 0, 0, 0, 0, 2047, 0, 0, 2036, 3209, 3210, 2037, 0, 3229, 0, 2038, 2039, 2040, 0, 0, 0, 0, 4903, 0, 0, 0, 0, 2048, 2049, 0, 0, 0, 2041, 0, 0, 0, 0, 0, 0, 0, 2043, 0, 2050, 0, 0, 0, 0, 2044, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2054, 0, 0, 0, 0, 0, 0, 0, 876, 0, 0, 3263, 2045, 0, 0, 2051, 876, 876, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2052, 876, 0, 2053, 0, 0, 0, 1481, 0, 0, 3300, 0, 0, 1482, 0, 1481, 0, 0, 0, 0, 1548, 1482, 0, 0, 0, 0, 0, 0, 1548, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1549, 0, 0, 0, 0, 879, 0, 0, 1549, 0, 0, 0, 0, 0, 0, 1717, 1484, 913, 0, 0, 0, 0, 0, 0, 1484, 0, 0, 0, 931, 0, 0, 2055, 0, 0, 2056, 2057, 2058, 0, 2059, 2060, 2061, 2062, 2063, 2064, 0, 0, 0, 0, 5347, 0, 1550, 0, 2054, 0, 2046, 0, 0, 0, 1550, 2047, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1486, 0, 0, 0, 0, 0, 0, 1487, 1486, 0, 1488, 2048, 2049, 0, 0, 1487, 3430, 0, 1488, 0, 0, 0, 0, 0, 0, 0, 2050, 0, 0, 0, 0, 0, 0, 0, 0, 1489, 0, 0, 0, 0, 0, 0, 0, 1489, 0, 1052, 0, 0, 0, 5084, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2051, 0, 0, 0, 0, 0, 0, 1551, 0, 0, 1490, 0, 0, 0, 2052, 1551, 0, 2053, 1490, 0, 0, 0, 2055, 0, 0, 2056, 2057, 2058, 0, 2059, 2060, 2061, 2062, 2063, 2064, 0, 0, 0, 0, 5417, 0, 0, 0, 2036, 0, 3466, 2037, 0, 0, 0, 2038, 2039, 2040, 0, 0, 1552, 0, 0, 1553, 0, 0, 0, 0, 1552, 0, 0, 1553, 2041, 0, 1554, 0, 1492, 0, 0, 0, 2043, 0, 1554, 0, 1492, 876, 1493, 2044, 0, 0, 0, 0, 0, 0, 1493, 1494, 0, 0, 0, 0, 0, 0, 0, 1494, 0, 0, 1555, 1495, 0, 0, 2054, 0, 2045, 875, 1555, 1495, 0, 0, 0, 875, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 875, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1556, 0, 875, 1497, 1498, 1557, 0, 0, 3139, 0, 0, 1497, 1498, 1557, 0, 0, 0, 875, 0, 0, 0, 0, 0, 0, 0, 875, 0, 1558, 0, 0, 0, 0, 0, 1559, 1052, 1558, 0, 0, 5228, 875, 5229, 3140, 0, 0, 5234, 5235, 0, 1560, 0, 875, 0, 0, 0, 0, 0, 1560, 0, 0, 0, 0, 0, 0, 0, 2055, 0, 0, 2056, 2057, 2058, 0, 2059, 2060, 2061, 2062, 2063, 2064, 2046, 0, 0, 0, 5473, 2047, 0, 0, 0, 0, 0, 1717, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1500, 0, 0, 2048, 2049, 0, 0, 0, 1500, 0, 0, 876, 0, 0, 0, 0, 0, 0, 2050, 876, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 876, 0, 0, 0, 0, 0, 0, 875, 0, 0, 945, 0, 0, 0, 0, 0, 993, 0, 3651, 0, 2051, 0, 3653, 0, 0, 0, 0, 0, 3655, 0, 0, 875, 0, 0, 2052, 0, 0, 2053, 0, 0, 0, 0, 0, 0, 875, 0, 3666, 3668, 0, 0, 0, 3668, 0, 0, 0, 0, 3679, 3680, 3681, 0, 3683, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 867, 867, 2036, 876, 876, 2037, 0, 0, 0, 2038, 2039, 2040, 3705, 0, 0, 867, 0, 876, 867, 0, 0, 0, 3711, 3712, 3713, 3714, 2041, 0, 0, 0, 876, 876, 0, 0, 2043, 0, 0, 0, 0, 0, 0, 2044, 0, 0, 0, 0, 876, 0, 0, 0, 0, 0, 0, 0, 2054, 0, 0, 0, 3731, 0, 0, 3736, 3737, 3738, 0, 0, 2045, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3758, 867, 1716, 1052, 867, 867, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3766, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1452, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1330, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1353, 0, 1453, 0, 0, 0, 0, 0, 2055, 0, 0, 2056, 2057, 2058, 0, 2059, 2060, 2061, 2062, 2063, 2064, 5454, 1377, 0, 0, 5487, 3808, 1717, 0, 0, 0, 2046, 1539, 0, 3812, 0, 2047, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 853, 855, 0, 0, 859, 0, 0, 2048, 2049, 0, 1455, 0, 2036, 0, 3826, 2037, 0, 1512, 0, 2038, 2039, 2040, 2050, 0, 915, 0, 0, 0, 0, 0, 0, 925, 0, 0, 5454, 0, 2041, 3869, 0, 0, 0, 0, 0, 0, 2043, 1456, 876, 0, 0, 0, 0, 2044, 5454, 0, 0, 2051, 0, 0, 0, 0, 0, 875, 0, 0, 0, 0, 0, 0, 0, 2052, 0, 0, 2053, 0, 0, 0, 2045, 0, 0, 875, 0, 1457, 0, 0, 0, 0, 0, 0, 0, 3906, 0, 0, 0, 0, 3912, 0, 0, 875, 0, 0, 0, 876, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1458, 0, 0, 0, 876, 0, 0, 0, 0, 1717, 876, 0, 875, 3951, 876, 0, 0, 0, 0, 0, 0, 0, 876, 0, 0, 0, 0, 1766, 875, 0, 0, 1540, 1460, 0, 0, 0, 0, 0, 1423, 0, 876, 0, 0, 0, 875, 2054, 0, 0, 875, 0, 0, 0, 3967, 0, 3968, 0, 1804, 1807, 1808, 0, 0, 0, 867, 0, 0, 867, 867, 0, 0, 0, 1541, 2046, 0, 0, 36, 0, 2047, 0, 1462, 0, 0, 0, 0, 0, 0, 0, 876, 1463, 0, 0, 0, 0, 0, 0, 0, 1464, 0, 0, 2048, 2049, 0, 0, 0, 1542, 4007, 876, 876, 0, 0, 0, 0, 0, 0, 2050, 0, 1466, 0, 0, 0, 0, 0, 0, 0, 0, 1467, 0, 0, 0, 1468, 0, 0, 0, 0, 0, 0, 0, 0, 1717, 876, 0, 0, 1717, 0, 0, 2055, 0, 2051, 2056, 2057, 2058, 0, 2059, 2060, 2061, 2062, 2063, 2064, 0, 0, 2460, 2052, 0, 0, 876, 0, 1717, 875, 0, 0, 0, 876, 0, 0, 0, 875, 875, 876, 0, 0, 0, 0, 1469, 0, 876, 0, 0, 0, 876, 875, 0, 0, 2036, 876, 0, 2037, 0, 0, 0, 2038, 2039, 2040, 0, 0, 0, 1330, 0, 0, 0, 0, 0, 0, 0, 876, 0, 0, 2041, 0, 876, 0, 2890, 0, 876, 0, 2043, 1717, 0, 0, 1976, 0, 0, 2044, 0, 0, 0, 876, 0, 1330, 0, 0, 0, 0, 1716, 0, 0, 0, 0, 0, 876, 0, 0, 1099, 2054, 0, 0, 0, 2045, 0, 876, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1099, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4189, 2891, 4190, 0, 0, 0, 995, 0, 998, 4192, 0, 0, 1001, 0, 0, 0, 0, 0, 0, 1717, 0, 0, 0, 0, 0, 4202, 1026, 0, 0, 0, 0, 0, 0, 1031, 0, 0, 0, 0, 0, 0, 0, 4210, 0, 0, 0, 0, 0, 2055, 0, 0, 2056, 2057, 2058, 0, 2059, 2060, 2061, 2062, 2063, 2064, 4231, 0, 2046, 0, 0, 0, 0, 2047, 0, 0, 2107, 0, 0, 0, 0, 0, 0, 0, 4235, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4244, 2048, 2049, 0, 0, 0, 0, 0, 0, 0, 0, 0, 876, 0, 0, 0, 2050, 0, 0, 4273, 0, 0, 0, 0, 0, 0, 0, 0, 2162, 0, 0, 0, 4281, 4282, 4283, 0, 0, 0, 0, 4287, 4288, 4289, 4290, 0, 875, 0, 4292, 4293, 0, 2051, 0, 0, 4300, 4301, 0, 4303, 4304, 4305, 4306, 4307, 4308, 0, 4310, 2052, 0, 0, 2053, 876, 0, 0, 2036, 4318, 0, 2037, 4321, 4322, 0, 2038, 2039, 2040, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2041, 0, 0, 0, 3668, 0, 0, 0, 2043, 0, 0, 0, 0, 0, 0, 2044, 2289, 876, 0, 0, 0, 0, 0, 4345, 0, 0, 2313, 0, 0, 0, 0, 0, 0, 0, 0, 876, 0, 0, 0, 0, 2045, 0, 0, 876, 0, 0, 0, 0, 0, 0, 1099, 0, 0, 867, 0, 0, 867, 2349, 0, 867, 2054, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1099, 0, 0, 0, 0, 2372, 0, 0, 2375, 0, 0, 0, 0, 0, 0, 1099, 0, 0, 0, 0, 1513, 1514, 0, 1716, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2892, 0, 0, 875, 3668, 0, 1717, 0, 0, 0, 0, 875, 1717, 0, 2423, 0, 0, 0, 0, 0, 0, 0, 0, 875, 0, 0, 0, 0, 2441, 0, 0, 2046, 0, 0, 0, 0, 2047, 0, 0, 0, 2055, 0, 0, 2056, 2057, 2058, 0, 2059, 2060, 2061, 2062, 2063, 2064, 4468, 0, 0, 1099, 0, 2048, 2049, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2050, 1746, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 876, 0, 0, 0, 0, 0, 0, 0, 0, 875, 875, 0, 0, 0, 0, 1768, 1769, 0, 2051, 0, 0, 0, 0, 875, 0, 0, 0, 0, 0, 0, 0, 0, 2052, 0, 0, 2053, 875, 875, 0, 0, 0, 1810, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2464, 875, 0, 0, 0, 0, 0, 0, 0, 4070, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 876, 876, 0, 0, 0, 0, 1099, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2515, 0, 0, 0, 876, 0, 0, 876, 0, 0, 0, 0, 0, 1878, 1880, 0, 0, 0, 0, 0, 0, 2054, 0, 0, 0, 0, 0, 0, 0, 2558, 0, 0, 0, 0, 0, 0, 2571, 0, 4071, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4595, 0, 0, 0, 4596, 4597, 4598, 4599, 0, 0, 4601, 0, 0, 0, 0, 1716, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1717, 1717, 1717, 0, 0, 0, 0, 0, 0, 0, 0, 4620, 4621, 4622, 0, 4623, 0, 4625, 4626, 0, 0, 0, 0, 876, 0, 0, 0, 0, 2055, 4635, 4636, 2056, 2057, 2058, 2092, 2059, 2060, 2061, 2062, 2063, 2064, 0, 0, 876, 0, 0, 0, 0, 0, 2649, 0, 0, 0, 0, 875, 0, 4641, 0, 0, 0, 2162, 0, 876, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4652, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1330, 1330, 0, 0, 0, 0, 0, 0, 0, 1099, 0, 0, 0, 0, 0, 0, 190, 2702, 875, 0, 0, 0, 0, 0, 2036, 0, 0, 2037, 0, 0, 0, 2038, 2039, 2040, 0, 0, 875, 0, 0, 0, 0, 1716, 875, 0, 0, 0, 875, 0, 2041, 0, 0, 3475, 0, 876, 875, 0, 2043, 0, 0, 0, 0, 0, 0, 2044, 191, 0, 0, 4704, 0, 0, 0, 0, 875, 0, 0, 0, 1099, 0, 0, 192, 0, 0, 0, 0, 0, 0, 0, 0, 2045, 0, 0, 0, 0, 0, 0, 0, 0, 193, 0, 0, 1717, 0, 0, 194, 0, 0, 0, 876, 0, 876, 0, 0, 0, 0, 0, 0, 2863, 1099, 875, 0, 195, 0, 876, 0, 876, 4756, 2869, 0, 0, 0, 0, 196, 0, 0, 0, 0, 0, 875, 875, 197, 0, 0, 0, 0, 0, 0, 1717, 0, 0, 0, 1099, 198, 0, 0, 0, 1377, 199, 0, 0, 0, 0, 0, 0, 200, 0, 0, 1377, 1377, 0, 1716, 875, 0, 0, 1716, 0, 0, 0, 0, 0, 0, 0, 0, 201, 0, 0, 2278, 0, 0, 0, 0, 876, 0, 0, 0, 0, 875, 0, 1716, 2046, 0, 1330, 0, 875, 2047, 0, 0, 0, 202, 875, 0, 2317, 0, 0, 0, 0, 875, 0, 0, 0, 875, 0, 0, 0, 0, 875, 2048, 2049, 0, 203, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2050, 876, 0, 0, 875, 0, 603, 0, 0, 875, 0, 0, 0, 875, 0, 0, 1716, 0, 0, 0, 0, 0, 204, 0, 0, 0, 875, 0, 0, 876, 0, 0, 0, 2051, 0, 0, 0, 0, 0, 875, 0, 0, 0, 0, 0, 0, 205, 2052, 0, 875, 2053, 876, 0, 0, 876, 0, 206, 207, 4859, 0, 208, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2419, 2420, 2421, 2422, 0, 0, 4869, 0, 0, 0, 0, 4874, 4875, 0, 0, 0, 209, 1099, 0, 210, 0, 1100, 0, 211, 0, 212, 0, 0, 0, 0, 0, 0, 213, 3043, 1099, 214, 0, 0, 0, 0, 0, 0, 0, 0, 1716, 0, 0, 1100, 0, 3066, 0, 0, 1099, 0, 215, 0, 0, 0, 0, 0, 0, 216, 0, 4936, 1717, 0, 217, 218, 2054, 3092, 219, 0, 0, 0, 220, 0, 0, 0, 0, 0, 0, 0, 0, 4953, 221, 4955, 0, 0, 0, 222, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4971, 223, 0, 0, 0, 0, 0, 0, 1099, 0, 0, 0, 0, 0, 224, 0, 0, 0, 0, 0, 3668, 1099, 0, 0, 0, 875, 0, 0, 0, 0, 0, 0, 0, 1099, 0, 0, 0, 4998, 0, 0, 0, 2472, 2473, 3166, 3167, 1099, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2496, 0, 0, 0, 0, 0, 2055, 0, 0, 2056, 2057, 2058, 0, 2059, 2060, 2061, 2062, 2063, 2064, 875, 0, 0, 0, 0, 0, 0, 0, 0, 1099, 1099, 0, 0, 0, 0, 0, 2541, 2542, 2543, 2544, 0, 0, 0, 876, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5048, 0, 1306, 1306, 0, 0, 875, 2036, 0, 0, 2037, 5056, 0, 0, 2038, 2039, 2040, 0, 0, 0, 0, 1090, 0, 0, 875, 0, 0, 0, 0, 0, 3289, 2041, 875, 0, 0, 0, 1717, 0, 0, 2043, 0, 1717, 0, 1717, 0, 0, 2044, 1090, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1717, 0, 0, 0, 0, 0, 2045, 1631, 0, 5115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1717, 0, 0, 0, 1100, 0, 0, 0, 0, 0, 0, 2642, 0, 0, 0, 0, 876, 2646, 0, 876, 0, 0, 0, 0, 0, 0, 0, 1099, 0, 1100, 1716, 0, 0, 0, 0, 0, 1716, 0, 0, 0, 0, 0, 0, 0, 1100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3668, 0, 0, 0, 5160, 0, 0, 0, 0, 0, 1628, 1632, 0, 0, 2036, 5378, 0, 2037, 0, 0, 0, 2038, 2039, 2040, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2041, 0, 2046, 3521, 0, 0, 0, 2047, 2043, 0, 0, 0, 0, 876, 876, 2044, 0, 875, 0, 0, 0, 5204, 0, 876, 0, 0, 0, 0, 0, 2048, 2049, 0, 0, 0, 1100, 0, 5217, 0, 0, 0, 2045, 0, 876, 0, 2050, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2814, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1099, 0, 0, 0, 1099, 1099, 0, 0, 2051, 0, 0, 5246, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2052, 0, 0, 2053, 5257, 875, 875, 0, 0, 0, 2036, 0, 0, 2037, 0, 0, 0, 2038, 2039, 2040, 0, 0, 0, 0, 0, 0, 5379, 0, 0, 0, 0, 0, 875, 0, 2041, 875, 1090, 0, 0, 0, 0, 876, 2043, 0, 1099, 0, 0, 0, 0, 2044, 0, 0, 0, 0, 0, 0, 0, 0, 1099, 2046, 1100, 1090, 0, 0, 2047, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2045, 0, 1090, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2048, 2049, 5321, 0, 0, 2054, 0, 0, 0, 0, 0, 0, 0, 1099, 0, 2050, 0, 0, 3577, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1716, 1716, 1716, 0, 0, 0, 0, 1377, 0, 0, 0, 0, 5343, 0, 2051, 0, 0, 0, 0, 0, 0, 0, 0, 875, 0, 0, 0, 0, 2052, 0, 0, 2053, 0, 0, 0, 0, 0, 2987, 2988, 0, 0, 1090, 0, 875, 0, 0, 0, 0, 3001, 0, 3003, 0, 0, 1993, 3007, 0, 0, 0, 0, 0, 0, 0, 875, 0, 2046, 0, 0, 0, 0, 2047, 2055, 0, 0, 2056, 2057, 2058, 0, 2059, 2060, 2061, 2062, 2063, 2064, 2007, 0, 0, 0, 0, 0, 0, 0, 2048, 2049, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5410, 0, 0, 2050, 0, 0, 0, 0, 2025, 2026, 2027, 0, 2029, 0, 0, 0, 2054, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 876, 0, 0, 2071, 0, 1717, 0, 2051, 0, 0, 0, 0, 875, 0, 0, 0, 0, 2184, 0, 0, 0, 2052, 0, 0, 2053, 0, 1090, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 876, 0, 0, 0, 0, 3489, 0, 0, 1099, 0, 0, 0, 876, 0, 3144, 0, 0, 3147, 0, 0, 0, 1716, 0, 0, 0, 0, 0, 0, 875, 0, 875, 0, 0, 2129, 0, 0, 0, 2141, 2146, 876, 0, 0, 0, 875, 0, 875, 2184, 0, 2055, 0, 0, 2056, 2057, 2058, 0, 2059, 2060, 2061, 2062, 2063, 2064, 0, 0, 0, 3753, 0, 0, 1716, 0, 0, 0, 0, 0, 0, 2054, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1100, 0, 0, 1099, 0, 0, 1099, 0, 0, 3232, 0, 0, 0, 0, 0, 0, 0, 3239, 0, 0, 3242, 0, 0, 0, 875, 0, 3244, 0, 0, 0, 0, 0, 0, 1100, 0, 0, 0, 3256, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 876, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 875, 0, 0, 3302, 0, 0, 0, 0, 0, 0, 0, 2055, 0, 0, 2056, 2057, 2058, 0, 2059, 2060, 2061, 2062, 2063, 2064, 0, 0, 0, 0, 875, 0, 0, 3325, 1631, 1631, 1631, 1090, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 875, 1099, 0, 875, 0, 0, 0, 0, 0, 0, 0, 0, 0, 876, 0, 3872, 3873, 3874, 1099, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3883, 1099, 0, 0, 0, 0, 0, 3388, 0, 3390, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1090, 0, 0, 3899, 0, 0, 0, 0, 0, 1628, 1628, 1628, 0, 3909, 3911, 0, 0, 0, 3916, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1716, 0, 1100, 0, 0, 0, 0, 0, 0, 0, 1090, 0, 0, 0, 0, 0, 0, 0, 0, 1100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 876, 0, 876, 0, 0, 0, 0, 1100, 0, 0, 0, 0, 0, 1090, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3465, 0, 0, 0, 0, 0, 0, 0, 0, 876, 0, 0, 0, 0, 0, 0, 0, 0, 867, 0, 0, 0, 0, 0, 0, 1100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1100, 0, 4006, 0, 0, 1330, 0, 0, 0, 0, 0, 0, 1100, 0, 0, 0, 0, 0, 1717, 0, 0, 0, 0, 867, 1100, 0, 0, 0, 0, 0, 0, 0, 0, 875, 0, 0, 0, 0, 0, 0, 1099, 0, 0, 1099, 0, 1099, 0, 0, 0, 0, 1099, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1100, 1100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1716, 0, 0, 0, 0, 1716, 0, 1716, 0, 0, 0, 0, 0, 0, 0, 1099, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1716, 1090, 0, 0, 0, 1099, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1090, 1716, 4110, 4111, 4112, 0, 0, 0, 0, 0, 0, 0, 1099, 0, 0, 0, 0, 875, 1090, 0, 875, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1090, 1717, 0, 1100, 0, 0, 0, 0, 1099, 0, 1099, 0, 0, 1090, 0, 3657, 0, 3658, 3659, 3660, 0, 0, 0, 0, 0, 1090, 876, 0, 0, 0, 0, 0, 0, 0, 0, 875, 875, 1090, 876, 0, 2745, 1631, 0, 0, 0, 875, 0, 0, 0, 0, 0, 0, 0, 2765, 0, 2767, 0, 0, 2779, 2782, 2787, 0, 0, 0, 875, 2793, 0, 0, 2798, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1090, 1090, 2805, 2806, 2807, 2808, 0, 0, 0, 0, 2815, 0, 0, 0, 2827, 0, 0, 2829, 1099, 0, 2836, 2837, 2838, 2839, 2840, 2841, 2842, 2843, 2844, 0, 2845, 0, 0, 0, 0, 0, 0, 1306, 0, 1628, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1099, 0, 2928, 0, 0, 0, 2184, 2934, 0, 0, 0, 0, 2036, 0, 0, 2037, 875, 0, 0, 2038, 2039, 2040, 0, 0, 0, 2882, 0, 0, 0, 1099, 0, 0, 0, 0, 0, 0, 2041, 0, 0, 0, 0, 0, 0, 0, 2043, 0, 0, 0, 0, 2026, 2027, 2044, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4342, 0, 0, 0, 0, 0, 0, 1100, 0, 0, 0, 4355, 0, 0, 0, 2045, 0, 0, 0, 0, 0, 1100, 1090, 0, 0, 0, 1717, 0, 876, 0, 0, 0, 0, 0, 0, 0, 0, 1099, 0, 0, 0, 0, 4386, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3819, 0, 0, 1099, 0, 0, 0, 1100, 0, 0, 1092, 0, 0, 0, 0, 2973, 0, 1099, 0, 0, 2571, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1093, 0, 0, 0, 0, 0, 1092, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3526, 0, 0, 0, 0, 1093, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2649, 0, 2046, 0, 0, 0, 1717, 2047, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 876, 0, 0, 0, 0, 0, 0, 0, 0, 2048, 2049, 0, 0, 0, 867, 0, 1090, 0, 0, 0, 1090, 1090, 0, 875, 2050, 0, 0, 876, 1716, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1099, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2051, 0, 0, 0, 875, 1099, 0, 0, 0, 0, 0, 0, 0, 0, 2052, 0, 875, 2053, 0, 0, 0, 0, 0, 0, 1631, 1090, 0, 3971, 0, 0, 1099, 0, 0, 867, 867, 0, 0, 0, 0, 1090, 0, 0, 0, 875, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4530, 4531, 4532, 4533, 1100, 0, 0, 1099, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 876, 0, 1090, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3220, 3221, 1628, 0, 2054, 0, 3225, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2036, 0, 0, 2037, 0, 0, 0, 2038, 2039, 2040, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1099, 0, 3254, 875, 2041, 0, 2184, 3532, 0, 2184, 0, 0, 2043, 1092, 0, 0, 0, 0, 0, 2044, 0, 0, 0, 0, 0, 1717, 0, 0, 0, 0, 0, 0, 0, 1093, 0, 0, 0, 0, 1092, 0, 0, 0, 0, 0, 2045, 0, 0, 0, 0, 0, 0, 0, 0, 1092, 0, 0, 0, 0, 1093, 0, 0, 0, 0, 0, 0, 0, 0, 2055, 0, 0, 2056, 2057, 2058, 1093, 2059, 2060, 2061, 2062, 2063, 2064, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1717, 0, 0, 875, 0, 0, 0, 0, 0, 0, 0, 1099, 0, 0, 0, 0, 0, 0, 1717, 0, 867, 867, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1099, 0, 0, 0, 0, 1100, 0, 0, 0, 0, 0, 0, 0, 0, 1092, 0, 0, 0, 1090, 0, 0, 0, 1100, 0, 4195, 4196, 4197, 4198, 0, 0, 2046, 0, 0, 0, 1093, 2047, 0, 1100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2048, 2049, 0, 0, 0, 0, 0, 0, 0, 0, 0, 875, 0, 875, 0, 2050, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1090, 0, 0, 1090, 0, 2051, 0, 0, 0, 0, 0, 1095, 0, 0, 0, 875, 0, 0, 0, 2052, 0, 0, 2053, 0, 0, 0, 0, 3471, 4747, 0, 1099, 1092, 3477, 0, 0, 0, 0, 1095, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1093, 0, 0, 0, 0, 0, 2029, 0, 0, 0, 0, 1716, 0, 0, 0, 0, 0, 2787, 0, 2787, 2787, 0, 0, 0, 0, 0, 0, 1099, 0, 0, 3535, 1099, 0, 3538, 0, 3540, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4341, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2054, 0, 0, 0, 4344, 3558, 0, 3561, 0, 3563, 0, 0, 0, 1090, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2184, 0, 0, 2934, 0, 2934, 0, 1090, 2036, 0, 2184, 2037, 0, 0, 0, 2038, 2039, 2040, 0, 0, 0, 0, 1090, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2041, 0, 0, 0, 0, 0, 0, 0, 2043, 2129, 0, 0, 0, 0, 0, 2044, 0, 0, 0, 0, 0, 0, 0, 0, 2146, 0, 0, 1100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2045, 0, 0, 0, 2055, 0, 1100, 2056, 2057, 2058, 0, 2059, 2060, 2061, 2062, 2063, 2064, 0, 0, 0, 1099, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1099, 2184, 0, 0, 0, 1092, 0, 0, 3637, 0, 0, 0, 0, 0, 0, 1716, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1093, 0, 0, 4908, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 875, 0, 0, 4921, 0, 0, 0, 0, 1330, 0, 0, 0, 875, 0, 0, 0, 0, 0, 0, 0, 0, 1095, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1100, 1092, 1100, 4958, 0, 0, 0, 0, 0, 2046, 0, 0, 0, 0, 2047, 1095, 0, 0, 0, 0, 0, 1093, 0, 0, 0, 0, 0, 0, 0, 0, 1095, 0, 0, 1099, 0, 0, 2048, 2049, 0, 0, 0, 0, 1092, 0, 0, 1090, 0, 0, 1090, 0, 1090, 2050, 0, 0, 0, 1090, 0, 0, 0, 0, 0, 0, 1093, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1099, 0, 0, 1092, 0, 0, 0, 0, 0, 0, 0, 0, 2051, 0, 0, 0, 0, 0, 0, 1100, 0, 1099, 0, 1093, 0, 0, 2052, 0, 0, 2053, 0, 0, 1090, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1095, 1631, 0, 0, 0, 0, 0, 1631, 1090, 0, 0, 0, 0, 5044, 0, 1100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1090, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1099, 2934, 0, 0, 0, 0, 0, 0, 0, 0, 1716, 0, 875, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2054, 0, 0, 0, 0, 0, 1628, 0, 0, 0, 0, 0, 1628, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1090, 0, 1090, 4022, 0, 0, 0, 5122, 0, 0, 1100, 0, 0, 0, 1095, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2934, 0, 0, 1092, 4649, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1100, 0, 0, 0, 0, 4653, 1092, 0, 1716, 1093, 0, 0, 0, 0, 0, 1099, 0, 0, 0, 0, 0, 0, 875, 0, 1092, 2055, 1093, 0, 2056, 2057, 2058, 0, 2059, 2060, 2061, 2062, 2063, 2064, 0, 0, 0, 0, 0, 0, 1093, 0, 1090, 0, 0, 875, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1099, 0, 0, 0, 0, 0, 0, 0, 1092, 1096, 0, 0, 0, 1090, 0, 0, 0, 0, 0, 0, 0, 1092, 0, 0, 4718, 0, 0, 0, 1093, 0, 0, 0, 0, 1092, 0, 1096, 0, 0, 0, 0, 1100, 1093, 1090, 0, 0, 1092, 0, 0, 0, 0, 0, 0, 0, 1093, 0, 0, 0, 0, 0, 0, 0, 1100, 0, 0, 0, 1093, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 875, 1100, 0, 0, 1092, 1092, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1095, 0, 0, 1093, 1093, 1090, 0, 0, 0, 0, 4023, 0, 0, 0, 1100, 0, 0, 0, 1099, 4027, 0, 0, 0, 0, 0, 4028, 1090, 4029, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1090, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4053, 4054, 0, 0, 0, 0, 0, 0, 0, 1716, 0, 0, 0, 1095, 0, 0, 0, 0, 2793, 0, 0, 0, 0, 0, 0, 0, 4080, 0, 0, 4083, 0, 4085, 0, 2184, 0, 0, 0, 0, 0, 0, 4089, 4840, 4841, 4841, 0, 0, 0, 0, 4096, 4097, 0, 0, 0, 0, 1095, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1092, 0, 0, 0, 1716, 0, 2036, 0, 0, 2037, 0, 4143, 0, 2038, 2039, 2040, 0, 0, 1095, 1099, 1093, 0, 1716, 0, 0, 0, 0, 0, 0, 1090, 2041, 0, 0, 4077, 0, 0, 4156, 0, 2043, 0, 0, 0, 0, 0, 0, 2044, 0, 0, 0, 0, 1090, 0, 0, 1099, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2934, 1096, 0, 0, 0, 0, 2045, 0, 0, 0, 0, 1090, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2934, 0, 1096, 0, 1099, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1096, 0, 0, 0, 1090, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4976, 0, 0, 0, 0, 0, 0, 1092, 0, 1099, 2036, 1092, 1092, 2037, 1099, 1099, 0, 2038, 2039, 2040, 0, 0, 0, 0, 0, 0, 0, 1093, 0, 0, 0, 1093, 1093, 0, 2041, 0, 0, 0, 0, 0, 0, 0, 2043, 0, 0, 0, 0, 0, 0, 2044, 2046, 0, 1090, 0, 0, 2047, 0, 0, 0, 0, 1096, 0, 0, 0, 0, 1095, 0, 0, 0, 0, 0, 0, 0, 1092, 2045, 0, 0, 2048, 2049, 0, 0, 0, 1095, 0, 0, 0, 0, 1092, 1100, 0, 0, 0, 2050, 1093, 0, 0, 0, 0, 0, 0, 1095, 0, 0, 0, 0, 0, 0, 1093, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2051, 0, 0, 1092, 0, 0, 1099, 0, 0, 0, 0, 2934, 0, 0, 2052, 2184, 0, 2053, 0, 0, 5071, 0, 5073, 1093, 0, 0, 0, 1090, 0, 0, 0, 1095, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1095, 0, 0, 0, 0, 0, 0, 1090, 1096, 0, 0, 0, 1095, 0, 0, 2046, 0, 0, 0, 0, 2047, 0, 0, 0, 1095, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2048, 2049, 0, 0, 0, 0, 0, 0, 0, 4431, 4432, 0, 0, 0, 0, 2050, 0, 0, 0, 2054, 0, 0, 0, 0, 0, 0, 1095, 1095, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1098, 0, 0, 0, 0, 0, 0, 0, 2051, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4458, 0, 2052, 0, 0, 2053, 1098, 0, 0, 0, 0, 0, 1100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1100, 0, 0, 0, 0, 0, 0, 0, 0, 4841, 0, 0, 0, 1090, 4483, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4488, 0, 0, 0, 0, 0, 0, 0, 0, 1092, 0, 2055, 0, 1099, 2056, 2057, 2058, 0, 2059, 2060, 2061, 2062, 2063, 2064, 0, 0, 0, 0, 0, 1093, 0, 0, 0, 0, 0, 0, 1090, 0, 0, 0, 1090, 4506, 4508, 0, 0, 0, 2054, 0, 4512, 4513, 0, 0, 0, 4514, 0, 0, 0, 0, 4517, 1095, 0, 4520, 4521, 5253, 0, 0, 4525, 0, 1096, 0, 0, 0, 4529, 0, 0, 0, 0, 0, 0, 1100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1092, 0, 0, 1092, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1093, 0, 0, 1093, 0, 0, 0, 1100, 0, 0, 0, 0, 0, 1306, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1096, 0, 0, 0, 1100, 4575, 0, 0, 0, 0, 2055, 0, 0, 2056, 2057, 2058, 0, 2059, 2060, 2061, 2062, 2063, 2064, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5327, 0, 0, 0, 0, 0, 0, 0, 1096, 0, 0, 0, 0, 0, 0, 1090, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1090, 0, 0, 1095, 0, 0, 0, 1095, 1095, 0, 0, 1100, 0, 0, 0, 0, 1096, 0, 0, 0, 0, 1092, 0, 0, 0, 1098, 614, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1092, 0, 0, 1093, 0, 615, 0, 0, 0, 0, 4638, 0, 1098, 0, 0, 1092, 0, 0, 0, 0, 1093, 0, 0, 0, 0, 0, 0, 1098, 616, 0, 0, 1095, 0, 0, 0, 1093, 0, 5403, 0, 0, 0, 617, 0, 0, 0, 1095, 0, 0, 0, 0, 0, 0, 618, 0, 0, 0, -856, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1090, 0, 0, 4841, 4841, 0, 0, 0, 619, 0, 0, 0, 0, 4675, 620, 0, 0, 0, 0, 0, 1095, 0, 0, 0, 0, 4744, 0, 1100, 0, 0, 0, 621, 0, 0, 0, 0, 0, 0, 0, 1090, 0, 0, 622, 0, 0, 0, 1098, 0, 0, 0, 623, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1090, 0, 624, 0, 0, 0, 0, 0, 0, 0, 625, 0, 0, 0, 626, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1100, 0, 0, 0, 0, 1096, 0, 0, 0, -1085, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1096, 4841, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1096, 1090, 0, 0, 0, 0, 627, 0, 0, 0, 0, 0, 0, 0, 0, -573, 0, 0, 0, 0, 0, 1092, 0, 0, 1092, 0, 1092, 0, 0, 0, 0, 1092, 0, 0, 0, 0, 0, 0, 0, 1098, 0, 1093, 0, 0, 1093, 0, 1093, 0, 0, 628, 0, 1093, 629, 0, 0, 0, 1096, 0, 0, 0, 0, 0, 0, 0, 4788, 4789, 0, 0, 4790, 1096, 0, 0, 0, 630, 0, 0, 0, 0, 0, 0, 1092, 1096, 0, 0, 2934, 0, 0, 631, 0, 0, 0, 0, 0, 1096, -444, 1095, 0, 0, 0, 1092, 1093, 0, 0, 0, 0, 4825, 4826, 0, 0, 0, 0, 0, 0, 632, 0, 0, 0, 0, 0, 1093, 0, 1090, 633, 0, 1092, 0, 0, 0, 0, -444, 0, 0, 634, 0, 0, 0, 0, 1096, 1096, 0, 0, 0, 0, 0, 1093, 0, 0, 0, 0, 0, 0, 635, 0, 0, 0, 0, 0, 0, 636, 0, 0, 0, 0, 0, -444, 0, 0, 637, 638, 0, 639, 640, 0, 0, 0, 0, 0, 1095, 1090, 0, 1095, 641, 0, 0, 0, 0, 642, 0, 0, 0, 0, 0, 643, 0, 1092, 644, 1092, 0, 645, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2934, 0, 0, -444, 0, 0, 1093, 0, 1093, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1100, 0, 0, 0, 0, 0, 1098, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1096, 0, 0, 0, 1100, 0, 0, 0, 1092, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1095, 0, 1090, 0, 0, 1093, 0, 0, 0, 0, 4997, 0, 0, 0, 0, 1098, 0, 1095, 0, 0, 0, 0, 0, 2793, 1092, 0, 0, 0, 1100, 0, 0, 0, 1095, 1100, 1100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1093, 0, 0, 0, 0, 0, 5020, 0, 0, 1092, 0, 0, 1098, 0, 0, 0, 0, 0, 0, 0, 2029, 0, 0, 0, 0, 0, 0, 0, 0, 1093, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1098, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1096, 0, 0, 5063, 1096, 1096, 0, 0, 1092, 0, 0, 0, 1090, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1093, 1092, 0, 0, 0, 0, 0, 4744, 1100, 0, 0, 0, 0, 0, 0, 1092, 5100, 0, 1090, 0, 0, 1093, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1093, 0, 0, 1096, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1096, 0, 665, 0, 0, 1090, 0, 666, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1095, 0, 0, 1095, 0, 1095, 0, 1096, 667, 0, 1095, 0, 0, 0, 0, 0, 0, 0, 1090, 0, 0, 668, 0, 1090, 1090, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 669, 0, 1098, 0, 0, 1092, 0, 0, 0, 0, 0, 0, 0, 0, 4825, 0, 0, 0, 670, 1098, 0, 0, 0, 1095, 0, 1093, 1092, 0, 0, 0, 0, 0, 0, 0, 5206, 0, 0, 1098, 0, 0, 0, 671, 1095, 0, 0, 0, 1093, 0, 948, 0, 0, 1092, 672, 949, 0, 0, 0, 0, 0, 0, 673, 0, 0, 0, 0, 0, 0, 1095, 0, 0, 0, 1093, 674, 0, 0, 0, 0, 675, 0, 0, 0, 0, 0, 0, 676, 1092, 1100, 0, 950, 0, 0, 0, 0, 1098, 0, 0, 0, 0, 0, 0, 0, 951, 952, 677, 1090, 1093, 1098, 0, 0, 0, 0, 5260, 953, 0, 0, 0, 954, 0, 1098, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1098, 0, 0, 0, 955, 0, 0, 1095, 0, 1095, 0, 0, 0, 0, 0, 0, 0, 0, 0, 678, 0, 0, 5292, 5292, 5292, 0, 0, 956, 1092, 0, 0, 0, 0, 0, 0, 0, 0, 0, 957, 0, 1096, 4825, 0, 0, 1098, 1098, 958, 0, 1093, 0, 0, 0, 0, 679, 0, 0, 0, 0, 959, 0, 0, 0, 0, 960, 0, 0, 680, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 681, 0, 0, 0, 0, 0, 0, 0, 0, 0, 206, 682, 961, 0, 683, 0, 0, 0, 0, 0, 0, 1095, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 962, 0, 0, 684, 0, 5352, 685, 0, 1096, 0, 686, 1096, 687, 0, 1092, 0, 0, 0, 0, 688, 0, 963, 689, 1095, 0, 0, 0, 5292, 0, 0, 0, 0, 0, 0, 1093, 0, 0, 0, 1092, 0, 0, 690, 0, 0, 0, 0, 0, 0, 691, 0, 0, 0, 1095, 0, 692, 964, 0, 693, 1093, 0, 1090, 694, 0, 0, 0, 0, 0, 0, 0, 695, 1098, 696, 0, 0, 0, 0, 697, 0, 0, 965, 0, 0, 0, 0, 0, 0, 0, 0, 698, 206, 966, 0, 0, 967, 0, 0, 0, 0, 0, 0, 0, 699, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 968, 0, 1095, 969, 0, 0, 0, 970, 0, 971, 0, 0, 1096, 0, 0, 0, 972, 0, 5445, 973, 0, 0, 0, 1095, 0, 0, 0, 0, 0, 1096, 0, 0, 0, 0, 0, 0, 0, 1095, 974, 0, 0, 0, 0, 0, 1096, 975, 0, 0, 0, 1092, 0, 976, 0, 5292, 977, 0, 0, 0, 978, 0, 0, 0, 0, 5472, 0, 0, 979, 0, 980, 1093, 0, 0, 0, 981, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1098, 0, 0, 0, 1098, 1098, 0, 0, 0, 1092, 982, 0, 0, 1092, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1093, 0, 0, 0, 1093, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2066, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1095, 0, 0, 0, 0, 1098, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1098, 0, 1095, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1095, 2066, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1098, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1095, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1096, 0, 0, 1096, 1092, 1096, 0, 0, 0, 0, 1096, 0, 0, 0, 1092, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1093, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1093, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1096, 0, 0, 1095, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1096, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1096, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1092, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1093, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1092, 0, 0, 0, 0, 1095, 0, 0, 0, 0, 0, 1098, 0, 0, 0, 0, 1096, 0, 1096, 0, 1093, 1092, 0, 0, 0, 0, 0, 0, 0, 1095, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1093, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2066, 0, 0, 0, 2066, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1092, 0, 0, 0, 0, 0, 0, 1098, 0, 0, 1098, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1093, 1096, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1096, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1095, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1096, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1092, 1095, 0, 0, 0, 1095, 0, 0, 0, 0, 1098, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1093, 0, 0, 0, 0, 0, 0, 1098, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1096, 0, 0, 0, 1098, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1092, 0, 1096, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1096, 0, 0, 0, 1093, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1095, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1095, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1092, 0, 0, 0, 1096, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1093, 0, 0, 0, 0, 1096, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2066, 0, 0, 0, 0, 0, 0, 0, 0, 1096, 0, 0, 0, 0, 2066, 0, 1098, 0, 2775, 1098, 0, 1098, 0, 0, 0, 0, 1098, 0, 0, 0, 0, 0, 2066, 2066, 2066, 0, 2066, 0, 0, 0, 1095, 0, 0, 1096, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1098, 0, 0, 2066, 1095, 0, 0, 0, 1092, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1098, 0, 0, 0, 0, 0, 1095, 0, 0, 1093, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1096, 1092, 0, 1098, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2066, 1093, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2066, 0, 0, 0, 0, 2066, 0, 0, 1092, 0, 0, 0, 0, 0, 0, 0, 0, 1095, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1093, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1098, 0, 1098, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1092, 0, 0, 0, 0, 1092, 1092, 0, 0, 0, 0, 0, 0, 1096, 0, 0, 0, 0, 0, 0, 1093, 0, 0, 0, 0, 1093, 1093, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1096, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1098, 0, 0, 0, 0, 1095, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1098, 0, 0, 0, 0, 0, 1092, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1095, 0, 0, 1093, 0, 0, 1098, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1096, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1098, 1096, 0, 0, 0, 1096, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1098, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1098, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1095, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1092, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1093, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1098, 1096, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1096, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1098, 0, 0, 0, 0, 1095, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1098, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1095, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1098, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1095, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1096, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1095, 0, 0, 0, 0, 1095, 1095, 1098, 1096, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1096, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2066, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2066, 0, 2066, 0, 0, 2775, 2775, 0, 3512, 0, 2775, 0, 0, 0, 2066, 0, 0, 2066, 0, 0, 0, 0, 2066, 0, 0, 0, 0, 0, 2066, 0, 0, 0, 1096, 2066, 0, 0, 0, 0, 0, 0, 2066, 2066, 2066, 2066, 0, 1098, 0, 2775, 2775, 0, 2066, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1095, 0, 2066, 0, 2066, 0, 0, 0, 0, 1098, 0, 2066, 2066, 2066, 2066, 2066, 2066, 2066, 2066, 2066, 2066, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2066, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1096, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1098, 0, 0, 0, 0, 0, 0, 0, 0, 2066, 1096, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1098, 0, 0, 0, 1098, 0, 0, 0, 0, 0, 0, 0, 0, 1095, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1096, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1098, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1098, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2066, 2066, 1096, 0, 0, 2066, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2066, 0, 1096, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1098, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1096, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1098, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1098, 0, 0, 0, 0, 0, 0, 0, 0, 1096, 0, 0, 0, 0, 1096, 1096, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1098, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1096, 0, 0, 0, 0, 0, 0, 2066, 0, 0, 0, 0, 0, 2066, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3512, 3512, 0, 0, 2775, 2775, 2775, 2775, 0, 0, 2775, 2775, 2775, 2775, 2775, 2775, 2775, 2775, 2775, 2775, 3512, 0, 0, 0, 0, 1098, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2066, 0, 0, 2066, 0, 2066, 0, 0, 3512, 3512, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2066, 2775, 2775, 2066, 0, 2066, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1098, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2066, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1096, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1098, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1098, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2775, 0, 0, 0, 1098, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1098, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1098, 0, 0, 0, 0, 1098, 1098, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2066, 0, 0, 0, 2066, 2066, 2066, 0, 0, 0, 0, 0, 3512, 3512, 3512, 3512, 0, 0, 0, 0, 3512, 3512, 3512, 3512, 3512, 3512, 3512, 3512, 3512, 3512, 2066, 2066, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1098, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2066, 0, 0, 2066, 0, 2066, 0, 0, 0, 2066, 0, 0, 3512, 3512, 0, 0, 2066, 2066, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2066, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2066, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1098, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3512, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2066, 2066, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2066, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2066, 0, 0, 0, 0, 2066, 2775, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2066, 0, 2066, 0, 0, 0, 2066, 2066, 2066, 0, 0, 2066, 0, 0, 2066, 2066, 0, 0, 0, 2066, 0, 0, 0, 2066, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2066, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2066, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2066, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3512, 2775, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2066, 2066, 2066, 0, 0, 0, 0, 0, 0, 0, 2775, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2066, 2066, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2066, 0, 0, 3512, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2775, 0, 0, 3512, 0, 0, 0, 2066, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2066, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2066, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3512, 0, 2775, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2066, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2066, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2066, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2066, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2775, 2775, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3512, 3512, 0, 0, 0, 2066, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 227, 1223, 660, 1224, 1225, 1226, 721, 1227, 0, 0, 0, 0, 0, 0, 2066, 228, 229, 230, 231, 232, 233, 234, 235, 1622, 236, 237, 238, 0, 0, 0, 0, 1228, 0, 0, 239, 240, 0, 241, 242, 243, 244, 245, 246, 247, 248, 1229, 250, 1230, 1231, 0, 253, 254, 255, 256, 257, 258, 1232, 1233, 259, 260, 1234, 1235, 263, 0, 264, 265, 266, 267, 1236, 0, 1237, 0, 270, 271, 272, 273, 274, 275, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 285, 286, 287, 288, 1238, 1239, 1240, 1241, 1242, 1243, 1244, 290, 291, 292, 293, 294, 295, 1245, 1246, 298, 1247, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 1623, 0, 310, 311, 1071, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 1248, 326, 327, 328, 1249, 1250, 330, 0, 331, 332, 1251, 334, 0, 335, 0, 336, 337, 0, 338, 339, 340, 341, 342, 0, 343, 1252, 0, 1253, 346, 347, 0, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 366, 367, 368, 369, 370, 371, 1254, 1255, 0, 1256, 0, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 0, 0, 385, 1257, 387, 388, 389, 0, 390, 391, 392, 1258, 1259, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 1260, 410, 1261, 412, 413, 414, 415, 1262, 416, 417, 418, 419, 1263, 1264, 421, 1265, 423, 424, 425, 0, 426, 427, 0, 0, 1266, 429, 430, 0, 0, 431, 432, 433, 434, 435, 436, 1267, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 1268, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 1269, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 484, 485, 486, 487, 488, 489, 1270, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 1271, 505, 506, 507, 508, 509, 510, 511, 512, 1272, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 1273, 529, 0, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 0, 539, 1274, 1275, 0, 0, 542, 543, 1276, 545, 1277, 1278, 547, 548, 549, 550, 551, 552, 553, 0, 1279, 554, 555, 556, 557, 558, 1280, 0, 559, 560, 561, 562, 563, 564, 1281, 1624, 566, 567, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 1282, 1283, 1284, 1285, 584, 1286, 1287, 1288, 1289, 589, 590, 591, 592, 1290, 0, 0, 0, 0, 0, 0, 1291, 1292, 1625, 0, 0, 0, 0, 0, 0, 1294, 1626, 227, 1223, 660, 1224, 1225, 1226, 721, 1227, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 1228, 0, 0, 239, 240, 0, 241, 242, 243, 244, 245, 246, 247, 248, 1229, 250, 1230, 1231, 0, 253, 254, 255, 256, 257, 258, 1232, 1233, 259, 260, 1234, 1235, 263, 0, 264, 265, 266, 267, 1236, 0, 1237, 0, 270, 271, 272, 273, 274, 275, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 285, 286, 287, 288, 1238, 1239, 1240, 1241, 1242, 1243, 1244, 290, 291, 292, 293, 294, 295, 1245, 1246, 298, 1247, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 1071, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 1248, 326, 327, 328, 1249, 1250, 330, 0, 331, 332, 1251, 334, 0, 335, 0, 336, 337, 0, 338, 339, 340, 341, 342, 0, 343, 1252, 0, 1253, 346, 347, 0, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 366, 367, 368, 369, 370, 371, 1254, 1255, 0, 1256, 0, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 0, 0, 385, 1257, 387, 388, 389, 0, 390, 391, 392, 1258, 1259, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 1260, 410, 1261, 412, 413, 414, 415, 1262, 416, 417, 418, 419, 1263, 1264, 421, 1265, 423, 424, 425, 0, 426, 427, 0, 0, 1266, 429, 430, 0, 0, 431, 432, 433, 434, 435, 436, 1267, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 1268, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 1269, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 484, 485, 486, 487, 488, 489, 1270, 491, 492, 493, 494, 495, 496, 497, 498, 499, 41, 500, 501, 502, 503, 504, 1271, 505, 506, 507, 508, 509, 510, 511, 512, 1272, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 1273, 529, 0, 530, 531, 45, 532, 533, 534, 535, 536, 537, 538, 0, 539, 1274, 1275, 0, 0, 542, 543, 1276, 545, 1277, 1278, 547, 548, 549, 550, 551, 552, 553, 0, 1279, 554, 555, 556, 557, 558, 1280, 0, 559, 560, 561, 562, 563, 1150, 1281, 0, 566, 567, 568, 569, 570, 571, 0, 0, 572, 0, 50, 573, 574, 575, 576, 577, 578, 579, 1282, 1283, 1284, 1285, 584, 1286, 1287, 1288, 1289, 589, 590, 591, 592, 1290, 0, 51, 0, 0, 0, 0, 1291, 1292, 0, 0, 0, 0, 0, 0, 0, 1294, 5031, 227, 1223, 660, 1224, 1225, 1226, 721, 1227, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 1228, 0, 0, 239, 240, 0, 241, 242, 243, 244, 245, 246, 247, 248, 1229, 250, 1230, 1231, 0, 253, 254, 255, 256, 257, 258, 1232, 1233, 259, 260, 1234, 1235, 263, 0, 264, 265, 266, 267, 1236, 0, 1237, 0, 270, 271, 272, 273, 274, 275, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 285, 286, 287, 288, 1238, 1239, 1240, 1241, 1242, 1243, 1244, 290, 291, 292, 293, 294, 295, 1245, 1246, 298, 1247, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 1071, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 1248, 326, 327, 328, 1249, 1250, 330, 0, 331, 332, 1251, 334, 0, 335, 0, 336, 337, 0, 338, 339, 340, 341, 342, 0, 343, 1252, 0, 1253, 346, 347, 0, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 366, 367, 368, 369, 370, 371, 1254, 1255, 0, 1256, 0, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 0, 0, 385, 1257, 387, 388, 389, 0, 390, 391, 392, 1258, 1259, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 1260, 410, 1261, 412, 413, 414, 415, 1262, 416, 417, 418, 419, 1263, 1264, 421, 1265, 423, 424, 425, 0, 426, 427, 0, 0, 1266, 429, 430, 0, 0, 431, 432, 433, 434, 435, 436, 1267, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 1268, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 1269, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 484, 485, 486, 487, 488, 489, 1270, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 1271, 505, 506, 507, 508, 509, 510, 511, 512, 1272, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 1273, 529, 0, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 0, 539, 1274, 1275, 0, 0, 542, 543, 1276, 545, 1277, 1278, 547, 548, 549, 550, 551, 552, 553, 0, 1279, 554, 555, 556, 557, 558, 1280, 0, 559, 560, 561, 562, 563, 564, 1281, 0, 566, 567, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 1282, 1283, 1284, 1285, 584, 1286, 1287, 1288, 1289, 589, 590, 591, 592, 1290, 0, 0, 0, 0, 0, 0, 1291, 1292, 0, 0, 0, 0, 0, 0, 0, 1294, 2777, 227, 1223, 660, 1224, 1225, 1226, 721, 1227, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 1228, 0, 0, 239, 240, 0, 241, 242, 243, 244, 245, 246, 247, 248, 1229, 250, 1230, 1231, 0, 253, 254, 255, 256, 257, 258, 1232, 1233, 259, 260, 1234, 1235, 263, 0, 264, 265, 266, 267, 1236, 0, 1237, 0, 270, 271, 272, 273, 274, 275, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 285, 286, 287, 288, 1238, 1239, 1240, 1241, 1242, 1243, 1244, 290, 291, 292, 293, 294, 295, 1245, 1246, 298, 1247, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 1071, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 1248, 326, 327, 328, 1249, 1250, 330, 0, 331, 332, 1251, 334, 0, 335, 0, 336, 337, 0, 338, 339, 340, 341, 342, 0, 343, 1252, 0, 1253, 346, 347, 0, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 366, 367, 368, 369, 370, 371, 1254, 1255, 0, 1256, 0, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 0, 0, 385, 1257, 387, 388, 389, 0, 390, 391, 392, 1258, 1259, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 1260, 410, 1261, 412, 413, 414, 415, 1262, 416, 417, 418, 419, 1263, 1264, 421, 1265, 423, 424, 425, 0, 426, 427, 0, 0, 1266, 429, 430, 0, 0, 431, 432, 433, 434, 435, 436, 1267, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 1268, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 1269, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 484, 485, 486, 487, 488, 489, 1270, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 1271, 505, 506, 507, 508, 509, 510, 511, 512, 1272, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 1273, 529, 0, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 0, 539, 1274, 1275, 0, 0, 542, 543, 1276, 545, 1277, 1278, 547, 548, 549, 550, 551, 552, 553, 0, 1279, 554, 555, 556, 557, 558, 1280, 0, 559, 560, 561, 562, 563, 564, 1281, 0, 566, 567, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 1282, 1283, 1284, 1285, 584, 1286, 1287, 1288, 1289, 589, 590, 591, 592, 1290, 0, 0, 0, 0, 0, 0, 1291, 1292, 0, 0, 0, 0, 0, 0, 0, 1294, 4031, 227, 1223, 660, 1224, 1225, 1226, 721, 1227, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 1228, 0, 0, 239, 240, 0, 241, 242, 243, 244, 245, 246, 247, 248, 1229, 250, 1230, 1231, 0, 253, 254, 255, 256, 257, 258, 1232, 1233, 259, 260, 1234, 1235, 263, 0, 264, 265, 266, 267, 1236, 0, 1237, 0, 270, 271, 272, 273, 274, 275, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 285, 286, 287, 288, 1238, 1239, 1240, 1241, 1242, 1243, 1244, 290, 291, 292, 293, 294, 295, 1245, 1246, 298, 1247, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 1071, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 1248, 326, 327, 328, 1249, 1250, 330, 0, 331, 332, 1251, 334, 0, 335, 0, 336, 337, 0, 338, 339, 340, 341, 342, 0, 343, 1252, 0, 1253, 346, 347, 0, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 366, 367, 368, 369, 370, 371, 1254, 1255, 0, 1256, 0, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 0, 0, 385, 1257, 387, 388, 389, 0, 390, 391, 392, 1258, 1259, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 1260, 410, 1261, 412, 413, 414, 415, 1262, 416, 417, 418, 419, 1263, 1264, 421, 1265, 423, 424, 425, 0, 426, 427, 0, 0, 1266, 429, 430, 0, 0, 431, 432, 433, 434, 435, 436, 1267, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 1268, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 1269, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 484, 485, 486, 487, 488, 489, 1270, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 1271, 505, 506, 507, 508, 509, 510, 511, 512, 1272, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 1273, 529, 0, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 0, 539, 1274, 1275, 0, 0, 542, 543, 1276, 545, 1277, 1278, 547, 548, 549, 550, 551, 552, 553, 0, 1279, 554, 555, 556, 557, 558, 1280, 0, 559, 560, 561, 562, 563, 564, 1281, 0, 566, 567, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 1282, 1283, 1284, 1285, 584, 1286, 1287, 1288, 1289, 589, 590, 591, 592, 1290, 0, 0, 600, 0, 0, 0, 1291, 1292, 0, 0, 0, 0, 0, 0, 0, 1294, 4103, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 4121, 0, 239, 240, 0, 241, 242, 243, 0, 245, 246, 247, 248, 249, 0, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 0, 0, 270, 271, 272, 273, 274, 0, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, -1777, 286, 287, 288, 0, 0, 0, 0, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 0, 0, -1777, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 352, 0, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, -1777, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 0, 0, 378, -1777, 380, 381, 382, 383, 384, 0, 0, 385, 386, -1777, 388, 0, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, -1777, 411, 412, 413, 414, 415, 0, 416, 417, 0, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 0, 435, 0, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, -1777, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 507, 508, 509, 0, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 0, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 0, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 0, 0, 0, 1063, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1370, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 244, 245, 246, 247, 0, 1064, 250, 1065, 1066, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 1067, 1068, 263, 0, 264, 265, 266, 267, 0, 0, 269, 0, 270, 271, 272, 273, 274, 275, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 285, 286, 287, 288, 0, 0, 0, 289, 0, 0, 0, 290, 291, 292, 293, 294, 295, 1069, 1070, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 1071, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 0, 326, 327, 328, 0, 0, 330, 0, 331, 332, 1072, 334, 0, 335, 0, 336, 337, 0, 338, 339, 340, 341, 342, 0, 343, 0, 0, 0, 346, 347, 0, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 2170, 358, 359, 360, 361, 362, 363, 364, 0, 365, 366, 2171, 368, 369, 370, 371, 1074, 1075, 0, 1076, 0, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 0, 0, 385, 0, 387, 388, 389, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 1077, 410, 1078, 412, 413, 414, 0, 0, 416, 417, 418, 419, 0, 0, 421, 1079, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 2173, 434, 435, 436, 0, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 0, 450, 0, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 1080, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 484, 485, 486, 487, 488, 489, 0, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 2174, 508, 509, 510, 511, 512, 1082, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 0, 529, 0, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 0, 539, 1083, 1084, 0, 0, 542, 543, 0, 545, 0, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 0, 1085, 2175, 566, 567, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 1063, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 590, 591, 592, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 2283, 0, 0, 239, 240, 0, 241, 242, 243, 244, 245, 246, 247, 0, 1064, 250, 1065, 1066, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 1067, 1068, 263, 0, 264, 265, 266, 267, 0, 0, 269, 0, 270, 271, 272, 273, 274, 275, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 285, 286, 287, 288, 0, 0, 0, 289, 0, 0, 0, 290, 291, 292, 293, 294, 295, 1069, 1070, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 1071, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 0, 326, 327, 328, 0, 0, 330, 0, 331, 332, 1072, 334, 0, 335, 0, 336, 337, 0, 338, 339, 340, 341, 342, 0, 343, 0, 0, 0, 346, 347, 0, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 2170, 358, 359, 360, 361, 362, 363, 364, 0, 365, 366, 2171, 368, 369, 370, 371, 1074, 1075, 0, 1076, 0, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 0, 0, 385, 0, 387, 388, 389, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 1077, 410, 1078, 412, 413, 414, 0, 0, 416, 417, 418, 419, 0, 0, 421, 1079, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 2173, 434, 435, 436, 0, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 0, 450, 0, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 1080, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 484, 485, 486, 487, 488, 489, 0, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 2174, 508, 509, 510, 511, 512, 1082, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 0, 529, 0, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 0, 539, 1083, 1084, 0, 0, 542, 543, 0, 545, 0, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 0, 1085, 2175, 566, 567, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 0, 227, 1223, 660, 1224, 1225, 1226, 721, 1227, 0, 0, 590, 591, 592, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 3343, 1228, 0, 0, 239, 240, 0, 241, 242, 243, 244, 245, 246, 247, 248, 1229, 250, 1230, 1231, 0, 253, 254, 255, 256, 257, 258, 1232, 1233, 259, 260, 1234, 1235, 263, 0, 264, 265, 266, 267, 1236, 0, 1237, 0, 270, 271, 272, 273, 274, 275, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 285, 286, 287, 288, 1238, 1239, 1240, 1241, 1242, 1243, 1244, 290, 291, 292, 293, 294, 295, 1245, 1246, 298, 1247, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 1071, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 1248, 326, 327, 328, 1249, 1250, 330, 0, 331, 332, 1251, 334, 0, 335, 0, 336, 337, 0, 338, 339, 340, 341, 342, 0, 343, 1252, 0, 1253, 346, 347, 0, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 366, 367, 368, 369, 370, 371, 1254, 1255, 0, 1256, 0, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 0, 0, 385, 1257, 387, 388, 389, 0, 390, 391, 392, 1258, 1259, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 1260, 410, 1261, 412, 413, 414, 415, 1262, 416, 417, 418, 419, 1263, 1264, 421, 1265, 423, 424, 425, 0, 426, 427, 0, 0, 1266, 429, 430, 0, 0, 431, 432, 433, 434, 435, 436, 1267, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 1268, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 1269, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 484, 485, 486, 487, 488, 489, 1270, 491, 492, 493, 494, 495, 496, 497, 498, 499, 41, 500, 501, 502, 503, 504, 1271, 505, 506, 507, 508, 509, 510, 511, 512, 1272, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 1273, 529, 0, 530, 531, 45, 532, 533, 534, 535, 536, 537, 538, 0, 539, 1274, 1275, 0, 0, 542, 543, 1276, 545, 1277, 1278, 547, 548, 549, 550, 551, 552, 553, 0, 1279, 554, 555, 556, 557, 558, 1280, 0, 559, 560, 561, 562, 563, 1150, 1281, 0, 566, 567, 568, 569, 570, 571, 0, 0, 572, 0, 50, 573, 574, 575, 576, 577, 578, 579, 1282, 1283, 1284, 1285, 584, 1286, 1287, 1288, 1289, 589, 590, 591, 592, 1290, 0, 51, 0, 0, 0, 0, 1291, 1292, 0, 0, 0, 0, 0, 0, 0, 1294, 227, 1223, 660, 1224, 1225, 1226, 721, 1227, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 1228, 0, 0, 239, 240, 0, 241, 242, 243, 244, 245, 246, 247, 248, 1229, 250, 1230, 1231, 2783, 253, 254, 255, 256, 257, 258, 1232, 1233, 259, 260, 1234, 1235, 263, 0, 264, 265, 266, 267, 1236, 0, 1237, 0, 270, 271, 272, 273, 274, 275, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 285, 286, 287, 288, 1238, 1239, 1240, 1241, 1242, 1243, 1244, 290, 291, 292, 293, 294, 295, 1245, 1246, 298, 1247, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 1071, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 1248, 326, 327, 328, 1249, 1250, 330, 0, 331, 332, 1251, 334, 0, 335, 0, 336, 337, 2784, 338, 339, 340, 341, 342, 0, 343, 1252, 0, 1253, 346, 347, 0, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 366, 367, 368, 369, 370, 371, 1254, 1255, 0, 1256, 0, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 0, 2785, 385, 1257, 387, 388, 389, 0, 390, 391, 392, 1258, 1259, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 1260, 410, 1261, 412, 413, 414, 415, 1262, 416, 417, 418, 419, 1263, 1264, 421, 1265, 423, 424, 425, 0, 426, 427, 0, 0, 1266, 429, 430, 0, 0, 431, 432, 433, 434, 435, 436, 1267, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 1268, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 1269, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 484, 485, 486, 487, 488, 489, 1270, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 1271, 505, 506, 507, 508, 509, 510, 511, 512, 1272, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 1273, 529, 0, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 0, 539, 1274, 1275, 0, 2786, 542, 543, 1276, 545, 1277, 1278, 547, 548, 549, 550, 551, 552, 553, 0, 1279, 554, 555, 556, 557, 558, 1280, 0, 559, 560, 561, 562, 563, 564, 1281, 0, 566, 567, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 1282, 1283, 1284, 1285, 584, 1286, 1287, 1288, 1289, 589, 590, 591, 592, 1290, 0, 0, 0, 0, 0, 0, 1291, 1292, 0, 0, 0, 0, 0, 0, 0, 1294, 227, 1223, 660, 1224, 1225, 1226, 721, 1227, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 1228, 0, 0, 239, 240, 0, 241, 242, 243, 244, 245, 246, 247, 248, 1229, 250, 1230, 1231, 0, 253, 254, 255, 256, 257, 258, 1232, 1233, 259, 260, 1234, 1235, 263, 0, 264, 265, 266, 267, 1236, 0, 1237, 0, 270, 271, 272, 273, 274, 275, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 285, 286, 287, 288, 1238, 1239, 1240, 1241, 1242, 1243, 1244, 290, 291, 292, 293, 294, 295, 1245, 1246, 298, 1247, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 1071, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 1248, 326, 327, 328, 1249, 1250, 330, 0, 331, 332, 1251, 334, 0, 335, 0, 336, 337, 0, 338, 339, 340, 341, 342, 0, 343, 1252, 0, 1253, 346, 347, 0, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 366, 367, 368, 369, 370, 371, 1254, 1255, 0, 1256, 0, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 0, 0, 385, 1257, 387, 388, 389, 0, 390, 391, 392, 1258, 1259, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 1260, 410, 1261, 412, 413, 414, 415, 1262, 416, 417, 418, 419, 1263, 1264, 421, 1265, 423, 424, 425, 0, 426, 427, 0, 0, 1266, 429, 430, 0, 0, 431, 432, 433, 434, 435, 436, 1267, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 1268, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 1269, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 484, 485, 486, 487, 488, 489, 1270, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 1271, 505, 506, 507, 508, 509, 510, 511, 512, 1272, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 1273, 529, 0, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 0, 539, 1274, 1275, 0, 0, 542, 543, 1276, 545, 1277, 1278, 547, 548, 549, 550, 551, 552, 553, 0, 1279, 554, 555, 556, 557, 558, 1280, 0, 559, 560, 561, 562, 563, 564, 1281, 0, 566, 567, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 1282, 1283, 1284, 1285, 584, 1286, 1287, 1288, 1289, 589, 590, 591, 592, 1290, 0, 0, 0, 0, 0, 0, 1291, 1292, 0, 0, 0, 0, 0, 1990, 2738, 1294, 227, 1223, 660, 1224, 1225, 1226, 721, 1227, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 1228, 0, 0, 239, 240, 0, 241, 242, 243, 244, 245, 246, 247, 248, 1229, 250, 1230, 1231, 0, 253, 254, 255, 256, 257, 258, 1232, 1233, 259, 260, 1234, 1235, 263, 0, 264, 265, 266, 267, 1236, 0, 1237, 0, 270, 271, 272, 273, 274, 275, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 285, 286, 287, 288, 1238, 1239, 1240, 1241, 1242, 1243, 1244, 290, 291, 292, 293, 294, 295, 1245, 1246, 298, 1247, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 1071, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 1248, 326, 327, 328, 1249, 1250, 330, 0, 331, 332, 1251, 334, 0, 335, 0, 336, 337, 0, 338, 339, 340, 341, 342, 0, 343, 1252, 0, 1253, 346, 347, 0, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 366, 367, 368, 369, 370, 371, 1254, 1255, 0, 1256, 0, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 0, 0, 385, 1257, 387, 388, 389, 0, 390, 391, 392, 1258, 1259, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 1260, 410, 1261, 412, 413, 414, 415, 1262, 416, 417, 418, 419, 1263, 1264, 421, 1265, 423, 424, 425, 0, 426, 427, 0, 0, 1266, 429, 430, 0, 0, 431, 432, 433, 434, 435, 436, 1267, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 1268, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 1269, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 484, 485, 486, 487, 488, 489, 1270, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 1271, 505, 506, 507, 508, 509, 510, 511, 512, 1272, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 1273, 529, 0, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 0, 539, 1274, 1275, 0, 0, 542, 543, 1276, 545, 1277, 1278, 547, 548, 549, 550, 551, 552, 553, 0, 1279, 554, 555, 556, 557, 558, 1280, 0, 559, 560, 561, 562, 563, 564, 1281, 0, 566, 567, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 1282, 1283, 1284, 1285, 584, 1286, 1287, 1288, 1289, 589, 590, 591, 592, 1290, 0, 0, 0, 0, 0, 0, 1291, 1292, 1293, 0, 0, 0, 0, 0, 0, 1294, 227, 1223, 660, 1224, 1225, 1226, 721, 1227, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 2139, 236, 237, 238, 0, 0, 0, 0, 1228, 0, 0, 239, 240, 0, 241, 242, 243, 244, 245, 246, 247, 248, 1229, 250, 1230, 1231, 0, 253, 254, 255, 256, 257, 258, 1232, 1233, 259, 260, 1234, 1235, 263, 0, 264, 265, 266, 267, 1236, 0, 1237, 0, 270, 271, 272, 273, 274, 275, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 285, 286, 287, 288, 1238, 1239, 1240, 1241, 1242, 1243, 1244, 290, 291, 292, 293, 294, 295, 1245, 1246, 298, 1247, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 1071, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 1248, 326, 327, 328, 1249, 1250, 330, 0, 331, 332, 1251, 334, 0, 335, 0, 336, 337, 0, 338, 339, 340, 341, 342, 0, 343, 1252, 0, 1253, 346, 347, 0, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 366, 367, 368, 369, 370, 371, 1254, 1255, 0, 1256, 0, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 0, 0, 385, 1257, 387, 388, 389, 0, 390, 391, 392, 1258, 1259, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 1260, 410, 1261, 412, 413, 414, 415, 1262, 416, 417, 418, 419, 1263, 1264, 421, 1265, 423, 424, 425, 0, 426, 427, 0, 0, 1266, 429, 430, 0, 0, 431, 432, 433, 434, 435, 436, 1267, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 1268, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 1269, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 484, 485, 486, 487, 488, 489, 1270, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 1271, 505, 506, 507, 508, 509, 510, 511, 512, 1272, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 1273, 529, 0, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 0, 539, 1274, 1275, 0, 0, 542, 543, 1276, 545, 1277, 1278, 547, 548, 549, 550, 551, 552, 553, 0, 1279, 554, 555, 556, 557, 558, 1280, 0, 559, 560, 561, 562, 563, 564, 1281, 0, 566, 567, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 1282, 1283, 1284, 1285, 584, 1286, 1287, 1288, 1289, 589, 590, 591, 592, 1290, 0, 0, 0, 0, 0, 0, 1291, 1292, 0, 0, 0, 0, 0, 0, 0, 1294, 227, 1223, 660, 1224, 1225, 1226, 721, 1227, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 1228, 0, 0, 239, 240, 0, 241, 242, 243, 244, 245, 246, 247, 248, 1229, 250, 1230, 1231, 0, 253, 254, 255, 256, 257, 258, 1232, 1233, 259, 260, 1234, 1235, 263, 0, 264, 265, 266, 267, 1236, 0, 1237, 0, 270, 271, 272, 273, 274, 275, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 285, 286, 287, 288, 1238, 1239, 1240, 1241, 1242, 1243, 1244, 290, 291, 292, 293, 294, 295, 1245, 1246, 298, 1247, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 1071, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 1248, 326, 327, 328, 1249, 1250, 330, 0, 331, 332, 1251, 334, 0, 335, 0, 336, 337, 0, 338, 339, 340, 341, 342, 0, 343, 1252, 0, 1253, 346, 347, 0, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 366, 367, 368, 369, 370, 371, 1254, 1255, 0, 1256, 0, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 0, 0, 385, 1257, 387, 388, 389, 0, 390, 391, 392, 1258, 1259, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 1260, 410, 1261, 412, 413, 414, 415, 1262, 416, 417, 418, 419, 1263, 1264, 421, 1265, 423, 424, 425, 0, 426, 427, 0, 0, 1266, 429, 430, 0, 0, 431, 432, 433, 434, 435, 436, 1267, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 1268, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 1269, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 484, 485, 486, 487, 488, 489, 1270, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 1271, 505, 506, 507, 508, 509, 510, 511, 512, 1272, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 1273, 529, 0, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 0, 539, 1274, 1275, 0, 0, 542, 543, 1276, 545, 1277, 1278, 547, 548, 549, 550, 551, 552, 553, 0, 1279, 554, 555, 556, 557, 558, 1280, 0, 559, 560, 561, 562, 563, 564, 1281, 3222, 566, 567, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 1282, 1283, 1284, 1285, 584, 1286, 1287, 1288, 1289, 589, 590, 591, 592, 1290, 0, 0, 0, 0, 0, 0, 1291, 1292, 0, 0, 0, 0, 0, 0, 0, 1294, 227, 1223, 660, 1224, 1225, 1226, 721, 1227, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 1228, 0, 0, 239, 240, 0, 241, 242, 243, 244, 245, 246, 247, 248, 1229, 250, 1230, 1231, 0, 253, 254, 255, 256, 257, 258, 1232, 1233, 259, 260, 1234, 1235, 263, 0, 264, 265, 266, 267, 1236, 0, 1237, 0, 270, 271, 272, 273, 274, 275, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 285, 286, 287, 288, 1238, 1239, 1240, 1241, 1242, 1243, 1244, 290, 291, 292, 293, 294, 295, 1245, 1246, 298, 1247, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 1071, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 1248, 326, 327, 328, 1249, 1250, 330, 0, 331, 332, 1251, 334, 0, 335, 0, 336, 337, 2784, 338, 339, 340, 341, 342, 0, 343, 1252, 0, 1253, 346, 347, 0, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 366, 367, 368, 369, 370, 371, 1254, 1255, 0, 1256, 0, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 0, 0, 385, 1257, 387, 388, 389, 0, 390, 391, 392, 1258, 1259, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 1260, 410, 1261, 412, 413, 414, 415, 1262, 416, 417, 418, 419, 1263, 1264, 421, 1265, 423, 424, 425, 0, 426, 427, 0, 0, 1266, 429, 430, 0, 0, 431, 432, 433, 434, 435, 436, 1267, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 1268, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 1269, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 484, 485, 486, 487, 488, 489, 1270, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 1271, 505, 506, 507, 508, 509, 510, 511, 512, 1272, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 1273, 529, 0, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 0, 539, 1274, 1275, 0, 0, 542, 543, 1276, 545, 1277, 1278, 547, 548, 549, 550, 551, 552, 553, 0, 1279, 554, 555, 556, 557, 558, 1280, 0, 559, 560, 561, 562, 563, 564, 1281, 0, 566, 567, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 1282, 1283, 1284, 1285, 584, 1286, 1287, 1288, 1289, 589, 590, 591, 592, 1290, 0, 0, 0, 0, 0, 0, 1291, 1292, 0, 0, 0, 0, 0, 0, 0, 1294, 227, 1223, 660, 1224, 1225, 1226, 721, 1227, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 1228, 0, 0, 239, 240, 0, 241, 242, 243, 244, 245, 246, 247, 248, 1229, 250, 1230, 1231, 0, 253, 254, 255, 256, 257, 258, 1232, 1233, 259, 260, 1234, 1235, 263, 0, 264, 265, 266, 267, 1236, 0, 1237, 0, 270, 271, 272, 273, 274, 275, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 285, 286, 287, 288, 1238, 1239, 1240, 1241, 1242, 1243, 1244, 290, 291, 292, 293, 294, 295, 1245, 1246, 298, 1247, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 1071, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 1248, 326, 327, 328, 1249, 1250, 330, 0, 331, 332, 1251, 334, 0, 335, 0, 336, 337, 0, 338, 339, 340, 341, 342, 0, 343, 1252, 0, 1253, 346, 347, 0, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 366, 367, 368, 369, 370, 371, 1254, 1255, 0, 1256, 0, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 0, 0, 385, 1257, 387, 388, 389, 0, 390, 391, 392, 1258, 1259, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 1260, 410, 1261, 412, 413, 414, 415, 1262, 416, 417, 418, 419, 1263, 1264, 421, 1265, 423, 424, 425, 0, 426, 427, 0, 0, 1266, 429, 430, 0, 0, 431, 432, 433, 434, 435, 436, 1267, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 1268, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 1269, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 484, 485, 486, 487, 488, 489, 1270, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 1271, 505, 506, 507, 508, 509, 510, 511, 512, 1272, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 1273, 529, 0, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 0, 539, 1274, 1275, 0, 0, 542, 543, 1276, 545, 1277, 1278, 547, 548, 549, 550, 551, 552, 553, 0, 1279, 554, 555, 556, 557, 558, 1280, 0, 559, 560, 561, 562, 563, 564, 1281, 0, 566, 567, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 1282, 1283, 1284, 1285, 584, 1286, 1287, 1288, 1289, 589, 590, 591, 592, 1290, 0, 0, 0, 0, 0, 0, 1291, 1292, 0, 0, 0, 0, 0, 0, 0, 1294, 227, 1223, 660, 1224, 1225, 1226, 721, 1227, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 1228, 0, 0, 239, 240, 0, 241, 242, 243, 244, 245, 246, 247, 248, 1229, 250, 1230, 1231, 0, 253, 254, 255, 256, 257, 258, 1232, 1233, 259, 260, 1234, 1235, 263, 0, 264, 265, 266, 267, 1236, 0, 1237, 0, 270, 271, 272, 273, 274, 275, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 285, 286, 287, 288, 1238, 1239, 1240, 1241, 1242, 1243, 1244, 290, 291, 292, 293, 294, 295, 1245, 1246, 298, 1247, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 1071, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 1248, 326, 327, 328, 1249, 1250, 330, 0, 331, 332, 1251, 334, 0, 335, 0, 336, 337, 0, 338, 339, 340, 341, 342, 0, 343, 1252, 0, 1253, 346, 347, 0, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 366, 367, 368, 369, 370, 371, 1254, 1255, 0, 1256, 0, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 0, 0, 385, 1257, 387, 388, 389, 0, 390, 391, 392, 1258, 1259, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 1260, 410, 1261, 412, 413, 414, 415, 1262, 416, 417, 418, 419, 1263, 1264, 421, 1265, 423, 424, 425, 0, 426, 427, 0, 0, 1266, 429, 430, 0, 0, 431, 432, 433, 434, 435, 436, 1267, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 1268, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 1269, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 484, 485, 486, 487, 488, 489, 1270, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 1271, 505, 506, 507, 508, 509, 510, 511, 512, 1272, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 1273, 529, 0, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 0, 539, 1274, 1275, 0, 0, 542, 543, 1276, 545, 1277, 1278, 547, 548, 549, 550, 551, 552, 553, 0, 1279, 554, 555, 556, 557, 558, 1280, 0, 559, 560, 561, 562, 563, 564, 1281, 0, 566, 567, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 1282, 1283, 1284, 1285, 584, 1286, 1287, 1288, 1289, 589, 590, 591, 592, 1290, 0, 0, 0, 0, 0, 0, 2142, 2143, 0, 0, 0, 0, 0, 0, 0, 1294, 227, 2905, 660, 1224, 1225, 1226, 721, 1227, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 1228, 0, 0, 239, 240, 0, 241, 242, 243, 244, 245, 246, 247, 248, 1229, 250, 1230, 1231, 0, 253, 254, 255, 256, 257, 258, 1232, 1233, 259, 260, 1234, 1235, 263, 0, 264, 265, 266, 267, 1236, 0, 1237, 0, 270, 271, 272, 273, 274, 275, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 285, 286, 287, 288, 1238, 1239, 1240, 1241, 1242, 1243, 1244, 290, 291, 292, 293, 294, 295, 1245, 1246, 298, 1247, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 1071, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 1248, 326, 327, 328, 1249, 1250, 330, 0, 331, 332, 1251, 334, 0, 335, 0, 336, 337, 0, 338, 339, 340, 341, 342, 0, 343, 1252, 0, 1253, 346, 347, 0, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 366, 367, 368, 369, 370, 371, 1254, 1255, 0, 1256, 0, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 0, 0, 385, 1257, 387, 388, 389, 0, 390, 391, 392, 1258, 1259, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 1260, 410, 1261, 412, 413, 414, 415, 1262, 416, 417, 418, 419, 1263, 1264, 421, 1265, 423, 424, 425, 0, 426, 427, 0, 0, 1266, 429, 430, 0, 0, 431, 432, 433, 434, 435, 436, 1267, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 1268, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 1269, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 484, 485, 486, 487, 488, 489, 1270, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 1271, 505, 506, 507, 508, 509, 510, 511, 512, 1272, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 1273, 529, 0, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 0, 539, 1274, 1275, 0, 0, 542, 543, 1276, 545, 1277, 1278, 547, 548, 549, 550, 551, 552, 553, 0, 1279, 554, 555, 556, 557, 558, 1280, 0, 559, 560, 561, 562, 563, 564, 1281, 0, 566, 567, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 1282, 1283, 1284, 1285, 584, 1286, 1287, 1288, 1289, 589, 590, 591, 592, 1290, 0, 0, 0, 0, 0, 0, 1291, 1292, 0, 0, 0, 0, 0, 0, 0, 1294, 227, 1223, 660, 1224, 1225, 1226, 721, 1227, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 1228, 0, 0, 239, 240, 0, 241, 242, 243, 244, 245, 246, 247, 248, 1229, 250, 1230, 1231, 0, 253, 254, 255, 256, 257, 258, 1232, 1233, 259, 260, 1234, 1235, 263, 0, 264, 265, 266, 267, 1236, 0, 1237, 0, 270, 271, 272, 273, 274, 275, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 285, 286, 287, 4155, 1238, 1239, 1240, 1241, 1242, 1243, 1244, 290, 291, 292, 293, 294, 295, 1245, 1246, 298, 1247, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 1071, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 1248, 326, 327, 328, 1249, 1250, 330, 0, 331, 332, 1251, 334, 0, 335, 0, 336, 337, 0, 338, 339, 340, 341, 342, 0, 343, 1252, 0, 1253, 346, 347, 0, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 366, 367, 368, 369, 370, 371, 1254, 1255, 0, 1256, 0, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 0, 0, 385, 1257, 387, 388, 389, 0, 390, 391, 392, 1258, 1259, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 1260, 410, 1261, 412, 413, 414, 415, 1262, 416, 417, 418, 419, 1263, 1264, 421, 1265, 423, 424, 425, 0, 426, 427, 0, 0, 1266, 429, 430, 0, 0, 431, 432, 433, 434, 435, 436, 1267, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 1268, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 1269, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 484, 485, 486, 487, 488, 489, 1270, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 1271, 505, 506, 507, 508, 509, 510, 511, 512, 1272, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 1273, 529, 0, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 0, 539, 1274, 1275, 0, 0, 542, 543, 1276, 545, 1277, 1278, 547, 548, 549, 550, 551, 552, 553, 0, 1279, 554, 555, 556, 557, 558, 1280, 0, 559, 560, 561, 562, 563, 564, 1281, 0, 566, 567, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 1282, 1283, 1284, 1285, 584, 1286, 1287, 1288, 1289, 589, 590, 591, 592, 1290, 0, 0, 0, 0, 0, 0, 1291, 1292, 0, 0, 0, 0, 0, 0, 0, 1294, 227, 1223, 660, 1224, 1225, 1226, 721, 1227, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 1228, 0, 0, 239, 240, 0, 241, 242, 243, 244, 245, 246, 247, 248, 1229, 250, 1230, 1231, 0, 253, 254, 255, 256, 257, 258, 1232, 1233, 259, 260, 1234, 1235, 263, 0, 264, 265, 266, 267, 1236, 0, 1237, 0, 270, 271, 272, 273, 274, 275, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 285, 286, 287, 288, 1238, 1239, 1240, 1241, 1242, 1243, 1244, 290, 291, 292, 293, 294, 295, 1245, 1246, 298, 1247, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 1071, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 1248, 326, 327, 328, 1249, 1250, 330, 0, 331, 332, 1251, 334, 0, 335, 0, 336, 337, 0, 338, 339, 340, 341, 342, 0, 343, 1252, 0, 1253, 346, 347, 0, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 366, 367, 368, 369, 370, 371, 1254, 1255, 0, 1256, 0, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 0, 0, 385, 1257, 387, 388, 389, 0, 390, 391, 392, 1258, 1259, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 1260, 410, 1261, 412, 413, 414, 415, 1262, 416, 417, 418, 419, 1263, 1264, 421, 1265, 423, 424, 425, 0, 426, 427, 0, 0, 1266, 429, 430, 0, 0, 431, 432, 433, 434, 435, 436, 1267, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 1268, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 1269, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 484, 485, 486, 487, 488, 489, 1270, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 1271, 505, 506, 507, 508, 509, 510, 511, 512, 1272, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 1273, 529, 0, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 0, 539, 1274, 1275, 0, 0, 542, 543, 1276, 545, 1277, 1278, 547, 548, 549, 550, 551, 552, 553, 0, 1279, 554, 555, 556, 557, 558, 1280, 0, 559, 560, 561, 562, 563, 564, 1281, 0, 566, 567, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 4495, 1282, 1283, 1284, 1285, 584, 1286, 1287, 1288, 1289, 589, 590, 591, 592, 1290, 0, 0, 0, 0, 0, 0, 1291, 1292, 0, 0, 0, 0, 0, 0, 0, 1294, 227, 1223, 660, 1224, 1225, 1226, 721, 1227, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 1228, 0, 0, 239, 240, 0, 241, 242, 243, 244, 245, 246, 247, 248, 1229, 250, 1230, 1231, 0, 253, 254, 255, 256, 257, 258, 1232, 1233, 259, 260, 1234, 1235, 263, 0, 264, 265, 266, 267, 1236, 0, 1237, 0, 270, 271, 272, 273, 274, 275, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 285, 286, 287, 288, 1238, 1239, 1240, 1241, 1242, 1243, 1244, 290, 291, 292, 293, 294, 295, 1245, 1246, 298, 1247, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 1071, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 1248, 326, 327, 328, 1249, 1250, 330, 0, 331, 332, 1251, 334, 0, 335, 0, 336, 337, 0, 338, 339, 340, 341, 342, 0, 343, 1252, 0, 1253, 346, 347, 0, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 366, 367, 368, 369, 370, 371, 1254, 1255, 0, 1256, 0, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 0, 0, 385, 1257, 387, 388, 389, 0, 390, 391, 392, 1258, 1259, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 1260, 410, 1261, 412, 413, 4507, 415, 1262, 416, 417, 418, 419, 1263, 1264, 421, 1265, 423, 424, 425, 0, 426, 427, 0, 0, 1266, 429, 430, 0, 0, 431, 432, 433, 434, 435, 436, 1267, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 1268, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 1269, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 484, 485, 486, 487, 488, 489, 1270, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 1271, 505, 506, 507, 508, 509, 510, 511, 512, 1272, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 1273, 529, 0, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 0, 539, 1274, 1275, 0, 0, 542, 543, 1276, 545, 1277, 1278, 547, 548, 549, 550, 551, 552, 553, 0, 1279, 554, 555, 556, 557, 558, 1280, 0, 559, 560, 561, 562, 563, 564, 1281, 0, 566, 567, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 1282, 1283, 1284, 1285, 584, 1286, 1287, 1288, 1289, 589, 590, 591, 592, 1290, 0, 0, 0, 0, 0, 0, 1291, 1292, 0, 0, 0, 0, 0, 0, 0, 1294, 227, 1223, 660, 1224, 1225, 1226, 721, 1227, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 1228, 0, 0, 239, 240, 0, 241, 242, 243, 244, 245, 246, 247, 248, 1229, 250, 1230, 1231, 0, 253, 254, 255, 256, 257, 258, 1232, 1233, 259, 260, 1234, 1235, 263, 0, 264, 265, 266, 267, 1236, 0, 1237, 0, 270, 271, 272, 273, 274, 275, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 285, 286, 4815, 288, 1238, 1239, 1240, 1241, 1242, 1243, 1244, 290, 291, 292, 293, 294, 295, 1245, 1246, 298, 1247, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 1071, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 1248, 326, 327, 328, 1249, 1250, 330, 0, 331, 332, 1251, 334, 0, 335, 0, 336, 337, 0, 338, 339, 340, 341, 342, 0, 343, 1252, 0, 4816, 346, 347, 0, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 366, 367, 368, 369, 370, 371, 1254, 1255, 0, 1256, 0, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 0, 0, 385, 1257, 387, 388, 389, 0, 390, 391, 392, 1258, 1259, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 1260, 410, 1261, 412, 413, 414, 415, 1262, 416, 417, 418, 419, 1263, 1264, 421, 1265, 423, 424, 425, 0, 426, 427, 0, 0, 1266, 429, 430, 0, 0, 431, 432, 433, 434, 435, 436, 1267, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 1268, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 1269, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 484, 485, 486, 4817, 488, 489, 1270, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 1271, 505, 506, 507, 508, 509, 510, 511, 512, 1272, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 1273, 529, 0, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 0, 539, 1274, 1275, 0, 0, 542, 543, 1276, 545, 1277, 1278, 547, 548, 549, 550, 551, 552, 553, 0, 1279, 554, 555, 556, 557, 558, 1280, 0, 559, 560, 561, 562, 563, 564, 1281, 0, 566, 567, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 1282, 1283, 1284, 1285, 584, 1286, 1287, 1288, 1289, 589, 590, 591, 592, 1290, 0, 0, 0, 0, 0, 0, 1291, 1292, 0, 0, 0, 0, 0, 0, 0, 4818, 227, 1223, 660, 1224, 1225, 1226, 721, 1227, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 1228, 0, 0, 239, 240, 0, 241, 242, 243, 244, 245, 246, 247, 5289, 1229, 250, 1230, 1231, 0, 253, 254, 255, 256, 257, 258, 1232, 1233, 259, 260, 1234, 1235, 263, 0, 264, 265, 266, 267, 1236, 0, 1237, 0, 270, 271, 272, 273, 274, 275, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 285, 286, 287, 5290, 1238, 1239, 1240, 1241, 1242, 1243, 1244, 290, 291, 292, 293, 294, 295, 1245, 1246, 298, 1247, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 1071, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 1248, 326, 327, 328, 1249, 1250, 330, 0, 331, 332, 1251, 334, 0, 335, 0, 336, 337, 0, 338, 339, 340, 341, 342, 0, 343, 1252, 0, 1253, 346, 347, 0, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 366, 367, 368, 369, 370, 371, 1254, 1255, 0, 1256, 0, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 0, 0, 385, 1257, 387, 388, 389, 0, 390, 391, 392, 1258, 1259, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 1260, 410, 1261, 412, 413, 414, 415, 1262, 416, 417, 418, 419, 1263, 1264, 421, 1265, 423, 424, 425, 0, 426, 427, 0, 0, 1266, 429, 430, 0, 0, 431, 432, 433, 434, 435, 436, 1267, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 1268, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 1269, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 484, 485, 486, 487, 488, 489, 1270, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 1271, 505, 506, 507, 508, 509, 510, 511, 512, 1272, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 1273, 529, 0, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 0, 539, 1274, 1275, 0, 0, 542, 543, 1276, 545, 1277, 1278, 547, 548, 549, 550, 5291, 552, 553, 0, 1279, 554, 555, 556, 557, 558, 1280, 0, 559, 560, 561, 562, 563, 564, 1281, 0, 566, 567, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 1282, 1283, 1284, 1285, 584, 1286, 1287, 1288, 1289, 589, 590, 591, 592, 1290, 0, 0, 0, 0, 0, 0, 1291, 1292, 0, 0, 0, 0, 0, 0, 0, 1294, 227, 1223, 660, 1224, 1225, 1226, 721, 1227, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 1228, 0, 0, 239, 240, 0, 241, 242, 243, 244, 245, 246, 247, 248, 1229, 250, 1230, 1231, 0, 253, 254, 255, 256, 257, 258, 1232, 1233, 259, 260, 1234, 1235, 263, 0, 264, 265, 266, 267, 1236, 0, 1237, 0, 270, 271, 272, 273, 274, 275, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 285, 286, 287, 5290, 1238, 1239, 1240, 1241, 1242, 1243, 1244, 290, 291, 292, 293, 294, 295, 1245, 1246, 298, 1247, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 1071, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 1248, 326, 327, 328, 1249, 1250, 330, 0, 331, 332, 1251, 334, 0, 335, 0, 336, 337, 0, 338, 339, 340, 341, 342, 0, 343, 1252, 0, 1253, 346, 347, 0, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 366, 367, 368, 369, 370, 371, 1254, 1255, 0, 1256, 0, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 0, 0, 385, 1257, 387, 388, 389, 0, 390, 391, 392, 1258, 1259, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 1260, 410, 1261, 412, 413, 414, 415, 1262, 416, 417, 418, 419, 1263, 1264, 421, 1265, 423, 424, 425, 0, 426, 427, 0, 0, 1266, 429, 430, 0, 0, 431, 432, 433, 434, 435, 436, 1267, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 1268, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 1269, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 484, 485, 486, 487, 488, 489, 1270, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 1271, 505, 506, 507, 508, 509, 510, 511, 512, 1272, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 1273, 529, 0, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 0, 539, 1274, 1275, 0, 0, 542, 543, 1276, 545, 1277, 1278, 547, 548, 549, 550, 5291, 552, 553, 0, 1279, 554, 555, 556, 557, 558, 1280, 0, 559, 560, 561, 562, 563, 564, 1281, 0, 566, 567, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 1282, 1283, 1284, 1285, 584, 1286, 1287, 1288, 1289, 589, 590, 591, 592, 1290, 0, 0, 0, 0, 0, 0, 1291, 1292, 0, 0, 0, 0, 0, 0, 0, 1294, 227, 1223, 660, 1224, 1225, 1226, 721, 1227, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 1228, 0, 0, 239, 240, 0, 241, 242, 243, 244, 245, 246, 247, 248, 1229, 250, 1230, 1231, 0, 253, 254, 255, 256, 257, 258, 1232, 1233, 259, 260, 1234, 1235, 263, 0, 264, 265, 266, 267, 1236, 0, 1237, 0, 270, 271, 272, 273, 274, 275, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 285, 286, 287, 288, 1238, 1239, 1240, 1241, 1242, 1243, 1244, 290, 291, 292, 293, 294, 295, 1245, 1246, 298, 5013, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 1071, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 1248, 326, 327, 328, 1249, 1250, 330, 0, 331, 332, 1251, 334, 0, 335, 0, 336, 337, 0, 338, 339, 340, 341, 342, 0, 343, 1252, 0, 1253, 346, 347, 0, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 366, 367, 368, 369, 370, 371, 1254, 1255, 0, 1256, 0, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 0, 0, 385, 1257, 387, 388, 389, 0, 390, 391, 392, 1258, 1259, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 1260, 410, 1261, 412, 413, 414, 415, 0, 416, 417, 418, 419, 1263, 1264, 421, 1265, 423, 424, 425, 0, 426, 427, 0, 0, 1266, 429, 430, 0, 0, 431, 432, 433, 434, 435, 436, 1267, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 1268, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 1269, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 484, 485, 486, 487, 488, 489, 2769, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 1271, 505, 506, 507, 508, 509, 510, 511, 512, 1272, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 1273, 529, 0, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 0, 539, 1274, 1275, 0, 0, 542, 543, 1276, 545, 1277, 1278, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 1280, 0, 559, 560, 561, 562, 563, 564, 1281, 0, 566, 567, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 1282, 1283, 1284, 1285, 584, 1286, 1287, 1288, 1289, 589, 590, 591, 592, 0, 0, 0, 0, 0, 0, 0, 2770, 2771, 0, 0, 0, 0, 0, 0, 0, 2772, 227, 1223, 660, 1224, 1225, 1226, 721, 1227, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 1228, 0, 0, 239, 240, 0, 241, 242, 243, 244, 245, 246, 247, -2637, 1229, 250, 1230, 1231, 0, 253, 254, 255, 256, 257, 258, 1232, 1233, 259, 260, 1234, 1235, 263, 0, 264, 265, 266, 267, 1236, 0, 1237, 0, 270, 271, 272, 273, 274, 275, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 285, 286, 287, 5290, 1238, 1239, 1240, 1241, 1242, 1243, 1244, 290, 291, 292, 293, 294, 295, 1245, 1246, 298, 1247, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 1071, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 1248, 326, 327, 328, 1249, 1250, 330, 0, 331, 332, 1251, 334, 0, 335, 0, 336, 337, 0, 338, 339, 340, 341, 342, 0, 343, 1252, 0, 1253, 346, 347, 0, 348, 349, 350, 351, 352, -2637, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 366, 367, 368, 369, 370, 371, 1254, 1255, 0, 1256, 0, 375, 0, 0, 378, 379, 380, 381, 382, 383, 384, 0, 0, 385, 1257, 387, 388, -2637, 0, 390, 391, 392, 1258, 1259, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 1260, 410, 1261, 412, 413, 414, 415, 1262, 416, 417, 0, 419, 1263, 1264, 421, 1265, 423, 424, 425, 0, 426, 427, 0, 0, 1266, 429, 430, 0, 0, 431, 432, 433, 434, 435, 436, 1267, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 1268, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 1269, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 484, 485, 486, 487, 488, 489, 1270, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 1271, 505, 506, 507, 508, 509, -2637, 511, 512, 1272, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 1273, 529, 0, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 0, 539, 1274, 1275, 0, 0, 542, 543, 1276, 545, 1277, 1278, 547, 548, 549, 550, 5291, 552, 553, 0, 1279, 554, 555, 556, 557, 558, 1280, 0, 559, 560, 561, 562, 563, 564, 1281, 0, 566, 567, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 1282, 1283, 1284, 1285, 584, 1286, 1287, 1288, 1289, 589, 590, 591, 592, -2637, 0, 0, 0, 0, 0, 0, 1291, 1292, 0, 0, 0, 0, 0, 0, 0, 1294, 227, 1223, 660, 1224, 1225, 1226, 721, 1227, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 1228, 0, 0, 239, 240, 0, 241, 242, 243, 244, 245, 246, 247, 248, 1229, 250, 1230, 1231, 0, 253, 254, 255, 256, 257, 258, 1232, 1233, 259, 260, 1234, 1235, 263, 0, 264, 265, 266, 267, 1236, 0, 1237, 0, 270, 271, 272, 273, 274, 275, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 285, 286, 287, 288, 1238, 1239, 1240, 1241, 1242, 1243, 1244, 290, 291, 292, 293, 294, 295, 1245, 1246, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 1071, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 1248, 326, 327, 328, 1249, 1250, 330, 0, 331, 332, 1251, 334, 0, 335, 0, 336, 337, 0, 338, 339, 340, 341, 342, 0, 343, 1252, 0, 1253, 346, 347, 0, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 366, 367, 368, 369, 370, 371, 1254, 1255, 0, 1256, 0, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 0, 0, 385, 1257, 387, 388, 389, 0, 390, 391, 392, 1258, 1259, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 1260, 410, 1261, 412, 413, 414, 415, 0, 416, 417, 418, 419, 1263, 1264, 421, 1265, 423, 424, 425, 0, 426, 427, 0, 0, 1266, 429, 430, 0, 0, 431, 432, 433, 434, 435, 436, 1267, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 1268, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 1269, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 484, 485, 486, 487, 488, 489, 2769, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 1271, 505, 506, 507, 508, 509, 510, 511, 512, 1272, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 1273, 529, 0, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 0, 539, 1274, 1275, 0, 0, 542, 543, 1276, 545, 1277, 1278, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 1280, 0, 559, 560, 561, 562, 563, 564, 1281, 0, 566, 567, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 1282, 1283, 1284, 1285, 584, 1286, 1287, 1288, 1289, 589, 590, 591, 592, 0, 0, 0, 0, 0, 0, 0, 2770, 2771, 0, 0, 227, 1223, 660, 1224, 1225, 2772, 721, 1227, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 1228, 0, 0, 239, 240, 0, 241, 242, 243, 244, 245, 246, 247, 248, 1229, 250, 1230, 1231, 0, 253, 254, 255, 256, 257, 258, 1232, 1233, 259, 260, 1234, 1235, 263, 0, 264, 265, 266, 267, 1236, 0, 1237, 0, 270, 271, 272, 273, 274, 275, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 285, 286, 287, 288, 1238, 1239, 1240, 1241, 1242, 1243, 1244, 290, 291, 292, 293, 294, 295, 1245, 1246, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 1071, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 1248, 326, 327, 328, 1249, 1250, 330, 0, 331, 332, 1251, 334, 0, 335, 0, 336, 337, 0, 338, 339, 340, 341, 342, 0, 343, 1252, 0, 1253, 346, 347, 0, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 366, 367, 368, 369, 370, 371, 1254, 1255, 0, 1256, 0, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 0, 0, 385, 1257, 387, 388, 389, 0, 390, 391, 392, 1258, 1259, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 1260, 410, 1261, 412, 413, 414, 415, 0, 416, 417, 418, 419, 1263, 1264, 421, 1265, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 434, 435, 436, 1267, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 1268, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 1269, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 484, 485, 486, 487, 488, 489, 2894, 2895, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 1271, 505, 506, 507, 508, 509, 510, 511, 512, 1272, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 1273, 529, 0, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 0, 539, 1274, 1275, 0, 0, 542, 543, 1276, 545, 1277, 1278, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 1280, 0, 559, 560, 561, 562, 563, 564, 1281, 0, 566, 567, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 1282, 1283, 1284, 1285, 584, 1286, 1287, 1288, 1289, 589, 590, 591, 592, 0, 0, 0, 0, 0, 0, 0, 2896, 2897, 0, 0, 0, 0, 0, 0, 0, 2772, 227, 1223, 660, 1224, 1225, 1226, 721, 1227, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 1228, 0, 0, 239, 240, 0, 241, 242, 243, 244, 245, 246, 247, 248, 1229, 250, 1230, 1231, 0, 253, 254, 255, 256, 257, 258, 1232, 1233, 259, 260, 1234, 1235, 263, 0, 264, 265, 266, 267, 1236, 0, 1237, 0, 270, 271, 272, 273, 274, 275, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 285, 286, 287, 288, 1238, 1239, 1240, 1241, 1242, 1243, 1244, 290, 291, 292, 293, 294, 295, 1245, 1246, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 1071, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 1248, 326, 327, 328, 1249, 1250, 330, 0, 331, 332, 1251, 334, 0, 335, 0, 336, 337, 0, 338, 339, 340, 341, 342, 0, 343, 1252, 0, 1253, 346, 347, 0, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 366, 367, 368, 369, 370, 371, 1254, 1255, 0, 1256, 0, 375, 0, 377, 378, 379, 380, 381, 382, 383, 384, 0, 0, 385, 1257, 387, 388, 389, 0, 390, 391, 392, 1258, 1259, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 1260, 410, 1261, 412, 413, 414, 415, 0, 416, 417, 418, 419, 1263, 1264, 421, 1265, 423, 424, 425, 0, 426, 427, 0, 0, 1266, 429, 430, 0, 0, 431, 432, 433, 434, 435, 436, 1267, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 1268, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 1269, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 484, 485, 486, 487, 488, 489, 2769, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 1271, 505, 506, 507, 508, 509, 510, 511, 512, 1272, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 1273, 529, 0, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 0, 539, 1274, 1275, 0, 0, 542, 543, 1276, 545, 1277, 1278, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 1280, 0, 559, 560, 561, 562, 563, 564, 1281, 0, 566, 567, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 1282, 1283, 1284, 1285, 584, 1286, 1287, 1288, 1289, 589, 590, 591, 592, 0, 0, 0, 0, 0, 0, 0, 2770, 2771, 0, 0, 227, 1223, 660, 1224, 1225, 2772, 721, 1227, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 1228, 0, 0, 239, 240, 0, 241, 242, 243, 244, 245, 246, 247, 248, 1229, 250, 1230, 1231, 0, 253, 254, 255, 256, 257, 258, 1232, 1233, 259, 260, 1234, 1235, 263, 0, 264, 265, 266, 267, 1236, 0, 1237, 0, 270, 271, 272, 273, 274, 275, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 285, 286, 287, 288, 1238, 1239, 1240, 1241, 1242, 1243, 1244, 290, 291, 292, 293, 294, 295, 1245, 1246, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 1071, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 1248, 326, 327, 328, 1249, 1250, 330, 0, 331, 332, 1251, 334, 0, 335, 0, 336, 337, 0, 338, 339, 340, 341, 342, 0, 343, 1252, 0, 1253, 346, 347, 0, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 366, 367, 368, 369, 370, 371, 1254, 1255, 0, 1256, 0, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 0, 0, 385, 1257, 387, 388, 389, 0, 390, 391, 392, 1258, 1259, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 1260, 410, 1261, 412, 413, 414, 415, 0, 416, 417, 418, 419, 1263, 1264, 421, 1265, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 434, 435, 436, 1267, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 1268, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 1269, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 484, 485, 486, 487, 488, 489, 2769, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 1271, 505, 506, 507, 508, 509, 510, 511, 512, 1272, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 1273, 529, 0, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 0, 539, 1274, 1275, 0, 0, 542, 543, 1276, 545, 1277, 1278, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 1280, 0, 559, 560, 561, 562, 563, 564, 1281, 0, 566, 567, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 1282, 1283, 1284, 1285, 584, 1286, 1287, 1288, 1289, 589, 590, 591, 592, 0, 0, 227, 1223, 660, 1224, 1225, 0, 721, 1227, 0, 0, 0, 0, 0, 0, 2772, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 1228, 0, 0, 239, 240, 0, 241, 242, 243, 244, 245, 246, 247, 248, 1229, 250, 1230, 1231, 0, 4064, 254, 255, 256, 257, 258, 1232, 1233, 259, 260, 1234, 1235, 263, 0, 264, 265, 266, 267, 1236, 0, 1237, 0, 270, 271, 272, 273, 274, 275, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 285, 286, 287, 288, 1238, 1239, 1240, 1241, 1242, 1243, 1244, 290, 291, 292, 293, 294, 295, 1245, 1246, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 1071, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 1248, 326, 327, 328, 1249, 1250, 330, 0, 331, 332, 1251, 334, 0, 335, 0, 336, 337, 0, 338, 339, 340, 341, 342, 0, 343, 1252, 0, 1253, 346, 347, 0, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 366, 367, 368, 369, 370, 371, 1254, 1255, 0, 1256, 0, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 0, 0, 385, 1257, 387, 388, 389, 0, 390, 391, 392, 1258, 1259, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 1260, 410, 1261, 412, 413, 414, 415, 0, 416, 417, 418, 419, 1263, 1264, 421, 1265, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 434, 435, 436, 1267, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 1268, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 1269, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 484, 485, 486, 487, 488, 489, 2769, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 1271, 505, 506, 507, 508, 509, 510, 511, 512, 1272, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 1273, 529, 0, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 0, 539, 1274, 1275, 0, 0, 542, 543, 1276, 545, 1277, 1278, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 1280, 0, 559, 560, 561, 562, 563, 564, 1281, 0, 566, 567, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 1282, 1283, 1284, 1285, 584, 1286, 1287, 1288, 1289, 589, 590, 591, 592, 0, 0, 227, 1223, 660, 1224, 1225, 0, 721, 1227, 0, 0, 0, 0, 0, 0, 2772, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 1228, 0, 0, 239, 240, 0, 241, 242, 243, 244, 245, 246, 247, 248, 1229, 250, 1230, 1231, 0, 253, 254, 255, 256, 257, 258, 1232, 1233, 259, 260, 1234, 1235, 263, 0, 264, 265, 266, 267, 1236, 0, 1237, 0, 270, 271, 272, 273, 274, 275, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 285, 286, 287, 288, 1238, 1239, 1240, 1241, 1242, 1243, 1244, 290, 291, 292, 293, 294, 295, 1245, 1246, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 1071, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 1248, 326, 327, 328, 1249, 1250, 330, 0, 331, 332, 1251, 334, 0, 335, 0, 336, 337, 0, 338, 339, 340, 341, 342, 0, 343, 1252, 0, 1253, 346, 347, 0, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 366, 367, 368, 369, 370, 371, 1254, 1255, 0, 1256, 0, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 0, 0, 385, 1257, 387, 388, 389, 0, 390, 391, 392, 1258, 1259, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 1260, 410, 1261, 412, 413, 414, 415, 0, 416, 417, 418, 419, 1263, 1264, 421, 1265, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 434, 435, 436, 1267, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 1268, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 1269, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 484, 485, 486, 487, 488, 489, 2769, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 1271, 505, 506, 507, 508, 509, 510, 511, 512, 1272, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 1273, 529, 0, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 0, 539, 1274, 1275, 0, 0, 542, 543, 1276, 545, 1277, 1278, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 1280, 0, 559, 560, 561, 562, 563, 564, 1281, 0, 566, 567, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 1282, 1283, 1284, 1285, 4538, 1286, 1287, 1288, 1289, 589, 590, 591, 592, 0, 0, 227, 1223, 660, 1224, 1225, 1226, 721, 1227, 0, 0, 0, 0, 0, 0, 2772, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 1228, 0, 0, 239, 240, 0, 241, 242, 243, 244, 245, 246, 247, 0, 1229, 250, 1230, 1231, 0, 253, 254, 255, 256, 257, 258, 1232, 1233, 259, 260, 1234, 1235, 263, 0, 264, 265, 266, 267, 1236, 0, 1237, 0, 270, 271, 272, 273, 274, 275, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 285, 286, 287, 288, 1238, 1239, 1240, 1241, 1242, 1243, 1244, 290, 291, 292, 293, 294, 295, 1245, 1246, 298, 1247, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 1071, 313, 314, 0, 315, 316, 317, 0, 318, 0, 320, 0, 321, 322, 323, 324, 1248, 326, 327, 328, 1249, 1250, 330, 0, 331, 332, 1251, 334, 0, 335, 0, 336, 337, 0, 338, 339, 340, 341, 342, 0, 343, 1252, 0, 1253, 346, 347, 0, 348, 349, 350, 351, 352, 0, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 366, 367, 368, 369, 370, 371, 1254, 1255, 0, 1256, 0, 375, 0, 0, 378, 379, 380, 381, 382, 383, 384, 0, 0, 385, 1257, 387, 388, 0, 0, 390, 391, 392, 1258, 1259, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 1260, 410, 1261, 412, 413, 414, 415, 1262, 416, 417, 0, 419, 1263, 1264, 421, 1265, 423, 424, 425, 0, 426, 427, 0, 0, 1266, 429, 430, 0, 0, 431, 432, 433, 434, 435, 436, 1267, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 1268, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 1269, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 484, 485, 486, 487, 488, 489, 1270, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 1271, 505, 506, 507, 508, 509, 0, 511, 512, 1272, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 1273, 529, 0, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 0, 539, 1274, 1275, 0, 0, 542, 543, 1276, 545, 1277, 1278, 547, 548, 549, 550, 551, 552, 553, 0, 1279, 554, 555, 556, 557, 558, 1280, 0, 559, 560, 561, 562, 563, 564, 1281, 0, 566, 567, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 1282, 1283, 1284, 1285, 584, 1286, 1287, 1288, 1289, 589, 590, 591, 592, 0, 0, 227, 0, 0, 0, 0, 1291, 1292, 0, 0, 0, 0, 0, 0, 0, 1294, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 1233, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 1236, 0, 1237, 0, 270, 271, 272, 273, 274, 275, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 285, 286, 287, 288, 1238, 1239, 1240, 1241, 1242, 1243, 1244, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 1249, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 337, 0, 338, 339, 340, 341, 342, 0, 343, 1252, 0, 345, 346, 347, 0, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 366, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 3581, 0, 385, 1257, 387, 388, 389, 0, 390, 391, 392, 1258, 1259, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 0, 416, 417, 418, 419, 0, 1264, 421, 422, 423, 424, 425, 0, 426, 427, 0, 813, 428, 429, 430, 0, 0, 431, 432, 433, 434, 435, 436, 1267, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 1268, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 3582, 492, 493, 494, 495, 496, 497, 498, 499, 41, 500, 501, 502, 503, 504, 1271, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 1273, 529, 0, 530, 531, 45, 532, 533, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 1276, 545, 1277, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 1280, 0, 559, 560, 561, 562, 563, 1150, 565, 0, 566, 567, 568, 569, 570, 571, 0, 0, 572, 0, 50, 573, 574, 575, 576, 577, 578, 579, 1282, 1283, 1284, 1285, 584, 1286, 1287, 1288, 1289, 3583, 590, 591, 592, 0, 0, 51, 227, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3584, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 1233, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 1236, 0, 1237, 0, 270, 271, 272, 273, 274, 275, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 285, 286, 287, 288, 1238, 1239, 1240, 1241, 1242, 1243, 1244, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 1249, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 337, 0, 338, 339, 340, 341, 342, 0, 343, 1252, 0, 345, 346, 347, 0, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 366, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 3581, 0, 385, 1257, 387, 388, 389, 0, 390, 391, 392, 1258, 1259, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 0, 416, 417, 418, 419, 0, 1264, 421, 422, 423, 424, 425, 0, 426, 427, 0, 813, 428, 429, 430, 0, 0, 431, 432, 433, 434, 435, 436, 1267, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 1268, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 3582, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 1271, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 1273, 529, 0, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 1276, 545, 1277, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 1280, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 1282, 1283, 1284, 1285, 584, 1286, 1287, 1288, 1289, 3583, 590, 591, 592, 0, 0, 227, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3584, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 1233, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 1236, 0, 1237, 0, 270, 271, 272, 273, 274, 275, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 285, 286, 287, 288, 1238, 1239, 1240, 1241, 1242, 1243, 1244, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 1249, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 337, 0, 338, 339, 340, 341, 342, 0, 343, 1252, 0, 345, 346, 347, 0, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 366, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 0, 0, 385, 1257, 387, 388, 389, 0, 390, 391, 392, 1258, 1259, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 0, 416, 417, 418, 419, 0, 1264, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 434, 435, 436, 1267, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 1268, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 3582, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 1271, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 1273, 529, 0, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 1276, 545, 1277, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 1280, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 1282, 1283, 1284, 1285, 584, 1286, 1287, 1288, 1289, 3583, 590, 591, 592, 0, 0, 227, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 52, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 1233, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 1236, 0, 1237, 0, 270, 271, 272, 273, 274, 275, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 285, 286, 287, 288, 1238, 1239, 1240, 1241, 1242, 1243, 1244, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 1249, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 337, 0, 338, 339, 340, 341, 342, 0, 343, 1252, 0, 345, 346, 347, 0, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 366, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 0, 0, 385, 1257, 387, 388, 389, 0, 390, 391, 392, 1258, 1259, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 0, 416, 417, 418, 419, 0, 1264, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 434, 435, 436, 1267, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 1268, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 1271, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 1273, 529, 0, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 1276, 545, 1277, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 1280, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 1282, 1283, 1284, 1285, 584, 1286, 1287, 1288, 1289, 589, 590, 591, 592, 0, 0, 227, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4173, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 1233, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 1236, 0, 1237, 0, 270, 271, 272, 273, 274, 275, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 285, 286, 287, 288, 1238, 1239, 1240, 1241, 1242, 1243, 1244, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 1249, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 337, 0, 338, 339, 340, 341, 342, 0, 343, 1252, 0, 345, 346, 347, 0, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 366, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 0, 0, 385, 1257, 387, 388, 389, 0, 390, 391, 392, 1258, 1259, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 0, 416, 417, 418, 419, 0, 1264, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 434, 435, 436, 1267, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 1268, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 1271, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 1273, 529, 0, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 1276, 545, 1277, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 1280, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 1282, 1283, 1284, 1285, 584, 1286, 1287, 1288, 1289, 589, 590, 591, 592, 0, 0, 868, 1505, 660, 0, 0, 0, 721, 0, 0, 0, 0, 0, 0, 0, 5267, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 269, 0, 270, 271, 272, 273, 274, 275, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 285, 286, 287, 288, 0, 0, 0, 289, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 1917, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 337, 0, 338, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 366, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 0, 0, 385, 386, 387, 388, 389, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 0, 416, 417, 418, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 1918, 0, 428, 429, 430, 0, 0, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 1919, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 0, 0, 868, 0, 0, 0, 0, 1506, 1507, 5078, 0, 0, 0, 0, 0, 0, 5079, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 3, 4, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 269, 0, 270, 271, 272, 273, 274, 275, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 285, 286, 287, 288, 0, 0, 0, 289, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 337, 0, 338, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 366, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 0, 0, 385, 386, 387, 388, 389, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 0, 416, 417, 418, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 41, 500, 501, 502, 503, 504, 0, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 45, 532, 533, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 1150, 565, 0, 566, 567, 568, 569, 570, 571, 0, 0, 572, 0, 50, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 0, 0, 51, 227, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 52, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 269, 0, 270, 271, 272, 273, 274, 275, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 285, 286, 287, 288, 0, 0, 0, 289, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 337, 0, 338, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 366, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 0, 0, 385, 386, 387, 388, 389, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 0, 416, 417, 418, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 0, 0, 600, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4861, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 0, 245, 246, 247, 248, 249, 0, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 0, 0, 270, 271, 272, 273, 274, 0, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 0, 286, 287, 288, 0, 0, 0, 0, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 0, 0, 0, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 352, 0, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 0, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 0, 0, 378, 0, 380, 381, 382, 383, 384, 0, 0, 385, 386, 0, 388, 0, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 0, 411, 412, 413, 414, 415, 0, 416, 417, 0, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 0, 435, 0, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 0, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 41, 500, 501, 502, 503, 504, 0, 505, 506, 507, 508, 509, 0, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 45, 532, 0, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 1150, 565, 0, 566, 0, 568, 569, 570, 571, 0, 0, 572, 0, 50, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 0, 0, 51, 600, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 52, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 0, 245, 246, 247, 248, 249, 0, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 0, 0, 270, 271, 272, 273, 274, 0, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 0, 286, 287, 288, 0, 0, 0, 0, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 0, 0, 0, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 352, 0, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 0, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 0, 0, 378, 0, 380, 381, 382, 383, 384, 0, 0, 385, 386, 0, 388, 0, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 0, 411, 412, 413, 414, 415, 0, 416, 417, 0, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 0, 435, 0, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 0, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 507, 508, 509, 0, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 0, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 0, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 0, 0, 600, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1352, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 0, 245, 246, 247, 248, 249, 0, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 0, 0, 270, 271, 272, 273, 274, 0, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 0, 286, 287, 288, 0, 0, 0, 0, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 0, 0, 0, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 352, 0, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 0, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 0, 0, 378, 0, 380, 381, 382, 383, 384, 0, 0, 385, 386, 0, 388, 0, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 0, 411, 412, 413, 414, 415, 0, 416, 417, 0, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 0, 435, 0, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 0, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 507, 508, 509, 0, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 0, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 0, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 0, 0, 600, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3411, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 0, 245, 246, 247, 248, 249, 0, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 0, 0, 270, 271, 272, 273, 274, 0, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 0, 286, 287, 288, 0, 0, 0, 0, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 0, 0, 0, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 352, 0, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 0, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 0, 0, 378, 0, 380, 381, 382, 383, 384, 0, 0, 385, 386, 0, 388, 0, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 0, 411, 412, 413, 414, 415, 0, 416, 417, 0, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 0, 435, 0, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 0, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 507, 508, 509, 0, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 0, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 0, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 0, 0, 600, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4100, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 0, 245, 246, 247, 248, 249, 0, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 0, 0, 270, 271, 272, 273, 274, 0, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 0, 286, 287, 288, 0, 0, 0, 0, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 0, 0, 0, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 352, 0, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 0, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 0, 0, 378, 0, 380, 381, 382, 383, 384, 0, 0, 385, 386, 0, 388, 0, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 0, 411, 412, 413, 414, 415, 0, 416, 417, 0, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 0, 435, 0, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 0, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 507, 508, 509, 0, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 0, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 0, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 0, 0, 0, 0, 0, 1063, 1505, 660, 0, 0, 882, 721, 0, 0, 0, 0, 4555, 883, 884, 885, 228, 229, 230, 231, 232, 233, 234, 235, 1635, 236, 237, 238, 1636, 1637, 1638, 1639, 1640, 1641, 1642, 239, 240, 1643, 241, 242, 243, 244, 245, 246, 247, 0, 1064, 250, 1065, 1066, 1644, 253, 254, 255, 256, 257, 258, 1645, 1646, 259, 260, 1067, 1068, 263, 1647, 264, 265, 266, 267, 0, 1648, 269, 1649, 270, 271, 272, 273, 274, 275, 276, 277, 278, 1650, 279, 280, 281, 282, 283, 284, 1651, 285, 286, 287, 288, 1652, 1653, 1654, 289, 1655, 1656, 1657, 290, 291, 292, 293, 294, 295, 1069, 1070, 298, 1658, 299, 1659, 300, 301, 302, 303, 304, 305, 1660, 306, 307, 308, 309, 1661, 1662, 310, 311, 1071, 313, 314, 1663, 315, 316, 317, 1664, 318, 319, 320, 1665, 321, 322, 323, 324, 0, 326, 327, 328, 0, 1666, 330, 1667, 331, 332, 1072, 334, 1668, 335, 1669, 336, 337, 1670, 338, 339, 340, 341, 342, 1671, 343, 0, 1672, 0, 346, 347, 1673, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 1674, 358, 359, 360, 361, 362, 363, 364, 1675, 365, 366, 0, 368, 369, 370, 371, 1074, 1075, 1676, 1076, 1677, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 1678, 1679, 385, 0, 387, 388, 389, 1680, 390, 391, 392, 1681, 1682, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 1077, 410, 1078, 412, 413, 414, 3839, 1683, 416, 417, 418, 419, 1684, 0, 421, 1079, 423, 424, 425, 1685, 426, 427, 1686, 1687, 3840, 429, 430, 1688, 1689, 431, 432, 0, 434, 435, 436, 0, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 1690, 447, 448, 0, 450, 0, 452, 453, 454, 1691, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 1080, 466, 467, 468, 469, 1692, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 1693, 482, 483, 484, 485, 486, 487, 488, 489, 0, 491, 492, 493, 494, 495, 496, 497, 498, 499, 1694, 500, 501, 502, 503, 504, 1695, 505, 506, 2174, 508, 509, 510, 511, 512, 1082, 514, 1696, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 0, 529, 1697, 530, 531, 1698, 532, 533, 534, 535, 536, 537, 538, 1699, 539, 1083, 1084, 1700, 1701, 542, 543, 0, 545, 0, 1702, 547, 548, 549, 550, 551, 552, 553, 1703, 1704, 554, 555, 556, 557, 558, 1705, 1706, 559, 560, 561, 562, 563, 0, 1085, 1707, 566, 567, 568, 569, 570, 571, 1708, 1709, 572, 1710, 1711, 573, 574, 575, 576, 577, 578, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 590, 591, 592, 0, 0, 0, 888, 889, 890, 0, 3841, 3842, 893, 894, 895, 896, 1063, 1505, 660, 0, 0, 882, 721, 0, 0, 0, 0, 0, 883, 884, 885, 228, 229, 230, 231, 232, 233, 234, 235, 1635, 236, 237, 238, 1636, 1637, 1638, 1639, 1640, 1641, 1642, 239, 240, 1643, 241, 242, 243, 244, 245, 246, 247, 0, 1064, 250, 1065, 1066, 1644, 253, 254, 255, 256, 257, 258, 1645, 1646, 259, 260, 1067, 1068, 263, 1647, 264, 265, 266, 267, 0, 1648, 269, 1649, 270, 271, 272, 273, 274, 275, 276, 277, 278, 1650, 279, 280, 281, 282, 283, 284, 1651, 285, 286, 287, 288, 1652, 1653, 1654, 289, 1655, 1656, 1657, 290, 291, 292, 293, 294, 295, 1069, 1070, 298, 1658, 299, 1659, 300, 301, 302, 303, 304, 305, 1660, 306, 307, 308, 309, 1661, 1662, 310, 311, 1071, 313, 314, 1663, 315, 316, 317, 1664, 318, 319, 320, 1665, 321, 322, 323, 324, 0, 326, 327, 328, 0, 1666, 330, 1667, 331, 332, 1072, 334, 1668, 335, 1669, 336, 337, 1670, 338, 339, 340, 341, 342, 1671, 343, 0, 1672, 0, 346, 347, 1673, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 1674, 358, 359, 360, 361, 362, 363, 364, 1675, 365, 366, 0, 368, 369, 370, 371, 1074, 1075, 1676, 1076, 1677, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 1678, 1679, 385, 0, 387, 388, 389, 1680, 390, 391, 392, 1681, 1682, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 1077, 410, 1078, 412, 413, 414, 4265, 1683, 416, 417, 418, 419, 1684, 0, 421, 1079, 423, 424, 425, 1685, 426, 427, 1686, 1687, 3840, 429, 430, 1688, 1689, 431, 432, 0, 434, 435, 436, 0, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 1690, 447, 448, 0, 450, 0, 452, 453, 454, 1691, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 1080, 466, 467, 468, 469, 1692, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 1693, 482, 483, 484, 485, 486, 487, 488, 489, 0, 491, 492, 493, 494, 495, 496, 497, 498, 499, 1694, 500, 501, 502, 503, 504, 1695, 505, 506, 2174, 508, 509, 510, 511, 512, 1082, 514, 1696, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 0, 529, 1697, 530, 531, 1698, 532, 533, 534, 535, 536, 537, 538, 1699, 539, 1083, 1084, 1700, 1701, 542, 543, 0, 545, 0, 1702, 547, 548, 549, 550, 551, 552, 553, 1703, 1704, 554, 555, 556, 557, 558, 1705, 1706, 559, 560, 561, 562, 563, 0, 1085, 1707, 566, 567, 568, 569, 570, 571, 1708, 1709, 572, 1710, 1711, 573, 574, 575, 576, 577, 578, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 590, 591, 592, 0, 600, 0, 888, 889, 890, 882, 3841, 3842, 893, 894, 895, 896, 883, 884, 885, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 0, 245, 246, 247, 248, 249, 0, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 886, 266, 267, 268, 0, 0, 0, 270, 271, 272, 273, 274, 0, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 0, 286, 287, 288, 0, 0, 0, 0, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 887, 0, 331, 332, 333, 334, 0, 335, 0, 336, 0, 0, 0, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 352, 0, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 0, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 0, 0, 378, 0, 380, 381, 382, 383, 384, 0, 0, 385, 386, 0, 388, 0, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 0, 411, 412, 413, 414, 415, 0, 416, 417, 0, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 0, 435, 0, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 0, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 507, 508, 509, 0, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 0, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 0, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 0, 600, 0, 888, 889, 890, 882, 891, 892, 893, 894, 895, 896, 883, 884, 885, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 0, 245, 246, 247, 248, 249, 0, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 1013, 266, 267, 268, 0, 0, 0, 270, 271, 272, 273, 274, 0, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 0, 286, 287, 288, 0, 0, 0, 0, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 1014, 0, 331, 332, 333, 334, 0, 335, 0, 336, 0, 0, 0, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 352, 0, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 0, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 0, 0, 378, 0, 380, 381, 382, 383, 384, 0, 0, 385, 386, 0, 388, 0, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 0, 411, 412, 413, 414, 415, 0, 416, 417, 0, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 0, 435, 0, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 0, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 507, 508, 509, 0, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 0, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 0, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 0, 600, 0, 888, 889, 890, 882, 891, 892, 893, 894, 895, 896, 883, 884, 885, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 0, 245, 246, 247, 248, 249, 0, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 1113, 266, 267, 268, 0, 0, 0, 270, 271, 272, 273, 274, 0, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 0, 286, 287, 288, 0, 0, 0, 0, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 1114, 0, 331, 332, 333, 334, 0, 335, 0, 336, 0, 0, 0, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 1115, 0, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 0, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 0, 0, 378, 0, 380, 381, 382, 383, 384, 0, 0, 385, 386, 0, 388, 0, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 0, 411, 412, 413, 414, 415, 0, 416, 417, 0, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 0, 435, 0, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 0, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 507, 508, 509, 0, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 0, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 0, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 0, 600, 0, 888, 889, 890, 882, 891, 892, 893, 894, 895, 896, 883, 884, 885, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 0, 245, 246, 247, 248, 249, 0, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 1734, 266, 267, 268, 0, 0, 0, 270, 271, 272, 273, 274, 0, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 0, 286, 287, 288, 0, 0, 0, 0, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 1735, 0, 331, 332, 333, 334, 0, 335, 0, 336, 0, 0, 0, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 352, 0, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 0, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 0, 0, 378, 0, 380, 381, 382, 383, 384, 0, 0, 385, 386, 0, 388, 0, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 0, 411, 412, 413, 414, 415, 0, 416, 417, 0, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 0, 435, 0, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 0, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 507, 508, 509, 0, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 0, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 0, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 0, 600, 0, 888, 889, 890, 882, 891, 892, 893, 894, 895, 896, 883, 884, 885, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 0, 245, 246, 247, 248, 249, 0, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 0, 0, 270, 271, 272, 273, 274, 0, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 0, 286, 287, 288, 0, 0, 0, 0, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 0, 0, 0, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 352, 0, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 0, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 0, 0, 378, 0, 380, 381, 382, 383, 384, 0, 0, 385, 386, 0, 388, 0, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 0, 411, 412, 413, 414, 415, 0, 416, 417, 0, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 0, 435, 0, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 0, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 507, 508, 509, 0, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 0, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 0, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 0, 600, 0, 888, 889, 890, 882, 891, 892, 893, 894, 895, 896, 883, 884, 885, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 0, 245, 246, 247, 248, 249, 0, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 2995, 266, 267, 268, 0, 0, 0, 270, 271, 272, 273, 274, 0, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 0, 286, 287, 288, 0, 0, 0, 0, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 2996, 0, 331, 332, 333, 334, 0, 335, 0, 336, 0, 0, 0, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 352, 0, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 0, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 0, 0, 378, 0, 380, 381, 382, 383, 384, 0, 0, 385, 386, 0, 388, 0, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 0, 411, 412, 413, 414, 415, 0, 416, 417, 0, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 0, 435, 0, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 0, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 507, 508, 509, 0, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 0, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 0, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 0, 600, 0, 888, 889, 890, 882, 891, 892, 893, 894, 895, 896, 883, 884, 885, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 0, 245, 246, 247, 248, 249, 0, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 0, 0, 270, 271, 272, 273, 274, 0, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 0, 286, 287, 288, 0, 0, 0, 0, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 0, 0, 0, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 352, 0, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 0, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 0, 0, 378, 0, 380, 381, 382, 383, 384, 0, 0, 385, 386, 0, 388, 0, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 0, 411, 412, 413, 414, 415, 0, 416, 417, 0, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 4838, 429, 430, 0, 0, 431, 432, 433, 0, 435, 0, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 0, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 507, 508, 509, 0, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 0, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 0, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 1634, 0, 0, 888, 889, 890, 0, 891, 892, 893, 894, 895, 896, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 1635, 236, 237, 238, 1636, 1637, 1638, 1639, 1640, 1641, 1642, 239, 240, 1643, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 1644, 253, 254, 255, 256, 257, 258, 1645, 1646, 259, 260, 261, 262, 263, 1647, 264, 265, 266, 267, 268, 1648, 269, 1649, 270, 271, 272, 273, 274, 275, 276, 277, 278, 1650, 279, 280, 281, 282, 283, 284, 1651, 285, 286, 287, 288, 1652, 1653, 1654, 289, 1655, 1656, 1657, 290, 291, 292, 293, 294, 295, 296, 297, 298, 1658, 299, 1659, 300, 301, 302, 303, 304, 305, 1660, 306, 307, 308, 309, 1661, 1662, 310, 311, 312, 313, 314, 1663, 315, 316, 317, 1664, 318, 319, 320, 1665, 321, 322, 323, 324, 325, 326, 327, 328, 329, 1666, 330, 1667, 331, 332, 333, 334, 1668, 335, 1669, 336, 337, 1670, 338, 339, 340, 341, 342, 1671, 343, 344, 1672, 345, 346, 347, 1673, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 1674, 358, 359, 360, 361, 362, 363, 364, 1675, 365, 366, 367, 368, 369, 370, 371, 372, 373, 1676, 374, 1677, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 1678, 1679, 385, 386, 387, 388, 389, 1680, 390, 391, 392, 1681, 1682, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 1683, 416, 417, 418, 419, 1684, 420, 421, 422, 423, 424, 425, 1685, 426, 427, 1686, 1687, 428, 429, 430, 1688, 1689, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 1690, 447, 448, 449, 450, 451, 452, 453, 454, 1691, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 1692, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 1693, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 1694, 500, 501, 502, 503, 504, 1695, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 1696, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 1697, 530, 531, 1698, 532, 533, 534, 535, 536, 537, 538, 1699, 539, 540, 541, 1700, 1701, 542, 543, 544, 545, 546, 1702, 547, 548, 549, 550, 551, 552, 553, 1703, 1704, 554, 555, 556, 557, 558, 1705, 1706, 559, 560, 561, 562, 563, 564, 565, 1707, 566, 567, 568, 569, 570, 571, 1708, 1709, 572, 1710, 1711, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 600, 0, 0, 0, 0, 0, 0, 0, 0, 1712, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 0, 245, 246, 247, 248, 249, 0, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 0, 0, 270, 271, 272, 273, 274, 0, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 0, 286, 287, 288, 0, 0, 0, 0, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 0, 0, 0, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 352, 0, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 0, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 0, 0, 378, 0, 380, 381, 382, 383, 384, 0, 0, 385, 386, 0, 388, 0, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 0, 411, 412, 413, 414, 415, 0, 416, 417, 0, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 0, 435, 0, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 0, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 507, 508, 509, 0, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 0, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 0, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 600, 0, 0, 0, 0, 0, 0, 0, 0, 818, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 0, 245, 246, 247, 248, 249, 0, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 0, 0, 270, 271, 272, 273, 274, 0, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 0, 286, 287, 288, 0, 0, 0, 0, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 0, 0, 0, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 352, 0, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 0, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 0, 0, 378, 0, 380, 381, 382, 383, 384, 0, 0, 385, 386, 0, 388, 0, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 0, 411, 412, 413, 414, 415, 0, 416, 417, 0, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 0, 435, 0, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 0, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 507, 508, 509, 0, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 0, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 0, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 1063, 0, 0, 0, 0, 0, 0, 0, 0, 5232, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 244, 245, 246, 247, 0, 1064, 250, 1065, 1066, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 1067, 1068, 263, 0, 264, 265, 266, 267, 0, 0, 269, 0, 270, 271, 272, 273, 274, 275, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 285, 286, 287, 288, 0, 0, 0, 289, 0, 0, 0, 290, 291, 292, 293, 294, 295, 1069, 1070, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 1071, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 0, 326, 327, 328, 0, 0, 330, 0, 331, 332, 1072, 334, 0, 335, 0, 336, 337, 0, 338, 339, 340, 341, 342, 0, 343, 0, 0, 0, 346, 347, 0, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 2170, 358, 359, 360, 361, 362, 363, 364, 0, 365, 366, 2171, 368, 369, 370, 371, 1074, 1075, 0, 1076, 0, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 0, 0, 385, 0, 387, 388, 389, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 1077, 410, 1078, 412, 413, 414, 0, 0, 416, 417, 418, 419, 0, 0, 421, 1079, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 2172, 431, 432, 2173, 434, 435, 436, 0, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 0, 450, 0, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 1080, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 484, 485, 486, 487, 488, 489, 0, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 2174, 508, 509, 510, 511, 512, 1082, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 0, 529, 0, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 0, 539, 1083, 1084, 0, 0, 542, 543, 0, 545, 0, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 0, 1085, 2175, 566, 567, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 3339, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 590, 591, 592, 0, 228, 229, 230, 231, 232, 233, 234, 235, 2176, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 244, 245, 246, 247, 0, 1064, 250, 1065, 1066, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 1067, 1068, 263, 0, 264, 265, 266, 267, 0, 0, 269, 0, 270, 271, 272, 273, 274, 275, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 285, 286, 287, 288, 0, 0, 0, 289, 0, 0, 0, 290, 291, 292, 293, 294, 295, 1069, 1070, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 1071, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 0, 326, 327, 328, 0, 0, 330, 0, 331, 332, 1072, 334, 0, 335, 0, 336, 337, 0, 338, 339, 340, 341, 342, 0, 343, 0, 0, 0, 346, 347, 0, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 2170, 358, 359, 360, 361, 362, 363, 364, 0, 365, 366, 2171, 368, 369, 370, 371, 1074, 1075, 0, 1076, 0, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 0, 0, 385, 0, 387, 388, 389, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 1077, 410, 1078, 412, 413, 414, 0, 0, 416, 417, 418, 419, 0, 0, 421, 1079, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 2172, 431, 432, 2173, 434, 435, 436, 0, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 0, 450, 0, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 1080, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 484, 485, 486, 487, 488, 489, 0, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 2174, 508, 509, 510, 511, 512, 1082, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 0, 529, 0, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 0, 539, 1083, 1084, 0, 0, 542, 543, 0, 545, 0, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 0, 1085, 2175, 566, 567, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 868, 1505, 660, 0, 0, 0, 721, 0, 0, 0, 0, 590, 591, 592, 0, 228, 229, 230, 231, 232, 233, 234, 235, 2176, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 269, 0, 270, 271, 272, 273, 274, 275, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 285, 286, 287, 288, 0, 0, 0, 289, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 2099, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 1917, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 337, 0, 338, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 366, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 0, 0, 385, 386, 387, 388, 389, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 0, 416, 417, 418, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 1918, 0, 428, 429, 430, 0, 0, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 1919, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 868, 1505, 660, 0, 0, 0, 721, 1506, 1507, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 269, 0, 270, 271, 272, 273, 274, 275, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 285, 286, 287, 288, 0, 0, 0, 289, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 2104, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 1917, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 337, 0, 338, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 366, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 0, 0, 385, 386, 387, 388, 389, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 0, 416, 417, 418, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 1918, 0, 428, 429, 430, 0, 0, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 1919, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 868, 1505, 660, 0, 0, 0, 721, 1506, 1507, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 269, 0, 270, 271, 272, 273, 274, 275, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 285, 286, 287, 288, 0, 0, 0, 289, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 1917, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 337, 0, 338, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 366, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 0, 0, 385, 386, 387, 388, 389, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 0, 416, 417, 418, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 1918, 0, 428, 429, 430, 0, 0, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 1919, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 868, 0, 660, 0, 0, 0, 721, 1506, 1507, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 269, 0, 270, 271, 272, 273, 274, 275, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 285, 286, 287, 288, 0, 0, 0, 289, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 2949, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 1917, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 337, 0, 338, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 366, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 0, 0, 385, 386, 387, 388, 389, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 0, 416, 417, 418, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 1918, 0, 428, 429, 430, 0, 0, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 1919, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 600, 0, 0, 0, 0, 0, 721, 733, 734, 0, 0, 0, 0, 0, 0, 228, 722, 230, 231, 232, 233, 234, 235, 723, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 0, 724, 246, 247, 248, 249, 0, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 0, 0, 270, 271, 272, 273, 274, 0, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 0, 286, 287, 288, 0, 0, 0, 0, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 725, 333, 334, 0, 335, 0, 726, 0, 727, 0, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 352, 0, 354, 355, 356, 357, 728, 358, 359, 360, 361, 362, 363, 364, 0, 365, 0, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 0, 0, 378, 0, 380, 381, 382, 383, 729, 0, 0, 385, 386, 0, 388, 0, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 0, 411, 412, 730, 414, 415, 0, 416, 417, 0, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 0, 435, 0, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 731, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 732, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 0, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 507, 508, 509, 0, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 0, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 0, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 1634, 5450, 660, 0, 0, 0, 721, 733, 734, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 1635, 236, 237, 238, 1636, 1637, 1638, 1639, 1640, 1641, 1642, 239, 240, 1643, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 1644, 253, 254, 255, 256, 257, 258, 1645, 1646, 259, 260, 261, 262, 263, 1647, 264, 265, 266, 267, 268, 1648, 269, 1649, 270, 271, 272, 273, 274, 275, 276, 277, 278, 1650, 279, 280, 281, 282, 283, 284, 1651, 285, 286, 287, 288, 1652, 1653, 1654, 289, 1655, 1656, 1657, 290, 291, 292, 293, 294, 295, 296, 297, 298, 1658, 299, 1659, 300, 301, 302, 303, 304, 305, 1660, 306, 307, 308, 309, 1661, 1662, 310, 311, 312, 313, 314, 1663, 315, 316, 317, 1664, 318, 319, 320, 1665, 321, 322, 323, 324, 325, 326, 327, 328, 329, 1666, 330, 1667, 331, 332, 333, 334, 1668, 335, 1669, 336, 337, 1670, 338, 339, 340, 341, 342, 1671, 343, 344, 1672, 345, 346, 347, 1673, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 1674, 358, 359, 360, 361, 362, 363, 364, 1675, 365, 366, 367, 368, 369, 370, 371, 372, 373, 1676, 374, 1677, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 1678, 1679, 385, 386, 387, 388, 389, 1680, 390, 391, 392, 1681, 1682, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 1683, 416, 417, 418, 419, 1684, 420, 421, 422, 423, 424, 425, 1685, 426, 427, 1686, 1687, 428, 429, 430, 1688, 1689, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 1690, 447, 448, 449, 450, 451, 452, 453, 454, 1691, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 1692, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 1693, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 1694, 500, 501, 502, 503, 504, 1695, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 1696, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 1697, 530, 531, 1698, 532, 533, 534, 535, 536, 537, 538, 1699, 539, 540, 541, 1700, 1701, 542, 543, 544, 545, 546, 1702, 547, 548, 549, 550, 551, 552, 553, 1703, 1704, 554, 555, 556, 557, 558, 1705, 1706, 559, 560, 561, 562, 563, 564, 565, 1707, 566, 567, 568, 569, 570, 571, 1708, 1709, 572, 1710, 1711, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 1634, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 1635, 236, 237, 238, 1636, 1637, 1638, 1639, 1640, 1641, 1642, 239, 240, 1643, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 1644, 253, 254, 255, 256, 257, 258, 1645, 1646, 259, 260, 261, 262, 263, 1647, 264, 265, 266, 267, 268, 1648, 269, 1649, 270, 271, 272, 273, 274, 275, 276, 277, 278, 1650, 279, 280, 281, 282, 283, 284, 1651, 285, 286, 287, 288, 1652, 1653, 1654, 289, 1655, 1656, 1657, 290, 291, 292, 293, 294, 295, 296, 297, 298, 1658, 299, 1659, 300, 301, 302, 303, 304, 305, 1660, 306, 307, 308, 309, 1661, 1662, 310, 311, 312, 313, 314, 1663, 315, 316, 317, 1664, 318, 319, 320, 1665, 321, 322, 323, 324, 325, 326, 327, 328, 329, 1666, 330, 1667, 331, 332, 333, 334, 1668, 335, 1669, 336, 337, 1670, 338, 339, 340, 341, 342, 1671, 343, 344, 1672, 345, 346, 347, 1673, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 1674, 358, 359, 360, 361, 362, 363, 364, 1675, 365, 366, 367, 368, 369, 370, 371, 372, 373, 1676, 374, 1677, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 1678, 1679, 385, 386, 387, 388, 389, 1680, 390, 391, 392, 1681, 1682, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 1683, 416, 417, 418, 419, 1684, 420, 421, 422, 423, 424, 425, 1685, 426, 427, 1686, 1687, 428, 429, 430, 1688, 1689, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 1690, 447, 448, 449, 450, 451, 452, 453, 454, 1691, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 1692, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 1693, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 1694, 500, 501, 502, 503, 504, 1695, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 1696, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 1697, 530, 531, 1698, 532, 533, 534, 535, 536, 537, 538, 1699, 539, 540, 541, 1700, 1701, 542, 543, 544, 545, 546, 1702, 547, 548, 549, 550, 551, 552, 553, 1703, 1704, 554, 555, 556, 557, 558, 1705, 1706, 559, 560, 561, 562, 563, 564, 565, 1707, 566, 567, 568, 569, 570, 571, 1708, 1709, 572, 1710, 1711, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 1634, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 3067, 233, 234, 235, 1635, 236, 237, 238, 1636, 1637, 1638, 1639, 1640, 1641, 1642, 239, 240, 1643, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 1644, 253, 254, 255, 256, 257, 258, 1645, 1646, 259, 260, 261, 262, 263, 1647, 264, 265, 266, 267, 268, 1648, 269, 1649, 270, 271, 272, 273, 274, 275, 276, 277, 278, 1650, 279, 280, 281, 282, 283, 284, 1651, 285, 286, 287, 288, 1652, 1653, 1654, 289, 1655, 1656, 1657, 290, 291, 292, 293, 294, 295, 296, 297, 298, 1658, 299, 1659, 300, 301, 302, 303, 304, 305, 1660, 306, 307, 308, 309, 1661, 1662, 310, 311, 312, 3068, 314, 1663, 315, 316, 317, 1664, 318, 319, 320, 1665, 321, 322, 323, 324, 325, 326, 327, 328, 329, 1666, 330, 1667, 331, 332, 333, 334, 1668, 335, 1669, 336, 337, 1670, 338, 339, 340, 341, 342, 1671, 343, 344, 1672, 345, 346, 347, 1673, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 1674, 358, 359, 360, 361, 362, 363, 364, 1675, 365, 366, 367, 368, 369, 370, 371, 372, 373, 1676, 374, 1677, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 1678, 1679, 385, 386, 387, 388, 389, 1680, 390, 391, 392, 1681, 1682, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 1683, 416, 417, 418, 419, 1684, 420, 421, 422, 423, 424, 425, 1685, 426, 427, 1686, 1687, 428, 429, 430, 1688, 1689, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 1690, 447, 448, 449, 450, 451, 452, 453, 454, 1691, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 1692, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 1693, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 1694, 500, 501, 502, 503, 504, 1695, 3069, 506, 507, 508, 509, 510, 511, 512, 513, 514, 1696, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 1697, 530, 531, 1698, 532, 533, 534, 535, 536, 537, 538, 1699, 539, 540, 541, 1700, 1701, 542, 543, 544, 545, 546, 1702, 547, 548, 549, 550, 551, 552, 553, 1703, 1704, 554, 555, 556, 557, 558, 1705, 1706, 559, 560, 561, 562, 563, 564, 565, 1707, 566, 567, 568, 569, 570, 571, 1708, 1709, 572, 1710, 1711, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 227, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 1233, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 1236, 0, 1237, 0, 270, 271, 272, 273, 274, 275, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 285, 286, 287, 288, 1238, 1239, 1240, 1241, 1242, 1243, 1244, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 1249, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 337, 0, 338, 339, 340, 341, 342, 0, 343, 1252, 0, 345, 346, 347, 0, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 366, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 0, 0, 385, 1257, 387, 388, 389, 0, 390, 391, 392, 1258, 1259, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 0, 416, 417, 418, 419, 0, 1264, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 434, 435, 436, 1267, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 1268, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 1271, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 1273, 529, 0, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 1276, 545, 1277, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 1280, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 1282, 1283, 1284, 1285, 584, 1286, 1287, 1288, 1289, 589, 590, 591, 592, 868, 0, 660, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 269, 0, 270, 271, 272, 273, 274, 275, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 285, 286, 287, 288, 0, 0, 0, 289, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 1917, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 337, 0, 338, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 366, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 0, 0, 385, 386, 387, 388, 389, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 0, 416, 417, 418, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 1918, 0, 428, 429, 430, 0, 0, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 1919, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 868, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 906, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 269, 0, 270, 271, 272, 273, 274, 275, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 285, 286, 287, 288, 0, 0, 0, 289, 0, 0, 869, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 337, 0, 338, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 366, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 0, 0, 385, 386, 387, 388, 389, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 0, 416, 417, 418, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 870, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 868, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 926, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 269, 0, 270, 271, 272, 273, 274, 275, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 285, 286, 287, 288, 0, 0, 0, 289, 0, 0, 869, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 337, 0, 338, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 366, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 0, 0, 385, 386, 387, 388, 389, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 927, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 0, 416, 417, 418, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 870, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 868, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 269, 0, 270, 271, 272, 273, 274, 275, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 285, 286, 287, 288, 0, 0, 0, 289, 0, 0, 869, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 337, 0, 338, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 366, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 0, 0, 385, 386, 387, 388, 389, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 0, 416, 417, 418, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 870, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 2435, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 868, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 269, 0, 270, 271, 272, 273, 274, 275, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 285, 286, 287, 288, 0, 0, 0, 289, 0, 0, 869, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 337, 0, 338, 339, 340, 341, 342, 0, 343, 344, 3427, 345, 346, 347, 0, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 366, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 0, 0, 385, 386, 387, 388, 389, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 0, 416, 417, 418, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 870, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 868, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 269, 0, 270, 271, 272, 273, 274, 275, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 285, 286, 287, 288, 0, 0, 0, 289, 0, 0, 869, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 337, 0, 338, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 366, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 0, 0, 385, 386, 387, 388, 389, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 0, 416, 417, 418, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 870, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 868, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 269, 0, 270, 271, 272, 273, 274, 275, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 285, 286, 287, 288, 0, 0, 0, 289, 0, 0, 869, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 337, 0, 338, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 366, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 0, 0, 385, 386, 387, 388, 389, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 1032, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 0, 416, 417, 418, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 870, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 868, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 269, 0, 270, 271, 272, 273, 274, 275, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 285, 286, 287, 288, 0, 0, 0, 289, 0, 0, 869, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 337, 0, 338, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 1108, 353, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 366, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 0, 0, 385, 386, 387, 388, 389, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 0, 416, 417, 418, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 870, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 868, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 269, 0, 270, 271, 272, 273, 274, 275, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 285, 286, 287, 288, 0, 0, 0, 289, 0, 0, 869, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 337, 0, 338, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 1121, 353, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 366, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 0, 0, 385, 386, 387, 388, 389, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 0, 416, 417, 418, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 870, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 868, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 269, 0, 270, 271, 272, 273, 274, 275, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 285, 286, 287, 288, 0, 0, 0, 289, 0, 0, 869, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 337, 0, 338, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 1133, 353, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 366, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 0, 0, 385, 386, 387, 388, 389, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 1134, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 0, 416, 417, 418, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 870, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 868, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 3, 4, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 269, 0, 270, 271, 272, 273, 274, 275, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 285, 286, 287, 288, 0, 0, 0, 289, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 337, 0, 338, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 366, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 0, 0, 385, 386, 387, 388, 389, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 0, 416, 417, 418, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 868, 0, 660, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 269, 0, 270, 271, 272, 273, 274, 275, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 285, 286, 287, 288, 0, 0, 0, 289, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 2084, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 337, 0, 338, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 366, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 0, 0, 385, 386, 387, 388, 389, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 0, 416, 417, 418, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 868, 0, 660, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 269, 0, 270, 271, 272, 273, 274, 275, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 285, 286, 287, 288, 0, 0, 0, 289, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 337, 0, 338, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 366, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 0, 0, 385, 386, 387, 388, 389, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 0, 416, 417, 418, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 868, 0, 660, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 269, 0, 270, 271, 272, 273, 274, 275, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 285, 286, 287, 288, 0, 0, 0, 289, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 337, 0, 338, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 1903, 353, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 366, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 0, 0, 385, 386, 387, 388, 389, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 0, 416, 417, 418, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 227, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 269, 0, 270, 271, 272, 273, 274, 275, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 285, 286, 287, 288, 0, 0, 0, 289, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 337, 0, 338, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 366, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 0, 0, 385, 386, 387, 388, 389, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 0, 416, 417, 418, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 227, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 269, 0, 270, 271, 272, 273, 274, 275, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 285, 286, 287, 288, 0, 0, 0, 289, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 337, 0, 338, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 1056, 353, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 366, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 0, 0, 385, 386, 387, 388, 389, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 0, 416, 417, 418, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 227, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 269, 0, 270, 271, 272, 273, 274, 275, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 285, 286, 287, 288, 0, 0, 0, 289, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 337, 0, 338, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 1105, 353, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 366, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 0, 0, 385, 386, 387, 388, 389, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 0, 416, 417, 418, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 227, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 269, 0, 270, 271, 272, 273, 274, 275, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 285, 286, 287, 288, 0, 0, 0, 289, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 337, 0, 338, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 1119, 353, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 366, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 0, 0, 385, 386, 387, 388, 389, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 0, 416, 417, 418, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 227, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 269, 0, 270, 271, 272, 273, 274, 275, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 285, 286, 287, 288, 0, 0, 0, 289, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 337, 0, 338, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 1123, 353, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 366, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 0, 0, 385, 386, 387, 388, 389, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 0, 416, 417, 418, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 868, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 269, 0, 270, 271, 272, 273, 274, 275, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 285, 286, 287, 288, 0, 0, 0, 289, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 337, 0, 338, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 366, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 0, 0, 385, 386, 387, 388, 389, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 0, 416, 417, 418, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 567, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 600, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 0, 245, 246, 247, 248, 249, 0, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 2210, 264, 265, 266, 267, 268, 0, 0, 2290, 270, 271, 272, 273, 274, 0, 276, 277, 278, 2211, 279, 280, 281, 282, 283, 284, 0, 0, 286, 287, 288, 0, 0, 0, 0, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 2291, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 2213, 336, 0, 0, 0, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 2292, 0, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 0, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 0, 0, 378, 0, 380, 381, 382, 383, 384, 0, 0, 385, 386, 0, 388, 0, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 0, 411, 412, 413, 414, 415, 0, 416, 417, 0, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 0, 435, 0, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 2214, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 0, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 507, 508, 509, 0, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 0, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 2215, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 0, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 600, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 0, 245, 246, 247, 248, 249, 0, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 2210, 264, 265, 266, 267, 268, 0, 0, 0, 270, 271, 272, 273, 274, 0, 276, 277, 278, 2211, 279, 280, 281, 282, 283, 284, 0, 0, 286, 287, 288, 0, 0, 0, 0, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 2291, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 2213, 336, 0, 0, 0, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 352, 0, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 0, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 0, 0, 378, 0, 380, 381, 382, 383, 384, 0, 0, 385, 386, 0, 388, 3273, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 0, 411, 412, 413, 414, 415, 0, 416, 417, 0, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 0, 435, 0, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 2214, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 0, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 507, 508, 509, 0, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 0, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 2215, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 0, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 600, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 781, 234, 235, 740, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 0, 245, 246, 247, 248, 249, 0, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 0, 0, 270, 271, 272, 273, 274, 0, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 741, 0, 286, 287, 288, 0, 0, 0, 0, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 0, 0, 0, 339, 340, 341, 342, 782, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 352, 0, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 0, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 0, 0, 378, 0, 380, 381, 382, 383, 384, 0, 0, 385, 386, 0, 388, 0, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 0, 411, 412, 413, 414, 415, 0, 416, 417, 0, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 0, 435, 0, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 742, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 0, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 743, 500, 501, 502, 503, 504, 0, 505, 506, 507, 508, 509, 0, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 0, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 0, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 600, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 740, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 0, 245, 246, 247, 248, 249, 0, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 0, 0, 270, 271, 272, 273, 274, 0, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 741, 0, 286, 287, 288, 0, 0, 0, 0, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 0, 0, 0, 339, 340, 341, 342, 2956, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 352, 0, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 0, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 0, 0, 378, 0, 380, 381, 382, 383, 384, 0, 0, 385, 386, 0, 388, 0, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 0, 411, 412, 413, 414, 415, 0, 416, 417, 0, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 0, 435, 0, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 742, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 0, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 743, 500, 501, 502, 503, 504, 0, 505, 506, 507, 508, 509, 0, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 0, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 0, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 600, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 0, 245, 246, 247, 248, 249, 0, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 2210, 264, 265, 266, 267, 268, 0, 0, 0, 270, 271, 272, 273, 274, 0, 276, 277, 278, 2211, 279, 280, 281, 282, 283, 284, 0, 0, 286, 287, 288, 0, 0, 0, 0, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 2291, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 2213, 336, 0, 0, 0, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 352, 0, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 0, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 0, 0, 378, 0, 380, 381, 382, 383, 384, 0, 0, 385, 386, 0, 388, 0, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 0, 411, 412, 413, 414, 415, 0, 416, 417, 0, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 0, 435, 0, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 2214, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 0, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 507, 508, 509, 0, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 0, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 2215, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 0, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 600, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 740, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 0, 245, 246, 247, 248, 249, 0, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 0, 0, 270, 271, 272, 273, 274, 0, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 741, 0, 286, 287, 288, 0, 0, 0, 0, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 0, 0, 0, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 352, 0, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 0, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 0, 0, 378, 0, 380, 381, 382, 383, 384, 0, 0, 385, 386, 0, 388, 0, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 0, 411, 412, 413, 414, 415, 0, 416, 417, 0, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 0, 435, 0, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 742, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 0, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 743, 500, 501, 502, 503, 504, 0, 505, 506, 507, 508, 509, 0, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 0, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 0, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 600, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 1946, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 0, 245, 246, 247, 248, 249, 0, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 0, 0, 270, 271, 272, 273, 274, 0, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 0, 286, 287, 288, 0, 0, 0, 0, 0, 0, 0, 290, 291, 292, 1947, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 1948, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 1949, 336, 0, 0, 0, 1950, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 352, 0, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 0, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 0, 0, 378, 0, 380, 381, 1951, 1952, 384, 0, 0, 385, 386, 0, 388, 0, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 0, 411, 412, 413, 414, 415, 0, 416, 417, 0, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 0, 435, 0, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 1953, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 0, 485, 486, 487, 1954, 489, 490, 491, 492, 493, 1955, 495, 496, 497, 498, 499, 0, 1956, 501, 502, 503, 504, 0, 505, 506, 507, 508, 509, 0, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 1957, 532, 0, 1958, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 1959, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 0, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 600, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 0, 245, 246, 247, 248, 249, 0, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 0, 0, 270, 271, 272, 273, 274, 0, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 741, 0, 286, 287, 288, 0, 0, 0, 0, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 0, 0, 0, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 352, 0, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 0, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 0, 0, 378, 0, 380, 381, 382, 383, 384, 0, 0, 385, 386, 0, 388, 0, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 0, 411, 412, 413, 414, 415, 0, 416, 417, 0, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 0, 435, 0, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 742, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 0, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 743, 500, 501, 502, 503, 504, 0, 505, 506, 507, 508, 509, 0, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 0, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 0, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 600, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 919, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 0, 245, 246, 247, 248, 249, 0, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 0, 0, 270, 271, 272, 273, 274, 0, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 0, 286, 287, 288, 0, 0, 0, 0, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 0, 0, 0, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 920, 0, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 0, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 0, 0, 378, 0, 380, 381, 382, 383, 384, 0, 0, 385, 386, 0, 388, 0, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 0, 411, 412, 413, 414, 415, 0, 416, 417, 0, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 813, 428, 429, 430, 0, 0, 431, 432, 433, 0, 435, 0, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 0, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 507, 508, 509, 0, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 0, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 0, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 600, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 3048, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 0, 245, 246, 247, 248, 249, 0, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 0, 0, 270, 271, 272, 273, 274, 0, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 0, 286, 287, 288, 0, 0, 0, 0, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 0, 0, 0, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 352, 0, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 0, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 0, 0, 378, 0, 380, 381, 382, 383, 384, 0, 0, 385, 386, 0, 388, 0, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 0, 411, 412, 413, 414, 415, 0, 416, 417, 0, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 0, 435, 0, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 0, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 507, 508, 509, 0, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 0, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 3049, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 0, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 600, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 3061, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 0, 245, 246, 247, 248, 249, 0, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 0, 0, 270, 271, 272, 273, 274, 0, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 0, 286, 287, 288, 0, 0, 0, 0, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 0, 0, 0, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 352, 0, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 0, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 0, 0, 378, 0, 380, 381, 382, 383, 384, 0, 0, 385, 386, 0, 388, 0, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 0, 411, 412, 413, 414, 415, 0, 416, 417, 0, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 0, 435, 0, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 0, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 507, 508, 509, 0, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 0, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 3062, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 0, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 600, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 601, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 0, 245, 246, 247, 248, 249, 0, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 0, 0, 270, 271, 272, 273, 274, 0, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 0, 286, 287, 288, 0, 0, 0, 0, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 0, 0, 0, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 352, 0, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 0, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 0, 0, 378, 0, 380, 381, 382, 383, 384, 0, 0, 385, 386, 0, 388, 0, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 0, 411, 412, 413, 414, 415, 0, 416, 417, 0, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 0, 435, 0, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 0, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 507, 508, 509, 0, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 0, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 0, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 600, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 651, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 0, 245, 246, 247, 248, 249, 0, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 0, 0, 270, 271, 272, 273, 274, 0, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 0, 286, 287, 288, 0, 0, 0, 0, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 0, 0, 0, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 352, 0, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 0, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 0, 0, 378, 0, 380, 381, 382, 383, 384, 0, 0, 385, 386, 0, 388, 0, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 0, 411, 412, 413, 414, 415, 0, 416, 417, 0, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 0, 435, 0, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 652, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 0, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 507, 508, 509, 0, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 0, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 0, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 600, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 773, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 0, 245, 246, 247, 248, 249, 0, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 0, 0, 270, 271, 272, 273, 274, 0, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 0, 286, 287, 288, 0, 0, 0, 0, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 0, 0, 0, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 352, 0, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 0, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 0, 0, 378, 0, 380, 381, 382, 383, 384, 0, 0, 385, 386, 0, 388, 0, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 0, 411, 412, 413, 414, 415, 0, 416, 417, 0, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 0, 435, 0, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 0, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 774, 0, 505, 506, 507, 508, 509, 0, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 0, 534, 535, 536, 537, 538, 0, 539, 775, 541, 0, 0, 776, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 0, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 600, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 807, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 0, 245, 246, 247, 248, 249, 0, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 0, 0, 270, 271, 272, 273, 274, 0, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 0, 286, 287, 288, 0, 0, 0, 0, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 0, 0, 0, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 352, 0, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 0, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 0, 0, 378, 0, 380, 381, 382, 383, 384, 0, 0, 385, 386, 0, 388, 0, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 0, 411, 412, 413, 414, 415, 0, 416, 417, 0, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 0, 435, 0, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 0, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 808, 0, 505, 506, 507, 508, 509, 0, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 0, 534, 535, 536, 537, 538, 0, 539, 809, 541, 0, 0, 810, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 0, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 600, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 0, 245, 246, 247, 248, 249, 0, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 0, 0, 270, 271, 272, 273, 274, 0, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 0, 286, 287, 288, 0, 0, 0, 0, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 0, 0, 0, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 352, 0, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 0, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 0, 0, 378, 0, 380, 381, 382, 383, 384, 0, 0, 385, 386, 0, 388, 0, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 0, 411, 412, 413, 414, 415, 0, 416, 417, 0, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 813, 428, 429, 430, 0, 0, 431, 432, 433, 0, 435, 0, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 0, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 507, 508, 509, 0, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 0, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 0, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 600, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 877, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 0, 245, 246, 247, 248, 249, 0, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 0, 0, 270, 271, 272, 273, 274, 0, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 0, 286, 287, 288, 0, 0, 0, 0, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 0, 0, 0, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 878, 0, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 0, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 0, 0, 378, 0, 380, 381, 382, 383, 384, 0, 0, 385, 386, 0, 388, 0, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 0, 411, 412, 413, 414, 415, 0, 416, 417, 0, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 0, 435, 0, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 0, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 507, 508, 509, 0, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 0, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 0, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 600, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 1048, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 0, 245, 246, 247, 248, 249, 0, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 0, 0, 270, 271, 272, 273, 274, 0, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 0, 286, 287, 288, 0, 0, 0, 0, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 0, 0, 0, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 352, 0, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 0, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 0, 0, 378, 0, 380, 381, 382, 383, 384, 0, 0, 385, 386, 0, 388, 0, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 0, 411, 412, 413, 414, 415, 0, 416, 417, 0, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 0, 435, 0, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 0, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 507, 508, 509, 0, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 0, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 0, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 600, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 773, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 0, 245, 246, 247, 248, 249, 0, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 0, 0, 270, 271, 272, 273, 274, 0, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 0, 286, 287, 288, 0, 0, 0, 0, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 0, 0, 0, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 352, 0, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 0, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 0, 0, 378, 0, 380, 381, 382, 383, 384, 0, 0, 385, 386, 0, 388, 0, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 0, 411, 412, 413, 414, 415, 0, 416, 417, 0, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 0, 435, 0, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 0, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 507, 508, 509, 0, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 0, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 0, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 600, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 1195, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 0, 245, 246, 247, 248, 249, 0, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 0, 0, 270, 271, 272, 273, 274, 0, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 0, 286, 287, 288, 0, 0, 0, 0, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 0, 0, 0, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 352, 0, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 0, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 0, 0, 378, 0, 380, 381, 382, 383, 384, 0, 0, 385, 386, 0, 388, 0, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 0, 411, 412, 413, 414, 415, 0, 416, 417, 0, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 0, 435, 0, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 0, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 507, 508, 509, 0, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 0, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 0, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 600, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 1327, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 0, 245, 246, 247, 248, 249, 0, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 0, 0, 270, 271, 272, 273, 274, 0, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 0, 286, 287, 288, 0, 0, 0, 0, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 0, 0, 0, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 352, 0, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 0, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 0, 0, 378, 0, 380, 381, 382, 383, 384, 0, 0, 385, 386, 0, 388, 0, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 0, 411, 412, 413, 414, 415, 0, 416, 417, 0, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 0, 435, 0, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 0, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 507, 508, 509, 0, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 0, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 0, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 600, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 1338, 245, 246, 247, 248, 249, 0, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 793, 260, 261, 262, 1339, 0, 264, 265, 266, 267, 268, 0, 0, 0, 270, 271, 272, 273, 274, 0, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 0, 286, 287, 288, 0, 0, 0, 0, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 0, 0, 0, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 352, 0, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 0, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 0, 0, 378, 0, 380, 381, 382, 383, 384, 0, 0, 385, 386, 0, 388, 0, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 796, 409, 0, 411, 412, 413, 414, 415, 0, 416, 417, 0, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 0, 435, 0, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 0, 797, 486, 487, 488, 489, 490, 491, 492, 493, 798, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 1331, 0, 505, 506, 507, 508, 509, 0, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 0, 534, 535, 536, 537, 538, 0, 539, 800, 541, 0, 0, 801, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 0, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 802, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 600, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 0, 245, 246, 247, 248, 249, 0, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 0, 0, 270, 271, 272, 273, 274, 0, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 0, 286, 287, 288, 0, 0, 0, 0, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 0, 0, 0, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 1450, 0, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 0, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 0, 0, 378, 0, 380, 381, 382, 383, 384, 0, 0, 385, 386, 0, 388, 0, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 0, 411, 412, 413, 414, 415, 0, 416, 417, 0, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 813, 428, 429, 430, 0, 0, 431, 432, 433, 0, 435, 0, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 0, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 507, 508, 509, 0, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 0, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 0, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 600, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 1510, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 0, 245, 246, 247, 248, 249, 0, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 0, 0, 270, 271, 272, 273, 274, 0, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 0, 286, 287, 288, 0, 0, 0, 0, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 0, 0, 0, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 1511, 0, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 0, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 0, 0, 378, 0, 380, 381, 382, 383, 384, 0, 0, 385, 386, 0, 388, 0, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 0, 411, 412, 413, 414, 415, 0, 416, 417, 0, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 0, 435, 0, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 0, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 507, 508, 509, 0, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 0, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 0, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 600, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 0, 245, 246, 247, 248, 249, 0, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 0, 0, 270, 271, 272, 273, 274, 0, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 0, 286, 287, 288, 0, 0, 0, 0, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 0, 0, 0, 339, 340, 341, 2856, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 352, 0, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 0, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 0, 0, 378, 0, 380, 381, 382, 383, 384, 0, 0, 385, 386, 0, 388, 0, 0, 390, 391, 2857, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 0, 411, 412, 413, 414, 415, 0, 416, 417, 0, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 0, 435, 0, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 0, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 507, 508, 509, 0, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 2858, 532, 0, 534, 2859, 536, 2860, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 2861, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 0, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 600, 0, 660, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 0, 245, 246, 247, 248, 249, 0, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 0, 0, 270, 271, 272, 273, 274, 0, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 0, 286, 287, 288, 0, 0, 0, 0, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 0, 0, 0, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 352, 0, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 0, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 0, 0, 378, 0, 380, 381, 382, 383, 384, 0, 0, 385, 386, 0, 388, 0, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 0, 411, 412, 413, 414, 415, 0, 416, 417, 0, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 0, 435, 0, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 0, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 507, 508, 509, 0, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 0, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 0, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 600, 0, 0, 0, 0, 0, 721, 0, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 0, 245, 246, 247, 248, 249, 0, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 0, 0, 270, 271, 272, 273, 274, 0, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 0, 286, 287, 288, 0, 0, 0, 0, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 0, 0, 0, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 352, 0, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 0, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 0, 0, 378, 0, 380, 381, 382, 383, 384, 0, 0, 385, 386, 0, 388, 0, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 0, 411, 412, 413, 414, 415, 0, 416, 417, 0, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 0, 435, 0, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 0, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 507, 508, 509, 0, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 0, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 0, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 600, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 4121, 0, 239, 240, 0, 241, 242, 243, 0, 245, 246, 247, 248, 249, 0, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 0, 0, 270, 271, 272, 273, 274, 0, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 0, 286, 287, 288, 0, 0, 0, 0, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 0, 0, 0, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 352, 0, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 0, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 0, 0, 378, 0, 380, 381, 382, 383, 384, 0, 0, 385, 386, 0, 388, 0, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 0, 411, 412, 413, 414, 415, 0, 416, 417, 0, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 0, 435, 0, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 0, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 507, 508, 509, 0, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 0, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 0, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 600, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 4135, 0, 239, 240, 0, 241, 242, 243, 0, 245, 246, 247, 248, 249, 0, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 0, 0, 270, 271, 272, 273, 274, 0, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 0, 286, 287, 288, 0, 0, 0, 0, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 0, 0, 0, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 352, 0, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 0, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 0, 0, 378, 0, 380, 381, 382, 383, 384, 0, 0, 385, 386, 0, 388, 0, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 0, 411, 412, 413, 414, 415, 0, 416, 417, 0, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 0, 435, 0, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 0, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 507, 508, 509, 0, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 0, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 0, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 600, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 0, 245, 246, 247, 248, 249, 0, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 0, 0, 270, 271, 272, 273, 274, 0, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 0, 286, 287, 288, 0, 0, 0, 0, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 0, 0, 0, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 352, 0, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 0, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 0, 0, 378, 0, 380, 381, 382, 383, 384, 0, 0, 385, 386, 0, 388, 0, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 0, 411, 412, 413, 414, 415, 0, 416, 417, 0, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 0, 435, 0, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 0, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 507, 508, 509, 0, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 0, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 0, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 600, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 0, 245, 246, 247, 248, 249, 0, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 0, 0, 270, 271, 272, 273, 274, 0, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 0, 286, 287, 288, 0, 0, 0, 0, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 0, 0, 0, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 352, 0, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 0, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 0, 0, 378, 0, 380, 381, 382, 383, 384, 0, 0, 385, 386, 0, 388, 0, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 0, 411, 412, 413, 414, 415, 0, 416, 417, 0, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 0, 435, 0, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 0, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 507, 508, 509, 0, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 0, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 759, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 0, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 600, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 0, 245, 246, 247, 248, 249, 0, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 0, 0, 270, 271, 272, 273, 274, 0, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 0, 286, 287, 288, 0, 0, 0, 0, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 0, 0, 0, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 352, 0, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 0, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 0, 0, 378, 0, 380, 381, 382, 383, 384, 0, 0, 385, 386, 0, 388, 0, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 0, 411, 412, 413, 414, 415, 0, 416, 417, 0, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 0, 435, 0, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 0, 485, 486, 487, 488, 489, 490, 491, 492, 771, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 507, 508, 509, 0, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 0, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 0, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 600, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 0, 245, 246, 247, 248, 249, 0, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 793, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 0, 0, 270, 271, 272, 273, 274, 0, 276, 277, 278, 0, 794, 280, 281, 282, 283, 284, 0, 0, 286, 287, 288, 0, 0, 0, 0, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 0, 0, 0, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 352, 0, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 0, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 0, 0, 378, 0, 380, 381, 382, 383, 384, 0, 0, 385, 386, 0, 388, 0, 0, 390, 391, 795, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 796, 409, 0, 411, 412, 413, 414, 415, 0, 416, 417, 0, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 0, 435, 0, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 0, 797, 486, 487, 488, 489, 490, 491, 492, 493, 798, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 799, 0, 505, 506, 507, 508, 509, 0, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 0, 534, 535, 536, 537, 538, 0, 539, 800, 541, 0, 0, 801, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 0, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 802, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 600, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 0, 245, 246, 247, 248, 249, 0, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 0, 0, 270, 271, 272, 273, 274, 0, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 0, 286, 287, 288, 0, 0, 0, 0, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 0, 0, 0, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 352, 0, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 0, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 0, 0, 378, 0, 380, 381, 382, 383, 384, 0, 0, 385, 386, 0, 388, 0, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 0, 411, 412, 413, 414, 415, 0, 416, 417, 0, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 0, 435, 0, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 824, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 0, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 507, 508, 509, 0, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 0, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 0, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 600, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 0, 245, 246, 247, 248, 249, 0, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 0, 0, 270, 271, 272, 273, 274, 0, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 0, 286, 287, 288, 0, 0, 0, 0, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 0, 0, 0, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 902, 0, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 0, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 0, 0, 378, 0, 380, 381, 382, 383, 384, 0, 0, 385, 386, 0, 388, 0, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 0, 411, 412, 413, 414, 415, 0, 416, 417, 0, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 0, 435, 0, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 0, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 507, 508, 509, 0, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 0, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 0, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 600, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 0, 245, 246, 247, 248, 249, 0, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 0, 0, 270, 271, 272, 273, 274, 0, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 0, 286, 287, 288, 0, 0, 0, 0, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 0, 0, 0, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 912, 0, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 0, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 0, 0, 378, 0, 380, 381, 382, 383, 384, 0, 0, 385, 386, 0, 388, 0, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 0, 411, 412, 413, 414, 415, 0, 416, 417, 0, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 0, 435, 0, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 0, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 507, 508, 509, 0, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 0, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 0, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 600, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 0, 245, 246, 247, 248, 249, 0, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 0, 0, 270, 271, 272, 273, 274, 0, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 0, 286, 287, 288, 0, 0, 0, 0, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 0, 0, 0, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 930, 0, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 0, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 0, 0, 378, 0, 380, 381, 382, 383, 384, 0, 0, 385, 386, 0, 388, 0, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 0, 411, 412, 413, 414, 415, 0, 416, 417, 0, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 0, 435, 0, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 0, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 507, 508, 509, 0, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 0, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 0, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 600, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 0, 245, 246, 247, 248, 249, 0, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 0, 0, 270, 271, 272, 273, 274, 0, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 0, 286, 287, 288, 0, 0, 0, 0, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 0, 0, 0, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 997, 0, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 0, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 0, 0, 378, 0, 380, 381, 382, 383, 384, 0, 0, 385, 386, 0, 388, 0, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 0, 411, 412, 413, 414, 415, 0, 416, 417, 0, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 0, 435, 0, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 0, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 507, 508, 509, 0, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 0, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 0, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 600, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 0, 245, 246, 247, 248, 249, 0, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 0, 0, 270, 271, 272, 273, 274, 0, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 0, 286, 287, 288, 0, 0, 0, 0, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 0, 0, 0, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 1003, 0, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 0, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 0, 0, 378, 0, 380, 381, 382, 383, 384, 0, 0, 385, 386, 0, 388, 0, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 0, 411, 412, 413, 414, 415, 0, 416, 417, 0, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 0, 435, 0, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 0, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 507, 508, 509, 0, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 0, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 0, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 600, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 0, 245, 246, 247, 248, 249, 0, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 0, 0, 270, 271, 272, 273, 274, 0, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 0, 286, 287, 288, 0, 0, 0, 0, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 0, 0, 0, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 1020, 0, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 0, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 0, 0, 378, 0, 380, 381, 382, 383, 384, 0, 0, 385, 386, 0, 388, 0, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 0, 411, 412, 413, 414, 415, 0, 416, 417, 0, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 0, 435, 0, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 0, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 507, 508, 509, 0, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 0, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 0, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 600, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 0, 245, 246, 247, 248, 249, 0, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 0, 0, 270, 271, 272, 273, 274, 0, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 0, 286, 287, 288, 0, 0, 0, 0, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 0, 0, 0, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 1023, 0, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 0, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 0, 0, 378, 0, 380, 381, 382, 383, 384, 0, 0, 385, 386, 0, 388, 0, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 0, 411, 412, 413, 414, 415, 0, 416, 417, 0, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 0, 435, 0, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 0, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 507, 508, 509, 0, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 0, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 0, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 600, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 0, 245, 246, 247, 248, 249, 0, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 0, 0, 270, 271, 272, 273, 274, 0, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 0, 286, 287, 288, 0, 0, 0, 0, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 0, 0, 0, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 1025, 0, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 0, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 0, 0, 378, 0, 380, 381, 382, 383, 384, 0, 0, 385, 386, 0, 388, 0, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 0, 411, 412, 413, 414, 415, 0, 416, 417, 0, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 0, 435, 0, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 0, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 507, 508, 509, 0, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 0, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 0, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 600, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 0, 245, 246, 247, 248, 249, 0, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 0, 0, 270, 271, 272, 273, 274, 0, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 0, 286, 287, 288, 0, 0, 0, 0, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 0, 0, 0, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 1061, 0, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 0, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 0, 0, 378, 0, 380, 381, 382, 383, 384, 0, 0, 385, 386, 0, 388, 0, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 0, 411, 412, 413, 414, 415, 0, 416, 417, 0, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 0, 435, 0, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 0, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 507, 508, 509, 0, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 0, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 0, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 600, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 0, 245, 246, 247, 248, 249, 0, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 0, 0, 270, 271, 272, 273, 274, 0, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 0, 286, 287, 288, 0, 0, 0, 0, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 0, 0, 0, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 1125, 0, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 0, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 0, 0, 378, 0, 380, 381, 382, 383, 384, 0, 0, 385, 386, 0, 388, 0, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 0, 411, 412, 413, 414, 415, 0, 416, 417, 0, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 0, 435, 0, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 0, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 507, 508, 509, 0, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 0, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 0, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 600, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 0, 245, 246, 247, 248, 249, 0, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 0, 0, 270, 271, 272, 273, 274, 0, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 0, 286, 287, 288, 0, 0, 0, 0, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 0, 0, 0, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 1127, 0, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 0, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 0, 0, 378, 0, 380, 381, 382, 383, 384, 0, 0, 385, 386, 0, 388, 0, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 0, 411, 412, 413, 414, 415, 0, 416, 417, 0, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 0, 435, 0, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 0, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 507, 508, 509, 0, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 0, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 0, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 600, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 0, 245, 246, 247, 248, 249, 0, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 0, 0, 270, 271, 272, 273, 274, 0, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 0, 286, 287, 288, 0, 0, 0, 0, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 0, 0, 0, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 1137, 0, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 0, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 0, 0, 378, 0, 380, 381, 382, 383, 384, 0, 0, 385, 386, 0, 388, 0, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 0, 411, 412, 413, 414, 415, 0, 416, 417, 0, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 0, 435, 0, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 0, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 507, 508, 509, 0, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 0, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 0, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 600, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 0, 245, 246, 247, 248, 249, 0, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 0, 0, 270, 271, 272, 273, 274, 0, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 0, 286, 287, 288, 0, 0, 0, 0, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 0, 0, 0, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 1140, 0, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 0, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 0, 0, 378, 0, 380, 381, 382, 383, 384, 0, 0, 385, 386, 0, 388, 0, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 0, 411, 412, 413, 414, 415, 0, 416, 417, 0, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 0, 435, 0, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 0, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 507, 508, 509, 0, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 0, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 0, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 600, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 0, 245, 246, 247, 248, 249, 0, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 0, 0, 270, 271, 272, 273, 274, 0, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 0, 286, 287, 288, 0, 0, 0, 0, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 0, 0, 0, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 1143, 0, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 0, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 0, 0, 378, 0, 380, 381, 382, 383, 384, 0, 0, 385, 386, 0, 388, 0, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 0, 411, 412, 413, 414, 415, 0, 416, 417, 0, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 0, 435, 0, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 0, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 507, 508, 509, 0, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 0, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 0, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 600, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 0, 245, 246, 247, 248, 249, 0, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 793, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 0, 0, 270, 271, 272, 273, 274, 0, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 0, 286, 287, 288, 0, 0, 0, 0, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 0, 0, 0, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 352, 0, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 0, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 0, 0, 378, 0, 380, 381, 382, 383, 384, 0, 0, 385, 386, 0, 388, 0, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 796, 409, 0, 411, 412, 413, 414, 415, 0, 416, 417, 0, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 0, 435, 0, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 0, 797, 486, 487, 488, 489, 490, 491, 492, 493, 798, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 1331, 0, 505, 506, 507, 508, 509, 0, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 0, 534, 535, 536, 537, 538, 0, 539, 800, 541, 0, 0, 801, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 0, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 802, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 600, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 0, 245, 246, 247, 248, 249, 0, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 0, 0, 270, 271, 272, 273, 274, 0, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 0, 286, 287, 288, 0, 0, 0, 0, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 0, 0, 0, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 1765, 0, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 0, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 0, 0, 378, 0, 380, 381, 382, 383, 384, 0, 0, 385, 386, 0, 388, 0, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 0, 411, 412, 413, 414, 415, 0, 416, 417, 0, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 0, 435, 0, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 0, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 507, 508, 509, 0, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 0, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 0, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 600, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 0, 245, 246, 247, 248, 249, 0, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 0, 0, 270, 271, 272, 273, 274, 0, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 0, 286, 287, 288, 0, 0, 0, 0, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 0, 0, 0, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 1803, 0, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 0, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 0, 0, 378, 0, 380, 381, 382, 383, 384, 0, 0, 385, 386, 0, 388, 0, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 0, 411, 412, 413, 414, 415, 0, 416, 417, 0, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 0, 435, 0, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 0, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 507, 508, 509, 0, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 0, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 0, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 600, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 0, 245, 246, 247, 248, 249, 0, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 0, 0, 270, 271, 272, 273, 274, 0, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 0, 286, 287, 288, 0, 0, 0, 0, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 0, 0, 0, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 1805, 0, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 0, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 0, 0, 378, 0, 380, 381, 382, 383, 384, 0, 0, 385, 386, 0, 388, 0, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 0, 411, 412, 413, 414, 415, 0, 416, 417, 0, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 0, 435, 0, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 0, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 507, 508, 509, 0, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 0, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 0, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 600, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 0, 245, 246, 247, 248, 249, 0, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 0, 0, 270, 271, 272, 273, 274, 0, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 0, 286, 287, 288, 0, 0, 0, 0, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 0, 0, 0, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 1875, 0, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 0, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 0, 0, 378, 0, 380, 381, 382, 383, 384, 0, 0, 385, 386, 0, 388, 0, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 0, 411, 412, 413, 414, 415, 0, 416, 417, 0, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 0, 435, 0, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 0, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 507, 508, 509, 0, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 0, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 0, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 600, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 0, 245, 246, 247, 248, 249, 0, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 0, 0, 270, 271, 272, 273, 274, 0, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 0, 286, 287, 288, 0, 0, 0, 0, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 0, 0, 0, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 1877, 0, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 0, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 0, 0, 378, 0, 380, 381, 382, 383, 384, 0, 0, 385, 386, 0, 388, 0, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 0, 411, 412, 413, 414, 415, 0, 416, 417, 0, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 0, 435, 0, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 0, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 507, 508, 509, 0, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 0, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 0, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 600, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 0, 245, 246, 247, 248, 249, 0, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 0, 0, 270, 271, 272, 273, 274, 0, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 0, 286, 287, 288, 0, 0, 0, 0, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 0, 0, 0, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 1879, 0, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 0, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 0, 0, 378, 0, 380, 381, 382, 383, 384, 0, 0, 385, 386, 0, 388, 0, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 0, 411, 412, 413, 414, 415, 0, 416, 417, 0, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 0, 435, 0, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 0, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 507, 508, 509, 0, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 0, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 0, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 600, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 0, 245, 246, 247, 248, 249, 0, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 0, 0, 270, 271, 272, 273, 274, 0, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 0, 286, 287, 288, 0, 0, 0, 0, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 0, 0, 0, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 352, 0, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 0, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 0, 0, 378, 0, 380, 381, 382, 383, 384, 0, 0, 385, 386, 0, 388, 0, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 0, 411, 412, 413, 414, 415, 0, 416, 417, 0, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 0, 435, 0, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 0, 485, 486, 487, 488, 489, 490, 491, 492, 1984, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 507, 508, 509, 0, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 0, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 0, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 600, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 2163, 0, 239, 240, 0, 241, 242, 243, 0, 245, 246, 247, 248, 249, 0, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 0, 0, 270, 271, 272, 273, 274, 0, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 0, 286, 287, 288, 0, 0, 0, 0, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 0, 0, 0, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 352, 0, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 0, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 0, 0, 378, 0, 380, 381, 382, 383, 384, 0, 0, 385, 386, 0, 388, 0, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 0, 411, 412, 413, 414, 415, 0, 416, 417, 0, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 0, 435, 0, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 0, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 0, 506, 507, 508, 509, 0, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 0, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 0, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 600, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 0, 245, 246, 247, 248, 249, 0, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 793, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 0, 0, 270, 271, 272, 273, 274, 0, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 0, 286, 287, 288, 0, 0, 0, 0, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 0, 0, 0, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 352, 0, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 0, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 0, 0, 378, 0, 380, 381, 382, 383, 384, 0, 0, 385, 386, 0, 388, 0, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 796, 409, 0, 411, 412, 413, 414, 415, 0, 416, 417, 0, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 0, 435, 0, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 0, 797, 486, 487, 488, 489, 490, 491, 492, 493, 798, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 1331, 0, 505, 506, 507, 508, 509, 0, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 0, 2197, 535, 536, 537, 538, 0, 539, 800, 541, 0, 0, 801, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 0, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 802, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 600, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 0, 245, 246, 247, 248, 249, 0, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 793, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 0, 0, 270, 271, 272, 273, 274, 0, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 0, 286, 287, 288, 0, 0, 0, 0, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 0, 0, 0, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 352, 0, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 0, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 0, 0, 378, 0, 380, 381, 382, 383, 384, 0, 0, 385, 386, 0, 388, 0, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 796, 409, 0, 411, 412, 413, 414, 415, 0, 416, 417, 0, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 0, 435, 0, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 0, 797, 486, 487, 488, 489, 490, 491, 492, 493, 2274, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 2275, 0, 505, 506, 507, 508, 509, 0, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 0, 534, 535, 536, 537, 538, 0, 539, 800, 541, 0, 0, 2276, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 0, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 802, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 600, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 0, 245, 246, 247, 248, 249, 0, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 793, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 0, 0, 270, 271, 272, 273, 274, 0, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 0, 286, 287, 288, 0, 0, 0, 0, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 0, 0, 0, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 352, 0, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 0, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 0, 0, 378, 0, 380, 381, 382, 383, 384, 0, 0, 385, 386, 0, 388, 0, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 796, 409, 0, 411, 412, 413, 414, 415, 0, 416, 417, 0, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 0, 435, 0, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 0, 797, 486, 487, 488, 489, 490, 491, 492, 493, 2353, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 2275, 0, 505, 506, 507, 508, 509, 0, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 0, 534, 535, 536, 537, 538, 0, 539, 800, 541, 0, 0, 2276, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 0, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 802, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 600, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 0, 245, 246, 247, 248, 249, 0, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 793, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 0, 0, 270, 271, 272, 273, 274, 0, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 0, 286, 287, 288, 0, 0, 0, 0, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 0, 0, 0, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 352, 0, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 0, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 0, 0, 378, 0, 380, 381, 382, 383, 384, 0, 0, 385, 386, 0, 388, 0, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 796, 409, 0, 411, 412, 413, 414, 415, 0, 416, 417, 0, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 0, 435, 0, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 0, 797, 486, 487, 488, 489, 490, 491, 492, 493, 2370, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 2275, 0, 505, 506, 507, 508, 509, 0, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 0, 534, 535, 536, 537, 538, 0, 539, 800, 541, 0, 0, 2276, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 0, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 802, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 600, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 0, 245, 246, 247, 248, 249, 0, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 0, 0, 270, 271, 272, 273, 274, 0, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 0, 286, 287, 288, 0, 0, 0, 0, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 0, 0, 0, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 2569, 0, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 0, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 0, 0, 378, 0, 380, 381, 382, 383, 384, 0, 0, 385, 386, 0, 388, 0, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 0, 411, 412, 413, 414, 415, 0, 416, 417, 0, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 0, 435, 0, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 0, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 507, 508, 509, 0, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 0, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 0, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 600, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 0, 245, 246, 247, 248, 249, 0, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 0, 0, 270, 271, 272, 273, 274, 0, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 0, 286, 287, 288, 0, 0, 0, 0, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 0, 0, 0, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 2573, 0, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 0, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 0, 0, 378, 0, 380, 381, 382, 383, 384, 0, 0, 385, 386, 0, 388, 0, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 0, 411, 412, 413, 414, 415, 0, 416, 417, 0, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 0, 435, 0, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 0, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 507, 508, 509, 0, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 0, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 0, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 600, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 0, 245, 246, 247, 248, 249, 0, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 0, 0, 270, 271, 272, 273, 274, 0, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 0, 286, 287, 288, 0, 0, 0, 0, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 0, 0, 0, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 2648, 0, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 0, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 0, 0, 378, 0, 380, 381, 382, 383, 384, 0, 0, 385, 386, 0, 388, 0, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 0, 411, 412, 413, 414, 415, 0, 416, 417, 0, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 0, 435, 0, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 0, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 507, 508, 509, 0, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 0, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 0, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 600, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 0, 245, 246, 247, 248, 249, 0, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 0, 0, 270, 271, 272, 273, 274, 0, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 0, 286, 287, 288, 0, 0, 0, 0, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 0, 0, 0, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 2967, 0, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 0, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 0, 0, 378, 0, 380, 381, 382, 383, 384, 0, 0, 385, 386, 0, 388, 0, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 0, 411, 412, 413, 414, 415, 0, 416, 417, 0, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 0, 435, 0, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 0, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 507, 508, 509, 0, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 0, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 0, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 600, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 0, 245, 246, 247, 248, 249, 0, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 793, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 0, 0, 270, 271, 272, 273, 274, 0, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 0, 286, 287, 288, 0, 0, 0, 0, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 0, 0, 0, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 352, 0, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 0, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 0, 0, 378, 0, 380, 381, 382, 383, 384, 0, 0, 385, 386, 0, 388, 0, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 796, 409, 0, 411, 412, 413, 414, 415, 0, 416, 417, 0, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 0, 435, 0, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 0, 797, 486, 487, 488, 489, 490, 491, 492, 493, 798, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 2275, 0, 505, 506, 507, 508, 509, 0, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 0, 534, 535, 536, 537, 538, 0, 539, 800, 541, 0, 0, 2276, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 0, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 802, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 600, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 0, 245, 246, 247, 248, 249, 0, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 0, 0, 270, 271, 272, 273, 274, 0, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 0, 286, 287, 288, 0, 0, 0, 0, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 0, 0, 0, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 3036, 0, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 0, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 0, 0, 378, 0, 380, 381, 382, 383, 384, 0, 0, 385, 386, 0, 388, 0, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 0, 411, 412, 413, 414, 415, 0, 416, 417, 0, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 0, 435, 0, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 0, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 507, 508, 509, 0, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 0, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 0, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 600, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 0, 245, 246, 247, 248, 249, 0, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 0, 0, 270, 271, 272, 273, 274, 0, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 0, 286, 287, 288, 0, 0, 0, 0, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 0, 0, 0, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 3051, 0, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 0, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 0, 0, 378, 0, 380, 381, 382, 383, 384, 0, 0, 385, 386, 0, 388, 0, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 0, 411, 412, 413, 414, 415, 0, 416, 417, 0, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 0, 435, 0, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 0, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 507, 508, 509, 0, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 0, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 0, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 600, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 0, 245, 246, 247, 248, 249, 0, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 0, 0, 270, 271, 272, 273, 274, 0, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 0, 286, 287, 288, 0, 0, 0, 0, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 0, 0, 0, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 3053, 0, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 0, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 0, 0, 378, 0, 380, 381, 382, 383, 384, 0, 0, 385, 386, 0, 388, 0, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 0, 411, 412, 413, 414, 415, 0, 416, 417, 0, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 0, 435, 0, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 0, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 507, 508, 509, 0, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 0, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 0, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 600, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 0, 245, 246, 247, 248, 249, 0, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 0, 0, 270, 271, 272, 273, 274, 0, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 0, 286, 287, 288, 0, 0, 0, 0, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 0, 0, 0, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 3195, 0, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 0, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 0, 0, 378, 0, 380, 381, 382, 383, 384, 0, 0, 385, 386, 0, 388, 0, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 0, 411, 412, 413, 414, 415, 0, 416, 417, 0, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 0, 435, 0, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 0, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 507, 508, 509, 0, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 0, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 0, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 600, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 0, 245, 246, 247, 248, 249, 0, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 0, 0, 270, 271, 272, 273, 274, 0, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 0, 286, 287, 288, 0, 0, 0, 0, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 3231, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 0, 0, 0, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 352, 0, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 0, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 0, 0, 378, 0, 380, 381, 382, 383, 384, 0, 0, 385, 386, 0, 388, 0, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 0, 411, 412, 413, 414, 415, 0, 416, 417, 0, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 0, 435, 0, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 0, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 507, 508, 509, 0, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 0, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 0, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 600, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 0, 245, 246, 247, 248, 249, 0, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 0, 0, 270, 271, 272, 273, 274, 0, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 0, 286, 287, 288, 0, 0, 0, 0, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 0, 0, 0, 339, 340, 341, 342, 0, 343, 344, 0, 345, 346, 347, 0, 348, 349, 350, 351, 4385, 0, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 0, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 0, 0, 378, 0, 380, 381, 382, 383, 384, 0, 0, 385, 386, 0, 388, 0, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 0, 411, 412, 413, 414, 415, 0, 416, 417, 0, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 0, 435, 0, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 0, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 507, 508, 509, 0, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 0, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 0, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 1063, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 244, 245, 246, 247, 0, 1064, 250, 1065, 1066, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 1067, 1068, 263, 0, 264, 265, 266, 267, 0, 0, 269, 0, 270, 271, 272, 273, 274, 275, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 285, 286, 287, 288, 0, 0, 0, 289, 0, 0, 0, 290, 291, 292, 293, 294, 295, 1069, 1070, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 1071, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 0, 326, 327, 328, 0, 0, 330, 0, 331, 332, 1072, 334, 0, 335, 0, 336, 337, 0, 338, 339, 340, 341, 342, 0, 343, 0, 0, 0, 346, 347, 0, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 2170, 358, 359, 360, 361, 362, 363, 364, 0, 365, 366, 2171, 368, 369, 370, 371, 1074, 1075, 0, 1076, 0, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 0, 0, 385, 0, 387, 388, 389, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 1077, 410, 1078, 412, 413, 414, 0, 0, 416, 417, 418, 419, 0, 0, 421, 1079, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 2173, 434, 435, 436, 0, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 0, 450, 0, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 1080, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 484, 485, 486, 487, 488, 489, 0, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 2174, 508, 509, 510, 511, 512, 1082, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 0, 529, 0, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 0, 539, 1083, 1084, 0, 0, 542, 543, 0, 545, 0, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 0, 1085, 2175, 566, 567, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 600, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 590, 591, 592, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 0, 245, 246, 247, 248, 249, 0, 251, 252, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 261, 262, 263, 0, 264, 265, 266, 267, 268, 0, 0, 0, 270, 271, 272, 273, 274, 0, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 0, 286, 287, 288, 0, 0, 0, 0, 0, 0, 0, 290, 291, 292, 293, 294, 295, 296, 297, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 325, 326, 327, 328, 329, 0, 330, 0, 331, 332, 333, 334, 0, 335, 0, 336, 0, 0, 0, 339, 340, 341, 342, 0, 343, 344, 0, 345, 0, 347, 0, 348, 349, 350, 351, 352, 0, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 0, 367, 368, 369, 370, 371, 372, 373, 0, 374, 0, 375, 0, 0, 378, 0, 380, 381, 382, 383, 384, 0, 0, 385, 386, 0, 388, 0, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 0, 411, 412, 413, 414, 415, 0, 416, 417, 0, 419, 0, 420, 421, 422, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 433, 0, 435, 0, 437, 438, 439, 440, 441, 442, 443, 0, 445, 446, 0, 0, 447, 448, 449, 450, 451, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 0, 464, 465, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 0, 485, 486, 487, 488, 489, 490, 0, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 507, 508, 509, 0, 511, 512, 513, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 0, 530, 531, 0, 532, 0, 534, 535, 536, 537, 538, 0, 539, 540, 541, 0, 0, 542, 543, 544, 545, 546, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 564, 565, 0, 566, 0, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 1063, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 244, 245, 246, 247, 0, 1064, 250, 1065, 1066, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 1067, 1068, 263, 0, 264, 265, 266, 267, 0, 0, 269, 0, 270, 271, 272, 273, 274, 275, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 285, 286, 287, 288, 0, 0, 0, 289, 0, 0, 0, 290, 291, 292, 293, 294, 295, 1069, 1070, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 1071, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 0, 326, 327, 328, 0, 0, 330, 0, 331, 332, 1072, 334, 0, 335, 0, 336, 337, 0, 338, 339, 340, 341, 342, 0, 343, 0, 0, 0, 346, 347, 0, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 366, 0, 368, 369, 370, 371, 1074, 1075, 0, 1076, 0, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 0, 0, 385, 0, 387, 388, 389, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 1077, 410, 1078, 412, 413, 414, 0, 0, 416, 417, 418, 419, 2270, 0, 421, 1079, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 0, 434, 435, 436, 0, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 0, 450, 0, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 1080, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 484, 485, 486, 487, 488, 489, 0, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 2174, 508, 509, 510, 511, 512, 1082, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 0, 529, 0, 530, 531, 3940, 532, 533, 534, 535, 536, 537, 538, 0, 539, 1083, 1084, 0, 0, 542, 543, 0, 545, 0, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 0, 1085, 0, 566, 567, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 1063, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 590, 591, 592, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 244, 245, 246, 247, 0, 1064, 250, 1065, 1066, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 1067, 1068, 263, 0, 264, 265, 266, 267, 0, 0, 269, 0, 270, 271, 272, 273, 274, 275, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 285, 286, 287, 288, 0, 0, 0, 289, 0, 0, 0, 290, 291, 292, 293, 294, 295, 1069, 1070, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 1071, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 0, 326, 327, 328, 0, 0, 330, 0, 331, 332, 1072, 334, 0, 335, 0, 336, 337, 0, 338, 339, 340, 341, 342, 0, 343, 0, 0, 0, 346, 347, 0, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 366, 0, 368, 369, 370, 371, 1074, 1075, 0, 1076, 0, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 0, 0, 385, 0, 387, 388, 389, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 1077, 410, 1078, 412, 413, 414, 2342, 0, 416, 417, 418, 419, 0, 0, 421, 1079, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 0, 434, 435, 436, 0, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 0, 450, 0, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 1080, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 484, 485, 486, 487, 488, 489, 0, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 1081, 508, 509, 510, 511, 512, 1082, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 0, 529, 0, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 0, 539, 1083, 1084, 0, 0, 542, 543, 0, 545, 0, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 0, 1085, 0, 566, 567, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 1063, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 590, 591, 592, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 244, 245, 246, 247, 0, 1064, 250, 1065, 1066, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 1067, 1068, 263, 0, 264, 265, 266, 267, 0, 0, 269, 0, 270, 271, 272, 273, 274, 275, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 285, 286, 287, 288, 0, 0, 0, 289, 0, 0, 0, 290, 291, 292, 293, 294, 295, 1069, 1070, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 1071, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 0, 326, 327, 328, 0, 0, 330, 0, 331, 332, 1072, 334, 0, 335, 0, 336, 337, 0, 338, 339, 340, 341, 342, 0, 343, 0, 0, 0, 346, 347, 0, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 366, 0, 368, 369, 370, 371, 1074, 1075, 0, 1076, 0, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 0, 0, 385, 0, 387, 388, 389, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 1077, 410, 1078, 412, 413, 414, 3748, 0, 416, 417, 418, 419, 0, 0, 421, 1079, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 0, 434, 435, 436, 0, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 0, 450, 0, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 1080, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 484, 485, 486, 487, 488, 489, 0, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 1081, 508, 509, 510, 511, 512, 1082, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 0, 529, 0, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 0, 539, 1083, 1084, 0, 0, 542, 543, 0, 545, 0, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 0, 1085, 0, 566, 567, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 1063, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 590, 591, 592, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 244, 245, 246, 247, 0, 1064, 250, 1065, 1066, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 1067, 1068, 263, 0, 264, 265, 266, 267, 0, 0, 269, 0, 270, 271, 272, 273, 274, 275, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 285, 286, 287, 288, 0, 0, 0, 289, 0, 0, 0, 290, 291, 292, 293, 294, 295, 1069, 1070, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 1071, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 0, 326, 327, 328, 0, 0, 330, 0, 331, 332, 1072, 334, 5304, 335, 0, 336, 337, 0, 338, 339, 340, 341, 342, 0, 343, 0, 0, 0, 346, 347, 0, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 366, 0, 368, 369, 370, 371, 1074, 1075, 0, 1076, 0, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 0, 0, 385, 0, 387, 388, 389, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 1077, 410, 1078, 412, 413, 414, 0, 0, 416, 417, 418, 419, 0, 0, 421, 1079, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 0, 434, 435, 436, 0, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 0, 450, 0, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 1080, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 484, 485, 486, 487, 488, 489, 0, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 1081, 508, 509, 510, 511, 512, 1082, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 0, 529, 0, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 0, 539, 1083, 1084, 0, 0, 542, 543, 0, 545, 0, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 0, 1085, 0, 566, 567, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 1063, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 590, 591, 592, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 244, 245, 246, 247, 0, 1064, 250, 1065, 1066, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 1067, 1068, 263, 0, 264, 265, 266, 267, 0, 0, 269, 0, 270, 271, 272, 273, 274, 275, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 285, 286, 287, 288, 0, 0, 0, 289, 0, 0, 0, 290, 291, 292, 293, 294, 295, 1069, 1070, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 1071, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 0, 326, 327, 328, 0, 0, 330, 0, 331, 332, 1072, 334, 0, 335, 0, 336, 337, 0, 338, 339, 340, 341, 342, 0, 343, 0, 0, 0, 346, 347, 0, 348, 349, 350, 351, 1073, 353, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 366, 0, 368, 369, 370, 371, 1074, 1075, 0, 1076, 0, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 0, 0, 385, 0, 387, 388, 389, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 1077, 410, 1078, 412, 413, 414, 0, 0, 416, 417, 418, 419, 0, 0, 421, 1079, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 0, 434, 435, 436, 0, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 0, 450, 0, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 1080, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 484, 485, 486, 487, 488, 489, 0, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 1081, 508, 509, 510, 511, 512, 1082, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 0, 529, 0, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 0, 539, 1083, 1084, 0, 0, 542, 543, 0, 545, 0, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 0, 1085, 0, 566, 567, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 1063, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 590, 591, 592, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 244, 245, 246, 247, 0, 1064, 250, 1065, 1066, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 1067, 1068, 263, 0, 264, 265, 266, 267, 0, 0, 269, 0, 270, 271, 272, 273, 274, 275, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 285, 286, 287, 288, 0, 0, 0, 289, 0, 0, 0, 290, 291, 292, 293, 294, 295, 1069, 1070, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 1071, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 0, 326, 327, 328, 0, 0, 330, 0, 331, 332, 1072, 334, 0, 335, 0, 336, 337, 0, 338, 339, 340, 341, 342, 0, 343, 0, 0, 0, 346, 347, 0, 348, 349, 350, 351, 1131, 353, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 366, 0, 368, 369, 370, 371, 1074, 1075, 0, 1076, 0, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 0, 0, 385, 0, 387, 388, 389, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 1077, 410, 1078, 412, 413, 414, 0, 0, 416, 417, 418, 419, 0, 0, 421, 1079, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 0, 434, 435, 436, 0, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 0, 450, 0, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 1080, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 484, 485, 486, 487, 488, 489, 0, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 1081, 508, 509, 510, 511, 512, 1082, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 0, 529, 0, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 0, 539, 1083, 1084, 0, 0, 542, 543, 0, 545, 0, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 0, 1085, 0, 566, 567, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 1063, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 590, 591, 592, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 244, 245, 246, 247, 0, 1064, 250, 1065, 1066, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 1067, 1068, 263, 0, 264, 265, 266, 267, 0, 0, 269, 0, 270, 271, 272, 273, 274, 275, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 285, 286, 287, 288, 0, 0, 0, 289, 0, 0, 0, 290, 291, 292, 293, 294, 295, 1069, 1070, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 1071, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 0, 326, 327, 328, 0, 0, 330, 0, 331, 332, 1072, 334, 0, 335, 0, 336, 337, 0, 338, 339, 340, 341, 342, 0, 343, 0, 0, 0, 346, 347, 0, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 366, 0, 368, 369, 370, 371, 1074, 1075, 0, 1076, 0, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 0, 0, 385, 0, 387, 388, 389, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 1077, 410, 1078, 412, 413, 414, 0, 0, 416, 417, 418, 419, 0, 0, 421, 1079, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 0, 434, 435, 436, 0, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 0, 450, 0, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 1080, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 484, 485, 486, 487, 488, 489, 0, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 1081, 508, 509, 510, 511, 512, 1082, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 0, 529, 0, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 0, 539, 1083, 1084, 0, 0, 542, 543, 0, 545, 0, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 0, 1085, 0, 566, 567, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 1063, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 590, 591, 592, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 244, 245, 246, 247, 0, 1064, 250, 1065, 1066, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 1067, 1068, 263, 0, 264, 265, 266, 267, 0, 0, 269, 0, 270, 271, 272, 273, 274, 275, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 285, 286, 287, 288, 0, 0, 0, 289, 0, 0, 0, 290, 291, 292, 293, 294, 295, 1069, 1070, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 1071, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 0, 326, 327, 328, 0, 0, 330, 0, 331, 332, 1072, 334, 0, 335, 0, 336, 337, 0, 338, 339, 340, 341, 342, 0, 343, 0, 0, 0, 346, 347, 0, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 366, 0, 368, 369, 370, 371, 1074, 1075, 0, 1076, 0, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 0, 0, 385, 0, 387, 388, 389, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 1077, 410, 1078, 412, 413, 414, 0, 0, 416, 417, 418, 419, 0, 0, 421, 1079, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 0, 434, 435, 436, 0, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 0, 450, 0, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 1080, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 484, 485, 486, 487, 488, 489, 0, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 2174, 508, 509, 510, 511, 512, 1082, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 0, 529, 0, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 0, 539, 1083, 1084, 0, 0, 542, 543, 0, 545, 0, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 0, 1085, 0, 566, 567, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 1063, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 590, 591, 592, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 244, 245, 246, 247, 0, 1064, 250, 1065, 1066, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 1067, 1068, 263, 0, 264, 265, 266, 267, 0, 0, 269, 0, 270, 271, 272, 273, 274, 275, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 285, 286, 287, 288, 0, 0, 0, 289, 0, 0, 0, 290, 291, 292, 293, 294, 295, 1069, 1070, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 1071, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 0, 326, 327, 328, 0, 0, 330, 0, 331, 332, 1072, 334, 0, 335, 0, 336, 337, 0, 338, 339, 340, 341, 342, 0, 343, 0, 0, 0, 346, 347, 0, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 366, 0, 368, 369, 370, 371, 1074, 1075, 0, 1076, 0, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 0, 0, 385, 0, 387, 388, 389, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 1077, 410, 1078, 412, 413, 414, 0, 0, 416, 417, 418, 419, 0, 0, 421, 1079, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 0, 434, 435, 436, 0, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 0, 450, 0, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 1080, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 484, 485, 486, 487, 488, 489, 0, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 0, 508, 509, 510, 511, 512, 1082, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 0, 529, 0, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 0, 539, 1083, 1084, 0, 0, 542, 543, 0, 545, 0, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 0, 1085, 0, 566, 567, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 1063, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 590, 591, 592, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 244, 245, 246, 247, 0, 0, 250, 0, 0, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 0, 0, 263, 0, 264, 265, 266, 267, 0, 0, 269, 0, 270, 271, 272, 273, 274, 275, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 285, 286, 287, 288, 0, 0, 0, 289, 0, 0, 0, 290, 291, 292, 293, 294, 295, 0, 0, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 0, 326, 327, 328, 0, 0, 330, 0, 331, 332, 0, 334, 0, 335, 0, 336, 337, 0, 338, 339, 340, 341, 342, 0, 343, 0, 0, 0, 346, 347, 0, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 366, 0, 368, 369, 370, 371, 0, 0, 0, 0, 0, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 0, 0, 385, 0, 387, 388, 389, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 0, 410, 0, 412, 413, 414, 0, 0, 416, 417, 418, 419, 0, 0, 421, 0, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 0, 434, 435, 436, 0, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 0, 450, 0, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 0, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 484, 485, 486, 487, 488, 489, 0, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 0, 508, 509, 510, 511, 512, 0, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 0, 529, 0, 530, 531, 0, 532, 533, 534, 535, 536, 537, 538, 0, 539, 0, 0, 0, 0, 542, 543, 0, 545, 0, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 0, 0, 0, 566, 567, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 4962, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 590, 591, 592, 0, 228, 229, 230, 231, 232, 233, 234, 235, 0, 236, 237, 238, 0, 0, 0, 0, 0, 0, 0, 239, 240, 0, 241, 242, 243, 0, 245, 246, 247, 0, 0, 0, 0, 0, 0, 253, 254, 255, 256, 257, 258, 0, 0, 259, 260, 0, 0, 263, 0, 264, 265, 266, 267, 0, 0, 0, 0, 270, 271, 272, 273, 274, 0, 276, 277, 278, 0, 279, 280, 281, 282, 283, 284, 0, 0, 286, 287, 288, 0, 0, 0, 0, 0, 0, 0, 290, 291, 292, 293, 294, 295, 0, 0, 298, 0, 299, 0, 300, 301, 302, 303, 304, 305, 0, 306, 307, 308, 309, 0, 0, 310, 311, 312, 313, 314, 0, 315, 316, 317, 0, 318, 319, 320, 0, 321, 322, 323, 324, 0, 326, 327, 328, 0, 0, 330, 0, 331, 332, 0, 334, 0, 335, 0, 336, 0, 0, 0, 339, 340, 341, 342, 0, 343, 0, 0, 0, 346, 347, 0, 348, 349, 350, 351, 352, 0, 354, 355, 356, 357, 0, 358, 359, 360, 361, 362, 363, 364, 0, 365, 0, 0, 368, 369, 370, 371, 0, 0, 0, 0, 0, 375, 0, 0, 378, 0, 380, 381, 382, 383, 384, 0, 0, 385, 0, 0, 388, 0, 0, 390, 391, 392, 0, 0, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 0, 0, 0, 412, 413, 414, 0, 0, 416, 417, 0, 419, 0, 0, 421, 0, 423, 424, 425, 0, 426, 427, 0, 0, 428, 429, 430, 0, 0, 431, 432, 0, 0, 435, 0, 0, 438, 439, 440, 441, 442, 443, 444, 445, 446, 0, 0, 447, 448, 0, 450, 0, 452, 453, 454, 0, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 0, 466, 467, 468, 469, 0, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 0, 482, 483, 0, 485, 486, 487, 488, 489, 0, 491, 492, 493, 494, 495, 496, 497, 498, 499, 0, 500, 501, 502, 503, 504, 0, 505, 506, 0, 508, 509, 0, 511, 512, 0, 514, 0, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 0, 529, 0, 530, 531, 0, 532, 0, 534, 535, 536, 537, 538, 0, 539, 0, 0, 0, 0, 542, 543, 0, 545, 0, 0, 547, 548, 549, 550, 551, 552, 553, 0, 0, 554, 555, 556, 557, 558, 0, 0, 559, 560, 561, 562, 563, 0, 0, 0, 566, 0, 568, 569, 570, 571, 0, 0, 572, 0, 0, 573, 574, 575, 576, 577, 578, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 590, 591, 592 }; static const yytype_int16 yycheck[] = { 6, 204, 0, 612, 612, 0, 913, 204, 628, 182, 52, 1154, 0, 37, 741, 742, 743, 23, 1111, 25, 747, 22, 843, 29, 794, 944, 21, 28, 1562, 35, 36, 37, 940, 39, 929, 792, 42, 43, 1436, 45, 1081, 47, 914, 13, 854, 1481, 671, 938, 816, 2868, 190, 1026, 6, 2709, 2509, 1215, 45, 1474, 2581, 46, 801, 817, 209, 1720, 1084, 1069, 1070, 1487, 2403, 0, 1971, 880, 697, 1178, 2918, 1079, 223, 2522, 684, 3335, 2078, 3352, 770, 1481, 3355, 3013, 23, 3324, 1498, 3610, 21, 3270, 698, 2424, 2178, 2179, 619, 942, 866, 1990, 37, 18, 3640, 2341, 661, 1000, 2685, 3040, 0, 1004, 707, 1799, 3259, 697, 1009, 1624, 3640, 3067, 3636, 3069, 3555, 4178, 2800, 3873, 1019, 3692, 0, 184, 3929, 21, 3584, 823, 3917, 3590, 1015, 3912, 3411, 3728, 1033, 3305, 169, 4581, 2892, 4415, 4539, 661, 0, 670, 2034, 51, 1031, 1413, 0, 2143, 1811, 0, 0, 1067, 1068, 199, 52, 1465, 0, 4423, 0, 1585, 3916, 207, 1078, 682, 210, 702, 685, 36, 184, 4686, 8, 0, 0, 947, 43, 1591, 1592, 15, 190, 191, 192, 193, 0, 195, 0, 2111, 708, 199, 2145, 201, 42, 4366, 204, 0, 5, 207, 2122, 3322, 210, 0, 0, 213, 0, 215, 4601, 4762, 218, 1901, 840, 5, 222, 1360, 224, 0, 2927, 1525, 3518, 0, 864, 840, 4727, 9, 913, 218, 3589, 4555, 3591, 4557, 5, 3981, 921, 0, 1542, 5, 797, 1245, 1246, 4065, 57, 4414, 931, 5, 1622, 1623, 4641, 35, 5, 49, 29, 1275, 4965, 42, 5, 4648, 4649, 1265, 87, 5, 904, 5, 993, 5, 57, 909, 5, 13, 14, 138, 2512, 13, 14, 0, 13, 14, 163, 797, 26, 5, 4939, 163, 9, 5, 1428, 2468, 1100, 2470, 184, 42, 114, 2474, 5, 2476, 2477, 79, 5, 5, 0, 26, 5, 821, 2485, 2486, 2487, 57, 170, 9, 32, 164, 114, 6, 163, 11, 834, 74, 57, 4842, 4843, 163, 1234, 1235, 175, 29, 26, 84, 4, 956, 158, 57, 11, 9, 3, 4, 5, 3930, 9, 269, 9, 119, 112, 1154, 112, 187, 269, 252, 1158, 1261, 1040, 264, 5, 4, 981, 107, 120, 289, 9, 4013, 4014, 40, 4016, 4017, 4018, 4019, 4020, 163, 144, 996, 144, 57, 57, 70, 255, 304, 289, 264, 62, 757, 163, 340, 112, 2623, 163, 2625, 270, 289, 357, 211, 165, 187, 57, 72, 164, 163, 114, 38, 163, 112, 1377, 252, 289, 39, 187, 358, 11, 39, 187, 32, 153, 22, 386, 57, 57, 74, 340, 28, 398, 26, 141, 11, 187, 57, 335, 84, 33, 179, 285, 628, 5141, 11, 254, 324, 1355, 40, 442, 254, 163, 86, 159, 26, 259, 112, 311, 437, 163, 908, 33, 26, 1343, 72, 1146, 440, 4728, 163, 33, 463, 431, 466, 40, 440, 187, 163, 4967, 926, 4859, 72, 929, 269, 187, 477, 479, 22, 193, 5132, 463, 626, 26, 74, 679, 128, 225, 632, 463, 255, 4812, 187, 240, 481, 312, 243, 72, 310, 481, 419, 645, 190, 74, 117, 357, 481, 329, 477, 225, 1548, 199, 398, 74, 420, 1118, 1201, 481, 398, 207, 330, 84, 210, 477, 163, 131, 74, 145, 266, 477, 1295, 252, 724, 725, 726, 1341, 306, 729, 730, 731, 1346, 1347, 206, 419, 330, 918, 259, 739, 163, 185, 477, 259, 477, 477, 1360, 327, 163, 475, 1323, 459, 1476, 479, 1156, 117, 228, 324, 445, 5273, 340, 477, 342, 1413, 163, 252, 117, 267, 1198, 26, 133, 425, 477, 1184, 1136, 180, 3728, 330, 466, 131, 201, 360, 11, 360, 1397, 163, 4680, 477, 330, 1200, 187, 479, 145, 348, 5039, 440, 607, 1294, 481, 11, 3752, 330, 613, 259, 615, 1216, 617, 477, 619, 612, 621, 40, 612, 1758, 5130, 1136, 481, 628, 423, 612, 327, 477, 633, 403, 635, 477, 411, 398, 357, 374, 375, 642, 442, 1154, 5140, 5349, 426, 386, 398, 1453, 421, 330, 330, 72, 398, 1531, 477, 4087, 421, 1463, 201, 481, 4114, 463, 430, 666, 481, 1557, 1220, 670, 1560, 708, 330, 481, 675, 843, 4125, 477, 679, 5195, 4129, 682, 426, 398, 685, 4502, 477, 5071, 712, 442, 4957, 480, 477, 3925, 330, 5345, 608, 481, 477, 476, 701, 1568, 1578, 330, 480, 466, 2075, 344, 480, 1220, 463, 477, 5416, 458, 1401, 3643, 4457, 707, 479, 1622, 1623, 1624, 480, 3884, 477, 612, 722, 2960, 724, 477, 726, 5277, 3906, 475, 1620, 477, 732, 479, 481, 4030, 477, 706, 3415, 466, 477, 1549, 398, 477, 1552, 1553, 468, 469, 753, 5457, 383, 756, 757, 758, 383, 4113, 477, 4115, 480, 4847, 477, 3926, 964, 367, 5264, 753, 771, 1451, 964, 477, 1395, 468, 469, 477, 477, 831, 481, 477, 708, 4835, 473, 1395, 1338, 480, 3930, 367, 791, 792, 22, 794, 795, 432, 440, 367, 799, 468, 469, 473, 481, 481, 468, 469, 468, 469, 419, 350, 398, 25, 813, 1629, 949, 357, 817, 1905, 5204, 463, 707, 708, 823, 481, 468, 469, 831, 1338, 3158, 398, 4477, 5217, 1512, 817, 835, 1346, 1347, 398, 1473, 398, 833, 1941, 1368, 833, 2259, 481, 847, 294, 4410, 1360, 833, 2930, 398, 2932, 481, 5351, 3296, 5176, 3972, 2290, 1948, 475, 863, 847, 477, 479, 22, 419, 1867, 5136, 106, 1959, 470, 471, 472, 473, 481, 419, 419, 863, 881, 105, 477, 436, 5139, 886, 887, 470, 471, 472, 473, 1526, 481, 436, 481, 1515, 20, 1387, 756, 757, 758, 131, 22, 175, 1519, 352, 3834, 833, 1543, 736, 3833, 105, 2897, 481, 207, 1755, 917, 918, 270, 5415, 5355, 5356, 2337, 163, 275, 960, 3628, 824, 1732, 105, 117, 966, 5, 2190, 969, 5321, 191, 1842, 1843, 940, 941, 105, 5448, 390, 831, 392, 833, 2011, 949, 5113, 81, 165, 2898, 2457, 795, 191, 5040, 112, 799, 960, 3, 5045, 5, 964, 833, 966, 2881, 49, 969, 1159, 252, 5135, 1162, 4718, 1164, 131, 1166, 27, 1168, 240, 666, 2280, 1172, 984, 833, 5, 105, 856, 172, 675, 833, 2872, 123, 833, 833, 5385, 682, 95, 5265, 685, 833, 107, 833, 3236, 3237, 1006, 34, 3752, 4672, 117, 163, 131, 1013, 1014, 201, 833, 833, 5, 4537, 5274, 144, 103, 66, 22, 5459, 3015, 833, 105, 833, 3952, 5289, 4617, 2561, 117, 1035, 1036, 1037, 833, 1039, 26, 1041, 1042, 1043, 833, 4577, 5, 833, 131, 81, 468, 469, 470, 471, 472, 473, 285, 3895, 24, 4577, 917, 918, 3235, 342, 4493, 107, 2203, 468, 469, 470, 471, 472, 473, 47, 179, 172, 1989, 385, 421, 45, 275, 160, 398, 264, 179, 112, 756, 1808, 348, 4540, 264, 123, 3, 306, 201, 324, 4544, 3329, 3, 142, 254, 4549, 164, 5357, 4552, 81, 1725, 5361, 289, 344, 105, 1111, 420, 1113, 1114, 289, 275, 160, 2031, 200, 3, 22, 22, 1742, 403, 309, 477, 28, 357, 342, 285, 481, 386, 131, 477, 240, 1047, 179, 243, 2174, 126, 1760, 22, 4922, 425, 240, 1146, 123, 28, 1835, 385, 386, 335, 202, 425, 252, 344, 287, 1158, 398, 5414, 354, 4412, 386, 2077, 481, 285, 1156, 2579, 324, 4435, 252, 83, 2075, 4405, 1158, 5434, 4921, 1178, 1179, 4959, 3259, 4977, 1183, 4955, 1185, 4455, 259, 401, 481, 344, 66, 1956, 1957, 407, 424, 8, 1816, 240, 11, 83, 243, 357, 2042, 5458, 324, 1206, 112, 182, 84, 1829, 386, 1212, 187, 4958, 1215, 299, 340, 1218, 5270, 5271, 4739, 1841, 386, 5478, 136, 288, 5481, 40, 91, 131, 131, 1232, 419, 1853, 47, 202, 360, 357, 4399, 259, 4904, 477, 348, 4762, 4172, 398, 917, 275, 111, 224, 131, 135, 348, 117, 287, 215, 252, 1294, 302, 72, 391, 1262, 1841, 949, 346, 2028, 142, 386, 4213, 1156, 3349, 259, 1873, 168, 960, 2178, 158, 1897, 1898, 3269, 966, 193, 145, 969, 160, 481, 1887, 386, 477, 1290, 1291, 1292, 477, 1294, 145, 477, 141, 395, 406, 1900, 363, 1988, 477, 1990, 84, 348, 3979, 234, 386, 1996, 287, 419, 1830, 1314, 157, 2002, 2003, 2004, 478, 1898, 4833, 481, 81, 1915, 316, 2012, 2013, 1519, 1380, 1381, 2017, 1383, 112, 228, 1161, 175, 1163, 201, 1165, 1363, 1167, 1228, 1169, 1170, 1171, 4775, 58, 231, 254, 1176, 2190, 1352, 458, 259, 66, 1041, 1042, 1043, 391, 4808, 205, 1248, 1870, 114, 123, 5417, 258, 1971, 1971, 182, 414, 477, 273, 158, 187, 1380, 1381, 1885, 1383, 291, 1888, 1382, 1908, 285, 169, 1386, 1387, 362, 357, 357, 91, 2156, 1279, 317, 2009, 115, 1397, 1398, 1399, 4961, 1401, 285, 187, 174, 285, 1916, 124, 1294, 2865, 153, 26, 224, 252, 1397, 391, 458, 134, 2037, 301, 3412, 112, 1947, 324, 3941, 1425, 1951, 302, 328, 329, 1955, 275, 4861, 1958, 273, 4008, 81, 4866, 4867, 466, 5, 114, 433, 1950, 324, 326, 1953, 1954, 475, 36, 477, 478, 479, 66, 481, 297, 357, 357, 320, 271, 1460, 211, 2918, 389, 183, 1465, 165, 165, 1468, 169, 63, 64, 106, 364, 2375, 254, 4617, 357, 123, 4729, 1480, 1481, 225, 2322, 301, 284, 4717, 350, 350, 180, 1490, 417, 5010, 1493, 1380, 1381, 390, 1383, 392, 112, 350, 412, 83, 426, 254, 2365, 389, 2346, 391, 420, 610, 126, 423, 481, 481, 166, 442, 228, 400, 1519, 275, 1521, 2011, 417, 386, 1525, 155, 5042, 5043, 287, 2019, 4704, 3861, 2620, 121, 175, 386, 1448, 211, 414, 115, 311, 1542, 124, 1544, 2420, 104, 1547, 116, 333, 362, 477, 66, 134, 167, 2457, 419, 191, 72, 112, 115, 443, 312, 254, 342, 427, 2405, 3896, 285, 413, 84, 341, 271, 271, 237, 155, 2379, 427, 440, 2439, 3905, 254, 1582, 400, 2387, 3470, 425, 2390, 217, 284, 440, 285, 347, 1593, 1594, 1595, 1596, 1597, 112, 1582, 114, 463, 2112, 116, 704, 2355, 2356, 324, 183, 2359, 2289, 1611, 252, 463, 3142, 477, 366, 114, 5150, 3030, 5138, 2240, 1622, 1623, 1624, 403, 443, 477, 183, 431, 324, 4614, 5150, 391, 442, 2254, 2451, 2452, 2453, 312, 208, 254, 287, 2518, 2133, 285, 259, 3820, 284, 461, 3728, 3824, 3825, 167, 3827, 463, 468, 469, 470, 471, 472, 473, 357, 357, 2503, 1533, 2541, 2542, 2543, 2544, 1538, 251, 166, 4656, 3752, 477, 2295, 376, 2553, 2196, 238, 195, 104, 241, 324, 1882, 786, 2287, 339, 302, 1881, 1882, 1826, 2203, 345, 208, 2375, 141, 195, 284, 421, 352, 213, 2578, 285, 318, 398, 2770, 2771, 153, 344, 3606, 2775, 3216, 158, 214, 4966, 3399, 11, 3222, 1720, 357, 1722, 340, 126, 342, 128, 0, 234, 2408, 283, 3963, 400, 3965, 1734, 1735, 387, 159, 1606, 320, 254, 252, 1610, 324, 4975, 259, 391, 4674, 3162, 2812, 2813, 385, 386, 29, 1754, 252, 477, 254, 409, 5277, 145, 205, 2441, 4936, 350, 324, 213, 2517, 112, 13, 14, 193, 357, 1773, 466, 443, 357, 53, 4938, 72, 4953, 225, 326, 477, 234, 425, 403, 479, 302, 1789, 1790, 1791, 1792, 312, 126, 141, 128, 350, 357, 5314, 386, 414, 1802, 1533, 318, 252, 325, 153, 1538, 1809, 26, 1811, 158, 307, 158, 164, 238, 478, 2009, 241, 481, 4471, 266, 1823, 292, 4998, 1826, 273, 5360, 4751, 1830, 275, 442, 386, 353, 1835, 5354, 1871, 344, 285, 1777, 427, 5360, 421, 2361, 339, 143, 8, 197, 360, 2571, 2537, 3930, 463, 15, 16, 17, 340, 352, 205, 328, 77, 264, 212, 1801, 312, 2965, 477, 324, 85, 1870, 1871, 2675, 222, 427, 2494, 1606, 440, 324, 225, 1610, 1881, 1882, 389, 5134, 1885, 5151, 440, 1888, 357, 440, 477, 189, 387, 344, 165, 440, 113, 400, 477, 414, 357, 5133, 386, 285, 1905, 1906, 2593, 419, 4853, 463, 417, 1912, 360, 1914, 340, 4365, 24, 481, 463, 266, 4571, 254, 4573, 477, 1925, 1915, 3331, 198, 275, 5462, 481, 264, 480, 4747, 285, 442, 481, 45, 389, 2938, 1941, 5115, 324, 5462, 4384, 187, 372, 1948, 328, 1950, 167, 2791, 1953, 1954, 4404, 1956, 1957, 2797, 1959, 285, 4193, 4194, 1981, 180, 350, 1966, 417, 168, 413, 320, 477, 419, 1973, 324, 32, 192, 440, 357, 1971, 1980, 1981, 1971, 1966, 1984, 334, 432, 285, 1988, 1971, 1990, 1916, 442, 3644, 4216, 1995, 1996, 285, 234, 324, 4222, 386, 2002, 2003, 2004, 285, 477, 357, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 5266, 2017, 481, 2019, 2020, 2703, 2704, 2023, 158, 4354, 324, 477, 228, 1915, 481, 475, 357, 2584, 478, 479, 324, 237, 2038, 2039, 2040, 2041, 427, 329, 324, 2045, 2046, 181, 2245, 1980, 2050, 292, 2867, 2053, 2245, 440, 2056, 2057, 2058, 2059, 2060, 2061, 2062, 2063, 2064, 285, 2066, 413, 4990, 357, 2873, 357, 2072, 2073, 2584, 2075, 1987, 357, 463, 237, 2699, 304, 2082, 324, 5257, 1971, 2772, 328, 2639, 4902, 4, 158, 477, 285, 403, 9, 254, 2716, 2784, 316, 5350, 1927, 2236, 1929, 324, 1931, 4944, 1933, 344, 1935, 271, 2111, 2731, 1939, 181, 168, 357, 3490, 2118, 5279, 5047, 153, 2122, 2123, 2928, 3581, 158, 316, 3584, 2639, 2816, 1526, 324, 2133, 351, 2870, 328, 357, 1823, 340, 341, 1826, 2142, 2143, 158, 2286, 3519, 2672, 1543, 328, 3016, 440, 4325, 389, 4327, 4328, 2156, 373, 4331, 153, 376, 2047, 351, 2163, 158, 357, 43, 181, 2854, 386, 5343, 3699, 30, 31, 463, 228, 3042, 22, 357, 263, 250, 417, 361, 28, 3640, 1870, 1871, 2205, 65, 2207, 390, 2116, 392, 225, 255, 256, 2196, 386, 268, 440, 1885, 30, 31, 1888, 114, 2205, 442, 2207, 2203, 2243, 74, 3310, 2246, 2247, 2828, 433, 433, 417, 74, 4576, 84, 3320, 463, 2364, 2224, 3907, 4583, 283, 84, 478, 347, 225, 481, 91, 266, 472, 2236, 5410, 2238, 2239, 477, 477, 479, 2243, 433, 2245, 2246, 2247, 158, 2249, 475, 2251, 4, 111, 479, 2255, 4585, 9, 2258, 126, 3690, 128, 3676, 316, 478, 1950, 472, 481, 1953, 1954, 84, 477, 266, 479, 5201, 2258, 478, 3928, 269, 481, 2280, 2770, 2771, 274, 151, 195, 2775, 145, 478, 350, 2290, 481, 215, 3697, 350, 3699, 3450, 2438, 2298, 2299, 5460, 340, 341, 464, 465, 466, 2306, 468, 469, 470, 471, 472, 473, 5, 3216, 2315, 476, 476, 3732, 11, 3222, 481, 481, 2812, 2813, 386, 4, 19, 477, 269, 386, 9, 239, 3302, 274, 2335, 477, 390, 3017, 392, 2340, 2341, 252, 475, 254, 477, 38, 479, 5161, 234, 340, 341, 2952, 2953, 168, 2355, 2356, 3371, 3372, 2359, 403, 2361, 2362, 2873, 417, 403, 427, 2986, 126, 326, 128, 427, 2355, 2356, 3263, 347, 2359, 191, 904, 440, 433, 3256, 237, 909, 440, 2385, 3005, 254, 2388, 5316, 237, 478, 259, 151, 481, 88, 478, 264, 4893, 481, 4895, 234, 463, 478, 4899, 4900, 481, 463, 191, 2409, 2410, 340, 341, 3092, 228, 2783, 477, 2785, 2786, 3258, 478, 477, 239, 481, 2424, 2021, 2426, 2427, 2024, 478, 2955, 2982, 481, 181, 3497, 3498, 3499, 3500, 403, 3895, 3503, 3504, 3505, 3506, 3507, 3508, 3509, 3510, 3511, 3512, 3, 478, 80, 4948, 481, 2455, 2456, 2457, 35, 344, 274, 2461, 320, 4695, 4981, 3304, 478, 2467, 478, 481, 23, 481, 2982, 478, 5401, 2475, 481, 54, 2478, 478, 433, 3100, 481, 3102, 2484, 478, 478, 4660, 481, 481, 53, 478, 350, 2493, 481, 2495, 3559, 3560, 347, 478, 234, 259, 481, 390, 389, 392, 264, 4836, 49, 2509, 3110, 344, 2512, 215, 2514, 3919, 4845, 2517, 390, 234, 392, 2521, 3914, 3934, 2524, 5171, 5172, 104, 386, 3129, 83, 477, 417, 479, 2517, 477, 2536, 2537, 405, 4617, 5295, 5296, 3641, 3642, 5194, 9, 478, 478, 415, 481, 481, 2236, 93, 475, 2554, 477, 389, 442, 2243, 2523, 5373, 2246, 2247, 390, 2564, 392, 2566, 478, 3289, 427, 481, 2563, 3191, 431, 477, 269, 390, 118, 392, 2713, 344, 53, 440, 136, 417, 481, 80, 478, 8, 403, 481, 11, 477, 2593, 135, 15, 16, 17, 139, 8, 414, 477, 11, 417, 43, 463, 15, 16, 17, 442, 344, 3230, 5425, 190, 433, 2609, 2610, 2611, 159, 477, 2620, 162, 2622, 2623, 2624, 2625, 3539, 3625, 478, 344, 478, 481, 478, 481, 187, 481, 177, 2828, 478, 431, 193, 481, 8, 478, 477, 11, 481, 405, 460, 15, 16, 17, 440, 2653, 442, 389, 3459, 415, 92, 211, 2652, 238, 2662, 4741, 241, 478, 32, 234, 481, 4125, 35, 479, 272, 4129, 389, 252, 478, 2563, 5491, 481, 3280, 272, 3282, 417, 3434, 2719, 269, 478, 2722, 54, 481, 2725, 478, 3532, 478, 481, 478, 481, 158, 481, 4228, 2892, 417, 8, 269, 43, 11, 284, 442, 3328, 15, 16, 17, 2713, 3265, 3600, 3267, 478, 259, 2719, 481, 478, 2722, 478, 481, 2725, 481, 442, 478, 478, 164, 481, 481, 477, 2734, 479, 2772, 478, 291, 104, 481, 460, 2742, 477, 3363, 478, 478, 2747, 481, 481, 478, 478, 329, 481, 481, 3265, 478, 3267, 478, 481, 272, 481, 477, 197, 460, 478, 2652, 187, 481, 310, 2770, 2771, 2772, 478, 351, 2775, 481, 344, 212, 211, 2816, 4211, 335, 2783, 2784, 2785, 2786, 470, 222, 209, 3853, 390, 478, 392, 371, 481, 2796, 3348, 162, 2799, 209, 2801, 167, 477, 481, 478, 3492, 5256, 481, 3698, 478, 478, 2812, 2813, 248, 478, 2816, 478, 481, 53, 481, 478, 389, 478, 481, 190, 481, 440, 2828, 442, 2830, 384, 2832, 3595, 2834, 269, 478, 163, 3348, 481, 3526, 92, 478, 209, 478, 481, 440, 481, 442, 3449, 417, 271, 478, 207, 2854, 481, 3475, 478, 2858, 412, 481, 350, 271, 478, 3668, 2865, 481, 420, 478, 478, 423, 481, 481, 238, 477, 442, 241, 3496, 2859, 2860, 2861, 2881, 478, 234, 480, 3571, 2772, 252, 3727, 2889, 3729, 478, 478, 478, 481, 481, 481, 386, 3423, 477, 334, 478, 3521, 3, 2904, 271, 478, 444, 478, 481, 477, 481, 3751, 164, 478, 477, 480, 2865, 2918, 284, 2920, 478, 478, 477, 481, 481, 8, 324, 479, 11, 2816, 3770, 187, 15, 16, 17, 3555, 837, 427, 839, 478, 3830, 3808, 481, 146, 478, 197, 2833, 481, 3752, 32, 440, 478, 478, 478, 481, 481, 481, 2958, 478, 2960, 212, 481, 2849, 329, 2965, 271, 477, 234, 478, 2918, 222, 481, 478, 463, 478, 481, 478, 481, 2865, 481, 0, 478, 83, 479, 481, 351, 421, 477, 4130, 146, 4132, 2992, 344, 2994, 2995, 2996, 248, 269, 478, 187, 3816, 481, 3606, 3606, 324, 371, 269, 3497, 3498, 3499, 3500, 146, 141, 3503, 3504, 3505, 3506, 3507, 3508, 3509, 3510, 3511, 3512, 478, 153, 478, 481, 2713, 481, 158, 146, 2918, 478, 2719, 135, 481, 2722, 389, 187, 2725, 3530, 4077, 269, 464, 465, 466, 158, 468, 469, 470, 471, 472, 473, 324, 464, 465, 466, 146, 468, 469, 470, 471, 472, 473, 223, 417, 114, 3259, 421, 3559, 3560, 91, 478, 3987, 269, 481, 205, 344, 478, 239, 4537, 481, 334, 478, 403, 478, 481, 4544, 481, 477, 442, 478, 4549, 263, 481, 4552, 225, 464, 465, 466, 433, 468, 469, 470, 471, 472, 473, 3108, 478, 478, 347, 481, 481, 158, 478, 215, 66, 254, 35, 141, 4577, 141, 389, 254, 256, 477, 209, 444, 477, 269, 231, 153, 158, 153, 254, 43, 158, 266, 158, 43, 254, 254, 408, 163, 83, 433, 275, 285, 433, 169, 417, 158, 172, 305, 146, 146, 176, 146, 464, 465, 466, 477, 468, 469, 470, 471, 472, 473, 430, 477, 298, 146, 477, 34, 477, 442, 444, 146, 146, 2865, 481, 146, 146, 205, 285, 205, 146, 146, 271, 146, 3994, 292, 146, 8, 146, 158, 11, 146, 146, 146, 15, 16, 17, 225, 146, 225, 269, 386, 207, 35, 477, 223, 477, 158, 158, 3216, 269, 32, 350, 477, 5, 3222, 5, 324, 477, 158, 477, 328, 4142, 477, 3231, 477, 2918, 477, 477, 3236, 3237, 477, 477, 5, 5, 477, 5, 477, 266, 477, 266, 477, 477, 269, 5, 477, 477, 275, 386, 275, 357, 477, 477, 477, 8, 477, 3882, 11, 477, 477, 477, 15, 16, 17, 3271, 3272, 3273, 477, 4374, 477, 477, 3878, 3879, 477, 477, 281, 4739, 441, 413, 207, 35, 3288, 389, 481, 391, 481, 40, 8, 95, 427, 11, 223, 35, 47, 15, 16, 17, 481, 158, 4762, 158, 398, 440, 3310, 3311, 331, 62, 266, 398, 344, 398, 32, 264, 3320, 3321, 3322, 432, 398, 72, 3326, 344, 398, 3329, 479, 4723, 463, 398, 344, 225, 328, 398, 3338, 398, 440, 466, 3334, 398, 84, 146, 477, 478, 344, 480, 8, 269, 4808, 11, 269, 3338, 349, 15, 16, 17, 398, 220, 398, 259, 3853, 398, 420, 386, 269, 3361, 289, 389, 3408, 264, 269, 340, 477, 4063, 398, 477, 35, 180, 464, 465, 466, 398, 468, 469, 470, 471, 472, 473, 413, 84, 413, 209, 481, 285, 187, 54, 3567, 146, 269, 3403, 398, 421, 4157, 421, 3408, 398, 386, 3411, 398, 386, 398, 398, 106, 4220, 437, 398, 439, 440, 269, 398, 53, 53, 4489, 398, 398, 398, 245, 273, 398, 344, 3434, 182, 309, 398, 398, 389, 187, 398, 42, 398, 398, 289, 4335, 3447, 3334, 104, 3450, 3434, 289, 42, 481, 344, 475, 271, 398, 478, 479, 480, 398, 3988, 3989, 3990, 3991, 3992, 4087, 398, 398, 398, 3472, 478, 398, 3361, 209, 224, 482, 269, 209, 3481, 209, 209, 269, 209, 209, 3487, 4944, 3489, 269, 269, 3492, 209, 209, 209, 209, 3497, 3498, 3499, 3500, 398, 444, 3503, 3504, 3505, 3506, 3507, 3508, 3509, 3510, 3511, 3512, 35, 408, 146, 3516, 3517, 24, 269, 146, 112, 3408, 254, 271, 146, 3526, 440, 421, 3565, 3530, 146, 4434, 432, 3534, 190, 4150, 3728, 4451, 146, 477, 269, 3542, 231, 264, 3545, 254, 3547, 3584, 254, 254, 209, 35, 158, 5010, 477, 3556, 271, 35, 3559, 3560, 3752, 215, 477, 3564, 3565, 346, 477, 34, 3569, 396, 3571, 4191, 396, 398, 475, 398, 4066, 3578, 3579, 3580, 3581, 398, 238, 3584, 3585, 241, 398, 475, 3589, 3590, 3591, 3573, 3574, 3575, 3576, 3596, 252, 477, 146, 146, 421, 146, 421, 146, 146, 357, 8, 4208, 263, 11, 4230, 398, 271, 3606, 362, 258, 3606, 163, 436, 477, 3621, 245, 245, 3606, 11, 481, 396, 4117, 284, 398, 477, 4251, 3581, 4355, 172, 3584, 477, 154, 40, 3640, 3641, 3642, 163, 3644, 400, 47, 481, 478, 180, 464, 465, 466, 180, 468, 469, 470, 471, 472, 473, 481, 3661, 3662, 3663, 3664, 205, 360, 270, 481, 421, 213, 72, 35, 53, 329, 478, 278, 344, 421, 3565, 477, 213, 5138, 213, 259, 4285, 259, 398, 398, 398, 3690, 239, 3640, 158, 5150, 3581, 351, 4316, 3584, 433, 477, 403, 347, 4389, 215, 259, 148, 269, 43, 3709, 5238, 4774, 148, 223, 461, 366, 371, 464, 465, 466, 3606, 468, 469, 470, 471, 472, 473, 223, 254, 223, 340, 269, 398, 389, 269, 481, 148, 148, 139, 3930, 324, 181, 354, 312, 35, 209, 398, 4846, 398, 421, 464, 465, 466, 4890, 468, 469, 470, 471, 472, 473, 275, 478, 421, 215, 3759, 466, 264, 146, 158, 4294, 4295, 433, 4297, 35, 308, 160, 387, 264, 477, 146, 309, 182, 4382, 354, 477, 146, 187, 146, 264, 421, 35, 440, 8, 254, 4881, 11, 4883, 254, 269, 269, 215, 178, 178, 158, 3804, 35, 464, 465, 466, 478, 468, 469, 470, 471, 472, 473, 460, 4436, 475, 460, 348, 5277, 243, 224, 40, 158, 4665, 215, 269, 354, 478, 47, 478, 187, 254, 478, 3836, 187, 478, 187, 187, 187, 481, 481, 481, 444, 23, 170, 398, 3849, 477, 3851, 163, 3853, 440, 242, 72, 481, 53, 269, 3860, 263, 386, 433, 403, 478, 3866, 163, 281, 478, 271, 215, 478, 477, 4493, 460, 3876, 478, 0, 163, 478, 478, 478, 478, 290, 478, 478, 481, 478, 477, 398, 3891, 237, 233, 477, 3895, 3581, 477, 5354, 3584, 477, 477, 280, 477, 5360, 3905, 462, 419, 270, 53, 270, 269, 477, 269, 3914, 272, 437, 477, 437, 191, 146, 444, 199, 139, 3924, 398, 398, 259, 3928, 4693, 398, 3923, 254, 146, 273, 3935, 3936, 146, 398, 357, 349, 146, 5079, 223, 349, 349, 148, 3895, 191, 466, 5013, 398, 421, 291, 225, 3640, 418, 35, 146, 4150, 291, 362, 235, 3963, 4578, 3965, 182, 481, 398, 91, 398, 187, 3972, 398, 398, 235, 54, 235, 4793, 398, 344, 398, 398, 269, 3984, 254, 3986, 357, 5087, 5088, 398, 344, 344, 344, 42, 398, 478, 478, 398, 398, 4489, 398, 398, 398, 478, 209, 5462, 175, 224, 3895, 209, 209, 209, 476, 4628, 408, 3, 158, 4618, 141, 478, 43, 4022, 478, 326, 481, 104, 105, 105, 478, 481, 153, 158, 4033, 112, 478, 158, 3923, 477, 35, 146, 163, 146, 466, 158, 175, 478, 169, 421, 8, 172, 146, 11, 421, 176, 271, 15, 16, 17, 269, 461, 398, 476, 4063, 272, 344, 4066, 468, 469, 470, 471, 472, 473, 354, 4074, 4075, 35, 466, 476, 344, 4982, 4081, 4082, 205, 427, 344, 4086, 4890, 344, 167, 344, 4091, 144, 4779, 4094, 4095, 209, 481, 144, 4099, 4100, 209, 209, 225, 209, 4105, 4106, 4107, 4108, 4109, 209, 209, 190, 4113, 4114, 4115, 209, 4117, 4118, 209, 137, 4121, 163, 11, 281, 4125, 475, 158, 432, 4129, 163, 5230, 4818, 163, 437, 4135, 172, 478, 463, 481, 331, 270, 478, 477, 266, 408, 362, 269, 478, 478, 4150, 478, 4170, 275, 478, 481, 4775, 4157, 477, 477, 238, 481, 478, 241, 158, 35, 421, 398, 421, 53, 4170, 215, 199, 4173, 252, 389, 254, 4125, 146, 477, 373, 4129, 167, 408, 349, 344, 398, 398, 344, 478, 4876, 4877, 5329, 4193, 4194, 4814, 478, 5098, 398, 324, 478, 477, 398, 440, 398, 53, 284, 389, 427, 331, 3895, 4211, 158, 148, 72, 146, 105, 478, 408, 209, 4215, 209, 213, 209, 194, 4225, 209, 477, 477, 4224, 269, 398, 319, 481, 478, 481, 35, 444, 5077, 4125, 289, 267, 4861, 4129, 269, 461, 3, 4866, 4867, 481, 209, 329, 468, 469, 470, 471, 472, 473, 408, 477, 481, 398, 477, 354, 386, 426, 82, 8, 169, 105, 11, 163, 478, 351, 4274, 476, 4801, 209, 6, 53, 163, 281, 212, 438, 438, 4774, 478, 4812, 477, 212, 477, 413, 478, 371, 478, 373, 4296, 477, 376, 40, 481, 279, 478, 478, 388, 477, 47, 276, 53, 4798, 176, 4311, 271, 264, 478, 437, 408, 439, 440, 398, 163, 5007, 440, 5044, 72, 5388, 5389, 188, 193, 181, 259, 72, 259, 466, 53, 389, 481, 398, 5024, 481, 66, 5180, 5028, 4343, 5030, 398, 146, 398, 119, 209, 478, 165, 163, 475, 477, 35, 478, 479, 480, 4359, 4885, 112, 421, 187, 4983, 4365, 264, 477, 4878, 35, 354, 421, 254, 160, 4374, 158, 440, 354, 264, 53, 4890, 78, 389, 440, 35, 163, 158, 4578, 269, 4389, 196, 477, 466, 272, 207, 163, 477, 477, 139, 477, 212, 477, 4402, 426, 4404, 370, 478, 478, 477, 4401, 477, 289, 478, 269, 318, 439, 478, 477, 398, 35, 158, 146, 398, 35, 259, 191, 4617, 5041, 236, 354, 477, 4628, 477, 146, 477, 477, 105, 4628, 4438, 477, 4125, 182, 477, 477, 4129, 477, 187, 132, 35, 478, 4450, 273, 408, 368, 436, 4455, 4448, 4449, 478, 368, 478, 84, 190, 127, 53, 35, 75, 477, 477, 477, 481, 199, 200, 477, 477, 389, 180, 421, 389, 207, 158, 209, 210, 224, 477, 252, 389, 269, 5, 4489, 152, 444, 145, 66, 341, 223, 5021, 478, 477, 341, 66, 127, 477, 272, 440, 464, 465, 466, 425, 468, 469, 470, 471, 472, 473, 4401, 440, 477, 4518, 4519, 426, 426, 4522, 477, 5013, 35, 481, 163, 259, 315, 271, 132, 389, 193, 269, 269, 477, 4537, 35, 354, 4540, 35, 272, 272, 4544, 188, 165, 165, 357, 4549, 478, 477, 4552, 4553, 53, 4555, 477, 4557, 398, 4559, 4560, 481, 4448, 4449, 5183, 437, 478, 340, 117, 5079, 377, 478, 5, 8, 5413, 419, 11, 4577, 4578, 4579, 4580, 4581, 477, 142, 354, 340, 276, 477, 325, 4537, 477, 21, 477, 4627, 32, 145, 4544, 477, 259, 163, 398, 4549, 277, 75, 4552, 40, 481, 481, 340, 368, 368, 440, 47, 440, 477, 872, 833, 165, 165, 2521, 2873, 362, 1609, 2408, 2330, 1347, 3042, 4627, 4628, 4577, 3701, 3727, 5221, 2433, 2491, 4668, 4670, 72, 5477, 3250, 5077, 5329, 3876, 4723, 4345, 4692, 2959, 2662, 5200, 4577, 8, 5318, 5107, 11, 5106, 5241, 5495, 5354, 4544, 2963, 3924, 3909, 5051, 4549, 3867, 2506, 4552, 2506, 3722, 3068, 4670, 3892, 3300, 4673, 4359, 914, 4383, 4699, 2500, 3312, 5283, 5283, 40, 4708, 5331, 4685, 5495, 5477, 4688, 47, 5179, 3258, 4685, 4693, 3932, 4695, 5254, 4630, 4864, 1768, 5060, 4633, 4702, 28, 139, 4697, 1185, 3997, 4832, 5422, 1814, 5221, 2179, 2937, 72, 3934, 1812, 1823, 5404, 4719, 461, 4982, 662, 4723, 695, 1974, 1881, 468, 469, 470, 471, 472, 473, 1974, 3194, 1975, 3751, 4737, 4738, 4739, 3304, 4567, 3770, 4735, 5283, 5465, 1432, 182, 2123, 812, 2112, 834, 187, 1916, 1925, 4738, 4758, 4450, 5288, 3984, 5363, 5363, 4762, 1324, 4764, 2889, 2159, 2904, 3599, 5189, 1390, 1389, 2133, 5032, 4774, 4147, 2158, 4777, 1392, 4779, 1367, 139, 4818, 3584, 4114, 4131, 3581, 5010, 4809, 224, 5009, 4739, 3581, 3985, 5471, 5303, 5392, 5179, 4798, 4777, 1846, 3534, 4563, 5193, 4804, 5192, 2743, 2070, 4808, 2833, 5299, 4697, 4812, 2461, 4762, 2831, -1, 2073, 4818, 5329, -1, -1, -1, -1, 182, -1, -1, 4827, -1, 187, -1, -1, -1, -1, -1, -1, 271, -1, -1, -1, -1, -1, -1, -1, 4844, -1, 4846, -1, -1, 4735, 5041, -1, 4537, -1, -1, -1, -1, -1, -1, 4544, 4808, -1, 5465, 5465, 4549, -1, 224, 4552, 4553, -1, -1, 4871, -1, -1, -1, -1, 4876, 4877, -1, -1, -1, 4881, 4882, 4883, 4884, -1, -1, -1, -1, -1, -1, -1, 4577, -1, -1, -1, -1, -1, 626, 5388, 5389, -1, -1, -1, 632, -1, -1, -1, -1, -1, -1, -1, 4912, 271, -1, -1, -1, 645, -1, 4919, -1, -1, 4808, -1, -1, -1, -1, 362, -1, -1, -1, -1, 4818, 661, -1, -1, -1, -1, 666, -1, -1, 4941, 4627, 671, 4944, -1, -1, 675, 676, -1, -1, -1, -1, -1, 682, -1, 684, 685, -1, -1, -1, -1, 4954, -1, -1, -1, -1, -1, -1, 697, 698, -1, -1, -1, -1, -1, -1, -1, -1, -1, 708, -1, -1, -1, -1, 4670, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4944, -1, -1, -1, -1, -1, -1, -1, 362, -1, -1, 5007, -1, -1, 5010, -1, -1, 5013, -1, -1, -1, 5017, -1, -1, -1, -1, -1, -1, 5024, -1, 461, -1, 5028, -1, 5030, -1, 5032, 468, 469, 470, 471, 472, 473, 5039, -1, 5041, -1, -1, 22, -1, -1, -1, -1, -1, 28, -1, 5052, -1, 4739, -1, -1, -1, 4944, -1, -1, -1, 5010, 791, 792, -1, -1, -1, 4954, 797, -1, -1, -1, -1, -1, -1, -1, 4762, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5087, 5088, -1, -1, -1, 70, 821, -1, 823, -1, -1, -1, -1, -1, -1, -1, 461, -1, -1, 834, -1, -1, -1, 468, 469, 470, 471, 472, 473, -1, -1, 5118, -1, -1, -1, -1, 4808, -1, 5125, -1, -1, -1, 5129, -1, -1, -1, -1, -1, -1, -1, -1, 5138, -1, -1, -1, 120, -1, -1, -1, 124, -1, -1, -1, 5150, -1, 8, 131, -1, 11, 134, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5159, -1, -1, 5170, 5171, 5172, -1, 5208, -1, 5176, -1, -1, 5179, -1, 159, -1, -1, 40, -1, -1, -1, -1, 5189, 5138, 47, 5192, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5150, -1, -1, -1, -1, -1, 5208, -1, -1, -1, 940, 941, 942, 193, 72, -1, -1, -1, -1, 949, -1, 5223, -1, -1, -1, -1, 956, -1, 5230, -1, 960, -1, 4919, -1, -1, -1, 966, -1, -1, 969, -1, -1, -1, -1, -1, -1, -1, -1, 5284, 5285, -1, 981, -1, -1, 5256, -1, -1, 4944, -1, 5261, -1, 5255, -1, -1, -1, 5267, 996, -1, -1, -1, -1, 5159, 252, -1, 254, 5277, -1, -1, -1, -1, -1, 139, 5284, 5285, 264, -1, 5288, 5289, -1, 5283, -1, -1, 5283, 273, -1, -1, -1, 5299, -1, 5283, -1, 5303, -1, -1, -1, 285, -1, -1, -1, -1, -1, 1041, 1042, 1043, -1, 25, -1, -1, -1, -1, -1, 5323, -1, 5010, 182, 5363, -1, 5277, -1, 187, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 324, -1, -1, 327, 328, -1, -1, 1081, 5354, 5355, 5356, -1, -1, -1, 5360, -1, -1, -1, -1, -1, 74, -1, 224, 5255, -1, 5363, -1, -1, 5363, -1, -1, -1, -1, 357, -1, 5363, -1, -1, -1, -1, -1, -1, 5388, 5389, 1118, -1, -1, 1086, -1, -1, -1, 5283, 106, 5399, -1, -1, -1, -1, 5404, -1, 5354, -1, 1136, -1, -1, -1, 5360, 1106, -1, 271, -1, -1, 1146, -1, -1, 129, -1, 1116, -1, -1, 1154, 1120, -1, -1, -1, 1124, 140, 1126, 5434, -1, -1, -1, -1, 1132, -1, -1, -1, -1, 5444, 1138, 424, -1, 1141, -1, -1, -1, 160, 5138, -1, -1, 1184, 165, -1, 5459, -1, -1, 5462, 5497, 5498, 5150, -1, -1, -1, -1, 1198, 5471, 1200, 5465, -1, 5475, 5465, 5363, -1, -1, -1, -1, -1, 5465, -1, -1, -1, -1, 1216, -1, -1, -1, 1220, -1, -1, -1, -1, 5497, 5498, -1, -1, -1, -1, -1, 1232, -1, 362, -1, 216, -1, -1, -1, -1, -1, 5462, 0, -1, -1, -1, -1, -1, -1, -1, 5208, -1, -1, -1, -1, -1, 237, 0, -1, -1, 18, 1262, -1, -1, -1, -1, -1, -1, -1, -1, 28, -1, 30, 31, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 46, 1290, 1291, 1292, -1, 1294, -1, -1, -1, 55, -1, -1, -1, -1, -1, 5261, -1, -1, 5465, -1, -1, 67, -1, 69, 70, 1314, -1, -1, -1, -1, 76, 5277, 78, -1, -1, -1, 305, 306, 5284, 5285, 309, -1, -1, 89, 461, 91, -1, -1, -1, 1338, -1, 468, 469, 470, 471, 472, 473, 1346, 1347, -1, 91, -1, 108, -1, -1, 111, 335, -1, -1, 338, -1, 1360, -1, -1, -1, 344, -1, -1, -1, 125, -1, 127, 351, -1, -1, 131, -1, -1, -1, -1, -1, 137, -1, 1382, -1, -1, -1, 1386, 1387, 145, -1, 147, -1, -1, -1, -1, -1, 153, 5354, -1, 141, 380, 1401, -1, 5360, -1, -1, 386, 1407, -1, 389, -1, 153, 169, 1413, -1, -1, 158, -1, -1, -1, -1, 163, -1, -1, -1, -1, -1, 169, 408, 186, 172, -1, -1, -1, 176, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 433, 22, -1, -1, -1, -1, -1, 28, -1, -1, 205, -1, -1, -1, -1, -1, 226, 227, -1, -1, -1, 1474, 232, -1, -1, -1, -1, -1, -1, -1, 225, -1, -1, -1, 244, -1, 22, -1, -1, -1, -1, -1, 28, -1, -1, -1, 256, -1, -1, -1, -1, -1, 5462, -1, -1, 41, -1, -1, -1, -1, -1, 8, 1515, -1, 11, 5475, -1, -1, 15, 16, 17, 266, -1, -1, 269, -1, -1, -1, -1, -1, 275, -1, 292, -1, 70, 32, -1, 5497, 5498, -1, 300, -1, -1, 40, -1, 1548, -1, -1, -1, -1, 47, -1, -1, -1, 314, -1, -1, -1, -1, -1, 320, 321, -1, 323, -1, -1, -1, -1, 328, -1, -1, -1, -1, 333, -1, 72, 336, -1, -1, -1, -1, -1, -1, 343, 120, -1, 331, -1, 124, 349, 350, -1, -1, -1, -1, 131, -1, 357, 134, -1, -1, 361, -1, -1, 1607, -1, -1, -1, -1, -1, -1, 371, -1, -1, -1, -1, -1, -1, -1, 1622, 1623, 1624, -1, 159, -1, -1, 386, 8, -1, -1, 11, -1, -1, -1, 15, 16, 17, -1, -1, -1, -1, 386, -1, -1, -1, -1, 406, -1, -1, -1, -1, 32, -1, -1, -1, -1, 416, 193, -1, 40, -1, -1, 422, -1, -1, -1, 47, 427, 413, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 440, -1, -1, -1, -1, 182, -1, -1, -1, -1, 187, 72, 437, -1, 439, 440, -1, -1, -1, -1, -1, -1, -1, 463, -1, -1, -1, -1, -1, -1, -1, -1, 209, 210, -1, -1, 252, 477, 254, -1, 480, -1, 1725, -1, -1, -1, -1, 224, 264, -1, 475, -1, -1, 478, 479, 480, -1, 273, -1, 1742, -1, -1, -1, -1, -1, -1, -1, -1, -1, 285, -1, -1, 1755, -1, -1, -1, -1, 1760, -1, -1, 257, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 271, -1, 1779, 274, -1, -1, -1, -1, -1, -1, 1787, -1, -1, -1, 324, -1, -1, 327, 328, -1, -1, -1, 1799, -1, -1, -1, -1, 182, -1, -1, -1, -1, 187, -1, -1, -1, -1, -1, -1, 1816, -1, -1, -1, -1, -1, -1, 1823, 357, -1, 1826, -1, -1, 1829, -1, 209, 210, -1, -1, 1835, -1, -1, -1, -1, -1, 1841, -1, -1, -1, -1, 224, -1, -1, -1, -1, -1, -1, 1853, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 362, -1, 1870, 1871, -1, 1873, 1874, -1, -1, -1, -1, 257, -1, -1, -1, -1, -1, 1885, -1, 1887, 1888, -1, -1, 424, -1, 271, -1, -1, 274, 1897, 1898, -1, 1900, 1901, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1876, -1, -1, -1, -1, 1916, -1, -1, 1884, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1904, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1950, -1, -1, 1953, 1954, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 461, -1, -1, 464, 465, 466, -1, 468, 469, 470, 471, 472, 473, -1, -1, -1, -1, 362, -1, -1, 481, 1988, -1, 1990, -1, -1, -1, -1, 1995, 1996, -1, -1, -1, -1, -1, 2002, 2003, 2004, -1, -1, -1, 2008, -1, 2010, 2011, 2012, 2013, 2014, 2015, -1, 2017, -1, 2019, 2020, -1, -1, 2023, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2037, 2038, 2039, 2040, 2041, 2042, -1, -1, -1, 2046, -1, -1, -1, 2050, -1, -1, 2053, -1, -1, 2056, 2057, 2058, 2059, 2060, 2061, 2062, 2063, 2064, -1, 2066, -1, -1, -1, -1, -1, -1, 2073, -1, 2075, -1, -1, -1, -1, -1, -1, -1, 461, -1, -1, 464, 465, 466, -1, 468, 469, 470, 471, 472, 473, -1, -1, -1, 8, -1, -1, 11, 481, -1, -1, 15, 16, 17, -1, -1, -1, 2112, -1, -1, -1, -1, -1, 2118, -1, -1, -1, -1, 32, -1, -1, -1, -1, -1, -1, -1, 40, -1, 2133, -1, -1, -1, -1, 47, -1, -1, -1, 2142, 2143, -1, 2110, -1, -1, -1, -1, -1, -1, -1, -1, 722, -1, 724, -1, 726, -1, -1, -1, -1, 72, 732, 733, 734, 2167, -1, -1, -1, -1, -1, -1, 2174, 3, -1, -1, 2178, 2179, 8, -1, -1, 11, -1, 2185, -1, 15, 16, 17, 2190, 2191, -1, -1, -1, 2195, -1, -1, -1, -1, -1, -1, -1, 2203, 32, -1, -1, 35, -1, -1, -1, -1, 40, -1, -1, 20, -1, -1, -1, 47, 25, 2221, -1, -1, 2224, -1, 200, -1, -1, -1, -1, -1, -1, -1, -1, 209, 2236, -1, -1, -1, 2240, -1, -1, 2243, 72, -1, 2246, 2247, -1, 223, -1, -1, -1, -1, 2254, 60, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2267, 73, -1, -1, -1, -1, 182, -1, -1, -1, -1, 187, -1, -1, -1, -1, 88, -1, -1, 2286, 2287, -1, -1, -1, -1, -1, -1, -1, 2295, -1, -1, -1, -1, 209, 210, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 880, -1, -1, 224, -1, -1, 2318, 2319, -1, -1, 2322, -1, 129, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 140, -1, -1, -1, -1, -1, -1, -1, -1, 2344, -1, 2346, -1, 257, -1, -1, 2351, -1, -1, 182, 160, -1, 2357, -1, 187, 165, -1, 271, 35, 2364, 274, -1, -1, 2368, -1, -1, -1, -1, 2373, -1, -1, 17, -1, -1, -1, -1, 209, 210, -1, 56, 26, -1, -1, -1, -1, -1, -1, -1, 2393, -1, -1, 224, -1, 2398, -1, -1, -1, 2402, -1, -1, 2405, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2415, -1, -1, 90, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2428, 257, -1, -1, 237, 22, -1, -1, -1, -1, 2438, 28, -1, -1, -1, 271, -1, -1, 274, -1, -1, -1, -1, -1, -1, 362, -1, 2455, 2456, 2457, -1, -1, -1, 2461, -1, -1, -1, -1, 271, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 149, -1, -1, -1, 70, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2493, 2494, -1, -1, -1, -1, -1, 305, 306, -1, 2503, -1, -1, -1, -1, -1, -1, -1, -1, 184, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 338, 362, 124, -1, 2537, -1, 344, -1, -1, 131, 215, -1, 134, 351, -1, 220, 354, -1, -1, 461, -1, -1, 464, 465, 466, -1, 468, 469, 470, 471, 472, 473, -1, -1, -1, -1, 478, 159, -1, -1, -1, -1, -1, 2576, -1, -1, 2579, -1, 386, 254, -1, 2584, -1, 1154, -1, 393, -1, -1, -1, -1, 2593, -1, -1, 401, -1, -1, -1, -1, -1, -1, 408, 193, -1, -1, -1, -1, -1, -1, -1, -1, -1, 286, -1, -1, -1, -1, -1, 292, -1, -1, -1, 2589, -1, -1, -1, 433, -1, -1, 2596, -1, 461, -1, -1, 464, 465, 466, 2639, 468, 469, 470, 471, 472, 473, -1, -1, -1, -1, -1, 2616, 626, -1, -1, -1, 328, -1, 632, -1, 332, 2626, -1, 252, 2629, 254, 2631, 2632, -1, 341, 2635, 645, -1, -1, -1, 264, 2641, 349, 2643, -1, -1, 2646, -1, 2683, 273, 357, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 285, 369, -1, 2699, -1, 2701, -1, -1, -1, -1, 378, -1, -1, 2709, 382, -1, -1, 2713, -1, -1, 2716, -1, -1, 2719, -1, -1, 2722, -1, -1, 2725, -1, -1, -1, 401, 56, 2731, -1, -1, -1, 324, -1, -1, 327, 328, -1, -1, 2742, -1, -1, -1, 2711, 2747, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 435, 90, -1, -1, 439, 357, -1, 2770, 2771, 2772, 1341, -1, 2775, -1, -1, 1346, 1347, -1, -1, -1, 2783, 2784, 2785, 2786, -1, -1, -1, -1, 2791, 1360, -1, 120, -1, 2796, 2797, -1, 2799, -1, 2801, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2812, 2813, -1, -1, 2816, -1, -1, -1, -1, -1, -1, 149, -1, -1, -1, -1, -1, -1, 2830, -1, 2832, -1, 2834, 424, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2854, -1, -1, -1, 184, 8, -1, -1, 11, -1, -1, 2865, 15, 16, 17, -1, -1, -1, -1, 2873, -1, -1, -1, -1, -1, -1, -1, -1, -1, 32, -1, 1453, -1, -1, -1, 2889, -1, 40, -1, -1, 220, 1463, -1, -1, 47, -1, -1, -1, -1, -1, 2904, -1, -1, -1, -1, -1, -1, -1, 8, -1, -1, 11, -1, -1, 2918, 15, 16, 17, -1, 72, -1, -1, -1, 2927, 254, -1, 2930, -1, 2932, -1, -1, 22, 32, 2937, 1506, 1507, -1, 28, -1, -1, 40, -1, -1, -1, -1, -1, -1, 47, 2952, 2953, 41, -1, -1, -1, 2958, 285, 286, -1, -1, -1, -1, -1, 292, -1, 609, -1, -1, -1, -1, -1, -1, -1, 72, -1, -1, 2979, -1, 1549, 2982, 70, 1552, 1553, 2986, -1, -1, -1, -1, 35, -1, -1, -1, -1, -1, -1, 324, -1, -1, -1, 328, 2968, -1, 3005, 332, -1, -1, -1, -1, -1, 56, -1, -1, 341, -1, -1, -1, -1, 661, 662, -1, 349, -1, -1, -1, -1, -1, -1, 3030, 357, -1, 182, -1, 122, -1, 124, 187, -1, -1, -1, -1, 369, 131, -1, 90, 134, -1, -1, -1, -1, 378, -1, -1, -1, 382, -1, -1, -1, 209, 210, -1, -1, -1, -1, -1, 3067, 3068, 3069, -1, -1, 159, -1, -1, 224, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 182, 3052, -1, 3054, 3090, 187, -1, -1, -1, -1, -1, -1, -1, -1, 3100, -1, 3102, -1, -1, 149, 193, -1, 257, 435, 3110, -1, -1, 209, 210, -1, -1, -1, 759, -1, -1, -1, 271, -1, -1, 274, -1, -1, 224, 3129, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 184, -1, -1, -1, 785, -1, -1, -1, -1, -1, -1, -1, 793, -1, -1, 796, 797, 798, -1, -1, -1, 257, -1, -1, 1732, 252, -1, 254, -1, -1, -1, 215, -1, -1, -1, 271, 220, 264, 274, -1, -1, -1, -1, -1, -1, 8, 273, -1, 11, -1, -1, 3191, 15, 16, 17, -1, -1, -1, 285, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 32, 254, 3211, -1, 362, -1, -1, 3216, 40, -1, -1, -1, -1, 3222, -1, 47, 3190, -1, -1, -1, -1, 3230, 3196, -1, -1, -1, -1, -1, 324, -1, -1, 327, 328, 286, -1, -1, -1, -1, -1, 292, 72, -1, -1, -1, -1, -1, -1, -1, -1, 3258, 3259, -1, -1, -1, -1, -1, 3265, 362, 3267, -1, -1, 357, 1839, -1, -1, -1, -1, -1, -1, -1, -1, 3280, 1849, 3282, 1851, 328, -1, -1, -1, 332, 1857, -1, -1, -1, -1, -1, -1, 1864, 341, -1, -1, -1, -1, -1, -1, 3304, 349, -1, -1, -1, -1, -1, -1, 461, 357, -1, 464, 465, 466, -1, 468, 469, 470, 471, 472, 473, 369, -1, -1, 3328, 478, -1, -1, -1, -1, 378, 158, -1, 424, 382, -1, 163, -1, -1, -1, -1, -1, -1, -1, 3348, 3349, -1, -1, -1, -1, -1, -1, -1, 401, -1, 182, -1, -1, -1, 3363, 187, 461, -1, -1, 464, 465, 466, -1, 468, 469, 470, 471, 472, 473, -1, -1, -1, -1, 478, -1, -1, -1, 209, 210, -1, -1, -1, 435, -1, -1, -1, 439, -1, -1, -1, 3399, -1, 224, -1, -1, 8, -1, -1, 11, -1, -1, -1, 15, 16, 17, -1, -1, -1, -1, -1, -1, -1, -1, 3387, -1, 3389, -1, 3391, 3427, 32, -1, 1998, 1999, -1, -1, 257, 3400, 40, 2005, 2006, -1, -1, -1, -1, 47, -1, -1, -1, -1, 271, 3449, -1, 274, 3452, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2033, -1, -1, 72, -1, -1, -1, 3472, -1, -1, 3475, -1, -1, -1, -1, -1, 3481, -1, -1, -1, -1, 3451, 3487, -1, 3489, -1, -1, 3492, -1, -1, 1136, 3496, 3497, 3498, 3499, 3500, -1, -1, 3503, 3504, 3505, 3506, 3507, 3508, 3509, 3510, 3511, 3512, 1154, -1, -1, 3516, 3517, -1, -1, -1, 3521, -1, -1, -1, -1, 3526, -1, -1, -1, 3530, -1, 3532, -1, 3534, -1, -1, -1, -1, 362, -1, -1, 3542, -1, -1, 3545, -1, 3547, -1, 1190, -1, -1, -1, -1, -1, 3555, 3556, -1, -1, 3559, 3560, -1, -1, -1, 3564, 3565, -1, -1, -1, -1, 22, 3571, -1, -1, 2142, 2143, 28, -1, 182, 1220, -1, 3581, -1, 187, 3584, -1, -1, -1, -1, -1, -1, -1, 8, -1, -1, 11, 3596, -1, -1, 15, 16, 17, -1, -1, -1, 209, 210, -1, -1, -1, -1, -1, -1, -1, -1, -1, 32, -1, 70, -1, 224, 3621, -1, -1, 40, -1, -1, -1, 3628, -1, -1, 47, -1, 1607, -1, 2203, -1, -1, 461, -1, 3640, 464, 465, 466, -1, 468, 469, 470, 471, 472, 473, -1, -1, 257, -1, 1296, 72, -1, -1, -1, -1, -1, -1, -1, 1305, -1, -1, 271, -1, -1, 274, 3671, 124, -1, -1, -1, -1, -1, 1319, 131, -1, -1, 134, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1338, -1, -1, 1341, 1342, -1, -1, -1, 1346, 1347, 159, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1360, -1, -1, 3722, -1, -1, -1, 22, 3727, 3728, 3729, 2298, -1, 28, -1, -1, -1, -1, -1, -1, -1, -1, 193, -1, -1, -1, 41, -1, -1, -1, -1, -1, 3751, 3752, -1, -1, -1, -1, -1, 362, -1, -1, -1, -1, -1, -1, -1, 182, -1, -1, -1, 3770, 187, -1, -1, 70, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3786, -1, -1, 3789, -1, -1, -1, 209, 210, -1, -1, -1, -1, -1, 252, -1, 254, -1, -1, 1779, -1, -1, 224, -1, -1, 2379, 264, 1787, -1, -1, -1, -1, -1, 2387, -1, 273, 2390, -1, -1, 1799, 122, -1, 124, -1, -1, -1, -1, 285, -1, 131, -1, -1, 134, -1, -1, 257, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3853, -1, 271, -1, 461, 274, -1, 464, 465, 466, 159, 468, 469, 470, 471, 472, 473, 56, -1, 324, -1, 478, 327, 328, -1, 3878, 3879, -1, -1, 3882, -1, -1, -1, -1, -1, 3888, -1, -1, -1, -1, -1, -1, 3895, -1, 193, -1, -1, 1874, -1, -1, -1, 90, 357, -1, 3907, -1, -1, -1, 8, -1, -1, 11, -1, -1, -1, 15, 16, 17, -1, -1, -1, -1, 1566, -1, 1901, -1, -1, 3930, 1572, -1, -1, 3934, 3935, 3936, -1, -1, -1, -1, -1, -1, 40, -1, -1, 362, -1, -1, -1, 47, -1, 8, -1, -1, 11, 252, -1, 254, 15, 16, 17, -1, 149, -1, -1, -1, -1, 264, -1, -1, -1, 424, -1, -1, 72, 32, 273, -1, -1, -1, -1, -1, -1, 40, -1, 3986, -1, -1, 285, -1, 47, -1, -1, -1, -1, -1, 3997, 184, -1, -1, -1, 3967, -1, -1, -1, 3971, -1, -1, -1, -1, -1, -1, -1, -1, -1, 72, -1, -1, -1, -1, -1, 4022, -1, -1, -1, -1, -1, 324, -1, -1, 327, 328, 4033, 220, -1, -1, -1, 2606, 2607, -1, -1, -1, -1, 2612, 461, -1, -1, 464, 465, 466, -1, 468, 469, 470, 471, 472, 473, -1, -1, -1, 357, 478, 4063, -1, -1, 4066, -1, 254, -1, -1, -1, -1, -1, 4074, 4075, -1, 4077, -1, -1, -1, 4081, 4082, -1, -1, 182, 4086, 4087, -1, -1, 187, 4091, -1, -1, 4094, 4095, -1, -1, -1, 4099, 286, -1, -1, -1, -1, 4105, 292, 2675, -1, -1, -1, -1, 209, 210, -1, -1, -1, 4117, -1, -1, -1, -1, -1, -1, -1, 4125, 182, 224, 424, 4129, -1, 187, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1782, 328, -1, 330, 1786, 332, -1, -1, -1, -1, -1, -1, 209, 210, 341, -1, 4157, -1, -1, 257, -1, -1, 349, -1, -1, -1, -1, 224, -1, -1, 357, -1, 4173, 271, -1, -1, -1, -1, -1, -1, -1, -1, 369, -1, -1, -1, -1, -1, -1, -1, 4191, 378, 2167, -1, -1, 382, -1, -1, -1, -1, 257, -1, -1, -1, -1, -1, -1, 4208, -1, -1, 2185, -1, 4213, -1, 271, -1, 2191, 274, -1, -1, 2195, -1, -1, 4189, -1, -1, -1, -1, -1, 4230, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4246, 2221, -1, 435, -1, 4251, -1, -1, -1, -1, -1, -1, 4258, -1, -1, -1, -1, -1, -1, 362, 4231, 4232, -1, -1, -1, -1, -1, -1, 4274, -1, -1, -1, -1, -1, -1, -1, -1, -1, 22, 4285, -1, -1, -1, -1, 28, -1, -1, 2267, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2871, -1, 2873, 362, -1, -1, -1, -1, -1, 2286, -1, -1, -1, 4316, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2896, 2897, -1, -1, 70, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4343, -1, 2319, -1, -1, -1, -1, -1, -1, 4317, 4318, -1, -1, -1, -1, -1, 4359, 2001, -1, -1, -1, 461, -1, -1, 464, 465, 466, 2344, 468, 469, 470, 471, 472, 473, 2351, -1, -1, -1, -1, 4382, 2357, -1, -1, 124, -1, -1, 4389, 2364, -1, -1, 131, 2368, -1, 134, -1, -1, 2373, -1, -1, -1, -1, -1, 461, -1, -1, 464, 465, 466, -1, 468, 469, 470, 471, 472, 473, -1, 2393, -1, 159, 478, -1, 2398, -1, -1, -1, 2402, -1, -1, -1, -1, -1, 4434, -1, 4436, -1, -1, -1, -1, 2415, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2092, -1, -1, 2428, 193, -1, -1, -1, -1, -1, -1, -1, -1, 2438, -1, -1, -1, -1, -1, -1, 4471, -1, -1, -1, -1, 4441, -1, 4443, 4444, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4489, -1, -1, -1, 4493, -1, -1, -1, -1, -1, -1, 8, -1, -1, 11, -1, 4470, -1, 15, 16, 17, -1, -1, -1, -1, 252, -1, 254, -1, 4518, 4519, -1, -1, 4522, -1, 32, -1, 264, -1, -1, -1, -1, -1, 40, -1, -1, 273, -1, 4537, -1, 47, -1, -1, -1, -1, 4544, -1, -1, 285, -1, 4549, -1, -1, 4552, 4553, -1, -1, -1, -1, -1, 4559, 4560, -1, 2203, -1, 72, -1, -1, -1, -1, -1, -1, 4571, -1, 4573, -1, -1, -1, 4577, -1, -1, -1, 8, -1, -1, -1, -1, 324, 14, 15, 327, 328, -1, -1, 20, -1, 22, -1, -1, -1, -1, -1, 28, -1, -1, 31, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4617, 4618, 357, -1, -1, -1, 50, 51, -1, -1, 4627, -1, -1, -1, -1, -1, 2274, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 8, -1, -1, 11, -1, -1, -1, 15, 16, 17, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4665, -1, -1, -1, -1, 4670, -1, -1, -1, 182, -1, -1, -1, 40, 187, -1, -1, -1, -1, -1, 47, 424, -1, -1, -1, -1, 3259, -1, -1, -1, -1, -1, -1, -1, -1, -1, 209, 210, -1, -1, -1, -1, -1, -1, 2683, 72, -1, 2353, -1, -1, 3283, 224, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4726, 2701, -1, 2370, -1, -1, -1, -1, -1, 2709, -1, -1, -1, 4739, -1, 4741, -1, -1, -1, -1, -1, -1, -1, 257, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4762, 271, 4764, -1, 274, -1, -1, -1, 197, -1, -1, -1, 4774, 4775, -1, 4777, 205, 4779, -1, 208, -1, -1, 211, 212, -1, 214, -1, 216, 2431, -1, 219, -1, 221, 22, -1, -1, 4798, -1, 3368, 28, -1, -1, 4804, 4770, -1, -1, 4808, -1, -1, -1, -1, -1, 4814, -1, -1, -1, 4818, -1, 182, -1, -1, -1, 2465, 187, -1, 2468, -1, 2470, -1, -1, -1, 2474, -1, 2476, 2477, -1, -1, -1, -1, -1, -1, 70, 2485, 2486, 2487, 209, 210, -1, -1, -1, -1, 4853, 362, -1, -1, -1, -1, -1, -1, 4861, 224, -1, -1, -1, 4866, 4867, -1, 4834, -1, 4871, -1, -1, -1, -1, 4876, 4877, 4878, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4890, 3459, -1, -1, 22, 257, -1, 124, -1, 2540, 28, -1, -1, -1, 131, -1, -1, 134, -1, 271, -1, -1, 4912, -1, -1, -1, -1, -1, -1, 4919, -1, 4886, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2572, 159, -1, -1, -1, -1, -1, -1, -1, -1, -1, 70, 2584, 4944, -1, -1, -1, -1, -1, -1, -1, -1, 461, -1, -1, 464, 465, 466, -1, 468, 469, 470, 471, 472, 473, 193, -1, -1, -1, 478, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4982, 4983, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 124, -1, 2639, -1, 362, -1, -1, 131, -1, 2979, 134, 5007, -1, -1, 5010, -1, -1, 5013, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5024, 252, -1, 254, 5028, -1, 5030, 159, 5032, -1, -1, -1, -1, 264, -1, -1, -1, -1, -1, -1, -1, -1, 273, -1, -1, -1, -1, -1, 5052, -1, 8, -1, -1, 11, 285, -1, -1, 15, 16, 17, -1, 193, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5077, 32, 5079, -1, -1, -1, -1, -1, -1, 40, -1, -1, -1, -1, -1, -1, 47, -1, -1, -1, 324, -1, 461, 327, 328, 464, 465, 466, -1, 468, 469, 470, 471, 472, 473, -1, -1, -1, -1, 3090, -1, 72, -1, -1, -1, -1, -1, 252, -1, 254, -1, -1, 5129, 357, -1, -1, -1, -1, -1, 264, -1, 5138, -1, -1, -1, -1, -1, -1, 273, -1, -1, -1, -1, 5150, -1, -1, -1, -1, -1, -1, 285, -1, -1, 3728, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5170, 5171, 5172, -1, -1, -1, -1, -1, -1, 5179, 5180, -1, -1, 5183, 3752, -1, -1, -1, -1, 5189, -1, 3759, -1, -1, 5194, -1, 623, 424, -1, 327, 328, -1, -1, 630, 631, -1, -1, 634, 5208, 636, 637, -1, -1, -1, 641, -1, -1, -1, -1, -1, -1, 5221, -1, -1, -1, 652, -1, -1, 182, 357, -1, -1, 2873, 187, -1, -1, -1, 3211, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 209, 210, -1, -1, -1, -1, 5261, -1, -1, 691, -1, 693, 5267, -1, -1, 224, -1, -1, 3841, 3842, -1, 703, 5277, -1, -1, -1, -1, -1, -1, 5284, 5285, -1, -1, -1, 5289, -1, -1, -1, -1, -1, -1, 424, -1, -1, 5299, -1, -1, -1, 257, -1, -1, -1, -1, -1, 736, -1, -1, -1, -1, -1, -1, -1, 271, -1, -1, 274, -1, -1, -1, -1, -1, -1, -1, -1, 5329, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2982, -1, -1, -1, -1, -1, -1, 5313, -1, -1, -1, -1, -1, 5354, -1, -1, -1, -1, -1, 5360, -1, 3930, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 8, -1, -1, 11, -1, 5388, 5389, 15, 16, 17, -1, -1, -1, -1, 824, -1, 5399, -1, -1, -1, -1, 5404, -1, -1, 32, 362, -1, -1, 22, -1, 5413, -1, 40, -1, 28, -1, -1, -1, -1, 47, -1, -1, 3399, 3994, -1, 8, -1, -1, 11, 3073, 860, 5434, 15, 16, 17, -1, -1, -1, -1, -1, -1, 5444, -1, -1, 72, -1, -1, -1, -1, 32, 3427, -1, -1, -1, -1, -1, 70, 40, -1, 5462, -1, -1, -1, -1, 47, -1, -1, -1, -1, -1, -1, -1, 5475, -1, 5477, 3452, -1, -1, -1, -1, -1, -1, -1, 3127, -1, -1, -1, -1, -1, 72, -1, -1, 5495, -1, 5497, 5498, -1, -1, -1, -1, -1, -1, 932, -1, 461, -1, -1, 464, 465, 466, 124, 468, 469, 470, 471, 472, 473, 131, -1, -1, 134, 478, -1, 953, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 965, -1, -1, -1, -1, 970, -1, -1, -1, -1, 159, -1, -1, -1, 3193, 980, -1, -1, 8, 182, 985, 11, -1, -1, 187, 15, 16, 17, -1, 994, -1, -1, -1, -1, 999, -1, -1, 1002, -1, -1, -1, -1, 32, -1, 193, -1, 209, 210, -1, -1, 40, -1, -1, -1, -1, -1, 3235, 47, -1, -1, -1, 224, -1, -1, 182, -1, -1, -1, -1, 187, 3249, 3250, -1, -1, -1, -1, -1, -1, -1, 1044, 3259, -1, 72, -1, -1, -1, 3265, -1, 3267, -1, -1, 209, 210, -1, 257, -1, -1, -1, 56, -1, -1, -1, -1, 252, -1, 254, 224, -1, 271, 4215, -1, 274, -1, -1, 4220, 264, -1, -1, 4224, -1, -1, -1, -1, -1, 273, -1, -1, -1, -1, 22, -1, -1, 90, -1, 3313, 28, 285, -1, -1, 257, -1, -1, -1, 4249, 4250, -1, -1, -1, 4254, 4255, -1, -1, -1, 271, -1, -1, 274, -1, -1, 3671, -1, -1, 120, -1, -1, -1, -1, -1, 3347, 3348, -1, -1, -1, -1, -1, 324, -1, 70, 327, 328, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 149, 182, -1, -1, -1, 1161, 187, 1163, 362, 1165, -1, 1167, -1, 1169, 1170, 1171, -1, 357, -1, -1, 1176, -1, -1, -1, -1, -1, -1, -1, 209, 210, -1, 1187, -1, -1, -1, 184, -1, -1, -1, -1, 124, -1, -1, 224, -1, -1, -1, 131, -1, 8, 134, 1207, 11, 362, -1, -1, 15, 16, 17, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 220, -1, 32, -1, 159, 257, -1, -1, -1, -1, 40, -1, 3786, 424, -1, 3789, -1, 47, -1, 271, -1, -1, 274, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 254, -1, 461, -1, 193, 464, 465, 466, 72, 468, 469, 470, 471, 472, 473, -1, -1, -1, -1, 478, -1, 8, -1, -1, 11, -1, -1, -1, 15, 16, 17, 285, 286, -1, -1, -1, -1, -1, 292, -1, -1, -1, -1, -1, -1, 32, -1, 461, -1, -1, 464, 465, 466, 40, 468, 469, 470, 471, 472, 473, 47, -1, -1, 252, 478, 254, 3541, -1, -1, -1, 324, -1, -1, -1, 328, 264, 362, -1, 332, -1, 3888, -1, -1, -1, 273, 72, -1, 341, -1, -1, -1, -1, -1, -1, -1, 349, 285, -1, -1, 3907, -1, 199, 200, 357, -1, -1, 1367, -1, -1, 207, -1, 209, 210, -1, -1, 369, -1, -1, 182, -1, -1, -1, -1, 187, 378, 223, -1, -1, 382, -1, -1, -1, -1, -1, -1, 324, -1, -1, 327, 328, -1, -1, -1, -1, -1, 209, 210, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 224, -1, -1, -1, -1, -1, -1, -1, 357, -1, -1, -1, -1, -1, -1, 461, -1, -1, 464, 465, 466, 435, 468, 469, 470, 471, 472, 473, 1449, 3997, -1, -1, 478, 257, -1, 182, -1, -1, -1, -1, 187, -1, -1, -1, -1, -1, -1, 271, -1, -1, 274, -1, -1, -1, -1, 4617, -1, -1, -1, -1, -1, -1, 209, 210, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 424, -1, 224, -1, -1, -1, -1, -1, -1, -1, -1, -1, 8, -1, -1, 11, -1, -1, 3728, 15, 16, 17, -1, -1, 1520, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 257, 32, -1, -1, -1, -1, -1, 3752, -1, 40, -1, -1, -1, -1, 271, 3760, 47, 274, 3763, -1, 3765, -1, -1, -1, -1, -1, -1, -1, 362, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 72, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 8, -1, 3807, 11, -1, -1, -1, 15, 16, 17, -1, -1, -1, -1, -1, 3820, -1, -1, 8, 3824, 3825, 11, 3827, -1, 32, 15, 16, 17, -1, -1, -1, -1, 40, -1, -1, -1, -1, -1, -1, 47, -1, -1, 32, -1, -1, 362, -1, -1, -1, -1, 40, -1, -1, -1, -1, -1, -1, 47, -1, -1, -1, -1, -1, -1, 72, -1, -1, 461, -1, -1, 464, 465, 466, -1, 468, 469, 470, 471, 472, 473, -1, -1, 72, -1, 478, -1, -1, -1, -1, -1, -1, 182, -1, -1, -1, -1, 187, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4246, -1, -1, -1, -1, -1, -1, -1, -1, -1, 209, 210, 4258, -1, 3927, -1, -1, 3930, -1, -1, -1, -1, -1, -1, -1, 224, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 461, -1, -1, 464, 465, 466, -1, 468, 469, 470, 471, 472, 473, -1, 4890, -1, -1, 478, -1, -1, -1, -1, 257, -1, -1, -1, -1, -1, -1, 1764, 182, -1, -1, -1, -1, 187, 271, -1, -1, 274, -1, -1, -1, -1, -1, -1, -1, -1, 182, -1, -1, -1, -1, 187, 626, -1, -1, 209, 210, -1, 632, -1, -1, 4012, 4013, 4014, -1, 4016, 4017, 4018, 4019, 4020, 224, 645, -1, 209, 210, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 661, 224, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 675, 676, 257, -1, -1, -1, -1, 682, -1, 684, 685, -1, -1, -1, -1, -1, 271, -1, -1, 274, 257, -1, -1, 698, 362, -1, -1, -1, -1, -1, -1, -1, -1, 708, 271, -1, -1, 274, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1890, -1, 1892, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1909, -1, 1911, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4471, -1, -1, 1927, 5069, 1929, -1, 1931, 4146, 1933, 4148, 1935, -1, -1, -1, 1939, -1, -1, -1, -1, -1, 362, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 797, 461, -1, 362, 464, 465, 466, -1, 468, 469, 470, 471, 472, 473, -1, -1, -1, -1, 478, -1, -1, -1, -1, -1, 821, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 834, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4571, -1, 4573, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 461, -1, -1, 464, 465, 466, -1, 468, 469, 470, 471, 472, 473, -1, -1, -1, -1, 478, 461, -1, -1, 464, 465, 466, -1, 468, 469, 470, 471, 472, 473, -1, -1, -1, -1, 478, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4314, 4315, -1, -1, -1, 942, -1, -1, -1, -1, -1, 4325, -1, 4327, 4328, -1, -1, 4331, -1, -1, -1, -1, -1, 960, -1, -1, -1, -1, -1, 966, -1, -1, 969, -1, -1, -1, -1, -1, -1, 8, -1, -1, 11, -1, -1, -1, 15, 16, 17, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 32, -1, -1, -1, -1, 2168, 2169, -1, 40, -1, -1, -1, -1, -1, -1, 47, -1, -1, 4395, -1, -1, -1, -1, -1, 2187, 2188, -1, -1, -1, 2192, 2193, -1, -1, -1, 2197, -1, -1, -1, -1, -1, 72, -1, -1, -1, -1, -1, -1, -1, 2211, -1, -1, -1, -1, -1, -1, 2218, 4433, -1, -1, 2222, 2223, -1, -1, 2226, 2227, -1, -1, -1, -1, -1, 2233, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2248, -1, 2250, -1, -1, -1, -1, -1, -1, -1, -1, 8, -1, -1, 11, 4477, -1, -1, 15, 16, 17, 2269, -1, -1, 5413, -1, 2274, -1, -1, -1, -1, -1, -1, 1118, -1, 32, -1, -1, -1, -1, 2288, -1, -1, 40, -1, -1, -1, -1, -1, 2297, 47, 1136, 2300, -1, -1, 2303, 2304, 2305, -1, -1, -1, -1, 2310, 2311, -1, 182, -1, -1, -1, 1154, 187, -1, 2320, -1, -1, 72, -1, 2325, -1, -1, -1, 2329, -1, -1, -1, -1, -1, -1, 5477, -1, -1, -1, 209, 210, -1, -1, -1, 2345, -1, 1184, -1, -1, -1, -1, 2352, 2353, 5495, 224, -1, -1, 2358, -1, -1, -1, -1, 1200, -1, -1, -1, -1, -1, 2369, 2370, -1, 200, -1, 2374, -1, -1, -1, -1, 1216, -1, 209, -1, 1220, -1, -1, 2386, -1, 257, 2389, -1, -1, -1, -1, 2394, 223, -1, -1, -1, 2399, 2400, -1, 271, 4617, 2404, 274, -1, 2407, -1, -1, -1, 2411, 2412, 2413, 2414, -1, 2416, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2429, 2430, -1, 2432, 182, -1, -1, -1, -1, 187, -1, -1, 8, 2442, 2443, 11, -1, 4660, -1, 15, 16, 17, -1, -1, -1, -1, 4669, -1, -1, -1, -1, 209, 210, -1, -1, -1, 32, -1, -1, -1, -1, -1, -1, -1, 40, -1, 224, -1, -1, -1, -1, 47, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 362, -1, -1, -1, -1, -1, -1, -1, 1338, -1, -1, 2504, 72, -1, -1, 257, 1346, 1347, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 271, 1360, -1, 274, -1, -1, -1, 22, -1, -1, 2532, -1, -1, 28, -1, 22, -1, -1, -1, -1, 35, 28, -1, -1, -1, -1, -1, -1, 35, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 54, -1, -1, -1, -1, 201, -1, -1, 54, -1, -1, -1, -1, -1, -1, 1413, 70, 213, -1, -1, -1, -1, -1, -1, 70, -1, -1, -1, 224, -1, -1, 461, -1, -1, 464, 465, 466, -1, 468, 469, 470, 471, 472, 473, -1, -1, -1, -1, 478, -1, 104, -1, 362, -1, 182, -1, -1, -1, 104, 187, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 124, -1, -1, -1, -1, -1, -1, 131, 124, -1, 134, 209, 210, -1, -1, 131, 5194, -1, 134, -1, -1, -1, -1, -1, -1, -1, 224, -1, -1, -1, -1, -1, -1, -1, -1, 159, -1, -1, -1, -1, -1, -1, -1, 159, -1, 4890, -1, -1, -1, 4894, -1, -1, -1, -1, -1, -1, -1, -1, -1, 257, -1, -1, -1, -1, -1, -1, 190, -1, -1, 193, -1, -1, -1, 271, 190, -1, 274, 193, -1, -1, -1, 461, -1, -1, 464, 465, 466, -1, 468, 469, 470, 471, 472, 473, -1, -1, -1, -1, 478, -1, -1, -1, 8, -1, 2735, 11, -1, -1, -1, 15, 16, 17, -1, -1, 238, -1, -1, 241, -1, -1, -1, -1, 238, -1, -1, 241, 32, -1, 252, -1, 254, -1, -1, -1, 40, -1, 252, -1, 254, 1607, 264, 47, -1, -1, -1, -1, -1, -1, 264, 273, -1, -1, -1, -1, -1, -1, -1, 273, -1, -1, 284, 285, -1, -1, 362, -1, 72, 626, 284, 285, -1, -1, -1, 632, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 645, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 324, -1, 661, 327, 328, 329, -1, -1, 324, -1, -1, 327, 328, 329, -1, -1, -1, 676, -1, -1, -1, -1, -1, -1, -1, 684, -1, 351, -1, -1, -1, -1, -1, 357, 5079, 351, -1, -1, 5083, 698, 5085, 357, -1, -1, 5089, 5090, -1, 371, -1, 708, -1, -1, -1, -1, -1, 371, -1, -1, -1, -1, -1, -1, -1, 461, -1, -1, 464, 465, 466, -1, 468, 469, 470, 471, 472, 473, 182, -1, -1, -1, 478, 187, -1, -1, -1, -1, -1, 1755, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 424, -1, -1, 209, 210, -1, -1, -1, 424, -1, -1, 1779, -1, -1, -1, -1, -1, -1, 224, 1787, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1799, -1, -1, -1, -1, -1, -1, 797, -1, -1, 607, -1, -1, -1, -1, -1, 613, -1, 2980, -1, 257, -1, 2984, -1, -1, -1, -1, -1, 2990, -1, -1, 821, -1, -1, 271, -1, -1, 274, -1, -1, -1, -1, -1, -1, 834, -1, 3008, 3009, -1, -1, -1, 3013, -1, -1, -1, -1, 3018, 3019, 3020, -1, 3022, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1870, 1871, 8, 1873, 1874, 11, -1, -1, -1, 15, 16, 17, 3045, -1, -1, 1885, -1, 1887, 1888, -1, -1, -1, 3055, 3056, 3057, 3058, 32, -1, -1, -1, 1900, 1901, -1, -1, 40, -1, -1, -1, -1, -1, -1, 47, -1, -1, -1, -1, 1916, -1, -1, -1, -1, -1, -1, -1, 362, -1, -1, -1, 3091, -1, -1, 3094, 3095, 3096, -1, -1, 72, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3112, 1950, 942, 5329, 1953, 1954, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3132, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 56, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 794, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 813, -1, 90, -1, -1, -1, -1, -1, 461, -1, -1, 464, 465, 466, -1, 468, 469, 470, 471, 472, 473, 5413, 835, -1, -1, 478, 3204, 2042, -1, -1, -1, 182, 120, -1, 3212, -1, 187, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 191, 192, -1, -1, 195, -1, -1, 209, 210, -1, 149, -1, 8, -1, 3243, 11, -1, 881, -1, 15, 16, 17, 224, -1, 215, -1, -1, -1, -1, -1, -1, 222, -1, -1, 5477, -1, 32, 3266, -1, -1, -1, -1, -1, -1, 40, 184, 2112, -1, -1, -1, -1, 47, 5495, -1, -1, 257, -1, -1, -1, -1, -1, 1118, -1, -1, -1, -1, -1, -1, -1, 271, -1, -1, 274, -1, -1, -1, 72, -1, -1, 1136, -1, 220, -1, -1, -1, -1, -1, -1, -1, 3318, -1, -1, -1, -1, 3323, -1, -1, 1154, -1, -1, -1, 2167, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 254, -1, -1, -1, 2185, -1, -1, -1, -1, 2190, 2191, -1, 1184, 3357, 2195, -1, -1, -1, -1, -1, -1, -1, 2203, -1, -1, -1, -1, 1006, 1200, -1, -1, 285, 286, -1, -1, -1, -1, -1, 292, -1, 2221, -1, -1, -1, 1216, 362, -1, -1, 1220, -1, -1, -1, 3396, -1, 3398, -1, 1035, 1036, 1037, -1, -1, -1, 2243, -1, -1, 2246, 2247, -1, -1, -1, 324, 182, -1, -1, 328, -1, 187, -1, 332, -1, -1, -1, -1, -1, -1, -1, 2267, 341, -1, -1, -1, -1, -1, -1, -1, 349, -1, -1, 209, 210, -1, -1, -1, 357, 3448, 2286, 2287, -1, -1, -1, -1, -1, -1, 224, -1, 369, -1, -1, -1, -1, -1, -1, -1, -1, 378, -1, -1, -1, 382, -1, -1, -1, -1, -1, -1, -1, -1, 2318, 2319, -1, -1, 2322, -1, -1, 461, -1, 257, 464, 465, 466, -1, 468, 469, 470, 471, 472, 473, -1, -1, 476, 271, -1, -1, 2344, -1, 2346, 1338, -1, -1, -1, 2351, -1, -1, -1, 1346, 1347, 2357, -1, -1, -1, -1, 435, -1, 2364, -1, -1, -1, 2368, 1360, -1, -1, 8, 2373, -1, 11, -1, -1, -1, 15, 16, 17, -1, -1, -1, 1183, -1, -1, -1, -1, -1, -1, -1, 2393, -1, -1, 32, -1, 2398, -1, 36, -1, 2402, -1, 40, 2405, -1, -1, 1206, -1, -1, 47, -1, -1, -1, 2415, -1, 1215, -1, -1, -1, -1, 1413, -1, -1, -1, -1, -1, 2428, -1, -1, 671, 362, -1, -1, -1, 72, -1, 2438, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 697, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3647, 121, 3649, -1, -1, -1, 615, -1, 617, 3656, -1, -1, 621, -1, -1, -1, -1, -1, -1, 2503, -1, -1, -1, -1, -1, 3672, 635, -1, -1, -1, -1, -1, -1, 642, -1, -1, -1, -1, -1, -1, -1, 3688, -1, -1, -1, -1, -1, 461, -1, -1, 464, 465, 466, -1, 468, 469, 470, 471, 472, 473, 3707, -1, 182, -1, -1, -1, -1, 187, -1, -1, 1352, -1, -1, -1, -1, -1, -1, -1, 3725, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3735, 209, 210, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2584, -1, -1, -1, 224, -1, -1, 3754, -1, -1, -1, -1, -1, -1, -1, -1, 1398, -1, -1, -1, 3767, 3768, 3769, -1, -1, -1, -1, 3774, 3775, 3776, 3777, -1, 1607, -1, 3781, 3782, -1, 257, -1, -1, 3787, 3788, -1, 3790, 3791, 3792, 3793, 3794, 3795, -1, 3797, 271, -1, -1, 274, 2639, -1, -1, 8, 3806, -1, 11, 3809, 3810, -1, 15, 16, 17, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 32, -1, -1, -1, 3833, -1, -1, -1, 40, -1, -1, -1, -1, -1, -1, 47, 1480, 2683, -1, -1, -1, -1, -1, 3852, -1, -1, 1490, -1, -1, -1, -1, -1, -1, -1, -1, 2701, -1, -1, -1, -1, 72, -1, -1, 2709, -1, -1, -1, -1, -1, -1, 956, -1, -1, 2719, -1, -1, 2722, 1521, -1, 2725, 362, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 981, -1, -1, -1, -1, 1544, -1, -1, 1547, -1, -1, -1, -1, -1, -1, 996, -1, -1, -1, -1, 886, 887, -1, 1755, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 421, -1, -1, 1779, 3952, -1, 2791, -1, -1, -1, -1, 1787, 2797, -1, 1597, -1, -1, -1, -1, -1, -1, -1, -1, 1799, -1, -1, -1, -1, 1611, -1, -1, 182, -1, -1, -1, -1, 187, -1, -1, -1, 461, -1, -1, 464, 465, 466, -1, 468, 469, 470, 471, 472, 473, 4001, -1, -1, 1081, -1, 209, 210, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 224, 984, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2873, -1, -1, -1, -1, -1, -1, -1, -1, 1873, 1874, -1, -1, -1, -1, 1013, 1014, -1, 257, -1, -1, -1, -1, 1887, -1, -1, -1, -1, -1, -1, -1, -1, 271, -1, -1, 274, 1900, 1901, -1, -1, -1, 1039, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1722, 1916, -1, -1, -1, -1, -1, -1, -1, 299, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2952, 2953, -1, -1, -1, -1, 1198, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1773, -1, -1, -1, 2979, -1, -1, 2982, -1, -1, -1, -1, -1, 1113, 1114, -1, -1, -1, -1, -1, -1, 362, -1, -1, -1, -1, -1, -1, -1, 1802, -1, -1, -1, -1, -1, -1, 1809, -1, 379, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4199, -1, -1, -1, 4203, 4204, 4205, 4206, -1, -1, 4209, -1, -1, -1, -1, 2042, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3067, 3068, 3069, -1, -1, -1, -1, -1, -1, -1, -1, 4241, 4242, 4243, -1, 4245, -1, 4247, 4248, -1, -1, -1, -1, 3090, -1, -1, -1, -1, 461, 4259, 4260, 464, 465, 466, 1341, 468, 469, 470, 471, 472, 473, -1, -1, 3110, -1, -1, -1, -1, -1, 1914, -1, -1, -1, -1, 2112, -1, 4286, -1, -1, -1, 1925, -1, 3129, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4309, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1956, 1957, -1, -1, -1, -1, -1, -1, -1, 1407, -1, -1, -1, -1, -1, -1, 25, 1973, 2167, -1, -1, -1, -1, -1, 8, -1, -1, 11, -1, -1, -1, 15, 16, 17, -1, -1, 2185, -1, -1, -1, -1, 2190, 2191, -1, -1, -1, 2195, -1, 32, -1, -1, 35, -1, 3211, 2203, -1, 40, -1, -1, -1, -1, -1, -1, 47, 73, -1, -1, 4388, -1, -1, -1, -1, 2221, -1, -1, -1, 1474, -1, -1, 88, -1, -1, -1, -1, -1, -1, -1, -1, 72, -1, -1, -1, -1, -1, -1, -1, -1, 106, -1, -1, 3258, -1, -1, 112, -1, -1, -1, 3265, -1, 3267, -1, -1, -1, -1, -1, -1, 2072, 1515, 2267, -1, 129, -1, 3280, -1, 3282, 4446, 2082, -1, -1, -1, -1, 140, -1, -1, -1, -1, -1, 2286, 2287, 148, -1, -1, -1, -1, -1, -1, 3304, -1, -1, -1, 1548, 160, -1, -1, -1, 2111, 165, -1, -1, -1, -1, -1, -1, 172, -1, -1, 2122, 2123, -1, 2318, 2319, -1, -1, 2322, -1, -1, -1, -1, -1, -1, -1, -1, 191, -1, -1, 1468, -1, -1, -1, -1, 3348, -1, -1, -1, -1, 2344, -1, 2346, 182, -1, 2156, -1, 2351, 187, -1, -1, -1, 216, 2357, -1, 1493, -1, -1, -1, -1, 2364, -1, -1, -1, 2368, -1, -1, -1, -1, 2373, 209, 210, -1, 237, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 224, 3399, -1, -1, 2393, -1, 4567, -1, -1, 2398, -1, -1, -1, 2402, -1, -1, 2405, -1, -1, -1, -1, -1, 271, -1, -1, -1, 2415, -1, -1, 3427, -1, -1, -1, 257, -1, -1, -1, -1, -1, 2428, -1, -1, -1, -1, -1, -1, 295, 271, -1, 2438, 274, 3449, -1, -1, 3452, -1, 305, 306, 4619, -1, 309, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1593, 1594, 1595, 1596, -1, -1, 4637, -1, -1, -1, -1, 4642, 4643, -1, -1, -1, 335, 1725, -1, 338, -1, 671, -1, 342, -1, 344, -1, -1, -1, -1, -1, -1, 351, 2299, 1742, 354, -1, -1, -1, -1, -1, -1, -1, -1, 2503, -1, -1, 697, -1, 2315, -1, -1, 1760, -1, 373, -1, -1, -1, -1, -1, -1, 380, -1, 4694, 3532, -1, 385, 386, 362, 2335, 389, -1, -1, -1, 393, -1, -1, -1, -1, -1, -1, -1, -1, 4714, 403, 4716, -1, -1, -1, 408, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4731, 420, -1, -1, -1, -1, -1, -1, 1816, -1, -1, -1, -1, -1, 433, -1, -1, -1, -1, -1, 4751, 1829, -1, -1, -1, 2584, -1, -1, -1, -1, -1, -1, -1, 1841, -1, -1, -1, 4768, -1, -1, -1, 1734, 1735, 2409, 2410, 1853, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1754, -1, -1, -1, -1, -1, 461, -1, -1, 464, 465, 466, -1, 468, 469, 470, 471, 472, 473, 2639, -1, -1, -1, -1, -1, -1, -1, -1, 1897, 1898, -1, -1, -1, -1, -1, 1789, 1790, 1791, 1792, -1, -1, -1, 3671, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4849, -1, 791, 792, -1, -1, 2683, 8, -1, -1, 11, 4860, -1, -1, 15, 16, 17, -1, -1, -1, -1, 671, -1, -1, 2701, -1, -1, -1, -1, -1, 2514, 32, 2709, -1, -1, -1, 3722, -1, -1, 40, -1, 3727, -1, 3729, -1, -1, 47, 697, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3751, -1, -1, -1, -1, -1, 72, 940, -1, 4923, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3770, -1, -1, -1, 956, -1, -1, -1, -1, -1, -1, 1906, -1, -1, -1, -1, 3786, 1912, -1, 3789, -1, -1, -1, -1, -1, -1, -1, 2037, -1, 981, 2791, -1, -1, -1, -1, -1, 2797, -1, -1, -1, -1, -1, -1, -1, 996, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4990, -1, -1, -1, 4994, -1, -1, -1, -1, -1, 940, 941, -1, -1, 8, 157, -1, 11, -1, -1, -1, 15, 16, 17, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 32, -1, 182, 35, -1, -1, -1, 187, 40, -1, -1, -1, -1, 3878, 3879, 47, -1, 2873, -1, -1, -1, 5049, -1, 3888, -1, -1, -1, -1, -1, 209, 210, -1, -1, -1, 1081, -1, 5064, -1, -1, -1, 72, -1, 3907, -1, 224, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2045, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2174, -1, -1, -1, 2178, 2179, -1, -1, 257, -1, -1, 5108, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 271, -1, -1, 274, 5123, 2952, 2953, -1, -1, -1, 8, -1, -1, 11, -1, -1, -1, 15, 16, 17, -1, -1, -1, -1, -1, -1, 297, -1, -1, -1, -1, -1, 2979, -1, 32, 2982, 956, -1, -1, -1, -1, 3997, 40, -1, 2240, -1, -1, -1, -1, 47, -1, -1, -1, -1, -1, -1, -1, -1, 2254, 182, 1198, 981, -1, -1, 187, -1, -1, -1, -1, -1, -1, -1, -1, -1, 72, -1, 996, -1, -1, -1, -1, -1, -1, -1, -1, -1, 209, 210, 5207, -1, -1, 362, -1, -1, -1, -1, -1, -1, -1, 2295, -1, 224, -1, -1, 2858, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3067, 3068, 3069, -1, -1, -1, -1, 2881, -1, -1, -1, -1, 5251, -1, 257, -1, -1, -1, -1, -1, -1, -1, -1, 3090, -1, -1, -1, -1, 271, -1, -1, 274, -1, -1, -1, -1, -1, 2238, 2239, -1, -1, 1081, -1, 3110, -1, -1, -1, -1, 2249, -1, 2251, -1, -1, 1232, 2255, -1, -1, -1, -1, -1, -1, -1, 3129, -1, 182, -1, -1, -1, -1, 187, 461, -1, -1, 464, 465, 466, -1, 468, 469, 470, 471, 472, 473, 1262, -1, -1, -1, -1, -1, -1, -1, 209, 210, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5342, -1, -1, 224, -1, -1, -1, -1, 1290, 1291, 1292, -1, 1294, -1, -1, -1, 362, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4208, -1, -1, 1314, -1, 4213, -1, 257, -1, -1, -1, -1, 3211, -1, -1, -1, -1, 1407, -1, -1, -1, 271, -1, -1, 274, -1, 1198, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4246, -1, -1, -1, -1, 293, -1, -1, 2494, -1, -1, -1, 4258, -1, 2385, -1, -1, 2388, -1, -1, -1, 3258, -1, -1, -1, -1, -1, -1, 3265, -1, 3267, -1, -1, 1382, -1, -1, -1, 1386, 1387, 4285, -1, -1, -1, 3280, -1, 3282, 1474, -1, 461, -1, -1, 464, 465, 466, -1, 468, 469, 470, 471, 472, 473, -1, -1, -1, 3108, -1, -1, 3304, -1, -1, -1, -1, -1, -1, 362, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1515, -1, -1, 2576, -1, -1, 2579, -1, -1, 2467, -1, -1, -1, -1, -1, -1, -1, 2475, -1, -1, 2478, -1, -1, -1, 3348, -1, 2484, -1, -1, -1, -1, -1, -1, 1548, -1, -1, -1, 2495, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4382, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3399, -1, -1, 2536, -1, -1, -1, -1, -1, -1, -1, 461, -1, -1, 464, 465, 466, -1, 468, 469, 470, 471, 472, 473, -1, -1, -1, -1, 3427, -1, -1, 2564, 1622, 1623, 1624, 1407, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3449, 2699, -1, 3452, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4471, -1, 3271, 3272, 3273, 2716, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3288, 2731, -1, -1, -1, -1, -1, 2622, -1, 2624, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1474, -1, -1, 3311, -1, -1, -1, -1, -1, 1622, 1623, 1624, -1, 3321, 3322, -1, -1, -1, 3326, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3532, -1, 1725, -1, -1, -1, -1, -1, -1, -1, 1515, -1, -1, -1, -1, -1, -1, -1, -1, 1742, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4571, -1, 4573, -1, -1, -1, -1, 1760, -1, -1, -1, -1, -1, 1548, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2734, -1, -1, -1, -1, -1, -1, -1, -1, 4618, -1, -1, -1, -1, -1, -1, -1, -1, 4627, -1, -1, -1, -1, -1, -1, 1816, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1829, -1, 3447, -1, -1, 3450, -1, -1, -1, -1, -1, -1, 1841, -1, -1, -1, -1, -1, 4665, -1, -1, -1, -1, 4670, 1853, -1, -1, -1, -1, -1, -1, -1, -1, 3671, -1, -1, -1, -1, -1, -1, 2927, -1, -1, 2930, -1, 2932, -1, -1, -1, -1, 2937, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1897, 1898, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3722, -1, -1, -1, -1, 3727, -1, 3729, -1, -1, -1, -1, -1, -1, -1, 2986, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3751, 1725, -1, -1, -1, 3005, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1742, 3770, 3578, 3579, 3580, -1, -1, -1, -1, -1, -1, -1, 3030, -1, -1, -1, -1, 3786, 1760, -1, 3789, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1816, 4853, -1, 2037, -1, -1, -1, -1, 3100, -1, 3102, -1, -1, 1829, -1, 2992, -1, 2994, 2995, 2996, -1, -1, -1, -1, -1, 1841, 4878, -1, -1, -1, -1, -1, -1, -1, -1, 3878, 3879, 1853, 4890, -1, 1995, 2075, -1, -1, -1, 3888, -1, -1, -1, -1, -1, -1, -1, 2008, -1, 2010, -1, -1, 2013, 2014, 2015, -1, -1, -1, 3907, 2020, -1, -1, 2023, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1897, 1898, 2038, 2039, 2040, 2041, -1, -1, -1, -1, 2046, -1, -1, -1, 2050, -1, -1, 2053, 3191, -1, 2056, 2057, 2058, 2059, 2060, 2061, 2062, 2063, 2064, -1, 2066, -1, -1, -1, -1, -1, -1, 2073, -1, 2075, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3230, -1, 2174, -1, -1, -1, 2178, 2179, -1, -1, -1, -1, 8, -1, -1, 11, 3997, -1, -1, 15, 16, 17, -1, -1, -1, 2118, -1, -1, -1, 3259, -1, -1, -1, -1, -1, -1, 32, -1, -1, -1, -1, -1, -1, -1, 40, -1, -1, -1, -1, 2142, 2143, 47, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3849, -1, -1, -1, -1, -1, -1, 2240, -1, -1, -1, 3860, -1, -1, -1, 72, -1, -1, -1, -1, -1, 2254, 2037, -1, -1, -1, 5077, -1, 5079, -1, -1, -1, -1, -1, -1, -1, -1, 3328, -1, -1, -1, -1, 3891, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3231, -1, -1, 3349, -1, -1, -1, 2295, -1, -1, 671, -1, -1, -1, -1, 2224, -1, 3363, -1, -1, 3924, -1, -1, -1, -1, -1, -1, -1, -1, -1, 671, -1, -1, -1, -1, -1, 697, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 163, -1, -1, -1, -1, 697, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3972, -1, 182, -1, -1, -1, 5180, 187, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5194, -1, -1, -1, -1, -1, -1, -1, -1, 209, 210, -1, -1, -1, 5208, -1, 2174, -1, -1, -1, 2178, 2179, -1, 4208, 224, -1, -1, 5221, 4213, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3475, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 257, -1, -1, -1, 4246, 3496, -1, -1, -1, -1, -1, -1, -1, -1, 271, -1, 4258, 274, -1, -1, -1, -1, -1, -1, 2457, 2240, -1, 3403, -1, -1, 3521, -1, -1, 5284, 5285, -1, -1, -1, -1, 2254, -1, -1, -1, 4285, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4106, 4107, 4108, 4109, 2494, -1, -1, 3555, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5329, -1, 2295, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2455, 2456, 2457, -1, 362, -1, 2461, -1, -1, -1, -1, -1, -1, -1, -1, -1, 8, -1, -1, 11, -1, -1, -1, 15, 16, 17, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3628, -1, 2493, 4382, 32, -1, 2576, 35, -1, 2579, -1, -1, 40, 956, -1, -1, -1, -1, -1, 47, -1, -1, -1, -1, -1, 5413, -1, -1, -1, -1, -1, -1, -1, 956, -1, -1, -1, -1, 981, -1, -1, -1, -1, -1, 72, -1, -1, -1, -1, -1, -1, -1, -1, 996, -1, -1, -1, -1, 981, -1, -1, -1, -1, -1, -1, -1, -1, 461, -1, -1, 464, 465, 466, 996, 468, 469, 470, 471, 472, 473, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5477, -1, -1, 4471, -1, -1, -1, -1, -1, -1, -1, 3728, -1, -1, -1, -1, -1, -1, 5495, -1, 5497, 5498, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3752, -1, -1, -1, -1, 2699, -1, -1, -1, -1, -1, -1, -1, -1, 1081, -1, -1, -1, 2494, -1, -1, -1, 2716, -1, 3661, 3662, 3663, 3664, -1, -1, 182, -1, -1, -1, 1081, 187, -1, 2731, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 209, 210, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4571, -1, 4573, -1, 224, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2576, -1, -1, 2579, -1, 257, -1, -1, -1, -1, -1, 671, -1, -1, -1, 4618, -1, -1, -1, 271, -1, -1, 274, -1, -1, -1, -1, 2742, 4438, -1, 3882, 1198, 2747, -1, -1, -1, -1, 697, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1198, -1, -1, -1, -1, -1, 2772, -1, -1, -1, -1, 4665, -1, -1, -1, -1, -1, 2783, -1, 2785, 2786, -1, -1, -1, -1, -1, -1, 3930, -1, -1, 2796, 3934, -1, 2799, -1, 2801, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3836, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 362, -1, -1, -1, 3851, 2830, -1, 2832, -1, 2834, -1, -1, -1, 2699, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2927, -1, -1, 2930, -1, 2932, -1, 2716, 8, -1, 2937, 11, -1, -1, -1, 15, 16, 17, -1, -1, -1, -1, 2731, -1, -1, -1, -1, -1, -1, -1, -1, -1, 32, -1, -1, -1, -1, -1, -1, -1, 40, 2889, -1, -1, -1, -1, -1, 47, -1, -1, -1, -1, -1, -1, -1, -1, 2904, -1, -1, 2986, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 72, -1, -1, -1, 461, -1, 3005, 464, 465, 466, -1, 468, 469, 470, 471, 472, 473, -1, -1, -1, 4077, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4087, 3030, -1, -1, -1, 1407, -1, -1, 2958, -1, -1, -1, -1, -1, -1, 4853, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1407, -1, -1, 4673, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4878, -1, -1, 4688, -1, -1, -1, -1, 4693, -1, -1, -1, 4890, -1, -1, -1, -1, -1, -1, -1, -1, 956, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3100, 1474, 3102, 4719, -1, -1, -1, -1, -1, 182, -1, -1, -1, -1, 187, 981, -1, -1, -1, -1, -1, 1474, -1, -1, -1, -1, -1, -1, -1, -1, 996, -1, -1, 4191, -1, -1, 209, 210, -1, -1, -1, -1, 1515, -1, -1, 2927, -1, -1, 2930, -1, 2932, 224, -1, -1, -1, 2937, -1, -1, -1, -1, -1, -1, 1515, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4230, -1, -1, 1548, -1, -1, -1, -1, -1, -1, -1, -1, 257, -1, -1, -1, -1, -1, -1, 3191, -1, 4251, -1, 1548, -1, -1, 271, -1, -1, 274, -1, -1, 2986, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1081, 3216, -1, -1, -1, -1, -1, 3222, 3005, -1, -1, -1, -1, 4844, -1, 3230, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3030, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4316, 3259, -1, -1, -1, -1, -1, -1, -1, -1, 5077, -1, 5079, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 362, -1, -1, -1, -1, -1, 3216, -1, -1, -1, -1, -1, 3222, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3100, -1, 3102, 394, -1, -1, -1, 4941, -1, -1, 3328, -1, -1, -1, 1198, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3349, -1, -1, 1725, 4296, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3363, -1, -1, -1, -1, 4311, 1742, -1, 5180, 1725, -1, -1, -1, -1, -1, 4436, -1, -1, -1, -1, -1, -1, 5194, -1, 1760, 461, 1742, -1, 464, 465, 466, -1, 468, 469, 470, 471, 472, 473, -1, -1, -1, -1, -1, -1, 1760, -1, 3191, -1, -1, 5221, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4493, -1, -1, -1, -1, -1, -1, -1, 1816, 671, -1, -1, -1, 3230, -1, -1, -1, -1, -1, -1, -1, 1829, -1, -1, 4402, -1, -1, -1, 1816, -1, -1, -1, -1, 1841, -1, 697, -1, -1, -1, -1, 3475, 1829, 3259, -1, -1, 1853, -1, -1, -1, -1, -1, -1, -1, 1841, -1, -1, -1, -1, -1, -1, -1, 3496, -1, -1, -1, 1853, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5329, 3521, -1, -1, 1897, 1898, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1407, -1, -1, 1897, 1898, 3328, -1, -1, -1, -1, 3472, -1, -1, -1, 3555, -1, -1, -1, 4617, 3481, -1, -1, -1, -1, -1, 3487, 3349, 3489, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3363, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3516, 3517, -1, -1, -1, -1, -1, -1, -1, 5413, -1, -1, -1, 1474, -1, -1, -1, -1, 3534, -1, -1, -1, -1, -1, -1, -1, 3542, -1, -1, 3545, -1, 3547, -1, 3628, -1, -1, -1, -1, -1, -1, 3556, 4579, 4580, 4581, -1, -1, -1, -1, 3564, 3565, -1, -1, -1, -1, 1515, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2037, -1, -1, -1, 5477, -1, 8, -1, -1, 11, -1, 3596, -1, 15, 16, 17, -1, -1, 1548, 4741, 2037, -1, 5495, -1, -1, -1, -1, -1, -1, 3475, 32, -1, -1, 35, -1, -1, 3621, -1, 40, -1, -1, -1, -1, -1, -1, 47, -1, -1, -1, -1, 3496, -1, -1, 4775, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3728, 956, -1, -1, -1, -1, 72, -1, -1, -1, -1, 3521, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3752, -1, 981, -1, 4814, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 996, -1, -1, -1, 3555, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4737, -1, -1, -1, -1, -1, -1, 2174, -1, 4861, 8, 2178, 2179, 11, 4866, 4867, -1, 15, 16, 17, -1, -1, -1, -1, -1, -1, -1, 2174, -1, -1, -1, 2178, 2179, -1, 32, -1, -1, -1, -1, -1, -1, -1, 40, -1, -1, -1, -1, -1, -1, 47, 182, -1, 3628, -1, -1, 187, -1, -1, -1, -1, 1081, -1, -1, -1, -1, 1725, -1, -1, -1, -1, -1, -1, -1, 2240, 72, -1, -1, 209, 210, -1, -1, -1, 1742, -1, -1, -1, -1, 2254, 3882, -1, -1, -1, 224, 2240, -1, -1, -1, -1, -1, -1, 1760, -1, -1, -1, -1, -1, -1, 2254, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 257, -1, -1, 2295, -1, -1, 4983, -1, -1, -1, -1, 3930, -1, -1, 271, 3934, -1, 274, -1, -1, 4882, -1, 4884, 2295, -1, -1, -1, 3728, -1, -1, -1, 1816, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1829, -1, -1, -1, -1, -1, -1, 3752, 1198, -1, -1, -1, 1841, -1, -1, 182, -1, -1, -1, -1, 187, -1, -1, -1, 1853, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 209, 210, -1, -1, -1, -1, -1, -1, -1, 3935, 3936, -1, -1, -1, -1, 224, -1, -1, -1, 362, -1, -1, -1, -1, -1, -1, 1897, 1898, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 671, -1, -1, -1, -1, -1, -1, -1, 257, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3986, -1, 271, -1, -1, 274, 697, -1, -1, -1, -1, -1, 4077, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4087, -1, -1, -1, -1, -1, -1, -1, -1, 5039, -1, -1, -1, 3882, 4022, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4033, -1, -1, -1, -1, -1, -1, -1, -1, 2494, -1, 461, -1, 5183, 464, 465, 466, -1, 468, 469, 470, 471, 472, 473, -1, -1, -1, -1, -1, 2494, -1, -1, -1, -1, -1, -1, 3930, -1, -1, -1, 3934, 4074, 4075, -1, -1, -1, 362, -1, 4081, 4082, -1, -1, -1, 4086, -1, -1, -1, -1, 4091, 2037, -1, 4094, 4095, 5118, -1, -1, 4099, -1, 1407, -1, -1, -1, 4105, -1, -1, -1, -1, -1, -1, 4191, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2576, -1, -1, 2579, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2576, -1, -1, 2579, -1, -1, -1, 4230, -1, -1, -1, -1, -1, 4157, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1474, -1, -1, -1, 4251, 4173, -1, -1, -1, -1, 461, -1, -1, 464, 465, 466, -1, 468, 469, 470, 471, 472, 473, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5223, -1, -1, -1, -1, -1, -1, -1, 1515, -1, -1, -1, -1, -1, -1, 4077, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4087, -1, -1, 2174, -1, -1, -1, 2178, 2179, -1, -1, 4316, -1, -1, -1, -1, 1548, -1, -1, -1, -1, 2699, -1, -1, -1, 956, 20, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2716, -1, -1, 2699, -1, 37, -1, -1, -1, -1, 4274, -1, 981, -1, -1, 2731, -1, -1, -1, -1, 2716, -1, -1, -1, -1, -1, -1, 996, 60, -1, -1, 2240, -1, -1, -1, 2731, -1, 5323, -1, -1, -1, 73, -1, -1, -1, 2254, -1, -1, -1, -1, -1, -1, 84, -1, -1, -1, 88, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4191, -1, -1, 5355, 5356, -1, -1, -1, 106, -1, -1, -1, -1, 4343, 112, -1, -1, -1, -1, -1, 2295, -1, -1, -1, -1, 4434, -1, 4436, -1, -1, -1, 129, -1, -1, -1, -1, -1, -1, -1, 4230, -1, -1, 140, -1, -1, -1, 1081, -1, -1, -1, 148, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4251, -1, 160, -1, -1, -1, -1, -1, -1, -1, 168, -1, -1, -1, 172, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4493, -1, -1, -1, -1, 1725, -1, -1, -1, 191, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1742, 5459, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1760, 4316, -1, -1, -1, -1, 228, -1, -1, -1, -1, -1, -1, -1, -1, 237, -1, -1, -1, -1, -1, 2927, -1, -1, 2930, -1, 2932, -1, -1, -1, -1, 2937, -1, -1, -1, -1, -1, -1, -1, 1198, -1, 2927, -1, -1, 2930, -1, 2932, -1, -1, 271, -1, 2937, 274, -1, -1, -1, 1816, -1, -1, -1, -1, -1, -1, -1, 4518, 4519, -1, -1, 4522, 1829, -1, -1, -1, 295, -1, -1, -1, -1, -1, -1, 2986, 1841, -1, -1, 4617, -1, -1, 309, -1, -1, -1, -1, -1, 1853, 316, 2494, -1, -1, -1, 3005, 2986, -1, -1, -1, -1, 4559, 4560, -1, -1, -1, -1, -1, -1, 335, -1, -1, -1, -1, -1, 3005, -1, 4436, 344, -1, 3030, -1, -1, -1, -1, 351, -1, -1, 354, -1, -1, -1, -1, 1897, 1898, -1, -1, -1, -1, -1, 3030, -1, -1, -1, -1, -1, -1, 373, -1, -1, -1, -1, -1, -1, 380, -1, -1, -1, -1, -1, 386, -1, -1, 389, 390, -1, 392, 393, -1, -1, -1, -1, -1, 2576, 4493, -1, 2579, 403, -1, -1, -1, -1, 408, -1, -1, -1, -1, -1, 414, -1, 3100, 417, 3102, -1, 420, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4741, -1, -1, 433, -1, -1, 3100, -1, 3102, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4775, -1, -1, -1, -1, -1, 1407, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2037, -1, -1, -1, 4814, -1, -1, -1, 3191, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2699, -1, 4617, -1, -1, 3191, -1, -1, -1, -1, 4764, -1, -1, -1, -1, 1474, -1, 2716, -1, -1, -1, -1, -1, 4777, 3230, -1, -1, -1, 4861, -1, -1, -1, 2731, 4866, 4867, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3230, -1, -1, -1, -1, -1, 4804, -1, -1, 3259, -1, -1, 1515, -1, -1, -1, -1, -1, -1, -1, 4818, -1, -1, -1, -1, -1, -1, -1, -1, 3259, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1548, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2174, -1, -1, 4871, 2178, 2179, -1, -1, 3328, -1, -1, -1, 4741, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3328, 3349, -1, -1, -1, -1, -1, 4982, 4983, -1, -1, -1, -1, -1, -1, 3363, 4912, -1, 4775, -1, -1, 3349, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3363, -1, -1, 2240, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2254, -1, 20, -1, -1, 4814, -1, 25, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2927, -1, -1, 2930, -1, 2932, -1, 2295, 60, -1, 2937, -1, -1, -1, -1, -1, -1, -1, 4861, -1, -1, 73, -1, 4866, 4867, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 88, -1, 1725, -1, -1, 3475, -1, -1, -1, -1, -1, -1, -1, -1, 5032, -1, -1, -1, 106, 1742, -1, -1, -1, 2986, -1, 3475, 3496, -1, -1, -1, -1, -1, -1, -1, 5052, -1, -1, 1760, -1, -1, -1, 129, 3005, -1, -1, -1, 3496, -1, 20, -1, -1, 3521, 140, 25, -1, -1, -1, -1, -1, -1, 148, -1, -1, -1, -1, -1, -1, 3030, -1, -1, -1, 3521, 160, -1, -1, -1, -1, 165, -1, -1, -1, -1, -1, -1, 172, 3555, 5183, -1, 60, -1, -1, -1, -1, 1816, -1, -1, -1, -1, -1, -1, -1, 73, 74, 191, 4983, 3555, 1829, -1, -1, -1, -1, 5129, 84, -1, -1, -1, 88, -1, 1841, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1853, -1, -1, -1, 106, -1, -1, 3100, -1, 3102, -1, -1, -1, -1, -1, -1, -1, -1, -1, 237, -1, -1, 5170, 5171, 5172, -1, -1, 129, 3628, -1, -1, -1, -1, -1, -1, -1, -1, -1, 140, -1, 2494, 5189, -1, -1, 1897, 1898, 148, -1, 3628, -1, -1, -1, -1, 271, -1, -1, -1, -1, 160, -1, -1, -1, -1, 165, -1, -1, 284, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 295, -1, -1, -1, -1, -1, -1, -1, -1, -1, 305, 306, 191, -1, 309, -1, -1, -1, -1, -1, -1, 3191, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 216, -1, -1, 335, -1, 5267, 338, -1, 2576, -1, 342, 2579, 344, -1, 3728, -1, -1, -1, -1, 351, -1, 237, 354, 3230, -1, -1, -1, 5289, -1, -1, -1, -1, -1, -1, 3728, -1, -1, -1, 3752, -1, -1, 373, -1, -1, -1, -1, -1, -1, 380, -1, -1, -1, 3259, -1, 386, 271, -1, 389, 3752, -1, 5183, 393, -1, -1, -1, -1, -1, -1, -1, 401, 2037, 403, -1, -1, -1, -1, 408, -1, -1, 295, -1, -1, -1, -1, -1, -1, -1, -1, 420, 305, 306, -1, -1, 309, -1, -1, -1, -1, -1, -1, -1, 433, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 335, -1, 3328, 338, -1, -1, -1, 342, -1, 344, -1, -1, 2699, -1, -1, -1, 351, -1, 5399, 354, -1, -1, -1, 3349, -1, -1, -1, -1, -1, 2716, -1, -1, -1, -1, -1, -1, -1, 3363, 373, -1, -1, -1, -1, -1, 2731, 380, -1, -1, -1, 3882, -1, 386, -1, 5434, 389, -1, -1, -1, 393, -1, -1, -1, -1, 5444, -1, -1, 401, -1, 403, 3882, -1, -1, -1, 408, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2174, -1, -1, -1, 2178, 2179, -1, -1, -1, 3930, 433, -1, -1, 3934, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3930, -1, -1, -1, 3934, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1306, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3475, -1, -1, -1, -1, 2240, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2254, -1, 3496, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3521, 1364, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2295, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3555, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2927, -1, -1, 2930, 4077, 2932, -1, -1, -1, -1, 2937, -1, -1, -1, 4087, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4077, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4087, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2986, -1, -1, 3628, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3005, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3030, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4191, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4191, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4230, -1, -1, -1, -1, 3728, -1, -1, -1, -1, -1, 2494, -1, -1, -1, -1, 3100, -1, 3102, -1, 4230, 4251, -1, -1, -1, -1, -1, -1, -1, 3752, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4251, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1628, -1, -1, -1, 1632, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4316, -1, -1, -1, -1, -1, -1, 2576, -1, -1, 2579, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4316, 3191, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3230, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3882, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3259, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4436, 3930, -1, -1, -1, 3934, -1, -1, -1, -1, 2699, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4436, -1, -1, -1, -1, -1, -1, 2716, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3328, -1, -1, -1, 2731, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4493, -1, 3349, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3363, -1, -1, -1, 4493, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4077, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4087, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4617, -1, -1, -1, 3475, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4617, -1, -1, -1, -1, 3496, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1993, -1, -1, -1, -1, -1, -1, -1, -1, 3521, -1, -1, -1, -1, 2007, -1, 2927, -1, 2011, 2930, -1, 2932, -1, -1, -1, -1, 2937, -1, -1, -1, -1, -1, 2025, 2026, 2027, -1, 2029, -1, -1, -1, 4191, -1, -1, 3555, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2986, -1, -1, 2071, 4230, -1, -1, -1, 4741, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3005, -1, -1, -1, -1, -1, 4251, -1, -1, 4741, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3628, 4775, -1, 3030, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2129, 4775, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2141, -1, -1, -1, -1, 2146, -1, -1, 4814, -1, -1, -1, -1, -1, -1, -1, -1, 4316, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4814, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3100, -1, 3102, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4861, -1, -1, -1, -1, 4866, 4867, -1, -1, -1, -1, -1, -1, 3728, -1, -1, -1, -1, -1, -1, 4861, -1, -1, -1, -1, 4866, 4867, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3752, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3191, -1, -1, -1, -1, 4436, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3230, -1, -1, -1, -1, -1, 4983, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4493, -1, -1, 4983, -1, -1, 3259, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3882, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3328, 3930, -1, -1, -1, 3934, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3349, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3363, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4617, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5183, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5183, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3475, 4077, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4087, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3496, -1, -1, -1, -1, 4741, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3521, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4775, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3555, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4814, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4191, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4861, -1, -1, -1, -1, 4866, 4867, 3628, 4230, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4251, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2745, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2765, -1, 2767, -1, -1, 2770, 2771, -1, 2773, -1, 2775, -1, -1, -1, 2779, -1, -1, 2782, -1, -1, -1, -1, 2787, -1, -1, -1, -1, -1, 2793, -1, -1, -1, 4316, 2798, -1, -1, -1, -1, -1, -1, 2805, 2806, 2807, 2808, -1, 3728, -1, 2812, 2813, -1, 2815, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4983, -1, 2827, -1, 2829, -1, -1, -1, -1, 3752, -1, 2836, 2837, 2838, 2839, 2840, 2841, 2842, 2843, 2844, 2845, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2882, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4436, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3882, -1, -1, -1, -1, -1, -1, -1, -1, 2973, 4493, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3930, -1, -1, -1, 3934, -1, -1, -1, -1, -1, -1, -1, -1, 5183, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4617, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4077, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4087, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3220, 3221, 4741, -1, -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, 3254, -1, 4775, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4191, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4814, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4230, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4251, -1, -1, -1, -1, -1, -1, -1, -1, 4861, -1, -1, -1, -1, 4866, 4867, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4316, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4983, -1, -1, -1, -1, -1, -1, 3471, -1, -1, -1, -1, -1, 3477, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3493, 3494, -1, -1, 3497, 3498, 3499, 3500, -1, -1, 3503, 3504, 3505, 3506, 3507, 3508, 3509, 3510, 3511, 3512, 3513, -1, -1, -1, -1, 4436, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3535, -1, -1, 3538, -1, 3540, -1, -1, 3543, 3544, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3558, 3559, 3560, 3561, -1, 3563, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4493, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3637, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5183, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4617, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4741, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3853, -1, -1, -1, 4775, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4814, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4861, -1, -1, -1, -1, 4866, 4867, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4023, -1, -1, -1, 4027, 4028, 4029, -1, -1, -1, -1, -1, 4035, 4036, 4037, 4038, -1, -1, -1, -1, 4043, 4044, 4045, 4046, 4047, 4048, 4049, 4050, 4051, 4052, 4053, 4054, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4983, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4080, -1, -1, 4083, -1, 4085, -1, -1, -1, 4089, -1, -1, 4092, 4093, -1, -1, 4096, 4097, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4143, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4156, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5183, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4346, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4431, 4432, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4458, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4483, -1, -1, -1, -1, 4488, 4489, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4506, -1, 4508, -1, -1, -1, 4512, 4513, 4514, -1, -1, 4517, -1, -1, 4520, 4521, -1, -1, -1, 4525, -1, -1, -1, 4529, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4575, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4638, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4675, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4773, 4774, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4788, 4789, 4790, -1, -1, -1, -1, -1, -1, -1, 4798, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4825, 4826, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4997, -1, -1, 5000, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5013, -1, -1, 5016, -1, -1, -1, 5020, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5063, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5100, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5177, -1, 5179, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5206, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5260, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5292, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5352, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5388, 5389, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5440, 5441, -1, -1, -1, 5445, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3, 4, 5, 6, 7, 8, 9, 10, -1, -1, -1, -1, -1, -1, 5472, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, -1, -1, -1, -1, 34, -1, -1, 37, 38, -1, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, 73, -1, 75, 76, 77, 78, 79, 80, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, 126, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, 162, -1, 164, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, 197, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, -1, -1, 220, 221, 222, 223, 224, -1, 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, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, 388, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, -1, 414, 415, 416, 417, 418, 419, 420, -1, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, -1, -1, -1, -1, -1, -1, 468, 469, 470, -1, -1, -1, -1, -1, -1, 477, 478, 3, 4, 5, 6, 7, 8, 9, 10, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, 34, -1, -1, 37, 38, -1, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, 73, -1, 75, 76, 77, 78, 79, 80, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, 162, -1, 164, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, 197, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, -1, -1, 220, 221, 222, 223, 224, -1, 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, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 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, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, -1, 414, 415, 416, 417, 418, 419, 420, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, 431, 432, 433, 434, 435, -1, -1, 438, -1, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, -1, 463, -1, -1, -1, -1, 468, 469, -1, -1, -1, -1, -1, -1, -1, 477, 478, 3, 4, 5, 6, 7, 8, 9, 10, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, 34, -1, -1, 37, 38, -1, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, 73, -1, 75, 76, 77, 78, 79, 80, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, 162, -1, 164, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, 197, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, -1, -1, 220, 221, 222, 223, 224, -1, 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, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, 388, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, -1, 414, 415, 416, 417, 418, 419, 420, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, 431, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, -1, -1, -1, -1, -1, -1, 468, 469, -1, -1, -1, -1, -1, -1, -1, 477, 478, 3, 4, 5, 6, 7, 8, 9, 10, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, 34, -1, -1, 37, 38, -1, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, 73, -1, 75, 76, 77, 78, 79, 80, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, 162, -1, 164, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, 197, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, -1, -1, 220, 221, 222, 223, 224, -1, 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, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, 388, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, -1, 414, 415, 416, 417, 418, 419, 420, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, 431, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, -1, -1, -1, -1, -1, -1, 468, 469, -1, -1, -1, -1, -1, -1, -1, 477, 478, 3, 4, 5, 6, 7, 8, 9, 10, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, 34, -1, -1, 37, 38, -1, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, 73, -1, 75, 76, 77, 78, 79, 80, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, 162, -1, 164, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, 197, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, -1, -1, 220, 221, 222, 223, 224, -1, 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, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, 388, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, -1, 414, 415, 416, 417, 418, 419, 420, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, 431, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, -1, -1, 3, -1, -1, -1, 468, 469, -1, -1, -1, -1, -1, -1, -1, 477, 478, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, 35, -1, 37, 38, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, -1, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, -1, -1, 75, 76, 77, 78, 79, -1, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, 92, 93, 94, 95, -1, -1, -1, -1, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, -1, -1, 164, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, -1, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, 197, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, -1, -1, 211, 212, 213, 214, 215, 216, 217, -1, -1, 220, 221, 222, 223, -1, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, -1, 255, 256, -1, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, -1, 280, -1, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, -1, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, -1, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, -1, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, -1, -1, -1, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 478, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, 43, 44, 45, 46, -1, 48, 49, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, -1, -1, 73, -1, 75, 76, 77, 78, 79, 80, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, 92, 93, 94, 95, -1, -1, -1, 99, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, -1, 147, 148, 149, -1, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, 162, -1, 164, 165, 166, 167, 168, -1, 170, -1, -1, -1, 174, 175, -1, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, -1, 196, 197, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, -1, -1, 220, -1, 222, 223, 224, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, -1, -1, 255, 256, 257, 258, -1, -1, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, 279, 280, 281, -1, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, -1, 297, -1, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, 334, 335, 336, 337, 338, 339, -1, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, -1, 382, -1, 384, 385, -1, 387, 388, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, -1, 403, -1, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, -1, 428, 429, 430, 431, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 458, 459, 460, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, 478, -1, -1, 37, 38, -1, 40, 41, 42, 43, 44, 45, 46, -1, 48, 49, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, -1, -1, 73, -1, 75, 76, 77, 78, 79, 80, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, 92, 93, 94, 95, -1, -1, -1, 99, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, -1, 147, 148, 149, -1, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, 162, -1, 164, 165, 166, 167, 168, -1, 170, -1, -1, -1, 174, 175, -1, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, -1, 196, 197, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, -1, -1, 220, -1, 222, 223, 224, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, -1, -1, 255, 256, 257, 258, -1, -1, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, 279, 280, 281, -1, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, -1, 297, -1, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, 334, 335, 336, 337, 338, 339, -1, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, -1, 382, -1, 384, 385, -1, 387, 388, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, -1, 403, -1, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, -1, 428, 429, 430, 431, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, -1, 3, 4, 5, 6, 7, 8, 9, 10, -1, -1, 458, 459, 460, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, 478, 34, -1, -1, 37, 38, -1, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, 73, -1, 75, 76, 77, 78, 79, 80, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, 162, -1, 164, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, 197, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, -1, -1, 220, 221, 222, 223, 224, -1, 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, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 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, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, -1, 414, 415, 416, 417, 418, 419, 420, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, 431, 432, 433, 434, 435, -1, -1, 438, -1, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, -1, 463, -1, -1, -1, -1, 468, 469, -1, -1, -1, -1, -1, -1, -1, 477, 3, 4, 5, 6, 7, 8, 9, 10, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, 34, -1, -1, 37, 38, -1, 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, -1, 67, 68, 69, 70, 71, -1, 73, -1, 75, 76, 77, 78, 79, 80, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, 162, 163, 164, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, 197, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, -1, 219, 220, 221, 222, 223, 224, -1, 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, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, 388, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, -1, 414, 415, 416, 417, 418, 419, 420, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, 431, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, -1, -1, -1, -1, -1, -1, 468, 469, -1, -1, -1, -1, -1, -1, -1, 477, 3, 4, 5, 6, 7, 8, 9, 10, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, 34, -1, -1, 37, 38, -1, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, 73, -1, 75, 76, 77, 78, 79, 80, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, 162, -1, 164, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, 197, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, -1, -1, 220, 221, 222, 223, 224, -1, 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, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, 388, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, -1, 414, 415, 416, 417, 418, 419, 420, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, 431, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, -1, -1, -1, -1, -1, -1, 468, 469, -1, -1, -1, -1, -1, 475, 476, 477, 3, 4, 5, 6, 7, 8, 9, 10, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, 34, -1, -1, 37, 38, -1, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, 73, -1, 75, 76, 77, 78, 79, 80, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, 162, -1, 164, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, 197, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, -1, -1, 220, 221, 222, 223, 224, -1, 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, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, 388, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, -1, 414, 415, 416, 417, 418, 419, 420, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, 431, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, -1, -1, -1, -1, -1, -1, 468, 469, 470, -1, -1, -1, -1, -1, -1, 477, 3, 4, 5, 6, 7, 8, 9, 10, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, -1, -1, -1, -1, 34, -1, -1, 37, 38, -1, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, 73, -1, 75, 76, 77, 78, 79, 80, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, 162, -1, 164, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, 197, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, -1, -1, 220, 221, 222, 223, 224, -1, 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, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, 388, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, -1, 414, 415, 416, 417, 418, 419, 420, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, 431, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, -1, -1, -1, -1, -1, -1, 468, 469, -1, -1, -1, -1, -1, -1, -1, 477, 3, 4, 5, 6, 7, 8, 9, 10, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, 34, -1, -1, 37, 38, -1, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, 73, -1, 75, 76, 77, 78, 79, 80, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, 162, -1, 164, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, 197, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, -1, -1, 220, 221, 222, 223, 224, -1, 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, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, 388, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, -1, 414, 415, 416, 417, 418, 419, 420, -1, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, -1, -1, -1, -1, -1, -1, 468, 469, -1, -1, -1, -1, -1, -1, -1, 477, 3, 4, 5, 6, 7, 8, 9, 10, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, 34, -1, -1, 37, 38, -1, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, 73, -1, 75, 76, 77, 78, 79, 80, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, 162, 163, 164, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, 197, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, -1, -1, 220, 221, 222, 223, 224, -1, 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, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, 388, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, -1, 414, 415, 416, 417, 418, 419, 420, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, 431, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, -1, -1, -1, -1, -1, -1, 468, 469, -1, -1, -1, -1, -1, -1, -1, 477, 3, 4, 5, 6, 7, 8, 9, 10, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, 34, -1, -1, 37, 38, -1, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, 73, -1, 75, 76, 77, 78, 79, 80, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, 162, -1, 164, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, 197, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, -1, -1, 220, 221, 222, 223, 224, -1, 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, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, 388, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, -1, 414, 415, 416, 417, 418, 419, 420, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, 431, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, -1, -1, -1, -1, -1, -1, 468, 469, -1, -1, -1, -1, -1, -1, -1, 477, 3, 4, 5, 6, 7, 8, 9, 10, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, 34, -1, -1, 37, 38, -1, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, 73, -1, 75, 76, 77, 78, 79, 80, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, 162, -1, 164, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, 197, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, -1, -1, 220, 221, 222, 223, 224, -1, 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, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, 388, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, -1, 414, 415, 416, 417, 418, 419, 420, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, 431, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, -1, -1, -1, -1, -1, -1, 468, 469, -1, -1, -1, -1, -1, -1, -1, 477, 3, 4, 5, 6, 7, 8, 9, 10, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, 34, -1, -1, 37, 38, -1, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, 73, -1, 75, 76, 77, 78, 79, 80, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, 162, -1, 164, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, 197, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, -1, -1, 220, 221, 222, 223, 224, -1, 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, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, 388, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, -1, 414, 415, 416, 417, 418, 419, 420, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, 431, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, -1, -1, -1, -1, -1, -1, 468, 469, -1, -1, -1, -1, -1, -1, -1, 477, 3, 4, 5, 6, 7, 8, 9, 10, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, 34, -1, -1, 37, 38, -1, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, 73, -1, 75, 76, 77, 78, 79, 80, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, 162, -1, 164, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, 197, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, -1, -1, 220, 221, 222, 223, 224, -1, 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, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, 388, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, -1, 414, 415, 416, 417, 418, 419, 420, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, 431, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, -1, -1, -1, -1, -1, -1, 468, 469, -1, -1, -1, -1, -1, -1, -1, 477, 3, 4, 5, 6, 7, 8, 9, 10, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, 34, -1, -1, 37, 38, -1, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, 73, -1, 75, 76, 77, 78, 79, 80, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, 162, -1, 164, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, 197, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, -1, -1, 220, 221, 222, 223, 224, -1, 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, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, 388, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, -1, 414, 415, 416, 417, 418, 419, 420, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, 431, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, -1, -1, -1, -1, -1, -1, 468, 469, -1, -1, -1, -1, -1, -1, -1, 477, 3, 4, 5, 6, 7, 8, 9, 10, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, 34, -1, -1, 37, 38, -1, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, 73, -1, 75, 76, 77, 78, 79, 80, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, 162, -1, 164, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, 197, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, -1, -1, 220, 221, 222, 223, 224, -1, 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, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, 388, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, -1, 414, 415, 416, 417, 418, 419, 420, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, 431, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, -1, -1, -1, -1, -1, -1, 468, 469, -1, -1, -1, -1, -1, -1, -1, 477, 3, 4, 5, 6, 7, 8, 9, 10, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, 34, -1, -1, 37, 38, -1, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, 73, -1, 75, 76, 77, 78, 79, 80, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, 162, -1, 164, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, 197, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, -1, -1, 220, 221, 222, 223, 224, -1, 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, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, 388, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, -1, 414, 415, 416, 417, 418, 419, 420, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, 431, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, -1, -1, -1, -1, -1, -1, 468, 469, -1, -1, -1, -1, -1, -1, -1, 477, 3, 4, 5, 6, 7, 8, 9, 10, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, 34, -1, -1, 37, 38, -1, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, 73, -1, 75, 76, 77, 78, 79, 80, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, 162, -1, 164, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, 197, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, -1, -1, 220, 221, 222, 223, 224, -1, 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, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, 388, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, -1, 414, 415, 416, 417, 418, 419, 420, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, 431, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, -1, -1, -1, -1, -1, -1, 468, 469, -1, -1, -1, -1, -1, -1, -1, 477, 3, 4, 5, 6, 7, 8, 9, 10, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, 34, -1, -1, 37, 38, -1, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, 73, -1, 75, 76, 77, 78, 79, 80, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, 162, -1, 164, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, 197, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, -1, -1, 220, 221, 222, 223, 224, -1, 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, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, 388, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, -1, 414, 415, 416, 417, 418, 419, 420, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, 431, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, -1, -1, -1, -1, -1, -1, 468, 469, -1, -1, -1, -1, -1, -1, -1, 477, 3, 4, 5, 6, 7, 8, 9, 10, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, 34, -1, -1, 37, 38, -1, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, 73, -1, 75, 76, 77, 78, 79, 80, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, 162, -1, 164, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, 197, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, -1, -1, 220, 221, 222, 223, 224, -1, 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, -1, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, 388, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, 420, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, 431, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, -1, -1, -1, -1, -1, -1, -1, 468, 469, -1, -1, -1, -1, -1, -1, -1, 477, 3, 4, 5, 6, 7, 8, 9, 10, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, 34, -1, -1, 37, 38, -1, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, 73, -1, 75, 76, 77, 78, 79, 80, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, 162, -1, 164, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, 197, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, -1, -1, 211, 212, 213, 214, 215, 216, 217, -1, -1, 220, 221, 222, 223, 224, -1, 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, -1, 258, 259, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, 388, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, -1, 414, 415, 416, 417, 418, 419, 420, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, 431, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, -1, -1, -1, -1, -1, -1, 468, 469, -1, -1, -1, -1, -1, -1, -1, 477, 3, 4, 5, 6, 7, 8, 9, 10, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, 34, -1, -1, 37, 38, -1, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, 73, -1, 75, 76, 77, 78, 79, 80, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, 162, -1, 164, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, 197, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, -1, -1, 220, 221, 222, 223, 224, -1, 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, -1, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, 388, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, 420, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, 431, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, -1, -1, -1, -1, -1, -1, -1, 468, 469, -1, -1, 3, 4, 5, 6, 7, 477, 9, 10, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, 34, -1, -1, 37, 38, -1, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, 73, -1, 75, 76, 77, 78, 79, 80, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, 162, -1, 164, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, 197, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, -1, -1, 220, 221, 222, 223, 224, -1, 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, -1, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, 388, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, 420, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, 431, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, -1, -1, -1, -1, -1, -1, -1, 468, 469, -1, -1, -1, -1, -1, -1, -1, 477, 3, 4, 5, 6, 7, 8, 9, 10, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, 34, -1, -1, 37, 38, -1, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, 73, -1, 75, 76, 77, 78, 79, 80, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, 162, -1, 164, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, 197, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, -1, 210, 211, 212, 213, 214, 215, 216, 217, -1, -1, 220, 221, 222, 223, 224, -1, 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, -1, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, 388, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, 420, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, 431, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, -1, -1, -1, -1, -1, -1, -1, 468, 469, -1, -1, 3, 4, 5, 6, 7, 477, 9, 10, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, 34, -1, -1, 37, 38, -1, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, 73, -1, 75, 76, 77, 78, 79, 80, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, 162, -1, 164, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, 197, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, -1, -1, 220, 221, 222, 223, 224, -1, 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, -1, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, 388, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, 420, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, 431, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, -1, -1, 3, 4, 5, 6, 7, -1, 9, 10, -1, -1, -1, -1, -1, -1, 477, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, 34, -1, -1, 37, 38, -1, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, 73, -1, 75, 76, 77, 78, 79, 80, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, 162, -1, 164, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, 197, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, -1, -1, 220, 221, 222, 223, 224, -1, 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, -1, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, 388, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, 420, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, 431, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, -1, -1, 3, 4, 5, 6, 7, -1, 9, 10, -1, -1, -1, -1, -1, -1, 477, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, 34, -1, -1, 37, 38, -1, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, 73, -1, 75, 76, 77, 78, 79, 80, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, 162, -1, 164, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, 197, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, -1, -1, 220, 221, 222, 223, 224, -1, 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, -1, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, 388, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, 420, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, 431, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, -1, -1, 3, 4, 5, 6, 7, 8, 9, 10, -1, -1, -1, -1, -1, -1, 477, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, 34, -1, -1, 37, 38, -1, 40, 41, 42, 43, 44, 45, 46, -1, 48, 49, 50, 51, -1, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, 73, -1, 75, 76, 77, 78, 79, 80, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, -1, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, 162, -1, 164, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, -1, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, 197, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, -1, -1, 211, 212, 213, 214, 215, 216, 217, -1, -1, 220, 221, 222, 223, -1, -1, 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, -1, 258, 259, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, -1, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, 388, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, -1, 414, 415, 416, 417, 418, 419, 420, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, 431, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, -1, -1, 3, -1, -1, -1, -1, 468, 469, -1, -1, -1, -1, -1, -1, -1, 477, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, 60, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, 73, -1, 75, 76, 77, 78, 79, 80, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, 162, -1, 164, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, 197, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, -1, 220, 221, 222, 223, 224, -1, 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, -1, 255, 256, 257, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, 270, 271, 272, 273, -1, -1, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 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, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, 420, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, 431, 432, 433, 434, 435, -1, -1, 438, -1, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, -1, -1, 463, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 477, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, 60, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, 73, -1, 75, 76, 77, 78, 79, 80, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, 162, -1, 164, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, 197, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, -1, 220, 221, 222, 223, 224, -1, 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, -1, 255, 256, 257, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, 270, 271, 272, 273, -1, -1, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, 388, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, 420, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, 431, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, -1, -1, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 477, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, 60, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, 73, -1, 75, 76, 77, 78, 79, 80, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, 162, -1, 164, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, 197, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, -1, -1, 220, 221, 222, 223, 224, -1, 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, -1, 255, 256, 257, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, 388, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, 420, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, 431, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, -1, -1, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 477, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, 60, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, 73, -1, 75, 76, 77, 78, 79, 80, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, 162, -1, 164, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, 197, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, -1, -1, 220, 221, 222, 223, 224, -1, 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, -1, 255, 256, 257, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, 388, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, 420, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, 431, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, -1, -1, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 477, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, 60, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, 73, -1, 75, 76, 77, 78, 79, 80, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, 162, -1, 164, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, 197, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, -1, -1, 220, 221, 222, 223, 224, -1, 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, -1, 255, 256, 257, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, 388, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, 420, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, 431, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, -1, -1, 3, 4, 5, -1, -1, -1, 9, -1, -1, -1, -1, -1, -1, -1, 477, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, 73, -1, 75, 76, 77, 78, 79, 80, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, 92, 93, 94, 95, -1, -1, -1, 99, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, 162, -1, 164, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, 197, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, -1, -1, 220, 221, 222, 223, 224, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, -1, 255, 256, 257, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, 269, -1, 271, 272, 273, -1, -1, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, 388, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, 431, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, -1, -1, 3, -1, -1, -1, -1, 468, 469, 470, -1, -1, -1, -1, -1, -1, 477, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, 30, 31, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, 73, -1, 75, 76, 77, 78, 79, 80, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, 92, 93, 94, 95, -1, -1, -1, 99, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, 162, -1, 164, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, 197, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, -1, -1, 220, 221, 222, 223, 224, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, -1, 255, 256, 257, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, 431, 432, 433, 434, 435, -1, -1, 438, -1, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, -1, -1, 463, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 477, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, 73, -1, 75, 76, 77, 78, 79, 80, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, 92, 93, 94, 95, -1, -1, -1, 99, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, 162, -1, 164, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, 197, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, -1, -1, 220, 221, 222, 223, 224, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, -1, 255, 256, 257, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, 388, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, 431, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, -1, -1, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 477, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, -1, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, -1, -1, 75, 76, 77, 78, 79, -1, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, -1, 93, 94, 95, -1, -1, -1, -1, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, -1, -1, -1, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, -1, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, -1, -1, 211, -1, 213, 214, 215, 216, 217, -1, -1, 220, 221, -1, 223, -1, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, 250, 251, 252, 253, -1, 255, 256, -1, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, -1, 280, -1, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, -1, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, 386, 387, -1, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, -1, 432, 433, 434, 435, -1, -1, 438, -1, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, -1, -1, 463, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 477, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, -1, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, -1, -1, 75, 76, 77, 78, 79, -1, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, -1, 93, 94, 95, -1, -1, -1, -1, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, -1, -1, -1, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, -1, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, -1, -1, 211, -1, 213, 214, 215, 216, 217, -1, -1, 220, 221, -1, 223, -1, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, 250, 251, 252, 253, -1, 255, 256, -1, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, -1, 280, -1, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, -1, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, -1, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, -1, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, -1, -1, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 477, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, -1, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, -1, -1, 75, 76, 77, 78, 79, -1, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, -1, 93, 94, 95, -1, -1, -1, -1, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, -1, -1, -1, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, -1, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, -1, -1, 211, -1, 213, 214, 215, 216, 217, -1, -1, 220, 221, -1, 223, -1, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, 250, 251, 252, 253, -1, 255, 256, -1, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, -1, 280, -1, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, -1, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, -1, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, -1, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, -1, -1, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 477, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, -1, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, -1, -1, 75, 76, 77, 78, 79, -1, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, -1, 93, 94, 95, -1, -1, -1, -1, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, -1, -1, -1, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, -1, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, -1, -1, 211, -1, 213, 214, 215, 216, 217, -1, -1, 220, 221, -1, 223, -1, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, 250, 251, 252, 253, -1, 255, 256, -1, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, -1, 280, -1, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, -1, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, -1, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, -1, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, -1, -1, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 477, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, -1, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, -1, -1, 75, 76, 77, 78, 79, -1, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, -1, 93, 94, 95, -1, -1, -1, -1, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, -1, -1, -1, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, -1, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, -1, -1, 211, -1, 213, 214, 215, 216, 217, -1, -1, 220, 221, -1, 223, -1, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, 250, 251, 252, 253, -1, 255, 256, -1, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, -1, 280, -1, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, -1, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, -1, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, -1, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, -1, -1, -1, -1, -1, 3, 4, 5, -1, -1, 8, 9, -1, -1, -1, -1, 477, 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, -1, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, -1, 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, -1, 147, 148, 149, -1, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, -1, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, -1, 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, -1, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, -1, 279, 280, 281, -1, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, 295, -1, 297, -1, 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, -1, 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, -1, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, -1, 403, -1, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, -1, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 458, 459, 460, -1, -1, -1, 464, 465, 466, -1, 468, 469, 470, 471, 472, 473, 3, 4, 5, -1, -1, 8, 9, -1, -1, -1, -1, -1, 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, -1, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, -1, 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, -1, 147, 148, 149, -1, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, -1, 172, -1, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, -1, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, -1, 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, -1, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, -1, 279, 280, 281, -1, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, 295, -1, 297, -1, 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, -1, 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, -1, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, -1, 403, -1, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, -1, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 458, 459, 460, -1, 3, -1, 464, 465, 466, 8, 468, 469, 470, 471, 472, 473, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, -1, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, -1, -1, 75, 76, 77, 78, 79, -1, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, -1, 93, 94, 95, -1, -1, -1, -1, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, -1, -1, -1, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, -1, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, -1, -1, 211, -1, 213, 214, 215, 216, 217, -1, -1, 220, 221, -1, 223, -1, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, 250, 251, 252, 253, -1, 255, 256, -1, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, -1, 280, -1, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, -1, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, -1, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, -1, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, -1, 3, -1, 464, 465, 466, 8, 468, 469, 470, 471, 472, 473, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, -1, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, -1, -1, 75, 76, 77, 78, 79, -1, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, -1, 93, 94, 95, -1, -1, -1, -1, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, -1, -1, -1, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, -1, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, -1, -1, 211, -1, 213, 214, 215, 216, 217, -1, -1, 220, 221, -1, 223, -1, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, 250, 251, 252, 253, -1, 255, 256, -1, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, -1, 280, -1, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, -1, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, -1, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, -1, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, -1, 3, -1, 464, 465, 466, 8, 468, 469, 470, 471, 472, 473, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, -1, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, -1, -1, 75, 76, 77, 78, 79, -1, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, -1, 93, 94, 95, -1, -1, -1, -1, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, -1, -1, -1, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, -1, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, -1, -1, 211, -1, 213, 214, 215, 216, 217, -1, -1, 220, 221, -1, 223, -1, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, 250, 251, 252, 253, -1, 255, 256, -1, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, -1, 280, -1, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, -1, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, -1, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, -1, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, -1, 3, -1, 464, 465, 466, 8, 468, 469, 470, 471, 472, 473, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, -1, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, -1, -1, 75, 76, 77, 78, 79, -1, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, -1, 93, 94, 95, -1, -1, -1, -1, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, -1, -1, -1, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, -1, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, -1, -1, 211, -1, 213, 214, 215, 216, 217, -1, -1, 220, 221, -1, 223, -1, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, 250, 251, 252, 253, -1, 255, 256, -1, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, -1, 280, -1, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, -1, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, -1, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, -1, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, -1, 3, -1, 464, 465, 466, 8, 468, 469, 470, 471, 472, 473, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, -1, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, -1, -1, 75, 76, 77, 78, 79, -1, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, -1, 93, 94, 95, -1, -1, -1, -1, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, -1, -1, -1, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, -1, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, -1, -1, 211, -1, 213, 214, 215, 216, 217, -1, -1, 220, 221, -1, 223, -1, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, 250, 251, 252, 253, -1, 255, 256, -1, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, -1, 280, -1, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, -1, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, -1, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, -1, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, -1, 3, -1, 464, 465, 466, 8, 468, 469, 470, 471, 472, 473, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, -1, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, -1, -1, 75, 76, 77, 78, 79, -1, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, -1, 93, 94, 95, -1, -1, -1, -1, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, -1, -1, -1, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, -1, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, -1, -1, 211, -1, 213, 214, 215, 216, 217, -1, -1, 220, 221, -1, 223, -1, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, 250, 251, 252, 253, -1, 255, 256, -1, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, -1, 280, -1, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, -1, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, -1, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, -1, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, -1, 3, -1, 464, 465, 466, 8, 468, 469, 470, 471, 472, 473, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, -1, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, -1, -1, 75, 76, 77, 78, 79, -1, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, -1, 93, 94, 95, -1, -1, -1, -1, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, -1, -1, -1, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, -1, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, -1, -1, 211, -1, 213, 214, 215, 216, 217, -1, -1, 220, 221, -1, 223, -1, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, 250, 251, 252, 253, -1, 255, 256, -1, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, -1, 280, -1, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, -1, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, -1, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, -1, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, -1, 464, 465, 466, -1, 468, 469, 470, 471, 472, 473, -1, -1, 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, -1, 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, 3, -1, -1, -1, -1, -1, -1, -1, -1, 470, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, -1, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, -1, -1, 75, 76, 77, 78, 79, -1, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, -1, 93, 94, 95, -1, -1, -1, -1, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, -1, -1, -1, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, -1, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, -1, -1, 211, -1, 213, 214, 215, 216, 217, -1, -1, 220, 221, -1, 223, -1, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, 250, 251, 252, 253, -1, 255, 256, -1, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, -1, 280, -1, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, -1, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, -1, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, -1, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, -1, -1, -1, -1, -1, -1, -1, 470, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, -1, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, -1, -1, 75, 76, 77, 78, 79, -1, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, -1, 93, 94, 95, -1, -1, -1, -1, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, -1, -1, -1, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, -1, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, -1, -1, 211, -1, 213, 214, 215, 216, 217, -1, -1, 220, 221, -1, 223, -1, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, 250, 251, 252, 253, -1, 255, 256, -1, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, -1, 280, -1, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, -1, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, -1, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, -1, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, -1, -1, -1, -1, -1, -1, -1, 470, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, 43, 44, 45, 46, -1, 48, 49, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, -1, -1, 73, -1, 75, 76, 77, 78, 79, 80, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, 92, 93, 94, 95, -1, -1, -1, 99, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, -1, 147, 148, 149, -1, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, 162, -1, 164, 165, 166, 167, 168, -1, 170, -1, -1, -1, 174, 175, -1, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, -1, 196, 197, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, -1, -1, 220, -1, 222, 223, 224, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, -1, -1, 255, 256, 257, 258, -1, -1, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, 275, 276, 277, 278, 279, 280, 281, -1, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, -1, 297, -1, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, 334, 335, 336, 337, 338, 339, -1, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, -1, 382, -1, 384, 385, -1, 387, 388, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, -1, 403, -1, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, -1, 428, 429, 430, 431, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 458, 459, 460, -1, 18, 19, 20, 21, 22, 23, 24, 25, 470, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, 43, 44, 45, 46, -1, 48, 49, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, -1, -1, 73, -1, 75, 76, 77, 78, 79, 80, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, 92, 93, 94, 95, -1, -1, -1, 99, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, -1, 147, 148, 149, -1, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, 162, -1, 164, 165, 166, 167, 168, -1, 170, -1, -1, -1, 174, 175, -1, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, -1, 196, 197, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, -1, -1, 220, -1, 222, 223, 224, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, -1, -1, 255, 256, 257, 258, -1, -1, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, 275, 276, 277, 278, 279, 280, 281, -1, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, -1, 297, -1, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, 334, 335, 336, 337, 338, 339, -1, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, -1, 382, -1, 384, 385, -1, 387, 388, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, -1, 403, -1, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, -1, 428, 429, 430, 431, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 3, 4, 5, -1, -1, -1, 9, -1, -1, -1, -1, 458, 459, 460, -1, 18, 19, 20, 21, 22, 23, 24, 25, 470, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, 73, -1, 75, 76, 77, 78, 79, 80, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, 92, 93, 94, 95, -1, -1, -1, 99, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, 162, -1, 164, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, 197, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, -1, -1, 220, 221, 222, 223, 224, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, -1, 255, 256, 257, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, 269, -1, 271, 272, 273, -1, -1, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, 388, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, 431, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, 4, 5, -1, -1, -1, 9, 468, 469, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, 73, -1, 75, 76, 77, 78, 79, 80, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, 92, 93, 94, 95, -1, -1, -1, 99, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, 162, -1, 164, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, 197, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, -1, -1, 220, 221, 222, 223, 224, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, -1, 255, 256, 257, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, 269, -1, 271, 272, 273, -1, -1, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, 388, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, 431, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, 4, 5, -1, -1, -1, 9, 468, 469, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, 73, -1, 75, 76, 77, 78, 79, 80, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, 92, 93, 94, 95, -1, -1, -1, 99, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, 162, -1, 164, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, 197, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, -1, -1, 220, 221, 222, 223, 224, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, -1, 255, 256, 257, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, 269, -1, 271, 272, 273, -1, -1, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, 388, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, 431, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, 5, -1, -1, -1, 9, 468, 469, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, 73, -1, 75, 76, 77, 78, 79, 80, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, 92, 93, 94, 95, -1, -1, -1, 99, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, 162, -1, 164, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, 197, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, -1, -1, 220, 221, 222, 223, 224, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, -1, 255, 256, 257, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, 269, -1, 271, 272, 273, -1, -1, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, 388, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, 431, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, -1, -1, -1, -1, 9, 468, 469, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, -1, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, -1, -1, 75, 76, 77, 78, 79, -1, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, -1, 93, 94, 95, -1, -1, -1, -1, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, -1, 163, -1, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, -1, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, -1, -1, 211, -1, 213, 214, 215, 216, 217, -1, -1, 220, 221, -1, 223, -1, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, 250, 251, 252, 253, -1, 255, 256, -1, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, -1, 280, -1, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, -1, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, -1, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, -1, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, 4, 5, -1, -1, -1, 9, 468, 469, -1, -1, -1, -1, -1, -1, 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, -1, 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, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 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, -1, 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, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 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, -1, 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, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, 60, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, 73, -1, 75, 76, 77, 78, 79, 80, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, 162, -1, 164, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, 197, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, -1, -1, 220, 221, 222, 223, 224, -1, 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, -1, 255, 256, 257, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, 388, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, 420, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, 431, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, 73, -1, 75, 76, 77, 78, 79, 80, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, 92, 93, 94, 95, -1, -1, -1, 99, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, 162, -1, 164, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, 197, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, -1, -1, 220, 221, 222, 223, 224, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, -1, 255, 256, 257, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, 269, -1, 271, 272, 273, -1, -1, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, 388, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, 431, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, 73, -1, 75, 76, 77, 78, 79, 80, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, 92, 93, 94, 95, -1, -1, -1, 99, -1, -1, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, 162, -1, 164, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, 197, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, -1, -1, 220, 221, 222, 223, 224, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, -1, 255, 256, 257, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, 388, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, 431, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, 73, -1, 75, 76, 77, 78, 79, 80, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, 92, 93, 94, 95, -1, -1, -1, 99, -1, -1, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, 162, -1, 164, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, 197, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, -1, -1, 220, 221, 222, 223, 224, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, -1, 255, 256, 257, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, 388, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, 431, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, 73, -1, 75, 76, 77, 78, 79, 80, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, 92, 93, 94, 95, -1, -1, -1, 99, -1, -1, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, 162, -1, 164, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, 197, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, -1, -1, 220, 221, 222, 223, 224, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, -1, 255, 256, 257, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, 388, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, 420, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, 431, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, 73, -1, 75, 76, 77, 78, 79, 80, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, 92, 93, 94, 95, -1, -1, -1, 99, -1, -1, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, 162, -1, 164, 165, 166, 167, 168, -1, 170, 171, 172, 173, 174, 175, -1, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, 197, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, -1, -1, 220, 221, 222, 223, 224, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, -1, 255, 256, 257, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, 388, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, 431, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, 73, -1, 75, 76, 77, 78, 79, 80, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, 92, 93, 94, 95, -1, -1, -1, 99, -1, -1, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, 162, -1, 164, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, 197, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, -1, -1, 220, 221, 222, 223, 224, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, -1, 255, 256, 257, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, 388, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, 431, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, 73, -1, 75, 76, 77, 78, 79, 80, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, 92, 93, 94, 95, -1, -1, -1, 99, -1, -1, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, 162, -1, 164, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, 197, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, -1, -1, 220, 221, 222, 223, 224, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, -1, 255, 256, 257, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, 388, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, 431, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, 73, -1, 75, 76, 77, 78, 79, 80, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, 92, 93, 94, 95, -1, -1, -1, 99, -1, -1, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, 162, -1, 164, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, 197, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, -1, -1, 220, 221, 222, 223, 224, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, -1, 255, 256, 257, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, 388, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, 431, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, 73, -1, 75, 76, 77, 78, 79, 80, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, 92, 93, 94, 95, -1, -1, -1, 99, -1, -1, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, 162, -1, 164, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, 197, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, -1, -1, 220, 221, 222, 223, 224, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, -1, 255, 256, 257, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, 388, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, 431, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, 73, -1, 75, 76, 77, 78, 79, 80, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, 92, 93, 94, 95, -1, -1, -1, 99, -1, -1, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, 162, -1, 164, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, 197, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, -1, -1, 220, 221, 222, 223, 224, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, -1, 255, 256, 257, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, 388, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, 431, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, 30, 31, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, 73, -1, 75, 76, 77, 78, 79, 80, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, 92, 93, 94, 95, -1, -1, -1, 99, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, 162, -1, 164, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, 197, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, -1, -1, 220, 221, 222, 223, 224, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, -1, 255, 256, 257, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, 388, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, 431, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, 73, -1, 75, 76, 77, 78, 79, 80, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, 92, 93, 94, 95, -1, -1, -1, 99, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, 162, -1, 164, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, 197, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, -1, -1, 220, 221, 222, 223, 224, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, -1, 255, 256, 257, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, 388, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, 431, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, 73, -1, 75, 76, 77, 78, 79, 80, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, 92, 93, 94, 95, -1, -1, -1, 99, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, 162, -1, 164, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, 197, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, -1, -1, 220, 221, 222, 223, 224, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, -1, 255, 256, 257, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, 388, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, 431, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, 73, -1, 75, 76, 77, 78, 79, 80, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, 92, 93, 94, 95, -1, -1, -1, 99, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, 162, -1, 164, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, 197, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, -1, -1, 220, 221, 222, 223, 224, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, -1, 255, 256, 257, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, 388, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, 431, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, 73, -1, 75, 76, 77, 78, 79, 80, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, 92, 93, 94, 95, -1, -1, -1, 99, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, 162, -1, 164, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, 197, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, -1, -1, 220, 221, 222, 223, 224, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, -1, 255, 256, 257, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, 388, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, 431, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, 73, -1, 75, 76, 77, 78, 79, 80, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, 92, 93, 94, 95, -1, -1, -1, 99, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, 162, -1, 164, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, 197, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, -1, -1, 220, 221, 222, 223, 224, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, -1, 255, 256, 257, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, 388, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, 431, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, 73, -1, 75, 76, 77, 78, 79, 80, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, 92, 93, 94, 95, -1, -1, -1, 99, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, 162, -1, 164, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, 197, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, -1, -1, 220, 221, 222, 223, 224, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, -1, 255, 256, 257, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, 388, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, 431, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, 73, -1, 75, 76, 77, 78, 79, 80, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, 92, 93, 94, 95, -1, -1, -1, 99, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, 162, -1, 164, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, 197, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, -1, -1, 220, 221, 222, 223, 224, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, -1, 255, 256, 257, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, 388, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, 431, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, 73, -1, 75, 76, 77, 78, 79, 80, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, 92, 93, 94, 95, -1, -1, -1, 99, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, 162, -1, 164, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, 197, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, -1, -1, 220, 221, 222, 223, 224, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, -1, 255, 256, 257, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, 388, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, 431, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, 73, -1, 75, 76, 77, 78, 79, 80, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, 92, 93, 94, 95, -1, -1, -1, 99, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, 162, -1, 164, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, 197, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, -1, -1, 220, 221, 222, 223, 224, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, -1, 255, 256, 257, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, 388, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, 431, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, -1, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, -1, -1, 74, 75, 76, 77, 78, 79, -1, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, -1, -1, 93, 94, 95, -1, -1, -1, -1, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, 160, 161, -1, -1, -1, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, -1, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, -1, -1, 211, -1, 213, 214, 215, 216, 217, -1, -1, 220, 221, -1, 223, -1, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, 250, 251, 252, 253, -1, 255, 256, -1, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, -1, 280, -1, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, -1, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, -1, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, 414, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, -1, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, -1, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, -1, -1, -1, 75, 76, 77, 78, 79, -1, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, -1, -1, 93, 94, 95, -1, -1, -1, -1, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, 160, 161, -1, -1, -1, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, -1, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, -1, -1, 211, -1, 213, 214, 215, 216, 217, -1, -1, 220, 221, -1, 223, 224, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, 250, 251, 252, 253, -1, 255, 256, -1, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, -1, 280, -1, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, -1, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, -1, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, 414, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, -1, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, -1, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, -1, -1, 75, 76, 77, 78, 79, -1, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, 91, -1, 93, 94, 95, -1, -1, -1, -1, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, -1, -1, -1, 165, 166, 167, 168, 169, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, -1, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, -1, -1, 211, -1, 213, 214, 215, 216, 217, -1, -1, 220, 221, -1, 223, -1, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, 250, 251, 252, 253, -1, 255, 256, -1, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, -1, 280, -1, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 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, -1, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, -1, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, -1, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, -1, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, -1, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, -1, -1, 75, 76, 77, 78, 79, -1, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, 91, -1, 93, 94, 95, -1, -1, -1, -1, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, -1, -1, -1, 165, 166, 167, 168, 169, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, -1, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, -1, -1, 211, -1, 213, 214, 215, 216, 217, -1, -1, 220, 221, -1, 223, -1, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, 250, 251, 252, 253, -1, 255, 256, -1, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, -1, 280, -1, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 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, -1, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, -1, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, -1, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, -1, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, -1, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, -1, -1, -1, 75, 76, 77, 78, 79, -1, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, -1, -1, 93, 94, 95, -1, -1, -1, -1, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, 160, 161, -1, -1, -1, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, -1, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, -1, -1, 211, -1, 213, 214, 215, 216, 217, -1, -1, 220, 221, -1, 223, -1, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, 250, 251, 252, 253, -1, 255, 256, -1, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, -1, 280, -1, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, -1, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, -1, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, 414, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, -1, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, -1, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, -1, -1, 75, 76, 77, 78, 79, -1, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, 91, -1, 93, 94, 95, -1, -1, -1, -1, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, -1, -1, -1, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, -1, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, -1, -1, 211, -1, 213, 214, 215, 216, 217, -1, -1, 220, 221, -1, 223, -1, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, 250, 251, 252, 253, -1, 255, 256, -1, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, -1, 280, -1, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 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, -1, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, -1, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, -1, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, -1, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, -1, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, -1, -1, 75, 76, 77, 78, 79, -1, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, -1, 93, 94, 95, -1, -1, -1, -1, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, 160, 161, -1, -1, -1, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, -1, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, -1, -1, 211, -1, 213, 214, 215, 216, 217, -1, -1, 220, 221, -1, 223, -1, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, 250, 251, 252, 253, -1, 255, 256, -1, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, -1, 280, -1, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, -1, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, 386, 387, -1, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, -1, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, -1, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, -1, -1, 75, 76, 77, 78, 79, -1, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, 91, -1, 93, 94, 95, -1, -1, -1, -1, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, -1, -1, -1, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, -1, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, -1, -1, 211, -1, 213, 214, 215, 216, 217, -1, -1, 220, 221, -1, 223, -1, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, 250, 251, 252, 253, -1, 255, 256, -1, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, -1, 280, -1, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 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, -1, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, -1, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, -1, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, -1, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, -1, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, -1, -1, 75, 76, 77, 78, 79, -1, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, -1, 93, 94, 95, -1, -1, -1, -1, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, -1, -1, -1, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, -1, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, -1, -1, 211, -1, 213, 214, 215, 216, 217, -1, -1, 220, 221, -1, 223, -1, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, 250, 251, 252, 253, -1, 255, 256, -1, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, 270, 271, 272, 273, -1, -1, 276, 277, 278, -1, 280, -1, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, -1, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, -1, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, -1, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, -1, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, -1, -1, 75, 76, 77, 78, 79, -1, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, -1, 93, 94, 95, -1, -1, -1, -1, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, -1, -1, -1, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, -1, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, -1, -1, 211, -1, 213, 214, 215, 216, 217, -1, -1, 220, 221, -1, 223, -1, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, 250, 251, 252, 253, -1, 255, 256, -1, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, -1, 280, -1, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, -1, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, -1, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, 420, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, -1, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, -1, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, -1, -1, 75, 76, 77, 78, 79, -1, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, -1, 93, 94, 95, -1, -1, -1, -1, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, -1, -1, -1, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, -1, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, -1, -1, 211, -1, 213, 214, 215, 216, 217, -1, -1, 220, 221, -1, 223, -1, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, 250, 251, 252, 253, -1, 255, 256, -1, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, -1, 280, -1, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, -1, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, -1, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, 420, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, -1, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, -1, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, -1, -1, 75, 76, 77, 78, 79, -1, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, -1, 93, 94, 95, -1, -1, -1, -1, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, -1, -1, -1, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, -1, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, -1, -1, 211, -1, 213, 214, 215, 216, 217, -1, -1, 220, 221, -1, 223, -1, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, 250, 251, 252, 253, -1, 255, 256, -1, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, -1, 280, -1, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, -1, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, -1, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, -1, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, -1, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, -1, -1, 75, 76, 77, 78, 79, -1, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, -1, 93, 94, 95, -1, -1, -1, -1, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, -1, -1, -1, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, -1, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, -1, -1, 211, -1, 213, 214, 215, 216, 217, -1, -1, 220, 221, -1, 223, -1, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, 250, 251, 252, 253, -1, 255, 256, -1, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, -1, 280, -1, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, -1, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, -1, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, -1, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, -1, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, -1, -1, 75, 76, 77, 78, 79, -1, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, -1, 93, 94, 95, -1, -1, -1, -1, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, -1, -1, -1, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, -1, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, -1, -1, 211, -1, 213, 214, 215, 216, 217, -1, -1, 220, 221, -1, 223, -1, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, 250, 251, 252, 253, -1, 255, 256, -1, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, -1, 280, -1, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, -1, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, -1, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, -1, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, -1, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, -1, -1, 75, 76, 77, 78, 79, -1, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, -1, 93, 94, 95, -1, -1, -1, -1, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, -1, -1, -1, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, -1, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, -1, -1, 211, -1, 213, 214, 215, 216, 217, -1, -1, 220, 221, -1, 223, -1, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, 250, 251, 252, 253, -1, 255, 256, -1, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, -1, 280, -1, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, -1, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, -1, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, -1, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, -1, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, -1, -1, 75, 76, 77, 78, 79, -1, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, -1, 93, 94, 95, -1, -1, -1, -1, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, -1, -1, -1, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, -1, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, -1, -1, 211, -1, 213, 214, 215, 216, 217, -1, -1, 220, 221, -1, 223, -1, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, 250, 251, 252, 253, -1, 255, 256, -1, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, 270, 271, 272, 273, -1, -1, 276, 277, 278, -1, 280, -1, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, -1, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, -1, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, -1, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, -1, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, -1, -1, 75, 76, 77, 78, 79, -1, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, -1, 93, 94, 95, -1, -1, -1, -1, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, -1, -1, -1, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, -1, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, -1, -1, 211, -1, 213, 214, 215, 216, 217, -1, -1, 220, 221, -1, 223, -1, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, 250, 251, 252, 253, -1, 255, 256, -1, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, -1, 280, -1, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, -1, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, -1, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, -1, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, -1, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, -1, -1, 75, 76, 77, 78, 79, -1, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, -1, 93, 94, 95, -1, -1, -1, -1, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, -1, -1, -1, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, -1, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, -1, -1, 211, -1, 213, 214, 215, 216, 217, -1, -1, 220, 221, -1, 223, -1, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, 250, 251, 252, 253, -1, 255, 256, -1, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, -1, 280, -1, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, -1, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, -1, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, -1, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, -1, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, -1, -1, 75, 76, 77, 78, 79, -1, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, -1, 93, 94, 95, -1, -1, -1, -1, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, -1, -1, -1, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, -1, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, -1, -1, 211, -1, 213, 214, 215, 216, 217, -1, -1, 220, 221, -1, 223, -1, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, 250, 251, 252, 253, -1, 255, 256, -1, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, -1, 280, -1, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, -1, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, -1, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, -1, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, -1, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, -1, -1, 75, 76, 77, 78, 79, -1, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, -1, 93, 94, 95, -1, -1, -1, -1, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, -1, -1, -1, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, -1, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, -1, -1, 211, -1, 213, 214, 215, 216, 217, -1, -1, 220, 221, -1, 223, -1, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, 250, 251, 252, 253, -1, 255, 256, -1, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, -1, 280, -1, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, -1, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, -1, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, -1, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, -1, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, -1, -1, 75, 76, 77, 78, 79, -1, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, -1, 93, 94, 95, -1, -1, -1, -1, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, -1, -1, -1, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, -1, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, -1, -1, 211, -1, 213, 214, 215, 216, 217, -1, -1, 220, 221, -1, 223, -1, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, 250, 251, 252, 253, -1, 255, 256, -1, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, -1, 280, -1, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, -1, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, -1, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, -1, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, 43, 44, 45, 46, 47, 48, -1, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, -1, -1, 75, 76, 77, 78, 79, -1, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, -1, 93, 94, 95, -1, -1, -1, -1, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, -1, -1, -1, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, -1, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, -1, -1, 211, -1, 213, 214, 215, 216, 217, -1, -1, 220, 221, -1, 223, -1, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, 250, 251, 252, 253, -1, 255, 256, -1, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, -1, 280, -1, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, -1, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, -1, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, -1, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, -1, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, -1, -1, 75, 76, 77, 78, 79, -1, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, -1, 93, 94, 95, -1, -1, -1, -1, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, -1, -1, -1, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, -1, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, -1, -1, 211, -1, 213, 214, 215, 216, 217, -1, -1, 220, 221, -1, 223, -1, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, 250, 251, 252, 253, -1, 255, 256, -1, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, 270, 271, 272, 273, -1, -1, 276, 277, 278, -1, 280, -1, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, -1, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, -1, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, -1, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, -1, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, -1, -1, 75, 76, 77, 78, 79, -1, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, -1, 93, 94, 95, -1, -1, -1, -1, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, -1, -1, -1, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, -1, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, -1, -1, 211, -1, 213, 214, 215, 216, 217, -1, -1, 220, 221, -1, 223, -1, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, 250, 251, 252, 253, -1, 255, 256, -1, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, -1, 280, -1, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, -1, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, -1, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, -1, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, -1, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, -1, -1, 75, 76, 77, 78, 79, -1, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, -1, 93, 94, 95, -1, -1, -1, -1, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, -1, -1, -1, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, -1, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, -1, -1, 211, -1, 213, 214, 215, 216, 217, -1, -1, 220, 221, -1, 223, -1, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, 250, 251, 252, 253, -1, 255, 256, -1, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, -1, 280, -1, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, -1, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, 386, 387, -1, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, -1, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, -1, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, -1, -1, 75, 76, 77, 78, 79, -1, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, -1, 93, 94, 95, -1, -1, -1, -1, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, -1, -1, -1, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, -1, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, -1, -1, 211, -1, 213, 214, 215, 216, 217, -1, -1, 220, 221, -1, 223, -1, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, 250, 251, 252, 253, -1, 255, 256, -1, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, -1, 280, -1, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, -1, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, -1, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, -1, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, -1, -1, -1, -1, 9, -1, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, -1, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, -1, -1, 75, 76, 77, 78, 79, -1, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, -1, 93, 94, 95, -1, -1, -1, -1, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, -1, -1, -1, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, -1, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, -1, -1, 211, -1, 213, 214, 215, 216, 217, -1, -1, 220, 221, -1, 223, -1, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, 250, 251, 252, 253, -1, 255, 256, -1, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, -1, 280, -1, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, -1, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, -1, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, -1, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, 35, -1, 37, 38, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, -1, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, -1, -1, 75, 76, 77, 78, 79, -1, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, -1, 93, 94, 95, -1, -1, -1, -1, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, -1, -1, -1, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, -1, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, -1, -1, 211, -1, 213, 214, 215, 216, 217, -1, -1, 220, 221, -1, 223, -1, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, 250, 251, 252, 253, -1, 255, 256, -1, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, -1, 280, -1, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, -1, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, -1, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, -1, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, 35, -1, 37, 38, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, -1, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, -1, -1, 75, 76, 77, 78, 79, -1, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, -1, 93, 94, 95, -1, -1, -1, -1, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, -1, -1, -1, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, -1, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, -1, -1, 211, -1, 213, 214, 215, 216, 217, -1, -1, 220, 221, -1, 223, -1, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, 250, 251, 252, 253, -1, 255, 256, -1, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, -1, 280, -1, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, -1, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, -1, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, -1, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, -1, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, -1, -1, 75, 76, 77, 78, 79, -1, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, -1, 93, 94, 95, -1, -1, -1, -1, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, -1, -1, -1, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, -1, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, -1, -1, 211, -1, 213, 214, 215, 216, 217, -1, -1, 220, 221, -1, 223, -1, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, 250, 251, 252, 253, -1, 255, 256, -1, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, -1, 280, -1, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, -1, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, -1, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, -1, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, -1, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, -1, -1, 75, 76, 77, 78, 79, -1, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, -1, 93, 94, 95, -1, -1, -1, -1, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, -1, -1, -1, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, -1, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, -1, -1, 211, -1, 213, 214, 215, 216, 217, -1, -1, 220, 221, -1, 223, -1, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, 250, 251, 252, 253, -1, 255, 256, -1, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, -1, 280, -1, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, -1, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, -1, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, -1, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, -1, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, -1, -1, 75, 76, 77, 78, 79, -1, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, -1, 93, 94, 95, -1, -1, -1, -1, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, -1, -1, -1, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, -1, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, -1, -1, 211, -1, 213, 214, 215, 216, 217, -1, -1, 220, 221, -1, 223, -1, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, 250, 251, 252, 253, -1, 255, 256, -1, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, -1, 280, -1, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, -1, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, -1, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, -1, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, -1, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, -1, -1, 75, 76, 77, 78, 79, -1, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, -1, 93, 94, 95, -1, -1, -1, -1, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, -1, -1, -1, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, -1, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, -1, -1, 211, -1, 213, 214, 215, 216, 217, -1, -1, 220, 221, -1, 223, -1, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, 250, 251, 252, 253, -1, 255, 256, -1, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, -1, 280, -1, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, -1, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, -1, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, -1, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, -1, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, -1, -1, 75, 76, 77, 78, 79, -1, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, -1, 93, 94, 95, -1, -1, -1, -1, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, -1, -1, -1, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, -1, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, -1, -1, 211, -1, 213, 214, 215, 216, 217, -1, -1, 220, 221, -1, 223, -1, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, 250, 251, 252, 253, -1, 255, 256, -1, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, -1, 280, -1, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, -1, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, -1, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, -1, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, -1, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, -1, -1, 75, 76, 77, 78, 79, -1, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, -1, 93, 94, 95, -1, -1, -1, -1, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, -1, -1, -1, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, -1, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, -1, -1, 211, -1, 213, 214, 215, 216, 217, -1, -1, 220, 221, -1, 223, -1, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, 250, 251, 252, 253, -1, 255, 256, -1, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, -1, 280, -1, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, -1, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, -1, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, -1, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, -1, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, -1, -1, 75, 76, 77, 78, 79, -1, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, -1, 93, 94, 95, -1, -1, -1, -1, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, -1, -1, -1, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, -1, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, -1, -1, 211, -1, 213, 214, 215, 216, 217, -1, -1, 220, 221, -1, 223, -1, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, 250, 251, 252, 253, -1, 255, 256, -1, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, -1, 280, -1, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, -1, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, -1, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, -1, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, -1, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, -1, -1, 75, 76, 77, 78, 79, -1, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, -1, 93, 94, 95, -1, -1, -1, -1, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, -1, -1, -1, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, -1, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, -1, -1, 211, -1, 213, 214, 215, 216, 217, -1, -1, 220, 221, -1, 223, -1, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, 250, 251, 252, 253, -1, 255, 256, -1, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, -1, 280, -1, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, -1, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, -1, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, -1, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, -1, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, -1, -1, 75, 76, 77, 78, 79, -1, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, -1, 93, 94, 95, -1, -1, -1, -1, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, -1, -1, -1, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, -1, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, -1, -1, 211, -1, 213, 214, 215, 216, 217, -1, -1, 220, 221, -1, 223, -1, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, 250, 251, 252, 253, -1, 255, 256, -1, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, -1, 280, -1, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, -1, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, -1, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, -1, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, -1, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, -1, -1, 75, 76, 77, 78, 79, -1, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, -1, 93, 94, 95, -1, -1, -1, -1, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, -1, -1, -1, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, -1, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, -1, -1, 211, -1, 213, 214, 215, 216, 217, -1, -1, 220, 221, -1, 223, -1, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, 250, 251, 252, 253, -1, 255, 256, -1, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, -1, 280, -1, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, -1, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, -1, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, -1, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, -1, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, -1, -1, 75, 76, 77, 78, 79, -1, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, -1, 93, 94, 95, -1, -1, -1, -1, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, -1, -1, -1, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, -1, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, -1, -1, 211, -1, 213, 214, 215, 216, 217, -1, -1, 220, 221, -1, 223, -1, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, 250, 251, 252, 253, -1, 255, 256, -1, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, -1, 280, -1, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, -1, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, -1, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, -1, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, -1, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, -1, -1, 75, 76, 77, 78, 79, -1, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, -1, 93, 94, 95, -1, -1, -1, -1, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, -1, -1, -1, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, -1, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, -1, -1, 211, -1, 213, 214, 215, 216, 217, -1, -1, 220, 221, -1, 223, -1, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, 250, 251, 252, 253, -1, 255, 256, -1, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, -1, 280, -1, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, -1, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, -1, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, -1, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, -1, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, -1, -1, 75, 76, 77, 78, 79, -1, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, -1, 93, 94, 95, -1, -1, -1, -1, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, -1, -1, -1, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, -1, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, -1, -1, 211, -1, 213, 214, 215, 216, 217, -1, -1, 220, 221, -1, 223, -1, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, 250, 251, 252, 253, -1, 255, 256, -1, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, -1, 280, -1, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, -1, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, -1, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, -1, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, -1, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, -1, -1, 75, 76, 77, 78, 79, -1, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, -1, 93, 94, 95, -1, -1, -1, -1, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, -1, -1, -1, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, -1, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, -1, -1, 211, -1, 213, 214, 215, 216, 217, -1, -1, 220, 221, -1, 223, -1, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, 250, 251, 252, 253, -1, 255, 256, -1, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, -1, 280, -1, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, -1, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, -1, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, -1, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, -1, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, -1, -1, 75, 76, 77, 78, 79, -1, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, -1, 93, 94, 95, -1, -1, -1, -1, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, -1, -1, -1, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, -1, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, -1, -1, 211, -1, 213, 214, 215, 216, 217, -1, -1, 220, 221, -1, 223, -1, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, 250, 251, 252, 253, -1, 255, 256, -1, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, -1, 280, -1, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, -1, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, -1, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, -1, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, -1, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, -1, -1, 75, 76, 77, 78, 79, -1, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, -1, 93, 94, 95, -1, -1, -1, -1, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, -1, -1, -1, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, -1, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, -1, -1, 211, -1, 213, 214, 215, 216, 217, -1, -1, 220, 221, -1, 223, -1, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, 250, 251, 252, 253, -1, 255, 256, -1, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, -1, 280, -1, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, -1, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, -1, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, -1, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, -1, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, -1, -1, 75, 76, 77, 78, 79, -1, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, -1, 93, 94, 95, -1, -1, -1, -1, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, -1, -1, -1, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, -1, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, -1, -1, 211, -1, 213, 214, 215, 216, 217, -1, -1, 220, 221, -1, 223, -1, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, 250, 251, 252, 253, -1, 255, 256, -1, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, -1, 280, -1, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, -1, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, -1, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, -1, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, -1, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, -1, -1, 75, 76, 77, 78, 79, -1, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, -1, 93, 94, 95, -1, -1, -1, -1, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, -1, -1, -1, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, -1, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, -1, -1, 211, -1, 213, 214, 215, 216, 217, -1, -1, 220, 221, -1, 223, -1, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, 250, 251, 252, 253, -1, 255, 256, -1, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, -1, 280, -1, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, -1, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, -1, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, -1, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, -1, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, -1, -1, 75, 76, 77, 78, 79, -1, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, -1, 93, 94, 95, -1, -1, -1, -1, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, -1, -1, -1, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, -1, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, -1, -1, 211, -1, 213, 214, 215, 216, 217, -1, -1, 220, 221, -1, 223, -1, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, 250, 251, 252, 253, -1, 255, 256, -1, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, -1, 280, -1, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, -1, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, -1, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, -1, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, -1, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, -1, -1, 75, 76, 77, 78, 79, -1, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, -1, 93, 94, 95, -1, -1, -1, -1, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, -1, -1, -1, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, -1, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, -1, -1, 211, -1, 213, 214, 215, 216, 217, -1, -1, 220, 221, -1, 223, -1, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, 250, 251, 252, 253, -1, 255, 256, -1, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, -1, 280, -1, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, -1, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, -1, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, -1, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, -1, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, -1, -1, 75, 76, 77, 78, 79, -1, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, -1, 93, 94, 95, -1, -1, -1, -1, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, -1, -1, -1, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, -1, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, -1, -1, 211, -1, 213, 214, 215, 216, 217, -1, -1, 220, 221, -1, 223, -1, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, 250, 251, 252, 253, -1, 255, 256, -1, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, -1, 280, -1, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, -1, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, -1, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, -1, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, -1, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, -1, -1, 75, 76, 77, 78, 79, -1, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, -1, 93, 94, 95, -1, -1, -1, -1, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, -1, -1, -1, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, -1, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, -1, -1, 211, -1, 213, 214, 215, 216, 217, -1, -1, 220, 221, -1, 223, -1, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, 250, 251, 252, 253, -1, 255, 256, -1, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, -1, 280, -1, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, -1, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, -1, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, -1, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, -1, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, -1, -1, 75, 76, 77, 78, 79, -1, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, -1, 93, 94, 95, -1, -1, -1, -1, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, -1, -1, -1, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, -1, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, -1, -1, 211, -1, 213, 214, 215, 216, 217, -1, -1, 220, 221, -1, 223, -1, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, 250, 251, 252, 253, -1, 255, 256, -1, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, -1, 280, -1, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, -1, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, -1, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, -1, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, -1, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, -1, -1, 75, 76, 77, 78, 79, -1, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, -1, 93, 94, 95, -1, -1, -1, -1, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, -1, -1, -1, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, -1, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, -1, -1, 211, -1, 213, 214, 215, 216, 217, -1, -1, 220, 221, -1, 223, -1, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, 250, 251, 252, 253, -1, 255, 256, -1, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, -1, 280, -1, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, -1, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, -1, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, -1, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, -1, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, -1, -1, 75, 76, 77, 78, 79, -1, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, -1, 93, 94, 95, -1, -1, -1, -1, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, -1, -1, -1, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, -1, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, -1, -1, 211, -1, 213, 214, 215, 216, 217, -1, -1, 220, 221, -1, 223, -1, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, 250, 251, 252, 253, -1, 255, 256, -1, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, -1, 280, -1, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, -1, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, -1, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, -1, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, -1, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, -1, -1, 75, 76, 77, 78, 79, -1, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, -1, 93, 94, 95, -1, -1, -1, -1, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, -1, -1, -1, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, -1, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, -1, -1, 211, -1, 213, 214, 215, 216, 217, -1, -1, 220, 221, -1, 223, -1, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, 250, 251, 252, 253, -1, 255, 256, -1, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, -1, 280, -1, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, -1, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, -1, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, -1, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, -1, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, -1, -1, 75, 76, 77, 78, 79, -1, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, -1, 93, 94, 95, -1, -1, -1, -1, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, -1, -1, -1, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, -1, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, -1, -1, 211, -1, 213, 214, 215, 216, 217, -1, -1, 220, 221, -1, 223, -1, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, 250, 251, 252, 253, -1, 255, 256, -1, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, -1, 280, -1, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, -1, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, -1, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, -1, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, 35, -1, 37, 38, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, -1, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, -1, -1, 75, 76, 77, 78, 79, -1, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, -1, 93, 94, 95, -1, -1, -1, -1, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, -1, -1, -1, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, -1, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, -1, -1, 211, -1, 213, 214, 215, 216, 217, -1, -1, 220, 221, -1, 223, -1, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, 250, 251, 252, 253, -1, 255, 256, -1, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, -1, 280, -1, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, -1, 358, 359, 360, 361, -1, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, -1, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, -1, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, -1, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, -1, -1, 75, 76, 77, 78, 79, -1, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, -1, 93, 94, 95, -1, -1, -1, -1, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, -1, -1, -1, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, -1, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, -1, -1, 211, -1, 213, 214, 215, 216, 217, -1, -1, 220, 221, -1, 223, -1, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, 250, 251, 252, 253, -1, 255, 256, -1, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, -1, 280, -1, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, -1, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, -1, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, -1, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, -1, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, -1, -1, 75, 76, 77, 78, 79, -1, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, -1, 93, 94, 95, -1, -1, -1, -1, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, -1, -1, -1, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, -1, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, -1, -1, 211, -1, 213, 214, 215, 216, 217, -1, -1, 220, 221, -1, 223, -1, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, 250, 251, 252, 253, -1, 255, 256, -1, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, -1, 280, -1, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, -1, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, -1, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, -1, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, -1, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, -1, -1, 75, 76, 77, 78, 79, -1, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, -1, 93, 94, 95, -1, -1, -1, -1, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, -1, -1, -1, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, -1, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, -1, -1, 211, -1, 213, 214, 215, 216, 217, -1, -1, 220, 221, -1, 223, -1, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, 250, 251, 252, 253, -1, 255, 256, -1, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, -1, 280, -1, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, -1, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, -1, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, -1, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, -1, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, -1, -1, 75, 76, 77, 78, 79, -1, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, -1, 93, 94, 95, -1, -1, -1, -1, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, -1, -1, -1, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, -1, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, -1, -1, 211, -1, 213, 214, 215, 216, 217, -1, -1, 220, 221, -1, 223, -1, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, 250, 251, 252, 253, -1, 255, 256, -1, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, -1, 280, -1, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, -1, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, -1, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, -1, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, -1, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, -1, -1, 75, 76, 77, 78, 79, -1, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, -1, 93, 94, 95, -1, -1, -1, -1, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, -1, -1, -1, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, -1, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, -1, -1, 211, -1, 213, 214, 215, 216, 217, -1, -1, 220, 221, -1, 223, -1, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, 250, 251, 252, 253, -1, 255, 256, -1, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, -1, 280, -1, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, -1, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, -1, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, -1, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, -1, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, -1, -1, 75, 76, 77, 78, 79, -1, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, -1, 93, 94, 95, -1, -1, -1, -1, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, -1, -1, -1, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, -1, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, -1, -1, 211, -1, 213, 214, 215, 216, 217, -1, -1, 220, 221, -1, 223, -1, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, 250, 251, 252, 253, -1, 255, 256, -1, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, -1, 280, -1, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, -1, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, -1, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, -1, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, -1, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, -1, -1, 75, 76, 77, 78, 79, -1, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, -1, 93, 94, 95, -1, -1, -1, -1, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, -1, -1, -1, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, -1, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, -1, -1, 211, -1, 213, 214, 215, 216, 217, -1, -1, 220, 221, -1, 223, -1, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, 250, 251, 252, 253, -1, 255, 256, -1, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, -1, 280, -1, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, -1, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, -1, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, -1, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, -1, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, -1, -1, 75, 76, 77, 78, 79, -1, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, -1, 93, 94, 95, -1, -1, -1, -1, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, -1, -1, -1, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, -1, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, -1, -1, 211, -1, 213, 214, 215, 216, 217, -1, -1, 220, 221, -1, 223, -1, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, 250, 251, 252, 253, -1, 255, 256, -1, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, -1, 280, -1, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, -1, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, -1, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, -1, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, -1, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, -1, -1, 75, 76, 77, 78, 79, -1, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, -1, 93, 94, 95, -1, -1, -1, -1, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, -1, -1, -1, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, -1, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, -1, -1, 211, -1, 213, 214, 215, 216, 217, -1, -1, 220, 221, -1, 223, -1, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, 250, 251, 252, 253, -1, 255, 256, -1, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, -1, 280, -1, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, -1, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, -1, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, -1, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, -1, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, -1, -1, 75, 76, 77, 78, 79, -1, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, -1, 93, 94, 95, -1, -1, -1, -1, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, -1, -1, -1, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, -1, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, -1, -1, 211, -1, 213, 214, 215, 216, 217, -1, -1, 220, 221, -1, 223, -1, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, 250, 251, 252, 253, -1, 255, 256, -1, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, -1, 280, -1, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, -1, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, -1, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, -1, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, -1, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, -1, -1, 75, 76, 77, 78, 79, -1, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, -1, 93, 94, 95, -1, -1, -1, -1, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, -1, -1, -1, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, -1, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, -1, -1, 211, -1, 213, 214, 215, 216, 217, -1, -1, 220, 221, -1, 223, -1, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, 250, 251, 252, 253, -1, 255, 256, -1, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, -1, 280, -1, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, -1, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, -1, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, -1, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, -1, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, -1, -1, 75, 76, 77, 78, 79, -1, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, -1, 93, 94, 95, -1, -1, -1, -1, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, -1, -1, -1, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, -1, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, -1, -1, 211, -1, 213, 214, 215, 216, 217, -1, -1, 220, 221, -1, 223, -1, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, 250, 251, 252, 253, -1, 255, 256, -1, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, -1, 280, -1, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, -1, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, -1, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, -1, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, -1, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, -1, -1, 75, 76, 77, 78, 79, -1, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, -1, 93, 94, 95, -1, -1, -1, -1, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, -1, -1, -1, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, -1, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, -1, -1, 211, -1, 213, 214, 215, 216, 217, -1, -1, 220, 221, -1, 223, -1, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, 250, 251, 252, 253, -1, 255, 256, -1, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, -1, 280, -1, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, -1, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, -1, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, -1, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, -1, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, -1, -1, 75, 76, 77, 78, 79, -1, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, -1, 93, 94, 95, -1, -1, -1, -1, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, -1, -1, -1, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, -1, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, -1, -1, 211, -1, 213, 214, 215, 216, 217, -1, -1, 220, 221, -1, 223, -1, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, 250, 251, 252, 253, -1, 255, 256, -1, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, -1, 280, -1, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, -1, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, -1, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, -1, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, -1, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, -1, -1, 75, 76, 77, 78, 79, -1, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, -1, 93, 94, 95, -1, -1, -1, -1, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, -1, -1, -1, 165, 166, 167, 168, -1, 170, 171, -1, 173, 174, 175, -1, 177, 178, 179, 180, 181, -1, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, -1, -1, 211, -1, 213, 214, 215, 216, 217, -1, -1, 220, 221, -1, 223, -1, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, 250, 251, 252, 253, -1, 255, 256, -1, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, -1, 280, -1, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, -1, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, -1, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, -1, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, -1, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, 43, 44, 45, 46, -1, 48, 49, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, -1, -1, 73, -1, 75, 76, 77, 78, 79, 80, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, 92, 93, 94, 95, -1, -1, -1, 99, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, -1, 147, 148, 149, -1, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, 162, -1, 164, 165, 166, 167, 168, -1, 170, -1, -1, -1, 174, 175, -1, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, -1, 196, 197, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, -1, -1, 220, -1, 222, 223, 224, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, -1, -1, 255, 256, 257, 258, -1, -1, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, 279, 280, 281, -1, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, -1, 297, -1, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, 334, 335, 336, 337, 338, 339, -1, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, -1, 382, -1, 384, 385, -1, 387, 388, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, -1, 403, -1, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, -1, 428, 429, 430, 431, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 458, 459, 460, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, -1, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, 71, -1, -1, -1, 75, 76, 77, 78, 79, -1, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, -1, 93, 94, 95, -1, -1, -1, -1, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, 150, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, -1, -1, -1, 165, 166, 167, 168, -1, 170, 171, -1, 173, -1, 175, -1, 177, 178, 179, 180, 181, -1, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, -1, -1, 211, -1, 213, 214, 215, 216, 217, -1, -1, 220, 221, -1, 223, -1, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, -1, 249, 250, 251, 252, 253, -1, 255, 256, -1, 258, -1, 260, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, 278, -1, 280, -1, 282, 283, 284, 285, 286, 287, 288, -1, 290, 291, -1, -1, 294, 295, 296, 297, 298, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, -1, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, -1, 335, 336, 337, 338, 339, 340, -1, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, -1, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, -1, 384, 385, -1, 387, -1, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, 402, 403, 404, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, 427, 428, -1, 430, -1, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, 43, 44, 45, 46, -1, 48, 49, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, -1, -1, 73, -1, 75, 76, 77, 78, 79, 80, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, 92, 93, 94, 95, -1, -1, -1, 99, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, -1, 147, 148, 149, -1, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, 162, -1, 164, 165, 166, 167, 168, -1, 170, -1, -1, -1, 174, 175, -1, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, 197, -1, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, -1, -1, 220, -1, 222, 223, 224, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, -1, -1, 255, 256, 257, 258, 259, -1, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, -1, 279, 280, 281, -1, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, -1, 297, -1, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, 334, 335, 336, 337, 338, 339, -1, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, -1, 382, -1, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, -1, 403, -1, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, -1, 428, -1, 430, 431, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 458, 459, 460, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, 43, 44, 45, 46, -1, 48, 49, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, -1, -1, 73, -1, 75, 76, 77, 78, 79, 80, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, 92, 93, 94, 95, -1, -1, -1, 99, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, -1, 147, 148, 149, -1, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, 162, -1, 164, 165, 166, 167, 168, -1, 170, -1, -1, -1, 174, 175, -1, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, 197, -1, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, -1, -1, 220, -1, 222, 223, 224, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, -1, 255, 256, 257, 258, -1, -1, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, -1, 279, 280, 281, -1, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, -1, 297, -1, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, 334, 335, 336, 337, 338, 339, -1, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, -1, 382, -1, 384, 385, -1, 387, 388, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, -1, 403, -1, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, -1, 428, -1, 430, 431, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 458, 459, 460, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, 43, 44, 45, 46, -1, 48, 49, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, -1, -1, 73, -1, 75, 76, 77, 78, 79, 80, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, 92, 93, 94, 95, -1, -1, -1, 99, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, -1, 147, 148, 149, -1, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, 162, -1, 164, 165, 166, 167, 168, -1, 170, -1, -1, -1, 174, 175, -1, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, 197, -1, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, -1, -1, 220, -1, 222, 223, 224, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, -1, 255, 256, 257, 258, -1, -1, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, -1, 279, 280, 281, -1, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, -1, 297, -1, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, 334, 335, 336, 337, 338, 339, -1, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, -1, 382, -1, 384, 385, -1, 387, 388, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, -1, 403, -1, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, -1, 428, -1, 430, 431, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 458, 459, 460, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, 43, 44, 45, 46, -1, 48, 49, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, -1, -1, 73, -1, 75, 76, 77, 78, 79, 80, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, 92, 93, 94, 95, -1, -1, -1, 99, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, -1, 147, 148, 149, -1, -1, 152, -1, 154, 155, 156, 157, 158, 159, -1, 161, 162, -1, 164, 165, 166, 167, 168, -1, 170, -1, -1, -1, 174, 175, -1, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, 197, -1, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, -1, -1, 220, -1, 222, 223, 224, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, -1, -1, 255, 256, 257, 258, -1, -1, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, -1, 279, 280, 281, -1, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, -1, 297, -1, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, 334, 335, 336, 337, 338, 339, -1, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, -1, 382, -1, 384, 385, -1, 387, 388, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, -1, 403, -1, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, -1, 428, -1, 430, 431, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 458, 459, 460, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, 43, 44, 45, 46, -1, 48, 49, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, -1, -1, 73, -1, 75, 76, 77, 78, 79, 80, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, 92, 93, 94, 95, -1, -1, -1, 99, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, -1, 147, 148, 149, -1, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, 162, -1, 164, 165, 166, 167, 168, -1, 170, -1, -1, -1, 174, 175, -1, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, 197, -1, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, -1, -1, 220, -1, 222, 223, 224, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, -1, -1, 255, 256, 257, 258, -1, -1, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, -1, 279, 280, 281, -1, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, -1, 297, -1, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, 334, 335, 336, 337, 338, 339, -1, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, -1, 382, -1, 384, 385, -1, 387, 388, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, -1, 403, -1, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, -1, 428, -1, 430, 431, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 458, 459, 460, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, 43, 44, 45, 46, -1, 48, 49, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, -1, -1, 73, -1, 75, 76, 77, 78, 79, 80, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, 92, 93, 94, 95, -1, -1, -1, 99, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, -1, 147, 148, 149, -1, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, 162, -1, 164, 165, 166, 167, 168, -1, 170, -1, -1, -1, 174, 175, -1, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, 197, -1, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, -1, -1, 220, -1, 222, 223, 224, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, -1, -1, 255, 256, 257, 258, -1, -1, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, -1, 279, 280, 281, -1, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, -1, 297, -1, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, 334, 335, 336, 337, 338, 339, -1, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, -1, 382, -1, 384, 385, -1, 387, 388, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, -1, 403, -1, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, -1, 428, -1, 430, 431, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 458, 459, 460, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, 43, 44, 45, 46, -1, 48, 49, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, -1, -1, 73, -1, 75, 76, 77, 78, 79, 80, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, 92, 93, 94, 95, -1, -1, -1, 99, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, -1, 147, 148, 149, -1, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, 162, -1, 164, 165, 166, 167, 168, -1, 170, -1, -1, -1, 174, 175, -1, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, 197, -1, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, -1, -1, 220, -1, 222, 223, 224, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, -1, -1, 255, 256, 257, 258, -1, -1, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, -1, 279, 280, 281, -1, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, -1, 297, -1, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, 334, 335, 336, 337, 338, 339, -1, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, -1, 382, -1, 384, 385, -1, 387, 388, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, -1, 403, -1, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, -1, 428, -1, 430, 431, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 458, 459, 460, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, 43, 44, 45, 46, -1, 48, 49, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, -1, -1, 73, -1, 75, 76, 77, 78, 79, 80, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, 92, 93, 94, 95, -1, -1, -1, 99, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, -1, 147, 148, 149, -1, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, 162, -1, 164, 165, 166, 167, 168, -1, 170, -1, -1, -1, 174, 175, -1, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, 197, -1, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, -1, -1, 220, -1, 222, 223, 224, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, -1, -1, 255, 256, 257, 258, -1, -1, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, -1, 279, 280, 281, -1, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, -1, 297, -1, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, 334, 335, 336, 337, 338, 339, -1, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, -1, 382, -1, 384, 385, -1, 387, 388, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, -1, 403, -1, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, -1, 428, -1, 430, 431, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 458, 459, 460, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, 43, 44, 45, 46, -1, 48, 49, 50, 51, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, 63, 64, 65, -1, 67, 68, 69, 70, -1, -1, 73, -1, 75, 76, 77, 78, 79, 80, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, 92, 93, 94, 95, -1, -1, -1, 99, -1, -1, -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, -1, 147, 148, 149, -1, -1, 152, -1, 154, 155, 156, 157, -1, 159, -1, 161, 162, -1, 164, 165, 166, 167, 168, -1, 170, -1, -1, -1, 174, 175, -1, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, 197, -1, 199, 200, 201, 202, 203, 204, -1, 206, -1, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, -1, -1, 220, -1, 222, 223, 224, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, -1, -1, 255, 256, 257, 258, -1, -1, 261, 262, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, -1, 279, 280, 281, -1, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, -1, 297, -1, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, 334, 335, 336, 337, 338, 339, -1, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, -1, 360, 361, 362, 363, 364, 365, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, -1, 382, -1, 384, 385, -1, 387, 388, 389, 390, 391, 392, 393, -1, 395, 396, 397, -1, -1, 400, 401, -1, 403, -1, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, -1, 428, -1, 430, 431, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 458, 459, 460, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, 43, 44, 45, 46, -1, -1, 49, -1, -1, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, -1, -1, 65, -1, 67, 68, 69, 70, -1, -1, 73, -1, 75, 76, 77, 78, 79, 80, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, 92, 93, 94, 95, -1, -1, -1, 99, -1, -1, -1, 103, 104, 105, 106, 107, 108, -1, -1, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, -1, 147, 148, 149, -1, -1, 152, -1, 154, 155, -1, 157, -1, 159, -1, 161, 162, -1, 164, 165, 166, 167, 168, -1, 170, -1, -1, -1, 174, 175, -1, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, 197, -1, 199, 200, 201, 202, -1, -1, -1, -1, -1, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, -1, -1, 220, -1, 222, 223, 224, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, 248, -1, 250, 251, 252, -1, -1, 255, 256, 257, 258, -1, -1, 261, -1, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, -1, 279, 280, 281, -1, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, -1, 297, -1, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, -1, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, 334, 335, 336, 337, 338, 339, -1, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, -1, 360, 361, 362, 363, 364, -1, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, -1, 382, -1, 384, 385, -1, 387, 388, 389, 390, 391, 392, 393, -1, 395, -1, -1, -1, -1, 400, 401, -1, 403, -1, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, -1, -1, -1, 430, 431, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 458, 459, 460, -1, 18, 19, 20, 21, 22, 23, 24, 25, -1, 27, 28, 29, -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, 40, 41, 42, -1, 44, 45, 46, -1, -1, -1, -1, -1, -1, 53, 54, 55, 56, 57, 58, -1, -1, 61, 62, -1, -1, 65, -1, 67, 68, 69, 70, -1, -1, -1, -1, 75, 76, 77, 78, 79, -1, 81, 82, 83, -1, 85, 86, 87, 88, 89, 90, -1, -1, 93, 94, 95, -1, -1, -1, -1, -1, -1, -1, 103, 104, 105, 106, 107, 108, -1, -1, 111, -1, 113, -1, 115, 116, 117, 118, 119, 120, -1, 122, 123, 124, 125, -1, -1, 128, 129, 130, 131, 132, -1, 134, 135, 136, -1, 138, 139, 140, -1, 142, 143, 144, 145, -1, 147, 148, 149, -1, -1, 152, -1, 154, 155, -1, 157, -1, 159, -1, 161, -1, -1, -1, 165, 166, 167, 168, -1, 170, -1, -1, -1, 174, 175, -1, 177, 178, 179, 180, 181, -1, 183, 184, 185, 186, -1, 188, 189, 190, 191, 192, 193, 194, -1, 196, -1, -1, 199, 200, 201, 202, -1, -1, -1, -1, -1, 208, -1, -1, 211, -1, 213, 214, 215, 216, 217, -1, -1, 220, -1, -1, 223, -1, -1, 226, 227, 228, -1, -1, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, -1, -1, -1, 250, 251, 252, -1, -1, 255, 256, -1, 258, -1, -1, 261, -1, 263, 264, 265, -1, 267, 268, -1, -1, 271, 272, 273, -1, -1, 276, 277, -1, -1, 280, -1, -1, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, -1, 294, 295, -1, 297, -1, 299, 300, 301, -1, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, -1, 314, 315, 316, 317, -1, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, -1, 335, 336, 337, 338, 339, -1, 341, 342, 343, 344, 345, 346, 347, 348, 349, -1, 351, 352, 353, 354, 355, -1, 357, 358, -1, 360, 361, -1, 363, 364, -1, 366, -1, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, -1, 382, -1, 384, 385, -1, 387, -1, 389, 390, 391, 392, 393, -1, 395, -1, -1, -1, -1, 400, 401, -1, 403, -1, -1, 406, 407, 408, 409, 410, 411, 412, -1, -1, 415, 416, 417, 418, 419, -1, -1, 422, 423, 424, 425, 426, -1, -1, -1, 430, -1, 432, 433, 434, 435, -1, -1, 438, -1, -1, 441, 442, 443, 444, 445, 446, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 458, 459, 460 }; /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing symbol of state STATE-NUM. */ static const yytype_uint16 yystos[] = { 0, 18, 28, 30, 31, 46, 55, 67, 69, 70, 76, 78, 89, 91, 108, 111, 125, 127, 131, 137, 145, 147, 153, 169, 186, 226, 227, 232, 244, 256, 292, 300, 314, 320, 321, 323, 328, 333, 336, 343, 349, 350, 357, 361, 371, 386, 406, 416, 422, 427, 440, 463, 477, 484, 485, 486, 487, 488, 494, 495, 497, 498, 499, 500, 502, 506, 518, 523, 524, 527, 528, 529, 548, 551, 552, 567, 612, 613, 616, 619, 620, 621, 629, 635, 637, 639, 640, 643, 646, 647, 651, 660, 664, 665, 666, 667, 670, 672, 673, 674, 675, 683, 685, 705, 709, 711, 712, 722, 724, 731, 732, 735, 736, 737, 738, 739, 747, 749, 753, 758, 762, 763, 771, 772, 775, 780, 793, 820, 823, 824, 825, 830, 833, 835, 837, 839, 840, 845, 846, 849, 850, 851, 855, 856, 859, 860, 863, 864, 865, 872, 874, 875, 876, 882, 884, 885, 891, 892, 893, 894, 895, 896, 897, 899, 900, 902, 903, 905, 906, 908, 920, 926, 929, 931, 933, 942, 944, 950, 955, 959, 960, 961, 962, 963, 964, 968, 1003, 400, 443, 877, 25, 73, 88, 106, 112, 129, 140, 148, 160, 165, 172, 191, 216, 237, 271, 295, 305, 306, 309, 335, 338, 342, 344, 351, 354, 373, 380, 385, 386, 389, 393, 403, 408, 420, 433, 636, 877, 3, 18, 19, 20, 21, 22, 23, 24, 25, 27, 28, 29, 37, 38, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 53, 54, 55, 56, 57, 58, 61, 62, 63, 64, 65, 67, 68, 69, 70, 71, 73, 75, 76, 77, 78, 79, 80, 81, 82, 83, 85, 86, 87, 88, 89, 90, 92, 93, 94, 95, 99, 103, 104, 105, 106, 107, 108, 109, 110, 111, 113, 115, 116, 117, 118, 119, 120, 122, 123, 124, 125, 128, 129, 130, 131, 132, 134, 135, 136, 138, 139, 140, 142, 143, 144, 145, 146, 147, 148, 149, 150, 152, 154, 155, 156, 157, 159, 161, 162, 164, 165, 166, 167, 168, 170, 171, 173, 174, 175, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 188, 189, 190, 191, 192, 193, 194, 196, 197, 198, 199, 200, 201, 202, 203, 204, 206, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 220, 221, 222, 223, 224, 226, 227, 228, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 255, 256, 257, 258, 260, 261, 262, 263, 264, 265, 267, 268, 271, 272, 273, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 294, 295, 296, 297, 298, 299, 300, 301, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 351, 352, 353, 354, 355, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, 384, 385, 387, 388, 389, 390, 391, 392, 393, 395, 396, 397, 400, 401, 402, 403, 404, 406, 407, 408, 409, 410, 411, 412, 415, 416, 417, 418, 419, 422, 423, 424, 425, 426, 427, 428, 430, 431, 432, 433, 434, 435, 438, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 1062, 1136, 1144, 1145, 1148, 1149, 1150, 3, 26, 956, 1130, 1144, 1148, 431, 913, 269, 301, 877, 49, 477, 559, 20, 37, 60, 73, 84, 106, 112, 129, 140, 148, 160, 168, 172, 228, 271, 274, 295, 309, 335, 344, 354, 373, 380, 389, 390, 392, 393, 403, 408, 414, 417, 420, 568, 618, 727, 781, 794, 26, 300, 1130, 956, 26, 294, 352, 390, 392, 5, 215, 831, 832, 1139, 20, 25, 60, 73, 88, 106, 129, 140, 148, 160, 165, 172, 191, 237, 271, 284, 295, 306, 309, 335, 338, 342, 344, 351, 354, 373, 380, 386, 389, 393, 401, 403, 408, 420, 433, 636, 740, 741, 742, 877, 1130, 91, 431, 477, 613, 616, 619, 908, 921, 929, 932, 942, 949, 955, 959, 968, 9, 19, 26, 44, 155, 161, 163, 187, 217, 251, 303, 322, 468, 469, 759, 760, 956, 1138, 1140, 26, 91, 318, 350, 764, 765, 766, 1144, 160, 1144, 1135, 1139, 386, 971, 759, 1144, 328, 357, 361, 400, 1130, 284, 237, 106, 191, 344, 385, 386, 477, 841, 842, 343, 1144, 26, 355, 396, 400, 510, 519, 520, 1144, 23, 169, 764, 765, 301, 877, 1144, 214, 26, 126, 973, 974, 61, 85, 228, 246, 335, 344, 355, 396, 400, 446, 507, 508, 509, 510, 26, 355, 396, 400, 510, 400, 270, 1014, 1128, 1144, 971, 470, 1144, 164, 477, 914, 477, 316, 965, 966, 1130, 965, 960, 961, 964, 0, 480, 477, 913, 141, 205, 275, 413, 975, 976, 960, 962, 963, 117, 201, 419, 481, 32, 881, 810, 1136, 744, 1144, 744, 1131, 1144, 304, 744, 403, 1130, 105, 386, 798, 1136, 1144, 1150, 3, 102, 356, 1141, 1142, 1146, 1148, 1149, 1150, 26, 181, 1128, 263, 433, 8, 15, 16, 17, 68, 152, 464, 465, 466, 468, 469, 470, 471, 472, 473, 827, 829, 1092, 1093, 1144, 181, 1130, 798, 1130, 26, 1141, 1142, 798, 1130, 1130, 181, 1128, 1130, 744, 1130, 328, 357, 26, 181, 1014, 1130, 347, 1130, 744, 26, 235, 1141, 1142, 181, 1128, 215, 114, 211, 254, 312, 878, 879, 880, 477, 475, 479, 1119, 1121, 1128, 1134, 1144, 20, 25, 60, 73, 74, 84, 88, 106, 129, 140, 148, 160, 165, 191, 216, 237, 271, 295, 306, 309, 335, 338, 342, 344, 351, 354, 373, 380, 386, 389, 393, 401, 403, 408, 433, 636, 750, 751, 1139, 881, 928, 932, 942, 949, 959, 1128, 239, 744, 477, 181, 744, 403, 1131, 744, 403, 181, 1130, 105, 386, 390, 392, 1141, 1142, 390, 392, 68, 152, 827, 326, 1130, 1130, 1141, 181, 503, 1144, 181, 1130, 181, 744, 1130, 1130, 347, 1130, 744, 235, 1141, 316, 351, 386, 433, 237, 88, 191, 25, 165, 306, 342, 401, 407, 630, 26, 1130, 957, 517, 1139, 1146, 832, 239, 181, 810, 811, 181, 836, 181, 1131, 3, 48, 50, 51, 63, 64, 109, 110, 130, 156, 181, 203, 204, 206, 247, 249, 262, 313, 359, 365, 396, 397, 428, 746, 1036, 1038, 1040, 1042, 1044, 1046, 1047, 1048, 1050, 1051, 1052, 1054, 1055, 1145, 1148, 403, 105, 386, 181, 797, 798, 181, 1142, 1143, 80, 433, 68, 152, 181, 828, 829, 53, 181, 797, 181, 1143, 181, 797, 181, 1130, 181, 1130, 347, 836, 181, 746, 181, 235, 1143, 215, 181, 743, 744, 181, 1129, 1130, 181, 1130, 881, 477, 930, 568, 921, 427, 908, 922, 923, 924, 1146, 913, 201, 419, 1140, 760, 761, 26, 761, 1140, 761, 26, 761, 1140, 761, 761, 761, 1140, 1138, 1138, 956, 761, 304, 477, 477, 588, 588, 588, 269, 398, 481, 588, 344, 1014, 1015, 481, 873, 520, 508, 510, 26, 510, 1139, 477, 927, 53, 433, 431, 843, 844, 80, 782, 782, 1144, 43, 460, 211, 479, 272, 272, 269, 163, 1139, 398, 881, 158, 754, 269, 4, 6, 7, 8, 10, 34, 48, 50, 51, 59, 60, 63, 64, 71, 73, 96, 97, 98, 99, 100, 101, 102, 109, 110, 112, 146, 150, 151, 156, 171, 173, 203, 204, 206, 221, 229, 230, 247, 249, 254, 259, 260, 262, 271, 282, 296, 313, 340, 356, 365, 381, 396, 397, 402, 404, 405, 414, 420, 428, 448, 449, 450, 451, 453, 454, 455, 456, 461, 468, 469, 470, 477, 960, 1039, 1042, 1045, 1046, 1047, 1049, 1050, 1051, 1054, 1055, 1059, 1061, 1062, 1063, 1065, 1088, 1089, 1090, 1094, 1113, 1118, 1125, 1126, 1136, 1137, 1138, 1139, 1144, 1124, 1125, 1139, 26, 525, 1127, 1128, 355, 507, 112, 516, 1139, 517, 1139, 43, 65, 507, 460, 366, 879, 272, 163, 398, 466, 43, 460, 211, 880, 477, 1128, 470, 1121, 1015, 907, 908, 909, 910, 1146, 162, 915, 1059, 1097, 965, 481, 477, 916, 478, 478, 486, 907, 917, 918, 919, 1128, 26, 126, 972, 972, 53, 972, 153, 158, 225, 266, 979, 981, 982, 997, 999, 1000, 1001, 975, 976, 163, 207, 1014, 1016, 477, 62, 252, 285, 324, 357, 477, 808, 285, 320, 324, 357, 479, 745, 285, 324, 357, 3, 83, 135, 231, 285, 292, 324, 357, 389, 391, 440, 518, 521, 886, 887, 888, 889, 776, 22, 131, 285, 324, 357, 424, 534, 1130, 22, 131, 357, 419, 501, 444, 181, 1014, 56, 90, 120, 149, 184, 220, 254, 285, 286, 324, 332, 341, 349, 357, 369, 378, 382, 435, 518, 522, 813, 821, 477, 795, 1121, 324, 501, 187, 146, 22, 28, 41, 70, 120, 124, 131, 134, 159, 193, 252, 254, 264, 273, 285, 324, 327, 328, 357, 424, 530, 532, 533, 654, 4, 468, 469, 627, 1140, 26, 181, 1128, 744, 744, 477, 826, 285, 357, 479, 146, 269, 120, 285, 324, 357, 821, 22, 131, 285, 324, 357, 187, 496, 324, 440, 463, 489, 496, 120, 285, 324, 357, 821, 269, 285, 324, 146, 35, 54, 104, 190, 238, 241, 252, 284, 324, 329, 351, 357, 371, 530, 624, 625, 285, 324, 432, 654, 662, 285, 324, 357, 83, 124, 134, 285, 320, 324, 357, 520, 508, 187, 146, 41, 122, 324, 357, 530, 531, 285, 324, 328, 357, 81, 123, 287, 391, 269, 22, 28, 131, 285, 324, 357, 549, 550, 496, 158, 324, 489, 496, 146, 324, 357, 530, 1130, 223, 114, 270, 445, 481, 878, 26, 126, 429, 470, 478, 803, 1059, 1098, 1099, 1145, 1059, 1120, 3, 26, 30, 31, 32, 33, 34, 35, 36, 39, 52, 59, 60, 66, 72, 74, 84, 91, 96, 97, 98, 100, 101, 102, 112, 114, 121, 126, 127, 133, 137, 141, 151, 153, 158, 160, 163, 169, 172, 176, 187, 195, 205, 207, 218, 219, 225, 229, 230, 254, 259, 266, 269, 270, 274, 275, 293, 302, 318, 331, 350, 356, 367, 383, 386, 394, 398, 399, 405, 413, 414, 420, 421, 429, 436, 437, 439, 440, 470, 1133, 1147, 1148, 1149, 1150, 1151, 1119, 421, 904, 269, 239, 810, 477, 1130, 1036, 403, 105, 386, 798, 263, 433, 68, 152, 829, 1130, 798, 798, 1130, 347, 158, 1130, 1036, 215, 744, 1130, 478, 588, 1130, 66, 1036, 254, 163, 477, 713, 1130, 489, 35, 898, 1130, 254, 489, 444, 181, 1128, 489, 744, 744, 713, 417, 568, 269, 158, 857, 858, 489, 254, 43, 504, 254, 408, 661, 254, 916, 83, 285, 638, 81, 123, 287, 391, 24, 45, 202, 686, 35, 713, 158, 181, 489, 433, 181, 1128, 181, 614, 1128, 1128, 433, 744, 782, 1136, 1136, 1136, 1130, 158, 636, 49, 103, 200, 252, 346, 146, 57, 330, 481, 535, 146, 477, 146, 430, 1053, 1053, 1053, 477, 1041, 1041, 298, 477, 1043, 146, 63, 64, 1053, 1041, 1038, 442, 463, 477, 1056, 477, 1056, 481, 535, 34, 1037, 477, 107, 179, 240, 243, 348, 458, 477, 1057, 1058, 745, 1041, 444, 146, 481, 535, 146, 481, 181, 743, 181, 744, 181, 744, 146, 481, 535, 1143, 146, 535, 146, 146, 535, 146, 535, 146, 81, 123, 287, 391, 158, 146, 535, 146, 158, 181, 181, 517, 146, 481, 535, 146, 481, 535, 146, 269, 1097, 386, 478, 481, 151, 269, 405, 514, 517, 627, 925, 921, 207, 1016, 761, 956, 761, 956, 761, 956, 761, 956, 761, 956, 956, 956, 761, 956, 477, 589, 590, 1144, 589, 26, 106, 129, 160, 165, 215, 216, 306, 338, 344, 351, 386, 389, 408, 767, 1127, 1143, 766, 1130, 187, 481, 945, 1139, 1036, 1100, 35, 1143, 782, 478, 481, 1128, 1130, 223, 1144, 158, 158, 767, 1143, 343, 1144, 517, 269, 477, 1122, 475, 960, 1101, 1059, 1117, 477, 477, 158, 477, 477, 960, 477, 477, 477, 477, 477, 477, 1059, 477, 477, 477, 477, 477, 477, 477, 477, 960, 477, 477, 477, 477, 477, 477, 477, 477, 1059, 1059, 1059, 960, 1059, 1097, 1121, 1139, 477, 1139, 3, 8, 11, 15, 16, 17, 32, 35, 40, 47, 72, 182, 187, 209, 210, 224, 257, 271, 274, 362, 461, 464, 465, 466, 468, 469, 470, 471, 472, 473, 1092, 1094, 1096, 441, 1075, 281, 1059, 207, 481, 969, 477, 1139, 1121, 969, 115, 183, 526, 481, 65, 112, 517, 35, 3, 112, 228, 515, 627, 1055, 1139, 1139, 86, 128, 1071, 95, 112, 511, 512, 514, 627, 112, 511, 223, 1128, 87, 329, 748, 478, 481, 514, 627, 911, 913, 478, 481, 966, 1129, 35, 478, 481, 916, 962, 962, 977, 978, 1059, 962, 155, 251, 988, 213, 252, 312, 360, 419, 26, 983, 1059, 468, 469, 984, 985, 1059, 1061, 997, 998, 982, 981, 979, 980, 158, 1000, 264, 1002, 979, 997, 1016, 934, 1128, 35, 1144, 1097, 62, 398, 398, 344, 187, 198, 275, 278, 359, 429, 470, 801, 802, 803, 805, 807, 809, 1036, 1145, 398, 432, 398, 344, 1133, 479, 398, 398, 344, 225, 398, 398, 389, 507, 285, 886, 888, 466, 890, 158, 169, 187, 333, 777, 778, 66, 84, 142, 160, 302, 414, 585, 586, 84, 112, 254, 398, 84, 398, 112, 254, 344, 84, 124, 134, 285, 324, 710, 344, 644, 20, 25, 60, 73, 88, 129, 140, 160, 165, 237, 271, 306, 338, 344, 351, 354, 386, 393, 401, 408, 433, 636, 1130, 146, 324, 357, 530, 269, 627, 269, 349, 220, 398, 1144, 398, 259, 627, 116, 208, 344, 355, 400, 509, 744, 330, 357, 813, 822, 478, 796, 801, 398, 420, 389, 1128, 74, 142, 181, 575, 585, 1144, 74, 84, 847, 289, 269, 269, 340, 342, 403, 84, 847, 29, 327, 340, 342, 403, 340, 1128, 159, 193, 264, 744, 477, 398, 398, 180, 477, 539, 234, 389, 417, 442, 539, 84, 481, 4, 4, 285, 187, 146, 120, 324, 357, 530, 421, 421, 253, 1036, 398, 344, 477, 827, 1130, 1128, 269, 398, 398, 344, 822, 386, 386, 398, 398, 386, 713, 106, 357, 521, 398, 491, 521, 269, 398, 398, 344, 822, 1128, 398, 398, 1128, 1038, 627, 53, 626, 627, 627, 104, 238, 241, 53, 398, 489, 245, 344, 489, 252, 625, 398, 398, 259, 1139, 654, 398, 398, 344, 1139, 398, 309, 398, 309, 713, 389, 1014, 289, 289, 84, 398, 847, 344, 398, 398, 539, 539, 744, 744, 744, 744, 1128, 42, 426, 42, 42, 398, 42, 398, 426, 344, 481, 521, 420, 671, 1142, 398, 491, 521, 1128, 398, 344, 285, 324, 312, 325, 353, 513, 878, 1098, 1098, 1099, 478, 13, 14, 481, 975, 976, 476, 482, 1134, 1144, 1128, 209, 1036, 269, 209, 444, 209, 627, 744, 744, 209, 269, 209, 209, 269, 81, 123, 287, 391, 1036, 269, 209, 209, 209, 398, 163, 398, 553, 408, 477, 35, 146, 744, 714, 715, 1147, 24, 886, 1036, 269, 146, 641, 1130, 254, 289, 477, 490, 727, 421, 316, 433, 1128, 26, 386, 440, 817, 490, 146, 1142, 91, 169, 505, 567, 620, 685, 762, 780, 882, 146, 1139, 662, 663, 146, 269, 1139, 1142, 231, 744, 744, 744, 744, 264, 117, 201, 406, 419, 687, 688, 138, 311, 477, 671, 254, 490, 1128, 254, 622, 624, 254, 35, 264, 289, 477, 588, 588, 181, 617, 1128, 158, 181, 783, 1134, 477, 717, 808, 477, 799, 799, 35, 1036, 215, 440, 442, 958, 346, 811, 810, 1036, 1131, 477, 1097, 1138, 746, 1053, 1053, 34, 1037, 396, 396, 1138, 1138, 1036, 475, 475, 1138, 398, 398, 398, 477, 398, 1138, 1041, 797, 798, 1143, 1142, 146, 535, 146, 421, 146, 421, 828, 829, 535, 797, 1143, 797, 1130, 1130, 1036, 746, 1143, 671, 146, 146, 535, 743, 744, 1129, 1130, 1130, 744, 478, 181, 1128, 921, 923, 934, 357, 956, 956, 956, 956, 956, 956, 589, 478, 481, 478, 166, 307, 339, 352, 387, 1129, 743, 105, 354, 797, 1129, 263, 797, 797, 1129, 1127, 1127, 1129, 743, 398, 440, 773, 141, 225, 668, 669, 20, 144, 340, 360, 946, 1014, 258, 947, 478, 481, 928, 398, 1128, 841, 842, 844, 765, 764, 765, 163, 170, 774, 1144, 25, 74, 106, 129, 140, 160, 165, 216, 237, 306, 309, 335, 338, 344, 351, 380, 386, 389, 408, 433, 636, 755, 756, 1097, 1119, 476, 1097, 1101, 1102, 436, 1114, 1115, 1059, 1097, 477, 1138, 1138, 3, 107, 179, 240, 243, 348, 458, 1103, 1104, 1139, 1097, 1097, 1097, 1138, 1138, 1059, 827, 1059, 1105, 340, 468, 469, 477, 1060, 1061, 1094, 1107, 478, 1097, 1059, 1097, 1108, 1059, 52, 163, 219, 399, 1059, 1097, 1111, 1097, 245, 1061, 1059, 1069, 1070, 1071, 245, 1059, 1071, 478, 481, 1138, 1057, 1036, 1059, 1059, 1059, 1059, 1147, 396, 39, 383, 1123, 744, 1059, 477, 960, 1112, 126, 128, 151, 254, 259, 264, 405, 415, 1059, 477, 1059, 398, 47, 182, 187, 224, 362, 1059, 1059, 1059, 1059, 1059, 1059, 1059, 1059, 1059, 1059, 26, 33, 367, 1091, 172, 154, 1076, 340, 477, 1088, 168, 228, 386, 390, 392, 417, 970, 1128, 1126, 163, 1004, 1098, 1004, 1128, 400, 477, 1139, 481, 478, 180, 180, 535, 919, 909, 908, 912, 1059, 478, 237, 254, 967, 919, 917, 481, 36, 121, 421, 791, 340, 341, 468, 469, 985, 987, 1061, 360, 213, 270, 481, 4, 986, 1138, 986, 340, 341, 987, 1127, 258, 364, 948, 998, 980, 421, 943, 35, 1144, 478, 1142, 1130, 1130, 278, 53, 1145, 478, 803, 805, 802, 805, 1145, 275, 478, 481, 745, 1142, 1130, 1130, 1133, 1142, 1130, 1130, 1142, 1131, 1130, 112, 514, 1140, 335, 420, 764, 344, 169, 764, 477, 1130, 421, 784, 213, 213, 421, 477, 611, 181, 1130, 259, 1142, 1130, 1130, 1059, 259, 1130, 1130, 29, 327, 398, 398, 1130, 398, 645, 239, 810, 477, 744, 744, 1036, 403, 105, 386, 798, 433, 68, 152, 829, 798, 798, 1130, 744, 1130, 744, 347, 158, 1036, 744, 215, 175, 252, 285, 324, 425, 648, 649, 650, 1014, 398, 847, 344, 259, 148, 116, 208, 1142, 1130, 269, 1130, 478, 481, 1141, 1143, 1130, 324, 530, 181, 575, 254, 1036, 1130, 1138, 1144, 1128, 1130, 148, 223, 1130, 26, 420, 1130, 181, 1130, 181, 1144, 342, 403, 342, 403, 223, 1130, 26, 420, 1130, 223, 340, 1128, 22, 131, 357, 655, 656, 657, 658, 1147, 1142, 1130, 112, 164, 255, 421, 538, 541, 542, 1147, 1130, 70, 267, 1130, 533, 398, 389, 1128, 269, 398, 847, 344, 1132, 1144, 1132, 481, 478, 481, 1142, 1130, 852, 853, 1147, 269, 324, 398, 679, 148, 1142, 1130, 1130, 1015, 1015, 1142, 1130, 1015, 1131, 1141, 3, 83, 136, 193, 291, 412, 420, 423, 492, 148, 1142, 1130, 1130, 324, 1142, 1130, 324, 357, 530, 624, 627, 744, 1130, 627, 744, 1130, 627, 1142, 1130, 1142, 1130, 1130, 1142, 817, 1130, 861, 862, 1147, 1130, 324, 357, 530, 531, 1128, 1128, 1130, 1130, 1130, 1130, 1142, 1130, 22, 28, 131, 285, 324, 357, 285, 324, 357, 713, 324, 357, 324, 357, 120, 324, 1028, 1144, 181, 723, 1144, 181, 1144, 1142, 1130, 1130, 1139, 1130, 22, 550, 354, 1141, 324, 357, 530, 1130, 1130, 398, 398, 79, 411, 312, 481, 975, 975, 975, 1059, 1059, 429, 1099, 478, 1059, 1120, 259, 752, 1139, 35, 129, 744, 752, 752, 209, 421, 421, 752, 744, 752, 752, 744, 215, 744, 752, 752, 752, 308, 554, 554, 191, 386, 684, 1059, 1036, 744, 478, 481, 466, 687, 577, 1147, 1130, 57, 163, 344, 432, 642, 649, 650, 146, 264, 224, 569, 571, 573, 575, 582, 585, 23, 187, 335, 384, 492, 493, 158, 1132, 433, 1128, 35, 680, 387, 1015, 713, 503, 1144, 504, 274, 568, 1130, 160, 744, 1097, 309, 1139, 713, 713, 713, 713, 264, 269, 274, 477, 713, 1026, 1027, 1028, 354, 146, 477, 146, 146, 145, 959, 744, 264, 569, 1144, 421, 606, 440, 540, 254, 35, 588, 1139, 254, 269, 3, 718, 719, 713, 478, 800, 801, 806, 35, 215, 332, 401, 439, 812, 813, 814, 812, 269, 215, 517, 178, 178, 158, 535, 35, 1097, 478, 478, 535, 475, 460, 460, 478, 478, 1138, 476, 1138, 478, 179, 240, 1058, 240, 1058, 1058, 1138, 243, 478, 535, 743, 744, 1132, 744, 1132, 535, 535, 535, 535, 215, 535, 354, 158, 517, 535, 535, 269, 535, 254, 112, 283, 477, 935, 959, 477, 951, 952, 953, 1144, 478, 590, 187, 187, 187, 187, 187, 444, 1129, 627, 628, 172, 768, 769, 1142, 23, 774, 398, 477, 163, 144, 360, 144, 360, 340, 419, 242, 1036, 1142, 440, 615, 782, 782, 163, 269, 768, 53, 535, 810, 1036, 403, 386, 798, 263, 433, 798, 798, 1036, 215, 744, 1130, 478, 476, 476, 481, 1059, 133, 1115, 1116, 35, 478, 1059, 478, 478, 478, 163, 478, 478, 478, 478, 478, 481, 478, 293, 1106, 478, 477, 1060, 1060, 1097, 11, 15, 16, 17, 187, 209, 271, 464, 465, 466, 468, 469, 470, 471, 472, 473, 1094, 1060, 478, 478, 158, 163, 1109, 1110, 478, 35, 1111, 1097, 1111, 1111, 163, 478, 478, 1147, 290, 1073, 35, 478, 481, 1059, 1147, 481, 1059, 1122, 1059, 478, 460, 1060, 1060, 139, 1097, 163, 126, 128, 151, 259, 264, 405, 415, 477, 139, 827, 1059, 383, 1123, 1059, 1112, 1059, 398, 477, 960, 477, 477, 280, 1080, 477, 1097, 390, 392, 390, 392, 1128, 971, 971, 971, 218, 341, 457, 477, 960, 1005, 1006, 1007, 1014, 1019, 1029, 1062, 1064, 1065, 1144, 437, 1024, 975, 1024, 879, 1138, 1057, 512, 919, 237, 477, 978, 271, 1092, 1095, 462, 792, 4, 1138, 987, 270, 419, 984, 233, 1005, 437, 1025, 1144, 809, 745, 805, 805, 53, 807, 472, 1143, 1143, 269, 1129, 272, 269, 1059, 586, 1132, 477, 477, 477, 611, 191, 589, 703, 146, 535, 398, 1142, 1130, 517, 1130, 1036, 1130, 444, 744, 744, 744, 744, 81, 123, 287, 391, 1036, 1130, 631, 1130, 175, 425, 398, 398, 631, 648, 654, 324, 357, 530, 1130, 1130, 1130, 199, 1130, 259, 801, 284, 357, 398, 254, 146, 273, 652, 703, 357, 22, 131, 328, 329, 357, 534, 543, 544, 654, 848, 1130, 349, 146, 535, 146, 535, 1130, 1130, 1130, 1130, 349, 349, 223, 657, 658, 657, 478, 481, 659, 1139, 191, 478, 481, 466, 479, 1142, 1130, 324, 357, 530, 148, 1130, 1130, 1130, 285, 324, 357, 22, 131, 285, 324, 357, 1036, 253, 1036, 478, 481, 466, 1128, 398, 1143, 421, 676, 1130, 225, 291, 259, 1139, 291, 1143, 418, 1130, 398, 398, 344, 481, 817, 284, 357, 84, 398, 847, 344, 112, 158, 545, 398, 398, 235, 235, 235, 398, 398, 344, 398, 398, 344, 398, 344, 398, 344, 269, 398, 535, 1036, 254, 1139, 357, 848, 146, 535, 398, 398, 1130, 398, 344, 1142, 1130, 478, 478, 478, 1099, 476, 1036, 744, 209, 752, 1132, 1132, 209, 209, 1130, 209, 374, 375, 555, 1139, 555, 175, 478, 478, 163, 713, 715, 253, 271, 468, 469, 627, 716, 805, 1095, 1139, 1151, 269, 66, 72, 84, 112, 114, 167, 195, 254, 259, 302, 318, 414, 578, 579, 581, 145, 436, 489, 517, 1130, 517, 652, 1128, 1128, 1128, 478, 481, 1143, 172, 335, 1143, 1138, 408, 1128, 588, 3, 158, 681, 43, 504, 326, 386, 661, 105, 916, 163, 861, 540, 589, 1128, 688, 720, 721, 1139, 478, 481, 1130, 158, 589, 1128, 614, 1128, 1130, 615, 477, 570, 1128, 478, 1132, 440, 442, 607, 539, 35, 146, 959, 606, 398, 146, 1014, 466, 478, 481, 478, 481, 112, 466, 815, 1139, 517, 386, 804, 805, 158, 816, 814, 117, 201, 350, 419, 870, 1130, 175, 959, 1036, 478, 1138, 1056, 1056, 476, 476, 478, 535, 421, 535, 421, 535, 1130, 1130, 671, 535, 744, 146, 427, 385, 420, 936, 937, 938, 1144, 269, 939, 953, 954, 481, 1004, 466, 1122, 344, 344, 344, 344, 344, 1129, 481, 1142, 440, 481, 770, 272, 1015, 354, 144, 144, 105, 252, 1128, 1130, 1143, 767, 535, 1142, 209, 209, 209, 627, 209, 209, 209, 209, 209, 1101, 394, 1059, 137, 1036, 478, 1059, 1059, 1059, 1109, 478, 1097, 481, 1036, 1060, 1060, 1060, 1060, 126, 128, 254, 264, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1059, 1059, 1110, 1109, 1036, 478, 478, 478, 1097, 478, 481, 53, 1061, 1074, 478, 1147, 1070, 299, 379, 1072, 478, 481, 432, 1066, 35, 478, 1139, 1059, 32, 32, 1059, 478, 1059, 163, 477, 1100, 1059, 478, 139, 1060, 1060, 139, 139, 1059, 1059, 976, 437, 477, 1081, 1144, 478, 1097, 481, 971, 971, 971, 971, 1128, 1128, 1128, 960, 1019, 1029, 163, 477, 960, 1006, 1007, 35, 1008, 1009, 1144, 481, 92, 164, 197, 212, 222, 248, 334, 1011, 1009, 35, 1008, 1010, 1144, 1009, 463, 1023, 1121, 1059, 172, 989, 478, 989, 478, 928, 477, 792, 155, 217, 270, 95, 1059, 331, 941, 478, 472, 809, 408, 166, 339, 345, 352, 387, 409, 779, 158, 779, 478, 477, 593, 594, 786, 1064, 1144, 589, 589, 703, 1134, 478, 114, 195, 252, 254, 704, 1130, 1130, 35, 1130, 421, 421, 744, 744, 744, 744, 215, 745, 1142, 1130, 398, 847, 344, 398, 199, 53, 389, 1130, 146, 575, 477, 577, 373, 167, 180, 254, 539, 489, 105, 167, 254, 373, 376, 539, 625, 357, 544, 408, 1130, 1144, 349, 656, 1130, 542, 716, 1147, 284, 357, 398, 847, 344, 1130, 398, 398, 398, 344, 165, 271, 376, 725, 726, 165, 271, 733, 734, 398, 398, 344, 478, 478, 478, 853, 253, 627, 805, 854, 1095, 1139, 1151, 324, 1130, 477, 440, 677, 1140, 1139, 1139, 1139, 1130, 1130, 1130, 862, 53, 389, 1130, 1130, 1130, 1130, 427, 1130, 1130, 158, 158, 326, 158, 181, 1142, 1130, 1130, 1142, 1130, 1130, 1130, 1130, 1130, 1130, 148, 1130, 72, 536, 146, 24, 45, 408, 1144, 1130, 1139, 654, 1130, 1130, 975, 478, 209, 752, 209, 209, 752, 752, 209, 752, 489, 421, 560, 561, 631, 703, 440, 442, 744, 1128, 477, 744, 1130, 1060, 29, 53, 580, 115, 183, 114, 259, 213, 1128, 817, 165, 306, 699, 706, 707, 1144, 641, 289, 477, 570, 583, 194, 600, 573, 1143, 1143, 1036, 477, 540, 26, 117, 201, 350, 419, 682, 398, 678, 1142, 181, 1128, 663, 444, 269, 1005, 817, 319, 689, 478, 481, 1028, 652, 671, 478, 622, 35, 264, 289, 477, 930, 572, 574, 576, 585, 1144, 289, 601, 602, 570, 600, 539, 267, 269, 608, 959, 617, 615, 540, 1139, 1134, 784, 716, 3, 719, 806, 1059, 1059, 481, 477, 812, 408, 481, 398, 477, 631, 478, 476, 1132, 1132, 535, 354, 535, 426, 478, 481, 1122, 82, 941, 478, 481, 952, 1025, 1059, 1129, 1129, 1129, 1129, 1129, 627, 169, 769, 478, 1130, 105, 774, 163, 259, 757, 1139, 757, 757, 209, 757, 757, 757, 757, 757, 1059, 478, 478, 1110, 478, 1059, 163, 126, 128, 264, 477, 478, 447, 1068, 1097, 317, 426, 53, 1074, 1061, 438, 438, 478, 1059, 252, 1059, 481, 1067, 1038, 1059, 1059, 1059, 1100, 478, 1059, 32, 32, 1059, 1059, 139, 478, 478, 1059, 1082, 1144, 478, 1059, 1128, 1128, 1128, 1128, 1009, 1010, 1009, 477, 452, 1061, 478, 1144, 477, 1006, 212, 279, 1012, 1006, 1012, 212, 1011, 1012, 212, 388, 1017, 477, 1144, 477, 276, 53, 176, 996, 1139, 996, 1139, 478, 827, 264, 1125, 408, 478, 398, 764, 163, 703, 1059, 478, 481, 440, 72, 789, 789, 478, 478, 188, 591, 115, 183, 193, 114, 423, 535, 1036, 1132, 1132, 1130, 1130, 1130, 1130, 1130, 1143, 1130, 575, 653, 657, 1140, 580, 181, 259, 627, 580, 259, 1140, 1144, 1036, 535, 535, 466, 53, 389, 1130, 1130, 1130, 1130, 1142, 1130, 1130, 1138, 1138, 1036, 481, 1138, 1138, 481, 1142, 1130, 1130, 398, 1059, 66, 1143, 1130, 398, 398, 163, 187, 440, 1129, 1129, 744, 1129, 146, 1130, 744, 1139, 1139, 1036, 535, 535, 478, 209, 752, 752, 752, 752, 477, 556, 557, 489, 119, 165, 198, 165, 163, 702, 1059, 254, 579, 112, 35, 817, 588, 421, 610, 1136, 32, 145, 187, 264, 569, 545, 143, 189, 477, 354, 421, 589, 35, 1143, 676, 504, 254, 477, 160, 1130, 1097, 250, 268, 690, 691, 692, 158, 695, 1139, 354, 540, 145, 959, 744, 264, 569, 615, 478, 481, 440, 577, 53, 606, 545, 601, 78, 389, 609, 440, 883, 35, 609, 163, 269, 477, 1139, 803, 818, 819, 1145, 1036, 158, 1128, 163, 398, 838, 196, 632, 535, 535, 535, 1130, 959, 283, 959, 938, 269, 477, 940, 466, 953, 941, 272, 207, 535, 768, 757, 478, 1060, 163, 477, 1100, 477, 478, 481, 478, 1074, 478, 426, 370, 478, 478, 478, 1059, 1059, 1059, 478, 289, 1083, 478, 1020, 1021, 1064, 477, 1073, 1008, 477, 1129, 1006, 269, 421, 1013, 1006, 212, 1006, 1136, 1027, 477, 1027, 1144, 94, 173, 337, 477, 990, 991, 992, 993, 994, 995, 1059, 1059, 439, 1077, 1077, 478, 956, 768, 269, 768, 478, 591, 594, 271, 827, 744, 744, 790, 790, 318, 591, 477, 817, 478, 398, 357, 947, 478, 481, 35, 146, 536, 716, 1143, 1130, 398, 477, 798, 827, 829, 726, 477, 477, 734, 1130, 478, 477, 357, 947, 1130, 1130, 477, 477, 477, 440, 463, 901, 326, 901, 901, 158, 536, 752, 562, 563, 1147, 49, 93, 118, 135, 139, 159, 162, 177, 259, 310, 558, 556, 1139, 798, 35, 834, 834, 1128, 703, 478, 180, 477, 610, 236, 592, 191, 477, 707, 699, 477, 1128, 478, 354, 26, 77, 85, 113, 167, 180, 192, 373, 376, 584, 584, 1127, 1130, 1132, 478, 959, 677, 146, 105, 652, 163, 691, 340, 386, 693, 132, 696, 436, 698, 1130, 35, 1130, 615, 570, 1128, 478, 574, 273, 3, 603, 1148, 607, 601, 606, 117, 131, 299, 1130, 58, 66, 228, 959, 744, 1014, 785, 786, 805, 478, 481, 408, 1024, 368, 368, 478, 631, 252, 425, 633, 634, 936, 84, 785, 127, 1059, 1130, 535, 1060, 1100, 478, 1069, 1097, 252, 459, 53, 975, 478, 481, 35, 1022, 112, 1034, 1035, 1060, 75, 1129, 478, 1059, 477, 1006, 1013, 477, 478, 1027, 478, 477, 358, 477, 478, 481, 1078, 1079, 1144, 770, 779, 535, 789, 817, 477, 791, 791, 1128, 817, 589, 610, 1130, 389, 657, 180, 421, 537, 357, 947, 1130, 1100, 158, 729, 729, 1100, 1100, 1059, 389, 1097, 1097, 546, 547, 1146, 743, 744, 743, 744, 1129, 535, 478, 481, 470, 477, 514, 564, 627, 898, 1139, 898, 254, 259, 310, 898, 898, 1024, 834, 38, 185, 158, 252, 587, 477, 623, 1059, 164, 288, 363, 269, 596, 597, 598, 389, 478, 1136, 5, 708, 570, 600, 1130, 478, 652, 152, 728, 540, 883, 1128, 444, 1005, 898, 340, 372, 697, 477, 145, 652, 959, 930, 601, 570, 600, 577, 477, 608, 606, 607, 341, 341, 66, 272, 66, 615, 784, 478, 481, 812, 818, 1036, 127, 440, 440, 425, 631, 426, 1130, 478, 255, 419, 652, 478, 478, 478, 426, 1097, 174, 311, 341, 1084, 1023, 1020, 477, 1060, 478, 481, 35, 1030, 1031, 1144, 478, 1129, 1097, 478, 1097, 477, 1097, 991, 481, 35, 163, 790, 610, 827, 792, 792, 588, 610, 478, 703, 1130, 623, 1059, 389, 478, 275, 347, 315, 730, 730, 478, 478, 478, 1130, 478, 478, 478, 481, 1138, 901, 563, 514, 565, 566, 1139, 1139, 259, 589, 470, 589, 1139, 1139, 132, 193, 624, 478, 117, 419, 269, 598, 269, 597, 1130, 477, 478, 481, 545, 354, 652, 744, 35, 35, 477, 1130, 694, 1144, 1059, 699, 883, 615, 606, 545, 601, 477, 604, 605, 1064, 1144, 609, 607, 608, 272, 272, 477, 188, 787, 786, 27, 202, 871, 165, 165, 959, 1024, 357, 47, 95, 410, 1059, 1085, 1086, 1085, 1085, 478, 1027, 481, 1035, 1147, 478, 481, 158, 1036, 478, 478, 478, 990, 478, 1079, 1081, 768, 791, 437, 595, 478, 592, 703, 947, 1130, 798, 53, 947, 398, 546, 744, 478, 481, 589, 340, 478, 377, 57, 252, 330, 357, 599, 599, 478, 5, 354, 1130, 725, 959, 652, 478, 1136, 607, 601, 606, 1059, 478, 481, 789, 789, 608, 609, 785, 477, 540, 255, 477, 866, 868, 872, 932, 942, 949, 959, 798, 798, 951, 1086, 340, 157, 297, 157, 297, 142, 1087, 1087, 1087, 478, 1061, 1031, 276, 3, 112, 254, 259, 1032, 1033, 325, 1018, 478, 535, 792, 477, 703, 596, 947, 744, 477, 566, 698, 21, 112, 259, 1130, 652, 883, 477, 608, 606, 607, 478, 605, 790, 790, 609, 478, 786, 788, 609, 867, 868, 869, 960, 961, 481, 481, 1024, 32, 95, 172, 252, 395, 1073, 1060, 1060, 259, 1033, 477, 1059, 703, 1097, 145, 652, 4, 700, 701, 1138, 1139, 1147, 609, 607, 608, 789, 787, 478, 481, 1024, 478, 480, 398, 163, 1086, 340, 277, 75, 1059, 478, 478, 699, 478, 481, 608, 609, 790, 540, 786, 869, 368, 368, 1030, 478, 1136, 701, 609, 609, 440, 440, 478, 477, 1024, 165, 165, 700, 798, 798, 478 }; /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ static const yytype_uint16 yyr1[] = { 0, 483, 484, 485, 485, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 486, 487, 488, 489, 489, 489, 490, 490, 491, 491, 492, 492, 492, 492, 492, 492, 492, 492, 492, 493, 493, 493, 493, 493, 493, 494, 495, 495, 496, 496, 497, 497, 497, 497, 498, 498, 498, 498, 498, 498, 499, 500, 501, 501, 502, 502, 502, 502, 503, 503, 504, 504, 505, 505, 505, 505, 505, 505, 506, 506, 506, 506, 507, 507, 507, 508, 508, 508, 508, 509, 509, 509, 509, 509, 509, 509, 509, 509, 509, 509, 510, 510, 511, 511, 512, 512, 513, 513, 513, 513, 514, 514, 514, 514, 515, 515, 515, 515, 515, 515, 515, 516, 516, 516, 517, 517, 518, 518, 519, 519, 519, 519, 520, 520, 521, 521, 522, 522, 523, 523, 523, 523, 523, 523, 523, 524, 525, 525, 526, 526, 527, 528, 528, 528, 528, 528, 529, 529, 529, 529, 529, 529, 529, 529, 529, 529, 529, 529, 529, 529, 529, 529, 529, 529, 529, 530, 530, 531, 531, 532, 533, 533, 533, 533, 533, 533, 533, 533, 533, 533, 533, 533, 533, 533, 533, 533, 533, 533, 533, 533, 533, 533, 533, 533, 533, 533, 533, 533, 533, 533, 533, 533, 533, 533, 533, 533, 533, 533, 533, 533, 533, 533, 533, 533, 533, 533, 533, 533, 533, 533, 533, 533, 533, 533, 533, 533, 534, 534, 535, 535, 535, 536, 536, 537, 537, 538, 538, 538, 538, 539, 540, 540, 541, 541, 542, 542, 542, 542, 543, 543, 544, 544, 544, 544, 545, 545, 545, 545, 546, 547, 547, 548, 549, 549, 550, 550, 550, 550, 551, 551, 552, 552, 553, 553, 554, 554, 555, 555, 555, 556, 556, 557, 557, 558, 558, 558, 558, 558, 558, 558, 558, 558, 558, 558, 558, 558, 559, 559, 560, 560, 561, 561, 562, 562, 563, 564, 564, 564, 564, 564, 565, 565, 566, 567, 567, 567, 567, 567, 567, 568, 568, 568, 568, 568, 568, 568, 568, 569, 569, 570, 570, 571, 571, 572, 572, 573, 573, 573, 574, 574, 575, 576, 576, 577, 577, 578, 578, 578, 578, 579, 579, 579, 579, 579, 579, 579, 579, 579, 580, 580, 581, 581, 581, 581, 582, 583, 583, 583, 584, 584, 584, 584, 584, 584, 584, 584, 584, 585, 585, 586, 586, 586, 586, 586, 586, 586, 587, 587, 588, 588, 589, 589, 590, 591, 591, 592, 592, 592, 592, 593, 593, 594, 594, 595, 595, 596, 596, 596, 596, 596, 597, 598, 599, 599, 599, 599, 599, 600, 600, 601, 601, 602, 603, 603, 604, 604, 605, 605, 605, 606, 606, 607, 607, 607, 608, 608, 608, 608, 609, 609, 610, 610, 611, 612, 612, 613, 613, 614, 615, 615, 615, 616, 616, 617, 618, 618, 619, 620, 620, 621, 621, 622, 622, 623, 623, 624, 624, 625, 625, 625, 625, 625, 625, 625, 625, 625, 625, 625, 625, 625, 625, 626, 626, 627, 627, 627, 627, 628, 628, 629, 629, 630, 630, 631, 631, 632, 632, 633, 633, 634, 634, 635, 635, 636, 636, 637, 638, 638, 639, 639, 640, 640, 641, 641, 642, 642, 642, 642, 643, 644, 644, 645, 646, 646, 646, 646, 646, 646, 646, 646, 646, 646, 646, 646, 646, 646, 646, 646, 646, 646, 646, 646, 646, 646, 646, 646, 646, 646, 646, 646, 647, 648, 648, 648, 648, 649, 649, 650, 650, 651, 651, 652, 652, 653, 653, 654, 655, 655, 656, 656, 656, 656, 657, 658, 659, 660, 660, 661, 661, 662, 662, 663, 663, 664, 664, 664, 665, 665, 665, 665, 666, 666, 667, 668, 668, 669, 669, 670, 670, 671, 671, 672, 672, 673, 674, 675, 676, 676, 677, 677, 678, 678, 679, 679, 680, 680, 681, 681, 682, 682, 682, 682, 682, 683, 684, 684, 685, 685, 686, 686, 686, 687, 687, 688, 688, 688, 688, 688, 689, 689, 690, 690, 691, 692, 692, 693, 693, 694, 695, 695, 696, 696, 697, 697, 698, 698, 699, 699, 700, 700, 700, 701, 701, 701, 701, 702, 702, 703, 703, 704, 704, 704, 704, 704, 704, 705, 705, 706, 706, 707, 708, 708, 709, 710, 710, 710, 710, 711, 712, 712, 712, 712, 712, 712, 712, 712, 712, 712, 712, 712, 712, 712, 712, 712, 713, 714, 714, 715, 715, 716, 716, 716, 716, 716, 716, 717, 718, 718, 719, 720, 720, 721, 721, 722, 722, 722, 722, 723, 723, 724, 725, 725, 726, 726, 726, 726, 726, 727, 727, 728, 728, 729, 729, 729, 730, 730, 731, 732, 732, 733, 733, 734, 734, 735, 735, 736, 736, 737, 738, 739, 739, 739, 739, 739, 739, 739, 739, 739, 739, 739, 739, 740, 740, 740, 740, 740, 740, 740, 740, 740, 740, 740, 740, 740, 741, 741, 741, 741, 741, 741, 741, 742, 742, 742, 743, 743, 744, 744, 745, 745, 746, 746, 747, 748, 748, 748, 749, 749, 749, 749, 749, 749, 749, 749, 749, 749, 749, 749, 749, 749, 749, 749, 749, 749, 749, 750, 750, 750, 750, 750, 750, 750, 750, 750, 750, 750, 750, 750, 750, 751, 751, 751, 751, 751, 751, 751, 751, 751, 751, 751, 751, 752, 752, 753, 753, 753, 753, 753, 753, 753, 753, 753, 754, 754, 755, 755, 755, 755, 755, 755, 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, 760, 760, 761, 761, 762, 763, 763, 764, 764, 764, 764, 764, 765, 765, 766, 766, 766, 766, 767, 767, 767, 767, 767, 767, 767, 767, 767, 767, 767, 767, 767, 767, 767, 767, 767, 767, 767, 767, 768, 768, 769, 769, 770, 770, 771, 772, 772, 773, 773, 774, 774, 775, 776, 776, 777, 777, 777, 778, 778, 778, 779, 779, 779, 779, 779, 779, 780, 780, 781, 781, 782, 782, 783, 783, 784, 784, 785, 785, 786, 786, 786, 787, 787, 788, 788, 789, 789, 790, 790, 791, 791, 791, 792, 792, 792, 793, 793, 793, 793, 794, 794, 795, 795, 796, 796, 797, 797, 798, 798, 798, 798, 799, 799, 800, 800, 801, 801, 801, 801, 801, 802, 802, 802, 802, 802, 803, 804, 805, 805, 805, 806, 806, 806, 807, 808, 808, 808, 808, 809, 809, 810, 811, 811, 812, 812, 813, 813, 813, 813, 813, 813, 813, 813, 813, 813, 813, 813, 813, 813, 813, 813, 813, 814, 814, 814, 814, 814, 815, 815, 816, 816, 817, 817, 818, 819, 819, 820, 820, 820, 821, 821, 822, 822, 823, 823, 823, 823, 823, 823, 824, 824, 825, 825, 826, 826, 826, 826, 827, 827, 828, 828, 829, 830, 831, 831, 832, 832, 833, 833, 833, 834, 834, 834, 835, 836, 836, 837, 838, 838, 838, 838, 839, 840, 840, 840, 840, 841, 841, 842, 842, 842, 843, 843, 844, 845, 845, 846, 846, 846, 846, 846, 846, 846, 846, 846, 846, 846, 846, 846, 846, 846, 846, 846, 846, 846, 846, 846, 846, 846, 846, 846, 846, 846, 846, 846, 846, 846, 846, 846, 846, 846, 846, 846, 846, 846, 846, 846, 846, 846, 846, 846, 846, 846, 846, 846, 846, 846, 846, 846, 847, 847, 848, 848, 849, 849, 849, 849, 849, 849, 850, 850, 850, 850, 850, 850, 850, 850, 850, 850, 850, 850, 850, 850, 850, 850, 850, 850, 850, 850, 850, 850, 850, 850, 850, 850, 850, 851, 852, 852, 853, 853, 854, 854, 854, 854, 854, 855, 855, 855, 855, 855, 855, 855, 855, 855, 855, 855, 855, 855, 855, 855, 855, 855, 855, 855, 855, 855, 855, 855, 855, 856, 857, 857, 858, 858, 859, 859, 859, 859, 860, 861, 861, 862, 863, 863, 863, 863, 863, 863, 864, 864, 865, 866, 866, 866, 867, 867, 868, 868, 868, 868, 868, 869, 869, 870, 870, 870, 870, 871, 871, 871, 872, 873, 873, 874, 875, 875, 876, 876, 876, 876, 876, 876, 876, 876, 876, 876, 876, 876, 876, 876, 877, 877, 877, 878, 878, 878, 878, 878, 879, 879, 879, 880, 880, 881, 881, 881, 882, 882, 882, 882, 883, 883, 883, 883, 884, 885, 886, 886, 887, 887, 888, 888, 888, 889, 889, 889, 889, 889, 889, 889, 890, 890, 891, 891, 891, 892, 893, 893, 894, 895, 895, 896, 897, 897, 897, 897, 897, 897, 897, 898, 898, 899, 900, 900, 900, 900, 900, 900, 901, 901, 902, 903, 903, 903, 904, 904, 905, 905, 906, 906, 907, 907, 908, 908, 909, 910, 910, 911, 911, 911, 912, 912, 913, 913, 914, 914, 915, 915, 916, 916, 917, 918, 918, 919, 919, 920, 920, 920, 920, 921, 921, 921, 921, 921, 921, 921, 921, 921, 922, 922, 923, 924, 924, 925, 925, 925, 926, 927, 927, 928, 928, 928, 928, 929, 929, 929, 930, 930, 931, 931, 931, 931, 932, 933, 934, 934, 935, 935, 935, 935, 935, 936, 936, 937, 937, 938, 939, 939, 939, 940, 940, 940, 941, 941, 942, 943, 943, 944, 945, 945, 946, 946, 946, 946, 946, 946, 946, 946, 947, 947, 948, 948, 948, 949, 950, 951, 951, 952, 952, 953, 954, 954, 955, 956, 957, 957, 957, 957, 957, 958, 958, 958, 959, 959, 960, 960, 961, 961, 961, 961, 961, 961, 961, 961, 962, 962, 963, 963, 963, 963, 963, 963, 963, 964, 964, 964, 965, 965, 966, 967, 967, 967, 968, 968, 969, 969, 970, 970, 970, 970, 970, 970, 970, 970, 970, 971, 971, 972, 972, 972, 973, 973, 974, 974, 975, 975, 976, 977, 977, 978, 978, 979, 979, 979, 979, 980, 980, 981, 981, 981, 981, 982, 982, 983, 983, 984, 985, 985, 985, 986, 986, 987, 987, 988, 988, 989, 989, 990, 990, 991, 991, 991, 991, 991, 992, 993, 994, 995, 996, 996, 997, 997, 998, 998, 999, 999, 1000, 1001, 1001, 1001, 1001, 1002, 1002, 1003, 1003, 1004, 1004, 1005, 1005, 1006, 1006, 1006, 1006, 1006, 1006, 1006, 1006, 1006, 1006, 1007, 1007, 1007, 1007, 1007, 1007, 1008, 1008, 1008, 1008, 1009, 1009, 1010, 1010, 1010, 1010, 1010, 1011, 1011, 1011, 1011, 1012, 1012, 1013, 1013, 1014, 1014, 1014, 1014, 1015, 1015, 1016, 1016, 1016, 1017, 1018, 1018, 1019, 1019, 1020, 1021, 1021, 1022, 1022, 1023, 1023, 1024, 1024, 1025, 1025, 1025, 1026, 1026, 1027, 1027, 1028, 1029, 1029, 1030, 1030, 1031, 1031, 1031, 1032, 1032, 1033, 1033, 1033, 1033, 1034, 1034, 1035, 1035, 1036, 1036, 1036, 1036, 1036, 1036, 1037, 1037, 1037, 1038, 1038, 1038, 1038, 1038, 1038, 1038, 1039, 1039, 1039, 1039, 1040, 1040, 1041, 1041, 1042, 1042, 1042, 1042, 1042, 1042, 1042, 1042, 1042, 1042, 1042, 1043, 1043, 1044, 1044, 1045, 1045, 1046, 1047, 1048, 1048, 1049, 1049, 1050, 1051, 1052, 1052, 1052, 1052, 1052, 1052, 1053, 1053, 1054, 1054, 1054, 1054, 1055, 1056, 1056, 1056, 1057, 1057, 1057, 1057, 1057, 1057, 1057, 1057, 1057, 1057, 1057, 1057, 1057, 1057, 1058, 1058, 1059, 1059, 1059, 1059, 1059, 1059, 1059, 1059, 1059, 1059, 1059, 1059, 1059, 1059, 1059, 1059, 1059, 1059, 1059, 1059, 1059, 1059, 1059, 1059, 1059, 1059, 1059, 1059, 1059, 1059, 1059, 1059, 1059, 1059, 1059, 1059, 1059, 1059, 1059, 1059, 1059, 1059, 1059, 1059, 1059, 1059, 1059, 1059, 1059, 1059, 1059, 1059, 1059, 1059, 1059, 1059, 1059, 1059, 1059, 1059, 1059, 1059, 1059, 1059, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1061, 1061, 1061, 1061, 1061, 1061, 1061, 1061, 1061, 1061, 1061, 1061, 1061, 1061, 1062, 1062, 1062, 1062, 1062, 1062, 1062, 1063, 1063, 1064, 1064, 1065, 1065, 1065, 1065, 1065, 1065, 1065, 1065, 1065, 1065, 1065, 1065, 1065, 1065, 1065, 1065, 1065, 1065, 1065, 1065, 1065, 1065, 1065, 1065, 1065, 1065, 1065, 1065, 1065, 1065, 1065, 1065, 1065, 1065, 1065, 1065, 1065, 1065, 1065, 1065, 1065, 1065, 1066, 1066, 1067, 1067, 1067, 1067, 1068, 1069, 1069, 1070, 1070, 1071, 1071, 1072, 1072, 1072, 1073, 1073, 1073, 1073, 1074, 1074, 1075, 1075, 1076, 1076, 1077, 1077, 1078, 1078, 1079, 1080, 1080, 1080, 1081, 1082, 1082, 1083, 1083, 1084, 1084, 1084, 1084, 1085, 1085, 1086, 1086, 1086, 1086, 1086, 1087, 1087, 1087, 1087, 1087, 1088, 1088, 1088, 1089, 1089, 1090, 1091, 1091, 1091, 1092, 1092, 1093, 1093, 1093, 1093, 1093, 1093, 1093, 1093, 1093, 1093, 1093, 1093, 1094, 1094, 1095, 1095, 1096, 1096, 1096, 1096, 1096, 1096, 1097, 1097, 1098, 1098, 1099, 1099, 1099, 1100, 1100, 1101, 1101, 1101, 1102, 1102, 1103, 1103, 1104, 1104, 1104, 1104, 1104, 1104, 1104, 1104, 1105, 1105, 1106, 1107, 1107, 1108, 1108, 1108, 1108, 1108, 1108, 1109, 1110, 1111, 1111, 1111, 1112, 1112, 1113, 1114, 1114, 1115, 1116, 1116, 1117, 1117, 1118, 1118, 1119, 1119, 1119, 1119, 1120, 1120, 1121, 1121, 1122, 1122, 1123, 1123, 1124, 1124, 1125, 1125, 1126, 1126, 1126, 1126, 1127, 1127, 1128, 1128, 1129, 1129, 1130, 1131, 1132, 1133, 1134, 1135, 1136, 1136, 1137, 1137, 1137, 1137, 1137, 1137, 1137, 1137, 1137, 1137, 1137, 1137, 1137, 1138, 1139, 1140, 1140, 1140, 1141, 1142, 1142, 1142, 1143, 1143, 1144, 1144, 1144, 1145, 1145, 1145, 1146, 1146, 1146, 1146, 1147, 1147, 1147, 1147, 1147, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1150, 1150, 1150, 1150, 1150, 1150, 1150, 1150, 1150, 1150, 1150, 1150, 1150, 1150, 1150, 1150, 1150, 1150, 1150, 1150, 1150, 1150, 1150, 1151, 1151, 1151, 1151, 1151, 1151, 1151, 1151, 1151, 1151, 1151, 1151, 1151, 1151, 1151, 1151, 1151, 1151, 1151, 1151, 1151, 1151, 1151, 1151, 1151, 1151, 1151, 1151, 1151, 1151, 1151, 1151, 1151, 1151, 1151, 1151, 1151, 1151, 1151, 1151, 1151, 1151, 1151, 1151, 1151, 1151, 1151, 1151, 1151, 1151, 1151, 1151, 1151, 1151, 1151, 1151, 1151, 1151, 1151, 1151, 1151, 1151, 1151, 1151, 1151, 1151, 1151, 1151, 1151, 1151, 1151, 1151, 1151, 1151, 1151, 1151, 1151 }; /* 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, 1, 1, 1, 1, 1, 1, 1, 0, 2, 5, 1, 1, 0, 2, 0, 2, 0, 2, 2, 3, 3, 1, 3, 3, 2, 1, 1, 2, 2, 2, 3, 3, 5, 5, 5, 0, 3, 5, 5, 5, 5, 3, 5, 3, 5, 3, 5, 5, 6, 1, 1, 6, 4, 9, 7, 1, 0, 2, 0, 1, 1, 1, 1, 1, 1, 3, 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, 5, 1, 1, 1, 1, 1, 0, 1, 1, 2, 3, 1, 2, 3, 2, 1, 1, 2, 1, 2, 1, 3, 3, 2, 3, 4, 3, 2, 4, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 4, 6, 4, 6, 10, 13, 4, 6, 4, 10, 13, 4, 6, 4, 6, 5, 7, 11, 14, 1, 3, 4, 3, 3, 2, 5, 3, 6, 4, 6, 6, 6, 6, 5, 5, 6, 9, 4, 5, 7, 6, 4, 8, 4, 2, 4, 3, 6, 4, 3, 3, 3, 2, 2, 3, 4, 4, 3, 3, 3, 3, 3, 3, 4, 4, 3, 2, 3, 2, 2, 3, 3, 2, 2, 3, 4, 4, 4, 5, 1, 3, 2, 1, 1, 0, 2, 0, 2, 0, 1, 1, 1, 3, 3, 2, 0, 1, 3, 3, 1, 5, 3, 1, 2, 1, 3, 2, 3, 6, 6, 10, 1, 2, 1, 3, 4, 1, 3, 4, 6, 4, 8, 2, 2, 11, 9, 1, 1, 1, 0, 1, 1, 1, 1, 3, 2, 0, 1, 1, 3, 3, 1, 1, 3, 3, 3, 3, 4, 3, 2, 1, 0, 3, 0, 1, 0, 1, 3, 2, 1, 1, 1, 3, 0, 1, 3, 1, 13, 16, 12, 15, 14, 17, 1, 1, 2, 2, 2, 2, 1, 0, 1, 0, 3, 0, 1, 3, 1, 3, 1, 1, 1, 1, 1, 4, 2, 4, 2, 0, 3, 1, 1, 2, 2, 1, 3, 4, 5, 2, 5, 7, 5, 1, 2, 1, 2, 2, 2, 3, 3, 3, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, 5, 8, 3, 9, 4, 10, 11, 2, 0, 3, 0, 1, 3, 1, 4, 0, 2, 2, 2, 0, 1, 3, 3, 6, 4, 0, 1, 1, 2, 2, 0, 3, 3, 2, 1, 1, 2, 2, 4, 0, 1, 0, 6, 1, 1, 1, 3, 3, 3, 5, 2, 0, 2, 2, 0, 3, 4, 4, 0, 2, 0, 4, 0, 3, 8, 11, 7, 10, 6, 2, 3, 0, 8, 11, 5, 1, 0, 6, 5, 8, 4, 6, 1, 0, 3, 0, 1, 2, 2, 2, 1, 2, 3, 2, 2, 2, 2, 3, 3, 3, 1, 3, 1, 0, 1, 2, 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, 1, 5, 2, 0, 2, 7, 6, 10, 6, 6, 6, 6, 7, 6, 9, 9, 6, 6, 6, 7, 6, 8, 8, 8, 8, 6, 6, 7, 7, 8, 6, 9, 6, 7, 2, 2, 2, 2, 1, 2, 1, 0, 7, 6, 4, 0, 1, 3, 4, 1, 3, 1, 2, 2, 2, 2, 1, 1, 10, 13, 2, 0, 2, 2, 1, 0, 5, 4, 4, 11, 14, 12, 15, 5, 7, 11, 2, 1, 4, 0, 8, 11, 1, 1, 7, 9, 8, 10, 8, 4, 0, 5, 0, 2, 0, 2, 0, 2, 0, 2, 0, 1, 1, 1, 1, 1, 8, 1, 1, 16, 20, 1, 1, 2, 1, 3, 1, 1, 1, 3, 1, 2, 0, 1, 2, 4, 1, 1, 1, 1, 1, 3, 0, 1, 0, 1, 1, 4, 0, 1, 1, 1, 3, 0, 1, 1, 1, 1, 2, 0, 0, 2, 2, 1, 2, 2, 2, 2, 11, 13, 1, 3, 5, 1, 3, 5, 1, 2, 2, 1, 8, 6, 5, 4, 4, 3, 7, 8, 6, 6, 6, 6, 6, 4, 7, 5, 8, 3, 1, 3, 3, 1, 1, 1, 1, 1, 1, 1, 3, 1, 3, 3, 1, 0, 1, 3, 7, 9, 9, 8, 3, 0, 13, 1, 3, 5, 5, 3, 6, 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, 6, 4, 6, 8, 4, 6, 4, 6, 5, 7, 1, 1, 1, 2, 1, 2, 1, 1, 1, 3, 3, 3, 3, 2, 2, 1, 3, 1, 1, 1, 1, 1, 1, 1, 3, 1, 2, 2, 3, 1, 3, 5, 2, 2, 0, 6, 6, 6, 6, 6, 6, 6, 8, 9, 8, 6, 6, 8, 9, 8, 9, 9, 7, 10, 1, 1, 1, 1, 1, 1, 2, 1, 1, 2, 3, 3, 3, 3, 2, 1, 2, 1, 3, 2, 1, 1, 1, 1, 1, 1, 1, 1, 8, 8, 8, 8, 8, 8, 9, 8, 8, 2, 0, 1, 2, 1, 1, 1, 2, 1, 2, 2, 1, 1, 1, 1, 1, 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, 2, 2, 3, 2, 2, 2, 5, 5, 5, 5, 5, 1, 3, 1, 2, 3, 0, 6, 6, 9, 3, 0, 3, 0, 5, 2, 0, 3, 3, 3, 7, 7, 10, 1, 1, 1, 1, 1, 1, 15, 18, 1, 0, 1, 0, 1, 0, 2, 0, 1, 3, 5, 5, 7, 4, 0, 1, 3, 2, 0, 1, 0, 1, 1, 0, 2, 2, 0, 8, 11, 6, 6, 2, 0, 3, 2, 1, 3, 1, 3, 2, 1, 1, 2, 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, 2, 1, 3, 1, 2, 4, 5, 1, 1, 1, 1, 3, 3, 2, 2, 1, 2, 2, 2, 2, 1, 2, 2, 2, 2, 1, 1, 1, 3, 3, 5, 2, 0, 2, 1, 3, 5, 5, 5, 1, 2, 1, 0, 4, 6, 4, 6, 4, 6, 4, 6, 4, 6, 3, 5, 5, 5, 1, 3, 1, 3, 2, 2, 1, 2, 1, 2, 11, 10, 10, 2, 2, 0, 9, 2, 0, 10, 11, 11, 5, 5, 8, 4, 4, 7, 7, 1, 1, 1, 1, 1, 1, 3, 1, 5, 5, 6, 6, 6, 6, 6, 8, 8, 6, 6, 7, 9, 9, 8, 10, 6, 6, 6, 6, 6, 6, 6, 8, 6, 8, 6, 8, 7, 9, 6, 8, 7, 9, 8, 10, 9, 11, 8, 10, 9, 11, 8, 8, 7, 6, 6, 6, 6, 8, 8, 8, 8, 6, 9, 1, 0, 2, 0, 7, 7, 7, 9, 8, 7, 6, 6, 6, 6, 6, 6, 6, 9, 9, 6, 6, 6, 8, 6, 8, 8, 8, 8, 6, 8, 6, 8, 7, 9, 7, 9, 6, 7, 1, 3, 3, 3, 1, 1, 1, 1, 1, 6, 6, 6, 6, 6, 6, 7, 7, 6, 9, 9, 6, 6, 6, 6, 6, 6, 8, 8, 8, 6, 7, 6, 6, 5, 1, 0, 3, 3, 5, 6, 6, 6, 8, 1, 3, 1, 5, 5, 6, 7, 4, 4, 4, 6, 13, 1, 1, 3, 3, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 3, 2, 0, 2, 2, 2, 3, 3, 3, 3, 3, 3, 2, 3, 2, 5, 4, 3, 3, 3, 1, 1, 0, 3, 2, 2, 1, 2, 1, 3, 2, 1, 0, 2, 3, 0, 9, 11, 12, 14, 3, 4, 4, 0, 2, 5, 1, 0, 1, 2, 3, 3, 3, 1, 2, 1, 1, 1, 1, 1, 1, 0, 5, 4, 6, 4, 3, 5, 5, 4, 4, 6, 4, 6, 6, 5, 7, 9, 6, 1, 0, 6, 11, 11, 11, 13, 9, 11, 1, 1, 10, 4, 2, 5, 2, 0, 6, 5, 3, 5, 1, 3, 1, 1, 2, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 3, 0, 2, 1, 3, 1, 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, 12, 3, 0, 2, 3, 2, 3, 7, 4, 1, 3, 1, 4, 4, 7, 2, 1, 1, 1, 3, 2, 8, 5, 0, 4, 3, 0, 2, 0, 7, 2, 0, 5, 3, 0, 2, 2, 2, 3, 1, 3, 1, 2, 1, 0, 1, 2, 0, 8, 3, 1, 3, 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, 9, 1, 2, 4, 4, 4, 2, 2, 3, 1, 3, 7, 1, 2, 0, 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, 4, 2, 3, 1, 1, 1, 1, 2, 2, 1, 1, 1, 1, 1, 1, 3, 0, 1, 3, 1, 1, 1, 1, 1, 2, 4, 4, 5, 2, 0, 1, 3, 1, 0, 1, 2, 3, 2, 4, 2, 3, 2, 0, 4, 5, 2, 0, 1, 3, 2, 3, 2, 3, 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, 6, 4, 0, 2, 6, 2, 1, 3, 4, 0, 2, 0, 2, 0, 2, 4, 0, 1, 0, 1, 3, 3, 7, 12, 1, 3, 2, 3, 3, 1, 2, 2, 2, 2, 1, 1, 3, 3, 2, 2, 3, 5, 6, 2, 3, 3, 4, 0, 1, 1, 1, 1, 1, 2, 4, 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, 4, 1, 2, 2, 1, 3, 3, 2, 1, 0, 5, 2, 5, 2, 1, 3, 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, 3, 3, 3, 2, 2, 3, 3, 2, 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, 1, 3, 2, 2, 3, 3, 3, 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, 1, 4, 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, 3, 3, 4, 2, 2, 5, 0, 5, 0, 2, 0, 1, 3, 3, 2, 2, 0, 6, 1, 0, 3, 0, 3, 3, 3, 0, 1, 4, 2, 2, 2, 2, 2, 3, 2, 2, 3, 0, 4, 3, 5, 4, 3, 5, 1, 1, 1, 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, 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, 0, 1, 2, 0, 2, 1, 0, 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, 5, 1, 1, 1, 1, 1, 1, 2, 2, 1, 1, 1, 1, 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, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 829 "gram_minimal.y" /* yacc.c:1646 */ { pg_yyget_extra(yyscanner)->parsetree = (yyvsp[0].list); } #line 25989 "gram_minimal.c" /* yacc.c:1646 */ break; case 3: #line 845 "gram_minimal.y" /* yacc.c:1646 */ { if ((yyvsp[-2].list) != NIL) { /* update length of previous stmt */ updateRawStmtEnd(llast_node(RawStmt, (yyvsp[-2].list)), (yylsp[-1])); } if ((yyvsp[0].node) != NULL) (yyval.list) = lappend((yyvsp[-2].list), makeRawStmt((yyvsp[0].node), (yylsp[-1]) + 1)); else (yyval.list) = (yyvsp[-2].list); } #line 26005 "gram_minimal.c" /* yacc.c:1646 */ break; case 4: #line 857 "gram_minimal.y" /* yacc.c:1646 */ { if ((yyvsp[0].node) != NULL) (yyval.list) = list_make1(makeRawStmt((yyvsp[0].node), 0)); else (yyval.list) = NIL; } #line 26016 "gram_minimal.c" /* yacc.c:1646 */ break; case 128: #line 990 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = NULL; } #line 26022 "gram_minimal.c" /* yacc.c:1646 */ break; case 129: #line 1000 "gram_minimal.y" /* yacc.c:1646 */ { CallStmt *n = makeNode(CallStmt); n->funccall = castNode(FuncCall, (yyvsp[0].node)); (yyval.node) = (Node *)n; } #line 26032 "gram_minimal.c" /* yacc.c:1646 */ break; case 130: #line 1015 "gram_minimal.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 26044 "gram_minimal.c" /* yacc.c:1646 */ break; case 131: #line 1025 "gram_minimal.y" /* yacc.c:1646 */ {} #line 26050 "gram_minimal.c" /* yacc.c:1646 */ break; case 132: #line 1026 "gram_minimal.y" /* yacc.c:1646 */ {} #line 26056 "gram_minimal.c" /* yacc.c:1646 */ break; case 133: #line 1027 "gram_minimal.y" /* yacc.c:1646 */ {} #line 26062 "gram_minimal.c" /* yacc.c:1646 */ break; case 134: #line 1036 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-1].list), (yyvsp[0].defelt)); } #line 26068 "gram_minimal.c" /* yacc.c:1646 */ break; case 135: #line 1037 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 26074 "gram_minimal.c" /* yacc.c:1646 */ break; case 136: #line 1041 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-1].list), (yyvsp[0].defelt)); } #line 26080 "gram_minimal.c" /* yacc.c:1646 */ break; case 137: #line 1042 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 26086 "gram_minimal.c" /* yacc.c:1646 */ break; case 138: #line 1047 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("password", (Node *)makeString((yyvsp[0].str)), (yylsp[-1])); } #line 26095 "gram_minimal.c" /* yacc.c:1646 */ break; case 139: #line 1052 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("password", NULL, (yylsp[-1])); } #line 26103 "gram_minimal.c" /* yacc.c:1646 */ break; case 140: #line 1056 "gram_minimal.y" /* yacc.c:1646 */ { /* * These days, passwords are always stored in encrypted * form, so there is no difference between PASSWORD and * ENCRYPTED PASSWORD. */ (yyval.defelt) = makeDefElem("password", (Node *)makeString((yyvsp[0].str)), (yylsp[-2])); } #line 26117 "gram_minimal.c" /* yacc.c:1646 */ break; case 141: #line 1066 "gram_minimal.y" /* yacc.c:1646 */ { ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), errmsg("UNENCRYPTED PASSWORD is no longer supported"), errhint("Remove UNENCRYPTED to store the password in encrypted form instead."), parser_errposition((yylsp[-2])))); } #line 26129 "gram_minimal.c" /* yacc.c:1646 */ break; case 142: #line 1074 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("inherit", (Node *)makeInteger(true), (yylsp[0])); } #line 26137 "gram_minimal.c" /* yacc.c:1646 */ break; case 143: #line 1078 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("connectionlimit", (Node *)makeInteger((yyvsp[0].ival)), (yylsp[-2])); } #line 26145 "gram_minimal.c" /* yacc.c:1646 */ break; case 144: #line 1082 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("validUntil", (Node *)makeString((yyvsp[0].str)), (yylsp[-2])); } #line 26153 "gram_minimal.c" /* yacc.c:1646 */ break; case 145: #line 1087 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("rolemembers", (Node *)(yyvsp[0].list), (yylsp[-1])); } #line 26161 "gram_minimal.c" /* yacc.c:1646 */ break; case 146: #line 1091 "gram_minimal.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), (yylsp[0])); else if (strcmp((yyvsp[0].str), "nosuperuser") == 0) (yyval.defelt) = makeDefElem("superuser", (Node *)makeInteger(false), (yylsp[0])); else if (strcmp((yyvsp[0].str), "createrole") == 0) (yyval.defelt) = makeDefElem("createrole", (Node *)makeInteger(true), (yylsp[0])); else if (strcmp((yyvsp[0].str), "nocreaterole") == 0) (yyval.defelt) = makeDefElem("createrole", (Node *)makeInteger(false), (yylsp[0])); else if (strcmp((yyvsp[0].str), "replication") == 0) (yyval.defelt) = makeDefElem("isreplication", (Node *)makeInteger(true), (yylsp[0])); else if (strcmp((yyvsp[0].str), "noreplication") == 0) (yyval.defelt) = makeDefElem("isreplication", (Node *)makeInteger(false), (yylsp[0])); else if (strcmp((yyvsp[0].str), "createdb") == 0) (yyval.defelt) = makeDefElem("createdb", (Node *)makeInteger(true), (yylsp[0])); else if (strcmp((yyvsp[0].str), "nocreatedb") == 0) (yyval.defelt) = makeDefElem("createdb", (Node *)makeInteger(false), (yylsp[0])); else if (strcmp((yyvsp[0].str), "login") == 0) (yyval.defelt) = makeDefElem("canlogin", (Node *)makeInteger(true), (yylsp[0])); else if (strcmp((yyvsp[0].str), "nologin") == 0) (yyval.defelt) = makeDefElem("canlogin", (Node *)makeInteger(false), (yylsp[0])); else if (strcmp((yyvsp[0].str), "bypassrls") == 0) (yyval.defelt) = makeDefElem("bypassrls", (Node *)makeInteger(true), (yylsp[0])); else if (strcmp((yyvsp[0].str), "nobypassrls") == 0) (yyval.defelt) = makeDefElem("bypassrls", (Node *)makeInteger(false), (yylsp[0])); 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), (yylsp[0])); } else ereport(ERROR, (errcode(ERRCODE_SYNTAX_ERROR), errmsg("unrecognized role option \"%s\"", (yyvsp[0].str)), parser_errposition((yylsp[0])))); } #line 26210 "gram_minimal.c" /* yacc.c:1646 */ break; case 147: #line 1138 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = (yyvsp[0].defelt); } #line 26216 "gram_minimal.c" /* yacc.c:1646 */ break; case 148: #line 1141 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("sysid", (Node *)makeInteger((yyvsp[0].ival)), (yylsp[-1])); } #line 26224 "gram_minimal.c" /* yacc.c:1646 */ break; case 149: #line 1145 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("adminmembers", (Node *)(yyvsp[0].list), (yylsp[-1])); } #line 26232 "gram_minimal.c" /* yacc.c:1646 */ break; case 150: #line 1149 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("rolemembers", (Node *)(yyvsp[0].list), (yylsp[-1])); } #line 26240 "gram_minimal.c" /* yacc.c:1646 */ break; case 151: #line 1153 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("addroleto", (Node *)(yyvsp[0].list), (yylsp[-2])); } #line 26248 "gram_minimal.c" /* yacc.c:1646 */ break; case 152: #line 1157 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("addroleto", (Node *)(yyvsp[0].list), (yylsp[-2])); } #line 26256 "gram_minimal.c" /* yacc.c:1646 */ break; case 153: #line 1171 "gram_minimal.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 26268 "gram_minimal.c" /* yacc.c:1646 */ break; case 154: #line 1189 "gram_minimal.y" /* yacc.c:1646 */ { AlterRoleStmt *n = makeNode(AlterRoleStmt); n->role = (yyvsp[-2].rolespec); n->action = +1; /* add, if there are members */ n->options = (yyvsp[0].list); (yyval.node) = (Node *)n; } #line 26280 "gram_minimal.c" /* yacc.c:1646 */ break; case 155: #line 1197 "gram_minimal.y" /* yacc.c:1646 */ { AlterRoleStmt *n = makeNode(AlterRoleStmt); n->role = (yyvsp[-2].rolespec); n->action = +1; /* add, if there are members */ n->options = (yyvsp[0].list); (yyval.node) = (Node *)n; } #line 26292 "gram_minimal.c" /* yacc.c:1646 */ break; case 156: #line 1207 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = NULL; } #line 26298 "gram_minimal.c" /* yacc.c:1646 */ break; case 157: #line 1208 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 26304 "gram_minimal.c" /* yacc.c:1646 */ break; case 158: #line 1213 "gram_minimal.y" /* yacc.c:1646 */ { AlterRoleSetStmt *n = makeNode(AlterRoleSetStmt); n->role = (yyvsp[-2].rolespec); n->database = (yyvsp[-1].str); n->setstmt = (yyvsp[0].vsetstmt); (yyval.node) = (Node *)n; } #line 26316 "gram_minimal.c" /* yacc.c:1646 */ break; case 159: #line 1221 "gram_minimal.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 26328 "gram_minimal.c" /* yacc.c:1646 */ break; case 160: #line 1229 "gram_minimal.y" /* yacc.c:1646 */ { AlterRoleSetStmt *n = makeNode(AlterRoleSetStmt); n->role = (yyvsp[-2].rolespec); n->database = (yyvsp[-1].str); n->setstmt = (yyvsp[0].vsetstmt); (yyval.node) = (Node *)n; } #line 26340 "gram_minimal.c" /* yacc.c:1646 */ break; case 161: #line 1237 "gram_minimal.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 26352 "gram_minimal.c" /* yacc.c:1646 */ break; case 162: #line 1258 "gram_minimal.y" /* yacc.c:1646 */ { DropRoleStmt *n = makeNode(DropRoleStmt); n->missing_ok = false; n->roles = (yyvsp[0].list); (yyval.node) = (Node *)n; } #line 26363 "gram_minimal.c" /* yacc.c:1646 */ break; case 163: #line 1265 "gram_minimal.y" /* yacc.c:1646 */ { DropRoleStmt *n = makeNode(DropRoleStmt); n->missing_ok = true; n->roles = (yyvsp[0].list); (yyval.node) = (Node *)n; } #line 26374 "gram_minimal.c" /* yacc.c:1646 */ break; case 164: #line 1272 "gram_minimal.y" /* yacc.c:1646 */ { DropRoleStmt *n = makeNode(DropRoleStmt); n->missing_ok = false; n->roles = (yyvsp[0].list); (yyval.node) = (Node *)n; } #line 26385 "gram_minimal.c" /* yacc.c:1646 */ break; case 165: #line 1279 "gram_minimal.y" /* yacc.c:1646 */ { DropRoleStmt *n = makeNode(DropRoleStmt); n->roles = (yyvsp[0].list); n->missing_ok = true; (yyval.node) = (Node *)n; } #line 26396 "gram_minimal.c" /* yacc.c:1646 */ break; case 166: #line 1286 "gram_minimal.y" /* yacc.c:1646 */ { DropRoleStmt *n = makeNode(DropRoleStmt); n->missing_ok = false; n->roles = (yyvsp[0].list); (yyval.node) = (Node *)n; } #line 26407 "gram_minimal.c" /* yacc.c:1646 */ break; case 167: #line 1293 "gram_minimal.y" /* yacc.c:1646 */ { DropRoleStmt *n = makeNode(DropRoleStmt); n->missing_ok = true; n->roles = (yyvsp[0].list); (yyval.node) = (Node *)n; } #line 26418 "gram_minimal.c" /* yacc.c:1646 */ break; case 168: #line 1310 "gram_minimal.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 26430 "gram_minimal.c" /* yacc.c:1646 */ break; case 169: #line 1328 "gram_minimal.y" /* yacc.c:1646 */ { AlterRoleStmt *n = makeNode(AlterRoleStmt); n->role = (yyvsp[-3].rolespec); n->action = (yyvsp[-2].ival); n->options = list_make1(makeDefElem("rolemembers", (Node *)(yyvsp[0].list), (yylsp[0]))); (yyval.node) = (Node *)n; } #line 26443 "gram_minimal.c" /* yacc.c:1646 */ break; case 170: #line 1338 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = +1; } #line 26449 "gram_minimal.c" /* yacc.c:1646 */ break; case 171: #line 1339 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = -1; } #line 26455 "gram_minimal.c" /* yacc.c:1646 */ break; case 172: #line 1351 "gram_minimal.y" /* yacc.c:1646 */ { CreateSchemaStmt *n = makeNode(CreateSchemaStmt); /* One can omit the schema name or the authorization id. */ n->schemaname = (yyvsp[-3].str); n->authrole = (yyvsp[-1].rolespec); n->schemaElts = (yyvsp[0].list); n->if_not_exists = false; (yyval.node) = (Node *)n; } #line 26469 "gram_minimal.c" /* yacc.c:1646 */ break; case 173: #line 1361 "gram_minimal.y" /* yacc.c:1646 */ { CreateSchemaStmt *n = makeNode(CreateSchemaStmt); /* ...but not both */ n->schemaname = (yyvsp[-1].str); n->authrole = NULL; n->schemaElts = (yyvsp[0].list); n->if_not_exists = false; (yyval.node) = (Node *)n; } #line 26483 "gram_minimal.c" /* yacc.c:1646 */ break; case 174: #line 1371 "gram_minimal.y" /* yacc.c:1646 */ { CreateSchemaStmt *n = makeNode(CreateSchemaStmt); /* schema name can be omitted here, too */ n->schemaname = (yyvsp[-3].str); n->authrole = (yyvsp[-1].rolespec); 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 26502 "gram_minimal.c" /* yacc.c:1646 */ break; case 175: #line 1386 "gram_minimal.y" /* yacc.c:1646 */ { CreateSchemaStmt *n = makeNode(CreateSchemaStmt); /* ...but not here */ n->schemaname = (yyvsp[-1].str); n->authrole = 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 26521 "gram_minimal.c" /* yacc.c:1646 */ break; case 176: #line 1403 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 26527 "gram_minimal.c" /* yacc.c:1646 */ break; case 177: #line 1404 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = NULL; } #line 26533 "gram_minimal.c" /* yacc.c:1646 */ break; case 178: #line 1409 "gram_minimal.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 26543 "gram_minimal.c" /* yacc.c:1646 */ break; case 179: #line 1415 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 26549 "gram_minimal.c" /* yacc.c:1646 */ break; case 186: #line 1443 "gram_minimal.y" /* yacc.c:1646 */ { VariableSetStmt *n = (yyvsp[0].vsetstmt); n->type = T_PgpoolVariableSetStmt; /* Hack to keep changes minumum */ n->is_local = false; (yyval.node) = (Node *) n; } #line 26560 "gram_minimal.c" /* yacc.c:1646 */ break; case 187: #line 1450 "gram_minimal.y" /* yacc.c:1646 */ { VariableSetStmt *n = (yyvsp[0].vsetstmt); n->is_local = false; (yyval.node) = (Node *) n; } #line 26570 "gram_minimal.c" /* yacc.c:1646 */ break; case 188: #line 1456 "gram_minimal.y" /* yacc.c:1646 */ { VariableSetStmt *n = (yyvsp[0].vsetstmt); n->is_local = true; (yyval.node) = (Node *) n; } #line 26580 "gram_minimal.c" /* yacc.c:1646 */ break; case 189: #line 1462 "gram_minimal.y" /* yacc.c:1646 */ { VariableSetStmt *n = (yyvsp[0].vsetstmt); n->is_local = false; (yyval.node) = (Node *) n; } #line 26590 "gram_minimal.c" /* yacc.c:1646 */ break; case 190: #line 1471 "gram_minimal.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 26602 "gram_minimal.c" /* yacc.c:1646 */ break; case 191: #line 1479 "gram_minimal.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 26614 "gram_minimal.c" /* yacc.c:1646 */ break; case 193: #line 1491 "gram_minimal.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 26626 "gram_minimal.c" /* yacc.c:1646 */ break; case 194: #line 1499 "gram_minimal.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 26638 "gram_minimal.c" /* yacc.c:1646 */ break; case 195: #line 1507 "gram_minimal.y" /* yacc.c:1646 */ { VariableSetStmt *n = makeNode(VariableSetStmt); n->kind = VAR_SET_DEFAULT; n->name = (yyvsp[-2].str); (yyval.vsetstmt) = n; } #line 26649 "gram_minimal.c" /* yacc.c:1646 */ break; case 196: #line 1514 "gram_minimal.y" /* yacc.c:1646 */ { VariableSetStmt *n = makeNode(VariableSetStmt); n->kind = VAR_SET_DEFAULT; n->name = (yyvsp[-2].str); (yyval.vsetstmt) = n; } #line 26660 "gram_minimal.c" /* yacc.c:1646 */ break; case 197: #line 1523 "gram_minimal.y" /* yacc.c:1646 */ {(yyval.vsetstmt) = (yyvsp[0].vsetstmt);} #line 26666 "gram_minimal.c" /* yacc.c:1646 */ break; case 198: #line 1525 "gram_minimal.y" /* yacc.c:1646 */ { VariableSetStmt *n = makeNode(VariableSetStmt); n->kind = VAR_SET_CURRENT; n->name = (yyvsp[-2].str); (yyval.vsetstmt) = n; } #line 26677 "gram_minimal.c" /* yacc.c:1646 */ break; case 199: #line 1533 "gram_minimal.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 26692 "gram_minimal.c" /* yacc.c:1646 */ break; case 200: #line 1544 "gram_minimal.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 26704 "gram_minimal.c" /* yacc.c:1646 */ break; case 201: #line 1552 "gram_minimal.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 26716 "gram_minimal.c" /* yacc.c:1646 */ break; case 202: #line 1560 "gram_minimal.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 26731 "gram_minimal.c" /* yacc.c:1646 */ break; case 203: #line 1571 "gram_minimal.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 26743 "gram_minimal.c" /* yacc.c:1646 */ break; case 204: #line 1579 "gram_minimal.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 26755 "gram_minimal.c" /* yacc.c:1646 */ break; case 205: #line 1587 "gram_minimal.y" /* yacc.c:1646 */ { VariableSetStmt *n = makeNode(VariableSetStmt); n->kind = VAR_SET_DEFAULT; n->name = "session_authorization"; (yyval.vsetstmt) = n; } #line 26766 "gram_minimal.c" /* yacc.c:1646 */ break; case 206: #line 1594 "gram_minimal.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 26778 "gram_minimal.c" /* yacc.c:1646 */ break; case 207: #line 1603 "gram_minimal.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 26790 "gram_minimal.c" /* yacc.c:1646 */ break; case 208: #line 1612 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 26796 "gram_minimal.c" /* yacc.c:1646 */ break; case 209: #line 1614 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = psprintf("%s.%s", (yyvsp[-2].str), (yyvsp[0].str)); } #line 26802 "gram_minimal.c" /* yacc.c:1646 */ break; case 210: #line 1617 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].node)); } #line 26808 "gram_minimal.c" /* yacc.c:1646 */ break; case 211: #line 1618 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].node)); } #line 26814 "gram_minimal.c" /* yacc.c:1646 */ break; case 212: #line 1622 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = makeStringConst((yyvsp[0].str), (yylsp[0])); } #line 26820 "gram_minimal.c" /* yacc.c:1646 */ break; case 213: #line 1624 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = makeAConst((yyvsp[0].value), (yylsp[0])); } #line 26826 "gram_minimal.c" /* yacc.c:1646 */ break; case 214: #line 1627 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = "read uncommitted"; } #line 26832 "gram_minimal.c" /* yacc.c:1646 */ break; case 215: #line 1628 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = "read committed"; } #line 26838 "gram_minimal.c" /* yacc.c:1646 */ break; case 216: #line 1629 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = "repeatable read"; } #line 26844 "gram_minimal.c" /* yacc.c:1646 */ break; case 217: #line 1630 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = "serializable"; } #line 26850 "gram_minimal.c" /* yacc.c:1646 */ break; case 218: #line 1634 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = "true"; } #line 26856 "gram_minimal.c" /* yacc.c:1646 */ break; case 219: #line 1635 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = "false"; } #line 26862 "gram_minimal.c" /* yacc.c:1646 */ break; case 220: #line 1636 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = "on"; } #line 26868 "gram_minimal.c" /* yacc.c:1646 */ break; case 221: #line 1642 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 26874 "gram_minimal.c" /* yacc.c:1646 */ break; case 222: #line 1655 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = makeStringConst((yyvsp[0].str), (yylsp[0])); } #line 26882 "gram_minimal.c" /* yacc.c:1646 */ break; case 223: #line 1659 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = makeStringConst((yyvsp[0].str), (yylsp[0])); } #line 26890 "gram_minimal.c" /* yacc.c:1646 */ break; case 224: #line 1663 "gram_minimal.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 26909 "gram_minimal.c" /* yacc.c:1646 */ break; case 225: #line 1678 "gram_minimal.y" /* yacc.c:1646 */ { TypeName *t = (yyvsp[-4].typnam); t->typmods = list_make2(makeIntConst(INTERVAL_FULL_RANGE, -1), makeIntConst((yyvsp[-2].ival), (yylsp[-2]))); (yyval.node) = makeStringConstCast((yyvsp[0].str), (yylsp[0]), t); } #line 26920 "gram_minimal.c" /* yacc.c:1646 */ break; case 226: #line 1684 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = makeAConst((yyvsp[0].value), (yylsp[0])); } #line 26926 "gram_minimal.c" /* yacc.c:1646 */ break; case 227: #line 1685 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = NULL; } #line 26932 "gram_minimal.c" /* yacc.c:1646 */ break; case 228: #line 1686 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = NULL; } #line 26938 "gram_minimal.c" /* yacc.c:1646 */ break; case 229: #line 1690 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 26944 "gram_minimal.c" /* yacc.c:1646 */ break; case 230: #line 1691 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = NULL; } #line 26950 "gram_minimal.c" /* yacc.c:1646 */ break; case 231: #line 1692 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = NULL; } #line 26956 "gram_minimal.c" /* yacc.c:1646 */ break; case 232: #line 1696 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 26962 "gram_minimal.c" /* yacc.c:1646 */ break; case 233: #line 1697 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 26968 "gram_minimal.c" /* yacc.c:1646 */ break; case 234: #line 1701 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) (yyvsp[0].vsetstmt); } #line 26974 "gram_minimal.c" /* yacc.c:1646 */ break; case 235: #line 1703 "gram_minimal.y" /* yacc.c:1646 */ { VariableSetStmt *n = (yyvsp[0].vsetstmt); n->type = T_PgpoolVariableSetStmt; /* Hack to keep the changes minumum */ (yyval.node) = (Node *) n; } #line 26984 "gram_minimal.c" /* yacc.c:1646 */ break; case 236: #line 1711 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.vsetstmt) = (yyvsp[0].vsetstmt); } #line 26990 "gram_minimal.c" /* yacc.c:1646 */ break; case 237: #line 1713 "gram_minimal.y" /* yacc.c:1646 */ { VariableSetStmt *n = makeNode(VariableSetStmt); n->kind = VAR_RESET; n->name = "timezone"; (yyval.vsetstmt) = n; } #line 27001 "gram_minimal.c" /* yacc.c:1646 */ break; case 238: #line 1720 "gram_minimal.y" /* yacc.c:1646 */ { VariableSetStmt *n = makeNode(VariableSetStmt); n->kind = VAR_RESET; n->name = "transaction_isolation"; (yyval.vsetstmt) = n; } #line 27012 "gram_minimal.c" /* yacc.c:1646 */ break; case 239: #line 1727 "gram_minimal.y" /* yacc.c:1646 */ { VariableSetStmt *n = makeNode(VariableSetStmt); n->kind = VAR_RESET; n->name = "session_authorization"; (yyval.vsetstmt) = n; } #line 27023 "gram_minimal.c" /* yacc.c:1646 */ break; case 240: #line 1737 "gram_minimal.y" /* yacc.c:1646 */ { VariableSetStmt *n = makeNode(VariableSetStmt); n->kind = VAR_RESET; n->name = (yyvsp[0].str); (yyval.vsetstmt) = n; } #line 27034 "gram_minimal.c" /* yacc.c:1646 */ break; case 241: #line 1744 "gram_minimal.y" /* yacc.c:1646 */ { VariableSetStmt *n = makeNode(VariableSetStmt); n->kind = VAR_RESET_ALL; (yyval.vsetstmt) = n; } #line 27044 "gram_minimal.c" /* yacc.c:1646 */ break; case 242: #line 1753 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.vsetstmt) = (yyvsp[0].vsetstmt); } #line 27050 "gram_minimal.c" /* yacc.c:1646 */ break; case 243: #line 1754 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.vsetstmt) = (VariableSetStmt *) (yyvsp[0].node); } #line 27056 "gram_minimal.c" /* yacc.c:1646 */ break; case 244: #line 1759 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.vsetstmt) = (yyvsp[0].vsetstmt); } #line 27062 "gram_minimal.c" /* yacc.c:1646 */ break; case 245: #line 1760 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.vsetstmt) = (VariableSetStmt *) (yyvsp[0].node); } #line 27068 "gram_minimal.c" /* yacc.c:1646 */ break; case 246: #line 1767 "gram_minimal.y" /* yacc.c:1646 */ { VariableShowStmt *n = (VariableShowStmt *)newNode(sizeof(VariableShowStmt),T_PgpoolVariableShowStmt); n->name = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 27078 "gram_minimal.c" /* yacc.c:1646 */ break; case 247: #line 1773 "gram_minimal.y" /* yacc.c:1646 */ { VariableShowStmt *n = (VariableShowStmt *)newNode(sizeof(VariableShowStmt),T_PgpoolVariableShowStmt); n->name = "all"; (yyval.node) = (Node *) n; } #line 27088 "gram_minimal.c" /* yacc.c:1646 */ break; case 248: #line 1779 "gram_minimal.y" /* yacc.c:1646 */ { VariableShowStmt *n = makeNode(VariableShowStmt); n->name = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 27098 "gram_minimal.c" /* yacc.c:1646 */ break; case 249: #line 1785 "gram_minimal.y" /* yacc.c:1646 */ { VariableShowStmt *n = makeNode(VariableShowStmt); n->name = "timezone"; (yyval.node) = (Node *) n; } #line 27108 "gram_minimal.c" /* yacc.c:1646 */ break; case 250: #line 1791 "gram_minimal.y" /* yacc.c:1646 */ { VariableShowStmt *n = makeNode(VariableShowStmt); n->name = "transaction_isolation"; (yyval.node) = (Node *) n; } #line 27118 "gram_minimal.c" /* yacc.c:1646 */ break; case 251: #line 1797 "gram_minimal.y" /* yacc.c:1646 */ { VariableShowStmt *n = makeNode(VariableShowStmt); n->name = "session_authorization"; (yyval.node) = (Node *) n; } #line 27128 "gram_minimal.c" /* yacc.c:1646 */ break; case 252: #line 1803 "gram_minimal.y" /* yacc.c:1646 */ { VariableShowStmt *n = makeNode(VariableShowStmt); n->name = "all"; (yyval.node) = (Node *) n; } #line 27138 "gram_minimal.c" /* yacc.c:1646 */ break; case 253: #line 1813 "gram_minimal.y" /* yacc.c:1646 */ { ConstraintsSetStmt *n = makeNode(ConstraintsSetStmt); n->constraints = (yyvsp[-1].list); n->deferred = (yyvsp[0].boolean); (yyval.node) = (Node *) n; } #line 27149 "gram_minimal.c" /* yacc.c:1646 */ break; case 254: #line 1822 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 27155 "gram_minimal.c" /* yacc.c:1646 */ break; case 255: #line 1823 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 27161 "gram_minimal.c" /* yacc.c:1646 */ break; case 256: #line 1827 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.boolean) = true; } #line 27167 "gram_minimal.c" /* yacc.c:1646 */ break; case 257: #line 1828 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.boolean) = false; } #line 27173 "gram_minimal.c" /* yacc.c:1646 */ break; case 258: #line 1837 "gram_minimal.y" /* yacc.c:1646 */ { CheckPointStmt *n = makeNode(CheckPointStmt); (yyval.node) = (Node *)n; } #line 27182 "gram_minimal.c" /* yacc.c:1646 */ break; case 259: #line 1852 "gram_minimal.y" /* yacc.c:1646 */ { DiscardStmt *n = makeNode(DiscardStmt); n->target = DISCARD_ALL; (yyval.node) = (Node *) n; } #line 27192 "gram_minimal.c" /* yacc.c:1646 */ break; case 260: #line 1858 "gram_minimal.y" /* yacc.c:1646 */ { DiscardStmt *n = makeNode(DiscardStmt); n->target = DISCARD_TEMP; (yyval.node) = (Node *) n; } #line 27202 "gram_minimal.c" /* yacc.c:1646 */ break; case 261: #line 1864 "gram_minimal.y" /* yacc.c:1646 */ { DiscardStmt *n = makeNode(DiscardStmt); n->target = DISCARD_TEMP; (yyval.node) = (Node *) n; } #line 27212 "gram_minimal.c" /* yacc.c:1646 */ break; case 262: #line 1870 "gram_minimal.y" /* yacc.c:1646 */ { DiscardStmt *n = makeNode(DiscardStmt); n->target = DISCARD_PLANS; (yyval.node) = (Node *) n; } #line 27222 "gram_minimal.c" /* yacc.c:1646 */ break; case 263: #line 1876 "gram_minimal.y" /* yacc.c:1646 */ { DiscardStmt *n = makeNode(DiscardStmt); n->target = DISCARD_SEQUENCES; (yyval.node) = (Node *) n; } #line 27232 "gram_minimal.c" /* yacc.c:1646 */ break; case 264: #line 1895 "gram_minimal.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 27245 "gram_minimal.c" /* yacc.c:1646 */ break; case 265: #line 1904 "gram_minimal.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 27258 "gram_minimal.c" /* yacc.c:1646 */ break; case 266: #line 1913 "gram_minimal.y" /* yacc.c:1646 */ { AlterTableStmt *n = makeNode(AlterTableStmt); n->relation = (yyvsp[-1].range); n->cmds = list_make1((yyvsp[0].node)); n->relkind = OBJECT_TABLE; n->missing_ok = false; (yyval.node) = (Node *)n; } #line 27271 "gram_minimal.c" /* yacc.c:1646 */ break; case 267: #line 1922 "gram_minimal.y" /* yacc.c:1646 */ { AlterTableStmt *n = makeNode(AlterTableStmt); n->relation = (yyvsp[-1].range); n->cmds = list_make1((yyvsp[0].node)); n->relkind = OBJECT_TABLE; n->missing_ok = true; (yyval.node) = (Node *)n; } #line 27284 "gram_minimal.c" /* yacc.c:1646 */ break; case 268: #line 1931 "gram_minimal.y" /* yacc.c:1646 */ { AlterTableMoveAllStmt *n = makeNode(AlterTableMoveAllStmt); n->orig_tablespacename = (yyvsp[-4].str); n->objtype = OBJECT_TABLE; n->roles = NIL; n->new_tablespacename = (yyvsp[-1].str); n->nowait = (yyvsp[0].boolean); (yyval.node) = (Node *)n; } #line 27299 "gram_minimal.c" /* yacc.c:1646 */ break; case 269: #line 1942 "gram_minimal.y" /* yacc.c:1646 */ { AlterTableMoveAllStmt *n = makeNode(AlterTableMoveAllStmt); n->orig_tablespacename = (yyvsp[-7].str); n->objtype = OBJECT_TABLE; n->roles = (yyvsp[-4].list); n->new_tablespacename = (yyvsp[-1].str); n->nowait = (yyvsp[0].boolean); (yyval.node) = (Node *)n; } #line 27314 "gram_minimal.c" /* yacc.c:1646 */ break; case 270: #line 1953 "gram_minimal.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 27327 "gram_minimal.c" /* yacc.c:1646 */ break; case 271: #line 1962 "gram_minimal.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 27340 "gram_minimal.c" /* yacc.c:1646 */ break; case 272: #line 1971 "gram_minimal.y" /* yacc.c:1646 */ { AlterTableStmt *n = makeNode(AlterTableStmt); n->relation = (yyvsp[-1].range); n->cmds = list_make1((yyvsp[0].node)); n->relkind = OBJECT_INDEX; n->missing_ok = false; (yyval.node) = (Node *)n; } #line 27353 "gram_minimal.c" /* yacc.c:1646 */ break; case 273: #line 1980 "gram_minimal.y" /* yacc.c:1646 */ { AlterTableMoveAllStmt *n = makeNode(AlterTableMoveAllStmt); n->orig_tablespacename = (yyvsp[-4].str); n->objtype = OBJECT_INDEX; n->roles = NIL; n->new_tablespacename = (yyvsp[-1].str); n->nowait = (yyvsp[0].boolean); (yyval.node) = (Node *)n; } #line 27368 "gram_minimal.c" /* yacc.c:1646 */ break; case 274: #line 1991 "gram_minimal.y" /* yacc.c:1646 */ { AlterTableMoveAllStmt *n = makeNode(AlterTableMoveAllStmt); n->orig_tablespacename = (yyvsp[-7].str); n->objtype = OBJECT_INDEX; n->roles = (yyvsp[-4].list); n->new_tablespacename = (yyvsp[-1].str); n->nowait = (yyvsp[0].boolean); (yyval.node) = (Node *)n; } #line 27383 "gram_minimal.c" /* yacc.c:1646 */ break; case 275: #line 2002 "gram_minimal.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 27396 "gram_minimal.c" /* yacc.c:1646 */ break; case 276: #line 2011 "gram_minimal.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 27409 "gram_minimal.c" /* yacc.c:1646 */ break; case 277: #line 2020 "gram_minimal.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 27422 "gram_minimal.c" /* yacc.c:1646 */ break; case 278: #line 2029 "gram_minimal.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 27435 "gram_minimal.c" /* yacc.c:1646 */ break; case 279: #line 2038 "gram_minimal.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 27448 "gram_minimal.c" /* yacc.c:1646 */ break; case 280: #line 2047 "gram_minimal.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 27461 "gram_minimal.c" /* yacc.c:1646 */ break; case 281: #line 2056 "gram_minimal.y" /* yacc.c:1646 */ { AlterTableMoveAllStmt *n = makeNode(AlterTableMoveAllStmt); n->orig_tablespacename = (yyvsp[-4].str); n->objtype = OBJECT_MATVIEW; n->roles = NIL; n->new_tablespacename = (yyvsp[-1].str); n->nowait = (yyvsp[0].boolean); (yyval.node) = (Node *)n; } #line 27476 "gram_minimal.c" /* yacc.c:1646 */ break; case 282: #line 2067 "gram_minimal.y" /* yacc.c:1646 */ { AlterTableMoveAllStmt *n = makeNode(AlterTableMoveAllStmt); n->orig_tablespacename = (yyvsp[-7].str); n->objtype = OBJECT_MATVIEW; n->roles = (yyvsp[-4].list); n->new_tablespacename = (yyvsp[-1].str); n->nowait = (yyvsp[0].boolean); (yyval.node) = (Node *)n; } #line 27491 "gram_minimal.c" /* yacc.c:1646 */ break; case 283: #line 2080 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].node)); } #line 27497 "gram_minimal.c" /* yacc.c:1646 */ break; case 284: #line 2081 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].node)); } #line 27503 "gram_minimal.c" /* yacc.c:1646 */ break; case 285: #line 2087 "gram_minimal.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); PartitionCmd *cmd = makeNode(PartitionCmd); n->subtype = AT_AttachPartition; cmd->name = (yyvsp[-1].range); cmd->bound = (yyvsp[0].partboundspec); n->def = (Node *) cmd; (yyval.node) = (Node *) n; } #line 27519 "gram_minimal.c" /* yacc.c:1646 */ break; case 286: #line 2100 "gram_minimal.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); PartitionCmd *cmd = makeNode(PartitionCmd); n->subtype = AT_DetachPartition; cmd->name = (yyvsp[0].range); cmd->bound = NULL; n->def = (Node *) cmd; (yyval.node) = (Node *) n; } #line 27535 "gram_minimal.c" /* yacc.c:1646 */ break; case 287: #line 2116 "gram_minimal.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); PartitionCmd *cmd = makeNode(PartitionCmd); n->subtype = AT_AttachPartition; cmd->name = (yyvsp[0].range); cmd->bound = NULL; n->def = (Node *) cmd; (yyval.node) = (Node *) n; } #line 27551 "gram_minimal.c" /* yacc.c:1646 */ break; case 288: #line 2132 "gram_minimal.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_AddColumn; n->def = (yyvsp[0].node); n->missing_ok = false; (yyval.node) = (Node *)n; } #line 27563 "gram_minimal.c" /* yacc.c:1646 */ break; case 289: #line 2141 "gram_minimal.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_AddColumn; n->def = (yyvsp[0].node); n->missing_ok = true; (yyval.node) = (Node *)n; } #line 27575 "gram_minimal.c" /* yacc.c:1646 */ break; case 290: #line 2150 "gram_minimal.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_AddColumn; n->def = (yyvsp[0].node); n->missing_ok = false; (yyval.node) = (Node *)n; } #line 27587 "gram_minimal.c" /* yacc.c:1646 */ break; case 291: #line 2159 "gram_minimal.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_AddColumn; n->def = (yyvsp[0].node); n->missing_ok = true; (yyval.node) = (Node *)n; } #line 27599 "gram_minimal.c" /* yacc.c:1646 */ break; case 292: #line 2168 "gram_minimal.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 27611 "gram_minimal.c" /* yacc.c:1646 */ break; case 293: #line 2177 "gram_minimal.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_DropNotNull; n->name = (yyvsp[-3].str); (yyval.node) = (Node *)n; } #line 27622 "gram_minimal.c" /* yacc.c:1646 */ break; case 294: #line 2185 "gram_minimal.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_SetNotNull; n->name = (yyvsp[-3].str); (yyval.node) = (Node *)n; } #line 27633 "gram_minimal.c" /* yacc.c:1646 */ break; case 295: #line 2193 "gram_minimal.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 27645 "gram_minimal.c" /* yacc.c:1646 */ break; case 296: #line 2202 "gram_minimal.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); if ((yyvsp[-3].ival) <= 0 || (yyvsp[-3].ival) > PG_INT16_MAX) ereport(ERROR, (errcode(ERRCODE_INVALID_PARAMETER_VALUE), errmsg("column number must be in range from 1 to %d", PG_INT16_MAX), parser_errposition((yylsp[-3])))); n->subtype = AT_SetStatistics; n->num = (int16) (yyvsp[-3].ival); n->def = (Node *) makeInteger((yyvsp[0].ival)); (yyval.node) = (Node *)n; } #line 27664 "gram_minimal.c" /* yacc.c:1646 */ break; case 297: #line 2218 "gram_minimal.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 27676 "gram_minimal.c" /* yacc.c:1646 */ break; case 298: #line 2227 "gram_minimal.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 27688 "gram_minimal.c" /* yacc.c:1646 */ break; case 299: #line 2236 "gram_minimal.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 27700 "gram_minimal.c" /* yacc.c:1646 */ break; case 300: #line 2245 "gram_minimal.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); Constraint *c = makeNode(Constraint); c->contype = CONSTR_IDENTITY; c->generated_when = (yyvsp[-3].ival); c->options = (yyvsp[0].list); c->location = (yylsp[-4]); n->subtype = AT_AddIdentity; n->name = (yyvsp[-6].str); n->def = (Node *) c; (yyval.node) = (Node *)n; } #line 27720 "gram_minimal.c" /* yacc.c:1646 */ break; case 301: #line 2262 "gram_minimal.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_SetIdentity; n->name = (yyvsp[-1].str); n->def = (Node *) (yyvsp[0].list); (yyval.node) = (Node *)n; } #line 27732 "gram_minimal.c" /* yacc.c:1646 */ break; case 302: #line 2271 "gram_minimal.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_DropIdentity; n->name = (yyvsp[-2].str); n->missing_ok = false; (yyval.node) = (Node *)n; } #line 27744 "gram_minimal.c" /* yacc.c:1646 */ break; case 303: #line 2280 "gram_minimal.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_DropIdentity; n->name = (yyvsp[-4].str); n->missing_ok = true; (yyval.node) = (Node *)n; } #line 27756 "gram_minimal.c" /* yacc.c:1646 */ break; case 304: #line 2289 "gram_minimal.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 27769 "gram_minimal.c" /* yacc.c:1646 */ break; case 305: #line 2299 "gram_minimal.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 27782 "gram_minimal.c" /* yacc.c:1646 */ break; case 306: #line 2312 "gram_minimal.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 27800 "gram_minimal.c" /* yacc.c:1646 */ break; case 307: #line 2327 "gram_minimal.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 27812 "gram_minimal.c" /* yacc.c:1646 */ break; case 308: #line 2336 "gram_minimal.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_AddConstraint; n->def = (yyvsp[0].node); n->missing_ok = false; (yyval.node) = (Node *)n; } #line 27824 "gram_minimal.c" /* yacc.c:1646 */ break; case 309: #line 2345 "gram_minimal.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 27842 "gram_minimal.c" /* yacc.c:1646 */ break; case 310: #line 2360 "gram_minimal.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_ValidateConstraint; n->name = (yyvsp[0].str); (yyval.node) = (Node *)n; } #line 27853 "gram_minimal.c" /* yacc.c:1646 */ break; case 311: #line 2368 "gram_minimal.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 27866 "gram_minimal.c" /* yacc.c:1646 */ break; case 312: #line 2378 "gram_minimal.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 27879 "gram_minimal.c" /* yacc.c:1646 */ break; case 313: #line 2388 "gram_minimal.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_DropOids; (yyval.node) = (Node *)n; } #line 27889 "gram_minimal.c" /* yacc.c:1646 */ break; case 314: #line 2395 "gram_minimal.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_ClusterOn; n->name = (yyvsp[0].str); (yyval.node) = (Node *)n; } #line 27900 "gram_minimal.c" /* yacc.c:1646 */ break; case 315: #line 2403 "gram_minimal.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_DropCluster; n->name = NULL; (yyval.node) = (Node *)n; } #line 27911 "gram_minimal.c" /* yacc.c:1646 */ break; case 316: #line 2411 "gram_minimal.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_SetLogged; (yyval.node) = (Node *)n; } #line 27921 "gram_minimal.c" /* yacc.c:1646 */ break; case 317: #line 2418 "gram_minimal.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_SetUnLogged; (yyval.node) = (Node *)n; } #line 27931 "gram_minimal.c" /* yacc.c:1646 */ break; case 318: #line 2425 "gram_minimal.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_EnableTrig; n->name = (yyvsp[0].str); (yyval.node) = (Node *)n; } #line 27942 "gram_minimal.c" /* yacc.c:1646 */ break; case 319: #line 2433 "gram_minimal.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_EnableAlwaysTrig; n->name = (yyvsp[0].str); (yyval.node) = (Node *)n; } #line 27953 "gram_minimal.c" /* yacc.c:1646 */ break; case 320: #line 2441 "gram_minimal.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_EnableReplicaTrig; n->name = (yyvsp[0].str); (yyval.node) = (Node *)n; } #line 27964 "gram_minimal.c" /* yacc.c:1646 */ break; case 321: #line 2449 "gram_minimal.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_EnableTrigAll; (yyval.node) = (Node *)n; } #line 27974 "gram_minimal.c" /* yacc.c:1646 */ break; case 322: #line 2456 "gram_minimal.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_EnableTrigUser; (yyval.node) = (Node *)n; } #line 27984 "gram_minimal.c" /* yacc.c:1646 */ break; case 323: #line 2463 "gram_minimal.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_DisableTrig; n->name = (yyvsp[0].str); (yyval.node) = (Node *)n; } #line 27995 "gram_minimal.c" /* yacc.c:1646 */ break; case 324: #line 2471 "gram_minimal.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_DisableTrigAll; (yyval.node) = (Node *)n; } #line 28005 "gram_minimal.c" /* yacc.c:1646 */ break; case 325: #line 2478 "gram_minimal.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_DisableTrigUser; (yyval.node) = (Node *)n; } #line 28015 "gram_minimal.c" /* yacc.c:1646 */ break; case 326: #line 2485 "gram_minimal.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_EnableRule; n->name = (yyvsp[0].str); (yyval.node) = (Node *)n; } #line 28026 "gram_minimal.c" /* yacc.c:1646 */ break; case 327: #line 2493 "gram_minimal.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_EnableAlwaysRule; n->name = (yyvsp[0].str); (yyval.node) = (Node *)n; } #line 28037 "gram_minimal.c" /* yacc.c:1646 */ break; case 328: #line 2501 "gram_minimal.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_EnableReplicaRule; n->name = (yyvsp[0].str); (yyval.node) = (Node *)n; } #line 28048 "gram_minimal.c" /* yacc.c:1646 */ break; case 329: #line 2509 "gram_minimal.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_DisableRule; n->name = (yyvsp[0].str); (yyval.node) = (Node *)n; } #line 28059 "gram_minimal.c" /* yacc.c:1646 */ break; case 330: #line 2517 "gram_minimal.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_AddInherit; n->def = (Node *) (yyvsp[0].range); (yyval.node) = (Node *)n; } #line 28070 "gram_minimal.c" /* yacc.c:1646 */ break; case 331: #line 2525 "gram_minimal.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_DropInherit; n->def = (Node *) (yyvsp[0].range); (yyval.node) = (Node *)n; } #line 28081 "gram_minimal.c" /* yacc.c:1646 */ break; case 332: #line 2533 "gram_minimal.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 28094 "gram_minimal.c" /* yacc.c:1646 */ break; case 333: #line 2543 "gram_minimal.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_DropOf; (yyval.node) = (Node *)n; } #line 28104 "gram_minimal.c" /* yacc.c:1646 */ break; case 334: #line 2550 "gram_minimal.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_ChangeOwner; n->newowner = (yyvsp[0].rolespec); (yyval.node) = (Node *)n; } #line 28115 "gram_minimal.c" /* yacc.c:1646 */ break; case 335: #line 2558 "gram_minimal.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_SetTableSpace; n->name = (yyvsp[0].str); (yyval.node) = (Node *)n; } #line 28126 "gram_minimal.c" /* yacc.c:1646 */ break; case 336: #line 2566 "gram_minimal.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_SetRelOptions; n->def = (Node *)(yyvsp[0].list); (yyval.node) = (Node *)n; } #line 28137 "gram_minimal.c" /* yacc.c:1646 */ break; case 337: #line 2574 "gram_minimal.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_ResetRelOptions; n->def = (Node *)(yyvsp[0].list); (yyval.node) = (Node *)n; } #line 28148 "gram_minimal.c" /* yacc.c:1646 */ break; case 338: #line 2582 "gram_minimal.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_ReplicaIdentity; n->def = (yyvsp[0].node); (yyval.node) = (Node *)n; } #line 28159 "gram_minimal.c" /* yacc.c:1646 */ break; case 339: #line 2590 "gram_minimal.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_EnableRowSecurity; (yyval.node) = (Node *)n; } #line 28169 "gram_minimal.c" /* yacc.c:1646 */ break; case 340: #line 2597 "gram_minimal.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_DisableRowSecurity; (yyval.node) = (Node *)n; } #line 28179 "gram_minimal.c" /* yacc.c:1646 */ break; case 341: #line 2604 "gram_minimal.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_ForceRowSecurity; (yyval.node) = (Node *)n; } #line 28189 "gram_minimal.c" /* yacc.c:1646 */ break; case 342: #line 2611 "gram_minimal.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_NoForceRowSecurity; (yyval.node) = (Node *)n; } #line 28199 "gram_minimal.c" /* yacc.c:1646 */ break; case 343: #line 2617 "gram_minimal.y" /* yacc.c:1646 */ { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_GenericOptions; n->def = (Node *)(yyvsp[0].list); (yyval.node) = (Node *) n; } #line 28210 "gram_minimal.c" /* yacc.c:1646 */ break; case 344: #line 2626 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 28216 "gram_minimal.c" /* yacc.c:1646 */ break; case 345: #line 2627 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = NULL; } #line 28222 "gram_minimal.c" /* yacc.c:1646 */ break; case 346: #line 2631 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.dbehavior) = DROP_CASCADE; } #line 28228 "gram_minimal.c" /* yacc.c:1646 */ break; case 347: #line 2632 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.dbehavior) = DROP_RESTRICT; } #line 28234 "gram_minimal.c" /* yacc.c:1646 */ break; case 348: #line 2633 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.dbehavior) = DROP_RESTRICT; /* default */ } #line 28240 "gram_minimal.c" /* yacc.c:1646 */ break; case 349: #line 2638 "gram_minimal.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 28252 "gram_minimal.c" /* yacc.c:1646 */ break; case 350: #line 2645 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = NULL; } #line 28258 "gram_minimal.c" /* yacc.c:1646 */ break; case 351: #line 2649 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 28264 "gram_minimal.c" /* yacc.c:1646 */ break; case 352: #line 2650 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = NULL; } #line 28270 "gram_minimal.c" /* yacc.c:1646 */ break; case 353: #line 2655 "gram_minimal.y" /* yacc.c:1646 */ { ReplicaIdentityStmt *n = makeNode(ReplicaIdentityStmt); n->identity_type = REPLICA_IDENTITY_NOTHING; n->name = NULL; (yyval.node) = (Node *) n; } #line 28281 "gram_minimal.c" /* yacc.c:1646 */ break; case 354: #line 2662 "gram_minimal.y" /* yacc.c:1646 */ { ReplicaIdentityStmt *n = makeNode(ReplicaIdentityStmt); n->identity_type = REPLICA_IDENTITY_FULL; n->name = NULL; (yyval.node) = (Node *) n; } #line 28292 "gram_minimal.c" /* yacc.c:1646 */ break; case 355: #line 2669 "gram_minimal.y" /* yacc.c:1646 */ { ReplicaIdentityStmt *n = makeNode(ReplicaIdentityStmt); n->identity_type = REPLICA_IDENTITY_DEFAULT; n->name = NULL; (yyval.node) = (Node *) n; } #line 28303 "gram_minimal.c" /* yacc.c:1646 */ break; case 356: #line 2676 "gram_minimal.y" /* yacc.c:1646 */ { ReplicaIdentityStmt *n = makeNode(ReplicaIdentityStmt); n->identity_type = REPLICA_IDENTITY_INDEX; n->name = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 28314 "gram_minimal.c" /* yacc.c:1646 */ break; case 357: #line 2685 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[-1].list); } #line 28320 "gram_minimal.c" /* yacc.c:1646 */ break; case 358: #line 2688 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 28326 "gram_minimal.c" /* yacc.c:1646 */ break; case 359: #line 2689 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 28332 "gram_minimal.c" /* yacc.c:1646 */ break; case 360: #line 2693 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].defelt)); } #line 28338 "gram_minimal.c" /* yacc.c:1646 */ break; case 361: #line 2694 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].defelt)); } #line 28344 "gram_minimal.c" /* yacc.c:1646 */ break; case 362: #line 2700 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem((yyvsp[-2].str), (Node *) (yyvsp[0].node), (yylsp[-2])); } #line 28352 "gram_minimal.c" /* yacc.c:1646 */ break; case 363: #line 2704 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem((yyvsp[0].str), NULL, (yylsp[0])); } #line 28360 "gram_minimal.c" /* yacc.c:1646 */ break; case 364: #line 2708 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElemExtended((yyvsp[-4].str), (yyvsp[-2].str), (Node *) (yyvsp[0].node), DEFELEM_UNSPEC, (yylsp[-4])); } #line 28369 "gram_minimal.c" /* yacc.c:1646 */ break; case 365: #line 2713 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElemExtended((yyvsp[-2].str), (yyvsp[0].str), NULL, DEFELEM_UNSPEC, (yylsp[-2])); } #line 28377 "gram_minimal.c" /* yacc.c:1646 */ break; case 366: #line 2720 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].defelt)); } #line 28383 "gram_minimal.c" /* yacc.c:1646 */ break; case 367: #line 2722 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-1].list), (yyvsp[0].defelt)); } #line 28389 "gram_minimal.c" /* yacc.c:1646 */ break; case 368: #line 2727 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("restart", NULL, (yylsp[0])); } #line 28397 "gram_minimal.c" /* yacc.c:1646 */ break; case 369: #line 2731 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("restart", (Node *)(yyvsp[0].value), (yylsp[-2])); } #line 28405 "gram_minimal.c" /* yacc.c:1646 */ break; case 370: #line 2735 "gram_minimal.y" /* yacc.c:1646 */ { if (strcmp((yyvsp[0].defelt)->defname, "as") == 0 || strcmp((yyvsp[0].defelt)->defname, "restart") == 0 || strcmp((yyvsp[0].defelt)->defname, "owned_by") == 0) ereport(ERROR, (errcode(ERRCODE_SYNTAX_ERROR), errmsg("sequence option \"%s\" not supported here", (yyvsp[0].defelt)->defname), parser_errposition((yylsp[0])))); (yyval.defelt) = (yyvsp[0].defelt); } #line 28420 "gram_minimal.c" /* yacc.c:1646 */ break; case 371: #line 2746 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("generated", (Node *) makeInteger((yyvsp[0].ival)), (yylsp[-2])); } #line 28428 "gram_minimal.c" /* yacc.c:1646 */ break; case 372: #line 2754 "gram_minimal.y" /* yacc.c:1646 */ { ListCell *lc; PartitionBoundSpec *n = makeNode(PartitionBoundSpec); n->strategy = PARTITION_STRATEGY_HASH; n->modulus = n->remainder = -1; foreach (lc, (yyvsp[-1].list)) { DefElem *opt = lfirst_node(DefElem, lc); if (strcmp(opt->defname, "modulus") == 0) { if (n->modulus != -1) ereport(ERROR, (errcode(ERRCODE_DUPLICATE_OBJECT), errmsg("modulus for hash partition provided more than once"), parser_errposition(opt->location))); n->modulus = defGetInt32(opt); } else if (strcmp(opt->defname, "remainder") == 0) { if (n->remainder != -1) ereport(ERROR, (errcode(ERRCODE_DUPLICATE_OBJECT), errmsg("remainder for hash partition provided more than once"), parser_errposition(opt->location))); n->remainder = defGetInt32(opt); } else ereport(ERROR, (errcode(ERRCODE_SYNTAX_ERROR), errmsg("unrecognized hash partition bound specification \"%s\"", opt->defname), parser_errposition(opt->location))); } if (n->modulus == -1) ereport(ERROR, (errcode(ERRCODE_SYNTAX_ERROR), errmsg("modulus for hash partition must be specified"))); if (n->remainder == -1) ereport(ERROR, (errcode(ERRCODE_SYNTAX_ERROR), errmsg("remainder for hash partition must be specified"))); n->location = (yylsp[-3]); (yyval.partboundspec) = n; } #line 28483 "gram_minimal.c" /* yacc.c:1646 */ break; case 373: #line 2807 "gram_minimal.y" /* yacc.c:1646 */ { PartitionBoundSpec *n = makeNode(PartitionBoundSpec); n->strategy = PARTITION_STRATEGY_LIST; n->is_default = false; n->listdatums = (yyvsp[-1].list); n->location = (yylsp[-3]); (yyval.partboundspec) = n; } #line 28498 "gram_minimal.c" /* yacc.c:1646 */ break; case 374: #line 2820 "gram_minimal.y" /* yacc.c:1646 */ { PartitionBoundSpec *n = makeNode(PartitionBoundSpec); n->strategy = PARTITION_STRATEGY_RANGE; n->is_default = false; n->lowerdatums = (yyvsp[-5].list); n->upperdatums = (yyvsp[-1].list); n->location = (yylsp[-7]); (yyval.partboundspec) = n; } #line 28514 "gram_minimal.c" /* yacc.c:1646 */ break; case 375: #line 2834 "gram_minimal.y" /* yacc.c:1646 */ { PartitionBoundSpec *n = makeNode(PartitionBoundSpec); n->is_default = true; n->location = (yylsp[0]); (yyval.partboundspec) = n; } #line 28527 "gram_minimal.c" /* yacc.c:1646 */ break; case 376: #line 2846 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem((yyvsp[-1].str), (Node *)makeInteger((yyvsp[0].ival)), (yylsp[-1])); } #line 28535 "gram_minimal.c" /* yacc.c:1646 */ break; case 377: #line 2853 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].defelt)); } #line 28543 "gram_minimal.c" /* yacc.c:1646 */ break; case 378: #line 2857 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].defelt)); } #line 28551 "gram_minimal.c" /* yacc.c:1646 */ break; case 379: #line 2871 "gram_minimal.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 28565 "gram_minimal.c" /* yacc.c:1646 */ break; case 380: #line 2883 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].node)); } #line 28571 "gram_minimal.c" /* yacc.c:1646 */ break; case 381: #line 2884 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].node)); } #line 28577 "gram_minimal.c" /* yacc.c:1646 */ break; case 382: #line 2890 "gram_minimal.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 28589 "gram_minimal.c" /* yacc.c:1646 */ break; case 383: #line 2899 "gram_minimal.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 28602 "gram_minimal.c" /* yacc.c:1646 */ break; case 384: #line 2909 "gram_minimal.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 28615 "gram_minimal.c" /* yacc.c:1646 */ break; case 385: #line 2919 "gram_minimal.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 28634 "gram_minimal.c" /* yacc.c:1646 */ break; case 386: #line 2945 "gram_minimal.y" /* yacc.c:1646 */ { ClosePortalStmt *n = makeNode(ClosePortalStmt); n->portalname = (yyvsp[0].str); (yyval.node) = (Node *)n; } #line 28644 "gram_minimal.c" /* yacc.c:1646 */ break; case 387: #line 2951 "gram_minimal.y" /* yacc.c:1646 */ { ClosePortalStmt *n = makeNode(ClosePortalStmt); n->portalname = NULL; (yyval.node) = (Node *)n; } #line 28654 "gram_minimal.c" /* yacc.c:1646 */ break; case 388: #line 2986 "gram_minimal.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[-6].boolean); n->is_program = (yyvsp[-5].boolean); n->filename = (yyvsp[-4].str); n->whereClause = (yyvsp[0].node); if (n->is_program && n->filename == NULL) ereport(ERROR, (errcode(ERRCODE_SYNTAX_ERROR), errmsg("STDIN/STDOUT not allowed with PROGRAM"), parser_errposition((yylsp[-3])))); if (!n->is_from && n->whereClause != NULL) ereport(ERROR, (errcode(ERRCODE_SYNTAX_ERROR), errmsg("WHERE clause not allowed with COPY TO"), parser_errposition((yylsp[0])))); n->options = NIL; /* Concatenate user-supplied flags */ if ((yyvsp[-9].defelt)) n->options = lappend(n->options, (yyvsp[-9].defelt)); if ((yyvsp[-3].defelt)) n->options = lappend(n->options, (yyvsp[-3].defelt)); if ((yyvsp[-1].list)) n->options = list_concat(n->options, (yyvsp[-1].list)); (yyval.node) = (Node *)n; } #line 28691 "gram_minimal.c" /* yacc.c:1646 */ break; case 389: #line 3019 "gram_minimal.y" /* yacc.c:1646 */ { CopyStmt *n = makeNode(CopyStmt); n->relation = NULL; n->query = (yyvsp[-6].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[-4])))); (yyval.node) = (Node *)n; } #line 28714 "gram_minimal.c" /* yacc.c:1646 */ break; case 390: #line 3040 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.boolean) = true; } #line 28720 "gram_minimal.c" /* yacc.c:1646 */ break; case 391: #line 3041 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.boolean) = false; } #line 28726 "gram_minimal.c" /* yacc.c:1646 */ break; case 392: #line 3045 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.boolean) = true; } #line 28732 "gram_minimal.c" /* yacc.c:1646 */ break; case 393: #line 3046 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.boolean) = false; } #line 28738 "gram_minimal.c" /* yacc.c:1646 */ break; case 394: #line 3055 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 28744 "gram_minimal.c" /* yacc.c:1646 */ break; case 395: #line 3056 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = NULL; } #line 28750 "gram_minimal.c" /* yacc.c:1646 */ break; case 396: #line 3057 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = NULL; } #line 28756 "gram_minimal.c" /* yacc.c:1646 */ break; case 397: #line 3060 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 28762 "gram_minimal.c" /* yacc.c:1646 */ break; case 398: #line 3061 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[-1].list); } #line 28768 "gram_minimal.c" /* yacc.c:1646 */ break; case 399: #line 3066 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-1].list), (yyvsp[0].defelt)); } #line 28774 "gram_minimal.c" /* yacc.c:1646 */ break; case 400: #line 3067 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 28780 "gram_minimal.c" /* yacc.c:1646 */ break; case 401: #line 3072 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("format", (Node *)makeString("binary"), (yylsp[0])); } #line 28788 "gram_minimal.c" /* yacc.c:1646 */ break; case 402: #line 3076 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("freeze", (Node *)makeInteger(true), (yylsp[0])); } #line 28796 "gram_minimal.c" /* yacc.c:1646 */ break; case 403: #line 3080 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("delimiter", (Node *)makeString((yyvsp[0].str)), (yylsp[-2])); } #line 28804 "gram_minimal.c" /* yacc.c:1646 */ break; case 404: #line 3084 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("null", (Node *)makeString((yyvsp[0].str)), (yylsp[-2])); } #line 28812 "gram_minimal.c" /* yacc.c:1646 */ break; case 405: #line 3088 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("format", (Node *)makeString("csv"), (yylsp[0])); } #line 28820 "gram_minimal.c" /* yacc.c:1646 */ break; case 406: #line 3092 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("header", (Node *)makeInteger(true), (yylsp[0])); } #line 28828 "gram_minimal.c" /* yacc.c:1646 */ break; case 407: #line 3096 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("quote", (Node *)makeString((yyvsp[0].str)), (yylsp[-2])); } #line 28836 "gram_minimal.c" /* yacc.c:1646 */ break; case 408: #line 3100 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("escape", (Node *)makeString((yyvsp[0].str)), (yylsp[-2])); } #line 28844 "gram_minimal.c" /* yacc.c:1646 */ break; case 409: #line 3104 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("force_quote", (Node *)(yyvsp[0].list), (yylsp[-2])); } #line 28852 "gram_minimal.c" /* yacc.c:1646 */ break; case 410: #line 3108 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("force_quote", (Node *)makeNode(A_Star), (yylsp[-2])); } #line 28860 "gram_minimal.c" /* yacc.c:1646 */ break; case 411: #line 3112 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("force_not_null", (Node *)(yyvsp[0].list), (yylsp[-3])); } #line 28868 "gram_minimal.c" /* yacc.c:1646 */ break; case 412: #line 3116 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("force_null", (Node *)(yyvsp[0].list), (yylsp[-2])); } #line 28876 "gram_minimal.c" /* yacc.c:1646 */ break; case 413: #line 3120 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("encoding", (Node *)makeString((yyvsp[0].str)), (yylsp[-1])); } #line 28884 "gram_minimal.c" /* yacc.c:1646 */ break; case 414: #line 3129 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("format", (Node *)makeString("binary"), (yylsp[0])); } #line 28892 "gram_minimal.c" /* yacc.c:1646 */ break; case 415: #line 3132 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = NULL; } #line 28898 "gram_minimal.c" /* yacc.c:1646 */ break; case 416: #line 3137 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("delimiter", (Node *)makeString((yyvsp[0].str)), (yylsp[-1])); } #line 28906 "gram_minimal.c" /* yacc.c:1646 */ break; case 417: #line 3140 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = NULL; } #line 28912 "gram_minimal.c" /* yacc.c:1646 */ break; case 418: #line 3144 "gram_minimal.y" /* yacc.c:1646 */ {} #line 28918 "gram_minimal.c" /* yacc.c:1646 */ break; case 419: #line 3145 "gram_minimal.y" /* yacc.c:1646 */ {} #line 28924 "gram_minimal.c" /* yacc.c:1646 */ break; case 420: #line 3151 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].defelt)); } #line 28932 "gram_minimal.c" /* yacc.c:1646 */ break; case 421: #line 3155 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].defelt)); } #line 28940 "gram_minimal.c" /* yacc.c:1646 */ break; case 422: #line 3162 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem((yyvsp[-1].str), (yyvsp[0].node), (yylsp[-1])); } #line 28948 "gram_minimal.c" /* yacc.c:1646 */ break; case 423: #line 3168 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeString((yyvsp[0].str)); } #line 28954 "gram_minimal.c" /* yacc.c:1646 */ break; case 424: #line 3169 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) (yyvsp[0].value); } #line 28960 "gram_minimal.c" /* yacc.c:1646 */ break; case 425: #line 3170 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeNode(A_Star); } #line 28966 "gram_minimal.c" /* yacc.c:1646 */ break; case 426: #line 3171 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) (yyvsp[-1].list); } #line 28972 "gram_minimal.c" /* yacc.c:1646 */ break; case 427: #line 3172 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = NULL; } #line 28978 "gram_minimal.c" /* yacc.c:1646 */ break; case 428: #line 3177 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].node)); } #line 28986 "gram_minimal.c" /* yacc.c:1646 */ break; case 429: #line 3181 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].node)); } #line 28994 "gram_minimal.c" /* yacc.c:1646 */ break; case 430: #line 3188 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeString((yyvsp[0].str)); } #line 29000 "gram_minimal.c" /* yacc.c:1646 */ break; case 431: #line 3202 "gram_minimal.y" /* yacc.c:1646 */ { CreateStmt *n = makeNode(CreateStmt); (yyvsp[-9].range)->relpersistence = (yyvsp[-11].ival); n->relation = (yyvsp[-9].range); n->tableElts = (yyvsp[-7].list); n->inhRelations = (yyvsp[-5].list); n->partspec = (yyvsp[-4].partspec); n->ofTypename = NULL; n->constraints = NIL; n->accessMethod = (yyvsp[-3].str); 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 29021 "gram_minimal.c" /* yacc.c:1646 */ break; case 432: #line 3221 "gram_minimal.y" /* yacc.c:1646 */ { CreateStmt *n = makeNode(CreateStmt); (yyvsp[-9].range)->relpersistence = (yyvsp[-14].ival); n->relation = (yyvsp[-9].range); n->tableElts = (yyvsp[-7].list); n->inhRelations = (yyvsp[-5].list); n->partspec = (yyvsp[-4].partspec); n->ofTypename = NULL; n->constraints = NIL; n->accessMethod = (yyvsp[-3].str); 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 29042 "gram_minimal.c" /* yacc.c:1646 */ break; case 433: #line 3240 "gram_minimal.y" /* yacc.c:1646 */ { CreateStmt *n = makeNode(CreateStmt); (yyvsp[-8].range)->relpersistence = (yyvsp[-10].ival); n->relation = (yyvsp[-8].range); n->tableElts = (yyvsp[-5].list); n->inhRelations = NIL; n->partspec = (yyvsp[-4].partspec); n->ofTypename = makeTypeNameFromNameList((yyvsp[-6].list)); n->ofTypename->location = (yylsp[-6]); n->constraints = NIL; n->accessMethod = (yyvsp[-3].str); 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 29064 "gram_minimal.c" /* yacc.c:1646 */ break; case 434: #line 3260 "gram_minimal.y" /* yacc.c:1646 */ { CreateStmt *n = makeNode(CreateStmt); (yyvsp[-8].range)->relpersistence = (yyvsp[-13].ival); n->relation = (yyvsp[-8].range); n->tableElts = (yyvsp[-5].list); n->inhRelations = NIL; n->partspec = (yyvsp[-4].partspec); n->ofTypename = makeTypeNameFromNameList((yyvsp[-6].list)); n->ofTypename->location = (yylsp[-6]); n->constraints = NIL; n->accessMethod = (yyvsp[-3].str); 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 29086 "gram_minimal.c" /* yacc.c:1646 */ break; case 435: #line 3280 "gram_minimal.y" /* yacc.c:1646 */ { CreateStmt *n = makeNode(CreateStmt); (yyvsp[-10].range)->relpersistence = (yyvsp[-12].ival); n->relation = (yyvsp[-10].range); n->tableElts = (yyvsp[-6].list); n->inhRelations = list_make1((yyvsp[-7].range)); n->partbound = (yyvsp[-5].partboundspec); n->partspec = (yyvsp[-4].partspec); n->ofTypename = NULL; n->constraints = NIL; n->accessMethod = (yyvsp[-3].str); 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 29108 "gram_minimal.c" /* yacc.c:1646 */ break; case 436: #line 3300 "gram_minimal.y" /* yacc.c:1646 */ { CreateStmt *n = makeNode(CreateStmt); (yyvsp[-10].range)->relpersistence = (yyvsp[-15].ival); n->relation = (yyvsp[-10].range); n->tableElts = (yyvsp[-6].list); n->inhRelations = list_make1((yyvsp[-7].range)); n->partbound = (yyvsp[-5].partboundspec); n->partspec = (yyvsp[-4].partspec); n->ofTypename = NULL; n->constraints = NIL; n->accessMethod = (yyvsp[-3].str); 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 29130 "gram_minimal.c" /* yacc.c:1646 */ break; case 437: #line 3330 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = RELPERSISTENCE_TEMP; } #line 29136 "gram_minimal.c" /* yacc.c:1646 */ break; case 438: #line 3331 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = RELPERSISTENCE_TEMP; } #line 29142 "gram_minimal.c" /* yacc.c:1646 */ break; case 439: #line 3332 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = RELPERSISTENCE_TEMP; } #line 29148 "gram_minimal.c" /* yacc.c:1646 */ break; case 440: #line 3333 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = RELPERSISTENCE_TEMP; } #line 29154 "gram_minimal.c" /* yacc.c:1646 */ break; case 441: #line 3335 "gram_minimal.y" /* yacc.c:1646 */ { ereport(WARNING, (errmsg("GLOBAL is deprecated in temporary table creation"), parser_errposition((yylsp[-1])))); (yyval.ival) = RELPERSISTENCE_TEMP; } #line 29165 "gram_minimal.c" /* yacc.c:1646 */ break; case 442: #line 3342 "gram_minimal.y" /* yacc.c:1646 */ { ereport(WARNING, (errmsg("GLOBAL is deprecated in temporary table creation"), parser_errposition((yylsp[-1])))); (yyval.ival) = RELPERSISTENCE_TEMP; } #line 29176 "gram_minimal.c" /* yacc.c:1646 */ break; case 443: #line 3348 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = RELPERSISTENCE_UNLOGGED; } #line 29182 "gram_minimal.c" /* yacc.c:1646 */ break; case 444: #line 3349 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = RELPERSISTENCE_PERMANENT; } #line 29188 "gram_minimal.c" /* yacc.c:1646 */ break; case 445: #line 3353 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 29194 "gram_minimal.c" /* yacc.c:1646 */ break; case 446: #line 3354 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 29200 "gram_minimal.c" /* yacc.c:1646 */ break; case 447: #line 3358 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[-1].list); } #line 29206 "gram_minimal.c" /* yacc.c:1646 */ break; case 448: #line 3359 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 29212 "gram_minimal.c" /* yacc.c:1646 */ break; case 449: #line 3364 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].node)); } #line 29220 "gram_minimal.c" /* yacc.c:1646 */ break; case 450: #line 3368 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].node)); } #line 29228 "gram_minimal.c" /* yacc.c:1646 */ break; case 451: #line 3375 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].node)); } #line 29236 "gram_minimal.c" /* yacc.c:1646 */ break; case 452: #line 3379 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].node)); } #line 29244 "gram_minimal.c" /* yacc.c:1646 */ break; case 453: #line 3385 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 29250 "gram_minimal.c" /* yacc.c:1646 */ break; case 454: #line 3386 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 29256 "gram_minimal.c" /* yacc.c:1646 */ break; case 455: #line 3387 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 29262 "gram_minimal.c" /* yacc.c:1646 */ break; case 456: #line 3391 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 29268 "gram_minimal.c" /* yacc.c:1646 */ break; case 457: #line 3392 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 29274 "gram_minimal.c" /* yacc.c:1646 */ break; case 458: #line 3396 "gram_minimal.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 29297 "gram_minimal.c" /* yacc.c:1646 */ break; case 459: #line 3417 "gram_minimal.y" /* yacc.c:1646 */ { ColumnDef *n = makeNode(ColumnDef); n->colname = (yyvsp[-1].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[-1]); (yyval.node) = (Node *)n; } #line 29319 "gram_minimal.c" /* yacc.c:1646 */ break; case 460: #line 3435 "gram_minimal.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 29341 "gram_minimal.c" /* yacc.c:1646 */ break; case 461: #line 3455 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-1].list), (yyvsp[0].node)); } #line 29347 "gram_minimal.c" /* yacc.c:1646 */ break; case 462: #line 3456 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 29353 "gram_minimal.c" /* yacc.c:1646 */ break; case 463: #line 3461 "gram_minimal.y" /* yacc.c:1646 */ { Constraint *n = castNode(Constraint, (yyvsp[0].node)); n->conname = (yyvsp[-1].str); n->location = (yylsp[-2]); (yyval.node) = (Node *) n; } #line 29364 "gram_minimal.c" /* yacc.c:1646 */ break; case 464: #line 3467 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 29370 "gram_minimal.c" /* yacc.c:1646 */ break; case 465: #line 3468 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 29376 "gram_minimal.c" /* yacc.c:1646 */ break; case 466: #line 3470 "gram_minimal.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 29393 "gram_minimal.c" /* yacc.c:1646 */ break; case 467: #line 3501 "gram_minimal.y" /* yacc.c:1646 */ { Constraint *n = makeNode(Constraint); n->contype = CONSTR_NOTNULL; n->location = (yylsp[-1]); (yyval.node) = (Node *)n; } #line 29404 "gram_minimal.c" /* yacc.c:1646 */ break; case 468: #line 3508 "gram_minimal.y" /* yacc.c:1646 */ { Constraint *n = makeNode(Constraint); n->contype = CONSTR_NULL; n->location = (yylsp[0]); (yyval.node) = (Node *)n; } #line 29415 "gram_minimal.c" /* yacc.c:1646 */ break; case 469: #line 3515 "gram_minimal.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 29430 "gram_minimal.c" /* yacc.c:1646 */ break; case 470: #line 3526 "gram_minimal.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 29445 "gram_minimal.c" /* yacc.c:1646 */ break; case 471: #line 3537 "gram_minimal.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; n->skip_validation = false; n->initially_valid = true; (yyval.node) = (Node *)n; } #line 29461 "gram_minimal.c" /* yacc.c:1646 */ break; case 472: #line 3549 "gram_minimal.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; n->skip_validation = false; n->initially_valid = true; (yyval.node) = (Node *)n; } #line 29476 "gram_minimal.c" /* yacc.c:1646 */ break; case 473: #line 3560 "gram_minimal.y" /* yacc.c:1646 */ { Constraint *n = makeNode(Constraint); n->contype = CONSTR_IDENTITY; n->generated_when = (yyvsp[-3].ival); n->options = (yyvsp[0].list); n->location = (yylsp[-4]); (yyval.node) = (Node *)n; } #line 29489 "gram_minimal.c" /* yacc.c:1646 */ break; case 474: #line 3569 "gram_minimal.y" /* yacc.c:1646 */ { Constraint *n = makeNode(Constraint); n->contype = CONSTR_GENERATED; n->generated_when = (yyvsp[-5].ival); n->raw_expr = (yyvsp[-2].node); n->cooked_expr = NULL; n->location = (yylsp[-6]); /* * Can't do this in the grammar because of shift/reduce * conflicts. (IDENTITY allows both ALWAYS and BY * DEFAULT, but generated columns only allow ALWAYS.) We * can also give a more useful error message and location. */ if ((yyvsp[-5].ival) != ATTRIBUTE_IDENTITY_ALWAYS) ereport(ERROR, (errcode(ERRCODE_SYNTAX_ERROR), errmsg("for a generated column, GENERATED ALWAYS must be specified"), parser_errposition((yylsp[-5])))); (yyval.node) = (Node *)n; } #line 29516 "gram_minimal.c" /* yacc.c:1646 */ break; case 475: #line 3592 "gram_minimal.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 29535 "gram_minimal.c" /* yacc.c:1646 */ break; case 476: #line 3609 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = ATTRIBUTE_IDENTITY_ALWAYS; } #line 29541 "gram_minimal.c" /* yacc.c:1646 */ break; case 477: #line 3610 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = ATTRIBUTE_IDENTITY_BY_DEFAULT; } #line 29547 "gram_minimal.c" /* yacc.c:1646 */ break; case 478: #line 3630 "gram_minimal.y" /* yacc.c:1646 */ { Constraint *n = makeNode(Constraint); n->contype = CONSTR_ATTR_DEFERRABLE; n->location = (yylsp[0]); (yyval.node) = (Node *)n; } #line 29558 "gram_minimal.c" /* yacc.c:1646 */ break; case 479: #line 3637 "gram_minimal.y" /* yacc.c:1646 */ { Constraint *n = makeNode(Constraint); n->contype = CONSTR_ATTR_NOT_DEFERRABLE; n->location = (yylsp[-1]); (yyval.node) = (Node *)n; } #line 29569 "gram_minimal.c" /* yacc.c:1646 */ break; case 480: #line 3644 "gram_minimal.y" /* yacc.c:1646 */ { Constraint *n = makeNode(Constraint); n->contype = CONSTR_ATTR_DEFERRED; n->location = (yylsp[-1]); (yyval.node) = (Node *)n; } #line 29580 "gram_minimal.c" /* yacc.c:1646 */ break; case 481: #line 3651 "gram_minimal.y" /* yacc.c:1646 */ { Constraint *n = makeNode(Constraint); n->contype = CONSTR_ATTR_IMMEDIATE; n->location = (yylsp[-1]); (yyval.node) = (Node *)n; } #line 29591 "gram_minimal.c" /* yacc.c:1646 */ break; case 482: #line 3662 "gram_minimal.y" /* yacc.c:1646 */ { TableLikeClause *n = makeNode(TableLikeClause); n->relation = (yyvsp[-1].range); n->options = (yyvsp[0].ival); (yyval.node) = (Node *)n; } #line 29602 "gram_minimal.c" /* yacc.c:1646 */ break; case 483: #line 3671 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = (yyvsp[-2].ival) | (yyvsp[0].ival); } #line 29608 "gram_minimal.c" /* yacc.c:1646 */ break; case 484: #line 3672 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = (yyvsp[-2].ival) & ~(yyvsp[0].ival); } #line 29614 "gram_minimal.c" /* yacc.c:1646 */ break; case 485: #line 3673 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = 0; } #line 29620 "gram_minimal.c" /* yacc.c:1646 */ break; case 486: #line 3677 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = CREATE_TABLE_LIKE_COMMENTS; } #line 29626 "gram_minimal.c" /* yacc.c:1646 */ break; case 487: #line 3678 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = CREATE_TABLE_LIKE_CONSTRAINTS; } #line 29632 "gram_minimal.c" /* yacc.c:1646 */ break; case 488: #line 3679 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = CREATE_TABLE_LIKE_DEFAULTS; } #line 29638 "gram_minimal.c" /* yacc.c:1646 */ break; case 489: #line 3680 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = CREATE_TABLE_LIKE_IDENTITY; } #line 29644 "gram_minimal.c" /* yacc.c:1646 */ break; case 490: #line 3681 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = CREATE_TABLE_LIKE_GENERATED; } #line 29650 "gram_minimal.c" /* yacc.c:1646 */ break; case 491: #line 3682 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = CREATE_TABLE_LIKE_INDEXES; } #line 29656 "gram_minimal.c" /* yacc.c:1646 */ break; case 492: #line 3683 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = CREATE_TABLE_LIKE_STATISTICS; } #line 29662 "gram_minimal.c" /* yacc.c:1646 */ break; case 493: #line 3684 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = CREATE_TABLE_LIKE_STORAGE; } #line 29668 "gram_minimal.c" /* yacc.c:1646 */ break; case 494: #line 3685 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = CREATE_TABLE_LIKE_ALL; } #line 29674 "gram_minimal.c" /* yacc.c:1646 */ break; case 495: #line 3695 "gram_minimal.y" /* yacc.c:1646 */ { Constraint *n = castNode(Constraint, (yyvsp[0].node)); n->conname = (yyvsp[-1].str); n->location = (yylsp[-2]); (yyval.node) = (Node *) n; } #line 29685 "gram_minimal.c" /* yacc.c:1646 */ break; case 496: #line 3701 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 29691 "gram_minimal.c" /* yacc.c:1646 */ break; case 497: #line 3706 "gram_minimal.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 29708 "gram_minimal.c" /* yacc.c:1646 */ break; case 498: #line 3720 "gram_minimal.y" /* yacc.c:1646 */ { Constraint *n = makeNode(Constraint); n->contype = CONSTR_UNIQUE; n->location = (yylsp[-7]); n->keys = (yyvsp[-5].list); n->including = (yyvsp[-3].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 29727 "gram_minimal.c" /* yacc.c:1646 */ break; case 499: #line 3735 "gram_minimal.y" /* yacc.c:1646 */ { Constraint *n = makeNode(Constraint); n->contype = CONSTR_UNIQUE; n->location = (yylsp[-2]); n->keys = NIL; n->including = 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 29746 "gram_minimal.c" /* yacc.c:1646 */ break; case 500: #line 3751 "gram_minimal.y" /* yacc.c:1646 */ { Constraint *n = makeNode(Constraint); n->contype = CONSTR_PRIMARY; n->location = (yylsp[-8]); n->keys = (yyvsp[-5].list); n->including = (yyvsp[-3].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 29765 "gram_minimal.c" /* yacc.c:1646 */ break; case 501: #line 3766 "gram_minimal.y" /* yacc.c:1646 */ { Constraint *n = makeNode(Constraint); n->contype = CONSTR_PRIMARY; n->location = (yylsp[-3]); n->keys = NIL; n->including = 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 29784 "gram_minimal.c" /* yacc.c:1646 */ break; case 502: #line 3783 "gram_minimal.y" /* yacc.c:1646 */ { Constraint *n = makeNode(Constraint); n->contype = CONSTR_EXCLUSION; n->location = (yylsp[-9]); n->access_method = (yyvsp[-8].str); n->exclusions = (yyvsp[-6].list); n->including = (yyvsp[-4].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 29805 "gram_minimal.c" /* yacc.c:1646 */ break; case 503: #line 3801 "gram_minimal.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 29827 "gram_minimal.c" /* yacc.c:1646 */ break; case 504: #line 3820 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.boolean) = true; } #line 29833 "gram_minimal.c" /* yacc.c:1646 */ break; case 505: #line 3821 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.boolean) = false; } #line 29839 "gram_minimal.c" /* yacc.c:1646 */ break; case 506: #line 3825 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[-1].list); } #line 29845 "gram_minimal.c" /* yacc.c:1646 */ break; case 507: #line 3826 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 29851 "gram_minimal.c" /* yacc.c:1646 */ break; case 508: #line 3830 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].node)); } #line 29857 "gram_minimal.c" /* yacc.c:1646 */ break; case 509: #line 3831 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].node)); } #line 29863 "gram_minimal.c" /* yacc.c:1646 */ break; case 510: #line 3835 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeString((yyvsp[0].str)); } #line 29871 "gram_minimal.c" /* yacc.c:1646 */ break; case 511: #line 3840 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[-1].list); } #line 29877 "gram_minimal.c" /* yacc.c:1646 */ break; case 512: #line 3841 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 29883 "gram_minimal.c" /* yacc.c:1646 */ break; case 513: #line 3845 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = FKCONSTR_MATCH_FULL; } #line 29891 "gram_minimal.c" /* yacc.c:1646 */ break; case 514: #line 3849 "gram_minimal.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 29903 "gram_minimal.c" /* yacc.c:1646 */ break; case 515: #line 3857 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = FKCONSTR_MATCH_SIMPLE; } #line 29911 "gram_minimal.c" /* yacc.c:1646 */ break; case 516: #line 3861 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = FKCONSTR_MATCH_SIMPLE; } #line 29919 "gram_minimal.c" /* yacc.c:1646 */ break; case 517: #line 3867 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].list)); } #line 29925 "gram_minimal.c" /* yacc.c:1646 */ break; case 518: #line 3869 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].list)); } #line 29931 "gram_minimal.c" /* yacc.c:1646 */ break; case 519: #line 3873 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make2((yyvsp[-2].ielem), (yyvsp[0].list)); } #line 29939 "gram_minimal.c" /* yacc.c:1646 */ break; case 520: #line 3878 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make2((yyvsp[-5].ielem), (yyvsp[-1].list)); } #line 29947 "gram_minimal.c" /* yacc.c:1646 */ break; case 521: #line 3884 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[-1].node); } #line 29953 "gram_minimal.c" /* yacc.c:1646 */ break; case 522: #line 3885 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = NULL; } #line 29959 "gram_minimal.c" /* yacc.c:1646 */ break; case 523: #line 3896 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = ((yyvsp[0].ival) << 8) | (FKCONSTR_ACTION_NOACTION & 0xFF); } #line 29965 "gram_minimal.c" /* yacc.c:1646 */ break; case 524: #line 3898 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = (FKCONSTR_ACTION_NOACTION << 8) | ((yyvsp[0].ival) & 0xFF); } #line 29971 "gram_minimal.c" /* yacc.c:1646 */ break; case 525: #line 3900 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = ((yyvsp[-1].ival) << 8) | ((yyvsp[0].ival) & 0xFF); } #line 29977 "gram_minimal.c" /* yacc.c:1646 */ break; case 526: #line 3902 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = ((yyvsp[0].ival) << 8) | ((yyvsp[-1].ival) & 0xFF); } #line 29983 "gram_minimal.c" /* yacc.c:1646 */ break; case 527: #line 3904 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = (FKCONSTR_ACTION_NOACTION << 8) | (FKCONSTR_ACTION_NOACTION & 0xFF); } #line 29989 "gram_minimal.c" /* yacc.c:1646 */ break; case 528: #line 3907 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = (yyvsp[0].ival); } #line 29995 "gram_minimal.c" /* yacc.c:1646 */ break; case 529: #line 3910 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = (yyvsp[0].ival); } #line 30001 "gram_minimal.c" /* yacc.c:1646 */ break; case 530: #line 3914 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = FKCONSTR_ACTION_NOACTION; } #line 30007 "gram_minimal.c" /* yacc.c:1646 */ break; case 531: #line 3915 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = FKCONSTR_ACTION_RESTRICT; } #line 30013 "gram_minimal.c" /* yacc.c:1646 */ break; case 532: #line 3916 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = FKCONSTR_ACTION_CASCADE; } #line 30019 "gram_minimal.c" /* yacc.c:1646 */ break; case 533: #line 3917 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = FKCONSTR_ACTION_SETNULL; } #line 30025 "gram_minimal.c" /* yacc.c:1646 */ break; case 534: #line 3918 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = FKCONSTR_ACTION_SETDEFAULT; } #line 30031 "gram_minimal.c" /* yacc.c:1646 */ break; case 535: #line 3921 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[-1].list); } #line 30037 "gram_minimal.c" /* yacc.c:1646 */ break; case 536: #line 3922 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 30043 "gram_minimal.c" /* yacc.c:1646 */ break; case 537: #line 3926 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.partspec) = (yyvsp[0].partspec); } #line 30049 "gram_minimal.c" /* yacc.c:1646 */ break; case 538: #line 3927 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.partspec) = NULL; } #line 30055 "gram_minimal.c" /* yacc.c:1646 */ break; case 539: #line 3931 "gram_minimal.y" /* yacc.c:1646 */ { PartitionSpec *n = makeNode(PartitionSpec); n->strategy = (yyvsp[-3].str); n->partParams = (yyvsp[-1].list); n->location = (yylsp[-5]); (yyval.partspec) = n; } #line 30069 "gram_minimal.c" /* yacc.c:1646 */ break; case 540: #line 3942 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 30075 "gram_minimal.c" /* yacc.c:1646 */ break; case 541: #line 3943 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = pstrdup((yyvsp[0].keyword)); } #line 30081 "gram_minimal.c" /* yacc.c:1646 */ break; case 542: #line 3946 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].partelem)); } #line 30087 "gram_minimal.c" /* yacc.c:1646 */ break; case 543: #line 3947 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].partelem)); } #line 30093 "gram_minimal.c" /* yacc.c:1646 */ break; case 544: #line 3951 "gram_minimal.y" /* yacc.c:1646 */ { PartitionElem *n = makeNode(PartitionElem); n->name = (yyvsp[-2].str); n->expr = NULL; n->collation = (yyvsp[-1].list); n->opclass = (yyvsp[0].list); n->location = (yylsp[-2]); (yyval.partelem) = n; } #line 30108 "gram_minimal.c" /* yacc.c:1646 */ break; case 545: #line 3962 "gram_minimal.y" /* yacc.c:1646 */ { PartitionElem *n = makeNode(PartitionElem); n->name = NULL; n->expr = (yyvsp[-2].node); n->collation = (yyvsp[-1].list); n->opclass = (yyvsp[0].list); n->location = (yylsp[-2]); (yyval.partelem) = n; } #line 30123 "gram_minimal.c" /* yacc.c:1646 */ break; case 546: #line 3973 "gram_minimal.y" /* yacc.c:1646 */ { PartitionElem *n = makeNode(PartitionElem); n->name = NULL; n->expr = (yyvsp[-3].node); n->collation = (yyvsp[-1].list); n->opclass = (yyvsp[0].list); n->location = (yylsp[-4]); (yyval.partelem) = n; } #line 30138 "gram_minimal.c" /* yacc.c:1646 */ break; case 547: #line 3986 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 30144 "gram_minimal.c" /* yacc.c:1646 */ break; case 548: #line 3987 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = NULL; } #line 30150 "gram_minimal.c" /* yacc.c:1646 */ break; case 549: #line 3992 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 30156 "gram_minimal.c" /* yacc.c:1646 */ break; case 550: #line 3993 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 30162 "gram_minimal.c" /* yacc.c:1646 */ break; case 551: #line 3994 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 30168 "gram_minimal.c" /* yacc.c:1646 */ break; case 552: #line 3997 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.oncommit) = ONCOMMIT_DROP; } #line 30174 "gram_minimal.c" /* yacc.c:1646 */ break; case 553: #line 3998 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.oncommit) = ONCOMMIT_DELETE_ROWS; } #line 30180 "gram_minimal.c" /* yacc.c:1646 */ break; case 554: #line 3999 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.oncommit) = ONCOMMIT_PRESERVE_ROWS; } #line 30186 "gram_minimal.c" /* yacc.c:1646 */ break; case 555: #line 4000 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.oncommit) = ONCOMMIT_NOOP; } #line 30192 "gram_minimal.c" /* yacc.c:1646 */ break; case 556: #line 4003 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 30198 "gram_minimal.c" /* yacc.c:1646 */ break; case 557: #line 4004 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = NULL; } #line 30204 "gram_minimal.c" /* yacc.c:1646 */ break; case 558: #line 4007 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 30210 "gram_minimal.c" /* yacc.c:1646 */ break; case 559: #line 4008 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = NULL; } #line 30216 "gram_minimal.c" /* yacc.c:1646 */ break; case 560: #line 4011 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 30222 "gram_minimal.c" /* yacc.c:1646 */ break; case 561: #line 4031 "gram_minimal.y" /* yacc.c:1646 */ { CreateStatsStmt *n = makeNode(CreateStatsStmt); n->defnames = (yyvsp[-5].list); n->stat_types = (yyvsp[-4].list); n->exprs = (yyvsp[-2].list); n->relations = (yyvsp[0].list); n->stxcomment = NULL; n->if_not_exists = false; (yyval.node) = (Node *)n; } #line 30237 "gram_minimal.c" /* yacc.c:1646 */ break; case 562: #line 4043 "gram_minimal.y" /* yacc.c:1646 */ { CreateStatsStmt *n = makeNode(CreateStatsStmt); n->defnames = (yyvsp[-5].list); n->stat_types = (yyvsp[-4].list); n->exprs = (yyvsp[-2].list); n->relations = (yyvsp[0].list); n->stxcomment = NULL; n->if_not_exists = true; (yyval.node) = (Node *)n; } #line 30252 "gram_minimal.c" /* yacc.c:1646 */ break; case 563: #line 4067 "gram_minimal.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; ctas->if_not_exists = 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 30269 "gram_minimal.c" /* yacc.c:1646 */ break; case 564: #line 4080 "gram_minimal.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; ctas->if_not_exists = true; /* cram additional flags into the IntoClause */ (yyvsp[-3].into)->rel->relpersistence = (yyvsp[-8].ival); (yyvsp[-3].into)->skipData = !((yyvsp[0].boolean)); (yyval.node) = (Node *) ctas; } #line 30286 "gram_minimal.c" /* yacc.c:1646 */ break; case 565: #line 4097 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.into) = makeNode(IntoClause); (yyval.into)->rel = (yyvsp[-5].range); (yyval.into)->colNames = (yyvsp[-4].list); (yyval.into)->accessMethod = (yyvsp[-3].str); (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 30302 "gram_minimal.c" /* yacc.c:1646 */ break; case 566: #line 4111 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.boolean) = true; } #line 30308 "gram_minimal.c" /* yacc.c:1646 */ break; case 567: #line 4112 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.boolean) = false; } #line 30314 "gram_minimal.c" /* yacc.c:1646 */ break; case 568: #line 4113 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.boolean) = true; } #line 30320 "gram_minimal.c" /* yacc.c:1646 */ break; case 569: #line 4126 "gram_minimal.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; ctas->if_not_exists = 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 30337 "gram_minimal.c" /* yacc.c:1646 */ break; case 570: #line 4139 "gram_minimal.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; ctas->if_not_exists = true; /* cram additional flags into the IntoClause */ (yyvsp[-3].into)->rel->relpersistence = (yyvsp[-9].ival); (yyvsp[-3].into)->skipData = !((yyvsp[0].boolean)); (yyval.node) = (Node *) ctas; } #line 30354 "gram_minimal.c" /* yacc.c:1646 */ break; case 571: #line 4155 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.into) = makeNode(IntoClause); (yyval.into)->rel = (yyvsp[-4].range); (yyval.into)->colNames = (yyvsp[-3].list); (yyval.into)->accessMethod = (yyvsp[-2].str); (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 30370 "gram_minimal.c" /* yacc.c:1646 */ break; case 572: #line 4168 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = RELPERSISTENCE_UNLOGGED; } #line 30376 "gram_minimal.c" /* yacc.c:1646 */ break; case 573: #line 4169 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = RELPERSISTENCE_PERMANENT; } #line 30382 "gram_minimal.c" /* yacc.c:1646 */ break; case 574: #line 4182 "gram_minimal.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 30394 "gram_minimal.c" /* yacc.c:1646 */ break; case 575: #line 4202 "gram_minimal.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; n->if_not_exists = false; (yyval.node) = (Node *)n; } #line 30408 "gram_minimal.c" /* yacc.c:1646 */ break; case 576: #line 4212 "gram_minimal.y" /* yacc.c:1646 */ { CreateSeqStmt *n = makeNode(CreateSeqStmt); (yyvsp[-1].range)->relpersistence = (yyvsp[-6].ival); n->sequence = (yyvsp[-1].range); n->options = (yyvsp[0].list); n->ownerId = InvalidOid; n->if_not_exists = true; (yyval.node) = (Node *)n; } #line 30422 "gram_minimal.c" /* yacc.c:1646 */ break; case 577: #line 4225 "gram_minimal.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 30434 "gram_minimal.c" /* yacc.c:1646 */ break; case 578: #line 4233 "gram_minimal.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 30446 "gram_minimal.c" /* yacc.c:1646 */ break; case 579: #line 4243 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 30452 "gram_minimal.c" /* yacc.c:1646 */ break; case 580: #line 4244 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 30458 "gram_minimal.c" /* yacc.c:1646 */ break; case 581: #line 4247 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[-1].list); } #line 30464 "gram_minimal.c" /* yacc.c:1646 */ break; case 582: #line 4248 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 30470 "gram_minimal.c" /* yacc.c:1646 */ break; case 583: #line 4251 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].defelt)); } #line 30476 "gram_minimal.c" /* yacc.c:1646 */ break; case 584: #line 4252 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-1].list), (yyvsp[0].defelt)); } #line 30482 "gram_minimal.c" /* yacc.c:1646 */ break; case 585: #line 4256 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("as", (Node *)(yyvsp[0].typnam), (yylsp[-1])); } #line 30490 "gram_minimal.c" /* yacc.c:1646 */ break; case 586: #line 4260 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("cache", (Node *)(yyvsp[0].value), (yylsp[-1])); } #line 30498 "gram_minimal.c" /* yacc.c:1646 */ break; case 587: #line 4264 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("cycle", (Node *)makeInteger(true), (yylsp[0])); } #line 30506 "gram_minimal.c" /* yacc.c:1646 */ break; case 588: #line 4268 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("cycle", (Node *)makeInteger(false), (yylsp[-1])); } #line 30514 "gram_minimal.c" /* yacc.c:1646 */ break; case 589: #line 4272 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("increment", (Node *)(yyvsp[0].value), (yylsp[-2])); } #line 30522 "gram_minimal.c" /* yacc.c:1646 */ break; case 590: #line 4276 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("maxvalue", (Node *)(yyvsp[0].value), (yylsp[-1])); } #line 30530 "gram_minimal.c" /* yacc.c:1646 */ break; case 591: #line 4280 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("minvalue", (Node *)(yyvsp[0].value), (yylsp[-1])); } #line 30538 "gram_minimal.c" /* yacc.c:1646 */ break; case 592: #line 4284 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("maxvalue", NULL, (yylsp[-1])); } #line 30546 "gram_minimal.c" /* yacc.c:1646 */ break; case 593: #line 4288 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("minvalue", NULL, (yylsp[-1])); } #line 30554 "gram_minimal.c" /* yacc.c:1646 */ break; case 594: #line 4292 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("owned_by", (Node *)(yyvsp[0].list), (yylsp[-2])); } #line 30562 "gram_minimal.c" /* yacc.c:1646 */ break; case 595: #line 4296 "gram_minimal.y" /* yacc.c:1646 */ { /* not documented, only used by pg_dump */ (yyval.defelt) = makeDefElem("sequence_name", (Node *)(yyvsp[0].list), (yylsp[-2])); } #line 30571 "gram_minimal.c" /* yacc.c:1646 */ break; case 596: #line 4301 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("start", (Node *)(yyvsp[0].value), (yylsp[-2])); } #line 30579 "gram_minimal.c" /* yacc.c:1646 */ break; case 597: #line 4305 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("restart", NULL, (yylsp[0])); } #line 30587 "gram_minimal.c" /* yacc.c:1646 */ break; case 598: #line 4309 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("restart", (Node *)(yyvsp[0].value), (yylsp[-2])); } #line 30595 "gram_minimal.c" /* yacc.c:1646 */ break; case 599: #line 4314 "gram_minimal.y" /* yacc.c:1646 */ {} #line 30601 "gram_minimal.c" /* yacc.c:1646 */ break; case 600: #line 4315 "gram_minimal.y" /* yacc.c:1646 */ {} #line 30607 "gram_minimal.c" /* yacc.c:1646 */ break; case 601: #line 4319 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.value) = makeFloat((yyvsp[0].str)); } #line 30613 "gram_minimal.c" /* yacc.c:1646 */ break; case 602: #line 4320 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.value) = makeFloat((yyvsp[0].str)); } #line 30619 "gram_minimal.c" /* yacc.c:1646 */ break; case 603: #line 4322 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.value) = makeFloat((yyvsp[0].str)); doNegateFloat((yyval.value)); } #line 30628 "gram_minimal.c" /* yacc.c:1646 */ break; case 604: #line 4326 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.value) = makeInteger((yyvsp[0].ival)); } #line 30634 "gram_minimal.c" /* yacc.c:1646 */ break; case 605: #line 4329 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].value)); } #line 30640 "gram_minimal.c" /* yacc.c:1646 */ break; case 606: #line 4330 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].value)); } #line 30646 "gram_minimal.c" /* yacc.c:1646 */ break; case 607: #line 4343 "gram_minimal.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 30662 "gram_minimal.c" /* yacc.c:1646 */ break; case 608: #line 4356 "gram_minimal.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 30677 "gram_minimal.c" /* yacc.c:1646 */ break; case 609: #line 4369 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.boolean) = true; } #line 30683 "gram_minimal.c" /* yacc.c:1646 */ break; case 610: #line 4370 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.boolean) = false; } #line 30689 "gram_minimal.c" /* yacc.c:1646 */ break; case 611: #line 4378 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1(makeString((yyvsp[0].str))); } #line 30695 "gram_minimal.c" /* yacc.c:1646 */ break; case 612: #line 4379 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = lcons(makeString((yyvsp[-1].str)), (yyvsp[0].list)); } #line 30701 "gram_minimal.c" /* yacc.c:1646 */ break; case 613: #line 4383 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 30707 "gram_minimal.c" /* yacc.c:1646 */ break; case 614: #line 4384 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 30713 "gram_minimal.c" /* yacc.c:1646 */ break; case 615: #line 4388 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 30719 "gram_minimal.c" /* yacc.c:1646 */ break; case 616: #line 4389 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 30725 "gram_minimal.c" /* yacc.c:1646 */ break; case 617: #line 4393 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 30731 "gram_minimal.c" /* yacc.c:1646 */ break; case 618: #line 4394 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 30737 "gram_minimal.c" /* yacc.c:1646 */ break; case 619: #line 4399 "gram_minimal.y" /* yacc.c:1646 */ { DropStmt *n = makeNode(DropStmt); n->removeType = OBJECT_LANGUAGE; n->objects = list_make1(makeString((yyvsp[-1].str))); n->behavior = (yyvsp[0].dbehavior); n->missing_ok = false; n->concurrent = false; (yyval.node) = (Node *)n; } #line 30751 "gram_minimal.c" /* yacc.c:1646 */ break; case 620: #line 4409 "gram_minimal.y" /* yacc.c:1646 */ { DropStmt *n = makeNode(DropStmt); n->removeType = OBJECT_LANGUAGE; n->objects = list_make1(makeString((yyvsp[-1].str))); n->behavior = (yyvsp[0].dbehavior); n->missing_ok = true; n->concurrent = false; (yyval.node) = (Node *)n; } #line 30765 "gram_minimal.c" /* yacc.c:1646 */ break; case 621: #line 4421 "gram_minimal.y" /* yacc.c:1646 */ {} #line 30771 "gram_minimal.c" /* yacc.c:1646 */ break; case 622: #line 4422 "gram_minimal.y" /* yacc.c:1646 */ {} #line 30777 "gram_minimal.c" /* yacc.c:1646 */ break; case 623: #line 4433 "gram_minimal.y" /* yacc.c:1646 */ { CreateTableSpaceStmt *n = makeNode(CreateTableSpaceStmt); n->tablespacename = (yyvsp[-4].str); n->owner = (yyvsp[-3].rolespec); n->location = (yyvsp[-1].str); n->options = (yyvsp[0].list); (yyval.node) = (Node *) n; } #line 30790 "gram_minimal.c" /* yacc.c:1646 */ break; case 624: #line 4443 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.rolespec) = (yyvsp[0].rolespec); } #line 30796 "gram_minimal.c" /* yacc.c:1646 */ break; case 625: #line 4444 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.rolespec) = NULL; } #line 30802 "gram_minimal.c" /* yacc.c:1646 */ break; case 626: #line 4458 "gram_minimal.y" /* yacc.c:1646 */ { DropTableSpaceStmt *n = makeNode(DropTableSpaceStmt); n->tablespacename = (yyvsp[0].str); n->missing_ok = false; (yyval.node) = (Node *) n; } #line 30813 "gram_minimal.c" /* yacc.c:1646 */ break; case 627: #line 4465 "gram_minimal.y" /* yacc.c:1646 */ { DropTableSpaceStmt *n = makeNode(DropTableSpaceStmt); n->tablespacename = (yyvsp[0].str); n->missing_ok = true; (yyval.node) = (Node *) n; } #line 30824 "gram_minimal.c" /* yacc.c:1646 */ break; case 628: #line 4482 "gram_minimal.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 30836 "gram_minimal.c" /* yacc.c:1646 */ break; case 629: #line 4490 "gram_minimal.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 30848 "gram_minimal.c" /* yacc.c:1646 */ break; case 630: #line 4501 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-1].list), (yyvsp[0].defelt)); } #line 30854 "gram_minimal.c" /* yacc.c:1646 */ break; case 631: #line 4503 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 30860 "gram_minimal.c" /* yacc.c:1646 */ break; case 632: #line 4508 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("schema", (Node *)makeString((yyvsp[0].str)), (yylsp[-1])); } #line 30868 "gram_minimal.c" /* yacc.c:1646 */ break; case 633: #line 4512 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("new_version", (Node *)makeString((yyvsp[0].str)), (yylsp[-1])); } #line 30876 "gram_minimal.c" /* yacc.c:1646 */ break; case 634: #line 4516 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("old_version", (Node *)makeString((yyvsp[0].str)), (yylsp[-1])); } #line 30884 "gram_minimal.c" /* yacc.c:1646 */ break; case 635: #line 4520 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("cascade", (Node *)makeInteger(true), (yylsp[0])); } #line 30892 "gram_minimal.c" /* yacc.c:1646 */ break; case 636: #line 4532 "gram_minimal.y" /* yacc.c:1646 */ { AlterExtensionStmt *n = makeNode(AlterExtensionStmt); n->extname = (yyvsp[-2].str); n->options = (yyvsp[0].list); (yyval.node) = (Node *) n; } #line 30903 "gram_minimal.c" /* yacc.c:1646 */ break; case 637: #line 4542 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-1].list), (yyvsp[0].defelt)); } #line 30909 "gram_minimal.c" /* yacc.c:1646 */ break; case 638: #line 4544 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 30915 "gram_minimal.c" /* yacc.c:1646 */ break; case 639: #line 4549 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("new_version", (Node *)makeString((yyvsp[0].str)), (yylsp[-1])); } #line 30923 "gram_minimal.c" /* yacc.c:1646 */ break; case 640: #line 4562 "gram_minimal.y" /* yacc.c:1646 */ { AlterExtensionContentsStmt *n = makeNode(AlterExtensionContentsStmt); n->extname = (yyvsp[-4].str); n->action = (yyvsp[-3].ival); n->objtype = OBJECT_ACCESS_METHOD; n->object = (Node *) makeString((yyvsp[0].str)); (yyval.node) = (Node *)n; } #line 30936 "gram_minimal.c" /* yacc.c:1646 */ break; case 641: #line 4571 "gram_minimal.y" /* yacc.c:1646 */ { AlterExtensionContentsStmt *n = makeNode(AlterExtensionContentsStmt); n->extname = (yyvsp[-3].str); n->action = (yyvsp[-2].ival); n->objtype = OBJECT_AGGREGATE; n->object = (Node *) (yyvsp[0].objwithargs); (yyval.node) = (Node *)n; } #line 30949 "gram_minimal.c" /* yacc.c:1646 */ break; case 642: #line 4580 "gram_minimal.y" /* yacc.c:1646 */ { AlterExtensionContentsStmt *n = makeNode(AlterExtensionContentsStmt); n->extname = (yyvsp[-7].str); n->action = (yyvsp[-6].ival); n->objtype = OBJECT_CAST; n->object = (Node *) list_make2((yyvsp[-3].typnam), (yyvsp[-1].typnam)); (yyval.node) = (Node *) n; } #line 30962 "gram_minimal.c" /* yacc.c:1646 */ break; case 643: #line 4589 "gram_minimal.y" /* yacc.c:1646 */ { AlterExtensionContentsStmt *n = makeNode(AlterExtensionContentsStmt); n->extname = (yyvsp[-3].str); n->action = (yyvsp[-2].ival); n->objtype = OBJECT_COLLATION; n->object = (Node *) (yyvsp[0].list); (yyval.node) = (Node *)n; } #line 30975 "gram_minimal.c" /* yacc.c:1646 */ break; case 644: #line 4598 "gram_minimal.y" /* yacc.c:1646 */ { AlterExtensionContentsStmt *n = makeNode(AlterExtensionContentsStmt); n->extname = (yyvsp[-3].str); n->action = (yyvsp[-2].ival); n->objtype = OBJECT_CONVERSION; n->object = (Node *) (yyvsp[0].list); (yyval.node) = (Node *)n; } #line 30988 "gram_minimal.c" /* yacc.c:1646 */ break; case 645: #line 4607 "gram_minimal.y" /* yacc.c:1646 */ { AlterExtensionContentsStmt *n = makeNode(AlterExtensionContentsStmt); n->extname = (yyvsp[-3].str); n->action = (yyvsp[-2].ival); n->objtype = OBJECT_DOMAIN; n->object = (Node *) (yyvsp[0].typnam); (yyval.node) = (Node *)n; } #line 31001 "gram_minimal.c" /* yacc.c:1646 */ break; case 646: #line 4616 "gram_minimal.y" /* yacc.c:1646 */ { AlterExtensionContentsStmt *n = makeNode(AlterExtensionContentsStmt); n->extname = (yyvsp[-3].str); n->action = (yyvsp[-2].ival); n->objtype = OBJECT_FUNCTION; n->object = (Node *) (yyvsp[0].objwithargs); (yyval.node) = (Node *)n; } #line 31014 "gram_minimal.c" /* yacc.c:1646 */ break; case 647: #line 4625 "gram_minimal.y" /* yacc.c:1646 */ { AlterExtensionContentsStmt *n = makeNode(AlterExtensionContentsStmt); n->extname = (yyvsp[-4].str); n->action = (yyvsp[-3].ival); n->objtype = OBJECT_LANGUAGE; n->object = (Node *) makeString((yyvsp[0].str)); (yyval.node) = (Node *)n; } #line 31027 "gram_minimal.c" /* yacc.c:1646 */ break; case 648: #line 4634 "gram_minimal.y" /* yacc.c:1646 */ { AlterExtensionContentsStmt *n = makeNode(AlterExtensionContentsStmt); n->extname = (yyvsp[-3].str); n->action = (yyvsp[-2].ival); n->objtype = OBJECT_OPERATOR; n->object = (Node *) (yyvsp[0].objwithargs); (yyval.node) = (Node *)n; } #line 31040 "gram_minimal.c" /* yacc.c:1646 */ break; case 649: #line 4643 "gram_minimal.y" /* yacc.c:1646 */ { AlterExtensionContentsStmt *n = makeNode(AlterExtensionContentsStmt); n->extname = (yyvsp[-6].str); n->action = (yyvsp[-5].ival); n->objtype = OBJECT_OPCLASS; n->object = (Node *) lcons(makeString((yyvsp[0].str)), (yyvsp[-2].list)); (yyval.node) = (Node *)n; } #line 31053 "gram_minimal.c" /* yacc.c:1646 */ break; case 650: #line 4652 "gram_minimal.y" /* yacc.c:1646 */ { AlterExtensionContentsStmt *n = makeNode(AlterExtensionContentsStmt); n->extname = (yyvsp[-6].str); n->action = (yyvsp[-5].ival); n->objtype = OBJECT_OPFAMILY; n->object = (Node *) lcons(makeString((yyvsp[0].str)), (yyvsp[-2].list)); (yyval.node) = (Node *)n; } #line 31066 "gram_minimal.c" /* yacc.c:1646 */ break; case 651: #line 4661 "gram_minimal.y" /* yacc.c:1646 */ { AlterExtensionContentsStmt *n = makeNode(AlterExtensionContentsStmt); n->extname = (yyvsp[-3].str); n->action = (yyvsp[-2].ival); n->objtype = OBJECT_PROCEDURE; n->object = (Node *) (yyvsp[0].objwithargs); (yyval.node) = (Node *)n; } #line 31079 "gram_minimal.c" /* yacc.c:1646 */ break; case 652: #line 4670 "gram_minimal.y" /* yacc.c:1646 */ { AlterExtensionContentsStmt *n = makeNode(AlterExtensionContentsStmt); n->extname = (yyvsp[-3].str); n->action = (yyvsp[-2].ival); n->objtype = OBJECT_ROUTINE; n->object = (Node *) (yyvsp[0].objwithargs); (yyval.node) = (Node *)n; } #line 31092 "gram_minimal.c" /* yacc.c:1646 */ break; case 653: #line 4679 "gram_minimal.y" /* yacc.c:1646 */ { AlterExtensionContentsStmt *n = makeNode(AlterExtensionContentsStmt); n->extname = (yyvsp[-3].str); n->action = (yyvsp[-2].ival); n->objtype = OBJECT_SCHEMA; n->object = (Node *) makeString((yyvsp[0].str)); (yyval.node) = (Node *)n; } #line 31105 "gram_minimal.c" /* yacc.c:1646 */ break; case 654: #line 4688 "gram_minimal.y" /* yacc.c:1646 */ { AlterExtensionContentsStmt *n = makeNode(AlterExtensionContentsStmt); n->extname = (yyvsp[-4].str); n->action = (yyvsp[-3].ival); n->objtype = OBJECT_EVENT_TRIGGER; n->object = (Node *) makeString((yyvsp[0].str)); (yyval.node) = (Node *)n; } #line 31118 "gram_minimal.c" /* yacc.c:1646 */ break; case 655: #line 4697 "gram_minimal.y" /* yacc.c:1646 */ { AlterExtensionContentsStmt *n = makeNode(AlterExtensionContentsStmt); n->extname = (yyvsp[-3].str); n->action = (yyvsp[-2].ival); n->objtype = OBJECT_TABLE; n->object = (Node *) (yyvsp[0].list); (yyval.node) = (Node *)n; } #line 31131 "gram_minimal.c" /* yacc.c:1646 */ break; case 656: #line 4706 "gram_minimal.y" /* yacc.c:1646 */ { AlterExtensionContentsStmt *n = makeNode(AlterExtensionContentsStmt); n->extname = (yyvsp[-5].str); n->action = (yyvsp[-4].ival); n->objtype = OBJECT_TSPARSER; n->object = (Node *) (yyvsp[0].list); (yyval.node) = (Node *)n; } #line 31144 "gram_minimal.c" /* yacc.c:1646 */ break; case 657: #line 4715 "gram_minimal.y" /* yacc.c:1646 */ { AlterExtensionContentsStmt *n = makeNode(AlterExtensionContentsStmt); n->extname = (yyvsp[-5].str); n->action = (yyvsp[-4].ival); n->objtype = OBJECT_TSDICTIONARY; n->object = (Node *) (yyvsp[0].list); (yyval.node) = (Node *)n; } #line 31157 "gram_minimal.c" /* yacc.c:1646 */ break; case 658: #line 4724 "gram_minimal.y" /* yacc.c:1646 */ { AlterExtensionContentsStmt *n = makeNode(AlterExtensionContentsStmt); n->extname = (yyvsp[-5].str); n->action = (yyvsp[-4].ival); n->objtype = OBJECT_TSTEMPLATE; n->object = (Node *) (yyvsp[0].list); (yyval.node) = (Node *)n; } #line 31170 "gram_minimal.c" /* yacc.c:1646 */ break; case 659: #line 4733 "gram_minimal.y" /* yacc.c:1646 */ { AlterExtensionContentsStmt *n = makeNode(AlterExtensionContentsStmt); n->extname = (yyvsp[-5].str); n->action = (yyvsp[-4].ival); n->objtype = OBJECT_TSCONFIGURATION; n->object = (Node *) (yyvsp[0].list); (yyval.node) = (Node *)n; } #line 31183 "gram_minimal.c" /* yacc.c:1646 */ break; case 660: #line 4742 "gram_minimal.y" /* yacc.c:1646 */ { AlterExtensionContentsStmt *n = makeNode(AlterExtensionContentsStmt); n->extname = (yyvsp[-3].str); n->action = (yyvsp[-2].ival); n->objtype = OBJECT_SEQUENCE; n->object = (Node *) (yyvsp[0].list); (yyval.node) = (Node *)n; } #line 31196 "gram_minimal.c" /* yacc.c:1646 */ break; case 661: #line 4751 "gram_minimal.y" /* yacc.c:1646 */ { AlterExtensionContentsStmt *n = makeNode(AlterExtensionContentsStmt); n->extname = (yyvsp[-3].str); n->action = (yyvsp[-2].ival); n->objtype = OBJECT_VIEW; n->object = (Node *) (yyvsp[0].list); (yyval.node) = (Node *)n; } #line 31209 "gram_minimal.c" /* yacc.c:1646 */ break; case 662: #line 4760 "gram_minimal.y" /* yacc.c:1646 */ { AlterExtensionContentsStmt *n = makeNode(AlterExtensionContentsStmt); n->extname = (yyvsp[-4].str); n->action = (yyvsp[-3].ival); n->objtype = OBJECT_MATVIEW; n->object = (Node *) (yyvsp[0].list); (yyval.node) = (Node *)n; } #line 31222 "gram_minimal.c" /* yacc.c:1646 */ break; case 663: #line 4769 "gram_minimal.y" /* yacc.c:1646 */ { AlterExtensionContentsStmt *n = makeNode(AlterExtensionContentsStmt); n->extname = (yyvsp[-4].str); n->action = (yyvsp[-3].ival); n->objtype = OBJECT_FOREIGN_TABLE; n->object = (Node *) (yyvsp[0].list); (yyval.node) = (Node *)n; } #line 31235 "gram_minimal.c" /* yacc.c:1646 */ break; case 664: #line 4778 "gram_minimal.y" /* yacc.c:1646 */ { AlterExtensionContentsStmt *n = makeNode(AlterExtensionContentsStmt); n->extname = (yyvsp[-5].str); n->action = (yyvsp[-4].ival); n->objtype = OBJECT_FDW; n->object = (Node *) makeString((yyvsp[0].str)); (yyval.node) = (Node *)n; } #line 31248 "gram_minimal.c" /* yacc.c:1646 */ break; case 665: #line 4787 "gram_minimal.y" /* yacc.c:1646 */ { AlterExtensionContentsStmt *n = makeNode(AlterExtensionContentsStmt); n->extname = (yyvsp[-3].str); n->action = (yyvsp[-2].ival); n->objtype = OBJECT_FOREIGN_SERVER; n->object = (Node *) makeString((yyvsp[0].str)); (yyval.node) = (Node *)n; } #line 31261 "gram_minimal.c" /* yacc.c:1646 */ break; case 666: #line 4796 "gram_minimal.y" /* yacc.c:1646 */ { AlterExtensionContentsStmt *n = makeNode(AlterExtensionContentsStmt); n->extname = (yyvsp[-6].str); n->action = (yyvsp[-5].ival); n->objtype = OBJECT_TRANSFORM; n->object = (Node *) list_make2((yyvsp[-2].typnam), makeString((yyvsp[0].str))); (yyval.node) = (Node *)n; } #line 31274 "gram_minimal.c" /* yacc.c:1646 */ break; case 667: #line 4805 "gram_minimal.y" /* yacc.c:1646 */ { AlterExtensionContentsStmt *n = makeNode(AlterExtensionContentsStmt); n->extname = (yyvsp[-3].str); n->action = (yyvsp[-2].ival); n->objtype = OBJECT_TYPE; n->object = (Node *) (yyvsp[0].typnam); (yyval.node) = (Node *)n; } #line 31287 "gram_minimal.c" /* yacc.c:1646 */ break; case 668: #line 4823 "gram_minimal.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 31299 "gram_minimal.c" /* yacc.c:1646 */ break; case 669: #line 4833 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("handler", (Node *)(yyvsp[0].list), (yylsp[-1])); } #line 31305 "gram_minimal.c" /* yacc.c:1646 */ break; case 670: #line 4834 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("handler", NULL, (yylsp[-1])); } #line 31311 "gram_minimal.c" /* yacc.c:1646 */ break; case 671: #line 4835 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("validator", (Node *)(yyvsp[0].list), (yylsp[-1])); } #line 31317 "gram_minimal.c" /* yacc.c:1646 */ break; case 672: #line 4836 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("validator", NULL, (yylsp[-1])); } #line 31323 "gram_minimal.c" /* yacc.c:1646 */ break; case 673: #line 4840 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].defelt)); } #line 31329 "gram_minimal.c" /* yacc.c:1646 */ break; case 674: #line 4841 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-1].list), (yyvsp[0].defelt)); } #line 31335 "gram_minimal.c" /* yacc.c:1646 */ break; case 675: #line 4845 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 31341 "gram_minimal.c" /* yacc.c:1646 */ break; case 676: #line 4846 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 31347 "gram_minimal.c" /* yacc.c:1646 */ break; case 677: #line 4857 "gram_minimal.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 31359 "gram_minimal.c" /* yacc.c:1646 */ break; case 678: #line 4865 "gram_minimal.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 31371 "gram_minimal.c" /* yacc.c:1646 */ break; case 679: #line 4876 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[-1].list); } #line 31377 "gram_minimal.c" /* yacc.c:1646 */ break; case 680: #line 4877 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 31383 "gram_minimal.c" /* yacc.c:1646 */ break; case 681: #line 4882 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].defelt)); } #line 31391 "gram_minimal.c" /* yacc.c:1646 */ break; case 682: #line 4886 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].defelt)); } #line 31399 "gram_minimal.c" /* yacc.c:1646 */ break; case 683: #line 4893 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[-1].list); } #line 31405 "gram_minimal.c" /* yacc.c:1646 */ break; case 684: #line 4898 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].defelt)); } #line 31413 "gram_minimal.c" /* yacc.c:1646 */ break; case 685: #line 4902 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].defelt)); } #line 31421 "gram_minimal.c" /* yacc.c:1646 */ break; case 686: #line 4909 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = (yyvsp[0].defelt); } #line 31429 "gram_minimal.c" /* yacc.c:1646 */ break; case 687: #line 4913 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = (yyvsp[0].defelt); (yyval.defelt)->defaction = DEFELEM_SET; } #line 31438 "gram_minimal.c" /* yacc.c:1646 */ break; case 688: #line 4918 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = (yyvsp[0].defelt); (yyval.defelt)->defaction = DEFELEM_ADD; } #line 31447 "gram_minimal.c" /* yacc.c:1646 */ break; case 689: #line 4923 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElemExtended(NULL, (yyvsp[0].str), NULL, DEFELEM_DROP, (yylsp[0])); } #line 31455 "gram_minimal.c" /* yacc.c:1646 */ break; case 690: #line 4930 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem((yyvsp[-1].str), (yyvsp[0].node), (yylsp[-1])); } #line 31463 "gram_minimal.c" /* yacc.c:1646 */ break; case 691: #line 4936 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 31469 "gram_minimal.c" /* yacc.c:1646 */ break; case 692: #line 4941 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeString((yyvsp[0].str)); } #line 31475 "gram_minimal.c" /* yacc.c:1646 */ break; case 693: #line 4953 "gram_minimal.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); n->if_not_exists = false; (yyval.node) = (Node *) n; } #line 31490 "gram_minimal.c" /* yacc.c:1646 */ break; case 694: #line 4965 "gram_minimal.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); n->if_not_exists = true; (yyval.node) = (Node *) n; } #line 31505 "gram_minimal.c" /* yacc.c:1646 */ break; case 695: #line 4978 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 31511 "gram_minimal.c" /* yacc.c:1646 */ break; case 696: #line 4979 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = NULL; } #line 31517 "gram_minimal.c" /* yacc.c:1646 */ break; case 697: #line 4984 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 31523 "gram_minimal.c" /* yacc.c:1646 */ break; case 698: #line 4985 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = NULL; } #line 31529 "gram_minimal.c" /* yacc.c:1646 */ break; case 699: #line 4989 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 31535 "gram_minimal.c" /* yacc.c:1646 */ break; case 700: #line 4990 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = NULL; } #line 31541 "gram_minimal.c" /* yacc.c:1646 */ break; case 701: #line 5001 "gram_minimal.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 31554 "gram_minimal.c" /* yacc.c:1646 */ break; case 702: #line 5010 "gram_minimal.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 31566 "gram_minimal.c" /* yacc.c:1646 */ break; case 703: #line 5018 "gram_minimal.y" /* yacc.c:1646 */ { AlterForeignServerStmt *n = makeNode(AlterForeignServerStmt); n->servername = (yyvsp[-1].str); n->options = (yyvsp[0].list); (yyval.node) = (Node *) n; } #line 31577 "gram_minimal.c" /* yacc.c:1646 */ break; case 704: #line 5037 "gram_minimal.y" /* yacc.c:1646 */ { CreateForeignTableStmt *n = makeNode(CreateForeignTableStmt); (yyvsp[-7].range)->relpersistence = RELPERSISTENCE_PERMANENT; n->base.relation = (yyvsp[-7].range); n->base.tableElts = (yyvsp[-5].list); n->base.inhRelations = (yyvsp[-3].list); n->base.ofTypename = NULL; n->base.constraints = NIL; n->base.options = NIL; n->base.oncommit = ONCOMMIT_NOOP; n->base.tablespacename = NULL; n->base.if_not_exists = false; /* FDW-specific data */ n->servername = (yyvsp[-1].str); n->options = (yyvsp[0].list); (yyval.node) = (Node *) n; } #line 31599 "gram_minimal.c" /* yacc.c:1646 */ break; case 705: #line 5057 "gram_minimal.y" /* yacc.c:1646 */ { CreateForeignTableStmt *n = makeNode(CreateForeignTableStmt); (yyvsp[-7].range)->relpersistence = RELPERSISTENCE_PERMANENT; n->base.relation = (yyvsp[-7].range); n->base.tableElts = (yyvsp[-5].list); n->base.inhRelations = (yyvsp[-3].list); n->base.ofTypename = NULL; n->base.constraints = NIL; n->base.options = NIL; n->base.oncommit = ONCOMMIT_NOOP; n->base.tablespacename = NULL; n->base.if_not_exists = true; /* FDW-specific data */ n->servername = (yyvsp[-1].str); n->options = (yyvsp[0].list); (yyval.node) = (Node *) n; } #line 31621 "gram_minimal.c" /* yacc.c:1646 */ break; case 706: #line 5077 "gram_minimal.y" /* yacc.c:1646 */ { CreateForeignTableStmt *n = makeNode(CreateForeignTableStmt); (yyvsp[-8].range)->relpersistence = RELPERSISTENCE_PERMANENT; n->base.relation = (yyvsp[-8].range); n->base.inhRelations = list_make1((yyvsp[-5].range)); n->base.tableElts = (yyvsp[-4].list); n->base.partbound = (yyvsp[-3].partboundspec); n->base.ofTypename = NULL; n->base.constraints = NIL; n->base.options = NIL; n->base.oncommit = ONCOMMIT_NOOP; n->base.tablespacename = NULL; n->base.if_not_exists = false; /* FDW-specific data */ n->servername = (yyvsp[-1].str); n->options = (yyvsp[0].list); (yyval.node) = (Node *) n; } #line 31644 "gram_minimal.c" /* yacc.c:1646 */ break; case 707: #line 5098 "gram_minimal.y" /* yacc.c:1646 */ { CreateForeignTableStmt *n = makeNode(CreateForeignTableStmt); (yyvsp[-8].range)->relpersistence = RELPERSISTENCE_PERMANENT; n->base.relation = (yyvsp[-8].range); n->base.inhRelations = list_make1((yyvsp[-5].range)); n->base.tableElts = (yyvsp[-4].list); n->base.partbound = (yyvsp[-3].partboundspec); n->base.ofTypename = NULL; n->base.constraints = NIL; n->base.options = NIL; n->base.oncommit = ONCOMMIT_NOOP; n->base.tablespacename = NULL; n->base.if_not_exists = true; /* FDW-specific data */ n->servername = (yyvsp[-1].str); n->options = (yyvsp[0].list); (yyval.node) = (Node *) n; } #line 31667 "gram_minimal.c" /* yacc.c:1646 */ break; case 708: #line 5127 "gram_minimal.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 31680 "gram_minimal.c" /* yacc.c:1646 */ break; case 709: #line 5136 "gram_minimal.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 31693 "gram_minimal.c" /* yacc.c:1646 */ break; case 710: #line 5158 "gram_minimal.y" /* yacc.c:1646 */ { ImportForeignSchemaStmt *n = makeNode(ImportForeignSchemaStmt); n->server_name = (yyvsp[-3].str); n->remote_schema = (yyvsp[-7].str); n->local_schema = (yyvsp[-1].str); n->list_type = (yyvsp[-6].importqual)->type; n->table_list = (yyvsp[-6].importqual)->table_names; n->options = (yyvsp[0].list); (yyval.node) = (Node *) n; } #line 31708 "gram_minimal.c" /* yacc.c:1646 */ break; case 711: #line 5171 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = FDW_IMPORT_SCHEMA_LIMIT_TO; } #line 31714 "gram_minimal.c" /* yacc.c:1646 */ break; case 712: #line 5172 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = FDW_IMPORT_SCHEMA_EXCEPT; } #line 31720 "gram_minimal.c" /* yacc.c:1646 */ break; case 713: #line 5177 "gram_minimal.y" /* yacc.c:1646 */ { ImportQual *n = (ImportQual *) palloc(sizeof(ImportQual)); n->type = (yyvsp[-3].ival); n->table_names = (yyvsp[-1].list); (yyval.importqual) = n; } #line 31731 "gram_minimal.c" /* yacc.c:1646 */ break; case 714: #line 5184 "gram_minimal.y" /* yacc.c:1646 */ { ImportQual *n = (ImportQual *) palloc(sizeof(ImportQual)); n->type = FDW_IMPORT_SCHEMA_ALL; n->table_names = NIL; (yyval.importqual) = n; } #line 31742 "gram_minimal.c" /* yacc.c:1646 */ break; case 715: #line 5200 "gram_minimal.y" /* yacc.c:1646 */ { CreateUserMappingStmt *n = makeNode(CreateUserMappingStmt); n->user = (yyvsp[-3].rolespec); n->servername = (yyvsp[-1].str); n->options = (yyvsp[0].list); n->if_not_exists = false; (yyval.node) = (Node *) n; } #line 31755 "gram_minimal.c" /* yacc.c:1646 */ break; case 716: #line 5209 "gram_minimal.y" /* yacc.c:1646 */ { CreateUserMappingStmt *n = makeNode(CreateUserMappingStmt); n->user = (yyvsp[-3].rolespec); n->servername = (yyvsp[-1].str); n->options = (yyvsp[0].list); n->if_not_exists = true; (yyval.node) = (Node *) n; } #line 31768 "gram_minimal.c" /* yacc.c:1646 */ break; case 717: #line 5220 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.rolespec) = (yyvsp[0].rolespec); } #line 31774 "gram_minimal.c" /* yacc.c:1646 */ break; case 718: #line 5221 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.rolespec) = makeRoleSpec(ROLESPEC_CURRENT_USER, (yylsp[0])); } #line 31780 "gram_minimal.c" /* yacc.c:1646 */ break; case 719: #line 5234 "gram_minimal.y" /* yacc.c:1646 */ { DropUserMappingStmt *n = makeNode(DropUserMappingStmt); n->user = (yyvsp[-2].rolespec); n->servername = (yyvsp[0].str); n->missing_ok = false; (yyval.node) = (Node *) n; } #line 31792 "gram_minimal.c" /* yacc.c:1646 */ break; case 720: #line 5242 "gram_minimal.y" /* yacc.c:1646 */ { DropUserMappingStmt *n = makeNode(DropUserMappingStmt); n->user = (yyvsp[-2].rolespec); n->servername = (yyvsp[0].str); n->missing_ok = true; (yyval.node) = (Node *) n; } #line 31804 "gram_minimal.c" /* yacc.c:1646 */ break; case 721: #line 5259 "gram_minimal.y" /* yacc.c:1646 */ { AlterUserMappingStmt *n = makeNode(AlterUserMappingStmt); n->user = (yyvsp[-3].rolespec); n->servername = (yyvsp[-1].str); n->options = (yyvsp[0].list); (yyval.node) = (Node *) n; } #line 31816 "gram_minimal.c" /* yacc.c:1646 */ break; case 722: #line 5285 "gram_minimal.y" /* yacc.c:1646 */ { CreatePolicyStmt *n = makeNode(CreatePolicyStmt); n->policy_name = (yyvsp[-7].str); n->table = (yyvsp[-5].range); n->permissive = (yyvsp[-4].boolean); n->cmd_name = (yyvsp[-3].str); n->roles = (yyvsp[-2].list); n->qual = (yyvsp[-1].node); n->with_check = (yyvsp[0].node); (yyval.node) = (Node *) n; } #line 31832 "gram_minimal.c" /* yacc.c:1646 */ break; case 723: #line 5301 "gram_minimal.y" /* yacc.c:1646 */ { AlterPolicyStmt *n = makeNode(AlterPolicyStmt); n->policy_name = (yyvsp[-5].str); n->table = (yyvsp[-3].range); n->roles = (yyvsp[-2].list); n->qual = (yyvsp[-1].node); n->with_check = (yyvsp[0].node); (yyval.node) = (Node *) n; } #line 31846 "gram_minimal.c" /* yacc.c:1646 */ break; case 724: #line 5313 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[-1].node); } #line 31852 "gram_minimal.c" /* yacc.c:1646 */ break; case 725: #line 5314 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = NULL; } #line 31858 "gram_minimal.c" /* yacc.c:1646 */ break; case 726: #line 5318 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[-1].node); } #line 31864 "gram_minimal.c" /* yacc.c:1646 */ break; case 727: #line 5319 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = NULL; } #line 31870 "gram_minimal.c" /* yacc.c:1646 */ break; case 728: #line 5323 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 31876 "gram_minimal.c" /* yacc.c:1646 */ break; case 729: #line 5324 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1(makeRoleSpec(ROLESPEC_PUBLIC, -1)); } #line 31882 "gram_minimal.c" /* yacc.c:1646 */ break; case 730: #line 5328 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 31888 "gram_minimal.c" /* yacc.c:1646 */ break; case 731: #line 5329 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = NULL; } #line 31894 "gram_minimal.c" /* yacc.c:1646 */ break; case 732: #line 5334 "gram_minimal.y" /* yacc.c:1646 */ { if (strcmp((yyvsp[0].str), "permissive") == 0) (yyval.boolean) = true; else if (strcmp((yyvsp[0].str), "restrictive") == 0) (yyval.boolean) = false; else ereport(ERROR, (errcode(ERRCODE_SYNTAX_ERROR), errmsg("unrecognized row security option \"%s\"", (yyvsp[0].str)), errhint("Only PERMISSIVE or RESTRICTIVE policies are supported currently."), parser_errposition((yylsp[0])))); } #line 31912 "gram_minimal.c" /* yacc.c:1646 */ break; case 733: #line 5347 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.boolean) = true; } #line 31918 "gram_minimal.c" /* yacc.c:1646 */ break; case 734: #line 5351 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 31924 "gram_minimal.c" /* yacc.c:1646 */ break; case 735: #line 5352 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = "all"; } #line 31930 "gram_minimal.c" /* yacc.c:1646 */ break; case 736: #line 5356 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = "all"; } #line 31936 "gram_minimal.c" /* yacc.c:1646 */ break; case 737: #line 5357 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = "select"; } #line 31942 "gram_minimal.c" /* yacc.c:1646 */ break; case 738: #line 5358 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = "insert"; } #line 31948 "gram_minimal.c" /* yacc.c:1646 */ break; case 739: #line 5359 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = "update"; } #line 31954 "gram_minimal.c" /* yacc.c:1646 */ break; case 740: #line 5360 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = "delete"; } #line 31960 "gram_minimal.c" /* yacc.c:1646 */ break; case 741: #line 5371 "gram_minimal.y" /* yacc.c:1646 */ { CreateAmStmt *n = makeNode(CreateAmStmt); n->amname = (yyvsp[-4].str); n->handler_name = (yyvsp[0].list); n->amtype = (yyvsp[-2].chr); (yyval.node) = (Node *) n; } #line 31972 "gram_minimal.c" /* yacc.c:1646 */ break; case 742: #line 5381 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.chr) = AMTYPE_INDEX; } #line 31978 "gram_minimal.c" /* yacc.c:1646 */ break; case 743: #line 5382 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.chr) = AMTYPE_TABLE; } #line 31984 "gram_minimal.c" /* yacc.c:1646 */ break; case 744: #line 5396 "gram_minimal.y" /* yacc.c:1646 */ { CreateTrigStmt *n = makeNode(CreateTrigStmt); n->trigname = (yyvsp[-13].str); n->relation = (yyvsp[-9].range); n->funcname = (yyvsp[-3].list); n->args = (yyvsp[-1].list); n->row = (yyvsp[-7].boolean); n->timing = (yyvsp[-12].ival); n->events = intVal(linitial((yyvsp[-11].list))); n->columns = (List *) lsecond((yyvsp[-11].list)); n->whenClause = (yyvsp[-6].node); n->transitionRels = (yyvsp[-8].list); n->isconstraint = false; n->deferrable = false; n->initdeferred = false; n->constrrel = NULL; (yyval.node) = (Node *)n; } #line 32007 "gram_minimal.c" /* yacc.c:1646 */ break; case 745: #line 5418 "gram_minimal.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->transitionRels = NIL; 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 32031 "gram_minimal.c" /* yacc.c:1646 */ break; case 746: #line 5440 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = TRIGGER_TYPE_BEFORE; } #line 32037 "gram_minimal.c" /* yacc.c:1646 */ break; case 747: #line 5441 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = TRIGGER_TYPE_AFTER; } #line 32043 "gram_minimal.c" /* yacc.c:1646 */ break; case 748: #line 5442 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = TRIGGER_TYPE_INSTEAD; } #line 32049 "gram_minimal.c" /* yacc.c:1646 */ break; case 749: #line 5447 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 32055 "gram_minimal.c" /* yacc.c:1646 */ break; case 750: #line 5449 "gram_minimal.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 32078 "gram_minimal.c" /* yacc.c:1646 */ break; case 751: #line 5471 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make2(makeInteger(TRIGGER_TYPE_INSERT), NIL); } #line 32084 "gram_minimal.c" /* yacc.c:1646 */ break; case 752: #line 5473 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make2(makeInteger(TRIGGER_TYPE_DELETE), NIL); } #line 32090 "gram_minimal.c" /* yacc.c:1646 */ break; case 753: #line 5475 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make2(makeInteger(TRIGGER_TYPE_UPDATE), NIL); } #line 32096 "gram_minimal.c" /* yacc.c:1646 */ break; case 754: #line 5477 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make2(makeInteger(TRIGGER_TYPE_UPDATE), (yyvsp[0].list)); } #line 32102 "gram_minimal.c" /* yacc.c:1646 */ break; case 755: #line 5479 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make2(makeInteger(TRIGGER_TYPE_TRUNCATE), NIL); } #line 32108 "gram_minimal.c" /* yacc.c:1646 */ break; case 756: #line 5483 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 32114 "gram_minimal.c" /* yacc.c:1646 */ break; case 757: #line 5484 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 32120 "gram_minimal.c" /* yacc.c:1646 */ break; case 758: #line 5488 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].node)); } #line 32126 "gram_minimal.c" /* yacc.c:1646 */ break; case 759: #line 5489 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-1].list), (yyvsp[0].node)); } #line 32132 "gram_minimal.c" /* yacc.c:1646 */ break; case 760: #line 5494 "gram_minimal.y" /* yacc.c:1646 */ { TriggerTransition *n = makeNode(TriggerTransition); n->name = (yyvsp[0].str); n->isNew = (yyvsp[-3].boolean); n->isTable = (yyvsp[-2].boolean); (yyval.node) = (Node *)n; } #line 32144 "gram_minimal.c" /* yacc.c:1646 */ break; case 761: #line 5504 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.boolean) = true; } #line 32150 "gram_minimal.c" /* yacc.c:1646 */ break; case 762: #line 5505 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.boolean) = false; } #line 32156 "gram_minimal.c" /* yacc.c:1646 */ break; case 763: #line 5509 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.boolean) = true; } #line 32162 "gram_minimal.c" /* yacc.c:1646 */ break; case 764: #line 5518 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.boolean) = false; } #line 32168 "gram_minimal.c" /* yacc.c:1646 */ break; case 765: #line 5522 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 32174 "gram_minimal.c" /* yacc.c:1646 */ break; case 766: #line 5527 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.boolean) = (yyvsp[0].boolean); } #line 32182 "gram_minimal.c" /* yacc.c:1646 */ break; case 767: #line 5531 "gram_minimal.y" /* yacc.c:1646 */ { /* * If ROW/STATEMENT not specified, default to * STATEMENT, per SQL */ (yyval.boolean) = false; } #line 32194 "gram_minimal.c" /* yacc.c:1646 */ break; case 768: #line 5541 "gram_minimal.y" /* yacc.c:1646 */ {} #line 32200 "gram_minimal.c" /* yacc.c:1646 */ break; case 769: #line 5542 "gram_minimal.y" /* yacc.c:1646 */ {} #line 32206 "gram_minimal.c" /* yacc.c:1646 */ break; case 770: #line 5546 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.boolean) = true; } #line 32212 "gram_minimal.c" /* yacc.c:1646 */ break; case 771: #line 5547 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.boolean) = false; } #line 32218 "gram_minimal.c" /* yacc.c:1646 */ break; case 772: #line 5551 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[-1].node); } #line 32224 "gram_minimal.c" /* yacc.c:1646 */ break; case 773: #line 5552 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = NULL; } #line 32230 "gram_minimal.c" /* yacc.c:1646 */ break; case 776: #line 5561 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].value)); } #line 32236 "gram_minimal.c" /* yacc.c:1646 */ break; case 777: #line 5562 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].value)); } #line 32242 "gram_minimal.c" /* yacc.c:1646 */ break; case 778: #line 5563 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 32248 "gram_minimal.c" /* yacc.c:1646 */ break; case 779: #line 5568 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.value) = makeString(psprintf("%d", (yyvsp[0].ival))); } #line 32256 "gram_minimal.c" /* yacc.c:1646 */ break; case 780: #line 5571 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.value) = makeString((yyvsp[0].str)); } #line 32262 "gram_minimal.c" /* yacc.c:1646 */ break; case 781: #line 5572 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.value) = makeString((yyvsp[0].str)); } #line 32268 "gram_minimal.c" /* yacc.c:1646 */ break; case 782: #line 5573 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.value) = makeString((yyvsp[0].str)); } #line 32274 "gram_minimal.c" /* yacc.c:1646 */ break; case 783: #line 5577 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.range) = (yyvsp[0].range); } #line 32280 "gram_minimal.c" /* yacc.c:1646 */ break; case 784: #line 5578 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.range) = NULL; } #line 32286 "gram_minimal.c" /* yacc.c:1646 */ break; case 785: #line 5583 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = 0; } #line 32292 "gram_minimal.c" /* yacc.c:1646 */ break; case 786: #line 5585 "gram_minimal.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 32320 "gram_minimal.c" /* yacc.c:1646 */ break; case 787: #line 5611 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = CAS_NOT_DEFERRABLE; } #line 32326 "gram_minimal.c" /* yacc.c:1646 */ break; case 788: #line 5612 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = CAS_DEFERRABLE; } #line 32332 "gram_minimal.c" /* yacc.c:1646 */ break; case 789: #line 5613 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = CAS_INITIALLY_IMMEDIATE; } #line 32338 "gram_minimal.c" /* yacc.c:1646 */ break; case 790: #line 5614 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = CAS_INITIALLY_DEFERRED; } #line 32344 "gram_minimal.c" /* yacc.c:1646 */ break; case 791: #line 5615 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = CAS_NOT_VALID; } #line 32350 "gram_minimal.c" /* yacc.c:1646 */ break; case 792: #line 5616 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = CAS_NO_INHERIT; } #line 32356 "gram_minimal.c" /* yacc.c:1646 */ break; case 793: #line 5631 "gram_minimal.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 32369 "gram_minimal.c" /* yacc.c:1646 */ break; case 794: #line 5642 "gram_minimal.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 32382 "gram_minimal.c" /* yacc.c:1646 */ break; case 795: #line 5654 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].defelt)); } #line 32388 "gram_minimal.c" /* yacc.c:1646 */ break; case 796: #line 5656 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].defelt)); } #line 32394 "gram_minimal.c" /* yacc.c:1646 */ break; case 797: #line 5661 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem((yyvsp[-4].str), (Node *) (yyvsp[-1].list), (yylsp[-4])); } #line 32400 "gram_minimal.c" /* yacc.c:1646 */ break; case 798: #line 5666 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1(makeString((yyvsp[0].str))); } #line 32406 "gram_minimal.c" /* yacc.c:1646 */ break; case 799: #line 5668 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), makeString((yyvsp[0].str))); } #line 32412 "gram_minimal.c" /* yacc.c:1646 */ break; case 800: #line 5673 "gram_minimal.y" /* yacc.c:1646 */ { AlterEventTrigStmt *n = makeNode(AlterEventTrigStmt); n->trigname = (yyvsp[-1].str); n->tgenabled = (yyvsp[0].chr); (yyval.node) = (Node *) n; } #line 32423 "gram_minimal.c" /* yacc.c:1646 */ break; case 801: #line 5682 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.chr) = TRIGGER_FIRES_ON_ORIGIN; } #line 32429 "gram_minimal.c" /* yacc.c:1646 */ break; case 802: #line 5683 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.chr) = TRIGGER_FIRES_ON_REPLICA; } #line 32435 "gram_minimal.c" /* yacc.c:1646 */ break; case 803: #line 5684 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.chr) = TRIGGER_FIRES_ALWAYS; } #line 32441 "gram_minimal.c" /* yacc.c:1646 */ break; case 804: #line 5685 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.chr) = TRIGGER_DISABLED; } #line 32447 "gram_minimal.c" /* yacc.c:1646 */ break; case 805: #line 5697 "gram_minimal.y" /* yacc.c:1646 */ { ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), errmsg("CREATE ASSERTION is not yet implemented"))); (yyval.node) = NULL; } #line 32459 "gram_minimal.c" /* yacc.c:1646 */ break; case 806: #line 5716 "gram_minimal.y" /* yacc.c:1646 */ { DefineStmt *n = makeNode(DefineStmt); n->kind = OBJECT_AGGREGATE; n->oldstyle = false; n->replace = (yyvsp[-4].boolean); n->defnames = (yyvsp[-2].list); n->args = (yyvsp[-1].list); n->definition = (yyvsp[0].list); (yyval.node) = (Node *)n; } #line 32474 "gram_minimal.c" /* yacc.c:1646 */ break; case 807: #line 5727 "gram_minimal.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->replace = (yyvsp[-3].boolean); n->defnames = (yyvsp[-1].list); n->args = NIL; n->definition = (yyvsp[0].list); (yyval.node) = (Node *)n; } #line 32490 "gram_minimal.c" /* yacc.c:1646 */ break; case 808: #line 5739 "gram_minimal.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 32504 "gram_minimal.c" /* yacc.c:1646 */ break; case 809: #line 5749 "gram_minimal.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 32518 "gram_minimal.c" /* yacc.c:1646 */ break; case 810: #line 5759 "gram_minimal.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 32533 "gram_minimal.c" /* yacc.c:1646 */ break; case 811: #line 5770 "gram_minimal.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 32546 "gram_minimal.c" /* yacc.c:1646 */ break; case 812: #line 5779 "gram_minimal.y" /* yacc.c:1646 */ { CreateEnumStmt *n = makeNode(CreateEnumStmt); n->typeName = (yyvsp[-5].list); n->vals = (yyvsp[-1].list); (yyval.node) = (Node *)n; } #line 32557 "gram_minimal.c" /* yacc.c:1646 */ break; case 813: #line 5786 "gram_minimal.y" /* yacc.c:1646 */ { CreateRangeStmt *n = makeNode(CreateRangeStmt); n->typeName = (yyvsp[-3].list); n->params = (yyvsp[0].list); (yyval.node) = (Node *)n; } #line 32568 "gram_minimal.c" /* yacc.c:1646 */ break; case 814: #line 5793 "gram_minimal.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 32581 "gram_minimal.c" /* yacc.c:1646 */ break; case 815: #line 5802 "gram_minimal.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 32594 "gram_minimal.c" /* yacc.c:1646 */ break; case 816: #line 5811 "gram_minimal.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 32607 "gram_minimal.c" /* yacc.c:1646 */ break; case 817: #line 5820 "gram_minimal.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 32620 "gram_minimal.c" /* yacc.c:1646 */ break; case 818: #line 5829 "gram_minimal.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 32633 "gram_minimal.c" /* yacc.c:1646 */ break; case 819: #line 5838 "gram_minimal.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); n->if_not_exists = true; (yyval.node) = (Node *)n; } #line 32647 "gram_minimal.c" /* yacc.c:1646 */ break; case 820: #line 5848 "gram_minimal.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), (yylsp[0]))); (yyval.node) = (Node *)n; } #line 32660 "gram_minimal.c" /* yacc.c:1646 */ break; case 821: #line 5857 "gram_minimal.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), (yylsp[0]))); n->if_not_exists = true; (yyval.node) = (Node *)n; } #line 32674 "gram_minimal.c" /* yacc.c:1646 */ break; case 822: #line 5868 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[-1].list); } #line 32680 "gram_minimal.c" /* yacc.c:1646 */ break; case 823: #line 5871 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].defelt)); } #line 32686 "gram_minimal.c" /* yacc.c:1646 */ break; case 824: #line 5872 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].defelt)); } #line 32692 "gram_minimal.c" /* yacc.c:1646 */ break; case 825: #line 5876 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem((yyvsp[-2].str), (Node *) (yyvsp[0].node), (yylsp[-2])); } #line 32700 "gram_minimal.c" /* yacc.c:1646 */ break; case 826: #line 5880 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem((yyvsp[0].str), NULL, (yylsp[0])); } #line 32708 "gram_minimal.c" /* yacc.c:1646 */ break; case 827: #line 5886 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (Node *)(yyvsp[0].typnam); } #line 32714 "gram_minimal.c" /* yacc.c:1646 */ break; case 828: #line 5887 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (Node *)makeString(pstrdup((yyvsp[0].keyword))); } #line 32720 "gram_minimal.c" /* yacc.c:1646 */ break; case 829: #line 5888 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (Node *)(yyvsp[0].list); } #line 32726 "gram_minimal.c" /* yacc.c:1646 */ break; case 830: #line 5889 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (Node *)(yyvsp[0].value); } #line 32732 "gram_minimal.c" /* yacc.c:1646 */ break; case 831: #line 5890 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (Node *)makeString((yyvsp[0].str)); } #line 32738 "gram_minimal.c" /* yacc.c:1646 */ break; case 832: #line 5891 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (Node *)makeString(pstrdup((yyvsp[0].keyword))); } #line 32744 "gram_minimal.c" /* yacc.c:1646 */ break; case 833: #line 5894 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[-1].list); } #line 32750 "gram_minimal.c" /* yacc.c:1646 */ break; case 834: #line 5897 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].defelt)); } #line 32756 "gram_minimal.c" /* yacc.c:1646 */ break; case 835: #line 5898 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].defelt)); } #line 32762 "gram_minimal.c" /* yacc.c:1646 */ break; case 836: #line 5907 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem((yyvsp[-2].str), (Node *)(yyvsp[0].node), (yylsp[-2])); } #line 32770 "gram_minimal.c" /* yacc.c:1646 */ break; case 837: #line 5913 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 32776 "gram_minimal.c" /* yacc.c:1646 */ break; case 838: #line 5914 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 32782 "gram_minimal.c" /* yacc.c:1646 */ break; case 839: #line 5918 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1(makeString((yyvsp[0].str))); } #line 32788 "gram_minimal.c" /* yacc.c:1646 */ break; case 840: #line 5920 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), makeString((yyvsp[0].str))); } #line 32794 "gram_minimal.c" /* yacc.c:1646 */ break; case 841: #line 5931 "gram_minimal.y" /* yacc.c:1646 */ { AlterEnumStmt *n = makeNode(AlterEnumStmt); n->typeName = (yyvsp[-4].list); n->oldVal = NULL; n->newVal = (yyvsp[0].str); n->newValNeighbor = NULL; n->newValIsAfter = true; n->skipIfNewValExists = (yyvsp[-1].boolean); (yyval.node) = (Node *) n; } #line 32809 "gram_minimal.c" /* yacc.c:1646 */ break; case 842: #line 5942 "gram_minimal.y" /* yacc.c:1646 */ { AlterEnumStmt *n = makeNode(AlterEnumStmt); n->typeName = (yyvsp[-6].list); n->oldVal = NULL; n->newVal = (yyvsp[-2].str); n->newValNeighbor = (yyvsp[0].str); n->newValIsAfter = false; n->skipIfNewValExists = (yyvsp[-3].boolean); (yyval.node) = (Node *) n; } #line 32824 "gram_minimal.c" /* yacc.c:1646 */ break; case 843: #line 5953 "gram_minimal.y" /* yacc.c:1646 */ { AlterEnumStmt *n = makeNode(AlterEnumStmt); n->typeName = (yyvsp[-6].list); n->oldVal = NULL; n->newVal = (yyvsp[-2].str); n->newValNeighbor = (yyvsp[0].str); n->newValIsAfter = true; n->skipIfNewValExists = (yyvsp[-3].boolean); (yyval.node) = (Node *) n; } #line 32839 "gram_minimal.c" /* yacc.c:1646 */ break; case 844: #line 5964 "gram_minimal.y" /* yacc.c:1646 */ { AlterEnumStmt *n = makeNode(AlterEnumStmt); n->typeName = (yyvsp[-5].list); n->oldVal = (yyvsp[-2].str); n->newVal = (yyvsp[0].str); n->newValNeighbor = NULL; n->newValIsAfter = false; n->skipIfNewValExists = false; (yyval.node) = (Node *) n; } #line 32854 "gram_minimal.c" /* yacc.c:1646 */ break; case 845: #line 5976 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.boolean) = true; } #line 32860 "gram_minimal.c" /* yacc.c:1646 */ break; case 846: #line 5977 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.boolean) = false; } #line 32866 "gram_minimal.c" /* yacc.c:1646 */ break; case 847: #line 5995 "gram_minimal.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 32881 "gram_minimal.c" /* yacc.c:1646 */ break; case 848: #line 6008 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].node)); } #line 32887 "gram_minimal.c" /* yacc.c:1646 */ break; case 849: #line 6009 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].node)); } #line 32893 "gram_minimal.c" /* yacc.c:1646 */ break; case 850: #line 6014 "gram_minimal.y" /* yacc.c:1646 */ { CreateOpClassItem *n = makeNode(CreateOpClassItem); ObjectWithArgs *owa = makeNode(ObjectWithArgs); owa->objname = (yyvsp[-2].list); owa->objargs = NIL; n->itemtype = OPCLASS_ITEM_OPERATOR; n->name = owa; n->number = (yyvsp[-3].ival); n->order_family = (yyvsp[-1].list); (yyval.node) = (Node *) n; } #line 32909 "gram_minimal.c" /* yacc.c:1646 */ break; case 851: #line 6027 "gram_minimal.y" /* yacc.c:1646 */ { CreateOpClassItem *n = makeNode(CreateOpClassItem); n->itemtype = OPCLASS_ITEM_OPERATOR; n->name = (yyvsp[-2].objwithargs); n->number = (yyvsp[-3].ival); n->order_family = (yyvsp[-1].list); (yyval.node) = (Node *) n; } #line 32922 "gram_minimal.c" /* yacc.c:1646 */ break; case 852: #line 6036 "gram_minimal.y" /* yacc.c:1646 */ { CreateOpClassItem *n = makeNode(CreateOpClassItem); n->itemtype = OPCLASS_ITEM_FUNCTION; n->name = (yyvsp[0].objwithargs); n->number = (yyvsp[-1].ival); (yyval.node) = (Node *) n; } #line 32934 "gram_minimal.c" /* yacc.c:1646 */ break; case 853: #line 6044 "gram_minimal.y" /* yacc.c:1646 */ { CreateOpClassItem *n = makeNode(CreateOpClassItem); n->itemtype = OPCLASS_ITEM_FUNCTION; n->name = (yyvsp[0].objwithargs); n->number = (yyvsp[-4].ival); n->class_args = (yyvsp[-2].list); (yyval.node) = (Node *) n; } #line 32947 "gram_minimal.c" /* yacc.c:1646 */ break; case 854: #line 6053 "gram_minimal.y" /* yacc.c:1646 */ { CreateOpClassItem *n = makeNode(CreateOpClassItem); n->itemtype = OPCLASS_ITEM_STORAGETYPE; n->storedtype = (yyvsp[0].typnam); (yyval.node) = (Node *) n; } #line 32958 "gram_minimal.c" /* yacc.c:1646 */ break; case 855: #line 6061 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.boolean) = true; } #line 32964 "gram_minimal.c" /* yacc.c:1646 */ break; case 856: #line 6062 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.boolean) = false; } #line 32970 "gram_minimal.c" /* yacc.c:1646 */ break; case 857: #line 6065 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 32976 "gram_minimal.c" /* yacc.c:1646 */ break; case 858: #line 6066 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 32982 "gram_minimal.c" /* yacc.c:1646 */ break; case 859: #line 6069 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 32988 "gram_minimal.c" /* yacc.c:1646 */ break; case 860: #line 6070 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 32994 "gram_minimal.c" /* yacc.c:1646 */ break; case 861: #line 6071 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 33000 "gram_minimal.c" /* yacc.c:1646 */ break; case 862: #line 6075 "gram_minimal.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 33018 "gram_minimal.c" /* yacc.c:1646 */ break; case 863: #line 6088 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.boolean) = false; } #line 33024 "gram_minimal.c" /* yacc.c:1646 */ break; case 864: #line 6094 "gram_minimal.y" /* yacc.c:1646 */ { CreateOpFamilyStmt *n = makeNode(CreateOpFamilyStmt); n->opfamilyname = (yyvsp[-2].list); n->amname = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 33035 "gram_minimal.c" /* yacc.c:1646 */ break; case 865: #line 6104 "gram_minimal.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 33048 "gram_minimal.c" /* yacc.c:1646 */ break; case 866: #line 6113 "gram_minimal.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 33061 "gram_minimal.c" /* yacc.c:1646 */ break; case 867: #line 6124 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].node)); } #line 33067 "gram_minimal.c" /* yacc.c:1646 */ break; case 868: #line 6125 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].node)); } #line 33073 "gram_minimal.c" /* yacc.c:1646 */ break; case 869: #line 6130 "gram_minimal.y" /* yacc.c:1646 */ { CreateOpClassItem *n = makeNode(CreateOpClassItem); n->itemtype = OPCLASS_ITEM_OPERATOR; n->number = (yyvsp[-3].ival); n->class_args = (yyvsp[-1].list); (yyval.node) = (Node *) n; } #line 33085 "gram_minimal.c" /* yacc.c:1646 */ break; case 870: #line 6138 "gram_minimal.y" /* yacc.c:1646 */ { CreateOpClassItem *n = makeNode(CreateOpClassItem); n->itemtype = OPCLASS_ITEM_FUNCTION; n->number = (yyvsp[-3].ival); n->class_args = (yyvsp[-1].list); (yyval.node) = (Node *) n; } #line 33097 "gram_minimal.c" /* yacc.c:1646 */ break; case 871: #line 6150 "gram_minimal.y" /* yacc.c:1646 */ { DropStmt *n = makeNode(DropStmt); n->objects = list_make1(lcons(makeString((yyvsp[-1].str)), (yyvsp[-3].list))); n->removeType = OBJECT_OPCLASS; n->behavior = (yyvsp[0].dbehavior); n->missing_ok = false; n->concurrent = false; (yyval.node) = (Node *) n; } #line 33111 "gram_minimal.c" /* yacc.c:1646 */ break; case 872: #line 6160 "gram_minimal.y" /* yacc.c:1646 */ { DropStmt *n = makeNode(DropStmt); n->objects = list_make1(lcons(makeString((yyvsp[-1].str)), (yyvsp[-3].list))); n->removeType = OBJECT_OPCLASS; n->behavior = (yyvsp[0].dbehavior); n->missing_ok = true; n->concurrent = false; (yyval.node) = (Node *) n; } #line 33125 "gram_minimal.c" /* yacc.c:1646 */ break; case 873: #line 6173 "gram_minimal.y" /* yacc.c:1646 */ { DropStmt *n = makeNode(DropStmt); n->objects = list_make1(lcons(makeString((yyvsp[-1].str)), (yyvsp[-3].list))); n->removeType = OBJECT_OPFAMILY; n->behavior = (yyvsp[0].dbehavior); n->missing_ok = false; n->concurrent = false; (yyval.node) = (Node *) n; } #line 33139 "gram_minimal.c" /* yacc.c:1646 */ break; case 874: #line 6183 "gram_minimal.y" /* yacc.c:1646 */ { DropStmt *n = makeNode(DropStmt); n->objects = list_make1(lcons(makeString((yyvsp[-1].str)), (yyvsp[-3].list))); n->removeType = OBJECT_OPFAMILY; n->behavior = (yyvsp[0].dbehavior); n->missing_ok = true; n->concurrent = false; (yyval.node) = (Node *) n; } #line 33153 "gram_minimal.c" /* yacc.c:1646 */ break; case 875: #line 6205 "gram_minimal.y" /* yacc.c:1646 */ { DropOwnedStmt *n = makeNode(DropOwnedStmt); n->roles = (yyvsp[-1].list); n->behavior = (yyvsp[0].dbehavior); (yyval.node) = (Node *)n; } #line 33164 "gram_minimal.c" /* yacc.c:1646 */ break; case 876: #line 6215 "gram_minimal.y" /* yacc.c:1646 */ { ReassignOwnedStmt *n = makeNode(ReassignOwnedStmt); n->roles = (yyvsp[-2].list); n->newrole = (yyvsp[0].rolespec); (yyval.node) = (Node *)n; } #line 33175 "gram_minimal.c" /* yacc.c:1646 */ break; case 877: #line 6233 "gram_minimal.y" /* yacc.c:1646 */ { DropStmt *n = makeNode(DropStmt); n->removeType = (yyvsp[-4].objtype); n->missing_ok = true; n->objects = (yyvsp[-1].list); n->behavior = (yyvsp[0].dbehavior); n->concurrent = false; (yyval.node) = (Node *)n; } #line 33189 "gram_minimal.c" /* yacc.c:1646 */ break; case 878: #line 6243 "gram_minimal.y" /* yacc.c:1646 */ { DropStmt *n = makeNode(DropStmt); n->removeType = (yyvsp[-2].objtype); n->missing_ok = false; n->objects = (yyvsp[-1].list); n->behavior = (yyvsp[0].dbehavior); n->concurrent = false; (yyval.node) = (Node *)n; } #line 33203 "gram_minimal.c" /* yacc.c:1646 */ break; case 879: #line 6253 "gram_minimal.y" /* yacc.c:1646 */ { DropStmt *n = makeNode(DropStmt); n->removeType = (yyvsp[-4].objtype); n->missing_ok = true; n->objects = (yyvsp[-1].list); n->behavior = (yyvsp[0].dbehavior); n->concurrent = false; (yyval.node) = (Node *)n; } #line 33217 "gram_minimal.c" /* yacc.c:1646 */ break; case 880: #line 6263 "gram_minimal.y" /* yacc.c:1646 */ { DropStmt *n = makeNode(DropStmt); n->removeType = (yyvsp[-2].objtype); n->missing_ok = false; n->objects = (yyvsp[-1].list); n->behavior = (yyvsp[0].dbehavior); n->concurrent = false; (yyval.node) = (Node *)n; } #line 33231 "gram_minimal.c" /* yacc.c:1646 */ break; case 881: #line 6273 "gram_minimal.y" /* yacc.c:1646 */ { DropStmt *n = makeNode(DropStmt); n->removeType = (yyvsp[-4].objtype); n->objects = list_make1(lappend((yyvsp[-1].list), makeString((yyvsp[-3].str)))); n->behavior = (yyvsp[0].dbehavior); n->missing_ok = false; n->concurrent = false; (yyval.node) = (Node *) n; } #line 33245 "gram_minimal.c" /* yacc.c:1646 */ break; case 882: #line 6283 "gram_minimal.y" /* yacc.c:1646 */ { DropStmt *n = makeNode(DropStmt); n->removeType = (yyvsp[-6].objtype); n->objects = list_make1(lappend((yyvsp[-1].list), makeString((yyvsp[-3].str)))); n->behavior = (yyvsp[0].dbehavior); n->missing_ok = true; n->concurrent = false; (yyval.node) = (Node *) n; } #line 33259 "gram_minimal.c" /* yacc.c:1646 */ break; case 883: #line 6293 "gram_minimal.y" /* yacc.c:1646 */ { DropStmt *n = makeNode(DropStmt); n->removeType = OBJECT_TYPE; n->missing_ok = false; n->objects = (yyvsp[-1].list); n->behavior = (yyvsp[0].dbehavior); n->concurrent = false; (yyval.node) = (Node *) n; } #line 33273 "gram_minimal.c" /* yacc.c:1646 */ break; case 884: #line 6303 "gram_minimal.y" /* yacc.c:1646 */ { DropStmt *n = makeNode(DropStmt); n->removeType = OBJECT_TYPE; n->missing_ok = true; n->objects = (yyvsp[-1].list); n->behavior = (yyvsp[0].dbehavior); n->concurrent = false; (yyval.node) = (Node *) n; } #line 33287 "gram_minimal.c" /* yacc.c:1646 */ break; case 885: #line 6313 "gram_minimal.y" /* yacc.c:1646 */ { DropStmt *n = makeNode(DropStmt); n->removeType = OBJECT_DOMAIN; n->missing_ok = false; n->objects = (yyvsp[-1].list); n->behavior = (yyvsp[0].dbehavior); n->concurrent = false; (yyval.node) = (Node *) n; } #line 33301 "gram_minimal.c" /* yacc.c:1646 */ break; case 886: #line 6323 "gram_minimal.y" /* yacc.c:1646 */ { DropStmt *n = makeNode(DropStmt); n->removeType = OBJECT_DOMAIN; n->missing_ok = true; n->objects = (yyvsp[-1].list); n->behavior = (yyvsp[0].dbehavior); n->concurrent = false; (yyval.node) = (Node *) n; } #line 33315 "gram_minimal.c" /* yacc.c:1646 */ break; case 887: #line 6333 "gram_minimal.y" /* yacc.c:1646 */ { DropStmt *n = makeNode(DropStmt); n->removeType = OBJECT_INDEX; n->missing_ok = false; n->objects = (yyvsp[-1].list); n->behavior = (yyvsp[0].dbehavior); n->concurrent = true; (yyval.node) = (Node *)n; } #line 33329 "gram_minimal.c" /* yacc.c:1646 */ break; case 888: #line 6343 "gram_minimal.y" /* yacc.c:1646 */ { DropStmt *n = makeNode(DropStmt); n->removeType = OBJECT_INDEX; n->missing_ok = true; n->objects = (yyvsp[-1].list); n->behavior = (yyvsp[0].dbehavior); n->concurrent = true; (yyval.node) = (Node *)n; } #line 33343 "gram_minimal.c" /* yacc.c:1646 */ break; case 889: #line 6356 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_TABLE; } #line 33349 "gram_minimal.c" /* yacc.c:1646 */ break; case 890: #line 6357 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_SEQUENCE; } #line 33355 "gram_minimal.c" /* yacc.c:1646 */ break; case 891: #line 6358 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_VIEW; } #line 33361 "gram_minimal.c" /* yacc.c:1646 */ break; case 892: #line 6359 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_MATVIEW; } #line 33367 "gram_minimal.c" /* yacc.c:1646 */ break; case 893: #line 6360 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_INDEX; } #line 33373 "gram_minimal.c" /* yacc.c:1646 */ break; case 894: #line 6361 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_FOREIGN_TABLE; } #line 33379 "gram_minimal.c" /* yacc.c:1646 */ break; case 895: #line 6362 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_COLLATION; } #line 33385 "gram_minimal.c" /* yacc.c:1646 */ break; case 896: #line 6363 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_CONVERSION; } #line 33391 "gram_minimal.c" /* yacc.c:1646 */ break; case 897: #line 6364 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_STATISTIC_EXT; } #line 33397 "gram_minimal.c" /* yacc.c:1646 */ break; case 898: #line 6365 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_TSPARSER; } #line 33403 "gram_minimal.c" /* yacc.c:1646 */ break; case 899: #line 6366 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_TSDICTIONARY; } #line 33409 "gram_minimal.c" /* yacc.c:1646 */ break; case 900: #line 6367 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_TSTEMPLATE; } #line 33415 "gram_minimal.c" /* yacc.c:1646 */ break; case 901: #line 6368 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_TSCONFIGURATION; } #line 33421 "gram_minimal.c" /* yacc.c:1646 */ break; case 902: #line 6373 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_ACCESS_METHOD; } #line 33427 "gram_minimal.c" /* yacc.c:1646 */ break; case 903: #line 6374 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_EVENT_TRIGGER; } #line 33433 "gram_minimal.c" /* yacc.c:1646 */ break; case 904: #line 6375 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_EXTENSION; } #line 33439 "gram_minimal.c" /* yacc.c:1646 */ break; case 905: #line 6376 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_FDW; } #line 33445 "gram_minimal.c" /* yacc.c:1646 */ break; case 906: #line 6377 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_PUBLICATION; } #line 33451 "gram_minimal.c" /* yacc.c:1646 */ break; case 907: #line 6378 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_SCHEMA; } #line 33457 "gram_minimal.c" /* yacc.c:1646 */ break; case 908: #line 6379 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_FOREIGN_SERVER; } #line 33463 "gram_minimal.c" /* yacc.c:1646 */ break; case 909: #line 6384 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_POLICY; } #line 33469 "gram_minimal.c" /* yacc.c:1646 */ break; case 910: #line 6385 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_RULE; } #line 33475 "gram_minimal.c" /* yacc.c:1646 */ break; case 911: #line 6386 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_TRIGGER; } #line 33481 "gram_minimal.c" /* yacc.c:1646 */ break; case 912: #line 6390 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].list)); } #line 33487 "gram_minimal.c" /* yacc.c:1646 */ break; case 913: #line 6391 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].list)); } #line 33493 "gram_minimal.c" /* yacc.c:1646 */ break; case 914: #line 6394 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1(makeString((yyvsp[0].str))); } #line 33499 "gram_minimal.c" /* yacc.c:1646 */ break; case 915: #line 6395 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = lcons(makeString((yyvsp[-1].str)), (yyvsp[0].list)); } #line 33505 "gram_minimal.c" /* yacc.c:1646 */ break; case 916: #line 6399 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1(makeString((yyvsp[0].str))); } #line 33511 "gram_minimal.c" /* yacc.c:1646 */ break; case 917: #line 6401 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), makeString((yyvsp[0].str))); } #line 33517 "gram_minimal.c" /* yacc.c:1646 */ break; case 918: #line 6405 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].typnam)); } #line 33523 "gram_minimal.c" /* yacc.c:1646 */ break; case 919: #line 6406 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].typnam)); } #line 33529 "gram_minimal.c" /* yacc.c:1646 */ break; case 920: #line 6418 "gram_minimal.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 33541 "gram_minimal.c" /* yacc.c:1646 */ break; case 921: #line 6428 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.boolean) = false; } #line 33547 "gram_minimal.c" /* yacc.c:1646 */ break; case 922: #line 6429 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.boolean) = true; } #line 33553 "gram_minimal.c" /* yacc.c:1646 */ break; case 923: #line 6430 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.boolean) = false; } #line 33559 "gram_minimal.c" /* yacc.c:1646 */ break; case 924: #line 6465 "gram_minimal.y" /* yacc.c:1646 */ { CommentStmt *n = makeNode(CommentStmt); n->objtype = (yyvsp[-3].objtype); n->object = (Node *) (yyvsp[-2].list); n->comment = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 33571 "gram_minimal.c" /* yacc.c:1646 */ break; case 925: #line 6473 "gram_minimal.y" /* yacc.c:1646 */ { CommentStmt *n = makeNode(CommentStmt); n->objtype = (yyvsp[-3].objtype); n->object = (Node *) makeString((yyvsp[-2].str)); n->comment = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 33583 "gram_minimal.c" /* yacc.c:1646 */ break; case 926: #line 6481 "gram_minimal.y" /* yacc.c:1646 */ { CommentStmt *n = makeNode(CommentStmt); n->objtype = OBJECT_TYPE; n->object = (Node *) (yyvsp[-2].typnam); n->comment = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 33595 "gram_minimal.c" /* yacc.c:1646 */ break; case 927: #line 6489 "gram_minimal.y" /* yacc.c:1646 */ { CommentStmt *n = makeNode(CommentStmt); n->objtype = OBJECT_DOMAIN; n->object = (Node *) (yyvsp[-2].typnam); n->comment = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 33607 "gram_minimal.c" /* yacc.c:1646 */ break; case 928: #line 6497 "gram_minimal.y" /* yacc.c:1646 */ { CommentStmt *n = makeNode(CommentStmt); n->objtype = OBJECT_AGGREGATE; n->object = (Node *) (yyvsp[-2].objwithargs); n->comment = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 33619 "gram_minimal.c" /* yacc.c:1646 */ break; case 929: #line 6505 "gram_minimal.y" /* yacc.c:1646 */ { CommentStmt *n = makeNode(CommentStmt); n->objtype = OBJECT_FUNCTION; n->object = (Node *) (yyvsp[-2].objwithargs); n->comment = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 33631 "gram_minimal.c" /* yacc.c:1646 */ break; case 930: #line 6513 "gram_minimal.y" /* yacc.c:1646 */ { CommentStmt *n = makeNode(CommentStmt); n->objtype = OBJECT_OPERATOR; n->object = (Node *) (yyvsp[-2].objwithargs); n->comment = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 33643 "gram_minimal.c" /* yacc.c:1646 */ break; case 931: #line 6521 "gram_minimal.y" /* yacc.c:1646 */ { CommentStmt *n = makeNode(CommentStmt); n->objtype = OBJECT_TABCONSTRAINT; n->object = (Node *) lappend((yyvsp[-2].list), makeString((yyvsp[-4].str))); n->comment = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 33655 "gram_minimal.c" /* yacc.c:1646 */ break; case 932: #line 6529 "gram_minimal.y" /* yacc.c:1646 */ { CommentStmt *n = makeNode(CommentStmt); n->objtype = OBJECT_DOMCONSTRAINT; /* * should use Typename not any_name in the production, but * there's a shift/reduce conflict if we do that, so fix it * up here. */ n->object = (Node *) list_make2(makeTypeNameFromNameList((yyvsp[-2].list)), makeString((yyvsp[-5].str))); n->comment = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 33672 "gram_minimal.c" /* yacc.c:1646 */ break; case 933: #line 6542 "gram_minimal.y" /* yacc.c:1646 */ { CommentStmt *n = makeNode(CommentStmt); n->objtype = OBJECT_POLICY; n->object = (Node *) lappend((yyvsp[-2].list), makeString((yyvsp[-4].str))); n->comment = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 33684 "gram_minimal.c" /* yacc.c:1646 */ break; case 934: #line 6550 "gram_minimal.y" /* yacc.c:1646 */ { CommentStmt *n = makeNode(CommentStmt); n->objtype = OBJECT_PROCEDURE; n->object = (Node *) (yyvsp[-2].objwithargs); n->comment = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 33696 "gram_minimal.c" /* yacc.c:1646 */ break; case 935: #line 6558 "gram_minimal.y" /* yacc.c:1646 */ { CommentStmt *n = makeNode(CommentStmt); n->objtype = OBJECT_ROUTINE; n->object = (Node *) (yyvsp[-2].objwithargs); n->comment = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 33708 "gram_minimal.c" /* yacc.c:1646 */ break; case 936: #line 6566 "gram_minimal.y" /* yacc.c:1646 */ { CommentStmt *n = makeNode(CommentStmt); n->objtype = OBJECT_RULE; n->object = (Node *) lappend((yyvsp[-2].list), makeString((yyvsp[-4].str))); n->comment = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 33720 "gram_minimal.c" /* yacc.c:1646 */ break; case 937: #line 6574 "gram_minimal.y" /* yacc.c:1646 */ { CommentStmt *n = makeNode(CommentStmt); n->objtype = OBJECT_TRANSFORM; n->object = (Node *) list_make2((yyvsp[-4].typnam), makeString((yyvsp[-2].str))); n->comment = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 33732 "gram_minimal.c" /* yacc.c:1646 */ break; case 938: #line 6582 "gram_minimal.y" /* yacc.c:1646 */ { CommentStmt *n = makeNode(CommentStmt); n->objtype = OBJECT_TRIGGER; n->object = (Node *) lappend((yyvsp[-2].list), makeString((yyvsp[-4].str))); n->comment = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 33744 "gram_minimal.c" /* yacc.c:1646 */ break; case 939: #line 6590 "gram_minimal.y" /* yacc.c:1646 */ { CommentStmt *n = makeNode(CommentStmt); n->objtype = OBJECT_OPCLASS; n->object = (Node *) lcons(makeString((yyvsp[-2].str)), (yyvsp[-4].list)); n->comment = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 33756 "gram_minimal.c" /* yacc.c:1646 */ break; case 940: #line 6598 "gram_minimal.y" /* yacc.c:1646 */ { CommentStmt *n = makeNode(CommentStmt); n->objtype = OBJECT_OPFAMILY; n->object = (Node *) lcons(makeString((yyvsp[-2].str)), (yyvsp[-4].list)); n->comment = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 33768 "gram_minimal.c" /* yacc.c:1646 */ break; case 941: #line 6606 "gram_minimal.y" /* yacc.c:1646 */ { CommentStmt *n = makeNode(CommentStmt); n->objtype = OBJECT_LARGEOBJECT; n->object = (Node *) (yyvsp[-2].value); n->comment = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 33780 "gram_minimal.c" /* yacc.c:1646 */ break; case 942: #line 6614 "gram_minimal.y" /* yacc.c:1646 */ { CommentStmt *n = makeNode(CommentStmt); n->objtype = OBJECT_CAST; n->object = (Node *) list_make2((yyvsp[-5].typnam), (yyvsp[-3].typnam)); n->comment = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 33792 "gram_minimal.c" /* yacc.c:1646 */ break; case 943: #line 6625 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_COLUMN; } #line 33798 "gram_minimal.c" /* yacc.c:1646 */ break; case 944: #line 6626 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_INDEX; } #line 33804 "gram_minimal.c" /* yacc.c:1646 */ break; case 945: #line 6627 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_SEQUENCE; } #line 33810 "gram_minimal.c" /* yacc.c:1646 */ break; case 946: #line 6628 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_STATISTIC_EXT; } #line 33816 "gram_minimal.c" /* yacc.c:1646 */ break; case 947: #line 6629 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_TABLE; } #line 33822 "gram_minimal.c" /* yacc.c:1646 */ break; case 948: #line 6630 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_VIEW; } #line 33828 "gram_minimal.c" /* yacc.c:1646 */ break; case 949: #line 6631 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_MATVIEW; } #line 33834 "gram_minimal.c" /* yacc.c:1646 */ break; case 950: #line 6632 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_COLLATION; } #line 33840 "gram_minimal.c" /* yacc.c:1646 */ break; case 951: #line 6633 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_CONVERSION; } #line 33846 "gram_minimal.c" /* yacc.c:1646 */ break; case 952: #line 6634 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_FOREIGN_TABLE; } #line 33852 "gram_minimal.c" /* yacc.c:1646 */ break; case 953: #line 6635 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_TSCONFIGURATION; } #line 33858 "gram_minimal.c" /* yacc.c:1646 */ break; case 954: #line 6636 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_TSDICTIONARY; } #line 33864 "gram_minimal.c" /* yacc.c:1646 */ break; case 955: #line 6637 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_TSPARSER; } #line 33870 "gram_minimal.c" /* yacc.c:1646 */ break; case 956: #line 6638 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_TSTEMPLATE; } #line 33876 "gram_minimal.c" /* yacc.c:1646 */ break; case 957: #line 6643 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_ACCESS_METHOD; } #line 33882 "gram_minimal.c" /* yacc.c:1646 */ break; case 958: #line 6644 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_DATABASE; } #line 33888 "gram_minimal.c" /* yacc.c:1646 */ break; case 959: #line 6645 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_EVENT_TRIGGER; } #line 33894 "gram_minimal.c" /* yacc.c:1646 */ break; case 960: #line 6646 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_EXTENSION; } #line 33900 "gram_minimal.c" /* yacc.c:1646 */ break; case 961: #line 6647 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_FDW; } #line 33906 "gram_minimal.c" /* yacc.c:1646 */ break; case 962: #line 6648 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_LANGUAGE; } #line 33912 "gram_minimal.c" /* yacc.c:1646 */ break; case 963: #line 6649 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_PUBLICATION; } #line 33918 "gram_minimal.c" /* yacc.c:1646 */ break; case 964: #line 6650 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_ROLE; } #line 33924 "gram_minimal.c" /* yacc.c:1646 */ break; case 965: #line 6651 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_SCHEMA; } #line 33930 "gram_minimal.c" /* yacc.c:1646 */ break; case 966: #line 6652 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_FOREIGN_SERVER; } #line 33936 "gram_minimal.c" /* yacc.c:1646 */ break; case 967: #line 6653 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_SUBSCRIPTION; } #line 33942 "gram_minimal.c" /* yacc.c:1646 */ break; case 968: #line 6654 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_TABLESPACE; } #line 33948 "gram_minimal.c" /* yacc.c:1646 */ break; case 969: #line 6658 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 33954 "gram_minimal.c" /* yacc.c:1646 */ break; case 970: #line 6659 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = NULL; } #line 33960 "gram_minimal.c" /* yacc.c:1646 */ break; case 971: #line 6675 "gram_minimal.y" /* yacc.c:1646 */ { SecLabelStmt *n = makeNode(SecLabelStmt); n->provider = (yyvsp[-5].str); n->objtype = (yyvsp[-3].objtype); n->object = (Node *) (yyvsp[-2].list); n->label = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 33973 "gram_minimal.c" /* yacc.c:1646 */ break; case 972: #line 6685 "gram_minimal.y" /* yacc.c:1646 */ { SecLabelStmt *n = makeNode(SecLabelStmt); n->provider = (yyvsp[-5].str); n->objtype = (yyvsp[-3].objtype); n->object = (Node *) makeString((yyvsp[-2].str)); n->label = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 33986 "gram_minimal.c" /* yacc.c:1646 */ break; case 973: #line 6695 "gram_minimal.y" /* yacc.c:1646 */ { SecLabelStmt *n = makeNode(SecLabelStmt); n->provider = (yyvsp[-5].str); n->objtype = OBJECT_TYPE; n->object = (Node *) (yyvsp[-2].typnam); n->label = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 33999 "gram_minimal.c" /* yacc.c:1646 */ break; case 974: #line 6705 "gram_minimal.y" /* yacc.c:1646 */ { SecLabelStmt *n = makeNode(SecLabelStmt); n->provider = (yyvsp[-5].str); n->objtype = OBJECT_DOMAIN; n->object = (Node *) (yyvsp[-2].typnam); n->label = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 34012 "gram_minimal.c" /* yacc.c:1646 */ break; case 975: #line 6715 "gram_minimal.y" /* yacc.c:1646 */ { SecLabelStmt *n = makeNode(SecLabelStmt); n->provider = (yyvsp[-5].str); n->objtype = OBJECT_AGGREGATE; n->object = (Node *) (yyvsp[-2].objwithargs); n->label = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 34025 "gram_minimal.c" /* yacc.c:1646 */ break; case 976: #line 6725 "gram_minimal.y" /* yacc.c:1646 */ { SecLabelStmt *n = makeNode(SecLabelStmt); n->provider = (yyvsp[-5].str); n->objtype = OBJECT_FUNCTION; n->object = (Node *) (yyvsp[-2].objwithargs); n->label = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 34038 "gram_minimal.c" /* yacc.c:1646 */ break; case 977: #line 6735 "gram_minimal.y" /* yacc.c:1646 */ { SecLabelStmt *n = makeNode(SecLabelStmt); n->provider = (yyvsp[-6].str); n->objtype = OBJECT_LARGEOBJECT; n->object = (Node *) (yyvsp[-2].value); n->label = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 34051 "gram_minimal.c" /* yacc.c:1646 */ break; case 978: #line 6745 "gram_minimal.y" /* yacc.c:1646 */ { SecLabelStmt *n = makeNode(SecLabelStmt); n->provider = (yyvsp[-5].str); n->objtype = OBJECT_PROCEDURE; n->object = (Node *) (yyvsp[-2].objwithargs); n->label = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 34064 "gram_minimal.c" /* yacc.c:1646 */ break; case 979: #line 6755 "gram_minimal.y" /* yacc.c:1646 */ { SecLabelStmt *n = makeNode(SecLabelStmt); n->provider = (yyvsp[-5].str); n->objtype = OBJECT_ROUTINE; n->object = (Node *) (yyvsp[-2].objwithargs); n->label = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 34077 "gram_minimal.c" /* yacc.c:1646 */ break; case 980: #line 6765 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 34083 "gram_minimal.c" /* yacc.c:1646 */ break; case 981: #line 6766 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = NULL; } #line 34089 "gram_minimal.c" /* yacc.c:1646 */ break; case 982: #line 6771 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_COLUMN; } #line 34095 "gram_minimal.c" /* yacc.c:1646 */ break; case 983: #line 6772 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_FOREIGN_TABLE; } #line 34101 "gram_minimal.c" /* yacc.c:1646 */ break; case 984: #line 6773 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_SEQUENCE; } #line 34107 "gram_minimal.c" /* yacc.c:1646 */ break; case 985: #line 6774 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_TABLE; } #line 34113 "gram_minimal.c" /* yacc.c:1646 */ break; case 986: #line 6775 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_VIEW; } #line 34119 "gram_minimal.c" /* yacc.c:1646 */ break; case 987: #line 6776 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_MATVIEW; } #line 34125 "gram_minimal.c" /* yacc.c:1646 */ break; case 988: #line 6781 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_DATABASE; } #line 34131 "gram_minimal.c" /* yacc.c:1646 */ break; case 989: #line 6782 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_EVENT_TRIGGER; } #line 34137 "gram_minimal.c" /* yacc.c:1646 */ break; case 990: #line 6783 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_LANGUAGE; } #line 34143 "gram_minimal.c" /* yacc.c:1646 */ break; case 991: #line 6784 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_PUBLICATION; } #line 34149 "gram_minimal.c" /* yacc.c:1646 */ break; case 992: #line 6785 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_ROLE; } #line 34155 "gram_minimal.c" /* yacc.c:1646 */ break; case 993: #line 6786 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_SCHEMA; } #line 34161 "gram_minimal.c" /* yacc.c:1646 */ break; case 994: #line 6787 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_SUBSCRIPTION; } #line 34167 "gram_minimal.c" /* yacc.c:1646 */ break; case 995: #line 6788 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.objtype) = OBJECT_TABLESPACE; } #line 34173 "gram_minimal.c" /* yacc.c:1646 */ break; case 996: #line 6791 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 34179 "gram_minimal.c" /* yacc.c:1646 */ break; case 997: #line 6792 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = NULL; } #line 34185 "gram_minimal.c" /* yacc.c:1646 */ break; case 998: #line 6803 "gram_minimal.y" /* yacc.c:1646 */ { FetchStmt *n = (FetchStmt *) (yyvsp[0].node); n->ismove = false; (yyval.node) = (Node *)n; } #line 34195 "gram_minimal.c" /* yacc.c:1646 */ break; case 999: #line 6809 "gram_minimal.y" /* yacc.c:1646 */ { FetchStmt *n = (FetchStmt *) (yyvsp[0].node); n->ismove = true; (yyval.node) = (Node *)n; } #line 34205 "gram_minimal.c" /* yacc.c:1646 */ break; case 1000: #line 6817 "gram_minimal.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 34217 "gram_minimal.c" /* yacc.c:1646 */ break; case 1001: #line 6825 "gram_minimal.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 34229 "gram_minimal.c" /* yacc.c:1646 */ break; case 1002: #line 6833 "gram_minimal.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 34241 "gram_minimal.c" /* yacc.c:1646 */ break; case 1003: #line 6841 "gram_minimal.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 34253 "gram_minimal.c" /* yacc.c:1646 */ break; case 1004: #line 6849 "gram_minimal.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 34265 "gram_minimal.c" /* yacc.c:1646 */ break; case 1005: #line 6857 "gram_minimal.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 34277 "gram_minimal.c" /* yacc.c:1646 */ break; case 1006: #line 6865 "gram_minimal.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 34289 "gram_minimal.c" /* yacc.c:1646 */ break; case 1007: #line 6873 "gram_minimal.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 34301 "gram_minimal.c" /* yacc.c:1646 */ break; case 1008: #line 6881 "gram_minimal.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 34313 "gram_minimal.c" /* yacc.c:1646 */ break; case 1009: #line 6889 "gram_minimal.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 34325 "gram_minimal.c" /* yacc.c:1646 */ break; case 1010: #line 6897 "gram_minimal.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 34337 "gram_minimal.c" /* yacc.c:1646 */ break; case 1011: #line 6905 "gram_minimal.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 34349 "gram_minimal.c" /* yacc.c:1646 */ break; case 1012: #line 6913 "gram_minimal.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 34361 "gram_minimal.c" /* yacc.c:1646 */ break; case 1013: #line 6921 "gram_minimal.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 34373 "gram_minimal.c" /* yacc.c:1646 */ break; case 1014: #line 6929 "gram_minimal.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 34385 "gram_minimal.c" /* yacc.c:1646 */ break; case 1015: #line 6937 "gram_minimal.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 34397 "gram_minimal.c" /* yacc.c:1646 */ break; case 1016: #line 6946 "gram_minimal.y" /* yacc.c:1646 */ {} #line 34403 "gram_minimal.c" /* yacc.c:1646 */ break; case 1017: #line 6947 "gram_minimal.y" /* yacc.c:1646 */ {} #line 34409 "gram_minimal.c" /* yacc.c:1646 */ break; case 1018: #line 6950 "gram_minimal.y" /* yacc.c:1646 */ {} #line 34415 "gram_minimal.c" /* yacc.c:1646 */ break; case 1019: #line 6951 "gram_minimal.y" /* yacc.c:1646 */ {} #line 34421 "gram_minimal.c" /* yacc.c:1646 */ break; case 1020: #line 6963 "gram_minimal.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 34437 "gram_minimal.c" /* yacc.c:1646 */ break; case 1021: #line 6979 "gram_minimal.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 34454 "gram_minimal.c" /* yacc.c:1646 */ break; case 1022: #line 6993 "gram_minimal.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 34471 "gram_minimal.c" /* yacc.c:1646 */ break; case 1023: #line 7018 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 34477 "gram_minimal.c" /* yacc.c:1646 */ break; case 1024: #line 7020 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 34483 "gram_minimal.c" /* yacc.c:1646 */ break; case 1025: #line 7022 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 34489 "gram_minimal.c" /* yacc.c:1646 */ break; case 1026: #line 7024 "gram_minimal.y" /* yacc.c:1646 */ { AccessPriv *n = makeNode(AccessPriv); n->priv_name = NULL; n->cols = (yyvsp[-1].list); (yyval.list) = list_make1(n); } #line 34500 "gram_minimal.c" /* yacc.c:1646 */ break; case 1027: #line 7031 "gram_minimal.y" /* yacc.c:1646 */ { AccessPriv *n = makeNode(AccessPriv); n->priv_name = NULL; n->cols = (yyvsp[-1].list); (yyval.list) = list_make1(n); } #line 34511 "gram_minimal.c" /* yacc.c:1646 */ break; case 1028: #line 7039 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].accesspriv)); } #line 34517 "gram_minimal.c" /* yacc.c:1646 */ break; case 1029: #line 7040 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].accesspriv)); } #line 34523 "gram_minimal.c" /* yacc.c:1646 */ break; case 1030: #line 7044 "gram_minimal.y" /* yacc.c:1646 */ { AccessPriv *n = makeNode(AccessPriv); n->priv_name = pstrdup((yyvsp[-1].keyword)); n->cols = (yyvsp[0].list); (yyval.accesspriv) = n; } #line 34534 "gram_minimal.c" /* yacc.c:1646 */ break; case 1031: #line 7051 "gram_minimal.y" /* yacc.c:1646 */ { AccessPriv *n = makeNode(AccessPriv); n->priv_name = pstrdup((yyvsp[-1].keyword)); n->cols = (yyvsp[0].list); (yyval.accesspriv) = n; } #line 34545 "gram_minimal.c" /* yacc.c:1646 */ break; case 1032: #line 7058 "gram_minimal.y" /* yacc.c:1646 */ { AccessPriv *n = makeNode(AccessPriv); n->priv_name = pstrdup((yyvsp[-1].keyword)); n->cols = (yyvsp[0].list); (yyval.accesspriv) = n; } #line 34556 "gram_minimal.c" /* yacc.c:1646 */ break; case 1033: #line 7065 "gram_minimal.y" /* yacc.c:1646 */ { AccessPriv *n = makeNode(AccessPriv); n->priv_name = (yyvsp[-1].str); n->cols = (yyvsp[0].list); (yyval.accesspriv) = n; } #line 34567 "gram_minimal.c" /* yacc.c:1646 */ break; case 1034: #line 7079 "gram_minimal.y" /* yacc.c:1646 */ { PrivTarget *n = (PrivTarget *) palloc(sizeof(PrivTarget)); n->targtype = ACL_TARGET_OBJECT; n->objtype = OBJECT_TABLE; n->objs = (yyvsp[0].list); (yyval.privtarget) = n; } #line 34579 "gram_minimal.c" /* yacc.c:1646 */ break; case 1035: #line 7087 "gram_minimal.y" /* yacc.c:1646 */ { PrivTarget *n = (PrivTarget *) palloc(sizeof(PrivTarget)); n->targtype = ACL_TARGET_OBJECT; n->objtype = OBJECT_TABLE; n->objs = (yyvsp[0].list); (yyval.privtarget) = n; } #line 34591 "gram_minimal.c" /* yacc.c:1646 */ break; case 1036: #line 7095 "gram_minimal.y" /* yacc.c:1646 */ { PrivTarget *n = (PrivTarget *) palloc(sizeof(PrivTarget)); n->targtype = ACL_TARGET_OBJECT; n->objtype = OBJECT_SEQUENCE; n->objs = (yyvsp[0].list); (yyval.privtarget) = n; } #line 34603 "gram_minimal.c" /* yacc.c:1646 */ break; case 1037: #line 7103 "gram_minimal.y" /* yacc.c:1646 */ { PrivTarget *n = (PrivTarget *) palloc(sizeof(PrivTarget)); n->targtype = ACL_TARGET_OBJECT; n->objtype = OBJECT_FDW; n->objs = (yyvsp[0].list); (yyval.privtarget) = n; } #line 34615 "gram_minimal.c" /* yacc.c:1646 */ break; case 1038: #line 7111 "gram_minimal.y" /* yacc.c:1646 */ { PrivTarget *n = (PrivTarget *) palloc(sizeof(PrivTarget)); n->targtype = ACL_TARGET_OBJECT; n->objtype = OBJECT_FOREIGN_SERVER; n->objs = (yyvsp[0].list); (yyval.privtarget) = n; } #line 34627 "gram_minimal.c" /* yacc.c:1646 */ break; case 1039: #line 7119 "gram_minimal.y" /* yacc.c:1646 */ { PrivTarget *n = (PrivTarget *) palloc(sizeof(PrivTarget)); n->targtype = ACL_TARGET_OBJECT; n->objtype = OBJECT_FUNCTION; n->objs = (yyvsp[0].list); (yyval.privtarget) = n; } #line 34639 "gram_minimal.c" /* yacc.c:1646 */ break; case 1040: #line 7127 "gram_minimal.y" /* yacc.c:1646 */ { PrivTarget *n = (PrivTarget *) palloc(sizeof(PrivTarget)); n->targtype = ACL_TARGET_OBJECT; n->objtype = OBJECT_PROCEDURE; n->objs = (yyvsp[0].list); (yyval.privtarget) = n; } #line 34651 "gram_minimal.c" /* yacc.c:1646 */ break; case 1041: #line 7135 "gram_minimal.y" /* yacc.c:1646 */ { PrivTarget *n = (PrivTarget *) palloc(sizeof(PrivTarget)); n->targtype = ACL_TARGET_OBJECT; n->objtype = OBJECT_ROUTINE; n->objs = (yyvsp[0].list); (yyval.privtarget) = n; } #line 34663 "gram_minimal.c" /* yacc.c:1646 */ break; case 1042: #line 7143 "gram_minimal.y" /* yacc.c:1646 */ { PrivTarget *n = (PrivTarget *) palloc(sizeof(PrivTarget)); n->targtype = ACL_TARGET_OBJECT; n->objtype = OBJECT_DATABASE; n->objs = (yyvsp[0].list); (yyval.privtarget) = n; } #line 34675 "gram_minimal.c" /* yacc.c:1646 */ break; case 1043: #line 7151 "gram_minimal.y" /* yacc.c:1646 */ { PrivTarget *n = (PrivTarget *) palloc(sizeof(PrivTarget)); n->targtype = ACL_TARGET_OBJECT; n->objtype = OBJECT_DOMAIN; n->objs = (yyvsp[0].list); (yyval.privtarget) = n; } #line 34687 "gram_minimal.c" /* yacc.c:1646 */ break; case 1044: #line 7159 "gram_minimal.y" /* yacc.c:1646 */ { PrivTarget *n = (PrivTarget *) palloc(sizeof(PrivTarget)); n->targtype = ACL_TARGET_OBJECT; n->objtype = OBJECT_LANGUAGE; n->objs = (yyvsp[0].list); (yyval.privtarget) = n; } #line 34699 "gram_minimal.c" /* yacc.c:1646 */ break; case 1045: #line 7167 "gram_minimal.y" /* yacc.c:1646 */ { PrivTarget *n = (PrivTarget *) palloc(sizeof(PrivTarget)); n->targtype = ACL_TARGET_OBJECT; n->objtype = OBJECT_LARGEOBJECT; n->objs = (yyvsp[0].list); (yyval.privtarget) = n; } #line 34711 "gram_minimal.c" /* yacc.c:1646 */ break; case 1046: #line 7175 "gram_minimal.y" /* yacc.c:1646 */ { PrivTarget *n = (PrivTarget *) palloc(sizeof(PrivTarget)); n->targtype = ACL_TARGET_OBJECT; n->objtype = OBJECT_SCHEMA; n->objs = (yyvsp[0].list); (yyval.privtarget) = n; } #line 34723 "gram_minimal.c" /* yacc.c:1646 */ break; case 1047: #line 7183 "gram_minimal.y" /* yacc.c:1646 */ { PrivTarget *n = (PrivTarget *) palloc(sizeof(PrivTarget)); n->targtype = ACL_TARGET_OBJECT; n->objtype = OBJECT_TABLESPACE; n->objs = (yyvsp[0].list); (yyval.privtarget) = n; } #line 34735 "gram_minimal.c" /* yacc.c:1646 */ break; case 1048: #line 7191 "gram_minimal.y" /* yacc.c:1646 */ { PrivTarget *n = (PrivTarget *) palloc(sizeof(PrivTarget)); n->targtype = ACL_TARGET_OBJECT; n->objtype = OBJECT_TYPE; n->objs = (yyvsp[0].list); (yyval.privtarget) = n; } #line 34747 "gram_minimal.c" /* yacc.c:1646 */ break; case 1049: #line 7199 "gram_minimal.y" /* yacc.c:1646 */ { PrivTarget *n = (PrivTarget *) palloc(sizeof(PrivTarget)); n->targtype = ACL_TARGET_ALL_IN_SCHEMA; n->objtype = OBJECT_TABLE; n->objs = (yyvsp[0].list); (yyval.privtarget) = n; } #line 34759 "gram_minimal.c" /* yacc.c:1646 */ break; case 1050: #line 7207 "gram_minimal.y" /* yacc.c:1646 */ { PrivTarget *n = (PrivTarget *) palloc(sizeof(PrivTarget)); n->targtype = ACL_TARGET_ALL_IN_SCHEMA; n->objtype = OBJECT_SEQUENCE; n->objs = (yyvsp[0].list); (yyval.privtarget) = n; } #line 34771 "gram_minimal.c" /* yacc.c:1646 */ break; case 1051: #line 7215 "gram_minimal.y" /* yacc.c:1646 */ { PrivTarget *n = (PrivTarget *) palloc(sizeof(PrivTarget)); n->targtype = ACL_TARGET_ALL_IN_SCHEMA; n->objtype = OBJECT_FUNCTION; n->objs = (yyvsp[0].list); (yyval.privtarget) = n; } #line 34783 "gram_minimal.c" /* yacc.c:1646 */ break; case 1052: #line 7223 "gram_minimal.y" /* yacc.c:1646 */ { PrivTarget *n = (PrivTarget *) palloc(sizeof(PrivTarget)); n->targtype = ACL_TARGET_ALL_IN_SCHEMA; n->objtype = OBJECT_PROCEDURE; n->objs = (yyvsp[0].list); (yyval.privtarget) = n; } #line 34795 "gram_minimal.c" /* yacc.c:1646 */ break; case 1053: #line 7231 "gram_minimal.y" /* yacc.c:1646 */ { PrivTarget *n = (PrivTarget *) palloc(sizeof(PrivTarget)); n->targtype = ACL_TARGET_ALL_IN_SCHEMA; n->objtype = OBJECT_ROUTINE; n->objs = (yyvsp[0].list); (yyval.privtarget) = n; } #line 34807 "gram_minimal.c" /* yacc.c:1646 */ break; case 1054: #line 7242 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].rolespec)); } #line 34813 "gram_minimal.c" /* yacc.c:1646 */ break; case 1055: #line 7243 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].rolespec)); } #line 34819 "gram_minimal.c" /* yacc.c:1646 */ break; case 1056: #line 7247 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.rolespec) = (yyvsp[0].rolespec); } #line 34825 "gram_minimal.c" /* yacc.c:1646 */ break; case 1057: #line 7248 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.rolespec) = (yyvsp[0].rolespec); } #line 34831 "gram_minimal.c" /* yacc.c:1646 */ break; case 1058: #line 7253 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.boolean) = true; } #line 34837 "gram_minimal.c" /* yacc.c:1646 */ break; case 1059: #line 7254 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.boolean) = false; } #line 34843 "gram_minimal.c" /* yacc.c:1646 */ break; case 1060: #line 7265 "gram_minimal.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].rolespec); (yyval.node) = (Node*)n; } #line 34857 "gram_minimal.c" /* yacc.c:1646 */ break; case 1061: #line 7278 "gram_minimal.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 34871 "gram_minimal.c" /* yacc.c:1646 */ break; case 1062: #line 7288 "gram_minimal.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 34885 "gram_minimal.c" /* yacc.c:1646 */ break; case 1063: #line 7299 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.boolean) = true; } #line 34891 "gram_minimal.c" /* yacc.c:1646 */ break; case 1064: #line 7300 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.boolean) = false; } #line 34897 "gram_minimal.c" /* yacc.c:1646 */ break; case 1065: #line 7303 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.rolespec) = (yyvsp[0].rolespec); } #line 34903 "gram_minimal.c" /* yacc.c:1646 */ break; case 1066: #line 7304 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.rolespec) = NULL; } #line 34909 "gram_minimal.c" /* yacc.c:1646 */ break; case 1067: #line 7315 "gram_minimal.y" /* yacc.c:1646 */ { AlterDefaultPrivilegesStmt *n = makeNode(AlterDefaultPrivilegesStmt); n->options = (yyvsp[-1].list); n->action = (GrantStmt *) (yyvsp[0].node); (yyval.node) = (Node*)n; } #line 34920 "gram_minimal.c" /* yacc.c:1646 */ break; case 1068: #line 7324 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-1].list), (yyvsp[0].defelt)); } #line 34926 "gram_minimal.c" /* yacc.c:1646 */ break; case 1069: #line 7325 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 34932 "gram_minimal.c" /* yacc.c:1646 */ break; case 1070: #line 7330 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("schemas", (Node *)(yyvsp[0].list), (yylsp[-2])); } #line 34940 "gram_minimal.c" /* yacc.c:1646 */ break; case 1071: #line 7334 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("roles", (Node *)(yyvsp[0].list), (yylsp[-2])); } #line 34948 "gram_minimal.c" /* yacc.c:1646 */ break; case 1072: #line 7338 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("roles", (Node *)(yyvsp[0].list), (yylsp[-2])); } #line 34956 "gram_minimal.c" /* yacc.c:1646 */ break; case 1073: #line 7350 "gram_minimal.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 34972 "gram_minimal.c" /* yacc.c:1646 */ break; case 1074: #line 7363 "gram_minimal.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 34989 "gram_minimal.c" /* yacc.c:1646 */ break; case 1075: #line 7377 "gram_minimal.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 35006 "gram_minimal.c" /* yacc.c:1646 */ break; case 1076: #line 7392 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = OBJECT_TABLE; } #line 35012 "gram_minimal.c" /* yacc.c:1646 */ break; case 1077: #line 7393 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = OBJECT_FUNCTION; } #line 35018 "gram_minimal.c" /* yacc.c:1646 */ break; case 1078: #line 7394 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = OBJECT_FUNCTION; } #line 35024 "gram_minimal.c" /* yacc.c:1646 */ break; case 1079: #line 7395 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = OBJECT_SEQUENCE; } #line 35030 "gram_minimal.c" /* yacc.c:1646 */ break; case 1080: #line 7396 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = OBJECT_TYPE; } #line 35036 "gram_minimal.c" /* yacc.c:1646 */ break; case 1081: #line 7397 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = OBJECT_SCHEMA; } #line 35042 "gram_minimal.c" /* yacc.c:1646 */ break; case 1082: #line 7412 "gram_minimal.y" /* yacc.c:1646 */ { IndexStmt *n = makeNode(IndexStmt); n->unique = (yyvsp[-13].boolean); n->concurrent = (yyvsp[-11].boolean); n->idxname = (yyvsp[-10].str); n->relation = (yyvsp[-8].range); n->accessMethod = (yyvsp[-7].str); n->indexParams = (yyvsp[-5].list); n->indexIncludingParams = (yyvsp[-3].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; n->transformed = false; n->if_not_exists = false; n->reset_default_tblspc = false; (yyval.node) = (Node *)n; } #line 35072 "gram_minimal.c" /* yacc.c:1646 */ break; case 1083: #line 7440 "gram_minimal.y" /* yacc.c:1646 */ { IndexStmt *n = makeNode(IndexStmt); n->unique = (yyvsp[-16].boolean); n->concurrent = (yyvsp[-14].boolean); n->idxname = (yyvsp[-10].str); n->relation = (yyvsp[-8].range); n->accessMethod = (yyvsp[-7].str); n->indexParams = (yyvsp[-5].list); n->indexIncludingParams = (yyvsp[-3].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; n->transformed = false; n->if_not_exists = true; n->reset_default_tblspc = false; (yyval.node) = (Node *)n; } #line 35102 "gram_minimal.c" /* yacc.c:1646 */ break; case 1084: #line 7468 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.boolean) = true; } #line 35108 "gram_minimal.c" /* yacc.c:1646 */ break; case 1085: #line 7469 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.boolean) = false; } #line 35114 "gram_minimal.c" /* yacc.c:1646 */ break; case 1086: #line 7473 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.boolean) = true; } #line 35120 "gram_minimal.c" /* yacc.c:1646 */ break; case 1087: #line 7474 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.boolean) = false; } #line 35126 "gram_minimal.c" /* yacc.c:1646 */ break; case 1088: #line 7478 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 35132 "gram_minimal.c" /* yacc.c:1646 */ break; case 1089: #line 7479 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = NULL; } #line 35138 "gram_minimal.c" /* yacc.c:1646 */ break; case 1090: #line 7483 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 35144 "gram_minimal.c" /* yacc.c:1646 */ break; case 1091: #line 7484 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = DEFAULT_INDEX_TYPE; } #line 35150 "gram_minimal.c" /* yacc.c:1646 */ break; case 1092: #line 7487 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].ielem)); } #line 35156 "gram_minimal.c" /* yacc.c:1646 */ break; case 1093: #line 7488 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].ielem)); } #line 35162 "gram_minimal.c" /* yacc.c:1646 */ break; case 1094: #line 7497 "gram_minimal.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 35177 "gram_minimal.c" /* yacc.c:1646 */ break; case 1095: #line 7508 "gram_minimal.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 35192 "gram_minimal.c" /* yacc.c:1646 */ break; case 1096: #line 7519 "gram_minimal.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 35207 "gram_minimal.c" /* yacc.c:1646 */ break; case 1097: #line 7531 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[-1].list); } #line 35213 "gram_minimal.c" /* yacc.c:1646 */ break; case 1098: #line 7532 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 35219 "gram_minimal.c" /* yacc.c:1646 */ break; case 1099: #line 7535 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].ielem)); } #line 35225 "gram_minimal.c" /* yacc.c:1646 */ break; case 1100: #line 7536 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].ielem)); } #line 35231 "gram_minimal.c" /* yacc.c:1646 */ break; case 1101: #line 7539 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 35237 "gram_minimal.c" /* yacc.c:1646 */ break; case 1102: #line 7540 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 35243 "gram_minimal.c" /* yacc.c:1646 */ break; case 1103: #line 7543 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 35249 "gram_minimal.c" /* yacc.c:1646 */ break; case 1104: #line 7544 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 35255 "gram_minimal.c" /* yacc.c:1646 */ break; case 1105: #line 7547 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = SORTBY_ASC; } #line 35261 "gram_minimal.c" /* yacc.c:1646 */ break; case 1106: #line 7548 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = SORTBY_DESC; } #line 35267 "gram_minimal.c" /* yacc.c:1646 */ break; case 1107: #line 7549 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = SORTBY_DEFAULT; } #line 35273 "gram_minimal.c" /* yacc.c:1646 */ break; case 1108: #line 7552 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = SORTBY_NULLS_FIRST; } #line 35279 "gram_minimal.c" /* yacc.c:1646 */ break; case 1109: #line 7553 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = SORTBY_NULLS_LAST; } #line 35285 "gram_minimal.c" /* yacc.c:1646 */ break; case 1110: #line 7554 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = SORTBY_NULLS_DEFAULT; } #line 35291 "gram_minimal.c" /* yacc.c:1646 */ break; case 1111: #line 7572 "gram_minimal.y" /* yacc.c:1646 */ { CreateFunctionStmt *n = makeNode(CreateFunctionStmt); n->is_procedure = false; n->replace = (yyvsp[-6].boolean); n->funcname = (yyvsp[-4].list); n->parameters = (yyvsp[-3].list); n->returnType = (yyvsp[-1].typnam); n->options = (yyvsp[0].list); (yyval.node) = (Node *)n; } #line 35306 "gram_minimal.c" /* yacc.c:1646 */ break; case 1112: #line 7584 "gram_minimal.y" /* yacc.c:1646 */ { CreateFunctionStmt *n = makeNode(CreateFunctionStmt); n->is_procedure = false; n->replace = (yyvsp[-9].boolean); n->funcname = (yyvsp[-7].list); n->parameters = mergeTableFuncParameters((yyvsp[-6].list), (yyvsp[-2].list)); n->returnType = TableFuncTypeName((yyvsp[-2].list)); n->returnType->location = (yylsp[-4]); n->options = (yyvsp[0].list); (yyval.node) = (Node *)n; } #line 35322 "gram_minimal.c" /* yacc.c:1646 */ break; case 1113: #line 7597 "gram_minimal.y" /* yacc.c:1646 */ { CreateFunctionStmt *n = makeNode(CreateFunctionStmt); n->is_procedure = false; n->replace = (yyvsp[-4].boolean); n->funcname = (yyvsp[-2].list); n->parameters = (yyvsp[-1].list); n->returnType = NULL; n->options = (yyvsp[0].list); (yyval.node) = (Node *)n; } #line 35337 "gram_minimal.c" /* yacc.c:1646 */ break; case 1114: #line 7609 "gram_minimal.y" /* yacc.c:1646 */ { CreateFunctionStmt *n = makeNode(CreateFunctionStmt); n->is_procedure = true; n->replace = (yyvsp[-4].boolean); n->funcname = (yyvsp[-2].list); n->parameters = (yyvsp[-1].list); n->returnType = NULL; n->options = (yyvsp[0].list); (yyval.node) = (Node *)n; } #line 35352 "gram_minimal.c" /* yacc.c:1646 */ break; case 1115: #line 7622 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.boolean) = true; } #line 35358 "gram_minimal.c" /* yacc.c:1646 */ break; case 1116: #line 7623 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.boolean) = false; } #line 35364 "gram_minimal.c" /* yacc.c:1646 */ break; case 1117: #line 7626 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[-1].list); } #line 35370 "gram_minimal.c" /* yacc.c:1646 */ break; case 1118: #line 7627 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 35376 "gram_minimal.c" /* yacc.c:1646 */ break; case 1119: #line 7631 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].fun_param)); } #line 35382 "gram_minimal.c" /* yacc.c:1646 */ break; case 1120: #line 7632 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].fun_param)); } #line 35388 "gram_minimal.c" /* yacc.c:1646 */ break; case 1121: #line 7636 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].objwithargs)); } #line 35394 "gram_minimal.c" /* yacc.c:1646 */ break; case 1122: #line 7638 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].objwithargs)); } #line 35400 "gram_minimal.c" /* yacc.c:1646 */ break; case 1123: #line 7643 "gram_minimal.y" /* yacc.c:1646 */ { ObjectWithArgs *n = makeNode(ObjectWithArgs); n->objname = (yyvsp[-1].list); n->objargs = extractArgTypes((yyvsp[0].list)); (yyval.objwithargs) = n; } #line 35411 "gram_minimal.c" /* yacc.c:1646 */ break; case 1124: #line 7655 "gram_minimal.y" /* yacc.c:1646 */ { ObjectWithArgs *n = makeNode(ObjectWithArgs); n->objname = list_make1(makeString(pstrdup((yyvsp[0].keyword)))); n->args_unspecified = true; (yyval.objwithargs) = n; } #line 35422 "gram_minimal.c" /* yacc.c:1646 */ break; case 1125: #line 7662 "gram_minimal.y" /* yacc.c:1646 */ { ObjectWithArgs *n = makeNode(ObjectWithArgs); n->objname = list_make1(makeString((yyvsp[0].str))); n->args_unspecified = true; (yyval.objwithargs) = n; } #line 35433 "gram_minimal.c" /* yacc.c:1646 */ break; case 1126: #line 7669 "gram_minimal.y" /* yacc.c:1646 */ { ObjectWithArgs *n = makeNode(ObjectWithArgs); n->objname = check_func_name(lcons(makeString((yyvsp[-1].str)), (yyvsp[0].list)), yyscanner); n->args_unspecified = true; (yyval.objwithargs) = n; } #line 35445 "gram_minimal.c" /* yacc.c:1646 */ break; case 1127: #line 7683 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[-1].list); } #line 35451 "gram_minimal.c" /* yacc.c:1646 */ break; case 1128: #line 7684 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 35457 "gram_minimal.c" /* yacc.c:1646 */ break; case 1129: #line 7688 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].fun_param)); } #line 35463 "gram_minimal.c" /* yacc.c:1646 */ break; case 1130: #line 7690 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].fun_param)); } #line 35469 "gram_minimal.c" /* yacc.c:1646 */ break; case 1131: #line 7705 "gram_minimal.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 35482 "gram_minimal.c" /* yacc.c:1646 */ break; case 1132: #line 7714 "gram_minimal.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 35495 "gram_minimal.c" /* yacc.c:1646 */ break; case 1133: #line 7723 "gram_minimal.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 35508 "gram_minimal.c" /* yacc.c:1646 */ break; case 1134: #line 7732 "gram_minimal.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 35521 "gram_minimal.c" /* yacc.c:1646 */ break; case 1135: #line 7741 "gram_minimal.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 35534 "gram_minimal.c" /* yacc.c:1646 */ break; case 1136: #line 7752 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.fun_param_mode) = FUNC_PARAM_IN; } #line 35540 "gram_minimal.c" /* yacc.c:1646 */ break; case 1137: #line 7753 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.fun_param_mode) = FUNC_PARAM_OUT; } #line 35546 "gram_minimal.c" /* yacc.c:1646 */ break; case 1138: #line 7754 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.fun_param_mode) = FUNC_PARAM_INOUT; } #line 35552 "gram_minimal.c" /* yacc.c:1646 */ break; case 1139: #line 7755 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.fun_param_mode) = FUNC_PARAM_INOUT; } #line 35558 "gram_minimal.c" /* yacc.c:1646 */ break; case 1140: #line 7756 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.fun_param_mode) = FUNC_PARAM_VARIADIC; } #line 35564 "gram_minimal.c" /* yacc.c:1646 */ break; case 1142: #line 7767 "gram_minimal.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 35576 "gram_minimal.c" /* yacc.c:1646 */ break; case 1143: #line 7781 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.typnam) = (yyvsp[0].typnam); } #line 35582 "gram_minimal.c" /* yacc.c:1646 */ break; case 1144: #line 7783 "gram_minimal.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 35592 "gram_minimal.c" /* yacc.c:1646 */ break; case 1145: #line 7789 "gram_minimal.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 35603 "gram_minimal.c" /* yacc.c:1646 */ break; case 1146: #line 7799 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.fun_param) = (yyvsp[0].fun_param); } #line 35611 "gram_minimal.c" /* yacc.c:1646 */ break; case 1147: #line 7803 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.fun_param) = (yyvsp[-2].fun_param); (yyval.fun_param)->defexpr = (yyvsp[0].node); } #line 35620 "gram_minimal.c" /* yacc.c:1646 */ break; case 1148: #line 7808 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.fun_param) = (yyvsp[-2].fun_param); (yyval.fun_param)->defexpr = (yyvsp[0].node); } #line 35629 "gram_minimal.c" /* yacc.c:1646 */ break; case 1149: #line 7816 "gram_minimal.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 35643 "gram_minimal.c" /* yacc.c:1646 */ break; case 1150: #line 7857 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make2(NIL, makeInteger(-1)); } #line 35651 "gram_minimal.c" /* yacc.c:1646 */ break; case 1151: #line 7861 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make2((yyvsp[-1].list), makeInteger(-1)); } #line 35659 "gram_minimal.c" /* yacc.c:1646 */ break; case 1152: #line 7865 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make2((yyvsp[-1].list), makeInteger(0)); } #line 35667 "gram_minimal.c" /* yacc.c:1646 */ break; case 1153: #line 7869 "gram_minimal.y" /* yacc.c:1646 */ { /* this is the only case requiring consistency checking */ (yyval.list) = makeOrderedSetArgs((yyvsp[-4].list), (yyvsp[-1].list), yyscanner); } #line 35676 "gram_minimal.c" /* yacc.c:1646 */ break; case 1154: #line 7876 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].fun_param)); } #line 35682 "gram_minimal.c" /* yacc.c:1646 */ break; case 1155: #line 7877 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].fun_param)); } #line 35688 "gram_minimal.c" /* yacc.c:1646 */ break; case 1156: #line 7882 "gram_minimal.y" /* yacc.c:1646 */ { ObjectWithArgs *n = makeNode(ObjectWithArgs); n->objname = (yyvsp[-1].list); n->objargs = extractAggrArgTypes((yyvsp[0].list)); (yyval.objwithargs) = n; } #line 35699 "gram_minimal.c" /* yacc.c:1646 */ break; case 1157: #line 7891 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].objwithargs)); } #line 35705 "gram_minimal.c" /* yacc.c:1646 */ break; case 1158: #line 7893 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].objwithargs)); } #line 35711 "gram_minimal.c" /* yacc.c:1646 */ break; case 1159: #line 7898 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].defelt)); } #line 35717 "gram_minimal.c" /* yacc.c:1646 */ break; case 1160: #line 7899 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-1].list), (yyvsp[0].defelt)); } #line 35723 "gram_minimal.c" /* yacc.c:1646 */ break; case 1161: #line 7907 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("strict", (Node *)makeInteger(false), (yylsp[-3])); } #line 35731 "gram_minimal.c" /* yacc.c:1646 */ break; case 1162: #line 7911 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("strict", (Node *)makeInteger(true), (yylsp[-4])); } #line 35739 "gram_minimal.c" /* yacc.c:1646 */ break; case 1163: #line 7915 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("strict", (Node *)makeInteger(true), (yylsp[0])); } #line 35747 "gram_minimal.c" /* yacc.c:1646 */ break; case 1164: #line 7919 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("volatility", (Node *)makeString("immutable"), (yylsp[0])); } #line 35755 "gram_minimal.c" /* yacc.c:1646 */ break; case 1165: #line 7923 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("volatility", (Node *)makeString("stable"), (yylsp[0])); } #line 35763 "gram_minimal.c" /* yacc.c:1646 */ break; case 1166: #line 7927 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("volatility", (Node *)makeString("volatile"), (yylsp[0])); } #line 35771 "gram_minimal.c" /* yacc.c:1646 */ break; case 1167: #line 7931 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("security", (Node *)makeInteger(true), (yylsp[-2])); } #line 35779 "gram_minimal.c" /* yacc.c:1646 */ break; case 1168: #line 7935 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("security", (Node *)makeInteger(false), (yylsp[-2])); } #line 35787 "gram_minimal.c" /* yacc.c:1646 */ break; case 1169: #line 7939 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("security", (Node *)makeInteger(true), (yylsp[-1])); } #line 35795 "gram_minimal.c" /* yacc.c:1646 */ break; case 1170: #line 7943 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("security", (Node *)makeInteger(false), (yylsp[-1])); } #line 35803 "gram_minimal.c" /* yacc.c:1646 */ break; case 1171: #line 7947 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("leakproof", (Node *)makeInteger(true), (yylsp[0])); } #line 35811 "gram_minimal.c" /* yacc.c:1646 */ break; case 1172: #line 7951 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("leakproof", (Node *)makeInteger(false), (yylsp[-1])); } #line 35819 "gram_minimal.c" /* yacc.c:1646 */ break; case 1173: #line 7955 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("cost", (Node *)(yyvsp[0].value), (yylsp[-1])); } #line 35827 "gram_minimal.c" /* yacc.c:1646 */ break; case 1174: #line 7959 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("rows", (Node *)(yyvsp[0].value), (yylsp[-1])); } #line 35835 "gram_minimal.c" /* yacc.c:1646 */ break; case 1175: #line 7963 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("support", (Node *)(yyvsp[0].list), (yylsp[-1])); } #line 35843 "gram_minimal.c" /* yacc.c:1646 */ break; case 1176: #line 7967 "gram_minimal.y" /* yacc.c:1646 */ { /* we abuse the normal content of a DefElem here */ (yyval.defelt) = makeDefElem("set", (Node *)(yyvsp[0].vsetstmt), (yylsp[0])); } #line 35852 "gram_minimal.c" /* yacc.c:1646 */ break; case 1177: #line 7972 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("parallel", (Node *)makeString((yyvsp[0].str)), (yylsp[-1])); } #line 35860 "gram_minimal.c" /* yacc.c:1646 */ break; case 1178: #line 7979 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("as", (Node *)(yyvsp[0].list), (yylsp[-1])); } #line 35868 "gram_minimal.c" /* yacc.c:1646 */ break; case 1179: #line 7983 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("language", (Node *)makeString((yyvsp[0].str)), (yylsp[-1])); } #line 35876 "gram_minimal.c" /* yacc.c:1646 */ break; case 1180: #line 7987 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("transform", (Node *)(yyvsp[0].list), (yylsp[-1])); } #line 35884 "gram_minimal.c" /* yacc.c:1646 */ break; case 1181: #line 7991 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("window", (Node *)makeInteger(true), (yylsp[0])); } #line 35892 "gram_minimal.c" /* yacc.c:1646 */ break; case 1182: #line 7995 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = (yyvsp[0].defelt); } #line 35900 "gram_minimal.c" /* yacc.c:1646 */ break; case 1183: #line 8000 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1(makeString((yyvsp[0].str))); } #line 35906 "gram_minimal.c" /* yacc.c:1646 */ break; case 1184: #line 8002 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make2(makeString((yyvsp[-2].str)), makeString((yyvsp[0].str))); } #line 35914 "gram_minimal.c" /* yacc.c:1646 */ break; case 1185: #line 8008 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].typnam)); } #line 35920 "gram_minimal.c" /* yacc.c:1646 */ break; case 1186: #line 8009 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-4].list), (yyvsp[0].typnam)); } #line 35926 "gram_minimal.c" /* yacc.c:1646 */ break; case 1187: #line 8013 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 35932 "gram_minimal.c" /* yacc.c:1646 */ break; case 1188: #line 8014 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 35938 "gram_minimal.c" /* yacc.c:1646 */ break; case 1189: #line 8018 "gram_minimal.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 35951 "gram_minimal.c" /* yacc.c:1646 */ break; case 1190: #line 8030 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].fun_param)); } #line 35959 "gram_minimal.c" /* yacc.c:1646 */ break; case 1191: #line 8034 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].fun_param)); } #line 35967 "gram_minimal.c" /* yacc.c:1646 */ break; case 1192: #line 8049 "gram_minimal.y" /* yacc.c:1646 */ { AlterFunctionStmt *n = makeNode(AlterFunctionStmt); n->objtype = OBJECT_FUNCTION; n->func = (yyvsp[-2].objwithargs); n->actions = (yyvsp[-1].list); (yyval.node) = (Node *) n; } #line 35979 "gram_minimal.c" /* yacc.c:1646 */ break; case 1193: #line 8057 "gram_minimal.y" /* yacc.c:1646 */ { AlterFunctionStmt *n = makeNode(AlterFunctionStmt); n->objtype = OBJECT_PROCEDURE; n->func = (yyvsp[-2].objwithargs); n->actions = (yyvsp[-1].list); (yyval.node) = (Node *) n; } #line 35991 "gram_minimal.c" /* yacc.c:1646 */ break; case 1194: #line 8065 "gram_minimal.y" /* yacc.c:1646 */ { AlterFunctionStmt *n = makeNode(AlterFunctionStmt); n->objtype = OBJECT_ROUTINE; n->func = (yyvsp[-2].objwithargs); n->actions = (yyvsp[-1].list); (yyval.node) = (Node *) n; } #line 36003 "gram_minimal.c" /* yacc.c:1646 */ break; case 1195: #line 8076 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].defelt)); } #line 36009 "gram_minimal.c" /* yacc.c:1646 */ break; case 1196: #line 8077 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-1].list), (yyvsp[0].defelt)); } #line 36015 "gram_minimal.c" /* yacc.c:1646 */ break; case 1199: #line 8101 "gram_minimal.y" /* yacc.c:1646 */ { DropStmt *n = makeNode(DropStmt); n->removeType = OBJECT_FUNCTION; n->objects = (yyvsp[-1].list); n->behavior = (yyvsp[0].dbehavior); n->missing_ok = false; n->concurrent = false; (yyval.node) = (Node *)n; } #line 36029 "gram_minimal.c" /* yacc.c:1646 */ break; case 1200: #line 8111 "gram_minimal.y" /* yacc.c:1646 */ { DropStmt *n = makeNode(DropStmt); n->removeType = OBJECT_FUNCTION; n->objects = (yyvsp[-1].list); n->behavior = (yyvsp[0].dbehavior); n->missing_ok = true; n->concurrent = false; (yyval.node) = (Node *)n; } #line 36043 "gram_minimal.c" /* yacc.c:1646 */ break; case 1201: #line 8121 "gram_minimal.y" /* yacc.c:1646 */ { DropStmt *n = makeNode(DropStmt); n->removeType = OBJECT_PROCEDURE; n->objects = (yyvsp[-1].list); n->behavior = (yyvsp[0].dbehavior); n->missing_ok = false; n->concurrent = false; (yyval.node) = (Node *)n; } #line 36057 "gram_minimal.c" /* yacc.c:1646 */ break; case 1202: #line 8131 "gram_minimal.y" /* yacc.c:1646 */ { DropStmt *n = makeNode(DropStmt); n->removeType = OBJECT_PROCEDURE; n->objects = (yyvsp[-1].list); n->behavior = (yyvsp[0].dbehavior); n->missing_ok = true; n->concurrent = false; (yyval.node) = (Node *)n; } #line 36071 "gram_minimal.c" /* yacc.c:1646 */ break; case 1203: #line 8141 "gram_minimal.y" /* yacc.c:1646 */ { DropStmt *n = makeNode(DropStmt); n->removeType = OBJECT_ROUTINE; n->objects = (yyvsp[-1].list); n->behavior = (yyvsp[0].dbehavior); n->missing_ok = false; n->concurrent = false; (yyval.node) = (Node *)n; } #line 36085 "gram_minimal.c" /* yacc.c:1646 */ break; case 1204: #line 8151 "gram_minimal.y" /* yacc.c:1646 */ { DropStmt *n = makeNode(DropStmt); n->removeType = OBJECT_ROUTINE; n->objects = (yyvsp[-1].list); n->behavior = (yyvsp[0].dbehavior); n->missing_ok = true; n->concurrent = false; (yyval.node) = (Node *)n; } #line 36099 "gram_minimal.c" /* yacc.c:1646 */ break; case 1205: #line 8164 "gram_minimal.y" /* yacc.c:1646 */ { DropStmt *n = makeNode(DropStmt); n->removeType = OBJECT_AGGREGATE; n->objects = (yyvsp[-1].list); n->behavior = (yyvsp[0].dbehavior); n->missing_ok = false; n->concurrent = false; (yyval.node) = (Node *)n; } #line 36113 "gram_minimal.c" /* yacc.c:1646 */ break; case 1206: #line 8174 "gram_minimal.y" /* yacc.c:1646 */ { DropStmt *n = makeNode(DropStmt); n->removeType = OBJECT_AGGREGATE; n->objects = (yyvsp[-1].list); n->behavior = (yyvsp[0].dbehavior); n->missing_ok = true; n->concurrent = false; (yyval.node) = (Node *)n; } #line 36127 "gram_minimal.c" /* yacc.c:1646 */ break; case 1207: #line 8187 "gram_minimal.y" /* yacc.c:1646 */ { DropStmt *n = makeNode(DropStmt); n->removeType = OBJECT_OPERATOR; n->objects = (yyvsp[-1].list); n->behavior = (yyvsp[0].dbehavior); n->missing_ok = false; n->concurrent = false; (yyval.node) = (Node *)n; } #line 36141 "gram_minimal.c" /* yacc.c:1646 */ break; case 1208: #line 8197 "gram_minimal.y" /* yacc.c:1646 */ { DropStmt *n = makeNode(DropStmt); n->removeType = OBJECT_OPERATOR; n->objects = (yyvsp[-1].list); n->behavior = (yyvsp[0].dbehavior); n->missing_ok = true; n->concurrent = false; (yyval.node) = (Node *)n; } #line 36155 "gram_minimal.c" /* yacc.c:1646 */ break; case 1209: #line 8210 "gram_minimal.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 36167 "gram_minimal.c" /* yacc.c:1646 */ break; case 1210: #line 8218 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make2((yyvsp[-3].typnam), (yyvsp[-1].typnam)); } #line 36173 "gram_minimal.c" /* yacc.c:1646 */ break; case 1211: #line 8220 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make2(NULL, (yyvsp[-1].typnam)); } #line 36179 "gram_minimal.c" /* yacc.c:1646 */ break; case 1212: #line 8222 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make2((yyvsp[-3].typnam), NULL); } #line 36185 "gram_minimal.c" /* yacc.c:1646 */ break; case 1213: #line 8227 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1(makeString((yyvsp[0].str))); } #line 36191 "gram_minimal.c" /* yacc.c:1646 */ break; case 1214: #line 8229 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = lcons(makeString((yyvsp[-2].str)), (yyvsp[0].list)); } #line 36197 "gram_minimal.c" /* yacc.c:1646 */ break; case 1215: #line 8233 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].objwithargs)); } #line 36203 "gram_minimal.c" /* yacc.c:1646 */ break; case 1216: #line 8235 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].objwithargs)); } #line 36209 "gram_minimal.c" /* yacc.c:1646 */ break; case 1217: #line 8240 "gram_minimal.y" /* yacc.c:1646 */ { ObjectWithArgs *n = makeNode(ObjectWithArgs); n->objname = (yyvsp[-1].list); n->objargs = (yyvsp[0].list); (yyval.objwithargs) = n; } #line 36220 "gram_minimal.c" /* yacc.c:1646 */ break; case 1218: #line 8258 "gram_minimal.y" /* yacc.c:1646 */ { DoStmt *n = makeNode(DoStmt); n->args = (yyvsp[0].list); (yyval.node) = (Node *)n; } #line 36230 "gram_minimal.c" /* yacc.c:1646 */ break; case 1219: #line 8266 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].defelt)); } #line 36236 "gram_minimal.c" /* yacc.c:1646 */ break; case 1220: #line 8267 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-1].list), (yyvsp[0].defelt)); } #line 36242 "gram_minimal.c" /* yacc.c:1646 */ break; case 1221: #line 8272 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("as", (Node *)makeString((yyvsp[0].str)), (yylsp[0])); } #line 36250 "gram_minimal.c" /* yacc.c:1646 */ break; case 1222: #line 8276 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("language", (Node *)makeString((yyvsp[0].str)), (yylsp[-1])); } #line 36258 "gram_minimal.c" /* yacc.c:1646 */ break; case 1223: #line 8289 "gram_minimal.y" /* yacc.c:1646 */ { CreateCastStmt *n = makeNode(CreateCastStmt); n->sourcetype = (yyvsp[-7].typnam); n->targettype = (yyvsp[-5].typnam); n->func = (yyvsp[-1].objwithargs); n->context = (CoercionContext) (yyvsp[0].ival); n->inout = false; (yyval.node) = (Node *)n; } #line 36272 "gram_minimal.c" /* yacc.c:1646 */ break; case 1224: #line 8300 "gram_minimal.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 36286 "gram_minimal.c" /* yacc.c:1646 */ break; case 1225: #line 8311 "gram_minimal.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 36300 "gram_minimal.c" /* yacc.c:1646 */ break; case 1226: #line 8322 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = COERCION_IMPLICIT; } #line 36306 "gram_minimal.c" /* yacc.c:1646 */ break; case 1227: #line 8323 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = COERCION_ASSIGNMENT; } #line 36312 "gram_minimal.c" /* yacc.c:1646 */ break; case 1228: #line 8324 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = COERCION_EXPLICIT; } #line 36318 "gram_minimal.c" /* yacc.c:1646 */ break; case 1229: #line 8329 "gram_minimal.y" /* yacc.c:1646 */ { DropStmt *n = makeNode(DropStmt); n->removeType = OBJECT_CAST; n->objects = list_make1(list_make2((yyvsp[-4].typnam), (yyvsp[-2].typnam))); n->behavior = (yyvsp[0].dbehavior); n->missing_ok = (yyvsp[-6].boolean); n->concurrent = false; (yyval.node) = (Node *)n; } #line 36332 "gram_minimal.c" /* yacc.c:1646 */ break; case 1230: #line 8340 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.boolean) = true; } #line 36338 "gram_minimal.c" /* yacc.c:1646 */ break; case 1231: #line 8341 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.boolean) = false; } #line 36344 "gram_minimal.c" /* yacc.c:1646 */ break; case 1232: #line 8352 "gram_minimal.y" /* yacc.c:1646 */ { CreateTransformStmt *n = makeNode(CreateTransformStmt); n->replace = (yyvsp[-8].boolean); n->type_name = (yyvsp[-5].typnam); n->lang = (yyvsp[-3].str); n->fromsql = linitial((yyvsp[-1].list)); n->tosql = lsecond((yyvsp[-1].list)); (yyval.node) = (Node *)n; } #line 36358 "gram_minimal.c" /* yacc.c:1646 */ break; case 1233: #line 8364 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make2((yyvsp[-6].objwithargs), (yyvsp[0].objwithargs)); } #line 36366 "gram_minimal.c" /* yacc.c:1646 */ break; case 1234: #line 8368 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make2((yyvsp[0].objwithargs), (yyvsp[-6].objwithargs)); } #line 36374 "gram_minimal.c" /* yacc.c:1646 */ break; case 1235: #line 8372 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make2((yyvsp[0].objwithargs), NULL); } #line 36382 "gram_minimal.c" /* yacc.c:1646 */ break; case 1236: #line 8376 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make2(NULL, (yyvsp[0].objwithargs)); } #line 36390 "gram_minimal.c" /* yacc.c:1646 */ break; case 1237: #line 8383 "gram_minimal.y" /* yacc.c:1646 */ { DropStmt *n = makeNode(DropStmt); n->removeType = OBJECT_TRANSFORM; n->objects = list_make1(list_make2((yyvsp[-3].typnam), makeString((yyvsp[-1].str)))); n->behavior = (yyvsp[0].dbehavior); n->missing_ok = (yyvsp[-5].boolean); (yyval.node) = (Node *)n; } #line 36403 "gram_minimal.c" /* yacc.c:1646 */ break; case 1238: #line 8403 "gram_minimal.y" /* yacc.c:1646 */ { ReindexStmt *n = makeNode(ReindexStmt); n->kind = (yyvsp[-2].ival); n->concurrent = (yyvsp[-1].boolean); n->relation = (yyvsp[0].range); n->name = NULL; n->options = 0; (yyval.node) = (Node *)n; } #line 36417 "gram_minimal.c" /* yacc.c:1646 */ break; case 1239: #line 8413 "gram_minimal.y" /* yacc.c:1646 */ { ReindexStmt *n = makeNode(ReindexStmt); n->kind = (yyvsp[-2].ival); n->concurrent = (yyvsp[-1].boolean); n->name = (yyvsp[0].str); n->relation = NULL; n->options = 0; (yyval.node) = (Node *)n; } #line 36431 "gram_minimal.c" /* yacc.c:1646 */ break; case 1240: #line 8423 "gram_minimal.y" /* yacc.c:1646 */ { ReindexStmt *n = makeNode(ReindexStmt); n->kind = (yyvsp[-2].ival); n->concurrent = (yyvsp[-1].boolean); n->relation = (yyvsp[0].range); n->name = NULL; n->options = (yyvsp[-4].ival); (yyval.node) = (Node *)n; } #line 36445 "gram_minimal.c" /* yacc.c:1646 */ break; case 1241: #line 8433 "gram_minimal.y" /* yacc.c:1646 */ { ReindexStmt *n = makeNode(ReindexStmt); n->kind = (yyvsp[-2].ival); n->concurrent = (yyvsp[-1].boolean); n->name = (yyvsp[0].str); n->relation = NULL; n->options = (yyvsp[-4].ival); (yyval.node) = (Node *)n; } #line 36459 "gram_minimal.c" /* yacc.c:1646 */ break; case 1242: #line 8444 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = REINDEX_OBJECT_INDEX; } #line 36465 "gram_minimal.c" /* yacc.c:1646 */ break; case 1243: #line 8445 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = REINDEX_OBJECT_TABLE; } #line 36471 "gram_minimal.c" /* yacc.c:1646 */ break; case 1244: #line 8448 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = REINDEX_OBJECT_SCHEMA; } #line 36477 "gram_minimal.c" /* yacc.c:1646 */ break; case 1245: #line 8449 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = REINDEX_OBJECT_SYSTEM; } #line 36483 "gram_minimal.c" /* yacc.c:1646 */ break; case 1246: #line 8450 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = REINDEX_OBJECT_DATABASE; } #line 36489 "gram_minimal.c" /* yacc.c:1646 */ break; case 1247: #line 8453 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = (yyvsp[0].ival); } #line 36495 "gram_minimal.c" /* yacc.c:1646 */ break; case 1248: #line 8454 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = (yyvsp[-2].ival) | (yyvsp[0].ival); } #line 36501 "gram_minimal.c" /* yacc.c:1646 */ break; case 1249: #line 8457 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = REINDEXOPT_VERBOSE; } #line 36507 "gram_minimal.c" /* yacc.c:1646 */ break; case 1250: #line 8468 "gram_minimal.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 36520 "gram_minimal.c" /* yacc.c:1646 */ break; case 1251: #line 8477 "gram_minimal.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 36533 "gram_minimal.c" /* yacc.c:1646 */ break; case 1252: #line 8494 "gram_minimal.y" /* yacc.c:1646 */ { RenameStmt *n = makeNode(RenameStmt); n->renameType = OBJECT_AGGREGATE; n->object = (Node *) (yyvsp[-3].objwithargs); n->newname = (yyvsp[0].str); n->missing_ok = false; (yyval.node) = (Node *)n; } #line 36546 "gram_minimal.c" /* yacc.c:1646 */ break; case 1253: #line 8503 "gram_minimal.y" /* yacc.c:1646 */ { RenameStmt *n = makeNode(RenameStmt); n->renameType = OBJECT_COLLATION; n->object = (Node *) (yyvsp[-3].list); n->newname = (yyvsp[0].str); n->missing_ok = false; (yyval.node) = (Node *)n; } #line 36559 "gram_minimal.c" /* yacc.c:1646 */ break; case 1254: #line 8512 "gram_minimal.y" /* yacc.c:1646 */ { RenameStmt *n = makeNode(RenameStmt); n->renameType = OBJECT_CONVERSION; n->object = (Node *) (yyvsp[-3].list); n->newname = (yyvsp[0].str); n->missing_ok = false; (yyval.node) = (Node *)n; } #line 36572 "gram_minimal.c" /* yacc.c:1646 */ break; case 1255: #line 8521 "gram_minimal.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 36585 "gram_minimal.c" /* yacc.c:1646 */ break; case 1256: #line 8530 "gram_minimal.y" /* yacc.c:1646 */ { RenameStmt *n = makeNode(RenameStmt); n->renameType = OBJECT_DOMAIN; n->object = (Node *) (yyvsp[-3].list); n->newname = (yyvsp[0].str); n->missing_ok = false; (yyval.node) = (Node *)n; } #line 36598 "gram_minimal.c" /* yacc.c:1646 */ break; case 1257: #line 8539 "gram_minimal.y" /* yacc.c:1646 */ { RenameStmt *n = makeNode(RenameStmt); n->renameType = OBJECT_DOMCONSTRAINT; n->object = (Node *) (yyvsp[-5].list); n->subname = (yyvsp[-2].str); n->newname = (yyvsp[0].str); (yyval.node) = (Node *)n; } #line 36611 "gram_minimal.c" /* yacc.c:1646 */ break; case 1258: #line 8548 "gram_minimal.y" /* yacc.c:1646 */ { RenameStmt *n = makeNode(RenameStmt); n->renameType = OBJECT_FDW; n->object = (Node *) makeString((yyvsp[-3].str)); n->newname = (yyvsp[0].str); n->missing_ok = false; (yyval.node) = (Node *)n; } #line 36624 "gram_minimal.c" /* yacc.c:1646 */ break; case 1259: #line 8557 "gram_minimal.y" /* yacc.c:1646 */ { RenameStmt *n = makeNode(RenameStmt); n->renameType = OBJECT_FUNCTION; n->object = (Node *) (yyvsp[-3].objwithargs); n->newname = (yyvsp[0].str); n->missing_ok = false; (yyval.node) = (Node *)n; } #line 36637 "gram_minimal.c" /* yacc.c:1646 */ break; case 1260: #line 8566 "gram_minimal.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 36650 "gram_minimal.c" /* yacc.c:1646 */ break; case 1261: #line 8575 "gram_minimal.y" /* yacc.c:1646 */ { RenameStmt *n = makeNode(RenameStmt); n->renameType = OBJECT_LANGUAGE; n->object = (Node *) makeString((yyvsp[-3].str)); n->newname = (yyvsp[0].str); n->missing_ok = false; (yyval.node) = (Node *)n; } #line 36663 "gram_minimal.c" /* yacc.c:1646 */ break; case 1262: #line 8584 "gram_minimal.y" /* yacc.c:1646 */ { RenameStmt *n = makeNode(RenameStmt); n->renameType = OBJECT_OPCLASS; n->object = (Node *) lcons(makeString((yyvsp[-3].str)), (yyvsp[-5].list)); n->newname = (yyvsp[0].str); n->missing_ok = false; (yyval.node) = (Node *)n; } #line 36676 "gram_minimal.c" /* yacc.c:1646 */ break; case 1263: #line 8593 "gram_minimal.y" /* yacc.c:1646 */ { RenameStmt *n = makeNode(RenameStmt); n->renameType = OBJECT_OPFAMILY; n->object = (Node *) lcons(makeString((yyvsp[-3].str)), (yyvsp[-5].list)); n->newname = (yyvsp[0].str); n->missing_ok = false; (yyval.node) = (Node *)n; } #line 36689 "gram_minimal.c" /* yacc.c:1646 */ break; case 1264: #line 8602 "gram_minimal.y" /* yacc.c:1646 */ { RenameStmt *n = makeNode(RenameStmt); n->renameType = OBJECT_POLICY; n->relation = (yyvsp[-3].range); n->subname = (yyvsp[-5].str); n->newname = (yyvsp[0].str); n->missing_ok = false; (yyval.node) = (Node *)n; } #line 36703 "gram_minimal.c" /* yacc.c:1646 */ break; case 1265: #line 8612 "gram_minimal.y" /* yacc.c:1646 */ { RenameStmt *n = makeNode(RenameStmt); n->renameType = OBJECT_POLICY; n->relation = (yyvsp[-3].range); n->subname = (yyvsp[-5].str); n->newname = (yyvsp[0].str); n->missing_ok = true; (yyval.node) = (Node *)n; } #line 36717 "gram_minimal.c" /* yacc.c:1646 */ break; case 1266: #line 8622 "gram_minimal.y" /* yacc.c:1646 */ { RenameStmt *n = makeNode(RenameStmt); n->renameType = OBJECT_PROCEDURE; n->object = (Node *) (yyvsp[-3].objwithargs); n->newname = (yyvsp[0].str); n->missing_ok = false; (yyval.node) = (Node *)n; } #line 36730 "gram_minimal.c" /* yacc.c:1646 */ break; case 1267: #line 8631 "gram_minimal.y" /* yacc.c:1646 */ { RenameStmt *n = makeNode(RenameStmt); n->renameType = OBJECT_PUBLICATION; n->object = (Node *) makeString((yyvsp[-3].str)); n->newname = (yyvsp[0].str); n->missing_ok = false; (yyval.node) = (Node *)n; } #line 36743 "gram_minimal.c" /* yacc.c:1646 */ break; case 1268: #line 8640 "gram_minimal.y" /* yacc.c:1646 */ { RenameStmt *n = makeNode(RenameStmt); n->renameType = OBJECT_ROUTINE; n->object = (Node *) (yyvsp[-3].objwithargs); n->newname = (yyvsp[0].str); n->missing_ok = false; (yyval.node) = (Node *)n; } #line 36756 "gram_minimal.c" /* yacc.c:1646 */ break; case 1269: #line 8649 "gram_minimal.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 36769 "gram_minimal.c" /* yacc.c:1646 */ break; case 1270: #line 8658 "gram_minimal.y" /* yacc.c:1646 */ { RenameStmt *n = makeNode(RenameStmt); n->renameType = OBJECT_FOREIGN_SERVER; n->object = (Node *) makeString((yyvsp[-3].str)); n->newname = (yyvsp[0].str); n->missing_ok = false; (yyval.node) = (Node *)n; } #line 36782 "gram_minimal.c" /* yacc.c:1646 */ break; case 1271: #line 8667 "gram_minimal.y" /* yacc.c:1646 */ { RenameStmt *n = makeNode(RenameStmt); n->renameType = OBJECT_SUBSCRIPTION; n->object = (Node *) makeString((yyvsp[-3].str)); n->newname = (yyvsp[0].str); n->missing_ok = false; (yyval.node) = (Node *)n; } #line 36795 "gram_minimal.c" /* yacc.c:1646 */ break; case 1272: #line 8676 "gram_minimal.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 36809 "gram_minimal.c" /* yacc.c:1646 */ break; case 1273: #line 8686 "gram_minimal.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 36823 "gram_minimal.c" /* yacc.c:1646 */ break; case 1274: #line 8696 "gram_minimal.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 36837 "gram_minimal.c" /* yacc.c:1646 */ break; case 1275: #line 8706 "gram_minimal.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 36851 "gram_minimal.c" /* yacc.c:1646 */ break; case 1276: #line 8716 "gram_minimal.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 36865 "gram_minimal.c" /* yacc.c:1646 */ break; case 1277: #line 8726 "gram_minimal.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 36879 "gram_minimal.c" /* yacc.c:1646 */ break; case 1278: #line 8736 "gram_minimal.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 36893 "gram_minimal.c" /* yacc.c:1646 */ break; case 1279: #line 8746 "gram_minimal.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 36907 "gram_minimal.c" /* yacc.c:1646 */ break; case 1280: #line 8756 "gram_minimal.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 36921 "gram_minimal.c" /* yacc.c:1646 */ break; case 1281: #line 8766 "gram_minimal.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 36935 "gram_minimal.c" /* yacc.c:1646 */ break; case 1282: #line 8776 "gram_minimal.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 36949 "gram_minimal.c" /* yacc.c:1646 */ break; case 1283: #line 8786 "gram_minimal.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 36963 "gram_minimal.c" /* yacc.c:1646 */ break; case 1284: #line 8796 "gram_minimal.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 36978 "gram_minimal.c" /* yacc.c:1646 */ break; case 1285: #line 8807 "gram_minimal.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 36993 "gram_minimal.c" /* yacc.c:1646 */ break; case 1286: #line 8818 "gram_minimal.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 37008 "gram_minimal.c" /* yacc.c:1646 */ break; case 1287: #line 8829 "gram_minimal.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 37023 "gram_minimal.c" /* yacc.c:1646 */ break; case 1288: #line 8840 "gram_minimal.y" /* yacc.c:1646 */ { RenameStmt *n = makeNode(RenameStmt); n->renameType = OBJECT_TABCONSTRAINT; n->relation = (yyvsp[-5].range); n->subname = (yyvsp[-2].str); n->newname = (yyvsp[0].str); n->missing_ok = false; (yyval.node) = (Node *)n; } #line 37037 "gram_minimal.c" /* yacc.c:1646 */ break; case 1289: #line 8850 "gram_minimal.y" /* yacc.c:1646 */ { RenameStmt *n = makeNode(RenameStmt); n->renameType = OBJECT_TABCONSTRAINT; n->relation = (yyvsp[-5].range); n->subname = (yyvsp[-2].str); n->newname = (yyvsp[0].str); n->missing_ok = true; (yyval.node) = (Node *)n; } #line 37051 "gram_minimal.c" /* yacc.c:1646 */ break; case 1290: #line 8860 "gram_minimal.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 37066 "gram_minimal.c" /* yacc.c:1646 */ break; case 1291: #line 8871 "gram_minimal.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 37081 "gram_minimal.c" /* yacc.c:1646 */ break; case 1292: #line 8882 "gram_minimal.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 37095 "gram_minimal.c" /* yacc.c:1646 */ break; case 1293: #line 8892 "gram_minimal.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 37109 "gram_minimal.c" /* yacc.c:1646 */ break; case 1294: #line 8902 "gram_minimal.y" /* yacc.c:1646 */ { RenameStmt *n = makeNode(RenameStmt); n->renameType = OBJECT_EVENT_TRIGGER; n->object = (Node *) makeString((yyvsp[-3].str)); n->newname = (yyvsp[0].str); (yyval.node) = (Node *)n; } #line 37121 "gram_minimal.c" /* yacc.c:1646 */ break; case 1295: #line 8910 "gram_minimal.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 37134 "gram_minimal.c" /* yacc.c:1646 */ break; case 1296: #line 8919 "gram_minimal.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 37147 "gram_minimal.c" /* yacc.c:1646 */ break; case 1297: #line 8928 "gram_minimal.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 37160 "gram_minimal.c" /* yacc.c:1646 */ break; case 1298: #line 8937 "gram_minimal.y" /* yacc.c:1646 */ { RenameStmt *n = makeNode(RenameStmt); n->renameType = OBJECT_STATISTIC_EXT; n->object = (Node *) (yyvsp[-3].list); n->newname = (yyvsp[0].str); n->missing_ok = false; (yyval.node) = (Node *)n; } #line 37173 "gram_minimal.c" /* yacc.c:1646 */ break; case 1299: #line 8946 "gram_minimal.y" /* yacc.c:1646 */ { RenameStmt *n = makeNode(RenameStmt); n->renameType = OBJECT_TSPARSER; n->object = (Node *) (yyvsp[-3].list); n->newname = (yyvsp[0].str); n->missing_ok = false; (yyval.node) = (Node *)n; } #line 37186 "gram_minimal.c" /* yacc.c:1646 */ break; case 1300: #line 8955 "gram_minimal.y" /* yacc.c:1646 */ { RenameStmt *n = makeNode(RenameStmt); n->renameType = OBJECT_TSDICTIONARY; n->object = (Node *) (yyvsp[-3].list); n->newname = (yyvsp[0].str); n->missing_ok = false; (yyval.node) = (Node *)n; } #line 37199 "gram_minimal.c" /* yacc.c:1646 */ break; case 1301: #line 8964 "gram_minimal.y" /* yacc.c:1646 */ { RenameStmt *n = makeNode(RenameStmt); n->renameType = OBJECT_TSTEMPLATE; n->object = (Node *) (yyvsp[-3].list); n->newname = (yyvsp[0].str); n->missing_ok = false; (yyval.node) = (Node *)n; } #line 37212 "gram_minimal.c" /* yacc.c:1646 */ break; case 1302: #line 8973 "gram_minimal.y" /* yacc.c:1646 */ { RenameStmt *n = makeNode(RenameStmt); n->renameType = OBJECT_TSCONFIGURATION; n->object = (Node *) (yyvsp[-3].list); n->newname = (yyvsp[0].str); n->missing_ok = false; (yyval.node) = (Node *)n; } #line 37225 "gram_minimal.c" /* yacc.c:1646 */ break; case 1303: #line 8982 "gram_minimal.y" /* yacc.c:1646 */ { RenameStmt *n = makeNode(RenameStmt); n->renameType = OBJECT_TYPE; n->object = (Node *) (yyvsp[-3].list); n->newname = (yyvsp[0].str); n->missing_ok = false; (yyval.node) = (Node *)n; } #line 37238 "gram_minimal.c" /* yacc.c:1646 */ break; case 1304: #line 8991 "gram_minimal.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 37254 "gram_minimal.c" /* yacc.c:1646 */ break; case 1305: #line 9004 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = COLUMN; } #line 37260 "gram_minimal.c" /* yacc.c:1646 */ break; case 1306: #line 9005 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = 0; } #line 37266 "gram_minimal.c" /* yacc.c:1646 */ break; case 1307: #line 9008 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = 1; } #line 37272 "gram_minimal.c" /* yacc.c:1646 */ break; case 1308: #line 9009 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = 0; } #line 37278 "gram_minimal.c" /* yacc.c:1646 */ break; case 1309: #line 9020 "gram_minimal.y" /* yacc.c:1646 */ { AlterObjectDependsStmt *n = makeNode(AlterObjectDependsStmt); n->objectType = OBJECT_FUNCTION; n->object = (Node *) (yyvsp[-4].objwithargs); n->extname = makeString((yyvsp[0].str)); (yyval.node) = (Node *)n; } #line 37290 "gram_minimal.c" /* yacc.c:1646 */ break; case 1310: #line 9028 "gram_minimal.y" /* yacc.c:1646 */ { AlterObjectDependsStmt *n = makeNode(AlterObjectDependsStmt); n->objectType = OBJECT_PROCEDURE; n->object = (Node *) (yyvsp[-4].objwithargs); n->extname = makeString((yyvsp[0].str)); (yyval.node) = (Node *)n; } #line 37302 "gram_minimal.c" /* yacc.c:1646 */ break; case 1311: #line 9036 "gram_minimal.y" /* yacc.c:1646 */ { AlterObjectDependsStmt *n = makeNode(AlterObjectDependsStmt); n->objectType = OBJECT_ROUTINE; n->object = (Node *) (yyvsp[-4].objwithargs); n->extname = makeString((yyvsp[0].str)); (yyval.node) = (Node *)n; } #line 37314 "gram_minimal.c" /* yacc.c:1646 */ break; case 1312: #line 9044 "gram_minimal.y" /* yacc.c:1646 */ { AlterObjectDependsStmt *n = makeNode(AlterObjectDependsStmt); n->objectType = OBJECT_TRIGGER; n->relation = (yyvsp[-4].range); n->object = (Node *) list_make1(makeString((yyvsp[-6].str))); n->extname = makeString((yyvsp[0].str)); (yyval.node) = (Node *)n; } #line 37327 "gram_minimal.c" /* yacc.c:1646 */ break; case 1313: #line 9053 "gram_minimal.y" /* yacc.c:1646 */ { AlterObjectDependsStmt *n = makeNode(AlterObjectDependsStmt); n->objectType = OBJECT_MATVIEW; n->relation = (yyvsp[-4].range); n->extname = makeString((yyvsp[0].str)); (yyval.node) = (Node *)n; } #line 37339 "gram_minimal.c" /* yacc.c:1646 */ break; case 1314: #line 9061 "gram_minimal.y" /* yacc.c:1646 */ { AlterObjectDependsStmt *n = makeNode(AlterObjectDependsStmt); n->objectType = OBJECT_INDEX; n->relation = (yyvsp[-4].range); n->extname = makeString((yyvsp[0].str)); (yyval.node) = (Node *)n; } #line 37351 "gram_minimal.c" /* yacc.c:1646 */ break; case 1315: #line 9078 "gram_minimal.y" /* yacc.c:1646 */ { AlterObjectSchemaStmt *n = makeNode(AlterObjectSchemaStmt); n->objectType = OBJECT_AGGREGATE; n->object = (Node *) (yyvsp[-3].objwithargs); n->newschema = (yyvsp[0].str); n->missing_ok = false; (yyval.node) = (Node *)n; } #line 37364 "gram_minimal.c" /* yacc.c:1646 */ break; case 1316: #line 9087 "gram_minimal.y" /* yacc.c:1646 */ { AlterObjectSchemaStmt *n = makeNode(AlterObjectSchemaStmt); n->objectType = OBJECT_COLLATION; n->object = (Node *) (yyvsp[-3].list); n->newschema = (yyvsp[0].str); n->missing_ok = false; (yyval.node) = (Node *)n; } #line 37377 "gram_minimal.c" /* yacc.c:1646 */ break; case 1317: #line 9096 "gram_minimal.y" /* yacc.c:1646 */ { AlterObjectSchemaStmt *n = makeNode(AlterObjectSchemaStmt); n->objectType = OBJECT_CONVERSION; n->object = (Node *) (yyvsp[-3].list); n->newschema = (yyvsp[0].str); n->missing_ok = false; (yyval.node) = (Node *)n; } #line 37390 "gram_minimal.c" /* yacc.c:1646 */ break; case 1318: #line 9105 "gram_minimal.y" /* yacc.c:1646 */ { AlterObjectSchemaStmt *n = makeNode(AlterObjectSchemaStmt); n->objectType = OBJECT_DOMAIN; n->object = (Node *) (yyvsp[-3].list); n->newschema = (yyvsp[0].str); n->missing_ok = false; (yyval.node) = (Node *)n; } #line 37403 "gram_minimal.c" /* yacc.c:1646 */ break; case 1319: #line 9114 "gram_minimal.y" /* yacc.c:1646 */ { AlterObjectSchemaStmt *n = makeNode(AlterObjectSchemaStmt); n->objectType = OBJECT_EXTENSION; n->object = (Node *) makeString((yyvsp[-3].str)); n->newschema = (yyvsp[0].str); n->missing_ok = false; (yyval.node) = (Node *)n; } #line 37416 "gram_minimal.c" /* yacc.c:1646 */ break; case 1320: #line 9123 "gram_minimal.y" /* yacc.c:1646 */ { AlterObjectSchemaStmt *n = makeNode(AlterObjectSchemaStmt); n->objectType = OBJECT_FUNCTION; n->object = (Node *) (yyvsp[-3].objwithargs); n->newschema = (yyvsp[0].str); n->missing_ok = false; (yyval.node) = (Node *)n; } #line 37429 "gram_minimal.c" /* yacc.c:1646 */ break; case 1321: #line 9132 "gram_minimal.y" /* yacc.c:1646 */ { AlterObjectSchemaStmt *n = makeNode(AlterObjectSchemaStmt); n->objectType = OBJECT_OPERATOR; n->object = (Node *) (yyvsp[-3].objwithargs); n->newschema = (yyvsp[0].str); n->missing_ok = false; (yyval.node) = (Node *)n; } #line 37442 "gram_minimal.c" /* yacc.c:1646 */ break; case 1322: #line 9141 "gram_minimal.y" /* yacc.c:1646 */ { AlterObjectSchemaStmt *n = makeNode(AlterObjectSchemaStmt); n->objectType = OBJECT_OPCLASS; n->object = (Node *) lcons(makeString((yyvsp[-3].str)), (yyvsp[-5].list)); n->newschema = (yyvsp[0].str); n->missing_ok = false; (yyval.node) = (Node *)n; } #line 37455 "gram_minimal.c" /* yacc.c:1646 */ break; case 1323: #line 9150 "gram_minimal.y" /* yacc.c:1646 */ { AlterObjectSchemaStmt *n = makeNode(AlterObjectSchemaStmt); n->objectType = OBJECT_OPFAMILY; n->object = (Node *) lcons(makeString((yyvsp[-3].str)), (yyvsp[-5].list)); n->newschema = (yyvsp[0].str); n->missing_ok = false; (yyval.node) = (Node *)n; } #line 37468 "gram_minimal.c" /* yacc.c:1646 */ break; case 1324: #line 9159 "gram_minimal.y" /* yacc.c:1646 */ { AlterObjectSchemaStmt *n = makeNode(AlterObjectSchemaStmt); n->objectType = OBJECT_PROCEDURE; n->object = (Node *) (yyvsp[-3].objwithargs); n->newschema = (yyvsp[0].str); n->missing_ok = false; (yyval.node) = (Node *)n; } #line 37481 "gram_minimal.c" /* yacc.c:1646 */ break; case 1325: #line 9168 "gram_minimal.y" /* yacc.c:1646 */ { AlterObjectSchemaStmt *n = makeNode(AlterObjectSchemaStmt); n->objectType = OBJECT_ROUTINE; n->object = (Node *) (yyvsp[-3].objwithargs); n->newschema = (yyvsp[0].str); n->missing_ok = false; (yyval.node) = (Node *)n; } #line 37494 "gram_minimal.c" /* yacc.c:1646 */ break; case 1326: #line 9177 "gram_minimal.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 37507 "gram_minimal.c" /* yacc.c:1646 */ break; case 1327: #line 9186 "gram_minimal.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 37520 "gram_minimal.c" /* yacc.c:1646 */ break; case 1328: #line 9195 "gram_minimal.y" /* yacc.c:1646 */ { AlterObjectSchemaStmt *n = makeNode(AlterObjectSchemaStmt); n->objectType = OBJECT_STATISTIC_EXT; n->object = (Node *) (yyvsp[-3].list); n->newschema = (yyvsp[0].str); n->missing_ok = false; (yyval.node) = (Node *)n; } #line 37533 "gram_minimal.c" /* yacc.c:1646 */ break; case 1329: #line 9204 "gram_minimal.y" /* yacc.c:1646 */ { AlterObjectSchemaStmt *n = makeNode(AlterObjectSchemaStmt); n->objectType = OBJECT_TSPARSER; n->object = (Node *) (yyvsp[-3].list); n->newschema = (yyvsp[0].str); n->missing_ok = false; (yyval.node) = (Node *)n; } #line 37546 "gram_minimal.c" /* yacc.c:1646 */ break; case 1330: #line 9213 "gram_minimal.y" /* yacc.c:1646 */ { AlterObjectSchemaStmt *n = makeNode(AlterObjectSchemaStmt); n->objectType = OBJECT_TSDICTIONARY; n->object = (Node *) (yyvsp[-3].list); n->newschema = (yyvsp[0].str); n->missing_ok = false; (yyval.node) = (Node *)n; } #line 37559 "gram_minimal.c" /* yacc.c:1646 */ break; case 1331: #line 9222 "gram_minimal.y" /* yacc.c:1646 */ { AlterObjectSchemaStmt *n = makeNode(AlterObjectSchemaStmt); n->objectType = OBJECT_TSTEMPLATE; n->object = (Node *) (yyvsp[-3].list); n->newschema = (yyvsp[0].str); n->missing_ok = false; (yyval.node) = (Node *)n; } #line 37572 "gram_minimal.c" /* yacc.c:1646 */ break; case 1332: #line 9231 "gram_minimal.y" /* yacc.c:1646 */ { AlterObjectSchemaStmt *n = makeNode(AlterObjectSchemaStmt); n->objectType = OBJECT_TSCONFIGURATION; n->object = (Node *) (yyvsp[-3].list); n->newschema = (yyvsp[0].str); n->missing_ok = false; (yyval.node) = (Node *)n; } #line 37585 "gram_minimal.c" /* yacc.c:1646 */ break; case 1333: #line 9240 "gram_minimal.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 37598 "gram_minimal.c" /* yacc.c:1646 */ break; case 1334: #line 9249 "gram_minimal.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 37611 "gram_minimal.c" /* yacc.c:1646 */ break; case 1335: #line 9258 "gram_minimal.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 37624 "gram_minimal.c" /* yacc.c:1646 */ break; case 1336: #line 9267 "gram_minimal.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 37637 "gram_minimal.c" /* yacc.c:1646 */ break; case 1337: #line 9276 "gram_minimal.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 37650 "gram_minimal.c" /* yacc.c:1646 */ break; case 1338: #line 9285 "gram_minimal.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 37663 "gram_minimal.c" /* yacc.c:1646 */ break; case 1339: #line 9294 "gram_minimal.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 37676 "gram_minimal.c" /* yacc.c:1646 */ break; case 1340: #line 9303 "gram_minimal.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 37689 "gram_minimal.c" /* yacc.c:1646 */ break; case 1341: #line 9312 "gram_minimal.y" /* yacc.c:1646 */ { AlterObjectSchemaStmt *n = makeNode(AlterObjectSchemaStmt); n->objectType = OBJECT_TYPE; n->object = (Node *) (yyvsp[-3].list); n->newschema = (yyvsp[0].str); n->missing_ok = false; (yyval.node) = (Node *)n; } #line 37702 "gram_minimal.c" /* yacc.c:1646 */ break; case 1342: #line 9330 "gram_minimal.y" /* yacc.c:1646 */ { AlterOperatorStmt *n = makeNode(AlterOperatorStmt); n->opername = (yyvsp[-4].objwithargs); n->options = (yyvsp[-1].list); (yyval.node) = (Node *)n; } #line 37713 "gram_minimal.c" /* yacc.c:1646 */ break; case 1343: #line 9338 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].defelt)); } #line 37719 "gram_minimal.c" /* yacc.c:1646 */ break; case 1344: #line 9339 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].defelt)); } #line 37725 "gram_minimal.c" /* yacc.c:1646 */ break; case 1345: #line 9343 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem((yyvsp[-2].str), NULL, (yylsp[-2])); } #line 37731 "gram_minimal.c" /* yacc.c:1646 */ break; case 1346: #line 9345 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem((yyvsp[-2].str), (Node *) (yyvsp[0].node), (yylsp[-2])); } #line 37737 "gram_minimal.c" /* yacc.c:1646 */ break; case 1347: #line 9350 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (Node *)(yyvsp[0].typnam); } #line 37743 "gram_minimal.c" /* yacc.c:1646 */ break; case 1348: #line 9351 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (Node *)makeString(pstrdup((yyvsp[0].keyword))); } #line 37749 "gram_minimal.c" /* yacc.c:1646 */ break; case 1349: #line 9352 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (Node *)(yyvsp[0].list); } #line 37755 "gram_minimal.c" /* yacc.c:1646 */ break; case 1350: #line 9353 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (Node *)(yyvsp[0].value); } #line 37761 "gram_minimal.c" /* yacc.c:1646 */ break; case 1351: #line 9354 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (Node *)makeString((yyvsp[0].str)); } #line 37767 "gram_minimal.c" /* yacc.c:1646 */ break; case 1352: #line 9364 "gram_minimal.y" /* yacc.c:1646 */ { AlterOwnerStmt *n = makeNode(AlterOwnerStmt); n->objectType = OBJECT_AGGREGATE; n->object = (Node *) (yyvsp[-3].objwithargs); n->newowner = (yyvsp[0].rolespec); (yyval.node) = (Node *)n; } #line 37779 "gram_minimal.c" /* yacc.c:1646 */ break; case 1353: #line 9372 "gram_minimal.y" /* yacc.c:1646 */ { AlterOwnerStmt *n = makeNode(AlterOwnerStmt); n->objectType = OBJECT_COLLATION; n->object = (Node *) (yyvsp[-3].list); n->newowner = (yyvsp[0].rolespec); (yyval.node) = (Node *)n; } #line 37791 "gram_minimal.c" /* yacc.c:1646 */ break; case 1354: #line 9380 "gram_minimal.y" /* yacc.c:1646 */ { AlterOwnerStmt *n = makeNode(AlterOwnerStmt); n->objectType = OBJECT_CONVERSION; n->object = (Node *) (yyvsp[-3].list); n->newowner = (yyvsp[0].rolespec); (yyval.node) = (Node *)n; } #line 37803 "gram_minimal.c" /* yacc.c:1646 */ break; case 1355: #line 9388 "gram_minimal.y" /* yacc.c:1646 */ { AlterOwnerStmt *n = makeNode(AlterOwnerStmt); n->objectType = OBJECT_DATABASE; n->object = (Node *) makeString((yyvsp[-3].str)); n->newowner = (yyvsp[0].rolespec); (yyval.node) = (Node *)n; } #line 37815 "gram_minimal.c" /* yacc.c:1646 */ break; case 1356: #line 9396 "gram_minimal.y" /* yacc.c:1646 */ { AlterOwnerStmt *n = makeNode(AlterOwnerStmt); n->objectType = OBJECT_DOMAIN; n->object = (Node *) (yyvsp[-3].list); n->newowner = (yyvsp[0].rolespec); (yyval.node) = (Node *)n; } #line 37827 "gram_minimal.c" /* yacc.c:1646 */ break; case 1357: #line 9404 "gram_minimal.y" /* yacc.c:1646 */ { AlterOwnerStmt *n = makeNode(AlterOwnerStmt); n->objectType = OBJECT_FUNCTION; n->object = (Node *) (yyvsp[-3].objwithargs); n->newowner = (yyvsp[0].rolespec); (yyval.node) = (Node *)n; } #line 37839 "gram_minimal.c" /* yacc.c:1646 */ break; case 1358: #line 9412 "gram_minimal.y" /* yacc.c:1646 */ { AlterOwnerStmt *n = makeNode(AlterOwnerStmt); n->objectType = OBJECT_LANGUAGE; n->object = (Node *) makeString((yyvsp[-3].str)); n->newowner = (yyvsp[0].rolespec); (yyval.node) = (Node *)n; } #line 37851 "gram_minimal.c" /* yacc.c:1646 */ break; case 1359: #line 9420 "gram_minimal.y" /* yacc.c:1646 */ { AlterOwnerStmt *n = makeNode(AlterOwnerStmt); n->objectType = OBJECT_LARGEOBJECT; n->object = (Node *) (yyvsp[-3].value); n->newowner = (yyvsp[0].rolespec); (yyval.node) = (Node *)n; } #line 37863 "gram_minimal.c" /* yacc.c:1646 */ break; case 1360: #line 9428 "gram_minimal.y" /* yacc.c:1646 */ { AlterOwnerStmt *n = makeNode(AlterOwnerStmt); n->objectType = OBJECT_OPERATOR; n->object = (Node *) (yyvsp[-3].objwithargs); n->newowner = (yyvsp[0].rolespec); (yyval.node) = (Node *)n; } #line 37875 "gram_minimal.c" /* yacc.c:1646 */ break; case 1361: #line 9436 "gram_minimal.y" /* yacc.c:1646 */ { AlterOwnerStmt *n = makeNode(AlterOwnerStmt); n->objectType = OBJECT_OPCLASS; n->object = (Node *) lcons(makeString((yyvsp[-3].str)), (yyvsp[-5].list)); n->newowner = (yyvsp[0].rolespec); (yyval.node) = (Node *)n; } #line 37887 "gram_minimal.c" /* yacc.c:1646 */ break; case 1362: #line 9444 "gram_minimal.y" /* yacc.c:1646 */ { AlterOwnerStmt *n = makeNode(AlterOwnerStmt); n->objectType = OBJECT_OPFAMILY; n->object = (Node *) lcons(makeString((yyvsp[-3].str)), (yyvsp[-5].list)); n->newowner = (yyvsp[0].rolespec); (yyval.node) = (Node *)n; } #line 37899 "gram_minimal.c" /* yacc.c:1646 */ break; case 1363: #line 9452 "gram_minimal.y" /* yacc.c:1646 */ { AlterOwnerStmt *n = makeNode(AlterOwnerStmt); n->objectType = OBJECT_PROCEDURE; n->object = (Node *) (yyvsp[-3].objwithargs); n->newowner = (yyvsp[0].rolespec); (yyval.node) = (Node *)n; } #line 37911 "gram_minimal.c" /* yacc.c:1646 */ break; case 1364: #line 9460 "gram_minimal.y" /* yacc.c:1646 */ { AlterOwnerStmt *n = makeNode(AlterOwnerStmt); n->objectType = OBJECT_ROUTINE; n->object = (Node *) (yyvsp[-3].objwithargs); n->newowner = (yyvsp[0].rolespec); (yyval.node) = (Node *)n; } #line 37923 "gram_minimal.c" /* yacc.c:1646 */ break; case 1365: #line 9468 "gram_minimal.y" /* yacc.c:1646 */ { AlterOwnerStmt *n = makeNode(AlterOwnerStmt); n->objectType = OBJECT_SCHEMA; n->object = (Node *) makeString((yyvsp[-3].str)); n->newowner = (yyvsp[0].rolespec); (yyval.node) = (Node *)n; } #line 37935 "gram_minimal.c" /* yacc.c:1646 */ break; case 1366: #line 9476 "gram_minimal.y" /* yacc.c:1646 */ { AlterOwnerStmt *n = makeNode(AlterOwnerStmt); n->objectType = OBJECT_TYPE; n->object = (Node *) (yyvsp[-3].list); n->newowner = (yyvsp[0].rolespec); (yyval.node) = (Node *)n; } #line 37947 "gram_minimal.c" /* yacc.c:1646 */ break; case 1367: #line 9484 "gram_minimal.y" /* yacc.c:1646 */ { AlterOwnerStmt *n = makeNode(AlterOwnerStmt); n->objectType = OBJECT_TABLESPACE; n->object = (Node *) makeString((yyvsp[-3].str)); n->newowner = (yyvsp[0].rolespec); (yyval.node) = (Node *)n; } #line 37959 "gram_minimal.c" /* yacc.c:1646 */ break; case 1368: #line 9492 "gram_minimal.y" /* yacc.c:1646 */ { AlterOwnerStmt *n = makeNode(AlterOwnerStmt); n->objectType = OBJECT_STATISTIC_EXT; n->object = (Node *) (yyvsp[-3].list); n->newowner = (yyvsp[0].rolespec); (yyval.node) = (Node *)n; } #line 37971 "gram_minimal.c" /* yacc.c:1646 */ break; case 1369: #line 9500 "gram_minimal.y" /* yacc.c:1646 */ { AlterOwnerStmt *n = makeNode(AlterOwnerStmt); n->objectType = OBJECT_TSDICTIONARY; n->object = (Node *) (yyvsp[-3].list); n->newowner = (yyvsp[0].rolespec); (yyval.node) = (Node *)n; } #line 37983 "gram_minimal.c" /* yacc.c:1646 */ break; case 1370: #line 9508 "gram_minimal.y" /* yacc.c:1646 */ { AlterOwnerStmt *n = makeNode(AlterOwnerStmt); n->objectType = OBJECT_TSCONFIGURATION; n->object = (Node *) (yyvsp[-3].list); n->newowner = (yyvsp[0].rolespec); (yyval.node) = (Node *)n; } #line 37995 "gram_minimal.c" /* yacc.c:1646 */ break; case 1371: #line 9516 "gram_minimal.y" /* yacc.c:1646 */ { AlterOwnerStmt *n = makeNode(AlterOwnerStmt); n->objectType = OBJECT_FDW; n->object = (Node *) makeString((yyvsp[-3].str)); n->newowner = (yyvsp[0].rolespec); (yyval.node) = (Node *)n; } #line 38007 "gram_minimal.c" /* yacc.c:1646 */ break; case 1372: #line 9524 "gram_minimal.y" /* yacc.c:1646 */ { AlterOwnerStmt *n = makeNode(AlterOwnerStmt); n->objectType = OBJECT_FOREIGN_SERVER; n->object = (Node *) makeString((yyvsp[-3].str)); n->newowner = (yyvsp[0].rolespec); (yyval.node) = (Node *)n; } #line 38019 "gram_minimal.c" /* yacc.c:1646 */ break; case 1373: #line 9532 "gram_minimal.y" /* yacc.c:1646 */ { AlterOwnerStmt *n = makeNode(AlterOwnerStmt); n->objectType = OBJECT_EVENT_TRIGGER; n->object = (Node *) makeString((yyvsp[-3].str)); n->newowner = (yyvsp[0].rolespec); (yyval.node) = (Node *)n; } #line 38031 "gram_minimal.c" /* yacc.c:1646 */ break; case 1374: #line 9540 "gram_minimal.y" /* yacc.c:1646 */ { AlterOwnerStmt *n = makeNode(AlterOwnerStmt); n->objectType = OBJECT_PUBLICATION; n->object = (Node *) makeString((yyvsp[-3].str)); n->newowner = (yyvsp[0].rolespec); (yyval.node) = (Node *)n; } #line 38043 "gram_minimal.c" /* yacc.c:1646 */ break; case 1375: #line 9548 "gram_minimal.y" /* yacc.c:1646 */ { AlterOwnerStmt *n = makeNode(AlterOwnerStmt); n->objectType = OBJECT_SUBSCRIPTION; n->object = (Node *) makeString((yyvsp[-3].str)); n->newowner = (yyvsp[0].rolespec); (yyval.node) = (Node *)n; } #line 38055 "gram_minimal.c" /* yacc.c:1646 */ break; case 1376: #line 9566 "gram_minimal.y" /* yacc.c:1646 */ { CreatePublicationStmt *n = makeNode(CreatePublicationStmt); n->pubname = (yyvsp[-2].str); n->options = (yyvsp[0].list); if ((yyvsp[-1].node) != NULL) { /* FOR TABLE */ if (IsA((yyvsp[-1].node), List)) n->tables = (List *)(yyvsp[-1].node); /* FOR ALL TABLES */ else n->for_all_tables = true; } (yyval.node) = (Node *)n; } #line 38075 "gram_minimal.c" /* yacc.c:1646 */ break; case 1377: #line 9584 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 38081 "gram_minimal.c" /* yacc.c:1646 */ break; case 1378: #line 9585 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = NULL; } #line 38087 "gram_minimal.c" /* yacc.c:1646 */ break; case 1379: #line 9590 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) (yyvsp[0].list); } #line 38095 "gram_minimal.c" /* yacc.c:1646 */ break; case 1380: #line 9594 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeInteger(true); } #line 38103 "gram_minimal.c" /* yacc.c:1646 */ break; case 1381: #line 9614 "gram_minimal.y" /* yacc.c:1646 */ { AlterPublicationStmt *n = makeNode(AlterPublicationStmt); n->pubname = (yyvsp[-2].str); n->options = (yyvsp[0].list); (yyval.node) = (Node *)n; } #line 38114 "gram_minimal.c" /* yacc.c:1646 */ break; case 1382: #line 9621 "gram_minimal.y" /* yacc.c:1646 */ { AlterPublicationStmt *n = makeNode(AlterPublicationStmt); n->pubname = (yyvsp[-3].str); n->tables = (yyvsp[0].list); n->tableAction = DEFELEM_ADD; (yyval.node) = (Node *)n; } #line 38126 "gram_minimal.c" /* yacc.c:1646 */ break; case 1383: #line 9629 "gram_minimal.y" /* yacc.c:1646 */ { AlterPublicationStmt *n = makeNode(AlterPublicationStmt); n->pubname = (yyvsp[-3].str); n->tables = (yyvsp[0].list); n->tableAction = DEFELEM_SET; (yyval.node) = (Node *)n; } #line 38138 "gram_minimal.c" /* yacc.c:1646 */ break; case 1384: #line 9637 "gram_minimal.y" /* yacc.c:1646 */ { AlterPublicationStmt *n = makeNode(AlterPublicationStmt); n->pubname = (yyvsp[-3].str); n->tables = (yyvsp[0].list); n->tableAction = DEFELEM_DROP; (yyval.node) = (Node *)n; } #line 38150 "gram_minimal.c" /* yacc.c:1646 */ break; case 1385: #line 9654 "gram_minimal.y" /* yacc.c:1646 */ { CreateSubscriptionStmt *n = makeNode(CreateSubscriptionStmt); n->subname = (yyvsp[-5].str); n->conninfo = (yyvsp[-3].str); n->publication = (yyvsp[-1].list); n->options = (yyvsp[0].list); (yyval.node) = (Node *)n; } #line 38164 "gram_minimal.c" /* yacc.c:1646 */ break; case 1386: #line 9667 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].value)); } #line 38172 "gram_minimal.c" /* yacc.c:1646 */ break; case 1387: #line 9671 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].value)); } #line 38180 "gram_minimal.c" /* yacc.c:1646 */ break; case 1388: #line 9677 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.value) = makeString((yyvsp[0].str)); } #line 38186 "gram_minimal.c" /* yacc.c:1646 */ break; case 1389: #line 9687 "gram_minimal.y" /* yacc.c:1646 */ { AlterSubscriptionStmt *n = makeNode(AlterSubscriptionStmt); n->kind = ALTER_SUBSCRIPTION_OPTIONS; n->subname = (yyvsp[-2].str); n->options = (yyvsp[0].list); (yyval.node) = (Node *)n; } #line 38199 "gram_minimal.c" /* yacc.c:1646 */ break; case 1390: #line 9696 "gram_minimal.y" /* yacc.c:1646 */ { AlterSubscriptionStmt *n = makeNode(AlterSubscriptionStmt); n->kind = ALTER_SUBSCRIPTION_CONNECTION; n->subname = (yyvsp[-2].str); n->conninfo = (yyvsp[0].str); (yyval.node) = (Node *)n; } #line 38212 "gram_minimal.c" /* yacc.c:1646 */ break; case 1391: #line 9705 "gram_minimal.y" /* yacc.c:1646 */ { AlterSubscriptionStmt *n = makeNode(AlterSubscriptionStmt); n->kind = ALTER_SUBSCRIPTION_REFRESH; n->subname = (yyvsp[-3].str); n->options = (yyvsp[0].list); (yyval.node) = (Node *)n; } #line 38225 "gram_minimal.c" /* yacc.c:1646 */ break; case 1392: #line 9714 "gram_minimal.y" /* yacc.c:1646 */ { AlterSubscriptionStmt *n = makeNode(AlterSubscriptionStmt); n->kind = ALTER_SUBSCRIPTION_PUBLICATION; n->subname = (yyvsp[-4].str); n->publication = (yyvsp[-1].list); n->options = (yyvsp[0].list); (yyval.node) = (Node *)n; } #line 38239 "gram_minimal.c" /* yacc.c:1646 */ break; case 1393: #line 9724 "gram_minimal.y" /* yacc.c:1646 */ { AlterSubscriptionStmt *n = makeNode(AlterSubscriptionStmt); n->kind = ALTER_SUBSCRIPTION_ENABLED; n->subname = (yyvsp[-1].str); n->options = list_make1(makeDefElem("enabled", (Node *)makeInteger(true), (yylsp[-3]))); (yyval.node) = (Node *)n; } #line 38253 "gram_minimal.c" /* yacc.c:1646 */ break; case 1394: #line 9734 "gram_minimal.y" /* yacc.c:1646 */ { AlterSubscriptionStmt *n = makeNode(AlterSubscriptionStmt); n->kind = ALTER_SUBSCRIPTION_ENABLED; n->subname = (yyvsp[-1].str); n->options = list_make1(makeDefElem("enabled", (Node *)makeInteger(false), (yylsp[-3]))); (yyval.node) = (Node *)n; } #line 38267 "gram_minimal.c" /* yacc.c:1646 */ break; case 1395: #line 9752 "gram_minimal.y" /* yacc.c:1646 */ { DropSubscriptionStmt *n = makeNode(DropSubscriptionStmt); n->subname = (yyvsp[-1].str); n->missing_ok = false; n->behavior = (yyvsp[0].dbehavior); (yyval.node) = (Node *) n; } #line 38279 "gram_minimal.c" /* yacc.c:1646 */ break; case 1396: #line 9760 "gram_minimal.y" /* yacc.c:1646 */ { DropSubscriptionStmt *n = makeNode(DropSubscriptionStmt); n->subname = (yyvsp[-1].str); n->missing_ok = true; n->behavior = (yyvsp[0].dbehavior); (yyval.node) = (Node *) n; } #line 38291 "gram_minimal.c" /* yacc.c:1646 */ break; case 1397: #line 9778 "gram_minimal.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 38307 "gram_minimal.c" /* yacc.c:1646 */ break; case 1398: #line 9792 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 38313 "gram_minimal.c" /* yacc.c:1646 */ break; case 1399: #line 9793 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].node)); } #line 38319 "gram_minimal.c" /* yacc.c:1646 */ break; case 1400: #line 9794 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[-1].list); } #line 38325 "gram_minimal.c" /* yacc.c:1646 */ break; case 1401: #line 9800 "gram_minimal.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 38335 "gram_minimal.c" /* yacc.c:1646 */ break; case 1402: #line 9806 "gram_minimal.y" /* yacc.c:1646 */ { if ((yyvsp[0].node) != NULL) (yyval.list) = list_make1((yyvsp[0].node)); else (yyval.list) = NIL; } #line 38345 "gram_minimal.c" /* yacc.c:1646 */ break; case 1408: #line 9822 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 38351 "gram_minimal.c" /* yacc.c:1646 */ break; case 1409: #line 9823 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = NULL; } #line 38357 "gram_minimal.c" /* yacc.c:1646 */ break; case 1410: #line 9826 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = CMD_SELECT; } #line 38363 "gram_minimal.c" /* yacc.c:1646 */ break; case 1411: #line 9827 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = CMD_UPDATE; } #line 38369 "gram_minimal.c" /* yacc.c:1646 */ break; case 1412: #line 9828 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = CMD_DELETE; } #line 38375 "gram_minimal.c" /* yacc.c:1646 */ break; case 1413: #line 9829 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = CMD_INSERT; } #line 38381 "gram_minimal.c" /* yacc.c:1646 */ break; case 1414: #line 9833 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.boolean) = true; } #line 38387 "gram_minimal.c" /* yacc.c:1646 */ break; case 1415: #line 9834 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.boolean) = false; } #line 38393 "gram_minimal.c" /* yacc.c:1646 */ break; case 1416: #line 9835 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.boolean) = false; } #line 38399 "gram_minimal.c" /* yacc.c:1646 */ break; case 1417: #line 9848 "gram_minimal.y" /* yacc.c:1646 */ { NotifyStmt *n = makeNode(NotifyStmt); n->conditionname = (yyvsp[-1].str); n->payload = (yyvsp[0].str); (yyval.node) = (Node *)n; } #line 38410 "gram_minimal.c" /* yacc.c:1646 */ break; case 1418: #line 9857 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 38416 "gram_minimal.c" /* yacc.c:1646 */ break; case 1419: #line 9858 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = NULL; } #line 38422 "gram_minimal.c" /* yacc.c:1646 */ break; case 1420: #line 9862 "gram_minimal.y" /* yacc.c:1646 */ { ListenStmt *n = makeNode(ListenStmt); n->conditionname = (yyvsp[0].str); (yyval.node) = (Node *)n; } #line 38432 "gram_minimal.c" /* yacc.c:1646 */ break; case 1421: #line 9871 "gram_minimal.y" /* yacc.c:1646 */ { UnlistenStmt *n = makeNode(UnlistenStmt); n->conditionname = (yyvsp[0].str); (yyval.node) = (Node *)n; } #line 38442 "gram_minimal.c" /* yacc.c:1646 */ break; case 1422: #line 9877 "gram_minimal.y" /* yacc.c:1646 */ { UnlistenStmt *n = makeNode(UnlistenStmt); n->conditionname = NULL; (yyval.node) = (Node *)n; } #line 38452 "gram_minimal.c" /* yacc.c:1646 */ break; case 1423: #line 9896 "gram_minimal.y" /* yacc.c:1646 */ { TransactionStmt *n = makeNode(TransactionStmt); n->kind = TRANS_STMT_ROLLBACK; n->options = NIL; n->chain = (yyvsp[0].boolean); (yyval.node) = (Node *)n; } #line 38464 "gram_minimal.c" /* yacc.c:1646 */ break; case 1424: #line 9904 "gram_minimal.y" /* yacc.c:1646 */ { TransactionStmt *n = makeNode(TransactionStmt); n->kind = TRANS_STMT_BEGIN; n->options = (yyvsp[0].list); (yyval.node) = (Node *)n; } #line 38475 "gram_minimal.c" /* yacc.c:1646 */ break; case 1425: #line 9911 "gram_minimal.y" /* yacc.c:1646 */ { TransactionStmt *n = makeNode(TransactionStmt); n->kind = TRANS_STMT_START; n->options = (yyvsp[0].list); (yyval.node) = (Node *)n; } #line 38486 "gram_minimal.c" /* yacc.c:1646 */ break; case 1426: #line 9918 "gram_minimal.y" /* yacc.c:1646 */ { TransactionStmt *n = makeNode(TransactionStmt); n->kind = TRANS_STMT_COMMIT; n->options = NIL; n->chain = (yyvsp[0].boolean); (yyval.node) = (Node *)n; } #line 38498 "gram_minimal.c" /* yacc.c:1646 */ break; case 1427: #line 9926 "gram_minimal.y" /* yacc.c:1646 */ { TransactionStmt *n = makeNode(TransactionStmt); n->kind = TRANS_STMT_COMMIT; n->options = NIL; n->chain = (yyvsp[0].boolean); (yyval.node) = (Node *)n; } #line 38510 "gram_minimal.c" /* yacc.c:1646 */ break; case 1428: #line 9934 "gram_minimal.y" /* yacc.c:1646 */ { TransactionStmt *n = makeNode(TransactionStmt); n->kind = TRANS_STMT_ROLLBACK; n->options = NIL; n->chain = (yyvsp[0].boolean); (yyval.node) = (Node *)n; } #line 38522 "gram_minimal.c" /* yacc.c:1646 */ break; case 1429: #line 9942 "gram_minimal.y" /* yacc.c:1646 */ { TransactionStmt *n = makeNode(TransactionStmt); n->kind = TRANS_STMT_SAVEPOINT; n->savepoint_name = (yyvsp[0].str); (yyval.node) = (Node *)n; } #line 38533 "gram_minimal.c" /* yacc.c:1646 */ break; case 1430: #line 9949 "gram_minimal.y" /* yacc.c:1646 */ { TransactionStmt *n = makeNode(TransactionStmt); n->kind = TRANS_STMT_RELEASE; n->savepoint_name = (yyvsp[0].str); (yyval.node) = (Node *)n; } #line 38544 "gram_minimal.c" /* yacc.c:1646 */ break; case 1431: #line 9956 "gram_minimal.y" /* yacc.c:1646 */ { TransactionStmt *n = makeNode(TransactionStmt); n->kind = TRANS_STMT_RELEASE; n->savepoint_name = (yyvsp[0].str); (yyval.node) = (Node *)n; } #line 38555 "gram_minimal.c" /* yacc.c:1646 */ break; case 1432: #line 9963 "gram_minimal.y" /* yacc.c:1646 */ { TransactionStmt *n = makeNode(TransactionStmt); n->kind = TRANS_STMT_ROLLBACK_TO; n->savepoint_name = (yyvsp[0].str); (yyval.node) = (Node *)n; } #line 38566 "gram_minimal.c" /* yacc.c:1646 */ break; case 1433: #line 9970 "gram_minimal.y" /* yacc.c:1646 */ { TransactionStmt *n = makeNode(TransactionStmt); n->kind = TRANS_STMT_ROLLBACK_TO; n->savepoint_name = (yyvsp[0].str); (yyval.node) = (Node *)n; } #line 38577 "gram_minimal.c" /* yacc.c:1646 */ break; case 1434: #line 9977 "gram_minimal.y" /* yacc.c:1646 */ { TransactionStmt *n = makeNode(TransactionStmt); n->kind = TRANS_STMT_PREPARE; n->gid = (yyvsp[0].str); (yyval.node) = (Node *)n; } #line 38588 "gram_minimal.c" /* yacc.c:1646 */ break; case 1435: #line 9984 "gram_minimal.y" /* yacc.c:1646 */ { TransactionStmt *n = makeNode(TransactionStmt); n->kind = TRANS_STMT_COMMIT_PREPARED; n->gid = (yyvsp[0].str); (yyval.node) = (Node *)n; } #line 38599 "gram_minimal.c" /* yacc.c:1646 */ break; case 1436: #line 9991 "gram_minimal.y" /* yacc.c:1646 */ { TransactionStmt *n = makeNode(TransactionStmt); n->kind = TRANS_STMT_ROLLBACK_PREPARED; n->gid = (yyvsp[0].str); (yyval.node) = (Node *)n; } #line 38610 "gram_minimal.c" /* yacc.c:1646 */ break; case 1437: #line 9999 "gram_minimal.y" /* yacc.c:1646 */ {} #line 38616 "gram_minimal.c" /* yacc.c:1646 */ break; case 1438: #line 10000 "gram_minimal.y" /* yacc.c:1646 */ {} #line 38622 "gram_minimal.c" /* yacc.c:1646 */ break; case 1439: #line 10001 "gram_minimal.y" /* yacc.c:1646 */ {} #line 38628 "gram_minimal.c" /* yacc.c:1646 */ break; case 1440: #line 10006 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("transaction_isolation", makeStringConst((yyvsp[0].str), (yylsp[0])), (yylsp[-2])); } #line 38635 "gram_minimal.c" /* yacc.c:1646 */ break; case 1441: #line 10009 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("transaction_read_only", makeIntConst(true, (yylsp[-1])), (yylsp[-1])); } #line 38642 "gram_minimal.c" /* yacc.c:1646 */ break; case 1442: #line 10012 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("transaction_read_only", makeIntConst(false, (yylsp[-1])), (yylsp[-1])); } #line 38649 "gram_minimal.c" /* yacc.c:1646 */ break; case 1443: #line 10015 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("transaction_deferrable", makeIntConst(true, (yylsp[0])), (yylsp[0])); } #line 38656 "gram_minimal.c" /* yacc.c:1646 */ break; case 1444: #line 10018 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("transaction_deferrable", makeIntConst(false, (yylsp[-1])), (yylsp[-1])); } #line 38663 "gram_minimal.c" /* yacc.c:1646 */ break; case 1445: #line 10025 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].defelt)); } #line 38669 "gram_minimal.c" /* yacc.c:1646 */ break; case 1446: #line 10027 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].defelt)); } #line 38675 "gram_minimal.c" /* yacc.c:1646 */ break; case 1447: #line 10029 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-1].list), (yyvsp[0].defelt)); } #line 38681 "gram_minimal.c" /* yacc.c:1646 */ break; case 1449: #line 10035 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 38687 "gram_minimal.c" /* yacc.c:1646 */ break; case 1450: #line 10039 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.boolean) = true; } #line 38693 "gram_minimal.c" /* yacc.c:1646 */ break; case 1451: #line 10040 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.boolean) = false; } #line 38699 "gram_minimal.c" /* yacc.c:1646 */ break; case 1452: #line 10041 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.boolean) = false; } #line 38705 "gram_minimal.c" /* yacc.c:1646 */ break; case 1453: #line 10055 "gram_minimal.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 38721 "gram_minimal.c" /* yacc.c:1646 */ break; case 1454: #line 10068 "gram_minimal.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 38737 "gram_minimal.c" /* yacc.c:1646 */ break; case 1455: #line 10081 "gram_minimal.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 38758 "gram_minimal.c" /* yacc.c:1646 */ break; case 1456: #line 10099 "gram_minimal.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 38779 "gram_minimal.c" /* yacc.c:1646 */ break; case 1457: #line 10118 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = CASCADED_CHECK_OPTION; } #line 38785 "gram_minimal.c" /* yacc.c:1646 */ break; case 1458: #line 10119 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = CASCADED_CHECK_OPTION; } #line 38791 "gram_minimal.c" /* yacc.c:1646 */ break; case 1459: #line 10120 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = LOCAL_CHECK_OPTION; } #line 38797 "gram_minimal.c" /* yacc.c:1646 */ break; case 1460: #line 10121 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = NO_CHECK_OPTION; } #line 38803 "gram_minimal.c" /* yacc.c:1646 */ break; case 1461: #line 10132 "gram_minimal.y" /* yacc.c:1646 */ { LoadStmt *n = makeNode(LoadStmt); n->filename = (yyvsp[0].str); (yyval.node) = (Node *)n; } #line 38813 "gram_minimal.c" /* yacc.c:1646 */ break; case 1462: #line 10148 "gram_minimal.y" /* yacc.c:1646 */ { CreatedbStmt *n = makeNode(CreatedbStmt); n->dbname = (yyvsp[-2].str); n->options = (yyvsp[0].list); (yyval.node) = (Node *)n; } #line 38824 "gram_minimal.c" /* yacc.c:1646 */ break; case 1463: #line 10157 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 38830 "gram_minimal.c" /* yacc.c:1646 */ break; case 1464: #line 10158 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 38836 "gram_minimal.c" /* yacc.c:1646 */ break; case 1465: #line 10162 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].defelt)); } #line 38842 "gram_minimal.c" /* yacc.c:1646 */ break; case 1466: #line 10163 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-1].list), (yyvsp[0].defelt)); } #line 38848 "gram_minimal.c" /* yacc.c:1646 */ break; case 1467: #line 10168 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem((yyvsp[-2].str), (Node *)makeInteger((yyvsp[0].ival)), (yylsp[-2])); } #line 38856 "gram_minimal.c" /* yacc.c:1646 */ break; case 1468: #line 10172 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem((yyvsp[-2].str), (Node *)makeString((yyvsp[0].str)), (yylsp[-2])); } #line 38864 "gram_minimal.c" /* yacc.c:1646 */ break; case 1469: #line 10176 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem((yyvsp[-2].str), NULL, (yylsp[-2])); } #line 38872 "gram_minimal.c" /* yacc.c:1646 */ break; case 1470: #line 10193 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 38878 "gram_minimal.c" /* yacc.c:1646 */ break; case 1471: #line 10194 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = pstrdup("connection_limit"); } #line 38884 "gram_minimal.c" /* yacc.c:1646 */ break; case 1472: #line 10195 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = pstrdup((yyvsp[0].keyword)); } #line 38890 "gram_minimal.c" /* yacc.c:1646 */ break; case 1473: #line 10196 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = pstrdup((yyvsp[0].keyword)); } #line 38896 "gram_minimal.c" /* yacc.c:1646 */ break; case 1474: #line 10197 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = pstrdup((yyvsp[0].keyword)); } #line 38902 "gram_minimal.c" /* yacc.c:1646 */ break; case 1475: #line 10198 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = pstrdup((yyvsp[0].keyword)); } #line 38908 "gram_minimal.c" /* yacc.c:1646 */ break; case 1476: #line 10199 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = pstrdup((yyvsp[0].keyword)); } #line 38914 "gram_minimal.c" /* yacc.c:1646 */ break; case 1477: #line 10206 "gram_minimal.y" /* yacc.c:1646 */ {} #line 38920 "gram_minimal.c" /* yacc.c:1646 */ break; case 1478: #line 10207 "gram_minimal.y" /* yacc.c:1646 */ {} #line 38926 "gram_minimal.c" /* yacc.c:1646 */ break; case 1479: #line 10219 "gram_minimal.y" /* yacc.c:1646 */ { AlterDatabaseStmt *n = makeNode(AlterDatabaseStmt); n->dbname = (yyvsp[-2].str); n->options = (yyvsp[0].list); (yyval.node) = (Node *)n; } #line 38937 "gram_minimal.c" /* yacc.c:1646 */ break; case 1480: #line 10226 "gram_minimal.y" /* yacc.c:1646 */ { AlterDatabaseStmt *n = makeNode(AlterDatabaseStmt); n->dbname = (yyvsp[-1].str); n->options = (yyvsp[0].list); (yyval.node) = (Node *)n; } #line 38948 "gram_minimal.c" /* yacc.c:1646 */ break; case 1481: #line 10233 "gram_minimal.y" /* yacc.c:1646 */ { AlterDatabaseStmt *n = makeNode(AlterDatabaseStmt); n->dbname = (yyvsp[-3].str); n->options = list_make1(makeDefElem("tablespace", (Node *)makeString((yyvsp[0].str)), (yylsp[0]))); (yyval.node) = (Node *)n; } #line 38960 "gram_minimal.c" /* yacc.c:1646 */ break; case 1482: #line 10244 "gram_minimal.y" /* yacc.c:1646 */ { AlterDatabaseSetStmt *n = makeNode(AlterDatabaseSetStmt); n->dbname = (yyvsp[-1].str); n->setstmt = (yyvsp[0].vsetstmt); (yyval.node) = (Node *)n; } #line 38971 "gram_minimal.c" /* yacc.c:1646 */ break; case 1483: #line 10261 "gram_minimal.y" /* yacc.c:1646 */ { DropdbStmt *n = makeNode(DropdbStmt); n->dbname = (yyvsp[0].str); n->missing_ok = false; (yyval.node) = (Node *)n; } #line 38982 "gram_minimal.c" /* yacc.c:1646 */ break; case 1484: #line 10268 "gram_minimal.y" /* yacc.c:1646 */ { DropdbStmt *n = makeNode(DropdbStmt); n->dbname = (yyvsp[0].str); n->missing_ok = true; (yyval.node) = (Node *)n; } #line 38993 "gram_minimal.c" /* yacc.c:1646 */ break; case 1485: #line 10284 "gram_minimal.y" /* yacc.c:1646 */ { AlterCollationStmt *n = makeNode(AlterCollationStmt); n->collname = (yyvsp[-2].list); (yyval.node) = (Node *)n; } #line 39003 "gram_minimal.c" /* yacc.c:1646 */ break; case 1486: #line 10301 "gram_minimal.y" /* yacc.c:1646 */ { AlterSystemStmt *n = makeNode(AlterSystemStmt); n->setstmt = (yyvsp[0].vsetstmt); (yyval.node) = (Node *)n; } #line 39013 "gram_minimal.c" /* yacc.c:1646 */ break; case 1487: #line 10307 "gram_minimal.y" /* yacc.c:1646 */ { AlterSystemStmt *n = makeNode(AlterSystemStmt); n->setstmt = (yyvsp[0].vsetstmt); (yyval.node) = (Node *)n; } #line 39023 "gram_minimal.c" /* yacc.c:1646 */ break; case 1488: #line 10323 "gram_minimal.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 39036 "gram_minimal.c" /* yacc.c:1646 */ break; case 1489: #line 10336 "gram_minimal.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 39048 "gram_minimal.c" /* yacc.c:1646 */ break; case 1490: #line 10345 "gram_minimal.y" /* yacc.c:1646 */ { AlterDomainStmt *n = makeNode(AlterDomainStmt); n->subtype = 'N'; n->typeName = (yyvsp[-3].list); (yyval.node) = (Node *)n; } #line 39059 "gram_minimal.c" /* yacc.c:1646 */ break; case 1491: #line 10353 "gram_minimal.y" /* yacc.c:1646 */ { AlterDomainStmt *n = makeNode(AlterDomainStmt); n->subtype = 'O'; n->typeName = (yyvsp[-3].list); (yyval.node) = (Node *)n; } #line 39070 "gram_minimal.c" /* yacc.c:1646 */ break; case 1492: #line 10361 "gram_minimal.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 39082 "gram_minimal.c" /* yacc.c:1646 */ break; case 1493: #line 10370 "gram_minimal.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 39096 "gram_minimal.c" /* yacc.c:1646 */ break; case 1494: #line 10381 "gram_minimal.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 39110 "gram_minimal.c" /* yacc.c:1646 */ break; case 1495: #line 10392 "gram_minimal.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 39122 "gram_minimal.c" /* yacc.c:1646 */ break; case 1496: #line 10401 "gram_minimal.y" /* yacc.c:1646 */ {} #line 39128 "gram_minimal.c" /* yacc.c:1646 */ break; case 1497: #line 10402 "gram_minimal.y" /* yacc.c:1646 */ {} #line 39134 "gram_minimal.c" /* yacc.c:1646 */ break; case 1498: #line 10414 "gram_minimal.y" /* yacc.c:1646 */ { AlterTSDictionaryStmt *n = makeNode(AlterTSDictionaryStmt); n->dictname = (yyvsp[-1].list); n->options = (yyvsp[0].list); (yyval.node) = (Node *)n; } #line 39145 "gram_minimal.c" /* yacc.c:1646 */ break; case 1499: #line 10424 "gram_minimal.y" /* yacc.c:1646 */ { AlterTSConfigurationStmt *n = makeNode(AlterTSConfigurationStmt); n->kind = ALTER_TSCONFIG_ADD_MAPPING; 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 39160 "gram_minimal.c" /* yacc.c:1646 */ break; case 1500: #line 10435 "gram_minimal.y" /* yacc.c:1646 */ { AlterTSConfigurationStmt *n = makeNode(AlterTSConfigurationStmt); n->kind = ALTER_TSCONFIG_ALTER_MAPPING_FOR_TOKEN; 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 39175 "gram_minimal.c" /* yacc.c:1646 */ break; case 1501: #line 10446 "gram_minimal.y" /* yacc.c:1646 */ { AlterTSConfigurationStmt *n = makeNode(AlterTSConfigurationStmt); n->kind = ALTER_TSCONFIG_REPLACE_DICT; 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 39190 "gram_minimal.c" /* yacc.c:1646 */ break; case 1502: #line 10457 "gram_minimal.y" /* yacc.c:1646 */ { AlterTSConfigurationStmt *n = makeNode(AlterTSConfigurationStmt); n->kind = ALTER_TSCONFIG_REPLACE_DICT_FOR_TOKEN; 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 39205 "gram_minimal.c" /* yacc.c:1646 */ break; case 1503: #line 10468 "gram_minimal.y" /* yacc.c:1646 */ { AlterTSConfigurationStmt *n = makeNode(AlterTSConfigurationStmt); n->kind = ALTER_TSCONFIG_DROP_MAPPING; n->cfgname = (yyvsp[-4].list); n->tokentype = (yyvsp[0].list); n->missing_ok = false; (yyval.node) = (Node*)n; } #line 39218 "gram_minimal.c" /* yacc.c:1646 */ break; case 1504: #line 10477 "gram_minimal.y" /* yacc.c:1646 */ { AlterTSConfigurationStmt *n = makeNode(AlterTSConfigurationStmt); n->kind = ALTER_TSCONFIG_DROP_MAPPING; n->cfgname = (yyvsp[-6].list); n->tokentype = (yyvsp[0].list); n->missing_ok = true; (yyval.node) = (Node*)n; } #line 39231 "gram_minimal.c" /* yacc.c:1646 */ break; case 1505: #line 10488 "gram_minimal.y" /* yacc.c:1646 */ {} #line 39237 "gram_minimal.c" /* yacc.c:1646 */ break; case 1506: #line 10489 "gram_minimal.y" /* yacc.c:1646 */ {} #line 39243 "gram_minimal.c" /* yacc.c:1646 */ break; case 1507: #line 10505 "gram_minimal.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 39257 "gram_minimal.c" /* yacc.c:1646 */ break; case 1508: #line 10527 "gram_minimal.y" /* yacc.c:1646 */ { ClusterStmt *n = makeNode(ClusterStmt); n->relation = (yyvsp[-1].range); n->indexname = (yyvsp[0].str); n->options = 0; if ((yyvsp[-2].boolean)) n->options |= CLUOPT_VERBOSE; (yyval.node) = (Node*)n; } #line 39271 "gram_minimal.c" /* yacc.c:1646 */ break; case 1509: #line 10537 "gram_minimal.y" /* yacc.c:1646 */ { ClusterStmt *n = makeNode(ClusterStmt); n->relation = NULL; n->indexname = NULL; n->options = 0; if ((yyvsp[0].boolean)) n->options |= CLUOPT_VERBOSE; (yyval.node) = (Node*)n; } #line 39285 "gram_minimal.c" /* yacc.c:1646 */ break; case 1510: #line 10548 "gram_minimal.y" /* yacc.c:1646 */ { ClusterStmt *n = makeNode(ClusterStmt); n->relation = (yyvsp[0].range); n->indexname = (yyvsp[-2].str); n->options = 0; if ((yyvsp[-3].boolean)) n->options |= CLUOPT_VERBOSE; (yyval.node) = (Node*)n; } #line 39299 "gram_minimal.c" /* yacc.c:1646 */ break; case 1511: #line 10560 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 39305 "gram_minimal.c" /* yacc.c:1646 */ break; case 1512: #line 10561 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = NULL; } #line 39311 "gram_minimal.c" /* yacc.c:1646 */ break; case 1513: #line 10574 "gram_minimal.y" /* yacc.c:1646 */ { VacuumStmt *n = makeNode(VacuumStmt); n->options = NIL; if ((yyvsp[-4].boolean)) n->options = lappend(n->options, makeDefElem("full", NULL, (yylsp[-4]))); if ((yyvsp[-3].boolean)) n->options = lappend(n->options, makeDefElem("freeze", NULL, (yylsp[-3]))); if ((yyvsp[-2].boolean)) n->options = lappend(n->options, makeDefElem("verbose", NULL, (yylsp[-2]))); if ((yyvsp[-1].boolean)) n->options = lappend(n->options, makeDefElem("analyze", NULL, (yylsp[-1]))); n->rels = (yyvsp[0].list); n->is_vacuumcmd = true; (yyval.node) = (Node *)n; } #line 39335 "gram_minimal.c" /* yacc.c:1646 */ break; case 1514: #line 10594 "gram_minimal.y" /* yacc.c:1646 */ { VacuumStmt *n = makeNode(VacuumStmt); n->options = (yyvsp[-2].list); n->rels = (yyvsp[0].list); n->is_vacuumcmd = true; (yyval.node) = (Node *) n; } #line 39347 "gram_minimal.c" /* yacc.c:1646 */ break; case 1515: #line 10604 "gram_minimal.y" /* yacc.c:1646 */ { VacuumStmt *n = makeNode(VacuumStmt); n->options = NIL; if ((yyvsp[-1].boolean)) n->options = lappend(n->options, makeDefElem("verbose", NULL, (yylsp[-1]))); n->rels = (yyvsp[0].list); n->is_vacuumcmd = false; (yyval.node) = (Node *)n; } #line 39362 "gram_minimal.c" /* yacc.c:1646 */ break; case 1516: #line 10615 "gram_minimal.y" /* yacc.c:1646 */ { VacuumStmt *n = makeNode(VacuumStmt); n->options = (yyvsp[-2].list); n->rels = (yyvsp[0].list); n->is_vacuumcmd = false; (yyval.node) = (Node *) n; } #line 39374 "gram_minimal.c" /* yacc.c:1646 */ break; case 1517: #line 10626 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].defelt)); } #line 39382 "gram_minimal.c" /* yacc.c:1646 */ break; case 1518: #line 10630 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].defelt)); } #line 39390 "gram_minimal.c" /* yacc.c:1646 */ break; case 1519: #line 10636 "gram_minimal.y" /* yacc.c:1646 */ {} #line 39396 "gram_minimal.c" /* yacc.c:1646 */ break; case 1520: #line 10637 "gram_minimal.y" /* yacc.c:1646 */ {} #line 39402 "gram_minimal.c" /* yacc.c:1646 */ break; case 1521: #line 10642 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem((yyvsp[-1].str), (yyvsp[0].node), (yylsp[-1])); } #line 39410 "gram_minimal.c" /* yacc.c:1646 */ break; case 1522: #line 10648 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 39416 "gram_minimal.c" /* yacc.c:1646 */ break; case 1523: #line 10649 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = "analyze"; } #line 39422 "gram_minimal.c" /* yacc.c:1646 */ break; case 1524: #line 10653 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeString((yyvsp[0].str)); } #line 39428 "gram_minimal.c" /* yacc.c:1646 */ break; case 1525: #line 10654 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) (yyvsp[0].value); } #line 39434 "gram_minimal.c" /* yacc.c:1646 */ break; case 1526: #line 10655 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = NULL; } #line 39440 "gram_minimal.c" /* yacc.c:1646 */ break; case 1527: #line 10659 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.boolean) = true; } #line 39446 "gram_minimal.c" /* yacc.c:1646 */ break; case 1528: #line 10660 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.boolean) = false; } #line 39452 "gram_minimal.c" /* yacc.c:1646 */ break; case 1529: #line 10664 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.boolean) = true; } #line 39458 "gram_minimal.c" /* yacc.c:1646 */ break; case 1530: #line 10665 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.boolean) = false; } #line 39464 "gram_minimal.c" /* yacc.c:1646 */ break; case 1531: #line 10668 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.boolean) = true; } #line 39470 "gram_minimal.c" /* yacc.c:1646 */ break; case 1532: #line 10669 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.boolean) = false; } #line 39476 "gram_minimal.c" /* yacc.c:1646 */ break; case 1533: #line 10672 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.boolean) = true; } #line 39482 "gram_minimal.c" /* yacc.c:1646 */ break; case 1534: #line 10673 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.boolean) = false; } #line 39488 "gram_minimal.c" /* yacc.c:1646 */ break; case 1535: #line 10677 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[-1].list); } #line 39494 "gram_minimal.c" /* yacc.c:1646 */ break; case 1536: #line 10678 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 39500 "gram_minimal.c" /* yacc.c:1646 */ break; case 1537: #line 10683 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeVacuumRelation((yyvsp[-1].range), InvalidOid, (yyvsp[0].list)); } #line 39508 "gram_minimal.c" /* yacc.c:1646 */ break; case 1538: #line 10690 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].node)); } #line 39514 "gram_minimal.c" /* yacc.c:1646 */ break; case 1539: #line 10692 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].node)); } #line 39520 "gram_minimal.c" /* yacc.c:1646 */ break; case 1540: #line 10696 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 39526 "gram_minimal.c" /* yacc.c:1646 */ break; case 1541: #line 10697 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 39532 "gram_minimal.c" /* yacc.c:1646 */ break; case 1542: #line 10711 "gram_minimal.y" /* yacc.c:1646 */ { ExplainStmt *n = makeNode(ExplainStmt); n->query = (yyvsp[0].node); n->options = NIL; (yyval.node) = (Node *) n; } #line 39543 "gram_minimal.c" /* yacc.c:1646 */ break; case 1543: #line 10718 "gram_minimal.y" /* yacc.c:1646 */ { ExplainStmt *n = makeNode(ExplainStmt); n->query = (yyvsp[0].node); n->options = list_make1(makeDefElem("analyze", NULL, (yylsp[-2]))); if ((yyvsp[-1].boolean)) n->options = lappend(n->options, makeDefElem("verbose", NULL, (yylsp[-1]))); (yyval.node) = (Node *) n; } #line 39557 "gram_minimal.c" /* yacc.c:1646 */ break; case 1544: #line 10728 "gram_minimal.y" /* yacc.c:1646 */ { ExplainStmt *n = makeNode(ExplainStmt); n->query = (yyvsp[0].node); n->options = list_make1(makeDefElem("verbose", NULL, (yylsp[-1]))); (yyval.node) = (Node *) n; } #line 39568 "gram_minimal.c" /* yacc.c:1646 */ break; case 1545: #line 10735 "gram_minimal.y" /* yacc.c:1646 */ { ExplainStmt *n = makeNode(ExplainStmt); n->query = (yyvsp[0].node); n->options = (yyvsp[-2].list); (yyval.node) = (Node *) n; } #line 39579 "gram_minimal.c" /* yacc.c:1646 */ break; case 1555: #line 10757 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].defelt)); } #line 39587 "gram_minimal.c" /* yacc.c:1646 */ break; case 1556: #line 10761 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].defelt)); } #line 39595 "gram_minimal.c" /* yacc.c:1646 */ break; case 1557: #line 10768 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem((yyvsp[-1].str), (yyvsp[0].node), (yylsp[-1])); } #line 39603 "gram_minimal.c" /* yacc.c:1646 */ break; case 1558: #line 10774 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 39609 "gram_minimal.c" /* yacc.c:1646 */ break; case 1559: #line 10775 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = "analyze"; } #line 39615 "gram_minimal.c" /* yacc.c:1646 */ break; case 1560: #line 10779 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeString((yyvsp[0].str)); } #line 39621 "gram_minimal.c" /* yacc.c:1646 */ break; case 1561: #line 10780 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) (yyvsp[0].value); } #line 39627 "gram_minimal.c" /* yacc.c:1646 */ break; case 1562: #line 10781 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = NULL; } #line 39633 "gram_minimal.c" /* yacc.c:1646 */ break; case 1563: #line 10792 "gram_minimal.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 39645 "gram_minimal.c" /* yacc.c:1646 */ break; case 1564: #line 10801 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[-1].list); } #line 39651 "gram_minimal.c" /* yacc.c:1646 */ break; case 1565: #line 10802 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 39657 "gram_minimal.c" /* yacc.c:1646 */ break; case 1570: #line 10820 "gram_minimal.y" /* yacc.c:1646 */ { ExecuteStmt *n = makeNode(ExecuteStmt); n->name = (yyvsp[-1].str); n->params = (yyvsp[0].list); (yyval.node) = (Node *) n; } #line 39668 "gram_minimal.c" /* yacc.c:1646 */ break; case 1571: #line 10828 "gram_minimal.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; ctas->if_not_exists = 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 39688 "gram_minimal.c" /* yacc.c:1646 */ break; case 1572: #line 10845 "gram_minimal.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; ctas->if_not_exists = true; /* cram additional flags into the IntoClause */ (yyvsp[-5].into)->rel->relpersistence = (yyvsp[-10].ival); (yyvsp[-5].into)->skipData = !((yyvsp[0].boolean)); (yyval.node) = (Node *) ctas; } #line 39708 "gram_minimal.c" /* yacc.c:1646 */ break; case 1573: #line 10862 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[-1].list); } #line 39714 "gram_minimal.c" /* yacc.c:1646 */ break; case 1574: #line 10863 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 39720 "gram_minimal.c" /* yacc.c:1646 */ break; case 1575: #line 10874 "gram_minimal.y" /* yacc.c:1646 */ { DeallocateStmt *n = makeNode(DeallocateStmt); n->name = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 39730 "gram_minimal.c" /* yacc.c:1646 */ break; case 1576: #line 10880 "gram_minimal.y" /* yacc.c:1646 */ { DeallocateStmt *n = makeNode(DeallocateStmt); n->name = (yyvsp[0].str); (yyval.node) = (Node *) n; } #line 39740 "gram_minimal.c" /* yacc.c:1646 */ break; case 1577: #line 10886 "gram_minimal.y" /* yacc.c:1646 */ { DeallocateStmt *n = makeNode(DeallocateStmt); n->name = NULL; (yyval.node) = (Node *) n; } #line 39750 "gram_minimal.c" /* yacc.c:1646 */ break; case 1578: #line 10892 "gram_minimal.y" /* yacc.c:1646 */ { DeallocateStmt *n = makeNode(DeallocateStmt); n->name = NULL; (yyval.node) = (Node *) n; } #line 39760 "gram_minimal.c" /* yacc.c:1646 */ break; case 1579: #line 10909 "gram_minimal.y" /* yacc.c:1646 */ { (yyvsp[-2].istmt)->relation = (yyvsp[-3].range); (yyvsp[-2].istmt)->onConflictClause = (yyvsp[-1].onconflict); (yyvsp[-2].istmt)->returningList = (yyvsp[0].list); (yyvsp[-2].istmt)->withClause = (yyvsp[-6].with); (yyval.node) = (Node *) (yyvsp[-2].istmt); } #line 39772 "gram_minimal.c" /* yacc.c:1646 */ break; case 1580: #line 10919 "gram_minimal.y" /* yacc.c:1646 */ { InsertStmt *insert = makeNode(InsertStmt); insert->relation = (yyvsp[0].range); insert->withClause= (yyvsp[-3].with); (yyval.node) = (Node *) insert; /* * Assign the node directly to the parsetree and exit the scanner * we don't want to keep parsing for information we don't need */ pg_yyget_extra(yyscanner)->parsetree = list_make1(makeRawStmt((yyval.node), 0)); YYACCEPT; } #line 39789 "gram_minimal.c" /* yacc.c:1646 */ break; case 1581: #line 10941 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.range) = (yyvsp[0].range); } #line 39797 "gram_minimal.c" /* yacc.c:1646 */ break; case 1582: #line 10945 "gram_minimal.y" /* yacc.c:1646 */ { (yyvsp[-2].range)->alias = makeAlias((yyvsp[0].str), NIL); (yyval.range) = (yyvsp[-2].range); } #line 39806 "gram_minimal.c" /* yacc.c:1646 */ break; case 1583: #line 10953 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.istmt) = makeNode(InsertStmt); (yyval.istmt)->cols = NIL; (yyval.istmt)->selectStmt = (yyvsp[0].node); } #line 39816 "gram_minimal.c" /* yacc.c:1646 */ break; case 1584: #line 10959 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.istmt) = makeNode(InsertStmt); (yyval.istmt)->cols = NIL; (yyval.istmt)->override = (yyvsp[-2].ival); (yyval.istmt)->selectStmt = (yyvsp[0].node); } #line 39827 "gram_minimal.c" /* yacc.c:1646 */ break; case 1585: #line 10966 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.istmt) = makeNode(InsertStmt); (yyval.istmt)->cols = (yyvsp[-2].list); (yyval.istmt)->selectStmt = (yyvsp[0].node); } #line 39837 "gram_minimal.c" /* yacc.c:1646 */ break; case 1586: #line 10972 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.istmt) = makeNode(InsertStmt); (yyval.istmt)->cols = (yyvsp[-5].list); (yyval.istmt)->override = (yyvsp[-2].ival); (yyval.istmt)->selectStmt = (yyvsp[0].node); } #line 39848 "gram_minimal.c" /* yacc.c:1646 */ break; case 1587: #line 10979 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.istmt) = makeNode(InsertStmt); (yyval.istmt)->cols = NIL; (yyval.istmt)->selectStmt = NULL; } #line 39858 "gram_minimal.c" /* yacc.c:1646 */ break; case 1588: #line 10987 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = OVERRIDING_USER_VALUE; } #line 39864 "gram_minimal.c" /* yacc.c:1646 */ break; case 1589: #line 10988 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = OVERRIDING_SYSTEM_VALUE; } #line 39870 "gram_minimal.c" /* yacc.c:1646 */ break; case 1590: #line 10993 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].target)); } #line 39876 "gram_minimal.c" /* yacc.c:1646 */ break; case 1591: #line 10995 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].target)); } #line 39882 "gram_minimal.c" /* yacc.c:1646 */ break; case 1592: #line 11000 "gram_minimal.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 39894 "gram_minimal.c" /* yacc.c:1646 */ break; case 1593: #line 11011 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.onconflict) = makeNode(OnConflictClause); (yyval.onconflict)->action = ONCONFLICT_UPDATE; (yyval.onconflict)->infer = (yyvsp[-5].infer); (yyval.onconflict)->targetList = (yyvsp[-1].list); (yyval.onconflict)->whereClause = (yyvsp[0].node); (yyval.onconflict)->location = (yylsp[-7]); } #line 39907 "gram_minimal.c" /* yacc.c:1646 */ break; case 1594: #line 11021 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.onconflict) = makeNode(OnConflictClause); (yyval.onconflict)->action = ONCONFLICT_NOTHING; (yyval.onconflict)->infer = (yyvsp[-2].infer); (yyval.onconflict)->targetList = NIL; (yyval.onconflict)->whereClause = NULL; (yyval.onconflict)->location = (yylsp[-4]); } #line 39920 "gram_minimal.c" /* yacc.c:1646 */ break; case 1595: #line 11030 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.onconflict) = NULL; } #line 39928 "gram_minimal.c" /* yacc.c:1646 */ break; case 1596: #line 11037 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.infer) = makeNode(InferClause); (yyval.infer)->indexElems = (yyvsp[-2].list); (yyval.infer)->whereClause = (yyvsp[0].node); (yyval.infer)->conname = NULL; (yyval.infer)->location = (yylsp[-3]); } #line 39940 "gram_minimal.c" /* yacc.c:1646 */ break; case 1597: #line 11046 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.infer) = makeNode(InferClause); (yyval.infer)->indexElems = NIL; (yyval.infer)->whereClause = NULL; (yyval.infer)->conname = (yyvsp[0].str); (yyval.infer)->location = (yylsp[-2]); } #line 39952 "gram_minimal.c" /* yacc.c:1646 */ break; case 1598: #line 11054 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.infer) = NULL; } #line 39960 "gram_minimal.c" /* yacc.c:1646 */ break; case 1599: #line 11060 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 39966 "gram_minimal.c" /* yacc.c:1646 */ break; case 1600: #line 11061 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 39972 "gram_minimal.c" /* yacc.c:1646 */ break; case 1601: #line 11074 "gram_minimal.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 39986 "gram_minimal.c" /* yacc.c:1646 */ break; case 1602: #line 11086 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 39992 "gram_minimal.c" /* yacc.c:1646 */ break; case 1603: #line 11087 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 39998 "gram_minimal.c" /* yacc.c:1646 */ break; case 1604: #line 11099 "gram_minimal.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 40011 "gram_minimal.c" /* yacc.c:1646 */ break; case 1605: #line 11109 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = (yyvsp[-1].ival); } #line 40017 "gram_minimal.c" /* yacc.c:1646 */ break; case 1606: #line 11110 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = AccessExclusiveLock; } #line 40023 "gram_minimal.c" /* yacc.c:1646 */ break; case 1607: #line 11113 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = AccessShareLock; } #line 40029 "gram_minimal.c" /* yacc.c:1646 */ break; case 1608: #line 11114 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = RowShareLock; } #line 40035 "gram_minimal.c" /* yacc.c:1646 */ break; case 1609: #line 11115 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = RowExclusiveLock; } #line 40041 "gram_minimal.c" /* yacc.c:1646 */ break; case 1610: #line 11116 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = ShareUpdateExclusiveLock; } #line 40047 "gram_minimal.c" /* yacc.c:1646 */ break; case 1611: #line 11117 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = ShareLock; } #line 40053 "gram_minimal.c" /* yacc.c:1646 */ break; case 1612: #line 11118 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = ShareRowExclusiveLock; } #line 40059 "gram_minimal.c" /* yacc.c:1646 */ break; case 1613: #line 11119 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = ExclusiveLock; } #line 40065 "gram_minimal.c" /* yacc.c:1646 */ break; case 1614: #line 11120 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = AccessExclusiveLock; } #line 40071 "gram_minimal.c" /* yacc.c:1646 */ break; case 1615: #line 11123 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.boolean) = true; } #line 40077 "gram_minimal.c" /* yacc.c:1646 */ break; case 1616: #line 11124 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.boolean) = false; } #line 40083 "gram_minimal.c" /* yacc.c:1646 */ break; case 1617: #line 11128 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = LockWaitError; } #line 40089 "gram_minimal.c" /* yacc.c:1646 */ break; case 1618: #line 11129 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = LockWaitSkip; } #line 40095 "gram_minimal.c" /* yacc.c:1646 */ break; case 1619: #line 11130 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = LockWaitBlock; } #line 40101 "gram_minimal.c" /* yacc.c:1646 */ break; case 1620: #line 11146 "gram_minimal.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 40116 "gram_minimal.c" /* yacc.c:1646 */ break; case 1621: #line 11158 "gram_minimal.y" /* yacc.c:1646 */ { UpdateStmt *n = makeNode(UpdateStmt); n->relation = (yyvsp[0].range); n->targetList = NULL; n->fromClause = NULL; n->whereClause = NULL; n->returningList = NULL; n->withClause = (yyvsp[-2].with); (yyval.node) = (Node *)n; pg_yyget_extra(yyscanner)->parsetree = list_make1(makeRawStmt((yyval.node), 0)); YYACCEPT; } #line 40133 "gram_minimal.c" /* yacc.c:1646 */ break; case 1622: #line 11172 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 40139 "gram_minimal.c" /* yacc.c:1646 */ break; case 1623: #line 11173 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_concat((yyvsp[-2].list),(yyvsp[0].list)); } #line 40145 "gram_minimal.c" /* yacc.c:1646 */ break; case 1624: #line 11178 "gram_minimal.y" /* yacc.c:1646 */ { (yyvsp[-2].target)->val = (Node *) (yyvsp[0].node); (yyval.list) = list_make1((yyvsp[-2].target)); } #line 40154 "gram_minimal.c" /* yacc.c:1646 */ break; case 1625: #line 11183 "gram_minimal.y" /* yacc.c:1646 */ { int ncolumns = list_length((yyvsp[-3].list)); int i = 1; ListCell *col_cell; /* Create a MultiAssignRef source for each target */ foreach(col_cell, (yyvsp[-3].list)) { ResTarget *res_col = (ResTarget *) lfirst(col_cell); MultiAssignRef *r = makeNode(MultiAssignRef); r->source = (Node *) (yyvsp[0].node); r->colno = i; r->ncolumns = ncolumns; res_col->val = (Node *) r; i++; } (yyval.list) = (yyvsp[-3].list); } #line 40179 "gram_minimal.c" /* yacc.c:1646 */ break; case 1626: #line 11207 "gram_minimal.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 40191 "gram_minimal.c" /* yacc.c:1646 */ break; case 1627: #line 11217 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].target)); } #line 40197 "gram_minimal.c" /* yacc.c:1646 */ break; case 1628: #line 11218 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list),(yyvsp[0].target)); } #line 40203 "gram_minimal.c" /* yacc.c:1646 */ break; case 1629: #line 11229 "gram_minimal.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 40216 "gram_minimal.c" /* yacc.c:1646 */ break; case 1630: #line 11239 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 40222 "gram_minimal.c" /* yacc.c:1646 */ break; case 1631: #line 11242 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = 0; } #line 40228 "gram_minimal.c" /* yacc.c:1646 */ break; case 1632: #line 11243 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = (yyvsp[-2].ival) | CURSOR_OPT_NO_SCROLL; } #line 40234 "gram_minimal.c" /* yacc.c:1646 */ break; case 1633: #line 11244 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = (yyvsp[-1].ival) | CURSOR_OPT_SCROLL; } #line 40240 "gram_minimal.c" /* yacc.c:1646 */ break; case 1634: #line 11245 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = (yyvsp[-1].ival) | CURSOR_OPT_BINARY; } #line 40246 "gram_minimal.c" /* yacc.c:1646 */ break; case 1635: #line 11246 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = (yyvsp[-1].ival) | CURSOR_OPT_INSENSITIVE; } #line 40252 "gram_minimal.c" /* yacc.c:1646 */ break; case 1636: #line 11249 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = 0; } #line 40258 "gram_minimal.c" /* yacc.c:1646 */ break; case 1637: #line 11250 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = CURSOR_OPT_HOLD; } #line 40264 "gram_minimal.c" /* yacc.c:1646 */ break; case 1638: #line 11251 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = 0; } #line 40270 "gram_minimal.c" /* yacc.c:1646 */ break; case 1641: #line 11304 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[-1].node); } #line 40276 "gram_minimal.c" /* yacc.c:1646 */ break; case 1642: #line 11305 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[-1].node); } #line 40282 "gram_minimal.c" /* yacc.c:1646 */ break; case 1643: #line 11320 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 40288 "gram_minimal.c" /* yacc.c:1646 */ break; case 1644: #line 11322 "gram_minimal.y" /* yacc.c:1646 */ { insertSelectOptions((SelectStmt *) (yyvsp[-1].node), (yyvsp[0].list), NIL, NULL, NULL, NULL, yyscanner); (yyval.node) = (yyvsp[-1].node); } #line 40299 "gram_minimal.c" /* yacc.c:1646 */ break; case 1645: #line 11329 "gram_minimal.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 40311 "gram_minimal.c" /* yacc.c:1646 */ break; case 1646: #line 11337 "gram_minimal.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 40323 "gram_minimal.c" /* yacc.c:1646 */ break; case 1647: #line 11345 "gram_minimal.y" /* yacc.c:1646 */ { insertSelectOptions((SelectStmt *) (yyvsp[0].node), NULL, NIL, NULL, NULL, (yyvsp[-1].with), yyscanner); (yyval.node) = (yyvsp[0].node); } #line 40335 "gram_minimal.c" /* yacc.c:1646 */ break; case 1648: #line 11353 "gram_minimal.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 40347 "gram_minimal.c" /* yacc.c:1646 */ break; case 1649: #line 11361 "gram_minimal.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 40359 "gram_minimal.c" /* yacc.c:1646 */ break; case 1650: #line 11369 "gram_minimal.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 40371 "gram_minimal.c" /* yacc.c:1646 */ break; case 1651: #line 11379 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 40377 "gram_minimal.c" /* yacc.c:1646 */ break; case 1652: #line 11380 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 40383 "gram_minimal.c" /* yacc.c:1646 */ break; case 1653: #line 11410 "gram_minimal.y" /* yacc.c:1646 */ { SelectStmt *n = makeNode(SelectStmt); 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 40399 "gram_minimal.c" /* yacc.c:1646 */ break; case 1654: #line 11424 "gram_minimal.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 40416 "gram_minimal.c" /* yacc.c:1646 */ break; case 1655: #line 11436 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 40422 "gram_minimal.c" /* yacc.c:1646 */ break; case 1656: #line 11438 "gram_minimal.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 40445 "gram_minimal.c" /* yacc.c:1646 */ break; case 1657: #line 11457 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = makeSetOp(SETOP_UNION, (yyvsp[-1].boolean), (yyvsp[-3].node), (yyvsp[0].node)); } #line 40453 "gram_minimal.c" /* yacc.c:1646 */ break; case 1658: #line 11461 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = makeSetOp(SETOP_INTERSECT, (yyvsp[-1].boolean), (yyvsp[-3].node), (yyvsp[0].node)); } #line 40461 "gram_minimal.c" /* yacc.c:1646 */ break; case 1659: #line 11465 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = makeSetOp(SETOP_EXCEPT, (yyvsp[-1].boolean), (yyvsp[-3].node), (yyvsp[0].node)); } #line 40469 "gram_minimal.c" /* yacc.c:1646 */ break; case 1660: #line 11482 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.with) = makeNode(WithClause); (yyval.with)->ctes = (yyvsp[0].list); (yyval.with)->recursive = false; (yyval.with)->location = (yylsp[-1]); } #line 40480 "gram_minimal.c" /* yacc.c:1646 */ break; case 1661: #line 11489 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.with) = makeNode(WithClause); (yyval.with)->ctes = (yyvsp[0].list); (yyval.with)->recursive = false; (yyval.with)->location = (yylsp[-1]); } #line 40491 "gram_minimal.c" /* yacc.c:1646 */ break; case 1662: #line 11496 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.with) = makeNode(WithClause); (yyval.with)->ctes = (yyvsp[0].list); (yyval.with)->recursive = true; (yyval.with)->location = (yylsp[-2]); } #line 40502 "gram_minimal.c" /* yacc.c:1646 */ break; case 1663: #line 11505 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].node)); } #line 40508 "gram_minimal.c" /* yacc.c:1646 */ break; case 1664: #line 11506 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].node)); } #line 40514 "gram_minimal.c" /* yacc.c:1646 */ break; case 1665: #line 11510 "gram_minimal.y" /* yacc.c:1646 */ { CommonTableExpr *n = makeNode(CommonTableExpr); n->ctename = (yyvsp[-6].str); n->aliascolnames = (yyvsp[-5].list); n->ctematerialized = (yyvsp[-3].ival); n->ctequery = (yyvsp[-1].node); n->location = (yylsp[-6]); (yyval.node) = (Node *) n; } #line 40528 "gram_minimal.c" /* yacc.c:1646 */ break; case 1666: #line 11522 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = CTEMaterializeAlways; } #line 40534 "gram_minimal.c" /* yacc.c:1646 */ break; case 1667: #line 11523 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = CTEMaterializeNever; } #line 40540 "gram_minimal.c" /* yacc.c:1646 */ break; case 1668: #line 11524 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = CTEMaterializeDefault; } #line 40546 "gram_minimal.c" /* yacc.c:1646 */ break; case 1669: #line 11528 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.with) = (yyvsp[0].with); } #line 40552 "gram_minimal.c" /* yacc.c:1646 */ break; case 1670: #line 11529 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.with) = NULL; } #line 40558 "gram_minimal.c" /* yacc.c:1646 */ break; case 1671: #line 11534 "gram_minimal.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 40573 "gram_minimal.c" /* yacc.c:1646 */ break; case 1672: #line 11545 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.into) = NULL; } #line 40579 "gram_minimal.c" /* yacc.c:1646 */ break; case 1673: #line 11554 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.range) = (yyvsp[0].range); (yyval.range)->relpersistence = RELPERSISTENCE_TEMP; } #line 40588 "gram_minimal.c" /* yacc.c:1646 */ break; case 1674: #line 11559 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.range) = (yyvsp[0].range); (yyval.range)->relpersistence = RELPERSISTENCE_TEMP; } #line 40597 "gram_minimal.c" /* yacc.c:1646 */ break; case 1675: #line 11564 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.range) = (yyvsp[0].range); (yyval.range)->relpersistence = RELPERSISTENCE_TEMP; } #line 40606 "gram_minimal.c" /* yacc.c:1646 */ break; case 1676: #line 11569 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.range) = (yyvsp[0].range); (yyval.range)->relpersistence = RELPERSISTENCE_TEMP; } #line 40615 "gram_minimal.c" /* yacc.c:1646 */ break; case 1677: #line 11574 "gram_minimal.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 40627 "gram_minimal.c" /* yacc.c:1646 */ break; case 1678: #line 11582 "gram_minimal.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 40639 "gram_minimal.c" /* yacc.c:1646 */ break; case 1679: #line 11590 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.range) = (yyvsp[0].range); (yyval.range)->relpersistence = RELPERSISTENCE_UNLOGGED; } #line 40648 "gram_minimal.c" /* yacc.c:1646 */ break; case 1680: #line 11595 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.range) = (yyvsp[0].range); (yyval.range)->relpersistence = RELPERSISTENCE_PERMANENT; } #line 40657 "gram_minimal.c" /* yacc.c:1646 */ break; case 1681: #line 11600 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.range) = (yyvsp[0].range); (yyval.range)->relpersistence = RELPERSISTENCE_PERMANENT; } #line 40666 "gram_minimal.c" /* yacc.c:1646 */ break; case 1682: #line 11606 "gram_minimal.y" /* yacc.c:1646 */ {} #line 40672 "gram_minimal.c" /* yacc.c:1646 */ break; case 1683: #line 11607 "gram_minimal.y" /* yacc.c:1646 */ {} #line 40678 "gram_minimal.c" /* yacc.c:1646 */ break; case 1684: #line 11611 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.boolean) = true; } #line 40684 "gram_minimal.c" /* yacc.c:1646 */ break; case 1685: #line 11612 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.boolean) = false; } #line 40690 "gram_minimal.c" /* yacc.c:1646 */ break; case 1686: #line 11613 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.boolean) = false; } #line 40696 "gram_minimal.c" /* yacc.c:1646 */ break; case 1687: #line 11620 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1(NIL); } #line 40702 "gram_minimal.c" /* yacc.c:1646 */ break; case 1688: #line 11621 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[-1].list); } #line 40708 "gram_minimal.c" /* yacc.c:1646 */ break; case 1689: #line 11625 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = NIL;} #line 40714 "gram_minimal.c" /* yacc.c:1646 */ break; case 1690: #line 11626 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 40720 "gram_minimal.c" /* yacc.c:1646 */ break; case 1691: #line 11630 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list);} #line 40726 "gram_minimal.c" /* yacc.c:1646 */ break; case 1692: #line 11631 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 40732 "gram_minimal.c" /* yacc.c:1646 */ break; case 1693: #line 11635 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 40738 "gram_minimal.c" /* yacc.c:1646 */ break; case 1694: #line 11639 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].sortby)); } #line 40744 "gram_minimal.c" /* yacc.c:1646 */ break; case 1695: #line 11640 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].sortby)); } #line 40750 "gram_minimal.c" /* yacc.c:1646 */ break; case 1696: #line 11644 "gram_minimal.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 40763 "gram_minimal.c" /* yacc.c:1646 */ break; case 1697: #line 11653 "gram_minimal.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 40776 "gram_minimal.c" /* yacc.c:1646 */ break; case 1698: #line 11665 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make2((yyvsp[0].node), (yyvsp[-1].node)); } #line 40782 "gram_minimal.c" /* yacc.c:1646 */ break; case 1699: #line 11666 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make2((yyvsp[-1].node), (yyvsp[0].node)); } #line 40788 "gram_minimal.c" /* yacc.c:1646 */ break; case 1700: #line 11667 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make2(NULL, (yyvsp[0].node)); } #line 40794 "gram_minimal.c" /* yacc.c:1646 */ break; case 1701: #line 11668 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make2((yyvsp[0].node), NULL); } #line 40800 "gram_minimal.c" /* yacc.c:1646 */ break; case 1702: #line 11672 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 40806 "gram_minimal.c" /* yacc.c:1646 */ break; case 1703: #line 11673 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make2(NULL,NULL); } #line 40812 "gram_minimal.c" /* yacc.c:1646 */ break; case 1704: #line 11678 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 40818 "gram_minimal.c" /* yacc.c:1646 */ break; case 1705: #line 11680 "gram_minimal.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 40831 "gram_minimal.c" /* yacc.c:1646 */ break; case 1706: #line 11696 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[-2].node); } #line 40837 "gram_minimal.c" /* yacc.c:1646 */ break; case 1707: #line 11698 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = makeIntConst(1, -1); } #line 40843 "gram_minimal.c" /* yacc.c:1646 */ break; case 1708: #line 11703 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 40849 "gram_minimal.c" /* yacc.c:1646 */ break; case 1709: #line 11706 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[-1].node); } #line 40855 "gram_minimal.c" /* yacc.c:1646 */ break; case 1710: #line 11710 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 40861 "gram_minimal.c" /* yacc.c:1646 */ break; case 1711: #line 11712 "gram_minimal.y" /* yacc.c:1646 */ { /* LIMIT ALL is represented as a NULL constant */ (yyval.node) = makeNullAConst((yylsp[0])); } #line 40870 "gram_minimal.c" /* yacc.c:1646 */ break; case 1712: #line 11719 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 40876 "gram_minimal.c" /* yacc.c:1646 */ break; case 1713: #line 11739 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 40882 "gram_minimal.c" /* yacc.c:1646 */ break; case 1714: #line 11741 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OP, "+", NULL, (yyvsp[0].node), (yylsp[-1])); } #line 40888 "gram_minimal.c" /* yacc.c:1646 */ break; case 1715: #line 11743 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = doNegate((yyvsp[0].node), (yylsp[-1])); } #line 40894 "gram_minimal.c" /* yacc.c:1646 */ break; case 1716: #line 11747 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = makeIntConst((yyvsp[0].ival),(yylsp[0])); } #line 40900 "gram_minimal.c" /* yacc.c:1646 */ break; case 1717: #line 11748 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = makeFloatConst((yyvsp[0].str),(yylsp[0])); } #line 40906 "gram_minimal.c" /* yacc.c:1646 */ break; case 1718: #line 11752 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = 0; } #line 40912 "gram_minimal.c" /* yacc.c:1646 */ break; case 1719: #line 11753 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = 0; } #line 40918 "gram_minimal.c" /* yacc.c:1646 */ break; case 1720: #line 11756 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = 0; } #line 40924 "gram_minimal.c" /* yacc.c:1646 */ break; case 1721: #line 11757 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = 0; } #line 40930 "gram_minimal.c" /* yacc.c:1646 */ break; case 1722: #line 11782 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 40936 "gram_minimal.c" /* yacc.c:1646 */ break; case 1723: #line 11783 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 40942 "gram_minimal.c" /* yacc.c:1646 */ break; case 1724: #line 11787 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].node)); } #line 40948 "gram_minimal.c" /* yacc.c:1646 */ break; case 1725: #line 11788 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list),(yyvsp[0].node)); } #line 40954 "gram_minimal.c" /* yacc.c:1646 */ break; case 1726: #line 11792 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 40960 "gram_minimal.c" /* yacc.c:1646 */ break; case 1727: #line 11793 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 40966 "gram_minimal.c" /* yacc.c:1646 */ break; case 1728: #line 11794 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 40972 "gram_minimal.c" /* yacc.c:1646 */ break; case 1729: #line 11795 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 40978 "gram_minimal.c" /* yacc.c:1646 */ break; case 1730: #line 11796 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 40984 "gram_minimal.c" /* yacc.c:1646 */ break; case 1731: #line 11801 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeGroupingSet(GROUPING_SET_EMPTY, NIL, (yylsp[-1])); } #line 40992 "gram_minimal.c" /* yacc.c:1646 */ break; case 1732: #line 11814 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeGroupingSet(GROUPING_SET_ROLLUP, (yyvsp[-1].list), (yylsp[-3])); } #line 41000 "gram_minimal.c" /* yacc.c:1646 */ break; case 1733: #line 11821 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeGroupingSet(GROUPING_SET_CUBE, (yyvsp[-1].list), (yylsp[-3])); } #line 41008 "gram_minimal.c" /* yacc.c:1646 */ break; case 1734: #line 11828 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeGroupingSet(GROUPING_SET_SETS, (yyvsp[-1].list), (yylsp[-4])); } #line 41016 "gram_minimal.c" /* yacc.c:1646 */ break; case 1735: #line 11834 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 41022 "gram_minimal.c" /* yacc.c:1646 */ break; case 1736: #line 11835 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = NULL; } #line 41028 "gram_minimal.c" /* yacc.c:1646 */ break; case 1737: #line 11839 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 41034 "gram_minimal.c" /* yacc.c:1646 */ break; case 1738: #line 11840 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 41040 "gram_minimal.c" /* yacc.c:1646 */ break; case 1739: #line 11844 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 41046 "gram_minimal.c" /* yacc.c:1646 */ break; case 1740: #line 11845 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 41052 "gram_minimal.c" /* yacc.c:1646 */ break; case 1741: #line 11849 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].node)); } #line 41058 "gram_minimal.c" /* yacc.c:1646 */ break; case 1742: #line 11850 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-1].list), (yyvsp[0].node)); } #line 41064 "gram_minimal.c" /* yacc.c:1646 */ break; case 1743: #line 11855 "gram_minimal.y" /* yacc.c:1646 */ { LockingClause *n = makeNode(LockingClause); n->lockedRels = (yyvsp[-1].list); n->strength = (yyvsp[-2].ival); n->waitPolicy = (yyvsp[0].ival); (yyval.node) = (Node *) n; } #line 41076 "gram_minimal.c" /* yacc.c:1646 */ break; case 1744: #line 11865 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = LCS_FORUPDATE; } #line 41082 "gram_minimal.c" /* yacc.c:1646 */ break; case 1745: #line 11866 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = LCS_FORNOKEYUPDATE; } #line 41088 "gram_minimal.c" /* yacc.c:1646 */ break; case 1746: #line 11867 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = LCS_FORSHARE; } #line 41094 "gram_minimal.c" /* yacc.c:1646 */ break; case 1747: #line 11868 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = LCS_FORKEYSHARE; } #line 41100 "gram_minimal.c" /* yacc.c:1646 */ break; case 1748: #line 11872 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 41106 "gram_minimal.c" /* yacc.c:1646 */ break; case 1749: #line 11873 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 41112 "gram_minimal.c" /* yacc.c:1646 */ break; case 1750: #line 11884 "gram_minimal.y" /* yacc.c:1646 */ { SelectStmt *n = makeNode(SelectStmt); n->valuesLists = list_make1((yyvsp[-1].list)); (yyval.node) = (Node *) n; } #line 41122 "gram_minimal.c" /* yacc.c:1646 */ break; case 1751: #line 11890 "gram_minimal.y" /* yacc.c:1646 */ { SelectStmt *n = (SelectStmt *) (yyvsp[-4].node); n->valuesLists = lappend(n->valuesLists, (yyvsp[-1].list)); (yyval.node) = (Node *) n; } #line 41132 "gram_minimal.c" /* yacc.c:1646 */ break; case 1752: #line 11907 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 41138 "gram_minimal.c" /* yacc.c:1646 */ break; case 1753: #line 11908 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 41144 "gram_minimal.c" /* yacc.c:1646 */ break; case 1754: #line 11912 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].node)); } #line 41150 "gram_minimal.c" /* yacc.c:1646 */ break; case 1755: #line 11913 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].node)); } #line 41156 "gram_minimal.c" /* yacc.c:1646 */ break; case 1756: #line 11920 "gram_minimal.y" /* yacc.c:1646 */ { (yyvsp[-1].range)->alias = (yyvsp[0].alias); (yyval.node) = (Node *) (yyvsp[-1].range); } #line 41165 "gram_minimal.c" /* yacc.c:1646 */ break; case 1757: #line 11925 "gram_minimal.y" /* yacc.c:1646 */ { RangeTableSample *n = (RangeTableSample *) (yyvsp[0].node); (yyvsp[-2].range)->alias = (yyvsp[-1].alias); /* relation_expr goes inside the RangeTableSample node */ n->relation = (Node *) (yyvsp[-2].range); (yyval.node) = (Node *) n; } #line 41177 "gram_minimal.c" /* yacc.c:1646 */ break; case 1758: #line 11933 "gram_minimal.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 41188 "gram_minimal.c" /* yacc.c:1646 */ break; case 1759: #line 11940 "gram_minimal.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 41200 "gram_minimal.c" /* yacc.c:1646 */ break; case 1760: #line 11948 "gram_minimal.y" /* yacc.c:1646 */ { RangeTableFunc *n = (RangeTableFunc *) (yyvsp[-1].node); n->alias = (yyvsp[0].alias); (yyval.node) = (Node *) n; } #line 41210 "gram_minimal.c" /* yacc.c:1646 */ break; case 1761: #line 11954 "gram_minimal.y" /* yacc.c:1646 */ { RangeTableFunc *n = (RangeTableFunc *) (yyvsp[-1].node); n->lateral = true; n->alias = (yyvsp[0].alias); (yyval.node) = (Node *) n; } #line 41221 "gram_minimal.c" /* yacc.c:1646 */ break; case 1762: #line 11961 "gram_minimal.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 41260 "gram_minimal.c" /* yacc.c:1646 */ break; case 1763: #line 11996 "gram_minimal.y" /* yacc.c:1646 */ { RangeSubselect *n = makeNode(RangeSubselect); n->lateral = true; n->subquery = (yyvsp[-1].node); n->alias = (yyvsp[0].alias); /* same comment 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 41289 "gram_minimal.c" /* yacc.c:1646 */ break; case 1764: #line 12021 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) (yyvsp[0].jexpr); } #line 41297 "gram_minimal.c" /* yacc.c:1646 */ break; case 1765: #line 12025 "gram_minimal.y" /* yacc.c:1646 */ { (yyvsp[-2].jexpr)->alias = (yyvsp[0].alias); (yyval.node) = (Node *) (yyvsp[-2].jexpr); } #line 41306 "gram_minimal.c" /* yacc.c:1646 */ break; case 1766: #line 12051 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.jexpr) = (yyvsp[-1].jexpr); } #line 41314 "gram_minimal.c" /* yacc.c:1646 */ break; case 1767: #line 12055 "gram_minimal.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 41330 "gram_minimal.c" /* yacc.c:1646 */ break; case 1768: #line 12067 "gram_minimal.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 41347 "gram_minimal.c" /* yacc.c:1646 */ break; case 1769: #line 12080 "gram_minimal.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 41365 "gram_minimal.c" /* yacc.c:1646 */ break; case 1770: #line 12094 "gram_minimal.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 41380 "gram_minimal.c" /* yacc.c:1646 */ break; case 1771: #line 12105 "gram_minimal.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 41396 "gram_minimal.c" /* yacc.c:1646 */ break; case 1772: #line 12120 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.alias) = makeNode(Alias); (yyval.alias)->aliasname = (yyvsp[-3].str); (yyval.alias)->colnames = (yyvsp[-1].list); } #line 41406 "gram_minimal.c" /* yacc.c:1646 */ break; case 1773: #line 12126 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.alias) = makeNode(Alias); (yyval.alias)->aliasname = (yyvsp[0].str); } #line 41415 "gram_minimal.c" /* yacc.c:1646 */ break; case 1774: #line 12131 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.alias) = makeNode(Alias); (yyval.alias)->aliasname = (yyvsp[-3].str); (yyval.alias)->colnames = (yyvsp[-1].list); } #line 41425 "gram_minimal.c" /* yacc.c:1646 */ break; case 1775: #line 12137 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.alias) = makeNode(Alias); (yyval.alias)->aliasname = (yyvsp[0].str); } #line 41434 "gram_minimal.c" /* yacc.c:1646 */ break; case 1776: #line 12143 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.alias) = (yyvsp[0].alias); } #line 41440 "gram_minimal.c" /* yacc.c:1646 */ break; case 1777: #line 12144 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.alias) = NULL; } #line 41446 "gram_minimal.c" /* yacc.c:1646 */ break; case 1778: #line 12153 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make2((yyvsp[0].alias), NIL); } #line 41454 "gram_minimal.c" /* yacc.c:1646 */ break; case 1779: #line 12157 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make2(NULL, (yyvsp[-1].list)); } #line 41462 "gram_minimal.c" /* yacc.c:1646 */ break; case 1780: #line 12161 "gram_minimal.y" /* yacc.c:1646 */ { Alias *a = makeNode(Alias); a->aliasname = (yyvsp[-3].str); (yyval.list) = list_make2(a, (yyvsp[-1].list)); } #line 41472 "gram_minimal.c" /* yacc.c:1646 */ break; case 1781: #line 12167 "gram_minimal.y" /* yacc.c:1646 */ { Alias *a = makeNode(Alias); a->aliasname = (yyvsp[-3].str); (yyval.list) = list_make2(a, (yyvsp[-1].list)); } #line 41482 "gram_minimal.c" /* yacc.c:1646 */ break; case 1782: #line 12173 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make2(NULL, NIL); } #line 41490 "gram_minimal.c" /* yacc.c:1646 */ break; case 1783: #line 12178 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.jtype) = JOIN_FULL; } #line 41496 "gram_minimal.c" /* yacc.c:1646 */ break; case 1784: #line 12179 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.jtype) = JOIN_LEFT; } #line 41502 "gram_minimal.c" /* yacc.c:1646 */ break; case 1785: #line 12180 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.jtype) = JOIN_RIGHT; } #line 41508 "gram_minimal.c" /* yacc.c:1646 */ break; case 1786: #line 12181 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.jtype) = JOIN_INNER; } #line 41514 "gram_minimal.c" /* yacc.c:1646 */ break; case 1787: #line 12185 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = NULL; } #line 41520 "gram_minimal.c" /* yacc.c:1646 */ break; case 1788: #line 12186 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = NULL; } #line 41526 "gram_minimal.c" /* yacc.c:1646 */ break; case 1789: #line 12198 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) (yyvsp[-1].list); } #line 41532 "gram_minimal.c" /* yacc.c:1646 */ break; case 1790: #line 12199 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 41538 "gram_minimal.c" /* yacc.c:1646 */ break; case 1791: #line 12205 "gram_minimal.y" /* yacc.c:1646 */ { /* inheritance query, implicitly */ (yyval.range) = (yyvsp[0].range); (yyval.range)->inh = true; (yyval.range)->alias = NULL; } #line 41549 "gram_minimal.c" /* yacc.c:1646 */ break; case 1792: #line 12212 "gram_minimal.y" /* yacc.c:1646 */ { /* inheritance query, explicitly */ (yyval.range) = (yyvsp[-1].range); (yyval.range)->inh = true; (yyval.range)->alias = NULL; } #line 41560 "gram_minimal.c" /* yacc.c:1646 */ break; case 1793: #line 12219 "gram_minimal.y" /* yacc.c:1646 */ { /* no inheritance */ (yyval.range) = (yyvsp[0].range); (yyval.range)->inh = false; (yyval.range)->alias = NULL; } #line 41571 "gram_minimal.c" /* yacc.c:1646 */ break; case 1794: #line 12226 "gram_minimal.y" /* yacc.c:1646 */ { /* no inheritance, SQL99-style syntax */ (yyval.range) = (yyvsp[-1].range); (yyval.range)->inh = false; (yyval.range)->alias = NULL; } #line 41582 "gram_minimal.c" /* yacc.c:1646 */ break; case 1795: #line 12236 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].range)); } #line 41588 "gram_minimal.c" /* yacc.c:1646 */ break; case 1796: #line 12237 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].range)); } #line 41594 "gram_minimal.c" /* yacc.c:1646 */ break; case 1797: #line 12251 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.range) = (yyvsp[0].range); } #line 41602 "gram_minimal.c" /* yacc.c:1646 */ break; case 1798: #line 12255 "gram_minimal.y" /* yacc.c:1646 */ { Alias *alias = makeNode(Alias); alias->aliasname = (yyvsp[0].str); (yyvsp[-1].range)->alias = alias; (yyval.range) = (yyvsp[-1].range); } #line 41613 "gram_minimal.c" /* yacc.c:1646 */ break; case 1799: #line 12262 "gram_minimal.y" /* yacc.c:1646 */ { Alias *alias = makeNode(Alias); alias->aliasname = (yyvsp[0].str); (yyvsp[-2].range)->alias = alias; (yyval.range) = (yyvsp[-2].range); } #line 41624 "gram_minimal.c" /* yacc.c:1646 */ break; case 1800: #line 12275 "gram_minimal.y" /* yacc.c:1646 */ { RangeTableSample *n = makeNode(RangeTableSample); /* n->relation will be filled in later */ n->method = (yyvsp[-4].list); n->args = (yyvsp[-2].list); n->repeatable = (yyvsp[0].node); n->location = (yylsp[-4]); (yyval.node) = (Node *) n; } #line 41638 "gram_minimal.c" /* yacc.c:1646 */ break; case 1801: #line 12287 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) (yyvsp[-1].node); } #line 41644 "gram_minimal.c" /* yacc.c:1646 */ break; case 1802: #line 12288 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = NULL; } #line 41650 "gram_minimal.c" /* yacc.c:1646 */ break; case 1803: #line 12304 "gram_minimal.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 41664 "gram_minimal.c" /* yacc.c:1646 */ break; case 1804: #line 12314 "gram_minimal.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 41678 "gram_minimal.c" /* yacc.c:1646 */ break; case 1805: #line 12326 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make2((yyvsp[-1].node), (yyvsp[0].list)); } #line 41684 "gram_minimal.c" /* yacc.c:1646 */ break; case 1806: #line 12330 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].list)); } #line 41690 "gram_minimal.c" /* yacc.c:1646 */ break; case 1807: #line 12331 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].list)); } #line 41696 "gram_minimal.c" /* yacc.c:1646 */ break; case 1808: #line 12334 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[-1].list); } #line 41702 "gram_minimal.c" /* yacc.c:1646 */ break; case 1809: #line 12335 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 41708 "gram_minimal.c" /* yacc.c:1646 */ break; case 1810: #line 12338 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.boolean) = true; } #line 41714 "gram_minimal.c" /* yacc.c:1646 */ break; case 1811: #line 12339 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.boolean) = false; } #line 41720 "gram_minimal.c" /* yacc.c:1646 */ break; case 1812: #line 12344 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 41726 "gram_minimal.c" /* yacc.c:1646 */ break; case 1813: #line 12345 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = NULL; } #line 41732 "gram_minimal.c" /* yacc.c:1646 */ break; case 1814: #line 12350 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 41738 "gram_minimal.c" /* yacc.c:1646 */ break; case 1815: #line 12352 "gram_minimal.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 41750 "gram_minimal.c" /* yacc.c:1646 */ break; case 1816: #line 12359 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = NULL; } #line 41756 "gram_minimal.c" /* yacc.c:1646 */ break; case 1817: #line 12364 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 41762 "gram_minimal.c" /* yacc.c:1646 */ break; case 1818: #line 12365 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 41768 "gram_minimal.c" /* yacc.c:1646 */ break; case 1819: #line 12370 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].node)); } #line 41776 "gram_minimal.c" /* yacc.c:1646 */ break; case 1820: #line 12374 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].node)); } #line 41784 "gram_minimal.c" /* yacc.c:1646 */ break; case 1821: #line 12380 "gram_minimal.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 41806 "gram_minimal.c" /* yacc.c:1646 */ break; case 1822: #line 12404 "gram_minimal.y" /* yacc.c:1646 */ { RangeTableFunc *n = makeNode(RangeTableFunc); n->rowexpr = (yyvsp[-4].node); n->docexpr = (yyvsp[-3].node); n->columns = (yyvsp[-1].list); n->namespaces = NIL; n->location = (yylsp[-6]); (yyval.node) = (Node *)n; } #line 41820 "gram_minimal.c" /* yacc.c:1646 */ break; case 1823: #line 12415 "gram_minimal.y" /* yacc.c:1646 */ { RangeTableFunc *n = makeNode(RangeTableFunc); n->rowexpr = (yyvsp[-4].node); n->docexpr = (yyvsp[-3].node); n->columns = (yyvsp[-1].list); n->namespaces = (yyvsp[-7].list); n->location = (yylsp[-11]); (yyval.node) = (Node *)n; } #line 41834 "gram_minimal.c" /* yacc.c:1646 */ break; case 1824: #line 12426 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].node)); } #line 41840 "gram_minimal.c" /* yacc.c:1646 */ break; case 1825: #line 12427 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].node)); } #line 41846 "gram_minimal.c" /* yacc.c:1646 */ break; case 1826: #line 12432 "gram_minimal.y" /* yacc.c:1646 */ { RangeTableFuncCol *fc = makeNode(RangeTableFuncCol); fc->colname = (yyvsp[-1].str); fc->for_ordinality = false; fc->typeName = (yyvsp[0].typnam); fc->is_not_null = false; fc->colexpr = NULL; fc->coldefexpr = NULL; fc->location = (yylsp[-1]); (yyval.node) = (Node *) fc; } #line 41864 "gram_minimal.c" /* yacc.c:1646 */ break; case 1827: #line 12446 "gram_minimal.y" /* yacc.c:1646 */ { RangeTableFuncCol *fc = makeNode(RangeTableFuncCol); ListCell *option; bool nullability_seen = false; fc->colname = (yyvsp[-2].str); fc->typeName = (yyvsp[-1].typnam); fc->for_ordinality = false; fc->is_not_null = false; fc->colexpr = NULL; fc->coldefexpr = NULL; fc->location = (yylsp[-2]); foreach(option, (yyvsp[0].list)) { DefElem *defel = (DefElem *) lfirst(option); if (strcmp(defel->defname, "default") == 0) { if (fc->coldefexpr != NULL) ereport(ERROR, (errcode(ERRCODE_SYNTAX_ERROR), errmsg("only one DEFAULT value is allowed"), parser_errposition(defel->location))); fc->coldefexpr = defel->arg; } else if (strcmp(defel->defname, "path") == 0) { if (fc->colexpr != NULL) ereport(ERROR, (errcode(ERRCODE_SYNTAX_ERROR), errmsg("only one PATH value per column is allowed"), parser_errposition(defel->location))); fc->colexpr = defel->arg; } else if (strcmp(defel->defname, "is_not_null") == 0) { if (nullability_seen) ereport(ERROR, (errcode(ERRCODE_SYNTAX_ERROR), errmsg("conflicting or redundant NULL / NOT NULL declarations for column \"%s\"", fc->colname), parser_errposition(defel->location))); fc->is_not_null = intVal(defel->arg); nullability_seen = true; } else { ereport(ERROR, (errcode(ERRCODE_SYNTAX_ERROR), errmsg("unrecognized column option \"%s\"", defel->defname), parser_errposition(defel->location))); } } (yyval.node) = (Node *) fc; } #line 41925 "gram_minimal.c" /* yacc.c:1646 */ break; case 1828: #line 12503 "gram_minimal.y" /* yacc.c:1646 */ { RangeTableFuncCol *fc = makeNode(RangeTableFuncCol); fc->colname = (yyvsp[-2].str); fc->for_ordinality = true; /* other fields are ignored, initialized by makeNode */ fc->location = (yylsp[-2]); (yyval.node) = (Node *) fc; } #line 41940 "gram_minimal.c" /* yacc.c:1646 */ break; case 1829: #line 12517 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].defelt)); } #line 41946 "gram_minimal.c" /* yacc.c:1646 */ break; case 1830: #line 12519 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-1].list), (yyvsp[0].defelt)); } #line 41952 "gram_minimal.c" /* yacc.c:1646 */ break; case 1831: #line 12524 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem((yyvsp[-1].str), (yyvsp[0].node), (yylsp[-1])); } #line 41958 "gram_minimal.c" /* yacc.c:1646 */ break; case 1832: #line 12526 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("default", (yyvsp[0].node), (yylsp[-1])); } #line 41964 "gram_minimal.c" /* yacc.c:1646 */ break; case 1833: #line 12528 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("is_not_null", (Node *) makeInteger(true), (yylsp[-1])); } #line 41970 "gram_minimal.c" /* yacc.c:1646 */ break; case 1834: #line 12530 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.defelt) = makeDefElem("is_not_null", (Node *) makeInteger(false), (yylsp[0])); } #line 41976 "gram_minimal.c" /* yacc.c:1646 */ break; case 1835: #line 12535 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].target)); } #line 41982 "gram_minimal.c" /* yacc.c:1646 */ break; case 1836: #line 12537 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].target)); } #line 41988 "gram_minimal.c" /* yacc.c:1646 */ break; case 1837: #line 12542 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.target) = makeNode(ResTarget); (yyval.target)->name = (yyvsp[0].str); (yyval.target)->indirection = NIL; (yyval.target)->val = (yyvsp[-2].node); (yyval.target)->location = (yylsp[-2]); } #line 42000 "gram_minimal.c" /* yacc.c:1646 */ break; case 1838: #line 12550 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.target) = makeNode(ResTarget); (yyval.target)->name = NULL; (yyval.target)->indirection = NIL; (yyval.target)->val = (yyvsp[0].node); (yyval.target)->location = (yylsp[-1]); } #line 42012 "gram_minimal.c" /* yacc.c:1646 */ break; case 1839: #line 12570 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.typnam) = (yyvsp[-1].typnam); (yyval.typnam)->arrayBounds = (yyvsp[0].list); } #line 42021 "gram_minimal.c" /* yacc.c:1646 */ break; case 1840: #line 12575 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.typnam) = (yyvsp[-1].typnam); (yyval.typnam)->arrayBounds = (yyvsp[0].list); (yyval.typnam)->setof = true; } #line 42031 "gram_minimal.c" /* yacc.c:1646 */ break; case 1841: #line 12582 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.typnam) = (yyvsp[-4].typnam); (yyval.typnam)->arrayBounds = list_make1(makeInteger((yyvsp[-1].ival))); } #line 42040 "gram_minimal.c" /* yacc.c:1646 */ break; case 1842: #line 12587 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.typnam) = (yyvsp[-4].typnam); (yyval.typnam)->arrayBounds = list_make1(makeInteger((yyvsp[-1].ival))); (yyval.typnam)->setof = true; } #line 42050 "gram_minimal.c" /* yacc.c:1646 */ break; case 1843: #line 12593 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.typnam) = (yyvsp[-1].typnam); (yyval.typnam)->arrayBounds = list_make1(makeInteger(-1)); } #line 42059 "gram_minimal.c" /* yacc.c:1646 */ break; case 1844: #line 12598 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.typnam) = (yyvsp[-1].typnam); (yyval.typnam)->arrayBounds = list_make1(makeInteger(-1)); (yyval.typnam)->setof = true; } #line 42069 "gram_minimal.c" /* yacc.c:1646 */ break; case 1845: #line 12607 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), makeInteger(-1)); } #line 42075 "gram_minimal.c" /* yacc.c:1646 */ break; case 1846: #line 12609 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-3].list), makeInteger((yyvsp[-1].ival))); } #line 42081 "gram_minimal.c" /* yacc.c:1646 */ break; case 1847: #line 12611 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 42087 "gram_minimal.c" /* yacc.c:1646 */ break; case 1848: #line 12615 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.typnam) = (yyvsp[0].typnam); } #line 42093 "gram_minimal.c" /* yacc.c:1646 */ break; case 1849: #line 12616 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.typnam) = (yyvsp[0].typnam); } #line 42099 "gram_minimal.c" /* yacc.c:1646 */ break; case 1850: #line 12617 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.typnam) = (yyvsp[0].typnam); } #line 42105 "gram_minimal.c" /* yacc.c:1646 */ break; case 1851: #line 12618 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.typnam) = (yyvsp[0].typnam); } #line 42111 "gram_minimal.c" /* yacc.c:1646 */ break; case 1852: #line 12619 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.typnam) = (yyvsp[0].typnam); } #line 42117 "gram_minimal.c" /* yacc.c:1646 */ break; case 1853: #line 12621 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.typnam) = (yyvsp[-1].typnam); (yyval.typnam)->typmods = (yyvsp[0].list); } #line 42126 "gram_minimal.c" /* yacc.c:1646 */ break; case 1854: #line 12626 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.typnam) = (yyvsp[-3].typnam); (yyval.typnam)->typmods = list_make2(makeIntConst(INTERVAL_FULL_RANGE, -1), makeIntConst((yyvsp[-1].ival), (yylsp[-1]))); } #line 42136 "gram_minimal.c" /* yacc.c:1646 */ break; case 1855: #line 12645 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.typnam) = (yyvsp[0].typnam); } #line 42142 "gram_minimal.c" /* yacc.c:1646 */ break; case 1856: #line 12646 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.typnam) = (yyvsp[0].typnam); } #line 42148 "gram_minimal.c" /* yacc.c:1646 */ break; case 1857: #line 12647 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.typnam) = (yyvsp[0].typnam); } #line 42154 "gram_minimal.c" /* yacc.c:1646 */ break; case 1858: #line 12648 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.typnam) = (yyvsp[0].typnam); } #line 42160 "gram_minimal.c" /* yacc.c:1646 */ break; case 1859: #line 12660 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.typnam) = makeTypeName((yyvsp[-1].str)); (yyval.typnam)->typmods = (yyvsp[0].list); (yyval.typnam)->location = (yylsp[-1]); } #line 42170 "gram_minimal.c" /* yacc.c:1646 */ break; case 1860: #line 12666 "gram_minimal.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 42180 "gram_minimal.c" /* yacc.c:1646 */ break; case 1861: #line 12673 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[-1].list); } #line 42186 "gram_minimal.c" /* yacc.c:1646 */ break; case 1862: #line 12674 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 42192 "gram_minimal.c" /* yacc.c:1646 */ break; case 1863: #line 12681 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.typnam) = SystemTypeName("int4"); (yyval.typnam)->location = (yylsp[0]); } #line 42201 "gram_minimal.c" /* yacc.c:1646 */ break; case 1864: #line 12686 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.typnam) = SystemTypeName("int4"); (yyval.typnam)->location = (yylsp[0]); } #line 42210 "gram_minimal.c" /* yacc.c:1646 */ break; case 1865: #line 12691 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.typnam) = SystemTypeName("int2"); (yyval.typnam)->location = (yylsp[0]); } #line 42219 "gram_minimal.c" /* yacc.c:1646 */ break; case 1866: #line 12696 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.typnam) = SystemTypeName("int8"); (yyval.typnam)->location = (yylsp[0]); } #line 42228 "gram_minimal.c" /* yacc.c:1646 */ break; case 1867: #line 12701 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.typnam) = SystemTypeName("float4"); (yyval.typnam)->location = (yylsp[0]); } #line 42237 "gram_minimal.c" /* yacc.c:1646 */ break; case 1868: #line 12706 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.typnam) = (yyvsp[0].typnam); (yyval.typnam)->location = (yylsp[-1]); } #line 42246 "gram_minimal.c" /* yacc.c:1646 */ break; case 1869: #line 12711 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.typnam) = SystemTypeName("float8"); (yyval.typnam)->location = (yylsp[-1]); } #line 42255 "gram_minimal.c" /* yacc.c:1646 */ break; case 1870: #line 12716 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.typnam) = SystemTypeName("numeric"); (yyval.typnam)->typmods = (yyvsp[0].list); (yyval.typnam)->location = (yylsp[-1]); } #line 42265 "gram_minimal.c" /* yacc.c:1646 */ break; case 1871: #line 12722 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.typnam) = SystemTypeName("numeric"); (yyval.typnam)->typmods = (yyvsp[0].list); (yyval.typnam)->location = (yylsp[-1]); } #line 42275 "gram_minimal.c" /* yacc.c:1646 */ break; case 1872: #line 12728 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.typnam) = SystemTypeName("numeric"); (yyval.typnam)->typmods = (yyvsp[0].list); (yyval.typnam)->location = (yylsp[-1]); } #line 42285 "gram_minimal.c" /* yacc.c:1646 */ break; case 1873: #line 12734 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.typnam) = SystemTypeName("bool"); (yyval.typnam)->location = (yylsp[0]); } #line 42294 "gram_minimal.c" /* yacc.c:1646 */ break; case 1874: #line 12741 "gram_minimal.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 42319 "gram_minimal.c" /* yacc.c:1646 */ break; case 1875: #line 12762 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.typnam) = SystemTypeName("float8"); } #line 42327 "gram_minimal.c" /* yacc.c:1646 */ break; case 1876: #line 12772 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.typnam) = (yyvsp[0].typnam); } #line 42335 "gram_minimal.c" /* yacc.c:1646 */ break; case 1877: #line 12776 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.typnam) = (yyvsp[0].typnam); } #line 42343 "gram_minimal.c" /* yacc.c:1646 */ break; case 1878: #line 12784 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.typnam) = (yyvsp[0].typnam); } #line 42351 "gram_minimal.c" /* yacc.c:1646 */ break; case 1879: #line 12788 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.typnam) = (yyvsp[0].typnam); (yyval.typnam)->typmods = NIL; } #line 42360 "gram_minimal.c" /* yacc.c:1646 */ break; case 1880: #line 12796 "gram_minimal.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 42373 "gram_minimal.c" /* yacc.c:1646 */ break; case 1881: #line 12808 "gram_minimal.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 42391 "gram_minimal.c" /* yacc.c:1646 */ break; case 1882: #line 12829 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.typnam) = (yyvsp[0].typnam); } #line 42399 "gram_minimal.c" /* yacc.c:1646 */ break; case 1883: #line 12833 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.typnam) = (yyvsp[0].typnam); } #line 42407 "gram_minimal.c" /* yacc.c:1646 */ break; case 1884: #line 12839 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.typnam) = (yyvsp[0].typnam); } #line 42415 "gram_minimal.c" /* yacc.c:1646 */ break; case 1885: #line 12843 "gram_minimal.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 42430 "gram_minimal.c" /* yacc.c:1646 */ break; case 1886: #line 12856 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.typnam) = SystemTypeName((yyvsp[-3].str)); (yyval.typnam)->typmods = list_make1(makeIntConst((yyvsp[-1].ival), (yylsp[-1]))); (yyval.typnam)->location = (yylsp[-3]); } #line 42440 "gram_minimal.c" /* yacc.c:1646 */ break; case 1887: #line 12864 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.typnam) = SystemTypeName((yyvsp[0].str)); /* char defaults to char(1), varchar to no limit */ if (strcmp((yyvsp[0].str), "bpchar") == 0) (yyval.typnam)->typmods = list_make1(makeIntConst(1, -1)); (yyval.typnam)->location = (yylsp[0]); } #line 42452 "gram_minimal.c" /* yacc.c:1646 */ break; case 1888: #line 12874 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].boolean) ? "varchar": "bpchar"; } #line 42458 "gram_minimal.c" /* yacc.c:1646 */ break; case 1889: #line 12876 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].boolean) ? "varchar": "bpchar"; } #line 42464 "gram_minimal.c" /* yacc.c:1646 */ break; case 1890: #line 12878 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = "varchar"; } #line 42470 "gram_minimal.c" /* yacc.c:1646 */ break; case 1891: #line 12880 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].boolean) ? "varchar": "bpchar"; } #line 42476 "gram_minimal.c" /* yacc.c:1646 */ break; case 1892: #line 12882 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].boolean) ? "varchar": "bpchar"; } #line 42482 "gram_minimal.c" /* yacc.c:1646 */ break; case 1893: #line 12884 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].boolean) ? "varchar": "bpchar"; } #line 42488 "gram_minimal.c" /* yacc.c:1646 */ break; case 1894: #line 12888 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.boolean) = true; } #line 42494 "gram_minimal.c" /* yacc.c:1646 */ break; case 1895: #line 12889 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.boolean) = false; } #line 42500 "gram_minimal.c" /* yacc.c:1646 */ break; case 1896: #line 12897 "gram_minimal.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 42513 "gram_minimal.c" /* yacc.c:1646 */ break; case 1897: #line 12906 "gram_minimal.y" /* yacc.c:1646 */ { if ((yyvsp[0].boolean)) (yyval.typnam) = SystemTypeName("timestamptz"); else (yyval.typnam) = SystemTypeName("timestamp"); (yyval.typnam)->location = (yylsp[-1]); } #line 42525 "gram_minimal.c" /* yacc.c:1646 */ break; case 1898: #line 12914 "gram_minimal.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 42538 "gram_minimal.c" /* yacc.c:1646 */ break; case 1899: #line 12923 "gram_minimal.y" /* yacc.c:1646 */ { if ((yyvsp[0].boolean)) (yyval.typnam) = SystemTypeName("timetz"); else (yyval.typnam) = SystemTypeName("time"); (yyval.typnam)->location = (yylsp[-1]); } #line 42550 "gram_minimal.c" /* yacc.c:1646 */ break; case 1900: #line 12934 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.typnam) = SystemTypeName("interval"); (yyval.typnam)->location = (yylsp[0]); } #line 42559 "gram_minimal.c" /* yacc.c:1646 */ break; case 1901: #line 12941 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.boolean) = true; } #line 42565 "gram_minimal.c" /* yacc.c:1646 */ break; case 1902: #line 12942 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.boolean) = false; } #line 42571 "gram_minimal.c" /* yacc.c:1646 */ break; case 1903: #line 12943 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.boolean) = false; } #line 42577 "gram_minimal.c" /* yacc.c:1646 */ break; case 1904: #line 12948 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1(makeIntConst(INTERVAL_MASK(YEAR), (yylsp[0]))); } #line 42583 "gram_minimal.c" /* yacc.c:1646 */ break; case 1905: #line 12950 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1(makeIntConst(INTERVAL_MASK(MONTH), (yylsp[0]))); } #line 42589 "gram_minimal.c" /* yacc.c:1646 */ break; case 1906: #line 12952 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1(makeIntConst(INTERVAL_MASK(DAY), (yylsp[0]))); } #line 42595 "gram_minimal.c" /* yacc.c:1646 */ break; case 1907: #line 12954 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1(makeIntConst(INTERVAL_MASK(HOUR), (yylsp[0]))); } #line 42601 "gram_minimal.c" /* yacc.c:1646 */ break; case 1908: #line 12956 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1(makeIntConst(INTERVAL_MASK(MINUTE), (yylsp[0]))); } #line 42607 "gram_minimal.c" /* yacc.c:1646 */ break; case 1909: #line 12958 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 42613 "gram_minimal.c" /* yacc.c:1646 */ break; case 1910: #line 12960 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1(makeIntConst(INTERVAL_MASK(YEAR) | INTERVAL_MASK(MONTH), (yylsp[-2]))); } #line 42622 "gram_minimal.c" /* yacc.c:1646 */ break; case 1911: #line 12965 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1(makeIntConst(INTERVAL_MASK(DAY) | INTERVAL_MASK(HOUR), (yylsp[-2]))); } #line 42631 "gram_minimal.c" /* yacc.c:1646 */ break; case 1912: #line 12970 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1(makeIntConst(INTERVAL_MASK(DAY) | INTERVAL_MASK(HOUR) | INTERVAL_MASK(MINUTE), (yylsp[-2]))); } #line 42641 "gram_minimal.c" /* yacc.c:1646 */ break; case 1913: #line 12976 "gram_minimal.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 42653 "gram_minimal.c" /* yacc.c:1646 */ break; case 1914: #line 12984 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1(makeIntConst(INTERVAL_MASK(HOUR) | INTERVAL_MASK(MINUTE), (yylsp[-2]))); } #line 42662 "gram_minimal.c" /* yacc.c:1646 */ break; case 1915: #line 12989 "gram_minimal.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 42673 "gram_minimal.c" /* yacc.c:1646 */ break; case 1916: #line 12996 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); linitial((yyval.list)) = makeIntConst(INTERVAL_MASK(MINUTE) | INTERVAL_MASK(SECOND), (yylsp[-2])); } #line 42683 "gram_minimal.c" /* yacc.c:1646 */ break; case 1917: #line 13002 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 42689 "gram_minimal.c" /* yacc.c:1646 */ break; case 1918: #line 13007 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1(makeIntConst(INTERVAL_MASK(SECOND), (yylsp[0]))); } #line 42697 "gram_minimal.c" /* yacc.c:1646 */ break; case 1919: #line 13011 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make2(makeIntConst(INTERVAL_MASK(SECOND), (yylsp[-3])), makeIntConst((yyvsp[-1].ival), (yylsp[-1]))); } #line 42706 "gram_minimal.c" /* yacc.c:1646 */ break; case 1920: #line 13046 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 42712 "gram_minimal.c" /* yacc.c:1646 */ break; case 1921: #line 13048 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = makeTypeCast((yyvsp[-2].node), (yyvsp[0].typnam), (yylsp[-1])); } #line 42718 "gram_minimal.c" /* yacc.c:1646 */ break; case 1922: #line 13050 "gram_minimal.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 42730 "gram_minimal.c" /* yacc.c:1646 */ break; case 1923: #line 13058 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeFuncCall(SystemFuncName("timezone"), list_make2((yyvsp[0].node), (yyvsp[-4].node)), (yylsp[-3])); } #line 42740 "gram_minimal.c" /* yacc.c:1646 */ break; case 1924: #line 13073 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OP, "+", NULL, (yyvsp[0].node), (yylsp[-1])); } #line 42746 "gram_minimal.c" /* yacc.c:1646 */ break; case 1925: #line 13075 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = doNegate((yyvsp[0].node), (yylsp[-1])); } #line 42752 "gram_minimal.c" /* yacc.c:1646 */ break; case 1926: #line 13077 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OP, "+", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 42758 "gram_minimal.c" /* yacc.c:1646 */ break; case 1927: #line 13079 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OP, "-", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 42764 "gram_minimal.c" /* yacc.c:1646 */ break; case 1928: #line 13081 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OP, "*", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 42770 "gram_minimal.c" /* yacc.c:1646 */ break; case 1929: #line 13083 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OP, "/", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 42776 "gram_minimal.c" /* yacc.c:1646 */ break; case 1930: #line 13085 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OP, "%", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 42782 "gram_minimal.c" /* yacc.c:1646 */ break; case 1931: #line 13087 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OP, "^", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 42788 "gram_minimal.c" /* yacc.c:1646 */ break; case 1932: #line 13089 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OP, "<", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 42794 "gram_minimal.c" /* yacc.c:1646 */ break; case 1933: #line 13091 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OP, ">", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 42800 "gram_minimal.c" /* yacc.c:1646 */ break; case 1934: #line 13093 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OP, "=", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 42806 "gram_minimal.c" /* yacc.c:1646 */ break; case 1935: #line 13095 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OP, "<=", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 42812 "gram_minimal.c" /* yacc.c:1646 */ break; case 1936: #line 13097 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OP, ">=", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 42818 "gram_minimal.c" /* yacc.c:1646 */ break; case 1937: #line 13099 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OP, "<>", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 42824 "gram_minimal.c" /* yacc.c:1646 */ break; case 1938: #line 13102 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeA_Expr(AEXPR_OP, (yyvsp[-1].list), (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 42830 "gram_minimal.c" /* yacc.c:1646 */ break; case 1939: #line 13104 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeA_Expr(AEXPR_OP, (yyvsp[-1].list), NULL, (yyvsp[0].node), (yylsp[-1])); } #line 42836 "gram_minimal.c" /* yacc.c:1646 */ break; case 1940: #line 13106 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeA_Expr(AEXPR_OP, (yyvsp[0].list), (yyvsp[-1].node), NULL, (yylsp[0])); } #line 42842 "gram_minimal.c" /* yacc.c:1646 */ break; case 1941: #line 13109 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = makeAndExpr((yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 42848 "gram_minimal.c" /* yacc.c:1646 */ break; case 1942: #line 13111 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = makeOrExpr((yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 42854 "gram_minimal.c" /* yacc.c:1646 */ break; case 1943: #line 13113 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = makeNotExpr((yyvsp[0].node), (yylsp[-1])); } #line 42860 "gram_minimal.c" /* yacc.c:1646 */ break; case 1944: #line 13115 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = makeNotExpr((yyvsp[0].node), (yylsp[-1])); } #line 42866 "gram_minimal.c" /* yacc.c:1646 */ break; case 1945: #line 13118 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_LIKE, "~~", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 42875 "gram_minimal.c" /* yacc.c:1646 */ break; case 1946: #line 13123 "gram_minimal.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_LIKE, "~~", (yyvsp[-4].node), (Node *) n, (yylsp[-3])); } #line 42887 "gram_minimal.c" /* yacc.c:1646 */ break; case 1947: #line 13131 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_LIKE, "!~~", (yyvsp[-3].node), (yyvsp[0].node), (yylsp[-2])); } #line 42896 "gram_minimal.c" /* yacc.c:1646 */ break; case 1948: #line 13136 "gram_minimal.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_LIKE, "!~~", (yyvsp[-5].node), (Node *) n, (yylsp[-4])); } #line 42908 "gram_minimal.c" /* yacc.c:1646 */ break; case 1949: #line 13144 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_ILIKE, "~~*", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 42917 "gram_minimal.c" /* yacc.c:1646 */ break; case 1950: #line 13149 "gram_minimal.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_ILIKE, "~~*", (yyvsp[-4].node), (Node *) n, (yylsp[-3])); } #line 42929 "gram_minimal.c" /* yacc.c:1646 */ break; case 1951: #line 13157 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_ILIKE, "!~~*", (yyvsp[-3].node), (yyvsp[0].node), (yylsp[-2])); } #line 42938 "gram_minimal.c" /* yacc.c:1646 */ break; case 1952: #line 13162 "gram_minimal.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_ILIKE, "!~~*", (yyvsp[-5].node), (Node *) n, (yylsp[-4])); } #line 42950 "gram_minimal.c" /* yacc.c:1646 */ break; case 1953: #line 13171 "gram_minimal.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_SIMILAR, "~", (yyvsp[-3].node), (Node *) n, (yylsp[-2])); } #line 42962 "gram_minimal.c" /* yacc.c:1646 */ break; case 1954: #line 13179 "gram_minimal.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_SIMILAR, "~", (yyvsp[-5].node), (Node *) n, (yylsp[-4])); } #line 42974 "gram_minimal.c" /* yacc.c:1646 */ break; case 1955: #line 13187 "gram_minimal.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_SIMILAR, "!~", (yyvsp[-4].node), (Node *) n, (yylsp[-3])); } #line 42986 "gram_minimal.c" /* yacc.c:1646 */ break; case 1956: #line 13195 "gram_minimal.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_SIMILAR, "!~", (yyvsp[-6].node), (Node *) n, (yylsp[-5])); } #line 42998 "gram_minimal.c" /* yacc.c:1646 */ break; case 1957: #line 13213 "gram_minimal.y" /* yacc.c:1646 */ { NullTest *n = makeNode(NullTest); n->arg = (Expr *) (yyvsp[-2].node); n->nulltesttype = IS_NULL; n->location = (yylsp[-1]); (yyval.node) = (Node *)n; } #line 43010 "gram_minimal.c" /* yacc.c:1646 */ break; case 1958: #line 13221 "gram_minimal.y" /* yacc.c:1646 */ { NullTest *n = makeNode(NullTest); n->arg = (Expr *) (yyvsp[-1].node); n->nulltesttype = IS_NULL; n->location = (yylsp[0]); (yyval.node) = (Node *)n; } #line 43022 "gram_minimal.c" /* yacc.c:1646 */ break; case 1959: #line 13229 "gram_minimal.y" /* yacc.c:1646 */ { NullTest *n = makeNode(NullTest); n->arg = (Expr *) (yyvsp[-3].node); n->nulltesttype = IS_NOT_NULL; n->location = (yylsp[-2]); (yyval.node) = (Node *)n; } #line 43034 "gram_minimal.c" /* yacc.c:1646 */ break; case 1960: #line 13237 "gram_minimal.y" /* yacc.c:1646 */ { NullTest *n = makeNode(NullTest); n->arg = (Expr *) (yyvsp[-1].node); n->nulltesttype = IS_NOT_NULL; n->location = (yylsp[0]); (yyval.node) = (Node *)n; } #line 43046 "gram_minimal.c" /* yacc.c:1646 */ break; case 1961: #line 13245 "gram_minimal.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 43066 "gram_minimal.c" /* yacc.c:1646 */ break; case 1962: #line 13261 "gram_minimal.y" /* yacc.c:1646 */ { BooleanTest *b = makeNode(BooleanTest); b->arg = (Expr *) (yyvsp[-2].node); b->booltesttype = IS_TRUE; b->location = (yylsp[-1]); (yyval.node) = (Node *)b; } #line 43078 "gram_minimal.c" /* yacc.c:1646 */ break; case 1963: #line 13269 "gram_minimal.y" /* yacc.c:1646 */ { BooleanTest *b = makeNode(BooleanTest); b->arg = (Expr *) (yyvsp[-3].node); b->booltesttype = IS_NOT_TRUE; b->location = (yylsp[-2]); (yyval.node) = (Node *)b; } #line 43090 "gram_minimal.c" /* yacc.c:1646 */ break; case 1964: #line 13277 "gram_minimal.y" /* yacc.c:1646 */ { BooleanTest *b = makeNode(BooleanTest); b->arg = (Expr *) (yyvsp[-2].node); b->booltesttype = IS_FALSE; b->location = (yylsp[-1]); (yyval.node) = (Node *)b; } #line 43102 "gram_minimal.c" /* yacc.c:1646 */ break; case 1965: #line 13285 "gram_minimal.y" /* yacc.c:1646 */ { BooleanTest *b = makeNode(BooleanTest); b->arg = (Expr *) (yyvsp[-3].node); b->booltesttype = IS_NOT_FALSE; b->location = (yylsp[-2]); (yyval.node) = (Node *)b; } #line 43114 "gram_minimal.c" /* yacc.c:1646 */ break; case 1966: #line 13293 "gram_minimal.y" /* yacc.c:1646 */ { BooleanTest *b = makeNode(BooleanTest); b->arg = (Expr *) (yyvsp[-2].node); b->booltesttype = IS_UNKNOWN; b->location = (yylsp[-1]); (yyval.node) = (Node *)b; } #line 43126 "gram_minimal.c" /* yacc.c:1646 */ break; case 1967: #line 13301 "gram_minimal.y" /* yacc.c:1646 */ { BooleanTest *b = makeNode(BooleanTest); b->arg = (Expr *) (yyvsp[-3].node); b->booltesttype = IS_NOT_UNKNOWN; b->location = (yylsp[-2]); (yyval.node) = (Node *)b; } #line 43138 "gram_minimal.c" /* yacc.c:1646 */ break; case 1968: #line 13309 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_DISTINCT, "=", (yyvsp[-4].node), (yyvsp[0].node), (yylsp[-3])); } #line 43146 "gram_minimal.c" /* yacc.c:1646 */ break; case 1969: #line 13313 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_NOT_DISTINCT, "=", (yyvsp[-5].node), (yyvsp[0].node), (yylsp[-4])); } #line 43154 "gram_minimal.c" /* yacc.c:1646 */ break; case 1970: #line 13317 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OF, "=", (yyvsp[-5].node), (Node *) (yyvsp[-1].list), (yylsp[-4])); } #line 43162 "gram_minimal.c" /* yacc.c:1646 */ break; case 1971: #line 13321 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OF, "<>", (yyvsp[-6].node), (Node *) (yyvsp[-1].list), (yylsp[-5])); } #line 43170 "gram_minimal.c" /* yacc.c:1646 */ break; case 1972: #line 13325 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_BETWEEN, "BETWEEN", (yyvsp[-5].node), (Node *) list_make2((yyvsp[-2].node), (yyvsp[0].node)), (yylsp[-4])); } #line 43182 "gram_minimal.c" /* yacc.c:1646 */ break; case 1973: #line 13333 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_NOT_BETWEEN, "NOT BETWEEN", (yyvsp[-6].node), (Node *) list_make2((yyvsp[-2].node), (yyvsp[0].node)), (yylsp[-5])); } #line 43194 "gram_minimal.c" /* yacc.c:1646 */ break; case 1974: #line 13341 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_BETWEEN_SYM, "BETWEEN SYMMETRIC", (yyvsp[-5].node), (Node *) list_make2((yyvsp[-2].node), (yyvsp[0].node)), (yylsp[-4])); } #line 43206 "gram_minimal.c" /* yacc.c:1646 */ break; case 1975: #line 13349 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_NOT_BETWEEN_SYM, "NOT BETWEEN SYMMETRIC", (yyvsp[-6].node), (Node *) list_make2((yyvsp[-2].node), (yyvsp[0].node)), (yylsp[-5])); } #line 43218 "gram_minimal.c" /* yacc.c:1646 */ break; case 1976: #line 13357 "gram_minimal.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->subLinkId = 0; n->testexpr = (yyvsp[-2].node); n->operName = NIL; /* show it's IN not = ANY */ 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 43242 "gram_minimal.c" /* yacc.c:1646 */ break; case 1977: #line 13377 "gram_minimal.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->subLinkId = 0; n->testexpr = (yyvsp[-3].node); n->operName = NIL; /* show it's IN not = ANY */ n->location = (yylsp[-2]); /* Stick a NOT on top; must have same parse location */ (yyval.node) = makeNotExpr((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 43268 "gram_minimal.c" /* yacc.c:1646 */ break; case 1978: #line 13399 "gram_minimal.y" /* yacc.c:1646 */ { SubLink *n = makeNode(SubLink); n->subLinkType = (yyvsp[-1].ival); n->subLinkId = 0; n->testexpr = (yyvsp[-3].node); n->operName = (yyvsp[-2].list); n->subselect = (yyvsp[0].node); n->location = (yylsp[-2]); (yyval.node) = (Node *)n; } #line 43283 "gram_minimal.c" /* yacc.c:1646 */ break; case 1979: #line 13410 "gram_minimal.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 43294 "gram_minimal.c" /* yacc.c:1646 */ break; case 1980: #line 13417 "gram_minimal.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 43314 "gram_minimal.c" /* yacc.c:1646 */ break; case 1981: #line 13433 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = makeXmlExpr(IS_DOCUMENT, NULL, NIL, list_make1((yyvsp[-2].node)), (yylsp[-1])); } #line 43323 "gram_minimal.c" /* yacc.c:1646 */ break; case 1982: #line 13438 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = makeNotExpr(makeXmlExpr(IS_DOCUMENT, NULL, NIL, list_make1((yyvsp[-3].node)), (yylsp[-2])), (yylsp[-2])); } #line 43333 "gram_minimal.c" /* yacc.c:1646 */ break; case 1983: #line 13444 "gram_minimal.y" /* yacc.c:1646 */ { /* * The SQL spec only allows DEFAULT in "contextually typed * expressions", but for us, it's easier to allow it in * any a_expr and then throw error during parse analysis * if it's in an inappropriate context. This way also * lets us say something smarter than "syntax error". */ SetToDefault *n = makeNode(SetToDefault); /* parse analysis will fill in the rest */ n->location = (yylsp[0]); (yyval.node) = (Node *)n; } #line 43351 "gram_minimal.c" /* yacc.c:1646 */ break; case 1984: #line 13469 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 43357 "gram_minimal.c" /* yacc.c:1646 */ break; case 1985: #line 13471 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = makeTypeCast((yyvsp[-2].node), (yyvsp[0].typnam), (yylsp[-1])); } #line 43363 "gram_minimal.c" /* yacc.c:1646 */ break; case 1986: #line 13473 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OP, "+", NULL, (yyvsp[0].node), (yylsp[-1])); } #line 43369 "gram_minimal.c" /* yacc.c:1646 */ break; case 1987: #line 13475 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = doNegate((yyvsp[0].node), (yylsp[-1])); } #line 43375 "gram_minimal.c" /* yacc.c:1646 */ break; case 1988: #line 13477 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OP, "+", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 43381 "gram_minimal.c" /* yacc.c:1646 */ break; case 1989: #line 13479 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OP, "-", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 43387 "gram_minimal.c" /* yacc.c:1646 */ break; case 1990: #line 13481 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OP, "*", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 43393 "gram_minimal.c" /* yacc.c:1646 */ break; case 1991: #line 13483 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OP, "/", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 43399 "gram_minimal.c" /* yacc.c:1646 */ break; case 1992: #line 13485 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OP, "%", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 43405 "gram_minimal.c" /* yacc.c:1646 */ break; case 1993: #line 13487 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OP, "^", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 43411 "gram_minimal.c" /* yacc.c:1646 */ break; case 1994: #line 13489 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OP, "<", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 43417 "gram_minimal.c" /* yacc.c:1646 */ break; case 1995: #line 13491 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OP, ">", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 43423 "gram_minimal.c" /* yacc.c:1646 */ break; case 1996: #line 13493 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OP, "=", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 43429 "gram_minimal.c" /* yacc.c:1646 */ break; case 1997: #line 13495 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OP, "<=", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 43435 "gram_minimal.c" /* yacc.c:1646 */ break; case 1998: #line 13497 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OP, ">=", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 43441 "gram_minimal.c" /* yacc.c:1646 */ break; case 1999: #line 13499 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OP, "<>", (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 43447 "gram_minimal.c" /* yacc.c:1646 */ break; case 2000: #line 13501 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeA_Expr(AEXPR_OP, (yyvsp[-1].list), (yyvsp[-2].node), (yyvsp[0].node), (yylsp[-1])); } #line 43453 "gram_minimal.c" /* yacc.c:1646 */ break; case 2001: #line 13503 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeA_Expr(AEXPR_OP, (yyvsp[-1].list), NULL, (yyvsp[0].node), (yylsp[-1])); } #line 43459 "gram_minimal.c" /* yacc.c:1646 */ break; case 2002: #line 13505 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeA_Expr(AEXPR_OP, (yyvsp[0].list), (yyvsp[-1].node), NULL, (yylsp[0])); } #line 43465 "gram_minimal.c" /* yacc.c:1646 */ break; case 2003: #line 13507 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_DISTINCT, "=", (yyvsp[-4].node), (yyvsp[0].node), (yylsp[-3])); } #line 43473 "gram_minimal.c" /* yacc.c:1646 */ break; case 2004: #line 13511 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_NOT_DISTINCT, "=", (yyvsp[-5].node), (yyvsp[0].node), (yylsp[-4])); } #line 43481 "gram_minimal.c" /* yacc.c:1646 */ break; case 2005: #line 13515 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OF, "=", (yyvsp[-5].node), (Node *) (yyvsp[-1].list), (yylsp[-4])); } #line 43489 "gram_minimal.c" /* yacc.c:1646 */ break; case 2006: #line 13519 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_OF, "<>", (yyvsp[-6].node), (Node *) (yyvsp[-1].list), (yylsp[-5])); } #line 43497 "gram_minimal.c" /* yacc.c:1646 */ break; case 2007: #line 13523 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = makeXmlExpr(IS_DOCUMENT, NULL, NIL, list_make1((yyvsp[-2].node)), (yylsp[-1])); } #line 43506 "gram_minimal.c" /* yacc.c:1646 */ break; case 2008: #line 13528 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = makeNotExpr(makeXmlExpr(IS_DOCUMENT, NULL, NIL, list_make1((yyvsp[-3].node)), (yylsp[-2])), (yylsp[-2])); } #line 43516 "gram_minimal.c" /* yacc.c:1646 */ break; case 2009: #line 13543 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 43522 "gram_minimal.c" /* yacc.c:1646 */ break; case 2010: #line 13544 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 43528 "gram_minimal.c" /* yacc.c:1646 */ break; case 2011: #line 13546 "gram_minimal.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 43547 "gram_minimal.c" /* yacc.c:1646 */ break; case 2012: #line 13561 "gram_minimal.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 if (operator_precedence_warning) { /* * If precedence warnings are enabled, insert * AEXPR_PAREN nodes wrapping all explicitly * parenthesized subexpressions; this prevents bogus * warnings from being issued when the ordering has * been forced by parentheses. Take care that an * AEXPR_PAREN node has the same exprLocation as its * child, so as not to cause surprising changes in * error cursor positioning. * * In principle we should not be relying on a GUC to * decide whether to insert AEXPR_PAREN nodes. * However, since they have no effect except to * suppress warnings, it's probably safe enough; and * we'd just as soon not waste cycles on dummy parse * nodes if we don't have to. */ (yyval.node) = (Node *) makeA_Expr(AEXPR_PAREN, NIL, (yyvsp[-2].node), NULL, exprLocation((yyvsp[-2].node))); } else (yyval.node) = (yyvsp[-2].node); } #line 43585 "gram_minimal.c" /* yacc.c:1646 */ break; case 2013: #line 13595 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 43591 "gram_minimal.c" /* yacc.c:1646 */ break; case 2014: #line 13597 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 43597 "gram_minimal.c" /* yacc.c:1646 */ break; case 2015: #line 13599 "gram_minimal.y" /* yacc.c:1646 */ { SubLink *n = makeNode(SubLink); n->subLinkType = EXPR_SUBLINK; n->subLinkId = 0; n->testexpr = NULL; n->operName = NIL; n->subselect = (yyvsp[0].node); n->location = (yylsp[0]); (yyval.node) = (Node *)n; } #line 43612 "gram_minimal.c" /* yacc.c:1646 */ break; case 2016: #line 13610 "gram_minimal.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->subLinkId = 0; 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 43640 "gram_minimal.c" /* yacc.c:1646 */ break; case 2017: #line 13634 "gram_minimal.y" /* yacc.c:1646 */ { SubLink *n = makeNode(SubLink); n->subLinkType = EXISTS_SUBLINK; n->subLinkId = 0; n->testexpr = NULL; n->operName = NIL; n->subselect = (yyvsp[0].node); n->location = (yylsp[-1]); (yyval.node) = (Node *)n; } #line 43655 "gram_minimal.c" /* yacc.c:1646 */ break; case 2018: #line 13645 "gram_minimal.y" /* yacc.c:1646 */ { SubLink *n = makeNode(SubLink); n->subLinkType = ARRAY_SUBLINK; n->subLinkId = 0; n->testexpr = NULL; n->operName = NIL; n->subselect = (yyvsp[0].node); n->location = (yylsp[-1]); (yyval.node) = (Node *)n; } #line 43670 "gram_minimal.c" /* yacc.c:1646 */ break; case 2019: #line 13656 "gram_minimal.y" /* yacc.c:1646 */ { A_ArrayExpr *n = castNode(A_ArrayExpr, (yyvsp[0].node)); /* point outermost A_ArrayExpr to the ARRAY keyword */ n->location = (yylsp[-1]); (yyval.node) = (Node *)n; } #line 43681 "gram_minimal.c" /* yacc.c:1646 */ break; case 2020: #line 13663 "gram_minimal.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->row_format = COERCE_EXPLICIT_CALL; /* abuse */ r->location = (yylsp[0]); (yyval.node) = (Node *)r; } #line 43695 "gram_minimal.c" /* yacc.c:1646 */ break; case 2021: #line 13673 "gram_minimal.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->row_format = COERCE_IMPLICIT_CAST; /* abuse */ r->location = (yylsp[0]); (yyval.node) = (Node *)r; } #line 43709 "gram_minimal.c" /* yacc.c:1646 */ break; case 2022: #line 13683 "gram_minimal.y" /* yacc.c:1646 */ { GroupingFunc *g = makeNode(GroupingFunc); g->args = (yyvsp[-1].list); g->location = (yylsp[-3]); (yyval.node) = (Node *)g; } #line 43720 "gram_minimal.c" /* yacc.c:1646 */ break; case 2023: #line 13692 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeFuncCall((yyvsp[-2].list), NIL, (yylsp[-2])); } #line 43728 "gram_minimal.c" /* yacc.c:1646 */ break; case 2024: #line 13696 "gram_minimal.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 43738 "gram_minimal.c" /* yacc.c:1646 */ break; case 2025: #line 13702 "gram_minimal.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 43749 "gram_minimal.c" /* yacc.c:1646 */ break; case 2026: #line 13709 "gram_minimal.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 43760 "gram_minimal.c" /* yacc.c:1646 */ break; case 2027: #line 13716 "gram_minimal.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 43774 "gram_minimal.c" /* yacc.c:1646 */ break; case 2028: #line 13726 "gram_minimal.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 43785 "gram_minimal.c" /* yacc.c:1646 */ break; case 2029: #line 13733 "gram_minimal.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 43805 "gram_minimal.c" /* yacc.c:1646 */ break; case 2030: #line 13761 "gram_minimal.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 43844 "gram_minimal.c" /* yacc.c:1646 */ break; case 2031: #line 13796 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 43850 "gram_minimal.c" /* yacc.c:1646 */ break; case 2032: #line 13806 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 43856 "gram_minimal.c" /* yacc.c:1646 */ break; case 2033: #line 13807 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 43862 "gram_minimal.c" /* yacc.c:1646 */ break; case 2034: #line 13815 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeFuncCall(SystemFuncName("pg_collation_for"), list_make1((yyvsp[-1].node)), (yylsp[-4])); } #line 43872 "gram_minimal.c" /* yacc.c:1646 */ break; case 2035: #line 13821 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = makeSQLValueFunction(SVFOP_CURRENT_DATE, -1, (yylsp[0])); } #line 43880 "gram_minimal.c" /* yacc.c:1646 */ break; case 2036: #line 13825 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = makeSQLValueFunction(SVFOP_CURRENT_TIME, -1, (yylsp[0])); } #line 43888 "gram_minimal.c" /* yacc.c:1646 */ break; case 2037: #line 13829 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = makeSQLValueFunction(SVFOP_CURRENT_TIME_N, (yyvsp[-1].ival), (yylsp[-3])); } #line 43896 "gram_minimal.c" /* yacc.c:1646 */ break; case 2038: #line 13833 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = makeSQLValueFunction(SVFOP_CURRENT_TIMESTAMP, -1, (yylsp[0])); } #line 43904 "gram_minimal.c" /* yacc.c:1646 */ break; case 2039: #line 13837 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = makeSQLValueFunction(SVFOP_CURRENT_TIMESTAMP_N, (yyvsp[-1].ival), (yylsp[-3])); } #line 43912 "gram_minimal.c" /* yacc.c:1646 */ break; case 2040: #line 13841 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = makeSQLValueFunction(SVFOP_LOCALTIME, -1, (yylsp[0])); } #line 43920 "gram_minimal.c" /* yacc.c:1646 */ break; case 2041: #line 13845 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = makeSQLValueFunction(SVFOP_LOCALTIME_N, (yyvsp[-1].ival), (yylsp[-3])); } #line 43928 "gram_minimal.c" /* yacc.c:1646 */ break; case 2042: #line 13849 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = makeSQLValueFunction(SVFOP_LOCALTIMESTAMP, -1, (yylsp[0])); } #line 43936 "gram_minimal.c" /* yacc.c:1646 */ break; case 2043: #line 13853 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = makeSQLValueFunction(SVFOP_LOCALTIMESTAMP_N, (yyvsp[-1].ival), (yylsp[-3])); } #line 43944 "gram_minimal.c" /* yacc.c:1646 */ break; case 2044: #line 13857 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = makeSQLValueFunction(SVFOP_CURRENT_ROLE, -1, (yylsp[0])); } #line 43952 "gram_minimal.c" /* yacc.c:1646 */ break; case 2045: #line 13861 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = makeSQLValueFunction(SVFOP_CURRENT_USER, -1, (yylsp[0])); } #line 43960 "gram_minimal.c" /* yacc.c:1646 */ break; case 2046: #line 13865 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = makeSQLValueFunction(SVFOP_SESSION_USER, -1, (yylsp[0])); } #line 43968 "gram_minimal.c" /* yacc.c:1646 */ break; case 2047: #line 13869 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = makeSQLValueFunction(SVFOP_USER, -1, (yylsp[0])); } #line 43976 "gram_minimal.c" /* yacc.c:1646 */ break; case 2048: #line 13873 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = makeSQLValueFunction(SVFOP_CURRENT_CATALOG, -1, (yylsp[0])); } #line 43984 "gram_minimal.c" /* yacc.c:1646 */ break; case 2049: #line 13877 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = makeSQLValueFunction(SVFOP_CURRENT_SCHEMA, -1, (yylsp[0])); } #line 43992 "gram_minimal.c" /* yacc.c:1646 */ break; case 2050: #line 13881 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = makeTypeCast((yyvsp[-3].node), (yyvsp[-1].typnam), (yylsp[-5])); } #line 43998 "gram_minimal.c" /* yacc.c:1646 */ break; case 2051: #line 13883 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeFuncCall(SystemFuncName("date_part"), (yyvsp[-1].list), (yylsp[-3])); } #line 44006 "gram_minimal.c" /* yacc.c:1646 */ break; case 2052: #line 13887 "gram_minimal.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 44019 "gram_minimal.c" /* yacc.c:1646 */ break; case 2053: #line 13896 "gram_minimal.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 44028 "gram_minimal.c" /* yacc.c:1646 */ break; case 2054: #line 13901 "gram_minimal.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 44039 "gram_minimal.c" /* yacc.c:1646 */ break; case 2055: #line 13908 "gram_minimal.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 44058 "gram_minimal.c" /* yacc.c:1646 */ break; case 2056: #line 13923 "gram_minimal.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 44069 "gram_minimal.c" /* yacc.c:1646 */ break; case 2057: #line 13930 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeFuncCall(SystemFuncName("ltrim"), (yyvsp[-1].list), (yylsp[-4])); } #line 44077 "gram_minimal.c" /* yacc.c:1646 */ break; case 2058: #line 13934 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeFuncCall(SystemFuncName("rtrim"), (yyvsp[-1].list), (yylsp[-4])); } #line 44085 "gram_minimal.c" /* yacc.c:1646 */ break; case 2059: #line 13938 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeFuncCall(SystemFuncName("btrim"), (yyvsp[-1].list), (yylsp[-3])); } #line 44093 "gram_minimal.c" /* yacc.c:1646 */ break; case 2060: #line 13942 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeSimpleA_Expr(AEXPR_NULLIF, "=", (yyvsp[-3].node), (yyvsp[-1].node), (yylsp[-5])); } #line 44101 "gram_minimal.c" /* yacc.c:1646 */ break; case 2061: #line 13946 "gram_minimal.y" /* yacc.c:1646 */ { CoalesceExpr *c = makeNode(CoalesceExpr); c->args = (yyvsp[-1].list); c->location = (yylsp[-3]); (yyval.node) = (Node *)c; } #line 44112 "gram_minimal.c" /* yacc.c:1646 */ break; case 2062: #line 13953 "gram_minimal.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 44124 "gram_minimal.c" /* yacc.c:1646 */ break; case 2063: #line 13961 "gram_minimal.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 44136 "gram_minimal.c" /* yacc.c:1646 */ break; case 2064: #line 13969 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = makeXmlExpr(IS_XMLCONCAT, NULL, NIL, (yyvsp[-1].list), (yylsp[-3])); } #line 44144 "gram_minimal.c" /* yacc.c:1646 */ break; case 2065: #line 13973 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = makeXmlExpr(IS_XMLELEMENT, (yyvsp[-1].str), NIL, NIL, (yylsp[-4])); } #line 44152 "gram_minimal.c" /* yacc.c:1646 */ break; case 2066: #line 13977 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = makeXmlExpr(IS_XMLELEMENT, (yyvsp[-3].str), (yyvsp[-1].list), NIL, (yylsp[-6])); } #line 44160 "gram_minimal.c" /* yacc.c:1646 */ break; case 2067: #line 13981 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = makeXmlExpr(IS_XMLELEMENT, (yyvsp[-3].str), NIL, (yyvsp[-1].list), (yylsp[-6])); } #line 44168 "gram_minimal.c" /* yacc.c:1646 */ break; case 2068: #line 13985 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = makeXmlExpr(IS_XMLELEMENT, (yyvsp[-5].str), (yyvsp[-3].list), (yyvsp[-1].list), (yylsp[-8])); } #line 44176 "gram_minimal.c" /* yacc.c:1646 */ break; case 2069: #line 13989 "gram_minimal.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 44186 "gram_minimal.c" /* yacc.c:1646 */ break; case 2070: #line 13995 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = makeXmlExpr(IS_XMLFOREST, NULL, (yyvsp[-1].list), NIL, (yylsp[-3])); } #line 44194 "gram_minimal.c" /* yacc.c:1646 */ break; case 2071: #line 13999 "gram_minimal.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 44207 "gram_minimal.c" /* yacc.c:1646 */ break; case 2072: #line 14008 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = makeXmlExpr(IS_XMLPI, (yyvsp[-1].str), NULL, NIL, (yylsp[-4])); } #line 44215 "gram_minimal.c" /* yacc.c:1646 */ break; case 2073: #line 14012 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = makeXmlExpr(IS_XMLPI, (yyvsp[-3].str), NULL, list_make1((yyvsp[-1].node)), (yylsp[-6])); } #line 44223 "gram_minimal.c" /* yacc.c:1646 */ break; case 2074: #line 14016 "gram_minimal.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 44232 "gram_minimal.c" /* yacc.c:1646 */ break; case 2075: #line 14021 "gram_minimal.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 44245 "gram_minimal.c" /* yacc.c:1646 */ break; case 2076: #line 14035 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 44251 "gram_minimal.c" /* yacc.c:1646 */ break; case 2077: #line 14037 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = makeNullAConst(-1); } #line 44257 "gram_minimal.c" /* yacc.c:1646 */ break; case 2078: #line 14041 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = makeIntConst(XML_STANDALONE_YES, -1); } #line 44263 "gram_minimal.c" /* yacc.c:1646 */ break; case 2079: #line 14043 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = makeIntConst(XML_STANDALONE_NO, -1); } #line 44269 "gram_minimal.c" /* yacc.c:1646 */ break; case 2080: #line 14045 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = makeIntConst(XML_STANDALONE_NO_VALUE, -1); } #line 44275 "gram_minimal.c" /* yacc.c:1646 */ break; case 2081: #line 14047 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = makeIntConst(XML_STANDALONE_OMITTED, -1); } #line 44281 "gram_minimal.c" /* yacc.c:1646 */ break; case 2082: #line 14050 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[-1].list); } #line 44287 "gram_minimal.c" /* yacc.c:1646 */ break; case 2083: #line 14053 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].target)); } #line 44293 "gram_minimal.c" /* yacc.c:1646 */ break; case 2084: #line 14054 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].target)); } #line 44299 "gram_minimal.c" /* yacc.c:1646 */ break; case 2085: #line 14058 "gram_minimal.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 44311 "gram_minimal.c" /* yacc.c:1646 */ break; case 2086: #line 14066 "gram_minimal.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 44323 "gram_minimal.c" /* yacc.c:1646 */ break; case 2087: #line 14075 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = XMLOPTION_DOCUMENT; } #line 44329 "gram_minimal.c" /* yacc.c:1646 */ break; case 2088: #line 14076 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = XMLOPTION_CONTENT; } #line 44335 "gram_minimal.c" /* yacc.c:1646 */ break; case 2089: #line 14079 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.boolean) = true; } #line 44341 "gram_minimal.c" /* yacc.c:1646 */ break; case 2090: #line 14080 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.boolean) = false; } #line 44347 "gram_minimal.c" /* yacc.c:1646 */ break; case 2091: #line 14081 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.boolean) = false; } #line 44353 "gram_minimal.c" /* yacc.c:1646 */ break; case 2092: #line 14087 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 44361 "gram_minimal.c" /* yacc.c:1646 */ break; case 2093: #line 14091 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[-1].node); } #line 44369 "gram_minimal.c" /* yacc.c:1646 */ break; case 2094: #line 14095 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 44377 "gram_minimal.c" /* yacc.c:1646 */ break; case 2095: #line 14099 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[-1].node); } #line 44385 "gram_minimal.c" /* yacc.c:1646 */ break; case 2098: #line 14114 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[-1].list); } #line 44391 "gram_minimal.c" /* yacc.c:1646 */ break; case 2099: #line 14115 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 44397 "gram_minimal.c" /* yacc.c:1646 */ break; case 2100: #line 14119 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[-1].node); } #line 44403 "gram_minimal.c" /* yacc.c:1646 */ break; case 2101: #line 14120 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = NULL; } #line 44409 "gram_minimal.c" /* yacc.c:1646 */ break; case 2102: #line 14128 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 44415 "gram_minimal.c" /* yacc.c:1646 */ break; case 2103: #line 14129 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 44421 "gram_minimal.c" /* yacc.c:1646 */ break; case 2104: #line 14133 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].windef)); } #line 44427 "gram_minimal.c" /* yacc.c:1646 */ break; case 2105: #line 14135 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].windef)); } #line 44433 "gram_minimal.c" /* yacc.c:1646 */ break; case 2106: #line 14140 "gram_minimal.y" /* yacc.c:1646 */ { WindowDef *n = (yyvsp[0].windef); n->name = (yyvsp[-2].str); (yyval.windef) = n; } #line 44443 "gram_minimal.c" /* yacc.c:1646 */ break; case 2107: #line 14148 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.windef) = (yyvsp[0].windef); } #line 44449 "gram_minimal.c" /* yacc.c:1646 */ break; case 2108: #line 14150 "gram_minimal.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 44466 "gram_minimal.c" /* yacc.c:1646 */ break; case 2109: #line 14163 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.windef) = NULL; } #line 44472 "gram_minimal.c" /* yacc.c:1646 */ break; case 2110: #line 14168 "gram_minimal.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 44490 "gram_minimal.c" /* yacc.c:1646 */ break; case 2111: #line 14193 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 44496 "gram_minimal.c" /* yacc.c:1646 */ break; case 2112: #line 14194 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = NULL; } #line 44502 "gram_minimal.c" /* yacc.c:1646 */ break; case 2113: #line 14197 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 44508 "gram_minimal.c" /* yacc.c:1646 */ break; case 2114: #line 14198 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 44514 "gram_minimal.c" /* yacc.c:1646 */ break; case 2115: #line 14207 "gram_minimal.y" /* yacc.c:1646 */ { WindowDef *n = (yyvsp[-1].windef); n->frameOptions |= FRAMEOPTION_NONDEFAULT | FRAMEOPTION_RANGE; n->frameOptions |= (yyvsp[0].ival); (yyval.windef) = n; } #line 44525 "gram_minimal.c" /* yacc.c:1646 */ break; case 2116: #line 14214 "gram_minimal.y" /* yacc.c:1646 */ { WindowDef *n = (yyvsp[-1].windef); n->frameOptions |= FRAMEOPTION_NONDEFAULT | FRAMEOPTION_ROWS; n->frameOptions |= (yyvsp[0].ival); (yyval.windef) = n; } #line 44536 "gram_minimal.c" /* yacc.c:1646 */ break; case 2117: #line 14221 "gram_minimal.y" /* yacc.c:1646 */ { WindowDef *n = (yyvsp[-1].windef); n->frameOptions |= FRAMEOPTION_NONDEFAULT | FRAMEOPTION_GROUPS; n->frameOptions |= (yyvsp[0].ival); (yyval.windef) = n; } #line 44547 "gram_minimal.c" /* yacc.c:1646 */ break; case 2118: #line 14228 "gram_minimal.y" /* yacc.c:1646 */ { WindowDef *n = makeNode(WindowDef); n->frameOptions = FRAMEOPTION_DEFAULTS; n->startOffset = NULL; n->endOffset = NULL; (yyval.windef) = n; } #line 44559 "gram_minimal.c" /* yacc.c:1646 */ break; case 2119: #line 14238 "gram_minimal.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_OFFSET_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 44580 "gram_minimal.c" /* yacc.c:1646 */ break; case 2120: #line 14255 "gram_minimal.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_OFFSET_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_OFFSET_FOLLOWING) && (frameOptions & (FRAMEOPTION_END_OFFSET_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 44621 "gram_minimal.c" /* yacc.c:1646 */ break; case 2121: #line 14300 "gram_minimal.y" /* yacc.c:1646 */ { WindowDef *n = makeNode(WindowDef); n->frameOptions = FRAMEOPTION_START_UNBOUNDED_PRECEDING; n->startOffset = NULL; n->endOffset = NULL; (yyval.windef) = n; } #line 44633 "gram_minimal.c" /* yacc.c:1646 */ break; case 2122: #line 14308 "gram_minimal.y" /* yacc.c:1646 */ { WindowDef *n = makeNode(WindowDef); n->frameOptions = FRAMEOPTION_START_UNBOUNDED_FOLLOWING; n->startOffset = NULL; n->endOffset = NULL; (yyval.windef) = n; } #line 44645 "gram_minimal.c" /* yacc.c:1646 */ break; case 2123: #line 14316 "gram_minimal.y" /* yacc.c:1646 */ { WindowDef *n = makeNode(WindowDef); n->frameOptions = FRAMEOPTION_START_CURRENT_ROW; n->startOffset = NULL; n->endOffset = NULL; (yyval.windef) = n; } #line 44657 "gram_minimal.c" /* yacc.c:1646 */ break; case 2124: #line 14324 "gram_minimal.y" /* yacc.c:1646 */ { WindowDef *n = makeNode(WindowDef); n->frameOptions = FRAMEOPTION_START_OFFSET_PRECEDING; n->startOffset = (yyvsp[-1].node); n->endOffset = NULL; (yyval.windef) = n; } #line 44669 "gram_minimal.c" /* yacc.c:1646 */ break; case 2125: #line 14332 "gram_minimal.y" /* yacc.c:1646 */ { WindowDef *n = makeNode(WindowDef); n->frameOptions = FRAMEOPTION_START_OFFSET_FOLLOWING; n->startOffset = (yyvsp[-1].node); n->endOffset = NULL; (yyval.windef) = n; } #line 44681 "gram_minimal.c" /* yacc.c:1646 */ break; case 2126: #line 14342 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = FRAMEOPTION_EXCLUDE_CURRENT_ROW; } #line 44687 "gram_minimal.c" /* yacc.c:1646 */ break; case 2127: #line 14343 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = FRAMEOPTION_EXCLUDE_GROUP; } #line 44693 "gram_minimal.c" /* yacc.c:1646 */ break; case 2128: #line 14344 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = FRAMEOPTION_EXCLUDE_TIES; } #line 44699 "gram_minimal.c" /* yacc.c:1646 */ break; case 2129: #line 14345 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = 0; } #line 44705 "gram_minimal.c" /* yacc.c:1646 */ break; case 2130: #line 14346 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = 0; } #line 44711 "gram_minimal.c" /* yacc.c:1646 */ break; case 2131: #line 14360 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[-1].list); } #line 44717 "gram_minimal.c" /* yacc.c:1646 */ break; case 2132: #line 14361 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 44723 "gram_minimal.c" /* yacc.c:1646 */ break; case 2133: #line 14362 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-3].list), (yyvsp[-1].node)); } #line 44729 "gram_minimal.c" /* yacc.c:1646 */ break; case 2134: #line 14365 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[-1].list); } #line 44735 "gram_minimal.c" /* yacc.c:1646 */ break; case 2135: #line 14366 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 44741 "gram_minimal.c" /* yacc.c:1646 */ break; case 2136: #line 14369 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-3].list), (yyvsp[-1].node)); } #line 44747 "gram_minimal.c" /* yacc.c:1646 */ break; case 2137: #line 14372 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = ANY_SUBLINK; } #line 44753 "gram_minimal.c" /* yacc.c:1646 */ break; case 2138: #line 14373 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = ANY_SUBLINK; } #line 44759 "gram_minimal.c" /* yacc.c:1646 */ break; case 2139: #line 14374 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = ALL_SUBLINK; } #line 44765 "gram_minimal.c" /* yacc.c:1646 */ break; case 2140: #line 14377 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 44771 "gram_minimal.c" /* yacc.c:1646 */ break; case 2141: #line 14378 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 44777 "gram_minimal.c" /* yacc.c:1646 */ break; case 2142: #line 14381 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = "+"; } #line 44783 "gram_minimal.c" /* yacc.c:1646 */ break; case 2143: #line 14382 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = "-"; } #line 44789 "gram_minimal.c" /* yacc.c:1646 */ break; case 2144: #line 14383 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = "*"; } #line 44795 "gram_minimal.c" /* yacc.c:1646 */ break; case 2145: #line 14384 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = "/"; } #line 44801 "gram_minimal.c" /* yacc.c:1646 */ break; case 2146: #line 14385 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = "%"; } #line 44807 "gram_minimal.c" /* yacc.c:1646 */ break; case 2147: #line 14386 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = "^"; } #line 44813 "gram_minimal.c" /* yacc.c:1646 */ break; case 2148: #line 14387 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = "<"; } #line 44819 "gram_minimal.c" /* yacc.c:1646 */ break; case 2149: #line 14388 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = ">"; } #line 44825 "gram_minimal.c" /* yacc.c:1646 */ break; case 2150: #line 14389 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = "="; } #line 44831 "gram_minimal.c" /* yacc.c:1646 */ break; case 2151: #line 14390 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = "<="; } #line 44837 "gram_minimal.c" /* yacc.c:1646 */ break; case 2152: #line 14391 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = ">="; } #line 44843 "gram_minimal.c" /* yacc.c:1646 */ break; case 2153: #line 14392 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = "<>"; } #line 44849 "gram_minimal.c" /* yacc.c:1646 */ break; case 2154: #line 14396 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1(makeString((yyvsp[0].str))); } #line 44855 "gram_minimal.c" /* yacc.c:1646 */ break; case 2155: #line 14398 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[-1].list); } #line 44861 "gram_minimal.c" /* yacc.c:1646 */ break; case 2156: #line 14403 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1(makeString((yyvsp[0].str))); } #line 44867 "gram_minimal.c" /* yacc.c:1646 */ break; case 2157: #line 14405 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[-1].list); } #line 44873 "gram_minimal.c" /* yacc.c:1646 */ break; case 2158: #line 14410 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1(makeString((yyvsp[0].str))); } #line 44879 "gram_minimal.c" /* yacc.c:1646 */ break; case 2159: #line 14412 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[-1].list); } #line 44885 "gram_minimal.c" /* yacc.c:1646 */ break; case 2160: #line 14414 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1(makeString("~~")); } #line 44891 "gram_minimal.c" /* yacc.c:1646 */ break; case 2161: #line 14416 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1(makeString("!~~")); } #line 44897 "gram_minimal.c" /* yacc.c:1646 */ break; case 2162: #line 14418 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1(makeString("~~*")); } #line 44903 "gram_minimal.c" /* yacc.c:1646 */ break; case 2163: #line 14420 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1(makeString("!~~*")); } #line 44909 "gram_minimal.c" /* yacc.c:1646 */ break; case 2164: #line 14432 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].node)); } #line 44917 "gram_minimal.c" /* yacc.c:1646 */ break; case 2165: #line 14436 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].node)); } #line 44925 "gram_minimal.c" /* yacc.c:1646 */ break; case 2166: #line 14443 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].node)); } #line 44933 "gram_minimal.c" /* yacc.c:1646 */ break; case 2167: #line 14447 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].node)); } #line 44941 "gram_minimal.c" /* yacc.c:1646 */ break; case 2168: #line 14453 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 44949 "gram_minimal.c" /* yacc.c:1646 */ break; case 2169: #line 14457 "gram_minimal.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 44962 "gram_minimal.c" /* yacc.c:1646 */ break; case 2170: #line 14466 "gram_minimal.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 44975 "gram_minimal.c" /* yacc.c:1646 */ break; case 2171: #line 14476 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].typnam)); } #line 44981 "gram_minimal.c" /* yacc.c:1646 */ break; case 2172: #line 14477 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].typnam)); } #line 44987 "gram_minimal.c" /* yacc.c:1646 */ break; case 2173: #line 14481 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = makeAArrayExpr((yyvsp[-1].list), (yylsp[-2])); } #line 44995 "gram_minimal.c" /* yacc.c:1646 */ break; case 2174: #line 14485 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = makeAArrayExpr((yyvsp[-1].list), (yylsp[-2])); } #line 45003 "gram_minimal.c" /* yacc.c:1646 */ break; case 2175: #line 14489 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = makeAArrayExpr(NIL, (yylsp[-1])); } #line 45011 "gram_minimal.c" /* yacc.c:1646 */ break; case 2176: #line 14494 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].node)); } #line 45017 "gram_minimal.c" /* yacc.c:1646 */ break; case 2177: #line 14495 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].node)); } #line 45023 "gram_minimal.c" /* yacc.c:1646 */ break; case 2178: #line 14501 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make2(makeStringConst((yyvsp[-2].str), (yylsp[-2])), (yyvsp[0].node)); } #line 45031 "gram_minimal.c" /* yacc.c:1646 */ break; case 2179: #line 14504 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 45037 "gram_minimal.c" /* yacc.c:1646 */ break; case 2180: #line 14511 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 45043 "gram_minimal.c" /* yacc.c:1646 */ break; case 2181: #line 14512 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = "year"; } #line 45049 "gram_minimal.c" /* yacc.c:1646 */ break; case 2182: #line 14513 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = "month"; } #line 45055 "gram_minimal.c" /* yacc.c:1646 */ break; case 2183: #line 14514 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = "day"; } #line 45061 "gram_minimal.c" /* yacc.c:1646 */ break; case 2184: #line 14515 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = "hour"; } #line 45067 "gram_minimal.c" /* yacc.c:1646 */ break; case 2185: #line 14516 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = "minute"; } #line 45073 "gram_minimal.c" /* yacc.c:1646 */ break; case 2186: #line 14517 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = "second"; } #line 45079 "gram_minimal.c" /* yacc.c:1646 */ break; case 2187: #line 14518 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 45085 "gram_minimal.c" /* yacc.c:1646 */ break; case 2188: #line 14529 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make4((yyvsp[-3].node), (yyvsp[-2].node), (yyvsp[-1].node), (yyvsp[0].node)); } #line 45093 "gram_minimal.c" /* yacc.c:1646 */ break; case 2189: #line 14533 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make3((yyvsp[-2].node), (yyvsp[-1].node), (yyvsp[0].node)); } #line 45101 "gram_minimal.c" /* yacc.c:1646 */ break; case 2190: #line 14540 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 45107 "gram_minimal.c" /* yacc.c:1646 */ break; case 2191: #line 14546 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make2((yyvsp[0].node), (yyvsp[-2].node)); } #line 45113 "gram_minimal.c" /* yacc.c:1646 */ break; case 2192: #line 14547 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 45119 "gram_minimal.c" /* yacc.c:1646 */ break; case 2193: #line 14564 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make3((yyvsp[-2].node), (yyvsp[-1].node), (yyvsp[0].node)); } #line 45127 "gram_minimal.c" /* yacc.c:1646 */ break; case 2194: #line 14568 "gram_minimal.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 45136 "gram_minimal.c" /* yacc.c:1646 */ break; case 2195: #line 14573 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make2((yyvsp[-1].node), (yyvsp[0].node)); } #line 45144 "gram_minimal.c" /* yacc.c:1646 */ break; case 2196: #line 14577 "gram_minimal.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 45163 "gram_minimal.c" /* yacc.c:1646 */ break; case 2197: #line 14592 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 45171 "gram_minimal.c" /* yacc.c:1646 */ break; case 2198: #line 14596 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 45177 "gram_minimal.c" /* yacc.c:1646 */ break; case 2199: #line 14600 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 45183 "gram_minimal.c" /* yacc.c:1646 */ break; case 2200: #line 14603 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 45189 "gram_minimal.c" /* yacc.c:1646 */ break; case 2201: #line 14606 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[0].list), (yyvsp[-2].node)); } #line 45195 "gram_minimal.c" /* yacc.c:1646 */ break; case 2202: #line 14607 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 45201 "gram_minimal.c" /* yacc.c:1646 */ break; case 2203: #line 14608 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 45207 "gram_minimal.c" /* yacc.c:1646 */ break; case 2204: #line 14612 "gram_minimal.y" /* yacc.c:1646 */ { SubLink *n = makeNode(SubLink); n->subselect = (yyvsp[0].node); /* other fields will be filled later */ (yyval.node) = (Node *)n; } #line 45218 "gram_minimal.c" /* yacc.c:1646 */ break; case 2205: #line 14618 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (Node *)(yyvsp[-1].list); } #line 45224 "gram_minimal.c" /* yacc.c:1646 */ break; case 2206: #line 14629 "gram_minimal.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 45238 "gram_minimal.c" /* yacc.c:1646 */ break; case 2207: #line 14642 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].node)); } #line 45244 "gram_minimal.c" /* yacc.c:1646 */ break; case 2208: #line 14643 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-1].list), (yyvsp[0].node)); } #line 45250 "gram_minimal.c" /* yacc.c:1646 */ break; case 2209: #line 14648 "gram_minimal.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 45262 "gram_minimal.c" /* yacc.c:1646 */ break; case 2210: #line 14658 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 45268 "gram_minimal.c" /* yacc.c:1646 */ break; case 2211: #line 14659 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = NULL; } #line 45274 "gram_minimal.c" /* yacc.c:1646 */ break; case 2212: #line 14662 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 45280 "gram_minimal.c" /* yacc.c:1646 */ break; case 2213: #line 14663 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = NULL; } #line 45286 "gram_minimal.c" /* yacc.c:1646 */ break; case 2214: #line 14667 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = makeColumnRef((yyvsp[0].str), NIL, (yylsp[0]), yyscanner); } #line 45294 "gram_minimal.c" /* yacc.c:1646 */ break; case 2215: #line 14671 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = makeColumnRef((yyvsp[-1].str), (yyvsp[0].list), (yylsp[-1]), yyscanner); } #line 45302 "gram_minimal.c" /* yacc.c:1646 */ break; case 2216: #line 14678 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeString((yyvsp[0].str)); } #line 45310 "gram_minimal.c" /* yacc.c:1646 */ break; case 2217: #line 14682 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (Node *) makeNode(A_Star); } #line 45318 "gram_minimal.c" /* yacc.c:1646 */ break; case 2218: #line 14686 "gram_minimal.y" /* yacc.c:1646 */ { A_Indices *ai = makeNode(A_Indices); ai->is_slice = false; ai->lidx = NULL; ai->uidx = (yyvsp[-1].node); (yyval.node) = (Node *) ai; } #line 45330 "gram_minimal.c" /* yacc.c:1646 */ break; case 2219: #line 14694 "gram_minimal.y" /* yacc.c:1646 */ { A_Indices *ai = makeNode(A_Indices); ai->is_slice = true; ai->lidx = (yyvsp[-3].node); ai->uidx = (yyvsp[-1].node); (yyval.node) = (Node *) ai; } #line 45342 "gram_minimal.c" /* yacc.c:1646 */ break; case 2220: #line 14704 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = (yyvsp[0].node); } #line 45348 "gram_minimal.c" /* yacc.c:1646 */ break; case 2221: #line 14705 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = NULL; } #line 45354 "gram_minimal.c" /* yacc.c:1646 */ break; case 2222: #line 14709 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].node)); } #line 45360 "gram_minimal.c" /* yacc.c:1646 */ break; case 2223: #line 14710 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-1].list), (yyvsp[0].node)); } #line 45366 "gram_minimal.c" /* yacc.c:1646 */ break; case 2224: #line 14714 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 45372 "gram_minimal.c" /* yacc.c:1646 */ break; case 2225: #line 14715 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-1].list), (yyvsp[0].node)); } #line 45378 "gram_minimal.c" /* yacc.c:1646 */ break; case 2228: #line 14729 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = (yyvsp[0].list); } #line 45384 "gram_minimal.c" /* yacc.c:1646 */ break; case 2229: #line 14730 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = NIL; } #line 45390 "gram_minimal.c" /* yacc.c:1646 */ break; case 2230: #line 14734 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].target)); } #line 45396 "gram_minimal.c" /* yacc.c:1646 */ break; case 2231: #line 14735 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].target)); } #line 45402 "gram_minimal.c" /* yacc.c:1646 */ break; case 2232: #line 14739 "gram_minimal.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 45414 "gram_minimal.c" /* yacc.c:1646 */ break; case 2233: #line 14755 "gram_minimal.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 45426 "gram_minimal.c" /* yacc.c:1646 */ break; case 2234: #line 14763 "gram_minimal.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 45438 "gram_minimal.c" /* yacc.c:1646 */ break; case 2235: #line 14771 "gram_minimal.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 45454 "gram_minimal.c" /* yacc.c:1646 */ break; case 2236: #line 14792 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].range)); } #line 45460 "gram_minimal.c" /* yacc.c:1646 */ break; case 2237: #line 14793 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].range)); } #line 45466 "gram_minimal.c" /* yacc.c:1646 */ break; case 2238: #line 14805 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.range) = makeRangeVar(NULL, (yyvsp[0].str), (yylsp[0])); } #line 45474 "gram_minimal.c" /* yacc.c:1646 */ break; case 2239: #line 14809 "gram_minimal.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 45503 "gram_minimal.c" /* yacc.c:1646 */ break; case 2240: #line 14836 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1(makeString((yyvsp[0].str))); } #line 45509 "gram_minimal.c" /* yacc.c:1646 */ break; case 2241: #line 14838 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), makeString((yyvsp[0].str))); } #line 45515 "gram_minimal.c" /* yacc.c:1646 */ break; case 2242: #line 14842 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 45521 "gram_minimal.c" /* yacc.c:1646 */ break; case 2243: #line 14845 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 45527 "gram_minimal.c" /* yacc.c:1646 */ break; case 2244: #line 14848 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 45533 "gram_minimal.c" /* yacc.c:1646 */ break; case 2245: #line 14850 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 45539 "gram_minimal.c" /* yacc.c:1646 */ break; case 2246: #line 14852 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 45545 "gram_minimal.c" /* yacc.c:1646 */ break; case 2247: #line 14854 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 45551 "gram_minimal.c" /* yacc.c:1646 */ break; case 2248: #line 14865 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1(makeString((yyvsp[0].str))); } #line 45557 "gram_minimal.c" /* yacc.c:1646 */ break; case 2249: #line 14867 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = check_func_name(lcons(makeString((yyvsp[-1].str)), (yyvsp[0].list)), yyscanner); } #line 45566 "gram_minimal.c" /* yacc.c:1646 */ break; case 2250: #line 14878 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = makeIntConst((yyvsp[0].ival), (yylsp[0])); } #line 45574 "gram_minimal.c" /* yacc.c:1646 */ break; case 2251: #line 14882 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = makeFloatConst((yyvsp[0].str), (yylsp[0])); } #line 45582 "gram_minimal.c" /* yacc.c:1646 */ break; case 2252: #line 14886 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = makeStringConst((yyvsp[0].str), (yylsp[0])); } #line 45590 "gram_minimal.c" /* yacc.c:1646 */ break; case 2253: #line 14890 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = makeBitStringConst((yyvsp[0].str), (yylsp[0])); } #line 45598 "gram_minimal.c" /* yacc.c:1646 */ break; case 2254: #line 14894 "gram_minimal.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 45611 "gram_minimal.c" /* yacc.c:1646 */ break; case 2255: #line 14903 "gram_minimal.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 45622 "gram_minimal.c" /* yacc.c:1646 */ break; case 2256: #line 14910 "gram_minimal.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 45658 "gram_minimal.c" /* yacc.c:1646 */ break; case 2257: #line 14942 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = makeStringConstCast((yyvsp[0].str), (yylsp[0]), (yyvsp[-1].typnam)); } #line 45666 "gram_minimal.c" /* yacc.c:1646 */ break; case 2258: #line 14946 "gram_minimal.y" /* yacc.c:1646 */ { TypeName *t = (yyvsp[-2].typnam); t->typmods = (yyvsp[0].list); (yyval.node) = makeStringConstCast((yyvsp[-1].str), (yylsp[-1]), t); } #line 45676 "gram_minimal.c" /* yacc.c:1646 */ break; case 2259: #line 14952 "gram_minimal.y" /* yacc.c:1646 */ { TypeName *t = (yyvsp[-4].typnam); t->typmods = list_make2(makeIntConst(INTERVAL_FULL_RANGE, -1), makeIntConst((yyvsp[-2].ival), (yylsp[-2]))); (yyval.node) = makeStringConstCast((yyvsp[0].str), (yylsp[0]), t); } #line 45687 "gram_minimal.c" /* yacc.c:1646 */ break; case 2260: #line 14959 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = makeBoolAConst(true, (yylsp[0])); } #line 45695 "gram_minimal.c" /* yacc.c:1646 */ break; case 2261: #line 14963 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = makeBoolAConst(false, (yylsp[0])); } #line 45703 "gram_minimal.c" /* yacc.c:1646 */ break; case 2262: #line 14967 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.node) = makeNullAConst((yylsp[0])); } #line 45711 "gram_minimal.c" /* yacc.c:1646 */ break; case 2263: #line 14972 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = (yyvsp[0].ival); } #line 45717 "gram_minimal.c" /* yacc.c:1646 */ break; case 2264: #line 14973 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 45723 "gram_minimal.c" /* yacc.c:1646 */ break; case 2265: #line 14975 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = (yyvsp[0].ival); } #line 45729 "gram_minimal.c" /* yacc.c:1646 */ break; case 2266: #line 14976 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = + (yyvsp[0].ival); } #line 45735 "gram_minimal.c" /* yacc.c:1646 */ break; case 2267: #line 14977 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.ival) = - (yyvsp[0].ival); } #line 45741 "gram_minimal.c" /* yacc.c:1646 */ break; case 2268: #line 14982 "gram_minimal.y" /* yacc.c:1646 */ { RoleSpec *spc = (RoleSpec *) (yyvsp[0].rolespec); switch (spc->roletype) { case ROLESPEC_CSTRING: (yyval.str) = spc->rolename; break; case ROLESPEC_PUBLIC: ereport(ERROR, (errcode(ERRCODE_RESERVED_NAME), errmsg("role name \"%s\" is reserved", "public"), parser_errposition((yylsp[0])))); break; case ROLESPEC_SESSION_USER: ereport(ERROR, (errcode(ERRCODE_RESERVED_NAME), errmsg("%s cannot be used as a role name here", "SESSION_USER"), parser_errposition((yylsp[0])))); break; case ROLESPEC_CURRENT_USER: ereport(ERROR, (errcode(ERRCODE_RESERVED_NAME), errmsg("%s cannot be used as a role name here", "CURRENT_USER"), parser_errposition((yylsp[0])))); break; } } #line 45776 "gram_minimal.c" /* yacc.c:1646 */ break; case 2269: #line 15015 "gram_minimal.y" /* yacc.c:1646 */ { /* * "public" and "none" are not keywords, but they must * be treated specially here. */ RoleSpec *n; if (strcmp((yyvsp[0].str), "public") == 0) { n = (RoleSpec *) makeRoleSpec(ROLESPEC_PUBLIC, (yylsp[0])); n->roletype = ROLESPEC_PUBLIC; } else if (strcmp((yyvsp[0].str), "none") == 0) { ereport(ERROR, (errcode(ERRCODE_RESERVED_NAME), errmsg("role name \"%s\" is reserved", "none"), parser_errposition((yylsp[0])))); } else { n = makeRoleSpec(ROLESPEC_CSTRING, (yylsp[0])); n->rolename = pstrdup((yyvsp[0].str)); } (yyval.rolespec) = n; } #line 45807 "gram_minimal.c" /* yacc.c:1646 */ break; case 2270: #line 15042 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.rolespec) = makeRoleSpec(ROLESPEC_CURRENT_USER, (yylsp[0])); } #line 45815 "gram_minimal.c" /* yacc.c:1646 */ break; case 2271: #line 15046 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.rolespec) = makeRoleSpec(ROLESPEC_SESSION_USER, (yylsp[0])); } #line 45823 "gram_minimal.c" /* yacc.c:1646 */ break; case 2272: #line 15052 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = list_make1((yyvsp[0].rolespec)); } #line 45829 "gram_minimal.c" /* yacc.c:1646 */ break; case 2273: #line 15054 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].rolespec)); } #line 45835 "gram_minimal.c" /* yacc.c:1646 */ break; case 2274: #line 15070 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 45841 "gram_minimal.c" /* yacc.c:1646 */ break; case 2275: #line 15071 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = pstrdup((yyvsp[0].keyword)); } #line 45847 "gram_minimal.c" /* yacc.c:1646 */ break; case 2276: #line 15072 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = pstrdup((yyvsp[0].keyword)); } #line 45853 "gram_minimal.c" /* yacc.c:1646 */ break; case 2277: #line 15077 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 45859 "gram_minimal.c" /* yacc.c:1646 */ break; case 2278: #line 15078 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = pstrdup((yyvsp[0].keyword)); } #line 45865 "gram_minimal.c" /* yacc.c:1646 */ break; case 2279: #line 15079 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = pstrdup((yyvsp[0].keyword)); } #line 45871 "gram_minimal.c" /* yacc.c:1646 */ break; case 2280: #line 15084 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 45877 "gram_minimal.c" /* yacc.c:1646 */ break; case 2281: #line 15085 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = pstrdup((yyvsp[0].keyword)); } #line 45883 "gram_minimal.c" /* yacc.c:1646 */ break; case 2282: #line 15086 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = pstrdup((yyvsp[0].keyword)); } #line 45889 "gram_minimal.c" /* yacc.c:1646 */ break; case 2283: #line 15087 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = pstrdup((yyvsp[0].keyword)); } #line 45895 "gram_minimal.c" /* yacc.c:1646 */ break; case 2284: #line 15093 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = (yyvsp[0].str); } #line 45901 "gram_minimal.c" /* yacc.c:1646 */ break; case 2285: #line 15094 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = pstrdup((yyvsp[0].keyword)); } #line 45907 "gram_minimal.c" /* yacc.c:1646 */ break; case 2286: #line 15095 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = pstrdup((yyvsp[0].keyword)); } #line 45913 "gram_minimal.c" /* yacc.c:1646 */ break; case 2287: #line 15096 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = pstrdup((yyvsp[0].keyword)); } #line 45919 "gram_minimal.c" /* yacc.c:1646 */ break; case 2288: #line 15097 "gram_minimal.y" /* yacc.c:1646 */ { (yyval.str) = pstrdup((yyvsp[0].keyword)); } #line 45925 "gram_minimal.c" /* yacc.c:1646 */ break; #line 45929 "gram_minimal.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 15596 "gram_minimal.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 minimal_base_yyerror(YYLTYPE *yylloc, core_yyscan_t yyscanner, const char *msg) { parser_yyerror(msg); } static RawStmt * makeRawStmt(Node *stmt, int stmt_location) { RawStmt *rs = makeNode(RawStmt); rs->stmt = stmt; rs->stmt_location = stmt_location; rs->stmt_len = 0; /* might get changed later */ return rs; } /* Adjust a RawStmt to reflect that it doesn't run to the end of the string */ static void updateRawStmtEnd(RawStmt *rs, int end_location) { /* * If we already set the length, don't change it. This is for situations * like "select foo ;; select bar" where the same statement will be last * in the string for more than one semicolon. */ if (rs->stmt_len > 0) return; /* OK, update length of RawStmt */ rs->stmt_len = end_location - rs->stmt_location; } 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 * 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 * 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); } /* makeRoleSpec * Create a RoleSpec with the given type */ static RoleSpec * makeRoleSpec(RoleSpecType type, int location) { RoleSpec *spec = makeNode(RoleSpec); spec->roletype = type; spec->location = location; return spec; } /* 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; } /* 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 * makeAndExpr(Node *lexpr, Node *rexpr, int location) { Node *lexp = lexpr; /* Look through AEXPR_PAREN nodes so they don't affect flattening */ while (IsA(lexp, A_Expr) && ((A_Expr *) lexp)->kind == AEXPR_PAREN) lexp = ((A_Expr *) lexp)->lexpr; /* Flatten "a AND b AND c ..." to a single BoolExpr on sight */ if (IsA(lexp, BoolExpr)) { BoolExpr *blexpr = (BoolExpr *) lexp; if (blexpr->boolop == AND_EXPR) { blexpr->args = lappend(blexpr->args, rexpr); return (Node *) blexpr; } } return (Node *) makeBoolExpr(AND_EXPR, list_make2(lexpr, rexpr), location); } static Node * makeOrExpr(Node *lexpr, Node *rexpr, int location) { Node *lexp = lexpr; /* Look through AEXPR_PAREN nodes so they don't affect flattening */ while (IsA(lexp, A_Expr) && ((A_Expr *) lexp)->kind == AEXPR_PAREN) lexp = ((A_Expr *) lexp)->lexpr; /* Flatten "a OR b OR c ..." to a single BoolExpr on sight */ if (IsA(lexp, BoolExpr)) { BoolExpr *blexpr = (BoolExpr *) lexp; if (blexpr->boolop == OR_EXPR) { blexpr->args = lappend(blexpr->args, rexpr); return (Node *) blexpr; } } return (Node *) makeBoolExpr(OR_EXPR, list_make2(lexpr, rexpr), location); } static Node * makeNotExpr(Node *expr, int location) { return (Node *) makeBoolExpr(NOT_EXPR, list_make1(expr), location); } static Node * makeAArrayExpr(List *elements, int location) { A_ArrayExpr *n = makeNode(A_ArrayExpr); n->elements = elements; n->location = location; return (Node *) n; } static Node * makeSQLValueFunction(SQLValueFunctionOp op, int32 typmod, int location) { SQLValueFunction *svf = makeNode(SQLValueFunction); svf->op = op; /* svf->type will be filled during parse analysis */ svf->typmod = typmod; svf->location = location; return (Node *) svf; } 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 = 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->ctematerialized = CTEMaterializeDefault; 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 minimal_parser_init(base_yy_extra_type *yyext) { yyext->parsetree = NIL; /* in case grammar forgets to set it */ } pgpool-II-4.1.4/src/parser/README0000664000175000017500000000352513730350075013215 00000000000000Generating minimal and standard parser files -------------------------------------------- To generate minimal and standard grammar files issue 'make generate_parsers' from Pgpool-II/src/parser directory. This will use gram_template.y file and will generate two grammar files. gram_minimal.y (for the minimal parser) and gram.y (for the standard parser). 'make generate_parsers' uses sunifdef (http://www.linuxcertif.com/man/1/sunifdef/) utility to generate the parsers. And If the 'sunifdef' utility is present on the the system in the standard path then the configure will automatically pick it up by itself. But in the case when the sunifdef is not present in the default path then you can use "--with-sunifdef=sunifdef_dir' configure switch to provide the 'sunifdef' path. Notes on importing the PostgreSQL parser ---------------------------------------- To import the PostgreSQL parser, merge all the changes in gram_template.y file from PostgreSQL's gram.y, and then run 'make generate_parsers' to generate updated minimal and standard grammar files for Pgpool-II Controlling minimal and standard parser output ----------------------------------------------- All the code in gram_template.y file inside #ifdef pgpool_minimal_parser section will only gets included in the gram_minimal.y file while the code inside #ifndef pgpool_minimal_parser section will only be included in the standard parser file. Similarly, the unconditional code which is not in either #ifndef pgpool_minimal_parser or #ifdef pgpool_minimal_parser will become part of both the parser. Example:1 --------- #ifdef pgpool_minimal_parser code only for the minimal parser #else code only for the standard parser #endif code for both parsers .. Example:2 --------- #ifndef pgpool_minimal_parser code only for the standard parser #else code only for the minimal parser #endif code for both parsers pgpool-II-4.1.4/src/parser/copyfuncs.c0000664000175000017500000035360013730350127014512 00000000000000/*------------------------------------------------------------------------- * * copyfuncs.c * Copy functions for Postgres tree nodes. * * NOTE: we currently support copying all node types found in parse and * plan trees. We do not support copying executor state trees; there * is no need for that, and no point in maintaining all the code that * would be needed. We also do not support copying Path trees, mainly * because the circular linkages between RelOptInfo and Path nodes can't * be handled easily in a simple depth-first traversal. * * * Portions Copyright (c) 2003-2019, PgPool Global Development Group * Portions Copyright (c) 1996-2019, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * IDENTIFICATION * src/backend/nodes/copyfuncs.c * *------------------------------------------------------------------------- */ #include "pool.h" #include #include #include "utils/palloc.h" #include "utils/elog.h" #include "parsenodes.h" #include "extensible.h" /* * Macros to simplify copying of different kinds of fields. Use these * wherever possible to reduce the chance for silly typos. Note that these * hard-wire the convention that the local variables in a Copy routine are * named 'newnode' and 'from'. */ /* Copy a simple scalar field (int, float, bool, enum, etc) */ #define COPY_SCALAR_FIELD(fldname) \ (newnode->fldname = from->fldname) /* Copy a field that is a pointer to some kind of Node or Node tree */ #define COPY_NODE_FIELD(fldname) \ (newnode->fldname = copyObjectImpl(from->fldname)) /* Copy a field that is a pointer to a Bitmapset */ #define COPY_BITMAPSET_FIELD(fldname) \ (newnode->fldname = bms_copy(from->fldname)) /* Copy a field that is a pointer to a C string, or perhaps NULL */ #define COPY_STRING_FIELD(fldname) \ (newnode->fldname = from->fldname ? pstrdup(from->fldname) : (char *) NULL) /* Copy a field that is a pointer to a simple palloc'd object of size sz */ #define COPY_POINTER_FIELD(fldname, sz) \ do { \ Size _size = (sz); \ newnode->fldname = palloc(_size); \ memcpy(newnode->fldname, from->fldname, _size); \ } while (0) /* Copy a parse location field (for Copy, this is same as scalar case) */ #define COPY_LOCATION_FIELD(fldname) \ (newnode->fldname = from->fldname) /* **************************************************************** * plannodes.h copy functions * **************************************************************** */ #ifdef NOT_USED_IN_PGPOOL /* * _copyPlannedStmt */ static PlannedStmt * _copyPlannedStmt(const PlannedStmt *from) { PlannedStmt *newnode = makeNode(PlannedStmt); COPY_SCALAR_FIELD(commandType); COPY_SCALAR_FIELD(queryId); COPY_SCALAR_FIELD(hasReturning); COPY_SCALAR_FIELD(hasModifyingCTE); COPY_SCALAR_FIELD(canSetTag); COPY_SCALAR_FIELD(transientPlan); COPY_SCALAR_FIELD(dependsOnRole); COPY_SCALAR_FIELD(parallelModeNeeded); COPY_SCALAR_FIELD(jitFlags); COPY_NODE_FIELD(planTree); COPY_NODE_FIELD(rtable); COPY_NODE_FIELD(resultRelations); COPY_NODE_FIELD(rootResultRelations); COPY_NODE_FIELD(subplans); COPY_BITMAPSET_FIELD(rewindPlanIDs); COPY_NODE_FIELD(rowMarks); COPY_NODE_FIELD(relationOids); COPY_NODE_FIELD(invalItems); COPY_NODE_FIELD(paramExecTypes); COPY_NODE_FIELD(utilityStmt); COPY_LOCATION_FIELD(stmt_location); COPY_LOCATION_FIELD(stmt_len); return newnode; } /* * CopyPlanFields * * This function copies the fields of the Plan node. It is used by * all the copy functions for classes which inherit from Plan. */ static void CopyPlanFields(const Plan *from, Plan *newnode) { COPY_SCALAR_FIELD(startup_cost); COPY_SCALAR_FIELD(total_cost); COPY_SCALAR_FIELD(plan_rows); COPY_SCALAR_FIELD(plan_width); COPY_SCALAR_FIELD(parallel_aware); COPY_SCALAR_FIELD(parallel_safe); COPY_SCALAR_FIELD(plan_node_id); COPY_NODE_FIELD(targetlist); COPY_NODE_FIELD(qual); COPY_NODE_FIELD(lefttree); COPY_NODE_FIELD(righttree); COPY_NODE_FIELD(initPlan); COPY_BITMAPSET_FIELD(extParam); COPY_BITMAPSET_FIELD(allParam); } /* * _copyPlan */ static Plan * _copyPlan(const Plan *from) { Plan *newnode = makeNode(Plan); /* * copy node superclass fields */ CopyPlanFields(from, newnode); return newnode; } /* * _copyResult */ static Result * _copyResult(const Result *from) { Result *newnode = makeNode(Result); /* * copy node superclass fields */ CopyPlanFields((const Plan *) from, (Plan *) newnode); /* * copy remainder of node */ COPY_NODE_FIELD(resconstantqual); return newnode; } /* * _copyProjectSet */ static ProjectSet * _copyProjectSet(const ProjectSet *from) { ProjectSet *newnode = makeNode(ProjectSet); /* * copy node superclass fields */ CopyPlanFields((const Plan *) from, (Plan *) newnode); return newnode; } /* * _copyModifyTable */ static ModifyTable * _copyModifyTable(const ModifyTable *from) { ModifyTable *newnode = makeNode(ModifyTable); /* * copy node superclass fields */ CopyPlanFields((const Plan *) from, (Plan *) newnode); /* * copy remainder of node */ COPY_SCALAR_FIELD(operation); COPY_SCALAR_FIELD(canSetTag); COPY_SCALAR_FIELD(nominalRelation); COPY_SCALAR_FIELD(rootRelation); COPY_SCALAR_FIELD(partColsUpdated); COPY_NODE_FIELD(resultRelations); COPY_SCALAR_FIELD(resultRelIndex); COPY_SCALAR_FIELD(rootResultRelIndex); COPY_NODE_FIELD(plans); COPY_NODE_FIELD(withCheckOptionLists); COPY_NODE_FIELD(returningLists); COPY_NODE_FIELD(fdwPrivLists); COPY_BITMAPSET_FIELD(fdwDirectModifyPlans); COPY_NODE_FIELD(rowMarks); COPY_SCALAR_FIELD(epqParam); COPY_SCALAR_FIELD(onConflictAction); COPY_NODE_FIELD(arbiterIndexes); COPY_NODE_FIELD(onConflictSet); COPY_NODE_FIELD(onConflictWhere); COPY_SCALAR_FIELD(exclRelRTI); COPY_NODE_FIELD(exclRelTlist); return newnode; } /* * _copyAppend */ static Append * _copyAppend(const Append *from) { Append *newnode = makeNode(Append); /* * copy node superclass fields */ CopyPlanFields((const Plan *) from, (Plan *) newnode); /* * copy remainder of node */ COPY_NODE_FIELD(appendplans); COPY_SCALAR_FIELD(first_partial_plan); COPY_NODE_FIELD(part_prune_info); return newnode; } /* * _copyMergeAppend */ static MergeAppend * _copyMergeAppend(const MergeAppend *from) { MergeAppend *newnode = makeNode(MergeAppend); /* * copy node superclass fields */ CopyPlanFields((const Plan *) from, (Plan *) newnode); /* * copy remainder of node */ COPY_NODE_FIELD(mergeplans); COPY_SCALAR_FIELD(numCols); COPY_POINTER_FIELD(sortColIdx, from->numCols * sizeof(AttrNumber)); COPY_POINTER_FIELD(sortOperators, from->numCols * sizeof(Oid)); COPY_POINTER_FIELD(collations, from->numCols * sizeof(Oid)); COPY_POINTER_FIELD(nullsFirst, from->numCols * sizeof(bool)); COPY_NODE_FIELD(part_prune_info); return newnode; } /* * _copyRecursiveUnion */ static RecursiveUnion * _copyRecursiveUnion(const RecursiveUnion *from) { RecursiveUnion *newnode = makeNode(RecursiveUnion); /* * copy node superclass fields */ CopyPlanFields((const Plan *) from, (Plan *) newnode); /* * copy remainder of node */ COPY_SCALAR_FIELD(wtParam); COPY_SCALAR_FIELD(numCols); if (from->numCols > 0) { COPY_POINTER_FIELD(dupColIdx, from->numCols * sizeof(AttrNumber)); COPY_POINTER_FIELD(dupOperators, from->numCols * sizeof(Oid)); COPY_POINTER_FIELD(dupCollations, from->numCols * sizeof(Oid)); } COPY_SCALAR_FIELD(numGroups); return newnode; } /* * _copyBitmapAnd */ static BitmapAnd * _copyBitmapAnd(const BitmapAnd *from) { BitmapAnd *newnode = makeNode(BitmapAnd); /* * copy node superclass fields */ CopyPlanFields((const Plan *) from, (Plan *) newnode); /* * copy remainder of node */ COPY_NODE_FIELD(bitmapplans); return newnode; } /* * _copyBitmapOr */ static BitmapOr * _copyBitmapOr(const BitmapOr *from) { BitmapOr *newnode = makeNode(BitmapOr); /* * copy node superclass fields */ CopyPlanFields((const Plan *) from, (Plan *) newnode); /* * copy remainder of node */ COPY_SCALAR_FIELD(isshared); COPY_NODE_FIELD(bitmapplans); return newnode; } /* * _copyGather */ static Gather * _copyGather(const Gather *from) { Gather *newnode = makeNode(Gather); /* * copy node superclass fields */ CopyPlanFields((const Plan *) from, (Plan *) newnode); /* * copy remainder of node */ COPY_SCALAR_FIELD(num_workers); COPY_SCALAR_FIELD(rescan_param); COPY_SCALAR_FIELD(single_copy); COPY_SCALAR_FIELD(invisible); COPY_BITMAPSET_FIELD(initParam); return newnode; } /* * CopyScanFields * * This function copies the fields of the Scan node. It is used by * all the copy functions for classes which inherit from Scan. */ static void CopyScanFields(const Scan *from, Scan *newnode) { CopyPlanFields((const Plan *) from, (Plan *) newnode); COPY_SCALAR_FIELD(scanrelid); } /* * _copyScan */ static Scan * _copyScan(const Scan *from) { Scan *newnode = makeNode(Scan); /* * copy node superclass fields */ CopyScanFields((const Scan *) from, (Scan *) newnode); return newnode; } /* * _copySeqScan */ static SeqScan * _copySeqScan(const SeqScan *from) { SeqScan *newnode = makeNode(SeqScan); /* * copy node superclass fields */ CopyScanFields((const Scan *) from, (Scan *) newnode); return newnode; } /* * _copySampleScan */ static SampleScan * _copySampleScan(const SampleScan *from) { SampleScan *newnode = makeNode(SampleScan); /* * copy node superclass fields */ CopyScanFields((const Scan *) from, (Scan *) newnode); /* * copy remainder of node */ COPY_NODE_FIELD(tablesample); return newnode; } /* * _copyIndexScan */ static IndexScan * _copyIndexScan(const IndexScan *from) { IndexScan *newnode = makeNode(IndexScan); /* * copy node superclass fields */ CopyScanFields((const Scan *) from, (Scan *) newnode); /* * copy remainder of node */ COPY_SCALAR_FIELD(indexid); COPY_NODE_FIELD(indexqual); COPY_NODE_FIELD(indexqualorig); COPY_NODE_FIELD(indexorderby); COPY_NODE_FIELD(indexorderbyorig); COPY_NODE_FIELD(indexorderbyops); COPY_SCALAR_FIELD(indexorderdir); return newnode; } /* * _copyIndexOnlyScan */ static IndexOnlyScan * _copyIndexOnlyScan(const IndexOnlyScan *from) { IndexOnlyScan *newnode = makeNode(IndexOnlyScan); /* * copy node superclass fields */ CopyScanFields((const Scan *) from, (Scan *) newnode); /* * copy remainder of node */ COPY_SCALAR_FIELD(indexid); COPY_NODE_FIELD(indexqual); COPY_NODE_FIELD(indexorderby); COPY_NODE_FIELD(indextlist); COPY_SCALAR_FIELD(indexorderdir); return newnode; } /* * _copyBitmapIndexScan */ static BitmapIndexScan * _copyBitmapIndexScan(const BitmapIndexScan *from) { BitmapIndexScan *newnode = makeNode(BitmapIndexScan); /* * copy node superclass fields */ CopyScanFields((const Scan *) from, (Scan *) newnode); /* * copy remainder of node */ COPY_SCALAR_FIELD(indexid); COPY_NODE_FIELD(indexqual); COPY_NODE_FIELD(indexqualorig); return newnode; } /* * _copyBitmapHeapScan */ static BitmapHeapScan * _copyBitmapHeapScan(const BitmapHeapScan *from) { BitmapHeapScan *newnode = makeNode(BitmapHeapScan); /* * copy node superclass fields */ CopyScanFields((const Scan *) from, (Scan *) newnode); /* * copy remainder of node */ COPY_NODE_FIELD(bitmapqualorig); return newnode; } /* * _copyTidScan */ static TidScan * _copyTidScan(const TidScan *from) { TidScan *newnode = makeNode(TidScan); /* * copy node superclass fields */ CopyScanFields((const Scan *) from, (Scan *) newnode); /* * copy remainder of node */ COPY_NODE_FIELD(tidquals); return newnode; } /* * _copySubqueryScan */ static SubqueryScan * _copySubqueryScan(const SubqueryScan *from) { SubqueryScan *newnode = makeNode(SubqueryScan); /* * copy node superclass fields */ CopyScanFields((const Scan *) from, (Scan *) newnode); /* * copy remainder of node */ COPY_NODE_FIELD(subplan); return newnode; } /* * _copyFunctionScan */ static FunctionScan * _copyFunctionScan(const FunctionScan *from) { FunctionScan *newnode = makeNode(FunctionScan); /* * copy node superclass fields */ CopyScanFields((const Scan *) from, (Scan *) newnode); /* * copy remainder of node */ COPY_NODE_FIELD(functions); COPY_SCALAR_FIELD(funcordinality); return newnode; } /* * _copyTableFuncScan */ static TableFuncScan * _copyTableFuncScan(const TableFuncScan *from) { TableFuncScan *newnode = makeNode(TableFuncScan); /* * copy node superclass fields */ CopyScanFields((const Scan *) from, (Scan *) newnode); /* * copy remainder of node */ COPY_NODE_FIELD(tablefunc); return newnode; } /* * _copyValuesScan */ static ValuesScan * _copyValuesScan(const ValuesScan *from) { ValuesScan *newnode = makeNode(ValuesScan); /* * copy node superclass fields */ CopyScanFields((const Scan *) from, (Scan *) newnode); /* * copy remainder of node */ COPY_NODE_FIELD(values_lists); return newnode; } /* * _copyCteScan */ static CteScan * _copyCteScan(const CteScan *from) { CteScan *newnode = makeNode(CteScan); /* * copy node superclass fields */ CopyScanFields((const Scan *) from, (Scan *) newnode); /* * copy remainder of node */ COPY_SCALAR_FIELD(ctePlanId); COPY_SCALAR_FIELD(cteParam); return newnode; } /* * _copyNamedTuplestoreScan */ static NamedTuplestoreScan * _copyNamedTuplestoreScan(const NamedTuplestoreScan *from) { NamedTuplestoreScan *newnode = makeNode(NamedTuplestoreScan); /* * copy node superclass fields */ CopyScanFields((const Scan *) from, (Scan *) newnode); /* * copy remainder of node */ COPY_STRING_FIELD(enrname); return newnode; } /* * _copyWorkTableScan */ static WorkTableScan * _copyWorkTableScan(const WorkTableScan *from) { WorkTableScan *newnode = makeNode(WorkTableScan); /* * copy node superclass fields */ CopyScanFields((const Scan *) from, (Scan *) newnode); /* * copy remainder of node */ COPY_SCALAR_FIELD(wtParam); return newnode; } /* * _copyForeignScan */ static ForeignScan * _copyForeignScan(const ForeignScan *from) { ForeignScan *newnode = makeNode(ForeignScan); /* * copy node superclass fields */ CopyScanFields((const Scan *) from, (Scan *) newnode); /* * copy remainder of node */ COPY_SCALAR_FIELD(operation); COPY_SCALAR_FIELD(fs_server); COPY_NODE_FIELD(fdw_exprs); COPY_NODE_FIELD(fdw_private); COPY_NODE_FIELD(fdw_scan_tlist); COPY_NODE_FIELD(fdw_recheck_quals); COPY_BITMAPSET_FIELD(fs_relids); COPY_SCALAR_FIELD(fsSystemCol); return newnode; } /* * _copyCustomScan */ static CustomScan * _copyCustomScan(const CustomScan *from) { CustomScan *newnode = makeNode(CustomScan); /* * copy node superclass fields */ CopyScanFields((const Scan *) from, (Scan *) newnode); /* * copy remainder of node */ COPY_SCALAR_FIELD(flags); COPY_NODE_FIELD(custom_plans); COPY_NODE_FIELD(custom_exprs); COPY_NODE_FIELD(custom_private); COPY_NODE_FIELD(custom_scan_tlist); COPY_BITMAPSET_FIELD(custom_relids); /* * NOTE: The method field of CustomScan is required to be a pointer to a * static table of callback functions. So we don't copy the table itself, * just reference the original one. */ COPY_SCALAR_FIELD(methods); return newnode; } /* * CopyJoinFields * * This function copies the fields of the Join node. It is used by * all the copy functions for classes which inherit from Join. */ static void CopyJoinFields(const Join *from, Join *newnode) { CopyPlanFields((const Plan *) from, (Plan *) newnode); COPY_SCALAR_FIELD(jointype); COPY_SCALAR_FIELD(inner_unique); COPY_NODE_FIELD(joinqual); } /* * _copyGatherMerge */ static GatherMerge * _copyGatherMerge(const GatherMerge *from) { GatherMerge *newnode = makeNode(GatherMerge); /* * copy node superclass fields */ CopyPlanFields((const Plan *) from, (Plan *) newnode); /* * copy remainder of node */ COPY_SCALAR_FIELD(num_workers); COPY_SCALAR_FIELD(rescan_param); COPY_SCALAR_FIELD(numCols); COPY_POINTER_FIELD(sortColIdx, from->numCols * sizeof(AttrNumber)); COPY_POINTER_FIELD(sortOperators, from->numCols * sizeof(Oid)); COPY_POINTER_FIELD(collations, from->numCols * sizeof(Oid)); COPY_POINTER_FIELD(nullsFirst, from->numCols * sizeof(bool)); COPY_BITMAPSET_FIELD(initParam); return newnode; } /* * _copyJoin */ static Join * _copyJoin(const Join *from) { Join *newnode = makeNode(Join); /* * copy node superclass fields */ CopyJoinFields(from, newnode); return newnode; } /* * _copyNestLoop */ static NestLoop * _copyNestLoop(const NestLoop *from) { NestLoop *newnode = makeNode(NestLoop); /* * copy node superclass fields */ CopyJoinFields((const Join *) from, (Join *) newnode); /* * copy remainder of node */ COPY_NODE_FIELD(nestParams); return newnode; } /* * _copyMergeJoin */ static MergeJoin * _copyMergeJoin(const MergeJoin *from) { MergeJoin *newnode = makeNode(MergeJoin); int numCols; /* * copy node superclass fields */ CopyJoinFields((const Join *) from, (Join *) newnode); /* * copy remainder of node */ COPY_SCALAR_FIELD(skip_mark_restore); COPY_NODE_FIELD(mergeclauses); numCols = list_length(from->mergeclauses); if (numCols > 0) { COPY_POINTER_FIELD(mergeFamilies, numCols * sizeof(Oid)); COPY_POINTER_FIELD(mergeCollations, numCols * sizeof(Oid)); COPY_POINTER_FIELD(mergeStrategies, numCols * sizeof(int)); COPY_POINTER_FIELD(mergeNullsFirst, numCols * sizeof(bool)); } return newnode; } /* * _copyHashJoin */ static HashJoin * _copyHashJoin(const HashJoin *from) { HashJoin *newnode = makeNode(HashJoin); /* * copy node superclass fields */ CopyJoinFields((const Join *) from, (Join *) newnode); /* * copy remainder of node */ COPY_NODE_FIELD(hashclauses); return newnode; } /* * _copyMaterial */ static Material * _copyMaterial(const Material *from) { Material *newnode = makeNode(Material); /* * copy node superclass fields */ CopyPlanFields((const Plan *) from, (Plan *) newnode); return newnode; } /* * _copySort */ static Sort * _copySort(const Sort *from) { Sort *newnode = makeNode(Sort); /* * copy node superclass fields */ CopyPlanFields((const Plan *) from, (Plan *) newnode); COPY_SCALAR_FIELD(numCols); COPY_POINTER_FIELD(sortColIdx, from->numCols * sizeof(AttrNumber)); COPY_POINTER_FIELD(sortOperators, from->numCols * sizeof(Oid)); COPY_POINTER_FIELD(collations, from->numCols * sizeof(Oid)); COPY_POINTER_FIELD(nullsFirst, from->numCols * sizeof(bool)); return newnode; } /* * _copyGroup */ static Group * _copyGroup(const Group *from) { Group *newnode = makeNode(Group); CopyPlanFields((const Plan *) from, (Plan *) newnode); COPY_SCALAR_FIELD(numCols); COPY_POINTER_FIELD(grpColIdx, from->numCols * sizeof(AttrNumber)); COPY_POINTER_FIELD(grpOperators, from->numCols * sizeof(Oid)); COPY_POINTER_FIELD(grpCollations, from->numCols * sizeof(Oid)); return newnode; } /* * _copyAgg */ static Agg * _copyAgg(const Agg *from) { Agg *newnode = makeNode(Agg); CopyPlanFields((const Plan *) from, (Plan *) newnode); COPY_SCALAR_FIELD(aggstrategy); COPY_SCALAR_FIELD(aggsplit); COPY_SCALAR_FIELD(numCols); if (from->numCols > 0) { COPY_POINTER_FIELD(grpColIdx, from->numCols * sizeof(AttrNumber)); COPY_POINTER_FIELD(grpOperators, from->numCols * sizeof(Oid)); COPY_POINTER_FIELD(grpCollations, from->numCols * sizeof(Oid)); } COPY_SCALAR_FIELD(numGroups); COPY_BITMAPSET_FIELD(aggParams); COPY_NODE_FIELD(groupingSets); COPY_NODE_FIELD(chain); return newnode; } /* * _copyWindowAgg */ static WindowAgg * _copyWindowAgg(const WindowAgg *from) { WindowAgg *newnode = makeNode(WindowAgg); CopyPlanFields((const Plan *) from, (Plan *) newnode); COPY_SCALAR_FIELD(winref); COPY_SCALAR_FIELD(partNumCols); if (from->partNumCols > 0) { COPY_POINTER_FIELD(partColIdx, from->partNumCols * sizeof(AttrNumber)); COPY_POINTER_FIELD(partOperators, from->partNumCols * sizeof(Oid)); COPY_POINTER_FIELD(partCollations, from->partNumCols * sizeof(Oid)); } COPY_SCALAR_FIELD(ordNumCols); if (from->ordNumCols > 0) { COPY_POINTER_FIELD(ordColIdx, from->ordNumCols * sizeof(AttrNumber)); COPY_POINTER_FIELD(ordOperators, from->ordNumCols * sizeof(Oid)); COPY_POINTER_FIELD(ordCollations, from->ordNumCols * sizeof(Oid)); } COPY_SCALAR_FIELD(frameOptions); COPY_NODE_FIELD(startOffset); COPY_NODE_FIELD(endOffset); COPY_SCALAR_FIELD(startInRangeFunc); COPY_SCALAR_FIELD(endInRangeFunc); COPY_SCALAR_FIELD(inRangeColl); COPY_SCALAR_FIELD(inRangeAsc); COPY_SCALAR_FIELD(inRangeNullsFirst); return newnode; } /* * _copyUnique */ static Unique * _copyUnique(const Unique *from) { Unique *newnode = makeNode(Unique); /* * copy node superclass fields */ CopyPlanFields((const Plan *) from, (Plan *) newnode); /* * copy remainder of node */ COPY_SCALAR_FIELD(numCols); COPY_POINTER_FIELD(uniqColIdx, from->numCols * sizeof(AttrNumber)); COPY_POINTER_FIELD(uniqOperators, from->numCols * sizeof(Oid)); COPY_POINTER_FIELD(uniqCollations, from->numCols * sizeof(Oid)); return newnode; } /* * _copyHash */ static Hash * _copyHash(const Hash *from) { Hash *newnode = makeNode(Hash); /* * copy node superclass fields */ CopyPlanFields((const Plan *) from, (Plan *) newnode); /* * copy remainder of node */ COPY_SCALAR_FIELD(skewTable); COPY_SCALAR_FIELD(skewColumn); COPY_SCALAR_FIELD(skewInherit); COPY_SCALAR_FIELD(rows_total); return newnode; } /* * _copySetOp */ static SetOp * _copySetOp(const SetOp *from) { SetOp *newnode = makeNode(SetOp); /* * copy node superclass fields */ CopyPlanFields((const Plan *) from, (Plan *) newnode); /* * copy remainder of node */ COPY_SCALAR_FIELD(cmd); COPY_SCALAR_FIELD(strategy); COPY_SCALAR_FIELD(numCols); COPY_POINTER_FIELD(dupColIdx, from->numCols * sizeof(AttrNumber)); COPY_POINTER_FIELD(dupOperators, from->numCols * sizeof(Oid)); COPY_POINTER_FIELD(dupCollations, from->numCols * sizeof(Oid)); COPY_SCALAR_FIELD(flagColIdx); COPY_SCALAR_FIELD(firstFlag); COPY_SCALAR_FIELD(numGroups); return newnode; } /* * _copyLockRows */ static LockRows * _copyLockRows(const LockRows *from) { LockRows *newnode = makeNode(LockRows); /* * copy node superclass fields */ CopyPlanFields((const Plan *) from, (Plan *) newnode); /* * copy remainder of node */ COPY_NODE_FIELD(rowMarks); COPY_SCALAR_FIELD(epqParam); return newnode; } /* * _copyLimit */ static Limit * _copyLimit(const Limit *from) { Limit *newnode = makeNode(Limit); /* * copy node superclass fields */ CopyPlanFields((const Plan *) from, (Plan *) newnode); /* * copy remainder of node */ COPY_NODE_FIELD(limitOffset); COPY_NODE_FIELD(limitCount); return newnode; } /* * _copyNestLoopParam */ static NestLoopParam * _copyNestLoopParam(const NestLoopParam *from) { NestLoopParam *newnode = makeNode(NestLoopParam); COPY_SCALAR_FIELD(paramno); COPY_NODE_FIELD(paramval); return newnode; } /* * _copyPlanRowMark */ static PlanRowMark * _copyPlanRowMark(const PlanRowMark *from) { PlanRowMark *newnode = makeNode(PlanRowMark); COPY_SCALAR_FIELD(rti); COPY_SCALAR_FIELD(prti); COPY_SCALAR_FIELD(rowmarkId); COPY_SCALAR_FIELD(markType); COPY_SCALAR_FIELD(allMarkTypes); COPY_SCALAR_FIELD(strength); COPY_SCALAR_FIELD(waitPolicy); COPY_SCALAR_FIELD(isParent); return newnode; } static PartitionPruneInfo * _copyPartitionPruneInfo(const PartitionPruneInfo *from) { PartitionPruneInfo *newnode = makeNode(PartitionPruneInfo); COPY_NODE_FIELD(prune_infos); COPY_BITMAPSET_FIELD(other_subplans); return newnode; } static PartitionedRelPruneInfo * _copyPartitionedRelPruneInfo(const PartitionedRelPruneInfo *from) { PartitionedRelPruneInfo *newnode = makeNode(PartitionedRelPruneInfo); COPY_SCALAR_FIELD(rtindex); COPY_BITMAPSET_FIELD(present_parts); COPY_SCALAR_FIELD(nparts); COPY_POINTER_FIELD(subplan_map, from->nparts * sizeof(int)); COPY_POINTER_FIELD(subpart_map, from->nparts * sizeof(int)); COPY_POINTER_FIELD(relid_map, from->nparts * sizeof(Oid)); COPY_NODE_FIELD(initial_pruning_steps); COPY_NODE_FIELD(exec_pruning_steps); COPY_BITMAPSET_FIELD(execparamids); return newnode; } /* * _copyPartitionPruneStepOp */ static PartitionPruneStepOp * _copyPartitionPruneStepOp(const PartitionPruneStepOp *from) { PartitionPruneStepOp *newnode = makeNode(PartitionPruneStepOp); COPY_SCALAR_FIELD(step.step_id); COPY_SCALAR_FIELD(opstrategy); COPY_NODE_FIELD(exprs); COPY_NODE_FIELD(cmpfns); COPY_BITMAPSET_FIELD(nullkeys); return newnode; } /* * _copyPartitionPruneStepCombine */ static PartitionPruneStepCombine * _copyPartitionPruneStepCombine(const PartitionPruneStepCombine *from) { PartitionPruneStepCombine *newnode = makeNode(PartitionPruneStepCombine); COPY_SCALAR_FIELD(step.step_id); COPY_SCALAR_FIELD(combineOp); COPY_NODE_FIELD(source_stepids); return newnode; } /* * _copyPlanInvalItem */ static PlanInvalItem * _copyPlanInvalItem(const PlanInvalItem *from) { PlanInvalItem *newnode = makeNode(PlanInvalItem); COPY_SCALAR_FIELD(cacheId); COPY_SCALAR_FIELD(hashValue); return newnode; } #endif /* **************************************************************** * primnodes.h copy functions * **************************************************************** */ /* * _copyAlias */ static Alias * _copyAlias(const Alias *from) { Alias *newnode = makeNode(Alias); COPY_STRING_FIELD(aliasname); COPY_NODE_FIELD(colnames); return newnode; } /* * _copyRangeVar */ static RangeVar * _copyRangeVar(const RangeVar *from) { RangeVar *newnode = makeNode(RangeVar); COPY_STRING_FIELD(catalogname); COPY_STRING_FIELD(schemaname); COPY_STRING_FIELD(relname); COPY_SCALAR_FIELD(inh); COPY_SCALAR_FIELD(relpersistence); COPY_NODE_FIELD(alias); COPY_LOCATION_FIELD(location); return newnode; } /* * _copyTableFunc */ static TableFunc * _copyTableFunc(const TableFunc *from) { TableFunc *newnode = makeNode(TableFunc); COPY_NODE_FIELD(ns_uris); COPY_NODE_FIELD(ns_names); COPY_NODE_FIELD(docexpr); COPY_NODE_FIELD(rowexpr); COPY_NODE_FIELD(colnames); COPY_NODE_FIELD(coltypes); COPY_NODE_FIELD(coltypmods); COPY_NODE_FIELD(colcollations); COPY_NODE_FIELD(colexprs); COPY_NODE_FIELD(coldefexprs); COPY_BITMAPSET_FIELD(notnulls); COPY_SCALAR_FIELD(ordinalitycol); COPY_LOCATION_FIELD(location); return newnode; } /* * _copyIntoClause */ static IntoClause * _copyIntoClause(const IntoClause *from) { IntoClause *newnode = makeNode(IntoClause); COPY_NODE_FIELD(rel); COPY_NODE_FIELD(colNames); COPY_STRING_FIELD(accessMethod); COPY_NODE_FIELD(options); COPY_SCALAR_FIELD(onCommit); COPY_STRING_FIELD(tableSpaceName); COPY_NODE_FIELD(viewQuery); COPY_SCALAR_FIELD(skipData); return newnode; } /* * We don't need a _copyExpr because Expr is an abstract supertype which * should never actually get instantiated. Also, since it has no common * fields except NodeTag, there's no need for a helper routine to factor * out copying the common fields... */ /* * _copyVar */ static Var * _copyVar(const Var *from) { Var *newnode = makeNode(Var); COPY_SCALAR_FIELD(varno); COPY_SCALAR_FIELD(varattno); COPY_SCALAR_FIELD(vartype); COPY_SCALAR_FIELD(vartypmod); COPY_SCALAR_FIELD(varcollid); COPY_SCALAR_FIELD(varlevelsup); COPY_SCALAR_FIELD(varnoold); COPY_SCALAR_FIELD(varoattno); COPY_LOCATION_FIELD(location); return newnode; } #ifdef NOT_USED_IN_PGPOOL /* * _copyConst */ static Const * _copyConst(const Const *from) { Const *newnode = makeNode(Const); COPY_SCALAR_FIELD(consttype); COPY_SCALAR_FIELD(consttypmod); COPY_SCALAR_FIELD(constcollid); COPY_SCALAR_FIELD(constlen); if (from->constbyval || from->constisnull) { /* * passed by value so just copy the datum. Also, don't try to copy * struct when value is null! */ newnode->constvalue = from->constvalue; } else { /* * passed by reference. We need a palloc'd copy. */ newnode->constvalue = datumCopy(from->constvalue, from->constbyval, from->constlen); } COPY_SCALAR_FIELD(constisnull); COPY_SCALAR_FIELD(constbyval); COPY_LOCATION_FIELD(location); return newnode; } #endif /* * _copyParam */ static Param * _copyParam(const Param *from) { Param *newnode = makeNode(Param); COPY_SCALAR_FIELD(paramkind); COPY_SCALAR_FIELD(paramid); COPY_SCALAR_FIELD(paramtype); COPY_SCALAR_FIELD(paramtypmod); COPY_SCALAR_FIELD(paramcollid); COPY_LOCATION_FIELD(location); return newnode; } /* * _copyAggref */ static Aggref * _copyAggref(const Aggref *from) { Aggref *newnode = makeNode(Aggref); COPY_SCALAR_FIELD(aggfnoid); COPY_SCALAR_FIELD(aggtype); COPY_SCALAR_FIELD(aggcollid); COPY_SCALAR_FIELD(inputcollid); COPY_SCALAR_FIELD(aggtranstype); COPY_NODE_FIELD(aggargtypes); COPY_NODE_FIELD(aggdirectargs); COPY_NODE_FIELD(args); COPY_NODE_FIELD(aggorder); COPY_NODE_FIELD(aggdistinct); COPY_NODE_FIELD(aggfilter); COPY_SCALAR_FIELD(aggstar); COPY_SCALAR_FIELD(aggvariadic); COPY_SCALAR_FIELD(aggkind); COPY_SCALAR_FIELD(agglevelsup); COPY_SCALAR_FIELD(aggsplit); COPY_LOCATION_FIELD(location); return newnode; } /* * _copyGroupingFunc */ static GroupingFunc * _copyGroupingFunc(const GroupingFunc *from) { GroupingFunc *newnode = makeNode(GroupingFunc); COPY_NODE_FIELD(args); COPY_NODE_FIELD(refs); COPY_NODE_FIELD(cols); COPY_SCALAR_FIELD(agglevelsup); COPY_LOCATION_FIELD(location); return newnode; } /* * _copyWindowFunc */ static WindowFunc * _copyWindowFunc(const WindowFunc *from) { WindowFunc *newnode = makeNode(WindowFunc); COPY_SCALAR_FIELD(winfnoid); COPY_SCALAR_FIELD(wintype); COPY_SCALAR_FIELD(wincollid); COPY_SCALAR_FIELD(inputcollid); COPY_NODE_FIELD(args); COPY_NODE_FIELD(aggfilter); COPY_SCALAR_FIELD(winref); COPY_SCALAR_FIELD(winstar); COPY_SCALAR_FIELD(winagg); COPY_LOCATION_FIELD(location); return newnode; } /* * _copySubscriptingRef */ static SubscriptingRef * _copySubscriptingRef(const SubscriptingRef *from) { SubscriptingRef *newnode = makeNode(SubscriptingRef); COPY_SCALAR_FIELD(refcontainertype); COPY_SCALAR_FIELD(refelemtype); COPY_SCALAR_FIELD(reftypmod); COPY_SCALAR_FIELD(refcollid); COPY_NODE_FIELD(refupperindexpr); COPY_NODE_FIELD(reflowerindexpr); COPY_NODE_FIELD(refexpr); COPY_NODE_FIELD(refassgnexpr); return newnode; } /* * _copyFuncExpr */ static FuncExpr * _copyFuncExpr(const FuncExpr *from) { FuncExpr *newnode = makeNode(FuncExpr); COPY_SCALAR_FIELD(funcid); COPY_SCALAR_FIELD(funcresulttype); COPY_SCALAR_FIELD(funcretset); COPY_SCALAR_FIELD(funcvariadic); COPY_SCALAR_FIELD(funcformat); COPY_SCALAR_FIELD(funccollid); COPY_SCALAR_FIELD(inputcollid); COPY_NODE_FIELD(args); COPY_LOCATION_FIELD(location); return newnode; } /* * _copyNamedArgExpr * */ static NamedArgExpr * _copyNamedArgExpr(const NamedArgExpr *from) { NamedArgExpr *newnode = makeNode(NamedArgExpr); COPY_NODE_FIELD(arg); COPY_STRING_FIELD(name); COPY_SCALAR_FIELD(argnumber); COPY_LOCATION_FIELD(location); return newnode; } /* * _copyOpExpr */ static OpExpr * _copyOpExpr(const OpExpr *from) { OpExpr *newnode = makeNode(OpExpr); COPY_SCALAR_FIELD(opno); COPY_SCALAR_FIELD(opfuncid); COPY_SCALAR_FIELD(opresulttype); COPY_SCALAR_FIELD(opretset); COPY_SCALAR_FIELD(opcollid); COPY_SCALAR_FIELD(inputcollid); COPY_NODE_FIELD(args); COPY_LOCATION_FIELD(location); return newnode; } /* * _copyDistinctExpr (same as OpExpr) */ static DistinctExpr * _copyDistinctExpr(const DistinctExpr *from) { DistinctExpr *newnode = makeNode(DistinctExpr); COPY_SCALAR_FIELD(opno); COPY_SCALAR_FIELD(opfuncid); COPY_SCALAR_FIELD(opresulttype); COPY_SCALAR_FIELD(opretset); COPY_SCALAR_FIELD(opcollid); COPY_SCALAR_FIELD(inputcollid); COPY_NODE_FIELD(args); COPY_LOCATION_FIELD(location); return newnode; } /* * _copyNullIfExpr (same as OpExpr) */ static NullIfExpr * _copyNullIfExpr(const NullIfExpr *from) { NullIfExpr *newnode = makeNode(NullIfExpr); COPY_SCALAR_FIELD(opno); COPY_SCALAR_FIELD(opfuncid); COPY_SCALAR_FIELD(opresulttype); COPY_SCALAR_FIELD(opretset); COPY_SCALAR_FIELD(opcollid); COPY_SCALAR_FIELD(inputcollid); COPY_NODE_FIELD(args); COPY_LOCATION_FIELD(location); return newnode; } /* * _copyScalarArrayOpExpr */ static ScalarArrayOpExpr * _copyScalarArrayOpExpr(const ScalarArrayOpExpr *from) { ScalarArrayOpExpr *newnode = makeNode(ScalarArrayOpExpr); COPY_SCALAR_FIELD(opno); COPY_SCALAR_FIELD(opfuncid); COPY_SCALAR_FIELD(useOr); COPY_SCALAR_FIELD(inputcollid); COPY_NODE_FIELD(args); COPY_LOCATION_FIELD(location); return newnode; } /* * _copyBoolExpr */ static BoolExpr * _copyBoolExpr(const BoolExpr *from) { BoolExpr *newnode = makeNode(BoolExpr); COPY_SCALAR_FIELD(boolop); COPY_NODE_FIELD(args); COPY_LOCATION_FIELD(location); return newnode; } /* * _copySubLink */ static SubLink * _copySubLink(const SubLink *from) { SubLink *newnode = makeNode(SubLink); COPY_SCALAR_FIELD(subLinkType); COPY_SCALAR_FIELD(subLinkId); COPY_NODE_FIELD(testexpr); COPY_NODE_FIELD(operName); COPY_NODE_FIELD(subselect); COPY_LOCATION_FIELD(location); return newnode; } /* * _copySubPlan */ static SubPlan * _copySubPlan(const SubPlan *from) { SubPlan *newnode = makeNode(SubPlan); COPY_SCALAR_FIELD(subLinkType); COPY_NODE_FIELD(testexpr); COPY_NODE_FIELD(paramIds); COPY_SCALAR_FIELD(plan_id); COPY_STRING_FIELD(plan_name); COPY_SCALAR_FIELD(firstColType); COPY_SCALAR_FIELD(firstColTypmod); COPY_SCALAR_FIELD(firstColCollation); COPY_SCALAR_FIELD(useHashTable); COPY_SCALAR_FIELD(unknownEqFalse); COPY_SCALAR_FIELD(parallel_safe); COPY_NODE_FIELD(setParam); COPY_NODE_FIELD(parParam); COPY_NODE_FIELD(args); COPY_SCALAR_FIELD(startup_cost); COPY_SCALAR_FIELD(per_call_cost); return newnode; } /* * _copyAlternativeSubPlan */ static AlternativeSubPlan * _copyAlternativeSubPlan(const AlternativeSubPlan *from) { AlternativeSubPlan *newnode = makeNode(AlternativeSubPlan); COPY_NODE_FIELD(subplans); return newnode; } /* * _copyFieldSelect */ static FieldSelect * _copyFieldSelect(const FieldSelect *from) { FieldSelect *newnode = makeNode(FieldSelect); COPY_NODE_FIELD(arg); COPY_SCALAR_FIELD(fieldnum); COPY_SCALAR_FIELD(resulttype); COPY_SCALAR_FIELD(resulttypmod); COPY_SCALAR_FIELD(resultcollid); return newnode; } /* * _copyFieldStore */ static FieldStore * _copyFieldStore(const FieldStore *from) { FieldStore *newnode = makeNode(FieldStore); COPY_NODE_FIELD(arg); COPY_NODE_FIELD(newvals); COPY_NODE_FIELD(fieldnums); COPY_SCALAR_FIELD(resulttype); return newnode; } /* * _copyRelabelType */ static RelabelType * _copyRelabelType(const RelabelType *from) { RelabelType *newnode = makeNode(RelabelType); COPY_NODE_FIELD(arg); COPY_SCALAR_FIELD(resulttype); COPY_SCALAR_FIELD(resulttypmod); COPY_SCALAR_FIELD(resultcollid); COPY_SCALAR_FIELD(relabelformat); COPY_LOCATION_FIELD(location); return newnode; } /* * _copyCoerceViaIO */ static CoerceViaIO * _copyCoerceViaIO(const CoerceViaIO *from) { CoerceViaIO *newnode = makeNode(CoerceViaIO); COPY_NODE_FIELD(arg); COPY_SCALAR_FIELD(resulttype); COPY_SCALAR_FIELD(resultcollid); COPY_SCALAR_FIELD(coerceformat); COPY_LOCATION_FIELD(location); return newnode; } /* * _copyArrayCoerceExpr */ static ArrayCoerceExpr * _copyArrayCoerceExpr(const ArrayCoerceExpr *from) { ArrayCoerceExpr *newnode = makeNode(ArrayCoerceExpr); COPY_NODE_FIELD(arg); COPY_NODE_FIELD(elemexpr); COPY_SCALAR_FIELD(resulttype); COPY_SCALAR_FIELD(resulttypmod); COPY_SCALAR_FIELD(resultcollid); COPY_SCALAR_FIELD(coerceformat); COPY_LOCATION_FIELD(location); return newnode; } /* * _copyConvertRowtypeExpr */ static ConvertRowtypeExpr * _copyConvertRowtypeExpr(const ConvertRowtypeExpr *from) { ConvertRowtypeExpr *newnode = makeNode(ConvertRowtypeExpr); COPY_NODE_FIELD(arg); COPY_SCALAR_FIELD(resulttype); COPY_SCALAR_FIELD(convertformat); COPY_LOCATION_FIELD(location); return newnode; } /* * _copyCollateExpr */ static CollateExpr * _copyCollateExpr(const CollateExpr *from) { CollateExpr *newnode = makeNode(CollateExpr); COPY_NODE_FIELD(arg); COPY_SCALAR_FIELD(collOid); COPY_LOCATION_FIELD(location); return newnode; } /* * _copyCaseExpr */ static CaseExpr * _copyCaseExpr(const CaseExpr *from) { CaseExpr *newnode = makeNode(CaseExpr); COPY_SCALAR_FIELD(casetype); COPY_SCALAR_FIELD(casecollid); COPY_NODE_FIELD(arg); COPY_NODE_FIELD(args); COPY_NODE_FIELD(defresult); COPY_LOCATION_FIELD(location); return newnode; } /* * _copyCaseWhen */ static CaseWhen * _copyCaseWhen(const CaseWhen *from) { CaseWhen *newnode = makeNode(CaseWhen); COPY_NODE_FIELD(expr); COPY_NODE_FIELD(result); COPY_LOCATION_FIELD(location); return newnode; } /* * _copyCaseTestExpr */ static CaseTestExpr * _copyCaseTestExpr(const CaseTestExpr *from) { CaseTestExpr *newnode = makeNode(CaseTestExpr); COPY_SCALAR_FIELD(typeId); COPY_SCALAR_FIELD(typeMod); COPY_SCALAR_FIELD(collation); return newnode; } /* * _copyArrayExpr */ static ArrayExpr * _copyArrayExpr(const ArrayExpr *from) { ArrayExpr *newnode = makeNode(ArrayExpr); COPY_SCALAR_FIELD(array_typeid); COPY_SCALAR_FIELD(array_collid); COPY_SCALAR_FIELD(element_typeid); COPY_NODE_FIELD(elements); COPY_SCALAR_FIELD(multidims); COPY_LOCATION_FIELD(location); return newnode; } /* * _copyRowExpr */ static RowExpr * _copyRowExpr(const RowExpr *from) { RowExpr *newnode = makeNode(RowExpr); COPY_NODE_FIELD(args); COPY_SCALAR_FIELD(row_typeid); COPY_SCALAR_FIELD(row_format); COPY_NODE_FIELD(colnames); COPY_LOCATION_FIELD(location); return newnode; } /* * _copyRowCompareExpr */ static RowCompareExpr * _copyRowCompareExpr(const RowCompareExpr *from) { RowCompareExpr *newnode = makeNode(RowCompareExpr); COPY_SCALAR_FIELD(rctype); COPY_NODE_FIELD(opnos); COPY_NODE_FIELD(opfamilies); COPY_NODE_FIELD(inputcollids); COPY_NODE_FIELD(largs); COPY_NODE_FIELD(rargs); return newnode; } /* * _copyCoalesceExpr */ static CoalesceExpr * _copyCoalesceExpr(const CoalesceExpr *from) { CoalesceExpr *newnode = makeNode(CoalesceExpr); COPY_SCALAR_FIELD(coalescetype); COPY_SCALAR_FIELD(coalescecollid); COPY_NODE_FIELD(args); COPY_LOCATION_FIELD(location); return newnode; } /* * _copyMinMaxExpr */ static MinMaxExpr * _copyMinMaxExpr(const MinMaxExpr *from) { MinMaxExpr *newnode = makeNode(MinMaxExpr); COPY_SCALAR_FIELD(minmaxtype); COPY_SCALAR_FIELD(minmaxcollid); COPY_SCALAR_FIELD(inputcollid); COPY_SCALAR_FIELD(op); COPY_NODE_FIELD(args); COPY_LOCATION_FIELD(location); return newnode; } /* * _copySQLValueFunction */ static SQLValueFunction * _copySQLValueFunction(const SQLValueFunction *from) { SQLValueFunction *newnode = makeNode(SQLValueFunction); COPY_SCALAR_FIELD(op); COPY_SCALAR_FIELD(type); COPY_SCALAR_FIELD(typmod); COPY_LOCATION_FIELD(location); return newnode; } /* * _copyXmlExpr */ static XmlExpr * _copyXmlExpr(const XmlExpr *from) { XmlExpr *newnode = makeNode(XmlExpr); COPY_SCALAR_FIELD(op); COPY_STRING_FIELD(name); COPY_NODE_FIELD(named_args); COPY_NODE_FIELD(arg_names); COPY_NODE_FIELD(args); COPY_SCALAR_FIELD(xmloption); COPY_SCALAR_FIELD(type); COPY_SCALAR_FIELD(typmod); COPY_LOCATION_FIELD(location); return newnode; } /* * _copyNullTest */ static NullTest * _copyNullTest(const NullTest *from) { NullTest *newnode = makeNode(NullTest); COPY_NODE_FIELD(arg); COPY_SCALAR_FIELD(nulltesttype); COPY_SCALAR_FIELD(argisrow); COPY_LOCATION_FIELD(location); return newnode; } /* * _copyBooleanTest */ static BooleanTest * _copyBooleanTest(const BooleanTest *from) { BooleanTest *newnode = makeNode(BooleanTest); COPY_NODE_FIELD(arg); COPY_SCALAR_FIELD(booltesttype); COPY_LOCATION_FIELD(location); return newnode; } /* * _copyCoerceToDomain */ static CoerceToDomain * _copyCoerceToDomain(const CoerceToDomain *from) { CoerceToDomain *newnode = makeNode(CoerceToDomain); COPY_NODE_FIELD(arg); COPY_SCALAR_FIELD(resulttype); COPY_SCALAR_FIELD(resulttypmod); COPY_SCALAR_FIELD(resultcollid); COPY_SCALAR_FIELD(coercionformat); COPY_LOCATION_FIELD(location); return newnode; } /* * _copyCoerceToDomainValue */ static CoerceToDomainValue * _copyCoerceToDomainValue(const CoerceToDomainValue *from) { CoerceToDomainValue *newnode = makeNode(CoerceToDomainValue); COPY_SCALAR_FIELD(typeId); COPY_SCALAR_FIELD(typeMod); COPY_SCALAR_FIELD(collation); COPY_LOCATION_FIELD(location); return newnode; } /* * _copySetToDefault */ static SetToDefault * _copySetToDefault(const SetToDefault *from) { SetToDefault *newnode = makeNode(SetToDefault); COPY_SCALAR_FIELD(typeId); COPY_SCALAR_FIELD(typeMod); COPY_SCALAR_FIELD(collation); COPY_LOCATION_FIELD(location); return newnode; } /* * _copyCurrentOfExpr */ static CurrentOfExpr * _copyCurrentOfExpr(const CurrentOfExpr *from) { CurrentOfExpr *newnode = makeNode(CurrentOfExpr); COPY_SCALAR_FIELD(cvarno); COPY_STRING_FIELD(cursor_name); COPY_SCALAR_FIELD(cursor_param); return newnode; } /* * _copyNextValueExpr */ static NextValueExpr * _copyNextValueExpr(const NextValueExpr *from) { NextValueExpr *newnode = makeNode(NextValueExpr); COPY_SCALAR_FIELD(seqid); COPY_SCALAR_FIELD(typeId); return newnode; } /* * _copyInferenceElem */ static InferenceElem * _copyInferenceElem(const InferenceElem *from) { InferenceElem *newnode = makeNode(InferenceElem); COPY_NODE_FIELD(expr); COPY_SCALAR_FIELD(infercollid); COPY_SCALAR_FIELD(inferopclass); return newnode; } /* * _copyTargetEntry */ static TargetEntry * _copyTargetEntry(const TargetEntry *from) { TargetEntry *newnode = makeNode(TargetEntry); COPY_NODE_FIELD(expr); COPY_SCALAR_FIELD(resno); COPY_STRING_FIELD(resname); COPY_SCALAR_FIELD(ressortgroupref); COPY_SCALAR_FIELD(resorigtbl); COPY_SCALAR_FIELD(resorigcol); COPY_SCALAR_FIELD(resjunk); return newnode; } /* * _copyRangeTblRef */ static RangeTblRef * _copyRangeTblRef(const RangeTblRef *from) { RangeTblRef *newnode = makeNode(RangeTblRef); COPY_SCALAR_FIELD(rtindex); return newnode; } /* * _copyJoinExpr */ static JoinExpr * _copyJoinExpr(const JoinExpr *from) { JoinExpr *newnode = makeNode(JoinExpr); COPY_SCALAR_FIELD(jointype); COPY_SCALAR_FIELD(isNatural); COPY_NODE_FIELD(larg); COPY_NODE_FIELD(rarg); COPY_NODE_FIELD(usingClause); COPY_NODE_FIELD(quals); COPY_NODE_FIELD(alias); COPY_SCALAR_FIELD(rtindex); return newnode; } /* * _copyFromExpr */ static FromExpr * _copyFromExpr(const FromExpr *from) { FromExpr *newnode = makeNode(FromExpr); COPY_NODE_FIELD(fromlist); COPY_NODE_FIELD(quals); return newnode; } /* * _copyOnConflictExpr */ static OnConflictExpr * _copyOnConflictExpr(const OnConflictExpr *from) { OnConflictExpr *newnode = makeNode(OnConflictExpr); COPY_SCALAR_FIELD(action); COPY_NODE_FIELD(arbiterElems); COPY_NODE_FIELD(arbiterWhere); COPY_SCALAR_FIELD(constraint); COPY_NODE_FIELD(onConflictSet); COPY_NODE_FIELD(onConflictWhere); COPY_SCALAR_FIELD(exclRelIndex); COPY_NODE_FIELD(exclRelTlist); return newnode; } /* **************************************************************** * pathnodes.h copy functions * * We don't support copying RelOptInfo, IndexOptInfo, or Path nodes. * There are some subsidiary structs that are useful to copy, though. * **************************************************************** */ #ifdef NOT_USED_IN_PGPOOL /* * _copyPathKey */ static PathKey * _copyPathKey(const PathKey *from) { PathKey *newnode = makeNode(PathKey); /* EquivalenceClasses are never moved, so just shallow-copy the pointer */ COPY_SCALAR_FIELD(pk_eclass); COPY_SCALAR_FIELD(pk_opfamily); COPY_SCALAR_FIELD(pk_strategy); COPY_SCALAR_FIELD(pk_nulls_first); return newnode; } /* * _copyRestrictInfo */ static RestrictInfo * _copyRestrictInfo(const RestrictInfo *from) { RestrictInfo *newnode = makeNode(RestrictInfo); COPY_NODE_FIELD(clause); COPY_SCALAR_FIELD(is_pushed_down); COPY_SCALAR_FIELD(outerjoin_delayed); COPY_SCALAR_FIELD(can_join); COPY_SCALAR_FIELD(pseudoconstant); COPY_SCALAR_FIELD(leakproof); COPY_SCALAR_FIELD(security_level); COPY_BITMAPSET_FIELD(clause_relids); COPY_BITMAPSET_FIELD(required_relids); COPY_BITMAPSET_FIELD(outer_relids); COPY_BITMAPSET_FIELD(nullable_relids); COPY_BITMAPSET_FIELD(left_relids); COPY_BITMAPSET_FIELD(right_relids); COPY_NODE_FIELD(orclause); /* EquivalenceClasses are never copied, so shallow-copy the pointers */ COPY_SCALAR_FIELD(parent_ec); COPY_SCALAR_FIELD(eval_cost); COPY_SCALAR_FIELD(norm_selec); COPY_SCALAR_FIELD(outer_selec); COPY_NODE_FIELD(mergeopfamilies); /* EquivalenceClasses are never copied, so shallow-copy the pointers */ COPY_SCALAR_FIELD(left_ec); COPY_SCALAR_FIELD(right_ec); COPY_SCALAR_FIELD(left_em); COPY_SCALAR_FIELD(right_em); /* MergeScanSelCache isn't a Node, so hard to copy; just reset cache */ newnode->scansel_cache = NIL; COPY_SCALAR_FIELD(outer_is_left); COPY_SCALAR_FIELD(hashjoinoperator); COPY_SCALAR_FIELD(left_bucketsize); COPY_SCALAR_FIELD(right_bucketsize); COPY_SCALAR_FIELD(left_mcvfreq); COPY_SCALAR_FIELD(right_mcvfreq); return newnode; } /* * _copyPlaceHolderVar */ static PlaceHolderVar * _copyPlaceHolderVar(const PlaceHolderVar *from) { PlaceHolderVar *newnode = makeNode(PlaceHolderVar); COPY_NODE_FIELD(phexpr); COPY_BITMAPSET_FIELD(phrels); COPY_SCALAR_FIELD(phid); COPY_SCALAR_FIELD(phlevelsup); return newnode; } /* * _copySpecialJoinInfo */ static SpecialJoinInfo * _copySpecialJoinInfo(const SpecialJoinInfo *from) { SpecialJoinInfo *newnode = makeNode(SpecialJoinInfo); COPY_BITMAPSET_FIELD(min_lefthand); COPY_BITMAPSET_FIELD(min_righthand); COPY_BITMAPSET_FIELD(syn_lefthand); COPY_BITMAPSET_FIELD(syn_righthand); COPY_SCALAR_FIELD(jointype); COPY_SCALAR_FIELD(lhs_strict); COPY_SCALAR_FIELD(delay_upper_joins); COPY_SCALAR_FIELD(semi_can_btree); COPY_SCALAR_FIELD(semi_can_hash); COPY_NODE_FIELD(semi_operators); COPY_NODE_FIELD(semi_rhs_exprs); return newnode; } /* * _copyAppendRelInfo */ static AppendRelInfo * _copyAppendRelInfo(const AppendRelInfo *from) { AppendRelInfo *newnode = makeNode(AppendRelInfo); COPY_SCALAR_FIELD(parent_relid); COPY_SCALAR_FIELD(child_relid); COPY_SCALAR_FIELD(parent_reltype); COPY_SCALAR_FIELD(child_reltype); COPY_NODE_FIELD(translated_vars); COPY_SCALAR_FIELD(parent_reloid); return newnode; } /* * _copyPlaceHolderInfo */ static PlaceHolderInfo * _copyPlaceHolderInfo(const PlaceHolderInfo *from) { PlaceHolderInfo *newnode = makeNode(PlaceHolderInfo); COPY_SCALAR_FIELD(phid); COPY_NODE_FIELD(ph_var); COPY_BITMAPSET_FIELD(ph_eval_at); COPY_BITMAPSET_FIELD(ph_lateral); COPY_BITMAPSET_FIELD(ph_needed); COPY_SCALAR_FIELD(ph_width); return newnode; } #endif /* **************************************************************** * parsenodes.h copy functions * **************************************************************** */ static RangeTblEntry * _copyRangeTblEntry(const RangeTblEntry *from) { RangeTblEntry *newnode = makeNode(RangeTblEntry); COPY_SCALAR_FIELD(rtekind); COPY_SCALAR_FIELD(relid); COPY_SCALAR_FIELD(relkind); COPY_SCALAR_FIELD(rellockmode); COPY_NODE_FIELD(tablesample); COPY_NODE_FIELD(subquery); COPY_SCALAR_FIELD(security_barrier); COPY_SCALAR_FIELD(jointype); COPY_NODE_FIELD(joinaliasvars); COPY_NODE_FIELD(functions); COPY_SCALAR_FIELD(funcordinality); COPY_NODE_FIELD(tablefunc); COPY_NODE_FIELD(values_lists); COPY_STRING_FIELD(ctename); COPY_SCALAR_FIELD(ctelevelsup); COPY_SCALAR_FIELD(self_reference); COPY_NODE_FIELD(coltypes); COPY_NODE_FIELD(coltypmods); COPY_NODE_FIELD(colcollations); COPY_STRING_FIELD(enrname); COPY_SCALAR_FIELD(enrtuples); COPY_NODE_FIELD(alias); COPY_NODE_FIELD(eref); COPY_SCALAR_FIELD(lateral); COPY_SCALAR_FIELD(inh); COPY_SCALAR_FIELD(inFromCl); COPY_SCALAR_FIELD(requiredPerms); COPY_SCALAR_FIELD(checkAsUser); COPY_BITMAPSET_FIELD(selectedCols); COPY_BITMAPSET_FIELD(insertedCols); COPY_BITMAPSET_FIELD(updatedCols); COPY_BITMAPSET_FIELD(extraUpdatedCols); COPY_NODE_FIELD(securityQuals); return newnode; } static RangeTblFunction * _copyRangeTblFunction(const RangeTblFunction *from) { RangeTblFunction *newnode = makeNode(RangeTblFunction); COPY_NODE_FIELD(funcexpr); COPY_SCALAR_FIELD(funccolcount); COPY_NODE_FIELD(funccolnames); COPY_NODE_FIELD(funccoltypes); COPY_NODE_FIELD(funccoltypmods); COPY_NODE_FIELD(funccolcollations); COPY_BITMAPSET_FIELD(funcparams); return newnode; } static TableSampleClause * _copyTableSampleClause(const TableSampleClause *from) { TableSampleClause *newnode = makeNode(TableSampleClause); COPY_SCALAR_FIELD(tsmhandler); COPY_NODE_FIELD(args); COPY_NODE_FIELD(repeatable); return newnode; } static WithCheckOption * _copyWithCheckOption(const WithCheckOption *from) { WithCheckOption *newnode = makeNode(WithCheckOption); COPY_SCALAR_FIELD(kind); COPY_STRING_FIELD(relname); COPY_STRING_FIELD(polname); COPY_NODE_FIELD(qual); COPY_SCALAR_FIELD(cascaded); return newnode; } static SortGroupClause * _copySortGroupClause(const SortGroupClause *from) { SortGroupClause *newnode = makeNode(SortGroupClause); COPY_SCALAR_FIELD(tleSortGroupRef); COPY_SCALAR_FIELD(eqop); COPY_SCALAR_FIELD(sortop); COPY_SCALAR_FIELD(nulls_first); COPY_SCALAR_FIELD(hashable); return newnode; } static GroupingSet * _copyGroupingSet(const GroupingSet *from) { GroupingSet *newnode = makeNode(GroupingSet); COPY_SCALAR_FIELD(kind); COPY_NODE_FIELD(content); COPY_LOCATION_FIELD(location); return newnode; } static WindowClause * _copyWindowClause(const WindowClause *from) { WindowClause *newnode = makeNode(WindowClause); COPY_STRING_FIELD(name); COPY_STRING_FIELD(refname); COPY_NODE_FIELD(partitionClause); COPY_NODE_FIELD(orderClause); COPY_SCALAR_FIELD(frameOptions); COPY_NODE_FIELD(startOffset); COPY_NODE_FIELD(endOffset); COPY_SCALAR_FIELD(startInRangeFunc); COPY_SCALAR_FIELD(endInRangeFunc); COPY_SCALAR_FIELD(inRangeColl); COPY_SCALAR_FIELD(inRangeAsc); COPY_SCALAR_FIELD(inRangeNullsFirst); COPY_SCALAR_FIELD(winref); COPY_SCALAR_FIELD(copiedOrder); return newnode; } static RowMarkClause * _copyRowMarkClause(const RowMarkClause *from) { RowMarkClause *newnode = makeNode(RowMarkClause); COPY_SCALAR_FIELD(rti); COPY_SCALAR_FIELD(strength); COPY_SCALAR_FIELD(waitPolicy); COPY_SCALAR_FIELD(pushedDown); return newnode; } static WithClause * _copyWithClause(const WithClause *from) { WithClause *newnode = makeNode(WithClause); COPY_NODE_FIELD(ctes); COPY_SCALAR_FIELD(recursive); COPY_LOCATION_FIELD(location); return newnode; } static InferClause * _copyInferClause(const InferClause *from) { InferClause *newnode = makeNode(InferClause); COPY_NODE_FIELD(indexElems); COPY_NODE_FIELD(whereClause); COPY_STRING_FIELD(conname); COPY_LOCATION_FIELD(location); return newnode; } static OnConflictClause * _copyOnConflictClause(const OnConflictClause *from) { OnConflictClause *newnode = makeNode(OnConflictClause); COPY_SCALAR_FIELD(action); COPY_NODE_FIELD(infer); COPY_NODE_FIELD(targetList); COPY_NODE_FIELD(whereClause); COPY_LOCATION_FIELD(location); return newnode; } static CommonTableExpr * _copyCommonTableExpr(const CommonTableExpr *from) { CommonTableExpr *newnode = makeNode(CommonTableExpr); COPY_STRING_FIELD(ctename); COPY_NODE_FIELD(aliascolnames); COPY_SCALAR_FIELD(ctematerialized); COPY_NODE_FIELD(ctequery); COPY_LOCATION_FIELD(location); COPY_SCALAR_FIELD(cterecursive); COPY_SCALAR_FIELD(cterefcount); COPY_NODE_FIELD(ctecolnames); COPY_NODE_FIELD(ctecoltypes); COPY_NODE_FIELD(ctecoltypmods); COPY_NODE_FIELD(ctecolcollations); return newnode; } static A_Expr * _copyAExpr(const A_Expr *from) { A_Expr *newnode = makeNode(A_Expr); COPY_SCALAR_FIELD(kind); COPY_NODE_FIELD(name); COPY_NODE_FIELD(lexpr); COPY_NODE_FIELD(rexpr); COPY_LOCATION_FIELD(location); return newnode; } static ColumnRef * _copyColumnRef(const ColumnRef *from) { ColumnRef *newnode = makeNode(ColumnRef); COPY_NODE_FIELD(fields); COPY_LOCATION_FIELD(location); return newnode; } static ParamRef * _copyParamRef(const ParamRef *from) { ParamRef *newnode = makeNode(ParamRef); COPY_SCALAR_FIELD(number); COPY_LOCATION_FIELD(location); return newnode; } static A_Const * _copyAConst(const A_Const *from) { A_Const *newnode = makeNode(A_Const); /* This part must duplicate _copyValue */ COPY_SCALAR_FIELD(val.type); switch (from->val.type) { case T_Integer: COPY_SCALAR_FIELD(val.val.ival); break; case T_Float: case T_String: case T_BitString: COPY_STRING_FIELD(val.val.str); break; case T_Null: /* nothing to do */ break; default: elog(ERROR, "unrecognized node type: %d", (int) from->val.type); break; } COPY_LOCATION_FIELD(location); return newnode; } static FuncCall * _copyFuncCall(const FuncCall *from) { FuncCall *newnode = makeNode(FuncCall); COPY_NODE_FIELD(funcname); COPY_NODE_FIELD(args); COPY_NODE_FIELD(agg_order); COPY_NODE_FIELD(agg_filter); COPY_SCALAR_FIELD(agg_within_group); COPY_SCALAR_FIELD(agg_star); COPY_SCALAR_FIELD(agg_distinct); COPY_SCALAR_FIELD(func_variadic); COPY_NODE_FIELD(over); COPY_LOCATION_FIELD(location); return newnode; } static A_Star * _copyAStar(const A_Star *from) { A_Star *newnode = makeNode(A_Star); return newnode; } static A_Indices * _copyAIndices(const A_Indices *from) { A_Indices *newnode = makeNode(A_Indices); COPY_SCALAR_FIELD(is_slice); COPY_NODE_FIELD(lidx); COPY_NODE_FIELD(uidx); return newnode; } static A_Indirection * _copyA_Indirection(const A_Indirection *from) { A_Indirection *newnode = makeNode(A_Indirection); COPY_NODE_FIELD(arg); COPY_NODE_FIELD(indirection); return newnode; } static A_ArrayExpr * _copyA_ArrayExpr(const A_ArrayExpr *from) { A_ArrayExpr *newnode = makeNode(A_ArrayExpr); COPY_NODE_FIELD(elements); COPY_LOCATION_FIELD(location); return newnode; } static ResTarget * _copyResTarget(const ResTarget *from) { ResTarget *newnode = makeNode(ResTarget); COPY_STRING_FIELD(name); COPY_NODE_FIELD(indirection); COPY_NODE_FIELD(val); COPY_LOCATION_FIELD(location); return newnode; } static MultiAssignRef * _copyMultiAssignRef(const MultiAssignRef *from) { MultiAssignRef *newnode = makeNode(MultiAssignRef); COPY_NODE_FIELD(source); COPY_SCALAR_FIELD(colno); COPY_SCALAR_FIELD(ncolumns); return newnode; } static TypeName * _copyTypeName(const TypeName *from) { TypeName *newnode = makeNode(TypeName); COPY_NODE_FIELD(names); COPY_SCALAR_FIELD(typeOid); COPY_SCALAR_FIELD(setof); COPY_SCALAR_FIELD(pct_type); COPY_NODE_FIELD(typmods); COPY_SCALAR_FIELD(typemod); COPY_NODE_FIELD(arrayBounds); COPY_LOCATION_FIELD(location); return newnode; } static SortBy * _copySortBy(const SortBy *from) { SortBy *newnode = makeNode(SortBy); COPY_NODE_FIELD(node); COPY_SCALAR_FIELD(sortby_dir); COPY_SCALAR_FIELD(sortby_nulls); COPY_NODE_FIELD(useOp); COPY_LOCATION_FIELD(location); return newnode; } static WindowDef * _copyWindowDef(const WindowDef *from) { WindowDef *newnode = makeNode(WindowDef); COPY_STRING_FIELD(name); COPY_STRING_FIELD(refname); COPY_NODE_FIELD(partitionClause); COPY_NODE_FIELD(orderClause); COPY_SCALAR_FIELD(frameOptions); COPY_NODE_FIELD(startOffset); COPY_NODE_FIELD(endOffset); COPY_LOCATION_FIELD(location); return newnode; } static RangeSubselect * _copyRangeSubselect(const RangeSubselect *from) { RangeSubselect *newnode = makeNode(RangeSubselect); COPY_SCALAR_FIELD(lateral); COPY_NODE_FIELD(subquery); COPY_NODE_FIELD(alias); return newnode; } static RangeFunction * _copyRangeFunction(const RangeFunction *from) { RangeFunction *newnode = makeNode(RangeFunction); COPY_SCALAR_FIELD(lateral); COPY_SCALAR_FIELD(ordinality); COPY_SCALAR_FIELD(is_rowsfrom); COPY_NODE_FIELD(functions); COPY_NODE_FIELD(alias); COPY_NODE_FIELD(coldeflist); return newnode; } static RangeTableSample * _copyRangeTableSample(const RangeTableSample *from) { RangeTableSample *newnode = makeNode(RangeTableSample); COPY_NODE_FIELD(relation); COPY_NODE_FIELD(method); COPY_NODE_FIELD(args); COPY_NODE_FIELD(repeatable); COPY_LOCATION_FIELD(location); return newnode; } static RangeTableFunc * _copyRangeTableFunc(const RangeTableFunc *from) { RangeTableFunc *newnode = makeNode(RangeTableFunc); COPY_SCALAR_FIELD(lateral); COPY_NODE_FIELD(docexpr); COPY_NODE_FIELD(rowexpr); COPY_NODE_FIELD(namespaces); COPY_NODE_FIELD(columns); COPY_NODE_FIELD(alias); COPY_LOCATION_FIELD(location); return newnode; } static RangeTableFuncCol * _copyRangeTableFuncCol(const RangeTableFuncCol *from) { RangeTableFuncCol *newnode = makeNode(RangeTableFuncCol); COPY_STRING_FIELD(colname); COPY_NODE_FIELD(typeName); COPY_SCALAR_FIELD(for_ordinality); COPY_SCALAR_FIELD(is_not_null); COPY_NODE_FIELD(colexpr); COPY_NODE_FIELD(coldefexpr); COPY_LOCATION_FIELD(location); return newnode; } static TypeCast * _copyTypeCast(const TypeCast *from) { TypeCast *newnode = makeNode(TypeCast); COPY_NODE_FIELD(arg); COPY_NODE_FIELD(typeName); COPY_LOCATION_FIELD(location); return newnode; } static CollateClause * _copyCollateClause(const CollateClause *from) { CollateClause *newnode = makeNode(CollateClause); COPY_NODE_FIELD(arg); COPY_NODE_FIELD(collname); COPY_LOCATION_FIELD(location); return newnode; } static IndexElem * _copyIndexElem(const IndexElem *from) { IndexElem *newnode = makeNode(IndexElem); COPY_STRING_FIELD(name); COPY_NODE_FIELD(expr); COPY_STRING_FIELD(indexcolname); COPY_NODE_FIELD(collation); COPY_NODE_FIELD(opclass); COPY_SCALAR_FIELD(ordering); COPY_SCALAR_FIELD(nulls_ordering); return newnode; } static ColumnDef * _copyColumnDef(const ColumnDef *from) { ColumnDef *newnode = makeNode(ColumnDef); COPY_STRING_FIELD(colname); COPY_NODE_FIELD(typeName); COPY_SCALAR_FIELD(inhcount); COPY_SCALAR_FIELD(is_local); COPY_SCALAR_FIELD(is_not_null); COPY_SCALAR_FIELD(is_from_type); COPY_SCALAR_FIELD(storage); COPY_NODE_FIELD(raw_default); COPY_NODE_FIELD(cooked_default); COPY_SCALAR_FIELD(identity); COPY_NODE_FIELD(identitySequence); COPY_SCALAR_FIELD(generated); COPY_NODE_FIELD(collClause); COPY_SCALAR_FIELD(collOid); COPY_NODE_FIELD(constraints); COPY_NODE_FIELD(fdwoptions); COPY_LOCATION_FIELD(location); return newnode; } static Constraint * _copyConstraint(const Constraint *from) { Constraint *newnode = makeNode(Constraint); COPY_SCALAR_FIELD(contype); COPY_STRING_FIELD(conname); COPY_SCALAR_FIELD(deferrable); COPY_SCALAR_FIELD(initdeferred); COPY_LOCATION_FIELD(location); COPY_SCALAR_FIELD(is_no_inherit); COPY_NODE_FIELD(raw_expr); COPY_STRING_FIELD(cooked_expr); COPY_SCALAR_FIELD(generated_when); COPY_NODE_FIELD(keys); COPY_NODE_FIELD(including); COPY_NODE_FIELD(exclusions); COPY_NODE_FIELD(options); COPY_STRING_FIELD(indexname); COPY_STRING_FIELD(indexspace); COPY_SCALAR_FIELD(reset_default_tblspc); COPY_STRING_FIELD(access_method); COPY_NODE_FIELD(where_clause); COPY_NODE_FIELD(pktable); COPY_NODE_FIELD(fk_attrs); COPY_NODE_FIELD(pk_attrs); COPY_SCALAR_FIELD(fk_matchtype); COPY_SCALAR_FIELD(fk_upd_action); COPY_SCALAR_FIELD(fk_del_action); COPY_NODE_FIELD(old_conpfeqop); COPY_SCALAR_FIELD(old_pktable_oid); COPY_SCALAR_FIELD(skip_validation); COPY_SCALAR_FIELD(initially_valid); return newnode; } static DefElem * _copyDefElem(const DefElem *from) { DefElem *newnode = makeNode(DefElem); COPY_STRING_FIELD(defnamespace); COPY_STRING_FIELD(defname); COPY_NODE_FIELD(arg); COPY_SCALAR_FIELD(defaction); COPY_LOCATION_FIELD(location); return newnode; } static LockingClause * _copyLockingClause(const LockingClause *from) { LockingClause *newnode = makeNode(LockingClause); COPY_NODE_FIELD(lockedRels); COPY_SCALAR_FIELD(strength); COPY_SCALAR_FIELD(waitPolicy); return newnode; } static XmlSerialize * _copyXmlSerialize(const XmlSerialize *from) { XmlSerialize *newnode = makeNode(XmlSerialize); COPY_SCALAR_FIELD(xmloption); COPY_NODE_FIELD(expr); COPY_NODE_FIELD(typeName); COPY_LOCATION_FIELD(location); return newnode; } static RoleSpec * _copyRoleSpec(const RoleSpec *from) { RoleSpec *newnode = makeNode(RoleSpec); COPY_SCALAR_FIELD(roletype); COPY_STRING_FIELD(rolename); COPY_LOCATION_FIELD(location); return newnode; } static TriggerTransition * _copyTriggerTransition(const TriggerTransition *from) { TriggerTransition *newnode = makeNode(TriggerTransition); COPY_STRING_FIELD(name); COPY_SCALAR_FIELD(isNew); COPY_SCALAR_FIELD(isTable); return newnode; } static Query * _copyQuery(const Query *from) { Query *newnode = makeNode(Query); COPY_SCALAR_FIELD(commandType); COPY_SCALAR_FIELD(querySource); COPY_SCALAR_FIELD(queryId); COPY_SCALAR_FIELD(canSetTag); COPY_NODE_FIELD(utilityStmt); COPY_SCALAR_FIELD(resultRelation); COPY_SCALAR_FIELD(hasAggs); COPY_SCALAR_FIELD(hasWindowFuncs); COPY_SCALAR_FIELD(hasTargetSRFs); COPY_SCALAR_FIELD(hasSubLinks); COPY_SCALAR_FIELD(hasDistinctOn); COPY_SCALAR_FIELD(hasRecursive); COPY_SCALAR_FIELD(hasModifyingCTE); COPY_SCALAR_FIELD(hasForUpdate); COPY_SCALAR_FIELD(hasRowSecurity); COPY_NODE_FIELD(cteList); COPY_NODE_FIELD(rtable); COPY_NODE_FIELD(jointree); COPY_NODE_FIELD(targetList); COPY_SCALAR_FIELD(override); COPY_NODE_FIELD(onConflict); COPY_NODE_FIELD(returningList); COPY_NODE_FIELD(groupClause); COPY_NODE_FIELD(groupingSets); COPY_NODE_FIELD(havingQual); COPY_NODE_FIELD(windowClause); COPY_NODE_FIELD(distinctClause); COPY_NODE_FIELD(sortClause); COPY_NODE_FIELD(limitOffset); COPY_NODE_FIELD(limitCount); COPY_NODE_FIELD(rowMarks); COPY_NODE_FIELD(setOperations); COPY_NODE_FIELD(constraintDeps); COPY_NODE_FIELD(withCheckOptions); COPY_LOCATION_FIELD(stmt_location); COPY_LOCATION_FIELD(stmt_len); return newnode; } static RawStmt * _copyRawStmt(const RawStmt *from) { RawStmt *newnode = makeNode(RawStmt); COPY_NODE_FIELD(stmt); COPY_LOCATION_FIELD(stmt_location); COPY_LOCATION_FIELD(stmt_len); return newnode; } static InsertStmt * _copyInsertStmt(const InsertStmt *from) { InsertStmt *newnode = makeNode(InsertStmt); COPY_NODE_FIELD(relation); COPY_NODE_FIELD(cols); COPY_NODE_FIELD(selectStmt); COPY_NODE_FIELD(onConflictClause); COPY_NODE_FIELD(returningList); COPY_NODE_FIELD(withClause); COPY_SCALAR_FIELD(override); return newnode; } static DeleteStmt * _copyDeleteStmt(const DeleteStmt *from) { DeleteStmt *newnode = makeNode(DeleteStmt); COPY_NODE_FIELD(relation); COPY_NODE_FIELD(usingClause); COPY_NODE_FIELD(whereClause); COPY_NODE_FIELD(returningList); COPY_NODE_FIELD(withClause); return newnode; } static UpdateStmt * _copyUpdateStmt(const UpdateStmt *from) { UpdateStmt *newnode = makeNode(UpdateStmt); COPY_NODE_FIELD(relation); COPY_NODE_FIELD(targetList); COPY_NODE_FIELD(whereClause); COPY_NODE_FIELD(fromClause); COPY_NODE_FIELD(returningList); COPY_NODE_FIELD(withClause); return newnode; } static SelectStmt * _copySelectStmt(const SelectStmt *from) { SelectStmt *newnode = makeNode(SelectStmt); COPY_NODE_FIELD(distinctClause); COPY_NODE_FIELD(intoClause); COPY_NODE_FIELD(targetList); COPY_NODE_FIELD(fromClause); COPY_NODE_FIELD(whereClause); COPY_NODE_FIELD(groupClause); COPY_NODE_FIELD(havingClause); COPY_NODE_FIELD(windowClause); COPY_NODE_FIELD(valuesLists); COPY_NODE_FIELD(sortClause); COPY_NODE_FIELD(limitOffset); COPY_NODE_FIELD(limitCount); COPY_NODE_FIELD(lockingClause); COPY_NODE_FIELD(withClause); COPY_SCALAR_FIELD(op); COPY_SCALAR_FIELD(all); COPY_NODE_FIELD(larg); COPY_NODE_FIELD(rarg); return newnode; } static SetOperationStmt * _copySetOperationStmt(const SetOperationStmt *from) { SetOperationStmt *newnode = makeNode(SetOperationStmt); COPY_SCALAR_FIELD(op); COPY_SCALAR_FIELD(all); COPY_NODE_FIELD(larg); COPY_NODE_FIELD(rarg); COPY_NODE_FIELD(colTypes); COPY_NODE_FIELD(colTypmods); COPY_NODE_FIELD(colCollations); COPY_NODE_FIELD(groupClauses); return newnode; } static AlterTableStmt * _copyAlterTableStmt(const AlterTableStmt *from) { AlterTableStmt *newnode = makeNode(AlterTableStmt); COPY_NODE_FIELD(relation); COPY_NODE_FIELD(cmds); COPY_SCALAR_FIELD(relkind); COPY_SCALAR_FIELD(missing_ok); return newnode; } static AlterTableCmd * _copyAlterTableCmd(const AlterTableCmd *from) { AlterTableCmd *newnode = makeNode(AlterTableCmd); COPY_SCALAR_FIELD(subtype); COPY_STRING_FIELD(name); COPY_SCALAR_FIELD(num); COPY_NODE_FIELD(newowner); COPY_NODE_FIELD(def); COPY_SCALAR_FIELD(behavior); COPY_SCALAR_FIELD(missing_ok); return newnode; } static AlterCollationStmt * _copyAlterCollationStmt(const AlterCollationStmt *from) { AlterCollationStmt *newnode = makeNode(AlterCollationStmt); COPY_NODE_FIELD(collname); return newnode; } static AlterDomainStmt * _copyAlterDomainStmt(const AlterDomainStmt *from) { AlterDomainStmt *newnode = makeNode(AlterDomainStmt); COPY_SCALAR_FIELD(subtype); COPY_NODE_FIELD(typeName); COPY_STRING_FIELD(name); COPY_NODE_FIELD(def); COPY_SCALAR_FIELD(behavior); COPY_SCALAR_FIELD(missing_ok); return newnode; } static GrantStmt * _copyGrantStmt(const GrantStmt *from) { GrantStmt *newnode = makeNode(GrantStmt); COPY_SCALAR_FIELD(is_grant); COPY_SCALAR_FIELD(targtype); COPY_SCALAR_FIELD(objtype); COPY_NODE_FIELD(objects); COPY_NODE_FIELD(privileges); COPY_NODE_FIELD(grantees); COPY_SCALAR_FIELD(grant_option); COPY_SCALAR_FIELD(behavior); return newnode; } static ObjectWithArgs * _copyObjectWithArgs(const ObjectWithArgs *from) { ObjectWithArgs *newnode = makeNode(ObjectWithArgs); COPY_NODE_FIELD(objname); COPY_NODE_FIELD(objargs); COPY_SCALAR_FIELD(args_unspecified); return newnode; } static AccessPriv * _copyAccessPriv(const AccessPriv *from) { AccessPriv *newnode = makeNode(AccessPriv); COPY_STRING_FIELD(priv_name); COPY_NODE_FIELD(cols); return newnode; } static GrantRoleStmt * _copyGrantRoleStmt(const GrantRoleStmt *from) { GrantRoleStmt *newnode = makeNode(GrantRoleStmt); COPY_NODE_FIELD(granted_roles); COPY_NODE_FIELD(grantee_roles); COPY_SCALAR_FIELD(is_grant); COPY_SCALAR_FIELD(admin_opt); COPY_NODE_FIELD(grantor); COPY_SCALAR_FIELD(behavior); return newnode; } static AlterDefaultPrivilegesStmt * _copyAlterDefaultPrivilegesStmt(const AlterDefaultPrivilegesStmt *from) { AlterDefaultPrivilegesStmt *newnode = makeNode(AlterDefaultPrivilegesStmt); COPY_NODE_FIELD(options); COPY_NODE_FIELD(action); return newnode; } static DeclareCursorStmt * _copyDeclareCursorStmt(const DeclareCursorStmt *from) { DeclareCursorStmt *newnode = makeNode(DeclareCursorStmt); COPY_STRING_FIELD(portalname); COPY_SCALAR_FIELD(options); COPY_NODE_FIELD(query); return newnode; } static ClosePortalStmt * _copyClosePortalStmt(const ClosePortalStmt *from) { ClosePortalStmt *newnode = makeNode(ClosePortalStmt); COPY_STRING_FIELD(portalname); return newnode; } static CallStmt * _copyCallStmt(const CallStmt *from) { CallStmt *newnode = makeNode(CallStmt); COPY_NODE_FIELD(funccall); COPY_NODE_FIELD(funcexpr); return newnode; } static ClusterStmt * _copyClusterStmt(const ClusterStmt *from) { ClusterStmt *newnode = makeNode(ClusterStmt); COPY_NODE_FIELD(relation); COPY_STRING_FIELD(indexname); COPY_SCALAR_FIELD(options); return newnode; } static CopyStmt * _copyCopyStmt(const CopyStmt *from) { CopyStmt *newnode = makeNode(CopyStmt); COPY_NODE_FIELD(relation); COPY_NODE_FIELD(query); COPY_NODE_FIELD(attlist); COPY_SCALAR_FIELD(is_from); COPY_SCALAR_FIELD(is_program); COPY_STRING_FIELD(filename); COPY_NODE_FIELD(options); COPY_NODE_FIELD(whereClause); return newnode; } /* * CopyCreateStmtFields * * This function copies the fields of the CreateStmt node. It is used by * copy functions for classes which inherit from CreateStmt. */ static void CopyCreateStmtFields(const CreateStmt *from, CreateStmt *newnode) { COPY_NODE_FIELD(relation); COPY_NODE_FIELD(tableElts); COPY_NODE_FIELD(inhRelations); COPY_NODE_FIELD(partspec); COPY_NODE_FIELD(partbound); COPY_NODE_FIELD(ofTypename); COPY_NODE_FIELD(constraints); COPY_NODE_FIELD(options); COPY_SCALAR_FIELD(oncommit); COPY_STRING_FIELD(tablespacename); COPY_STRING_FIELD(accessMethod); COPY_SCALAR_FIELD(if_not_exists); } static CreateStmt * _copyCreateStmt(const CreateStmt *from) { CreateStmt *newnode = makeNode(CreateStmt); CopyCreateStmtFields(from, newnode); return newnode; } static TableLikeClause * _copyTableLikeClause(const TableLikeClause *from) { TableLikeClause *newnode = makeNode(TableLikeClause); COPY_NODE_FIELD(relation); COPY_SCALAR_FIELD(options); return newnode; } static DefineStmt * _copyDefineStmt(const DefineStmt *from) { DefineStmt *newnode = makeNode(DefineStmt); COPY_SCALAR_FIELD(kind); COPY_SCALAR_FIELD(oldstyle); COPY_NODE_FIELD(defnames); COPY_NODE_FIELD(args); COPY_NODE_FIELD(definition); COPY_SCALAR_FIELD(if_not_exists); COPY_SCALAR_FIELD(replace); return newnode; } static DropStmt * _copyDropStmt(const DropStmt *from) { DropStmt *newnode = makeNode(DropStmt); COPY_NODE_FIELD(objects); COPY_SCALAR_FIELD(removeType); COPY_SCALAR_FIELD(behavior); COPY_SCALAR_FIELD(missing_ok); COPY_SCALAR_FIELD(concurrent); return newnode; } static TruncateStmt * _copyTruncateStmt(const TruncateStmt *from) { TruncateStmt *newnode = makeNode(TruncateStmt); COPY_NODE_FIELD(relations); COPY_SCALAR_FIELD(restart_seqs); COPY_SCALAR_FIELD(behavior); return newnode; } static CommentStmt * _copyCommentStmt(const CommentStmt *from) { CommentStmt *newnode = makeNode(CommentStmt); COPY_SCALAR_FIELD(objtype); COPY_NODE_FIELD(object); COPY_STRING_FIELD(comment); return newnode; } static SecLabelStmt * _copySecLabelStmt(const SecLabelStmt *from) { SecLabelStmt *newnode = makeNode(SecLabelStmt); COPY_SCALAR_FIELD(objtype); COPY_NODE_FIELD(object); COPY_STRING_FIELD(provider); COPY_STRING_FIELD(label); return newnode; } static FetchStmt * _copyFetchStmt(const FetchStmt *from) { FetchStmt *newnode = makeNode(FetchStmt); COPY_SCALAR_FIELD(direction); COPY_SCALAR_FIELD(howMany); COPY_STRING_FIELD(portalname); COPY_SCALAR_FIELD(ismove); return newnode; } static IndexStmt * _copyIndexStmt(const IndexStmt *from) { IndexStmt *newnode = makeNode(IndexStmt); COPY_STRING_FIELD(idxname); COPY_NODE_FIELD(relation); COPY_STRING_FIELD(accessMethod); COPY_STRING_FIELD(tableSpace); COPY_NODE_FIELD(indexParams); COPY_NODE_FIELD(indexIncludingParams); COPY_NODE_FIELD(options); COPY_NODE_FIELD(whereClause); COPY_NODE_FIELD(excludeOpNames); COPY_STRING_FIELD(idxcomment); COPY_SCALAR_FIELD(indexOid); COPY_SCALAR_FIELD(oldNode); COPY_SCALAR_FIELD(unique); COPY_SCALAR_FIELD(primary); COPY_SCALAR_FIELD(isconstraint); COPY_SCALAR_FIELD(deferrable); COPY_SCALAR_FIELD(initdeferred); COPY_SCALAR_FIELD(transformed); COPY_SCALAR_FIELD(concurrent); COPY_SCALAR_FIELD(if_not_exists); COPY_SCALAR_FIELD(reset_default_tblspc); return newnode; } static CreateStatsStmt * _copyCreateStatsStmt(const CreateStatsStmt *from) { CreateStatsStmt *newnode = makeNode(CreateStatsStmt); COPY_NODE_FIELD(defnames); COPY_NODE_FIELD(stat_types); COPY_NODE_FIELD(exprs); COPY_NODE_FIELD(relations); COPY_STRING_FIELD(stxcomment); COPY_SCALAR_FIELD(if_not_exists); return newnode; } static CreateFunctionStmt * _copyCreateFunctionStmt(const CreateFunctionStmt *from) { CreateFunctionStmt *newnode = makeNode(CreateFunctionStmt); COPY_SCALAR_FIELD(is_procedure); COPY_SCALAR_FIELD(replace); COPY_NODE_FIELD(funcname); COPY_NODE_FIELD(parameters); COPY_NODE_FIELD(returnType); COPY_NODE_FIELD(options); return newnode; } static FunctionParameter * _copyFunctionParameter(const FunctionParameter *from) { FunctionParameter *newnode = makeNode(FunctionParameter); COPY_STRING_FIELD(name); COPY_NODE_FIELD(argType); COPY_SCALAR_FIELD(mode); COPY_NODE_FIELD(defexpr); return newnode; } static AlterFunctionStmt * _copyAlterFunctionStmt(const AlterFunctionStmt *from) { AlterFunctionStmt *newnode = makeNode(AlterFunctionStmt); COPY_SCALAR_FIELD(objtype); COPY_NODE_FIELD(func); COPY_NODE_FIELD(actions); return newnode; } static DoStmt * _copyDoStmt(const DoStmt *from) { DoStmt *newnode = makeNode(DoStmt); COPY_NODE_FIELD(args); return newnode; } static RenameStmt * _copyRenameStmt(const RenameStmt *from) { RenameStmt *newnode = makeNode(RenameStmt); COPY_SCALAR_FIELD(renameType); COPY_SCALAR_FIELD(relationType); COPY_NODE_FIELD(relation); COPY_NODE_FIELD(object); COPY_STRING_FIELD(subname); COPY_STRING_FIELD(newname); COPY_SCALAR_FIELD(behavior); COPY_SCALAR_FIELD(missing_ok); return newnode; } static AlterObjectDependsStmt * _copyAlterObjectDependsStmt(const AlterObjectDependsStmt *from) { AlterObjectDependsStmt *newnode = makeNode(AlterObjectDependsStmt); COPY_SCALAR_FIELD(objectType); COPY_NODE_FIELD(relation); COPY_NODE_FIELD(object); COPY_NODE_FIELD(extname); return newnode; } static AlterObjectSchemaStmt * _copyAlterObjectSchemaStmt(const AlterObjectSchemaStmt *from) { AlterObjectSchemaStmt *newnode = makeNode(AlterObjectSchemaStmt); COPY_SCALAR_FIELD(objectType); COPY_NODE_FIELD(relation); COPY_NODE_FIELD(object); COPY_STRING_FIELD(newschema); COPY_SCALAR_FIELD(missing_ok); return newnode; } static AlterOwnerStmt * _copyAlterOwnerStmt(const AlterOwnerStmt *from) { AlterOwnerStmt *newnode = makeNode(AlterOwnerStmt); COPY_SCALAR_FIELD(objectType); COPY_NODE_FIELD(relation); COPY_NODE_FIELD(object); COPY_NODE_FIELD(newowner); return newnode; } static AlterOperatorStmt * _copyAlterOperatorStmt(const AlterOperatorStmt *from) { AlterOperatorStmt *newnode = makeNode(AlterOperatorStmt); COPY_NODE_FIELD(opername); COPY_NODE_FIELD(options); return newnode; } static RuleStmt * _copyRuleStmt(const RuleStmt *from) { RuleStmt *newnode = makeNode(RuleStmt); COPY_NODE_FIELD(relation); COPY_STRING_FIELD(rulename); COPY_NODE_FIELD(whereClause); COPY_SCALAR_FIELD(event); COPY_SCALAR_FIELD(instead); COPY_NODE_FIELD(actions); COPY_SCALAR_FIELD(replace); return newnode; } static NotifyStmt * _copyNotifyStmt(const NotifyStmt *from) { NotifyStmt *newnode = makeNode(NotifyStmt); COPY_STRING_FIELD(conditionname); COPY_STRING_FIELD(payload); return newnode; } static ListenStmt * _copyListenStmt(const ListenStmt *from) { ListenStmt *newnode = makeNode(ListenStmt); COPY_STRING_FIELD(conditionname); return newnode; } static UnlistenStmt * _copyUnlistenStmt(const UnlistenStmt *from) { UnlistenStmt *newnode = makeNode(UnlistenStmt); COPY_STRING_FIELD(conditionname); return newnode; } static TransactionStmt * _copyTransactionStmt(const TransactionStmt *from) { TransactionStmt *newnode = makeNode(TransactionStmt); COPY_SCALAR_FIELD(kind); COPY_NODE_FIELD(options); COPY_STRING_FIELD(savepoint_name); COPY_STRING_FIELD(gid); COPY_SCALAR_FIELD(chain); return newnode; } static CompositeTypeStmt * _copyCompositeTypeStmt(const CompositeTypeStmt *from) { CompositeTypeStmt *newnode = makeNode(CompositeTypeStmt); COPY_NODE_FIELD(typevar); COPY_NODE_FIELD(coldeflist); return newnode; } static CreateEnumStmt * _copyCreateEnumStmt(const CreateEnumStmt *from) { CreateEnumStmt *newnode = makeNode(CreateEnumStmt); COPY_NODE_FIELD(typeName); COPY_NODE_FIELD(vals); return newnode; } static CreateRangeStmt * _copyCreateRangeStmt(const CreateRangeStmt *from) { CreateRangeStmt *newnode = makeNode(CreateRangeStmt); COPY_NODE_FIELD(typeName); COPY_NODE_FIELD(params); return newnode; } static AlterEnumStmt * _copyAlterEnumStmt(const AlterEnumStmt *from) { AlterEnumStmt *newnode = makeNode(AlterEnumStmt); COPY_NODE_FIELD(typeName); COPY_STRING_FIELD(oldVal); COPY_STRING_FIELD(newVal); COPY_STRING_FIELD(newValNeighbor); COPY_SCALAR_FIELD(newValIsAfter); COPY_SCALAR_FIELD(skipIfNewValExists); return newnode; } static ViewStmt * _copyViewStmt(const ViewStmt *from) { ViewStmt *newnode = makeNode(ViewStmt); COPY_NODE_FIELD(view); COPY_NODE_FIELD(aliases); COPY_NODE_FIELD(query); COPY_SCALAR_FIELD(replace); COPY_NODE_FIELD(options); COPY_SCALAR_FIELD(withCheckOption); return newnode; } static LoadStmt * _copyLoadStmt(const LoadStmt *from) { LoadStmt *newnode = makeNode(LoadStmt); COPY_STRING_FIELD(filename); return newnode; } static CreateDomainStmt * _copyCreateDomainStmt(const CreateDomainStmt *from) { CreateDomainStmt *newnode = makeNode(CreateDomainStmt); COPY_NODE_FIELD(domainname); COPY_NODE_FIELD(typeName); COPY_NODE_FIELD(collClause); COPY_NODE_FIELD(constraints); return newnode; } static CreateOpClassStmt * _copyCreateOpClassStmt(const CreateOpClassStmt *from) { CreateOpClassStmt *newnode = makeNode(CreateOpClassStmt); COPY_NODE_FIELD(opclassname); COPY_NODE_FIELD(opfamilyname); COPY_STRING_FIELD(amname); COPY_NODE_FIELD(datatype); COPY_NODE_FIELD(items); COPY_SCALAR_FIELD(isDefault); return newnode; } static CreateOpClassItem * _copyCreateOpClassItem(const CreateOpClassItem *from) { CreateOpClassItem *newnode = makeNode(CreateOpClassItem); COPY_SCALAR_FIELD(itemtype); COPY_NODE_FIELD(name); COPY_SCALAR_FIELD(number); COPY_NODE_FIELD(order_family); COPY_NODE_FIELD(class_args); COPY_NODE_FIELD(storedtype); return newnode; } static CreateOpFamilyStmt * _copyCreateOpFamilyStmt(const CreateOpFamilyStmt *from) { CreateOpFamilyStmt *newnode = makeNode(CreateOpFamilyStmt); COPY_NODE_FIELD(opfamilyname); COPY_STRING_FIELD(amname); return newnode; } static AlterOpFamilyStmt * _copyAlterOpFamilyStmt(const AlterOpFamilyStmt *from) { AlterOpFamilyStmt *newnode = makeNode(AlterOpFamilyStmt); COPY_NODE_FIELD(opfamilyname); COPY_STRING_FIELD(amname); COPY_SCALAR_FIELD(isDrop); COPY_NODE_FIELD(items); return newnode; } static CreatedbStmt * _copyCreatedbStmt(const CreatedbStmt *from) { CreatedbStmt *newnode = makeNode(CreatedbStmt); COPY_STRING_FIELD(dbname); COPY_NODE_FIELD(options); return newnode; } static AlterDatabaseStmt * _copyAlterDatabaseStmt(const AlterDatabaseStmt *from) { AlterDatabaseStmt *newnode = makeNode(AlterDatabaseStmt); COPY_STRING_FIELD(dbname); COPY_NODE_FIELD(options); return newnode; } static AlterDatabaseSetStmt * _copyAlterDatabaseSetStmt(const AlterDatabaseSetStmt *from) { AlterDatabaseSetStmt *newnode = makeNode(AlterDatabaseSetStmt); COPY_STRING_FIELD(dbname); COPY_NODE_FIELD(setstmt); return newnode; } static DropdbStmt * _copyDropdbStmt(const DropdbStmt *from) { DropdbStmt *newnode = makeNode(DropdbStmt); COPY_STRING_FIELD(dbname); COPY_SCALAR_FIELD(missing_ok); return newnode; } static VacuumStmt * _copyVacuumStmt(const VacuumStmt *from) { VacuumStmt *newnode = makeNode(VacuumStmt); COPY_NODE_FIELD(options); COPY_NODE_FIELD(rels); COPY_SCALAR_FIELD(is_vacuumcmd); return newnode; } static VacuumRelation * _copyVacuumRelation(const VacuumRelation *from) { VacuumRelation *newnode = makeNode(VacuumRelation); COPY_NODE_FIELD(relation); COPY_SCALAR_FIELD(oid); COPY_NODE_FIELD(va_cols); return newnode; } static ExplainStmt * _copyExplainStmt(const ExplainStmt *from) { ExplainStmt *newnode = makeNode(ExplainStmt); COPY_NODE_FIELD(query); COPY_NODE_FIELD(options); return newnode; } static CreateTableAsStmt * _copyCreateTableAsStmt(const CreateTableAsStmt *from) { CreateTableAsStmt *newnode = makeNode(CreateTableAsStmt); COPY_NODE_FIELD(query); COPY_NODE_FIELD(into); COPY_SCALAR_FIELD(relkind); COPY_SCALAR_FIELD(is_select_into); COPY_SCALAR_FIELD(if_not_exists); return newnode; } static RefreshMatViewStmt * _copyRefreshMatViewStmt(const RefreshMatViewStmt *from) { RefreshMatViewStmt *newnode = makeNode(RefreshMatViewStmt); COPY_SCALAR_FIELD(concurrent); COPY_SCALAR_FIELD(skipData); COPY_NODE_FIELD(relation); return newnode; } static ReplicaIdentityStmt * _copyReplicaIdentityStmt(const ReplicaIdentityStmt *from) { ReplicaIdentityStmt *newnode = makeNode(ReplicaIdentityStmt); COPY_SCALAR_FIELD(identity_type); COPY_STRING_FIELD(name); return newnode; } static AlterSystemStmt * _copyAlterSystemStmt(const AlterSystemStmt *from) { AlterSystemStmt *newnode = makeNode(AlterSystemStmt); COPY_NODE_FIELD(setstmt); return newnode; } static CreateSeqStmt * _copyCreateSeqStmt(const CreateSeqStmt *from) { CreateSeqStmt *newnode = makeNode(CreateSeqStmt); COPY_NODE_FIELD(sequence); COPY_NODE_FIELD(options); COPY_SCALAR_FIELD(ownerId); COPY_SCALAR_FIELD(for_identity); COPY_SCALAR_FIELD(if_not_exists); return newnode; } static AlterSeqStmt * _copyAlterSeqStmt(const AlterSeqStmt *from) { AlterSeqStmt *newnode = makeNode(AlterSeqStmt); COPY_NODE_FIELD(sequence); COPY_NODE_FIELD(options); COPY_SCALAR_FIELD(for_identity); COPY_SCALAR_FIELD(missing_ok); return newnode; } static VariableSetStmt * _copyVariableSetStmt(const VariableSetStmt *from) { VariableSetStmt *newnode = makeNode(VariableSetStmt); COPY_SCALAR_FIELD(kind); COPY_STRING_FIELD(name); COPY_NODE_FIELD(args); COPY_SCALAR_FIELD(is_local); return newnode; } static VariableShowStmt * _copyVariableShowStmt(const VariableShowStmt *from) { VariableShowStmt *newnode = makeNode(VariableShowStmt); COPY_STRING_FIELD(name); return newnode; } static DiscardStmt * _copyDiscardStmt(const DiscardStmt *from) { DiscardStmt *newnode = makeNode(DiscardStmt); COPY_SCALAR_FIELD(target); return newnode; } static CreateTableSpaceStmt * _copyCreateTableSpaceStmt(const CreateTableSpaceStmt *from) { CreateTableSpaceStmt *newnode = makeNode(CreateTableSpaceStmt); COPY_STRING_FIELD(tablespacename); COPY_NODE_FIELD(owner); COPY_STRING_FIELD(location); COPY_NODE_FIELD(options); return newnode; } static DropTableSpaceStmt * _copyDropTableSpaceStmt(const DropTableSpaceStmt *from) { DropTableSpaceStmt *newnode = makeNode(DropTableSpaceStmt); COPY_STRING_FIELD(tablespacename); COPY_SCALAR_FIELD(missing_ok); return newnode; } static AlterTableSpaceOptionsStmt * _copyAlterTableSpaceOptionsStmt(const AlterTableSpaceOptionsStmt *from) { AlterTableSpaceOptionsStmt *newnode = makeNode(AlterTableSpaceOptionsStmt); COPY_STRING_FIELD(tablespacename); COPY_NODE_FIELD(options); COPY_SCALAR_FIELD(isReset); return newnode; } static AlterTableMoveAllStmt * _copyAlterTableMoveAllStmt(const AlterTableMoveAllStmt *from) { AlterTableMoveAllStmt *newnode = makeNode(AlterTableMoveAllStmt); COPY_STRING_FIELD(orig_tablespacename); COPY_SCALAR_FIELD(objtype); COPY_NODE_FIELD(roles); COPY_STRING_FIELD(new_tablespacename); COPY_SCALAR_FIELD(nowait); return newnode; } static CreateExtensionStmt * _copyCreateExtensionStmt(const CreateExtensionStmt *from) { CreateExtensionStmt *newnode = makeNode(CreateExtensionStmt); COPY_STRING_FIELD(extname); COPY_SCALAR_FIELD(if_not_exists); COPY_NODE_FIELD(options); return newnode; } static AlterExtensionStmt * _copyAlterExtensionStmt(const AlterExtensionStmt *from) { AlterExtensionStmt *newnode = makeNode(AlterExtensionStmt); COPY_STRING_FIELD(extname); COPY_NODE_FIELD(options); return newnode; } static AlterExtensionContentsStmt * _copyAlterExtensionContentsStmt(const AlterExtensionContentsStmt *from) { AlterExtensionContentsStmt *newnode = makeNode(AlterExtensionContentsStmt); COPY_STRING_FIELD(extname); COPY_SCALAR_FIELD(action); COPY_SCALAR_FIELD(objtype); COPY_NODE_FIELD(object); return newnode; } static CreateFdwStmt * _copyCreateFdwStmt(const CreateFdwStmt *from) { CreateFdwStmt *newnode = makeNode(CreateFdwStmt); COPY_STRING_FIELD(fdwname); COPY_NODE_FIELD(func_options); COPY_NODE_FIELD(options); return newnode; } static AlterFdwStmt * _copyAlterFdwStmt(const AlterFdwStmt *from) { AlterFdwStmt *newnode = makeNode(AlterFdwStmt); COPY_STRING_FIELD(fdwname); COPY_NODE_FIELD(func_options); COPY_NODE_FIELD(options); return newnode; } static CreateForeignServerStmt * _copyCreateForeignServerStmt(const CreateForeignServerStmt *from) { CreateForeignServerStmt *newnode = makeNode(CreateForeignServerStmt); COPY_STRING_FIELD(servername); COPY_STRING_FIELD(servertype); COPY_STRING_FIELD(version); COPY_STRING_FIELD(fdwname); COPY_SCALAR_FIELD(if_not_exists); COPY_NODE_FIELD(options); return newnode; } static AlterForeignServerStmt * _copyAlterForeignServerStmt(const AlterForeignServerStmt *from) { AlterForeignServerStmt *newnode = makeNode(AlterForeignServerStmt); COPY_STRING_FIELD(servername); COPY_STRING_FIELD(version); COPY_NODE_FIELD(options); COPY_SCALAR_FIELD(has_version); return newnode; } static CreateUserMappingStmt * _copyCreateUserMappingStmt(const CreateUserMappingStmt *from) { CreateUserMappingStmt *newnode = makeNode(CreateUserMappingStmt); COPY_NODE_FIELD(user); COPY_STRING_FIELD(servername); COPY_SCALAR_FIELD(if_not_exists); COPY_NODE_FIELD(options); return newnode; } static AlterUserMappingStmt * _copyAlterUserMappingStmt(const AlterUserMappingStmt *from) { AlterUserMappingStmt *newnode = makeNode(AlterUserMappingStmt); COPY_NODE_FIELD(user); COPY_STRING_FIELD(servername); COPY_NODE_FIELD(options); return newnode; } static DropUserMappingStmt * _copyDropUserMappingStmt(const DropUserMappingStmt *from) { DropUserMappingStmt *newnode = makeNode(DropUserMappingStmt); COPY_NODE_FIELD(user); COPY_STRING_FIELD(servername); COPY_SCALAR_FIELD(missing_ok); return newnode; } static CreateForeignTableStmt * _copyCreateForeignTableStmt(const CreateForeignTableStmt *from) { CreateForeignTableStmt *newnode = makeNode(CreateForeignTableStmt); CopyCreateStmtFields((const CreateStmt *) from, (CreateStmt *) newnode); COPY_STRING_FIELD(servername); COPY_NODE_FIELD(options); return newnode; } static ImportForeignSchemaStmt * _copyImportForeignSchemaStmt(const ImportForeignSchemaStmt *from) { ImportForeignSchemaStmt *newnode = makeNode(ImportForeignSchemaStmt); COPY_STRING_FIELD(server_name); COPY_STRING_FIELD(remote_schema); COPY_STRING_FIELD(local_schema); COPY_SCALAR_FIELD(list_type); COPY_NODE_FIELD(table_list); COPY_NODE_FIELD(options); return newnode; } static CreateTransformStmt * _copyCreateTransformStmt(const CreateTransformStmt *from) { CreateTransformStmt *newnode = makeNode(CreateTransformStmt); COPY_SCALAR_FIELD(replace); COPY_NODE_FIELD(type_name); COPY_STRING_FIELD(lang); COPY_NODE_FIELD(fromsql); COPY_NODE_FIELD(tosql); return newnode; } static CreateAmStmt * _copyCreateAmStmt(const CreateAmStmt *from) { CreateAmStmt *newnode = makeNode(CreateAmStmt); COPY_STRING_FIELD(amname); COPY_NODE_FIELD(handler_name); COPY_SCALAR_FIELD(amtype); return newnode; } static CreateTrigStmt * _copyCreateTrigStmt(const CreateTrigStmt *from) { CreateTrigStmt *newnode = makeNode(CreateTrigStmt); COPY_STRING_FIELD(trigname); COPY_NODE_FIELD(relation); COPY_NODE_FIELD(funcname); COPY_NODE_FIELD(args); COPY_SCALAR_FIELD(row); COPY_SCALAR_FIELD(timing); COPY_SCALAR_FIELD(events); COPY_NODE_FIELD(columns); COPY_NODE_FIELD(whenClause); COPY_SCALAR_FIELD(isconstraint); COPY_NODE_FIELD(transitionRels); COPY_SCALAR_FIELD(deferrable); COPY_SCALAR_FIELD(initdeferred); COPY_NODE_FIELD(constrrel); return newnode; } static CreateEventTrigStmt * _copyCreateEventTrigStmt(const CreateEventTrigStmt *from) { CreateEventTrigStmt *newnode = makeNode(CreateEventTrigStmt); COPY_STRING_FIELD(trigname); COPY_STRING_FIELD(eventname); COPY_NODE_FIELD(whenclause); COPY_NODE_FIELD(funcname); return newnode; } static AlterEventTrigStmt * _copyAlterEventTrigStmt(const AlterEventTrigStmt *from) { AlterEventTrigStmt *newnode = makeNode(AlterEventTrigStmt); COPY_STRING_FIELD(trigname); COPY_SCALAR_FIELD(tgenabled); return newnode; } static CreatePLangStmt * _copyCreatePLangStmt(const CreatePLangStmt *from) { CreatePLangStmt *newnode = makeNode(CreatePLangStmt); COPY_SCALAR_FIELD(replace); COPY_STRING_FIELD(plname); COPY_NODE_FIELD(plhandler); COPY_NODE_FIELD(plinline); COPY_NODE_FIELD(plvalidator); COPY_SCALAR_FIELD(pltrusted); return newnode; } static CreateRoleStmt * _copyCreateRoleStmt(const CreateRoleStmt *from) { CreateRoleStmt *newnode = makeNode(CreateRoleStmt); COPY_SCALAR_FIELD(stmt_type); COPY_STRING_FIELD(role); COPY_NODE_FIELD(options); return newnode; } static AlterRoleStmt * _copyAlterRoleStmt(const AlterRoleStmt *from) { AlterRoleStmt *newnode = makeNode(AlterRoleStmt); COPY_NODE_FIELD(role); COPY_NODE_FIELD(options); COPY_SCALAR_FIELD(action); return newnode; } static AlterRoleSetStmt * _copyAlterRoleSetStmt(const AlterRoleSetStmt *from) { AlterRoleSetStmt *newnode = makeNode(AlterRoleSetStmt); COPY_NODE_FIELD(role); COPY_STRING_FIELD(database); COPY_NODE_FIELD(setstmt); return newnode; } static DropRoleStmt * _copyDropRoleStmt(const DropRoleStmt *from) { DropRoleStmt *newnode = makeNode(DropRoleStmt); COPY_NODE_FIELD(roles); COPY_SCALAR_FIELD(missing_ok); return newnode; } static LockStmt * _copyLockStmt(const LockStmt *from) { LockStmt *newnode = makeNode(LockStmt); COPY_NODE_FIELD(relations); COPY_SCALAR_FIELD(mode); COPY_SCALAR_FIELD(nowait); return newnode; } static ConstraintsSetStmt * _copyConstraintsSetStmt(const ConstraintsSetStmt *from) { ConstraintsSetStmt *newnode = makeNode(ConstraintsSetStmt); COPY_NODE_FIELD(constraints); COPY_SCALAR_FIELD(deferred); return newnode; } static ReindexStmt * _copyReindexStmt(const ReindexStmt *from) { ReindexStmt *newnode = makeNode(ReindexStmt); COPY_SCALAR_FIELD(kind); COPY_NODE_FIELD(relation); COPY_STRING_FIELD(name); COPY_SCALAR_FIELD(options); COPY_SCALAR_FIELD(concurrent); return newnode; } static CreateSchemaStmt * _copyCreateSchemaStmt(const CreateSchemaStmt *from) { CreateSchemaStmt *newnode = makeNode(CreateSchemaStmt); COPY_STRING_FIELD(schemaname); COPY_NODE_FIELD(authrole); COPY_NODE_FIELD(schemaElts); COPY_SCALAR_FIELD(if_not_exists); return newnode; } static CreateConversionStmt * _copyCreateConversionStmt(const CreateConversionStmt *from) { CreateConversionStmt *newnode = makeNode(CreateConversionStmt); COPY_NODE_FIELD(conversion_name); COPY_STRING_FIELD(for_encoding_name); COPY_STRING_FIELD(to_encoding_name); COPY_NODE_FIELD(func_name); COPY_SCALAR_FIELD(def); return newnode; } static CreateCastStmt * _copyCreateCastStmt(const CreateCastStmt *from) { CreateCastStmt *newnode = makeNode(CreateCastStmt); COPY_NODE_FIELD(sourcetype); COPY_NODE_FIELD(targettype); COPY_NODE_FIELD(func); COPY_SCALAR_FIELD(context); COPY_SCALAR_FIELD(inout); return newnode; } static PrepareStmt * _copyPrepareStmt(const PrepareStmt *from) { PrepareStmt *newnode = makeNode(PrepareStmt); COPY_STRING_FIELD(name); COPY_NODE_FIELD(argtypes); COPY_NODE_FIELD(query); return newnode; } static ExecuteStmt * _copyExecuteStmt(const ExecuteStmt *from) { ExecuteStmt *newnode = makeNode(ExecuteStmt); COPY_STRING_FIELD(name); COPY_NODE_FIELD(params); return newnode; } static DeallocateStmt * _copyDeallocateStmt(const DeallocateStmt *from) { DeallocateStmt *newnode = makeNode(DeallocateStmt); COPY_STRING_FIELD(name); return newnode; } static DropOwnedStmt * _copyDropOwnedStmt(const DropOwnedStmt *from) { DropOwnedStmt *newnode = makeNode(DropOwnedStmt); COPY_NODE_FIELD(roles); COPY_SCALAR_FIELD(behavior); return newnode; } static ReassignOwnedStmt * _copyReassignOwnedStmt(const ReassignOwnedStmt *from) { ReassignOwnedStmt *newnode = makeNode(ReassignOwnedStmt); COPY_NODE_FIELD(roles); COPY_NODE_FIELD(newrole); return newnode; } static AlterTSDictionaryStmt * _copyAlterTSDictionaryStmt(const AlterTSDictionaryStmt *from) { AlterTSDictionaryStmt *newnode = makeNode(AlterTSDictionaryStmt); COPY_NODE_FIELD(dictname); COPY_NODE_FIELD(options); return newnode; } static AlterTSConfigurationStmt * _copyAlterTSConfigurationStmt(const AlterTSConfigurationStmt *from) { AlterTSConfigurationStmt *newnode = makeNode(AlterTSConfigurationStmt); COPY_SCALAR_FIELD(kind); COPY_NODE_FIELD(cfgname); COPY_NODE_FIELD(tokentype); COPY_NODE_FIELD(dicts); COPY_SCALAR_FIELD(override); COPY_SCALAR_FIELD(replace); COPY_SCALAR_FIELD(missing_ok); return newnode; } static CreatePolicyStmt * _copyCreatePolicyStmt(const CreatePolicyStmt *from) { CreatePolicyStmt *newnode = makeNode(CreatePolicyStmt); COPY_STRING_FIELD(policy_name); COPY_NODE_FIELD(table); COPY_STRING_FIELD(cmd_name); COPY_SCALAR_FIELD(permissive); COPY_NODE_FIELD(roles); COPY_NODE_FIELD(qual); COPY_NODE_FIELD(with_check); return newnode; } static AlterPolicyStmt * _copyAlterPolicyStmt(const AlterPolicyStmt *from) { AlterPolicyStmt *newnode = makeNode(AlterPolicyStmt); COPY_STRING_FIELD(policy_name); COPY_NODE_FIELD(table); COPY_NODE_FIELD(roles); COPY_NODE_FIELD(qual); COPY_NODE_FIELD(with_check); return newnode; } static PartitionElem * _copyPartitionElem(const PartitionElem *from) { PartitionElem *newnode = makeNode(PartitionElem); COPY_STRING_FIELD(name); COPY_NODE_FIELD(expr); COPY_NODE_FIELD(collation); COPY_NODE_FIELD(opclass); COPY_LOCATION_FIELD(location); return newnode; } static PartitionSpec * _copyPartitionSpec(const PartitionSpec *from) { PartitionSpec *newnode = makeNode(PartitionSpec); COPY_STRING_FIELD(strategy); COPY_NODE_FIELD(partParams); COPY_LOCATION_FIELD(location); return newnode; } static PartitionBoundSpec * _copyPartitionBoundSpec(const PartitionBoundSpec *from) { PartitionBoundSpec *newnode = makeNode(PartitionBoundSpec); COPY_SCALAR_FIELD(strategy); COPY_SCALAR_FIELD(is_default); COPY_SCALAR_FIELD(modulus); COPY_SCALAR_FIELD(remainder); COPY_NODE_FIELD(listdatums); COPY_NODE_FIELD(lowerdatums); COPY_NODE_FIELD(upperdatums); COPY_LOCATION_FIELD(location); return newnode; } static PartitionRangeDatum * _copyPartitionRangeDatum(const PartitionRangeDatum *from) { PartitionRangeDatum *newnode = makeNode(PartitionRangeDatum); COPY_SCALAR_FIELD(kind); COPY_NODE_FIELD(value); COPY_LOCATION_FIELD(location); return newnode; } static PartitionCmd * _copyPartitionCmd(const PartitionCmd *from) { PartitionCmd *newnode = makeNode(PartitionCmd); COPY_NODE_FIELD(name); COPY_NODE_FIELD(bound); return newnode; } static CreatePublicationStmt * _copyCreatePublicationStmt(const CreatePublicationStmt *from) { CreatePublicationStmt *newnode = makeNode(CreatePublicationStmt); COPY_STRING_FIELD(pubname); COPY_NODE_FIELD(options); COPY_NODE_FIELD(tables); COPY_SCALAR_FIELD(for_all_tables); return newnode; } static AlterPublicationStmt * _copyAlterPublicationStmt(const AlterPublicationStmt *from) { AlterPublicationStmt *newnode = makeNode(AlterPublicationStmt); COPY_STRING_FIELD(pubname); COPY_NODE_FIELD(options); COPY_NODE_FIELD(tables); COPY_SCALAR_FIELD(for_all_tables); COPY_SCALAR_FIELD(tableAction); return newnode; } static CreateSubscriptionStmt * _copyCreateSubscriptionStmt(const CreateSubscriptionStmt *from) { CreateSubscriptionStmt *newnode = makeNode(CreateSubscriptionStmt); COPY_STRING_FIELD(subname); COPY_STRING_FIELD(conninfo); COPY_NODE_FIELD(publication); COPY_NODE_FIELD(options); return newnode; } static AlterSubscriptionStmt * _copyAlterSubscriptionStmt(const AlterSubscriptionStmt *from) { AlterSubscriptionStmt *newnode = makeNode(AlterSubscriptionStmt); COPY_SCALAR_FIELD(kind); COPY_STRING_FIELD(subname); COPY_STRING_FIELD(conninfo); COPY_NODE_FIELD(publication); COPY_NODE_FIELD(options); return newnode; } static DropSubscriptionStmt * _copyDropSubscriptionStmt(const DropSubscriptionStmt *from) { DropSubscriptionStmt *newnode = makeNode(DropSubscriptionStmt); COPY_STRING_FIELD(subname); COPY_SCALAR_FIELD(missing_ok); COPY_SCALAR_FIELD(behavior); return newnode; } /* **************************************************************** * pg_list.h copy functions * **************************************************************** */ /* * Perform a deep copy of the specified list, using copyObject(). The * list MUST be of type T_List; T_IntList and T_OidList nodes don't * need deep copies, so they should be copied via list_copy() */ #define COPY_NODE_CELL(new, old) \ (new) = (ListCell *) palloc(sizeof(ListCell)); \ lfirst(new) = copyObjectImpl(lfirst(old)); static List * _copyList(const List *from) { List *new; ListCell *curr_old; ListCell *prev_new; Assert(list_length(from) >= 1); new = makeNode(List); new->length = from->length; COPY_NODE_CELL(new->head, from->head); prev_new = new->head; curr_old = lnext(from->head); while (curr_old) { COPY_NODE_CELL(prev_new->next, curr_old); prev_new = prev_new->next; curr_old = curr_old->next; } prev_new->next = NULL; new->tail = prev_new; return new; } #ifdef NOT_USED_IN_PGPOOL /* **************************************************************** * extensible.h copy functions * **************************************************************** */ static ExtensibleNode * _copyExtensibleNode(const ExtensibleNode *from) { ExtensibleNode *newnode; const ExtensibleNodeMethods *methods; methods = GetExtensibleNodeMethods(from->extnodename, false); newnode = (ExtensibleNode *) newNode(methods->node_size, T_ExtensibleNode); COPY_STRING_FIELD(extnodename); /* copy the private fields */ methods->nodeCopy(newnode, from); return newnode; } #endif /* **************************************************************** * value.h copy functions * **************************************************************** */ static Value * _copyValue(const Value *from) { Value *newnode = makeNode(Value); /* See also _copyAConst when changing this code! */ COPY_SCALAR_FIELD(type); switch (from->type) { case T_Integer: COPY_SCALAR_FIELD(val.ival); break; case T_Float: case T_String: case T_BitString: COPY_STRING_FIELD(val.str); break; case T_Null: /* nothing to do */ break; default: elog(ERROR, "unrecognized node type: %d", (int) from->type); break; } return newnode; } #ifdef NOT_USED_IN_PGPOOL static ForeignKeyCacheInfo * _copyForeignKeyCacheInfo(const ForeignKeyCacheInfo *from) { ForeignKeyCacheInfo *newnode = makeNode(ForeignKeyCacheInfo); COPY_SCALAR_FIELD(conoid); COPY_SCALAR_FIELD(conrelid); COPY_SCALAR_FIELD(confrelid); COPY_SCALAR_FIELD(nkeys); /* COPY_SCALAR_FIELD might work for these, but let's not assume that */ memcpy(newnode->conkey, from->conkey, sizeof(newnode->conkey)); memcpy(newnode->confkey, from->confkey, sizeof(newnode->confkey)); memcpy(newnode->conpfeqop, from->conpfeqop, sizeof(newnode->conpfeqop)); return newnode; } #endif /* * copyObjectImpl -- implementation of copyObject(); see nodes/nodes.h * * Create a copy of a Node tree or list. This is a "deep" copy: all * substructure is copied too, recursively. */ void * copyObjectImpl(const void *from) { void *retval; if (from == NULL) return NULL; /* Guard against stack overflow due to overly complex expressions */ #ifdef NOT_USED_IN_PGPOOL check_stack_depth(); #endif switch (nodeTag(from)) { #ifdef NOT_USED_IN_PGPOOL /* * PLAN NODES */ case T_PlannedStmt: retval = _copyPlannedStmt(from); break; case T_Plan: retval = _copyPlan(from); break; case T_Result: retval = _copyResult(from); break; case T_ProjectSet: retval = _copyProjectSet(from); break; case T_ModifyTable: retval = _copyModifyTable(from); break; case T_Append: retval = _copyAppend(from); break; case T_MergeAppend: retval = _copyMergeAppend(from); break; case T_RecursiveUnion: retval = _copyRecursiveUnion(from); break; case T_BitmapAnd: retval = _copyBitmapAnd(from); break; case T_BitmapOr: retval = _copyBitmapOr(from); break; case T_Scan: retval = _copyScan(from); break; case T_Gather: retval = _copyGather(from); break; case T_GatherMerge: retval = _copyGatherMerge(from); break; case T_SeqScan: retval = _copySeqScan(from); break; case T_SampleScan: retval = _copySampleScan(from); break; case T_IndexScan: retval = _copyIndexScan(from); break; case T_IndexOnlyScan: retval = _copyIndexOnlyScan(from); break; case T_BitmapIndexScan: retval = _copyBitmapIndexScan(from); break; case T_BitmapHeapScan: retval = _copyBitmapHeapScan(from); break; case T_TidScan: retval = _copyTidScan(from); break; case T_SubqueryScan: retval = _copySubqueryScan(from); break; case T_FunctionScan: retval = _copyFunctionScan(from); break; case T_TableFuncScan: retval = _copyTableFuncScan(from); break; case T_ValuesScan: retval = _copyValuesScan(from); break; case T_CteScan: retval = _copyCteScan(from); break; case T_NamedTuplestoreScan: retval = _copyNamedTuplestoreScan(from); break; case T_WorkTableScan: retval = _copyWorkTableScan(from); break; case T_ForeignScan: retval = _copyForeignScan(from); break; case T_CustomScan: retval = _copyCustomScan(from); break; case T_Join: retval = _copyJoin(from); break; case T_NestLoop: retval = _copyNestLoop(from); break; case T_MergeJoin: retval = _copyMergeJoin(from); break; case T_HashJoin: retval = _copyHashJoin(from); break; case T_Material: retval = _copyMaterial(from); break; case T_Sort: retval = _copySort(from); break; case T_Group: retval = _copyGroup(from); break; case T_Agg: retval = _copyAgg(from); break; case T_WindowAgg: retval = _copyWindowAgg(from); break; case T_Unique: retval = _copyUnique(from); break; case T_Hash: retval = _copyHash(from); break; case T_SetOp: retval = _copySetOp(from); break; case T_LockRows: retval = _copyLockRows(from); break; case T_Limit: retval = _copyLimit(from); break; case T_NestLoopParam: retval = _copyNestLoopParam(from); break; case T_PlanRowMark: retval = _copyPlanRowMark(from); break; case T_PartitionPruneInfo: retval = _copyPartitionPruneInfo(from); break; case T_PartitionedRelPruneInfo: retval = _copyPartitionedRelPruneInfo(from); break; case T_PartitionPruneStepOp: retval = _copyPartitionPruneStepOp(from); break; case T_PartitionPruneStepCombine: retval = _copyPartitionPruneStepCombine(from); break; case T_PlanInvalItem: retval = _copyPlanInvalItem(from); break; #endif /* * PRIMITIVE NODES */ case T_Alias: retval = _copyAlias(from); break; case T_RangeVar: retval = _copyRangeVar(from); break; case T_TableFunc: retval = _copyTableFunc(from); break; case T_IntoClause: retval = _copyIntoClause(from); break; case T_Var: retval = _copyVar(from); break; #ifdef NOT_USED_IN_PGPOOL case T_Const: retval = _copyConst(from); break; #endif case T_Param: retval = _copyParam(from); break; case T_Aggref: retval = _copyAggref(from); break; case T_GroupingFunc: retval = _copyGroupingFunc(from); break; case T_WindowFunc: retval = _copyWindowFunc(from); break; case T_SubscriptingRef: retval = _copySubscriptingRef(from); break; case T_FuncExpr: retval = _copyFuncExpr(from); break; case T_NamedArgExpr: retval = _copyNamedArgExpr(from); break; case T_OpExpr: retval = _copyOpExpr(from); break; case T_DistinctExpr: retval = _copyDistinctExpr(from); break; case T_NullIfExpr: retval = _copyNullIfExpr(from); break; case T_ScalarArrayOpExpr: retval = _copyScalarArrayOpExpr(from); break; case T_BoolExpr: retval = _copyBoolExpr(from); break; case T_SubLink: retval = _copySubLink(from); break; case T_SubPlan: retval = _copySubPlan(from); break; case T_AlternativeSubPlan: retval = _copyAlternativeSubPlan(from); break; case T_FieldSelect: retval = _copyFieldSelect(from); break; case T_FieldStore: retval = _copyFieldStore(from); break; case T_RelabelType: retval = _copyRelabelType(from); break; case T_CoerceViaIO: retval = _copyCoerceViaIO(from); break; case T_ArrayCoerceExpr: retval = _copyArrayCoerceExpr(from); break; case T_ConvertRowtypeExpr: retval = _copyConvertRowtypeExpr(from); break; case T_CollateExpr: retval = _copyCollateExpr(from); break; case T_CaseExpr: retval = _copyCaseExpr(from); break; case T_CaseWhen: retval = _copyCaseWhen(from); break; case T_CaseTestExpr: retval = _copyCaseTestExpr(from); break; case T_ArrayExpr: retval = _copyArrayExpr(from); break; case T_RowExpr: retval = _copyRowExpr(from); break; case T_RowCompareExpr: retval = _copyRowCompareExpr(from); break; case T_CoalesceExpr: retval = _copyCoalesceExpr(from); break; case T_MinMaxExpr: retval = _copyMinMaxExpr(from); break; case T_SQLValueFunction: retval = _copySQLValueFunction(from); break; case T_XmlExpr: retval = _copyXmlExpr(from); break; case T_NullTest: retval = _copyNullTest(from); break; case T_BooleanTest: retval = _copyBooleanTest(from); break; case T_CoerceToDomain: retval = _copyCoerceToDomain(from); break; case T_CoerceToDomainValue: retval = _copyCoerceToDomainValue(from); break; case T_SetToDefault: retval = _copySetToDefault(from); break; case T_CurrentOfExpr: retval = _copyCurrentOfExpr(from); break; case T_NextValueExpr: retval = _copyNextValueExpr(from); break; case T_InferenceElem: retval = _copyInferenceElem(from); break; case T_TargetEntry: retval = _copyTargetEntry(from); break; case T_RangeTblRef: retval = _copyRangeTblRef(from); break; case T_JoinExpr: retval = _copyJoinExpr(from); break; case T_FromExpr: retval = _copyFromExpr(from); break; case T_OnConflictExpr: retval = _copyOnConflictExpr(from); break; #ifdef NOT_USED_IN_PGPOOL /* * RELATION NODES */ case T_PathKey: retval = _copyPathKey(from); break; case T_RestrictInfo: retval = _copyRestrictInfo(from); break; case T_PlaceHolderVar: retval = _copyPlaceHolderVar(from); break; case T_SpecialJoinInfo: retval = _copySpecialJoinInfo(from); break; case T_AppendRelInfo: retval = _copyAppendRelInfo(from); break; case T_PlaceHolderInfo: retval = _copyPlaceHolderInfo(from); break; #endif /* * VALUE NODES */ case T_Integer: case T_Float: case T_String: case T_BitString: case T_Null: retval = _copyValue(from); break; /* * LIST NODES */ case T_List: retval = _copyList(from); break; /* * Lists of integers and OIDs don't need to be deep-copied, so we * perform a shallow copy via list_copy() */ case T_IntList: case T_OidList: retval = list_copy(from); break; #ifdef NOT_USED_IN_PGPOOL /* * EXTENSIBLE NODES */ case T_ExtensibleNode: retval = _copyExtensibleNode(from); break; #endif /* * PARSE NODES */ case T_Query: retval = _copyQuery(from); break; case T_RawStmt: retval = _copyRawStmt(from); break; case T_InsertStmt: retval = _copyInsertStmt(from); break; case T_DeleteStmt: retval = _copyDeleteStmt(from); break; case T_UpdateStmt: retval = _copyUpdateStmt(from); break; case T_SelectStmt: retval = _copySelectStmt(from); break; case T_SetOperationStmt: retval = _copySetOperationStmt(from); break; case T_AlterTableStmt: retval = _copyAlterTableStmt(from); break; case T_AlterTableCmd: retval = _copyAlterTableCmd(from); break; case T_AlterCollationStmt: retval = _copyAlterCollationStmt(from); break; case T_AlterDomainStmt: retval = _copyAlterDomainStmt(from); break; case T_GrantStmt: retval = _copyGrantStmt(from); break; case T_GrantRoleStmt: retval = _copyGrantRoleStmt(from); break; case T_AlterDefaultPrivilegesStmt: retval = _copyAlterDefaultPrivilegesStmt(from); break; case T_DeclareCursorStmt: retval = _copyDeclareCursorStmt(from); break; case T_ClosePortalStmt: retval = _copyClosePortalStmt(from); break; case T_CallStmt: retval = _copyCallStmt(from); break; case T_ClusterStmt: retval = _copyClusterStmt(from); break; case T_CopyStmt: retval = _copyCopyStmt(from); break; case T_CreateStmt: retval = _copyCreateStmt(from); break; case T_TableLikeClause: retval = _copyTableLikeClause(from); break; case T_DefineStmt: retval = _copyDefineStmt(from); break; case T_DropStmt: retval = _copyDropStmt(from); break; case T_TruncateStmt: retval = _copyTruncateStmt(from); break; case T_CommentStmt: retval = _copyCommentStmt(from); break; case T_SecLabelStmt: retval = _copySecLabelStmt(from); break; case T_FetchStmt: retval = _copyFetchStmt(from); break; case T_IndexStmt: retval = _copyIndexStmt(from); break; case T_CreateStatsStmt: retval = _copyCreateStatsStmt(from); break; case T_CreateFunctionStmt: retval = _copyCreateFunctionStmt(from); break; case T_FunctionParameter: retval = _copyFunctionParameter(from); break; case T_AlterFunctionStmt: retval = _copyAlterFunctionStmt(from); break; case T_DoStmt: retval = _copyDoStmt(from); break; case T_RenameStmt: retval = _copyRenameStmt(from); break; case T_AlterObjectDependsStmt: retval = _copyAlterObjectDependsStmt(from); break; case T_AlterObjectSchemaStmt: retval = _copyAlterObjectSchemaStmt(from); break; case T_AlterOwnerStmt: retval = _copyAlterOwnerStmt(from); break; case T_AlterOperatorStmt: retval = _copyAlterOperatorStmt(from); break; case T_RuleStmt: retval = _copyRuleStmt(from); break; case T_NotifyStmt: retval = _copyNotifyStmt(from); break; case T_ListenStmt: retval = _copyListenStmt(from); break; case T_UnlistenStmt: retval = _copyUnlistenStmt(from); break; case T_TransactionStmt: retval = _copyTransactionStmt(from); break; case T_CompositeTypeStmt: retval = _copyCompositeTypeStmt(from); break; case T_CreateEnumStmt: retval = _copyCreateEnumStmt(from); break; case T_CreateRangeStmt: retval = _copyCreateRangeStmt(from); break; case T_AlterEnumStmt: retval = _copyAlterEnumStmt(from); break; case T_ViewStmt: retval = _copyViewStmt(from); break; case T_LoadStmt: retval = _copyLoadStmt(from); break; case T_CreateDomainStmt: retval = _copyCreateDomainStmt(from); break; case T_CreateOpClassStmt: retval = _copyCreateOpClassStmt(from); break; case T_CreateOpClassItem: retval = _copyCreateOpClassItem(from); break; case T_CreateOpFamilyStmt: retval = _copyCreateOpFamilyStmt(from); break; case T_AlterOpFamilyStmt: retval = _copyAlterOpFamilyStmt(from); break; case T_CreatedbStmt: retval = _copyCreatedbStmt(from); break; case T_AlterDatabaseStmt: retval = _copyAlterDatabaseStmt(from); break; case T_AlterDatabaseSetStmt: retval = _copyAlterDatabaseSetStmt(from); break; case T_DropdbStmt: retval = _copyDropdbStmt(from); break; case T_VacuumStmt: retval = _copyVacuumStmt(from); break; case T_VacuumRelation: retval = _copyVacuumRelation(from); break; case T_ExplainStmt: retval = _copyExplainStmt(from); break; case T_CreateTableAsStmt: retval = _copyCreateTableAsStmt(from); break; case T_RefreshMatViewStmt: retval = _copyRefreshMatViewStmt(from); break; case T_ReplicaIdentityStmt: retval = _copyReplicaIdentityStmt(from); break; case T_AlterSystemStmt: retval = _copyAlterSystemStmt(from); break; case T_CreateSeqStmt: retval = _copyCreateSeqStmt(from); break; case T_AlterSeqStmt: retval = _copyAlterSeqStmt(from); break; case T_VariableSetStmt: retval = _copyVariableSetStmt(from); break; case T_VariableShowStmt: retval = _copyVariableShowStmt(from); break; case T_DiscardStmt: retval = _copyDiscardStmt(from); break; case T_CreateTableSpaceStmt: retval = _copyCreateTableSpaceStmt(from); break; case T_DropTableSpaceStmt: retval = _copyDropTableSpaceStmt(from); break; case T_AlterTableSpaceOptionsStmt: retval = _copyAlterTableSpaceOptionsStmt(from); break; case T_AlterTableMoveAllStmt: retval = _copyAlterTableMoveAllStmt(from); break; case T_CreateExtensionStmt: retval = _copyCreateExtensionStmt(from); break; case T_AlterExtensionStmt: retval = _copyAlterExtensionStmt(from); break; case T_AlterExtensionContentsStmt: retval = _copyAlterExtensionContentsStmt(from); break; case T_CreateFdwStmt: retval = _copyCreateFdwStmt(from); break; case T_AlterFdwStmt: retval = _copyAlterFdwStmt(from); break; case T_CreateForeignServerStmt: retval = _copyCreateForeignServerStmt(from); break; case T_AlterForeignServerStmt: retval = _copyAlterForeignServerStmt(from); break; case T_CreateUserMappingStmt: retval = _copyCreateUserMappingStmt(from); break; case T_AlterUserMappingStmt: retval = _copyAlterUserMappingStmt(from); break; case T_DropUserMappingStmt: retval = _copyDropUserMappingStmt(from); break; case T_CreateForeignTableStmt: retval = _copyCreateForeignTableStmt(from); break; case T_ImportForeignSchemaStmt: retval = _copyImportForeignSchemaStmt(from); break; case T_CreateTransformStmt: retval = _copyCreateTransformStmt(from); break; case T_CreateAmStmt: retval = _copyCreateAmStmt(from); break; case T_CreateTrigStmt: retval = _copyCreateTrigStmt(from); break; case T_CreateEventTrigStmt: retval = _copyCreateEventTrigStmt(from); break; case T_AlterEventTrigStmt: retval = _copyAlterEventTrigStmt(from); break; case T_CreatePLangStmt: retval = _copyCreatePLangStmt(from); break; case T_CreateRoleStmt: retval = _copyCreateRoleStmt(from); break; case T_AlterRoleStmt: retval = _copyAlterRoleStmt(from); break; case T_AlterRoleSetStmt: retval = _copyAlterRoleSetStmt(from); break; case T_DropRoleStmt: retval = _copyDropRoleStmt(from); break; case T_LockStmt: retval = _copyLockStmt(from); break; case T_ConstraintsSetStmt: retval = _copyConstraintsSetStmt(from); break; case T_ReindexStmt: retval = _copyReindexStmt(from); break; case T_CheckPointStmt: retval = (void *) makeNode(CheckPointStmt); break; case T_CreateSchemaStmt: retval = _copyCreateSchemaStmt(from); break; case T_CreateConversionStmt: retval = _copyCreateConversionStmt(from); break; case T_CreateCastStmt: retval = _copyCreateCastStmt(from); break; case T_PrepareStmt: retval = _copyPrepareStmt(from); break; case T_ExecuteStmt: retval = _copyExecuteStmt(from); break; case T_DeallocateStmt: retval = _copyDeallocateStmt(from); break; case T_DropOwnedStmt: retval = _copyDropOwnedStmt(from); break; case T_ReassignOwnedStmt: retval = _copyReassignOwnedStmt(from); break; case T_AlterTSDictionaryStmt: retval = _copyAlterTSDictionaryStmt(from); break; case T_AlterTSConfigurationStmt: retval = _copyAlterTSConfigurationStmt(from); break; case T_CreatePolicyStmt: retval = _copyCreatePolicyStmt(from); break; case T_AlterPolicyStmt: retval = _copyAlterPolicyStmt(from); break; case T_CreatePublicationStmt: retval = _copyCreatePublicationStmt(from); break; case T_AlterPublicationStmt: retval = _copyAlterPublicationStmt(from); break; case T_CreateSubscriptionStmt: retval = _copyCreateSubscriptionStmt(from); break; case T_AlterSubscriptionStmt: retval = _copyAlterSubscriptionStmt(from); break; case T_DropSubscriptionStmt: retval = _copyDropSubscriptionStmt(from); break; case T_A_Expr: retval = _copyAExpr(from); break; case T_ColumnRef: retval = _copyColumnRef(from); break; case T_ParamRef: retval = _copyParamRef(from); break; case T_A_Const: retval = _copyAConst(from); break; case T_FuncCall: retval = _copyFuncCall(from); break; case T_A_Star: retval = _copyAStar(from); break; case T_A_Indices: retval = _copyAIndices(from); break; case T_A_Indirection: retval = _copyA_Indirection(from); break; case T_A_ArrayExpr: retval = _copyA_ArrayExpr(from); break; case T_ResTarget: retval = _copyResTarget(from); break; case T_MultiAssignRef: retval = _copyMultiAssignRef(from); break; case T_TypeCast: retval = _copyTypeCast(from); break; case T_CollateClause: retval = _copyCollateClause(from); break; case T_SortBy: retval = _copySortBy(from); break; case T_WindowDef: retval = _copyWindowDef(from); break; case T_RangeSubselect: retval = _copyRangeSubselect(from); break; case T_RangeFunction: retval = _copyRangeFunction(from); break; case T_RangeTableSample: retval = _copyRangeTableSample(from); break; case T_RangeTableFunc: retval = _copyRangeTableFunc(from); break; case T_RangeTableFuncCol: retval = _copyRangeTableFuncCol(from); break; case T_TypeName: retval = _copyTypeName(from); break; case T_IndexElem: retval = _copyIndexElem(from); break; case T_ColumnDef: retval = _copyColumnDef(from); break; case T_Constraint: retval = _copyConstraint(from); break; case T_DefElem: retval = _copyDefElem(from); break; case T_LockingClause: retval = _copyLockingClause(from); break; case T_RangeTblEntry: retval = _copyRangeTblEntry(from); break; case T_RangeTblFunction: retval = _copyRangeTblFunction(from); break; case T_TableSampleClause: retval = _copyTableSampleClause(from); break; case T_WithCheckOption: retval = _copyWithCheckOption(from); break; case T_SortGroupClause: retval = _copySortGroupClause(from); break; case T_GroupingSet: retval = _copyGroupingSet(from); break; case T_WindowClause: retval = _copyWindowClause(from); break; case T_RowMarkClause: retval = _copyRowMarkClause(from); break; case T_WithClause: retval = _copyWithClause(from); break; case T_InferClause: retval = _copyInferClause(from); break; case T_OnConflictClause: retval = _copyOnConflictClause(from); break; case T_CommonTableExpr: retval = _copyCommonTableExpr(from); break; case T_ObjectWithArgs: retval = _copyObjectWithArgs(from); break; case T_AccessPriv: retval = _copyAccessPriv(from); break; case T_XmlSerialize: retval = _copyXmlSerialize(from); break; case T_RoleSpec: retval = _copyRoleSpec(from); break; case T_TriggerTransition: retval = _copyTriggerTransition(from); break; case T_PartitionElem: retval = _copyPartitionElem(from); break; case T_PartitionSpec: retval = _copyPartitionSpec(from); break; case T_PartitionBoundSpec: retval = _copyPartitionBoundSpec(from); break; case T_PartitionRangeDatum: retval = _copyPartitionRangeDatum(from); break; case T_PartitionCmd: retval = _copyPartitionCmd(from); break; #ifdef NOT_USED_IN_PGPOOL /* * MISCELLANEOUS NODES */ case T_ForeignKeyCacheInfo: retval = _copyForeignKeyCacheInfo(from); break; #endif default: elog(ERROR, "unrecognized node type: %d", (int) nodeTag(from)); retval = 0; /* keep compiler quiet */ break; } return retval; } /* * from src/backend/nodes/bitmapset.c * bms_copy - make a palloc'd copy of a bitmapset */ #define BITMAPSET_SIZE(nwords) \ (offsetof(Bitmapset, words) + (nwords) * sizeof(bitmapword)) Bitmapset * bms_copy(const Bitmapset *a) { Bitmapset *result; size_t size; if (a == NULL) return NULL; size = BITMAPSET_SIZE(a->nwords); result = (Bitmapset *) palloc(size); memcpy(result, a, size); return result; } pgpool-II-4.1.4/src/parser/gram.y0000664000175000017500000154640513730350127013465 00000000000000%{ /*#define YYDEBUG 1*/ /*------------------------------------------------------------------------- * * gram.y * POSTGRESQL BISON rules/actions * * Portions Copyright (c) 2003-2019, PgPool Global Development Group * Portions Copyright (c) 1996-2019, 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 constraint_exclusion 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. * * 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" /* This is a configuration parameter since PostgreSQL 9.5. * We set this false in pgpool-II. This is default in PostgreSQL. */ static bool operator_precedence_warning = false; /* * 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/catalog/pg_attribute.h */ #define ATTRIBUTE_IDENTITY_ALWAYS 'a' #define ATTRIBUTE_IDENTITY_BY_DEFAULT 'd' /* * 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; /* * 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, or whose leftmost * component 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.) * * A cleaner answer would be to make YYLLOC_DEFAULT scan all the Rhs * locations until it's found one that's not -1. Then we'd get a correct * location for any nonterminal that isn't entirely empty. But this way * would add overhead to every rule reduction, and so far there's not been * a compelling reason to pay that overhead. */ /* * 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; ObjectType objtype; List *objs; } PrivTarget; /* Private struct for the result of import_qualification production */ typedef struct ImportQual { ImportForeignSchemaType type; List *table_names; } ImportQual; /* 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 RawStmt *makeRawStmt(Node *stmt, int stmt_location); static void updateRawStmtEnd(RawStmt *rs, int end_location); static Node *makeColumnRef(char *colname, List *indirection, int location, core_yyscan_t yyscanner); static Node *makeStringConst(char *str, 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 RoleSpec *makeRoleSpec(RoleSpecType type, 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 *makeAndExpr(Node *lexpr, Node *rexpr, int location); static Node *makeOrExpr(Node *lexpr, Node *rexpr, int location); static Node *makeNotExpr(Node *expr, int location); static Node *makeAArrayExpr(List *elements, int location); static Node *makeSQLValueFunction(SQLValueFunctionOp op, int32 typmod, 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; ObjectWithArgs *objwithargs; DefElem *defelt; SortBy *sortby; WindowDef *windef; JoinExpr *jexpr; IndexElem *ielem; Alias *alias; RangeVar *range; IntoClause *into; WithClause *with; InferClause *infer; OnConflictClause *onconflict; A_Indices *aind; ResTarget *target; struct PrivTarget *privtarget; AccessPriv *accesspriv; struct ImportQual *importqual; InsertStmt *istmt; VariableSetStmt *vsetstmt; PartitionElem *partelem; PartitionSpec *partspec; PartitionBoundSpec *partboundspec; RoleSpec *rolespec; } %type stmt schema_stmt AlterEventTrigStmt AlterCollationStmt AlterDatabaseStmt AlterDatabaseSetStmt AlterDomainStmt AlterEnumStmt AlterFdwStmt AlterForeignServerStmt AlterGroupStmt AlterObjectDependsStmt AlterObjectSchemaStmt AlterOwnerStmt AlterOperatorStmt AlterSeqStmt AlterSystemStmt AlterTableStmt AlterTblSpcStmt AlterExtensionStmt AlterExtensionContentsStmt AlterForeignTableStmt AlterCompositeTypeStmt AlterUserMappingStmt AlterRoleStmt AlterRoleSetStmt AlterPolicyStmt AlterDefaultPrivilegesStmt DefACLAction AnalyzeStmt CallStmt ClosePortalStmt ClusterStmt CommentStmt ConstraintsSetStmt CopyStmt CreateAsStmt CreateCastStmt CreateDomainStmt CreateExtensionStmt CreateGroupStmt CreateOpClassStmt CreateOpFamilyStmt AlterOpFamilyStmt CreatePLangStmt CreateSchemaStmt CreateSeqStmt CreateStmt CreateStatsStmt CreateTableSpaceStmt CreateFdwStmt CreateForeignServerStmt CreateForeignTableStmt CreateAssertionStmt CreateTransformStmt CreateTrigStmt CreateEventTrigStmt CreateUserStmt CreateUserMappingStmt CreateRoleStmt CreatePolicyStmt CreatedbStmt DeclareCursorStmt DefineStmt DeleteStmt DiscardStmt DoStmt DropOpClassStmt DropOpFamilyStmt DropPLangStmt DropStmt DropCastStmt DropRoleStmt DropdbStmt DropTableSpaceStmt DropTransformStmt DropUserMappingStmt ExplainStmt FetchStmt GrantStmt GrantRoleStmt ImportForeignSchemaStmt 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 CreateAmStmt CreatePublicationStmt AlterPublicationStmt CreateSubscriptionStmt AlterSubscriptionStmt DropSubscriptionStmt %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 partition_cmd index_partition_cmd %type alter_table_cmds alter_type_cmds %type alter_identity_column_option_list %type alter_identity_column_option %type opt_drop_behavior %type createdb_opt_list createdb_opt_items copy_opt_list transaction_mode_list create_extension_opt_list alter_extension_opt_list %type createdb_opt_item copy_opt_item transaction_mode_item create_extension_opt_item alter_extension_opt_item %type opt_lock lock_type cast_context %type vac_analyze_option_name %type vac_analyze_option_elem %type vac_analyze_option_list %type vac_analyze_option_arg %type opt_or_replace opt_grant_grant_option opt_grant_admin_option opt_nowait opt_if_exists opt_with_data opt_transaction_chain %type opt_nowait_or_skip %type OptRoleList AlterOptRoleList %type CreateOptRoleElem AlterOptRoleElem %type opt_type %type foreign_server_version opt_foreign_server_version %type opt_in_database %type OptSchemaName %type OptSchemaEltList %type am_type %type TriggerForSpec TriggerForType %type TriggerActionTime %type TriggerEvents TriggerOneEvent %type TriggerFuncArg %type TriggerWhen %type TransitionRelName %type TransitionRowOrTable TransitionOldOrNew %type TriggerTransition %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 table_access_method_clause 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 insert_target OptConstrFromTable %type all_Op MathOp %type row_security_cmd RowSecurityDefaultForCmd %type RowSecurityDefaultPermissive %type RowSecurityOptionalWithCheck RowSecurityOptionalExpr %type RowSecurityDefaultToRole RowSecurityOptionalToRole %type iso_level opt_encoding %type grantee %type grantee_list %type privilege %type privileges privilege_list %type privilege_target %type function_with_argtypes aggregate_with_argtypes operator_with_argtypes %type function_with_argtypes_list aggregate_with_argtypes_list operator_with_argtypes_list %type defacl_privilege_target %type DefACLOption %type DefACLOptionList %type import_qualification_type %type import_qualification %type vacuum_relation %type stmtblock stmtmulti OptTableElementList TableElementList OptInherit definition OptTypedTableElementList TypedTableElementList reloptions opt_reloptions OptWith distinct_clause opt_all_clause 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 opt_include opt_c_include index_including_params name_list role_list from_clause from_list opt_array_bounds qualified_name_list any_name any_name_list type_name_list any_operator expr_list attrs target_list opt_target_list insert_column_list set_target_list set_clause_list set_clause def_list operator_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 transform_element_list transform_type_list TriggerTransitions TriggerReferencing publication_name_list vacuum_relation_list opt_vacuum_relation_list %type group_by_list %type group_by_item empty_grouping_set rollup_clause cube_clause %type grouping_sets_clause %type opt_publication_for_tables publication_for_tables %type publication_name_item %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 all_or_distinct %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_analyze opt_default opt_recheck %type opt_binary copy_delimiter %type copy_from opt_program %type opt_column event cursor_options opt_hold opt_set_data %type drop_type_any_name drop_type_name drop_type_name_on_any_name comment_type_any_name comment_type_name security_label_type_any_name security_label_type_name %type fetch_args limit_clause select_limit_value offset_clause select_offset_value select_fetch_first_value I_or_F_const %type row_or_rows first_or_next %type OptSeqOptList SeqOptList OptParenthesizedSeqOptList %type SeqOptElem %type insert_rest %type opt_conf_expr %type opt_on_conflict %type generic_set set_rest set_rest_more generic_reset reset_rest SetResetClause FunctionSetResetClause %type TableElement TypedTableElement ConstraintElem TableFuncElement %type columnDef columnOptions %type def_elem reloption_elem old_aggr_elem operator_def_elem %type def_arg columnElem where_clause where_or_current_clause a_expr b_expr c_expr AexprConst indirection_el opt_slice_bound columnref in_expr having_clause func_table xmltable array_expr ExclusionWhereClause operator_def_arg %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 explicit_row implicit_row type_list array_expr_list %type case_expr case_arg when_clause case_default %type when_clause_list %type sub_type opt_materialized %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 tablesample_clause opt_repeatable_clause %type target_el 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 reindex_target_type reindex_target_multitable %type reindex_option_list reindex_option_elem %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_varying opt_timezone opt_no_inherit %type Iconst SignedIconst %type Sconst comment_text notify_payload %type RoleId opt_boolean_or_string %type var_list %type ColId ColLabel var_name type_function_name param_name %type NonReservedWord NonReservedWord_or_Sconst %type createdb_opt_name %type var_value zone_value %type auth_ident RoleSpec opt_granted_by %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 %type 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 xmltable_column_list xmltable_column_option_list %type xmltable_column_el %type xmltable_column_option_el %type xml_namespace_list %type xml_namespace_el %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_window_exclusion_clause %type opt_existing_window_name %type opt_if_not_exists %type generated_when override_kind %type PartitionSpec OptPartitionSpec %type part_strategy %type part_elem %type part_params %type PartitionBoundSpec %type hash_partbound %type hash_partbound_elem /* * 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 EQUALS_GREATER %token LESS_EQUALS GREATER_EQUALS NOT_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 ATTACH ATTRIBUTE AUTHORIZATION BACKWARD BEFORE BEGIN_P BETWEEN BIGINT BINARY BIT BOOLEAN_P BOTH BY CACHE CALL CALLED CASCADE CASCADED CASE CAST CATALOG_P CHAIN CHAR_P CHARACTER CHARACTERISTICS CHECK CHECKPOINT CLASS CLOSE CLUSTER COALESCE COLLATE COLLATION COLUMN COLUMNS COMMENT COMMENTS COMMIT COMMITTED CONCURRENTLY CONFIGURATION CONFLICT CONNECTION CONSTRAINT CONSTRAINTS CONTENT_P CONTINUE_P CONVERSION_P COPY COST CREATE CROSS CSV CUBE 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 DEPENDS DESC DETACH 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 GENERATED GLOBAL GRANT GRANTED GREATEST GROUP_P GROUPING GROUPS HANDLER HAVING HEADER_P HOLD HOUR_P IDENTITY_P IF_P ILIKE IMMEDIATE IMMUTABLE IMPLICIT_P IMPORT_P IN_P INCLUDE 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 LEADING LEAKPROOF LEAST LEFT LEVEL LIKE LIMIT LISTEN LOAD LOCAL LOCALTIME LOCALTIMESTAMP LOCATION LOCK_P LOCKED LOGGED MAPPING MATCH MATERIALIZED MAXVALUE METHOD MINUTE_P MINVALUE MODE MONTH_P MOVE NAME_P NAMES NATIONAL NATURAL NCHAR NEW NEXT NO NONE NOT NOTHING NOTIFY NOTNULL NOWAIT NULL_P NULLIF NULLS_P NUMERIC OBJECT_P OF OFF OFFSET OIDS OLD ON ONLY OPERATOR OPTION OPTIONS OR ORDER ORDINALITY OTHERS OUT_P OUTER_P OVER OVERLAPS OVERLAY OVERRIDING OWNED OWNER PARALLEL PARSER PARTIAL PARTITION PASSING PASSWORD PGPOOL PLACING PLANS POLICY POSITION PRECEDING PRECISION PRESERVE PREPARE PREPARED PRIMARY PRIOR PRIVILEGES PROCEDURAL PROCEDURE PROCEDURES PROGRAM PUBLICATION QUOTE RANGE READ REAL REASSIGN RECHECK RECURSIVE REF REFERENCES REFERENCING REFRESH REINDEX RELATIVE_P RELEASE RENAME REPEATABLE REPLACE REPLICA RESET RESTART RESTRICT RETURNING RETURNS REVOKE RIGHT ROLE ROLLBACK ROLLUP ROUTINE ROUTINES ROW ROWS RULE SAVEPOINT SCHEMA SCHEMAS SCROLL SEARCH SECOND_P SECURITY SELECT SEQUENCE SEQUENCES SERIALIZABLE SERVER SESSION SESSION_USER SET SETS SETOF SHARE SHOW SIMILAR SIMPLE SKIP SMALLINT SNAPSHOT SOME SQL_P STABLE STANDALONE_P START STATEMENT STATISTICS STDIN STDOUT STORAGE STORED STRICT_P STRIP_P SUBSCRIPTION SUBSTRING SUPPORT SYMMETRIC SYSID SYSTEM_P TABLE TABLES TABLESAMPLE TABLESPACE TEMP TEMPLATE TEMPORARY TEXT_P THEN TIES TIME TIMESTAMP TO TRAILING TRANSACTION TRANSFORM 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 XMLNAMESPACES XMLPARSE XMLPI XMLROOT XMLSERIALIZE XMLTABLE 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 (based on looking one token ahead). * * NOT_LA exists so that productions such as NOT LIKE can be given the same * precedence as LIKE; otherwise they'd effectively have the same precedence * as NOT, at least with respect to their left-hand subexpression. * NULLS_LA and WITH_LA are needed to make the grammar LALR(1). */ %token NOT_LA NULLS_LA WITH_LA /* Precedence: lowest to highest */ %nonassoc SET /* see relation_expr_opt_alias */ %left UNION EXCEPT %left INTERSECT %left OR %left AND %right NOT %nonassoc IS ISNULL NOTNULL /* IS sets precedence for IS NULL, etc */ %nonassoc '<' '>' '=' LESS_EQUALS GREATER_EQUALS NOT_EQUALS %nonassoc BETWEEN IN_P LIKE ILIKE SIMILAR NOT_LA %nonassoc ESCAPE /* ESCAPE must be just above LIKE/ILIKE/SIMILAR */ %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, GROUPS to support opt_existing_window_name; * for RANGE, ROWS, GROUPS so that they can follow a_expr without creating * postfix-operator problems; * for GENERATED so that it can follow b_expr; * and for NULL so that it can follow b_expr in ColQualList without creating * postfix-operator problems. * * To support CUBE and ROLLUP in GROUP BY without reserving them, we give them * an explicit priority lower than '(', so that a rule with CUBE '(' will shift * rather than reducing a conflicting rule that takes CUBE as a function name. * Using the same precedence as IDENT seems right for the reasons given above. * * 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 GENERATED NULL_P PARTITION RANGE ROWS GROUPS PRECEDING FOLLOWING CUBE ROLLUP %left Op OPERATOR /* multi-character ops and user-defined operators */ %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; } ; /* * At top level, we wrap each stmt with a RawStmt node carrying start location * and length of the stmt's text. Notice that the start loc/len are driven * entirely from semicolon locations (@2). It would seem natural to use * @1 or @3 to get the true start location of a stmt, but that doesn't work * for statements that can start with empty nonterminals (opt_with_clause is * the main offender here); as noted in the comments for YYLLOC_DEFAULT, * we'd get -1 for the location in such cases. * We also take care to discard empty statements entirely. */ stmtmulti: stmtmulti ';' stmt { if ($1 != NIL) { /* update length of previous stmt */ updateRawStmtEnd(llast_node(RawStmt, $1), @2); } if ($3 != NULL) $$ = lappend($1, makeRawStmt($3, @2 + 1)); else $$ = $1; } | stmt { if ($1 != NULL) $$ = list_make1(makeRawStmt($1, 0)); else $$ = NIL; } ; stmt : AlterEventTrigStmt | AlterCollationStmt | AlterDatabaseStmt | AlterDatabaseSetStmt | AlterDefaultPrivilegesStmt | AlterDomainStmt | AlterEnumStmt | AlterExtensionStmt | AlterExtensionContentsStmt | AlterFdwStmt | AlterForeignServerStmt | AlterForeignTableStmt | AlterFunctionStmt | AlterGroupStmt | AlterObjectDependsStmt | AlterObjectSchemaStmt | AlterOwnerStmt | AlterOperatorStmt | AlterPolicyStmt | AlterSeqStmt | AlterSystemStmt | AlterTableStmt | AlterTblSpcStmt | AlterCompositeTypeStmt | AlterPublicationStmt | AlterRoleSetStmt | AlterRoleStmt | AlterSubscriptionStmt | AlterTSConfigurationStmt | AlterTSDictionaryStmt | AlterUserMappingStmt | AnalyzeStmt | CallStmt | CheckPointStmt | ClosePortalStmt | ClusterStmt | CommentStmt | ConstraintsSetStmt | CopyStmt | CreateAmStmt | CreateAsStmt | CreateAssertionStmt | CreateCastStmt | CreateConversionStmt | CreateDomainStmt | CreateExtensionStmt | CreateFdwStmt | CreateForeignServerStmt | CreateForeignTableStmt | CreateFunctionStmt | CreateGroupStmt | CreateMatViewStmt | CreateOpClassStmt | CreateOpFamilyStmt | CreatePublicationStmt | AlterOpFamilyStmt | CreatePolicyStmt | CreatePLangStmt | CreateSchemaStmt | CreateSeqStmt | CreateStmt | CreateSubscriptionStmt | CreateStatsStmt | CreateTableSpaceStmt | CreateTransformStmt | CreateTrigStmt | CreateEventTrigStmt | CreateRoleStmt | CreateUserStmt | CreateUserMappingStmt | CreatedbStmt | DeallocateStmt | DeclareCursorStmt | DefineStmt | DeleteStmt | DiscardStmt | DoStmt | DropCastStmt | DropOpClassStmt | DropOpFamilyStmt | DropOwnedStmt | DropPLangStmt | DropStmt | DropSubscriptionStmt | DropTableSpaceStmt | DropTransformStmt | DropRoleStmt | DropUserMappingStmt | DropdbStmt | ExecuteStmt | ExplainStmt | FetchStmt | GrantStmt | GrantRoleStmt | ImportForeignSchemaStmt | 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; } ; /***************************************************************************** * * CALL statement * *****************************************************************************/ CallStmt: CALL func_application { CallStmt *n = makeNode(CallStmt); n->funccall = castNode(FuncCall, $2); $$ = (Node *)n; } ; /***************************************************************************** * * 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 {} | WITH_LA {} | /*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), @1); } | PASSWORD NULL_P { $$ = makeDefElem("password", NULL, @1); } | ENCRYPTED PASSWORD Sconst { /* * These days, passwords are always stored in encrypted * form, so there is no difference between PASSWORD and * ENCRYPTED PASSWORD. */ $$ = makeDefElem("password", (Node *)makeString($3), @1); } | UNENCRYPTED PASSWORD Sconst { ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), errmsg("UNENCRYPTED PASSWORD is no longer supported"), errhint("Remove UNENCRYPTED to store the password in encrypted form instead."), parser_errposition(@1))); } | INHERIT { $$ = makeDefElem("inherit", (Node *)makeInteger(true), @1); } | CONNECTION LIMIT SignedIconst { $$ = makeDefElem("connectionlimit", (Node *)makeInteger($3), @1); } | VALID UNTIL Sconst { $$ = makeDefElem("validUntil", (Node *)makeString($3), @1); } /* Supported but not documented for roles, for use by ALTER GROUP. */ | USER role_list { $$ = makeDefElem("rolemembers", (Node *)$2, @1); } | 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), @1); else if (strcmp($1, "nosuperuser") == 0) $$ = makeDefElem("superuser", (Node *)makeInteger(false), @1); else if (strcmp($1, "createrole") == 0) $$ = makeDefElem("createrole", (Node *)makeInteger(true), @1); else if (strcmp($1, "nocreaterole") == 0) $$ = makeDefElem("createrole", (Node *)makeInteger(false), @1); else if (strcmp($1, "replication") == 0) $$ = makeDefElem("isreplication", (Node *)makeInteger(true), @1); else if (strcmp($1, "noreplication") == 0) $$ = makeDefElem("isreplication", (Node *)makeInteger(false), @1); else if (strcmp($1, "createdb") == 0) $$ = makeDefElem("createdb", (Node *)makeInteger(true), @1); else if (strcmp($1, "nocreatedb") == 0) $$ = makeDefElem("createdb", (Node *)makeInteger(false), @1); else if (strcmp($1, "login") == 0) $$ = makeDefElem("canlogin", (Node *)makeInteger(true), @1); else if (strcmp($1, "nologin") == 0) $$ = makeDefElem("canlogin", (Node *)makeInteger(false), @1); else if (strcmp($1, "bypassrls") == 0) $$ = makeDefElem("bypassrls", (Node *)makeInteger(true), @1); else if (strcmp($1, "nobypassrls") == 0) $$ = makeDefElem("bypassrls", (Node *)makeInteger(false), @1); 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), @1); } 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), @1); } | ADMIN role_list { $$ = makeDefElem("adminmembers", (Node *)$2, @1); } | ROLE role_list { $$ = makeDefElem("rolemembers", (Node *)$2, @1); } | IN_P ROLE role_list { $$ = makeDefElem("addroleto", (Node *)$3, @1); } | IN_P GROUP_P role_list { $$ = makeDefElem("addroleto", (Node *)$3, @1); } ; /***************************************************************************** * * 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 RoleSpec opt_with AlterOptRoleList { AlterRoleStmt *n = makeNode(AlterRoleStmt); n->role = $3; n->action = +1; /* add, if there are members */ n->options = $5; $$ = (Node *)n; } | ALTER USER RoleSpec 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 RoleSpec 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 USER RoleSpec opt_in_database SetResetClause { AlterRoleSetStmt *n = makeNode(AlterRoleSetStmt); n->role = $3; n->database = $4; n->setstmt = $5; $$ = (Node *)n; } | ALTER USER ALL opt_in_database SetResetClause { AlterRoleSetStmt *n = makeNode(AlterRoleSetStmt); n->role = NULL; n->database = $4; n->setstmt = $5; $$ = (Node *)n; } ; /***************************************************************************** * * Drop a postgresql DBMS role * * XXX Ideally this would have CASCADE/RESTRICT options, but a role * might own objects in multiple databases, and there is presently no way to * implement cascading to other databases. So we always behave as RESTRICT. *****************************************************************************/ 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 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; } | 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; } ; /***************************************************************************** * * 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 RoleSpec add_drop USER role_list { AlterRoleStmt *n = makeNode(AlterRoleStmt); n->role = $3; n->action = $4; n->options = list_make1(makeDefElem("rolemembers", (Node *)$6, @6)); $$ = (Node *)n; } ; add_drop: ADD_P { $$ = +1; } | DROP { $$ = -1; } ; /***************************************************************************** * * Manipulate a schema * *****************************************************************************/ CreateSchemaStmt: CREATE SCHEMA OptSchemaName AUTHORIZATION RoleSpec OptSchemaEltList { CreateSchemaStmt *n = makeNode(CreateSchemaStmt); /* One can omit the schema name or the authorization id. */ n->schemaname = $3; n->authrole = $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->authrole = NULL; n->schemaElts = $4; n->if_not_exists = false; $$ = (Node *)n; } | CREATE SCHEMA IF_P NOT EXISTS OptSchemaName AUTHORIZATION RoleSpec OptSchemaEltList { CreateSchemaStmt *n = makeNode(CreateSchemaStmt); /* schema name can be omitted here, too */ n->schemaname = $6; n->authrole = $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 here */ n->schemaname = $6; n->authrole = 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: PGPOOL SET generic_set { VariableSetStmt *n = $3; n->type = T_PgpoolVariableSetStmt; /* Hack to keep changes minumum */ n->is_local = false; $$ = (Node *) n; } | 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 { TypeName *t = $1; 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 reset_rest { $$ = (Node *) $2; } | PGPOOL RESET generic_reset { VariableSetStmt *n = $3; n->type = T_PgpoolVariableSetStmt; /* Hack to keep the changes minumum */ $$ = (Node *) n; } ; reset_rest: generic_reset { $$ = $1; } | TIME ZONE { VariableSetStmt *n = makeNode(VariableSetStmt); n->kind = VAR_RESET; n->name = "timezone"; $$ = n; } | TRANSACTION ISOLATION LEVEL { VariableSetStmt *n = makeNode(VariableSetStmt); n->kind = VAR_RESET; n->name = "transaction_isolation"; $$ = n; } | SESSION AUTHORIZATION { VariableSetStmt *n = makeNode(VariableSetStmt); n->kind = VAR_RESET; n->name = "session_authorization"; $$ = n; } ; generic_reset: var_name { VariableSetStmt *n = makeNode(VariableSetStmt); n->kind = VAR_RESET; n->name = $1; $$ = n; } | ALL { VariableSetStmt *n = makeNode(VariableSetStmt); n->kind = VAR_RESET_ALL; $$ = 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: /* pgpool extension */ PGPOOL SHOW var_name { VariableShowStmt *n = (VariableShowStmt *)newNode(sizeof(VariableShowStmt),T_PgpoolVariableShowStmt); n->name = $3; $$ = (Node *) n; } | PGPOOL SHOW ALL { VariableShowStmt *n = (VariableShowStmt *)newNode(sizeof(VariableShowStmt),T_PgpoolVariableShowStmt); n->name = "all"; $$ = (Node *) n; } | 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 TABLE relation_expr partition_cmd { AlterTableStmt *n = makeNode(AlterTableStmt); n->relation = $3; n->cmds = list_make1($4); n->relkind = OBJECT_TABLE; n->missing_ok = false; $$ = (Node *)n; } | ALTER TABLE IF_P EXISTS relation_expr partition_cmd { AlterTableStmt *n = makeNode(AlterTableStmt); n->relation = $5; n->cmds = list_make1($6); n->relkind = OBJECT_TABLE; n->missing_ok = true; $$ = (Node *)n; } | ALTER TABLE ALL IN_P TABLESPACE name SET TABLESPACE name opt_nowait { AlterTableMoveAllStmt *n = makeNode(AlterTableMoveAllStmt); n->orig_tablespacename = $6; n->objtype = OBJECT_TABLE; n->roles = NIL; n->new_tablespacename = $9; n->nowait = $10; $$ = (Node *)n; } | ALTER TABLE ALL IN_P TABLESPACE name OWNED BY role_list SET TABLESPACE name opt_nowait { AlterTableMoveAllStmt *n = makeNode(AlterTableMoveAllStmt); n->orig_tablespacename = $6; n->objtype = OBJECT_TABLE; n->roles = $9; n->new_tablespacename = $12; n->nowait = $13; $$ = (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 INDEX qualified_name index_partition_cmd { AlterTableStmt *n = makeNode(AlterTableStmt); n->relation = $3; n->cmds = list_make1($4); n->relkind = OBJECT_INDEX; n->missing_ok = false; $$ = (Node *)n; } | ALTER INDEX ALL IN_P TABLESPACE name SET TABLESPACE name opt_nowait { AlterTableMoveAllStmt *n = makeNode(AlterTableMoveAllStmt); n->orig_tablespacename = $6; n->objtype = OBJECT_INDEX; n->roles = NIL; n->new_tablespacename = $9; n->nowait = $10; $$ = (Node *)n; } | ALTER INDEX ALL IN_P TABLESPACE name OWNED BY role_list SET TABLESPACE name opt_nowait { AlterTableMoveAllStmt *n = makeNode(AlterTableMoveAllStmt); n->orig_tablespacename = $6; n->objtype = OBJECT_INDEX; n->roles = $9; n->new_tablespacename = $12; n->nowait = $13; $$ = (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 MATERIALIZED VIEW ALL IN_P TABLESPACE name SET TABLESPACE name opt_nowait { AlterTableMoveAllStmt *n = makeNode(AlterTableMoveAllStmt); n->orig_tablespacename = $7; n->objtype = OBJECT_MATVIEW; n->roles = NIL; n->new_tablespacename = $10; n->nowait = $11; $$ = (Node *)n; } | ALTER MATERIALIZED VIEW ALL IN_P TABLESPACE name OWNED BY role_list SET TABLESPACE name opt_nowait { AlterTableMoveAllStmt *n = makeNode(AlterTableMoveAllStmt); n->orig_tablespacename = $7; n->objtype = OBJECT_MATVIEW; n->roles = $10; n->new_tablespacename = $13; n->nowait = $14; $$ = (Node *)n; } ; alter_table_cmds: alter_table_cmd { $$ = list_make1($1); } | alter_table_cmds ',' alter_table_cmd { $$ = lappend($1, $3); } ; partition_cmd: /* ALTER TABLE ATTACH PARTITION FOR VALUES */ ATTACH PARTITION qualified_name PartitionBoundSpec { AlterTableCmd *n = makeNode(AlterTableCmd); PartitionCmd *cmd = makeNode(PartitionCmd); n->subtype = AT_AttachPartition; cmd->name = $3; cmd->bound = $4; n->def = (Node *) cmd; $$ = (Node *) n; } /* ALTER TABLE DETACH PARTITION */ | DETACH PARTITION qualified_name { AlterTableCmd *n = makeNode(AlterTableCmd); PartitionCmd *cmd = makeNode(PartitionCmd); n->subtype = AT_DetachPartition; cmd->name = $3; cmd->bound = NULL; n->def = (Node *) cmd; $$ = (Node *) n; } ; index_partition_cmd: /* ALTER INDEX ATTACH PARTITION */ ATTACH PARTITION qualified_name { AlterTableCmd *n = makeNode(AlterTableCmd); PartitionCmd *cmd = makeNode(PartitionCmd); n->subtype = AT_AttachPartition; cmd->name = $3; cmd->bound = NULL; n->def = (Node *) cmd; $$ = (Node *) n; } ; alter_table_cmd: /* ALTER TABLE ADD */ ADD_P columnDef { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_AddColumn; n->def = $2; n->missing_ok = false; $$ = (Node *)n; } /* ALTER TABLE ADD IF NOT EXISTS */ | ADD_P IF_P NOT EXISTS columnDef { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_AddColumn; n->def = $5; n->missing_ok = true; $$ = (Node *)n; } /* ALTER TABLE ADD COLUMN */ | ADD_P COLUMN columnDef { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_AddColumn; n->def = $3; n->missing_ok = false; $$ = (Node *)n; } /* ALTER TABLE ADD COLUMN IF NOT EXISTS */ | ADD_P COLUMN IF_P NOT EXISTS columnDef { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_AddColumn; n->def = $6; n->missing_ok = true; $$ = (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 STATISTICS */ | ALTER opt_column Iconst SET STATISTICS SignedIconst { AlterTableCmd *n = makeNode(AlterTableCmd); if ($3 <= 0 || $3 > PG_INT16_MAX) ereport(ERROR, (errcode(ERRCODE_INVALID_PARAMETER_VALUE), errmsg("column number must be in range from 1 to %d", PG_INT16_MAX), parser_errposition(@3))); n->subtype = AT_SetStatistics; n->num = (int16) $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] RESET ( 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 ALTER [COLUMN] ADD GENERATED ... AS IDENTITY ... */ | ALTER opt_column ColId ADD_P GENERATED generated_when AS IDENTITY_P OptParenthesizedSeqOptList { AlterTableCmd *n = makeNode(AlterTableCmd); Constraint *c = makeNode(Constraint); c->contype = CONSTR_IDENTITY; c->generated_when = $6; c->options = $9; c->location = @5; n->subtype = AT_AddIdentity; n->name = $3; n->def = (Node *) c; $$ = (Node *)n; } /* ALTER TABLE ALTER [COLUMN] SET /RESET */ | ALTER opt_column ColId alter_identity_column_option_list { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_SetIdentity; n->name = $3; n->def = (Node *) $4; $$ = (Node *)n; } /* ALTER TABLE ALTER [COLUMN] DROP IDENTITY */ | ALTER opt_column ColId DROP IDENTITY_P { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_DropIdentity; n->name = $3; n->missing_ok = false; $$ = (Node *)n; } /* ALTER TABLE ALTER [COLUMN] DROP IDENTITY IF EXISTS */ | ALTER opt_column ColId DROP IDENTITY_P IF_P EXISTS { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_DropIdentity; n->name = $3; n->missing_ok = true; $$ = (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; n->missing_ok = false; $$ = (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 WITHOUT OIDS, for backward compat */ | 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 SET LOGGED */ | SET LOGGED { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_SetLogged; $$ = (Node *)n; } /* ALTER TABLE SET UNLOGGED */ | SET UNLOGGED { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_SetUnLogged; $$ = (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 RoleSpec */ | OWNER TO RoleSpec { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_ChangeOwner; n->newowner = $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 TABLE ENABLE ROW LEVEL SECURITY */ | ENABLE_P ROW LEVEL SECURITY { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_EnableRowSecurity; $$ = (Node *)n; } /* ALTER TABLE DISABLE ROW LEVEL SECURITY */ | DISABLE_P ROW LEVEL SECURITY { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_DisableRowSecurity; $$ = (Node *)n; } /* ALTER TABLE FORCE ROW LEVEL SECURITY */ | FORCE ROW LEVEL SECURITY { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_ForceRowSecurity; $$ = (Node *)n; } /* ALTER TABLE NO FORCE ROW LEVEL SECURITY */ | NO FORCE ROW LEVEL SECURITY { AlterTableCmd *n = makeNode(AlterTableCmd); n->subtype = AT_NoForceRowSecurity; $$ = (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, @1); } | ColLabel { $$ = makeDefElem($1, NULL, @1); } | ColLabel '.' ColLabel '=' def_arg { $$ = makeDefElemExtended($1, $3, (Node *) $5, DEFELEM_UNSPEC, @1); } | ColLabel '.' ColLabel { $$ = makeDefElemExtended($1, $3, NULL, DEFELEM_UNSPEC, @1); } ; alter_identity_column_option_list: alter_identity_column_option { $$ = list_make1($1); } | alter_identity_column_option_list alter_identity_column_option { $$ = lappend($1, $2); } ; alter_identity_column_option: RESTART { $$ = makeDefElem("restart", NULL, @1); } | RESTART opt_with NumericOnly { $$ = makeDefElem("restart", (Node *)$3, @1); } | SET SeqOptElem { if (strcmp($2->defname, "as") == 0 || strcmp($2->defname, "restart") == 0 || strcmp($2->defname, "owned_by") == 0) ereport(ERROR, (errcode(ERRCODE_SYNTAX_ERROR), errmsg("sequence option \"%s\" not supported here", $2->defname), parser_errposition(@2))); $$ = $2; } | SET GENERATED generated_when { $$ = makeDefElem("generated", (Node *) makeInteger($3), @1); } ; PartitionBoundSpec: /* a HASH partition */ FOR VALUES WITH '(' hash_partbound ')' { ListCell *lc; PartitionBoundSpec *n = makeNode(PartitionBoundSpec); n->strategy = PARTITION_STRATEGY_HASH; n->modulus = n->remainder = -1; foreach (lc, $5) { DefElem *opt = lfirst_node(DefElem, lc); if (strcmp(opt->defname, "modulus") == 0) { if (n->modulus != -1) ereport(ERROR, (errcode(ERRCODE_DUPLICATE_OBJECT), errmsg("modulus for hash partition provided more than once"), parser_errposition(opt->location))); n->modulus = defGetInt32(opt); } else if (strcmp(opt->defname, "remainder") == 0) { if (n->remainder != -1) ereport(ERROR, (errcode(ERRCODE_DUPLICATE_OBJECT), errmsg("remainder for hash partition provided more than once"), parser_errposition(opt->location))); n->remainder = defGetInt32(opt); } else ereport(ERROR, (errcode(ERRCODE_SYNTAX_ERROR), errmsg("unrecognized hash partition bound specification \"%s\"", opt->defname), parser_errposition(opt->location))); } if (n->modulus == -1) ereport(ERROR, (errcode(ERRCODE_SYNTAX_ERROR), errmsg("modulus for hash partition must be specified"))); if (n->remainder == -1) ereport(ERROR, (errcode(ERRCODE_SYNTAX_ERROR), errmsg("remainder for hash partition must be specified"))); n->location = @3; $$ = n; } /* a LIST partition */ | FOR VALUES IN_P '(' expr_list ')' { PartitionBoundSpec *n = makeNode(PartitionBoundSpec); n->strategy = PARTITION_STRATEGY_LIST; n->is_default = false; n->listdatums = $5; n->location = @3; $$ = n; } /* a RANGE partition */ | FOR VALUES FROM '(' expr_list ')' TO '(' expr_list ')' { PartitionBoundSpec *n = makeNode(PartitionBoundSpec); n->strategy = PARTITION_STRATEGY_RANGE; n->is_default = false; n->lowerdatums = $5; n->upperdatums = $9; n->location = @3; $$ = n; } /* a DEFAULT partition */ | DEFAULT { PartitionBoundSpec *n = makeNode(PartitionBoundSpec); n->is_default = true; n->location = @1; $$ = n; } ; hash_partbound_elem: NonReservedWord Iconst { $$ = makeDefElem($1, (Node *)makeInteger($2), @1); } ; hash_partbound: hash_partbound_elem { $$ = list_make1($1); } | hash_partbound ',' hash_partbound_elem { $$ = lappend($1, $3); } ; /***************************************************************************** * * 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 ( query ) TO file [WITH] [(options)] * * where 'query' can be one of: * { SELECT | UPDATE | INSERT | DELETE } * * and '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 FROM/TO file * [ [ USING ] DELIMITERS 'delimiter' ] ] * [ WITH NULL AS 'null string' ] * This option placement is not supported with COPY (query...). * *****************************************************************************/ CopyStmt: COPY opt_binary qualified_name opt_column_list copy_from opt_program copy_file_name copy_delimiter opt_with copy_options where_clause { CopyStmt *n = makeNode(CopyStmt); n->relation = $3; n->query = NULL; n->attlist = $4; n->is_from = $5; n->is_program = $6; n->filename = $7; n->whereClause = $11; if (n->is_program && n->filename == NULL) ereport(ERROR, (errcode(ERRCODE_SYNTAX_ERROR), errmsg("STDIN/STDOUT not allowed with PROGRAM"), parser_errposition(@8))); if (!n->is_from && n->whereClause != NULL) ereport(ERROR, (errcode(ERRCODE_SYNTAX_ERROR), errmsg("WHERE clause not allowed with COPY TO"), parser_errposition(@11))); n->options = NIL; /* Concatenate user-supplied flags */ if ($2) n->options = lappend(n->options, $2); if ($8) n->options = lappend(n->options, $8); if ($10) n->options = list_concat(n->options, $10); $$ = (Node *)n; } | COPY '(' PreparableStmt ')' TO opt_program copy_file_name opt_with copy_options { CopyStmt *n = makeNode(CopyStmt); n->relation = NULL; n->query = $3; n->attlist = NIL; n->is_from = false; n->is_program = $6; n->filename = $7; n->options = $9; 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"), @1); } | FREEZE { $$ = makeDefElem("freeze", (Node *)makeInteger(true), @1); } | DELIMITER opt_as Sconst { $$ = makeDefElem("delimiter", (Node *)makeString($3), @1); } | NULL_P opt_as Sconst { $$ = makeDefElem("null", (Node *)makeString($3), @1); } | CSV { $$ = makeDefElem("format", (Node *)makeString("csv"), @1); } | HEADER_P { $$ = makeDefElem("header", (Node *)makeInteger(true), @1); } | QUOTE opt_as Sconst { $$ = makeDefElem("quote", (Node *)makeString($3), @1); } | ESCAPE opt_as Sconst { $$ = makeDefElem("escape", (Node *)makeString($3), @1); } | FORCE QUOTE columnList { $$ = makeDefElem("force_quote", (Node *)$3, @1); } | FORCE QUOTE '*' { $$ = makeDefElem("force_quote", (Node *)makeNode(A_Star), @1); } | FORCE NOT NULL_P columnList { $$ = makeDefElem("force_not_null", (Node *)$4, @1); } | FORCE NULL_P columnList { $$ = makeDefElem("force_null", (Node *)$3, @1); } | ENCODING Sconst { $$ = makeDefElem("encoding", (Node *)makeString($2), @1); } ; /* The following exist for backward compatibility with very old versions */ opt_binary: BINARY { $$ = makeDefElem("format", (Node *)makeString("binary"), @1); } | /*EMPTY*/ { $$ = NULL; } ; copy_delimiter: opt_using DELIMITERS Sconst { $$ = makeDefElem("delimiter", (Node *)makeString($3), @2); } | /*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, @1); } ; 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 OptPartitionSpec table_access_method_clause OptWith OnCommitOption OptTableSpace { CreateStmt *n = makeNode(CreateStmt); $4->relpersistence = $2; n->relation = $4; n->tableElts = $6; n->inhRelations = $8; n->partspec = $9; n->ofTypename = NULL; n->constraints = NIL; n->accessMethod = $10; n->options = $11; n->oncommit = $12; n->tablespacename = $13; n->if_not_exists = false; $$ = (Node *)n; } | CREATE OptTemp TABLE IF_P NOT EXISTS qualified_name '(' OptTableElementList ')' OptInherit OptPartitionSpec table_access_method_clause OptWith OnCommitOption OptTableSpace { CreateStmt *n = makeNode(CreateStmt); $7->relpersistence = $2; n->relation = $7; n->tableElts = $9; n->inhRelations = $11; n->partspec = $12; n->ofTypename = NULL; n->constraints = NIL; n->accessMethod = $13; n->options = $14; n->oncommit = $15; n->tablespacename = $16; n->if_not_exists = true; $$ = (Node *)n; } | CREATE OptTemp TABLE qualified_name OF any_name OptTypedTableElementList OptPartitionSpec table_access_method_clause OptWith OnCommitOption OptTableSpace { CreateStmt *n = makeNode(CreateStmt); $4->relpersistence = $2; n->relation = $4; n->tableElts = $7; n->inhRelations = NIL; n->partspec = $8; n->ofTypename = makeTypeNameFromNameList($6); n->ofTypename->location = @6; n->constraints = NIL; n->accessMethod = $9; n->options = $10; n->oncommit = $11; n->tablespacename = $12; n->if_not_exists = false; $$ = (Node *)n; } | CREATE OptTemp TABLE IF_P NOT EXISTS qualified_name OF any_name OptTypedTableElementList OptPartitionSpec table_access_method_clause OptWith OnCommitOption OptTableSpace { CreateStmt *n = makeNode(CreateStmt); $7->relpersistence = $2; n->relation = $7; n->tableElts = $10; n->inhRelations = NIL; n->partspec = $11; n->ofTypename = makeTypeNameFromNameList($9); n->ofTypename->location = @9; n->constraints = NIL; n->accessMethod = $12; n->options = $13; n->oncommit = $14; n->tablespacename = $15; n->if_not_exists = true; $$ = (Node *)n; } | CREATE OptTemp TABLE qualified_name PARTITION OF qualified_name OptTypedTableElementList PartitionBoundSpec OptPartitionSpec table_access_method_clause OptWith OnCommitOption OptTableSpace { CreateStmt *n = makeNode(CreateStmt); $4->relpersistence = $2; n->relation = $4; n->tableElts = $8; n->inhRelations = list_make1($7); n->partbound = $9; n->partspec = $10; n->ofTypename = NULL; n->constraints = NIL; n->accessMethod = $11; n->options = $12; n->oncommit = $13; n->tablespacename = $14; n->if_not_exists = false; $$ = (Node *)n; } | CREATE OptTemp TABLE IF_P NOT EXISTS qualified_name PARTITION OF qualified_name OptTypedTableElementList PartitionBoundSpec OptPartitionSpec table_access_method_clause OptWith OnCommitOption OptTableSpace { CreateStmt *n = makeNode(CreateStmt); $7->relpersistence = $2; n->relation = $7; n->tableElts = $11; n->inhRelations = list_make1($10); n->partbound = $12; n->partspec = $13; n->ofTypename = NULL; n->constraints = NIL; n->accessMethod = $14; n->options = $15; n->oncommit = $16; n->tablespacename = $17; 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 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($2, &n->constraints, &n->collClause, yyscanner); n->location = @1; $$ = (Node *)n; } | 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 = castNode(Constraint, $3); 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; n->skip_validation = false; n->initially_valid = true; $$ = (Node *)n; } | DEFAULT b_expr { Constraint *n = makeNode(Constraint); n->contype = CONSTR_DEFAULT; n->location = @1; n->raw_expr = $2; n->cooked_expr = NULL; n->skip_validation = false; n->initially_valid = true; $$ = (Node *)n; } | GENERATED generated_when AS IDENTITY_P OptParenthesizedSeqOptList { Constraint *n = makeNode(Constraint); n->contype = CONSTR_IDENTITY; n->generated_when = $2; n->options = $5; n->location = @1; $$ = (Node *)n; } | GENERATED generated_when AS '(' a_expr ')' STORED { Constraint *n = makeNode(Constraint); n->contype = CONSTR_GENERATED; n->generated_when = $2; n->raw_expr = $5; n->cooked_expr = NULL; n->location = @1; /* * Can't do this in the grammar because of shift/reduce * conflicts. (IDENTITY allows both ALWAYS and BY * DEFAULT, but generated columns only allow ALWAYS.) We * can also give a more useful error message and location. */ if ($2 != ATTRIBUTE_IDENTITY_ALWAYS) ereport(ERROR, (errcode(ERRCODE_SYNTAX_ERROR), errmsg("for a generated column, GENERATED ALWAYS must be specified"), parser_errposition(@2))); $$ = (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; } ; generated_when: ALWAYS { $$ = ATTRIBUTE_IDENTITY_ALWAYS; } | BY DEFAULT { $$ = ATTRIBUTE_IDENTITY_BY_DEFAULT; } ; /* * 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: COMMENTS { $$ = CREATE_TABLE_LIKE_COMMENTS; } | CONSTRAINTS { $$ = CREATE_TABLE_LIKE_CONSTRAINTS; } | DEFAULTS { $$ = CREATE_TABLE_LIKE_DEFAULTS; } | IDENTITY_P { $$ = CREATE_TABLE_LIKE_IDENTITY; } | GENERATED { $$ = CREATE_TABLE_LIKE_GENERATED; } | INDEXES { $$ = CREATE_TABLE_LIKE_INDEXES; } | STATISTICS { $$ = CREATE_TABLE_LIKE_STATISTICS; } | STORAGE { $$ = CREATE_TABLE_LIKE_STORAGE; } | 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 = castNode(Constraint, $3); 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_c_include opt_definition OptConsTableSpace ConstraintAttributeSpec { Constraint *n = makeNode(Constraint); n->contype = CONSTR_UNIQUE; n->location = @1; n->keys = $3; n->including = $5; n->options = $6; n->indexname = NULL; n->indexspace = $7; processCASbits($8, @8, "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->including = 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_c_include opt_definition OptConsTableSpace ConstraintAttributeSpec { Constraint *n = makeNode(Constraint); n->contype = CONSTR_PRIMARY; n->location = @1; n->keys = $4; n->including = $6; n->options = $7; n->indexname = NULL; n->indexspace = $8; processCASbits($9, @9, "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->including = 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_c_include opt_definition OptConsTableSpace ExclusionWhereClause ConstraintAttributeSpec { Constraint *n = makeNode(Constraint); n->contype = CONSTR_EXCLUSION; n->location = @1; n->access_method = $2; n->exclusions = $4; n->including = $6; n->options = $7; n->indexname = NULL; n->indexspace = $8; n->where_clause = $9; processCASbits($10, @10, "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); } ; opt_c_include: INCLUDE '(' columnList ')' { $$ = $3; } | /* EMPTY */ { $$ = NIL; } ; 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; } ; /* Optional partition key specification */ OptPartitionSpec: PartitionSpec { $$ = $1; } | /*EMPTY*/ { $$ = NULL; } ; PartitionSpec: PARTITION BY part_strategy '(' part_params ')' { PartitionSpec *n = makeNode(PartitionSpec); n->strategy = $3; n->partParams = $5; n->location = @1; $$ = n; } ; part_strategy: IDENT { $$ = $1; } | unreserved_keyword { $$ = pstrdup($1); } ; part_params: part_elem { $$ = list_make1($1); } | part_params ',' part_elem { $$ = lappend($1, $3); } ; part_elem: ColId opt_collate opt_class { PartitionElem *n = makeNode(PartitionElem); n->name = $1; n->expr = NULL; n->collation = $2; n->opclass = $3; n->location = @1; $$ = n; } | func_expr_windowless opt_collate opt_class { PartitionElem *n = makeNode(PartitionElem); n->name = NULL; n->expr = $1; n->collation = $2; n->opclass = $3; n->location = @1; $$ = n; } | '(' a_expr ')' opt_collate opt_class { PartitionElem *n = makeNode(PartitionElem); n->name = NULL; n->expr = $2; n->collation = $4; n->opclass = $5; n->location = @1; $$ = n; } ; table_access_method_clause: USING access_method { $$ = $2; } | /*EMPTY*/ { $$ = NULL; } ; /* WITHOUT OIDS is legacy only */ OptWith: WITH reloptions { $$ = $2; } | WITHOUT OIDS { $$ = NIL; } | /*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 STATISTICS [IF NOT EXISTS] stats_name [(stat types)] * ON expression-list FROM from_list * * Note: the expectation here is that the clauses after ON are a subset of * SELECT syntax, allowing for expressions and joined tables, and probably * someday a WHERE clause. Much less than that is currently implemented, * but the grammar accepts it and then we'll throw FEATURE_NOT_SUPPORTED * errors as necessary at execution. * *****************************************************************************/ CreateStatsStmt: CREATE STATISTICS any_name opt_name_list ON expr_list FROM from_list { CreateStatsStmt *n = makeNode(CreateStatsStmt); n->defnames = $3; n->stat_types = $4; n->exprs = $6; n->relations = $8; n->stxcomment = NULL; n->if_not_exists = false; $$ = (Node *)n; } | CREATE STATISTICS IF_P NOT EXISTS any_name opt_name_list ON expr_list FROM from_list { CreateStatsStmt *n = makeNode(CreateStatsStmt); n->defnames = $6; n->stat_types = $7; n->exprs = $9; n->relations = $11; n->stxcomment = NULL; n->if_not_exists = true; $$ = (Node *)n; } ; /***************************************************************************** * * 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; ctas->if_not_exists = false; /* cram additional flags into the IntoClause */ $4->rel->relpersistence = $2; $4->skipData = !($7); $$ = (Node *) ctas; } | CREATE OptTemp TABLE IF_P NOT EXISTS create_as_target AS SelectStmt opt_with_data { CreateTableAsStmt *ctas = makeNode(CreateTableAsStmt); ctas->query = $9; ctas->into = $7; ctas->relkind = OBJECT_TABLE; ctas->is_select_into = false; ctas->if_not_exists = true; /* cram additional flags into the IntoClause */ $7->rel->relpersistence = $2; $7->skipData = !($10); $$ = (Node *) ctas; } ; create_as_target: qualified_name opt_column_list table_access_method_clause OptWith OnCommitOption OptTableSpace { $$ = makeNode(IntoClause); $$->rel = $1; $$->colNames = $2; $$->accessMethod = $3; $$->options = $4; $$->onCommit = $5; $$->tableSpaceName = $6; $$->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; ctas->if_not_exists = false; /* cram additional flags into the IntoClause */ $5->rel->relpersistence = $2; $5->skipData = !($8); $$ = (Node *) ctas; } | CREATE OptNoLog MATERIALIZED VIEW IF_P NOT EXISTS create_mv_target AS SelectStmt opt_with_data { CreateTableAsStmt *ctas = makeNode(CreateTableAsStmt); ctas->query = $10; ctas->into = $8; ctas->relkind = OBJECT_MATVIEW; ctas->is_select_into = false; ctas->if_not_exists = true; /* cram additional flags into the IntoClause */ $8->rel->relpersistence = $2; $8->skipData = !($11); $$ = (Node *) ctas; } ; create_mv_target: qualified_name opt_column_list table_access_method_clause opt_reloptions OptTableSpace { $$ = makeNode(IntoClause); $$->rel = $1; $$->colNames = $2; $$->accessMethod = $3; $$->options = $4; $$->onCommit = ONCOMMIT_NOOP; $$->tableSpaceName = $5; $$->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; n->if_not_exists = false; $$ = (Node *)n; } | CREATE OptTemp SEQUENCE IF_P NOT EXISTS qualified_name OptSeqOptList { CreateSeqStmt *n = makeNode(CreateSeqStmt); $7->relpersistence = $2; n->sequence = $7; n->options = $8; n->ownerId = InvalidOid; n->if_not_exists = true; $$ = (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; } ; OptParenthesizedSeqOptList: '(' SeqOptList ')' { $$ = $2; } | /*EMPTY*/ { $$ = NIL; } ; SeqOptList: SeqOptElem { $$ = list_make1($1); } | SeqOptList SeqOptElem { $$ = lappend($1, $2); } ; SeqOptElem: AS SimpleTypename { $$ = makeDefElem("as", (Node *)$2, @1); } | CACHE NumericOnly { $$ = makeDefElem("cache", (Node *)$2, @1); } | CYCLE { $$ = makeDefElem("cycle", (Node *)makeInteger(true), @1); } | NO CYCLE { $$ = makeDefElem("cycle", (Node *)makeInteger(false), @1); } | INCREMENT opt_by NumericOnly { $$ = makeDefElem("increment", (Node *)$3, @1); } | MAXVALUE NumericOnly { $$ = makeDefElem("maxvalue", (Node *)$2, @1); } | MINVALUE NumericOnly { $$ = makeDefElem("minvalue", (Node *)$2, @1); } | NO MAXVALUE { $$ = makeDefElem("maxvalue", NULL, @1); } | NO MINVALUE { $$ = makeDefElem("minvalue", NULL, @1); } | OWNED BY any_name { $$ = makeDefElem("owned_by", (Node *)$3, @1); } | SEQUENCE NAME_P any_name { /* not documented, only used by pg_dump */ $$ = makeDefElem("sequence_name", (Node *)$3, @1); } | START opt_with NumericOnly { $$ = makeDefElem("start", (Node *)$3, @1); } | RESTART { $$ = makeDefElem("restart", NULL, @1); } | RESTART opt_with NumericOnly { $$ = makeDefElem("restart", (Node *)$3, @1); } ; opt_by: BY {} | /* empty */ {} ; NumericOnly: FCONST { $$ = makeFloat($1); } | '+' FCONST { $$ = makeFloat($2); } | '-' 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(makeString($4)); 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(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 RoleSpec { $$ = $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), @1); } | VERSION_P NonReservedWord_or_Sconst { $$ = makeDefElem("new_version", (Node *)makeString($2), @1); } | FROM NonReservedWord_or_Sconst { $$ = makeDefElem("old_version", (Node *)makeString($2), @1); } | CASCADE { $$ = makeDefElem("cascade", (Node *)makeInteger(true), @1); } ; /***************************************************************************** * * 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), @1); } ; /***************************************************************************** * * ALTER EXTENSION name ADD/DROP object-identifier * *****************************************************************************/ AlterExtensionContentsStmt: ALTER EXTENSION name add_drop ACCESS METHOD name { AlterExtensionContentsStmt *n = makeNode(AlterExtensionContentsStmt); n->extname = $3; n->action = $4; n->objtype = OBJECT_ACCESS_METHOD; n->object = (Node *) makeString($7); $$ = (Node *)n; } | ALTER EXTENSION name add_drop AGGREGATE aggregate_with_argtypes { AlterExtensionContentsStmt *n = makeNode(AlterExtensionContentsStmt); n->extname = $3; n->action = $4; n->objtype = OBJECT_AGGREGATE; n->object = (Node *) $6; $$ = (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->object = (Node *) list_make2($7, $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->object = (Node *) $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->object = (Node *) $6; $$ = (Node *)n; } | ALTER EXTENSION name add_drop DOMAIN_P Typename { AlterExtensionContentsStmt *n = makeNode(AlterExtensionContentsStmt); n->extname = $3; n->action = $4; n->objtype = OBJECT_DOMAIN; n->object = (Node *) $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->object = (Node *) $6; $$ = (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->object = (Node *) makeString($7); $$ = (Node *)n; } | ALTER EXTENSION name add_drop OPERATOR operator_with_argtypes { AlterExtensionContentsStmt *n = makeNode(AlterExtensionContentsStmt); n->extname = $3; n->action = $4; n->objtype = OBJECT_OPERATOR; n->object = (Node *) $6; $$ = (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->object = (Node *) lcons(makeString($9), $7); $$ = (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->object = (Node *) lcons(makeString($9), $7); $$ = (Node *)n; } | ALTER EXTENSION name add_drop PROCEDURE function_with_argtypes { AlterExtensionContentsStmt *n = makeNode(AlterExtensionContentsStmt); n->extname = $3; n->action = $4; n->objtype = OBJECT_PROCEDURE; n->object = (Node *) $6; $$ = (Node *)n; } | ALTER EXTENSION name add_drop ROUTINE function_with_argtypes { AlterExtensionContentsStmt *n = makeNode(AlterExtensionContentsStmt); n->extname = $3; n->action = $4; n->objtype = OBJECT_ROUTINE; n->object = (Node *) $6; $$ = (Node *)n; } | ALTER EXTENSION name add_drop SCHEMA name { AlterExtensionContentsStmt *n = makeNode(AlterExtensionContentsStmt); n->extname = $3; n->action = $4; n->objtype = OBJECT_SCHEMA; n->object = (Node *) 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->object = (Node *) 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->object = (Node *) $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->object = (Node *) $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->object = (Node *) $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->object = (Node *) $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->object = (Node *) $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->object = (Node *) $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->object = (Node *) $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->object = (Node *) $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->object = (Node *) $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->object = (Node *) 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->object = (Node *) makeString($6); $$ = (Node *)n; } | ALTER EXTENSION name add_drop TRANSFORM FOR Typename LANGUAGE name { AlterExtensionContentsStmt *n = makeNode(AlterExtensionContentsStmt); n->extname = $3; n->action = $4; n->objtype = OBJECT_TRANSFORM; n->object = (Node *) list_make2($7, makeString($9)); $$ = (Node *)n; } | ALTER EXTENSION name add_drop TYPE_P Typename { AlterExtensionContentsStmt *n = makeNode(AlterExtensionContentsStmt); n->extname = $3; n->action = $4; n->objtype = OBJECT_TYPE; n->object = (Node *) $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, @1); } | NO HANDLER { $$ = makeDefElem("handler", NULL, @1); } | VALIDATOR handler_name { $$ = makeDefElem("validator", (Node *)$2, @1); } | NO VALIDATOR { $$ = makeDefElem("validator", NULL, @1); } ; fdw_options: fdw_option { $$ = list_make1($1); } | fdw_options fdw_option { $$ = lappend($1, $2); } ; opt_fdw_options: fdw_options { $$ = $1; } | /*EMPTY*/ { $$ = NIL; } ; /***************************************************************************** * * 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, @2); } ; generic_option_elem: generic_option_name generic_option_arg { $$ = makeDefElem($1, $2, @1); } ; 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; n->if_not_exists = false; $$ = (Node *) n; } | CREATE SERVER IF_P NOT EXISTS name opt_type opt_foreign_server_version FOREIGN DATA_P WRAPPER name create_generic_options { CreateForeignServerStmt *n = makeNode(CreateForeignServerStmt); n->servername = $6; n->servertype = $7; n->version = $8; n->fdwname = $12; n->options = $13; n->if_not_exists = true; $$ = (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 : * 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 ')' OptInherit SERVER name create_generic_options { CreateForeignTableStmt *n = makeNode(CreateForeignTableStmt); $4->relpersistence = RELPERSISTENCE_PERMANENT; n->base.relation = $4; n->base.tableElts = $6; n->base.inhRelations = $8; n->base.ofTypename = NULL; n->base.constraints = NIL; n->base.options = NIL; n->base.oncommit = ONCOMMIT_NOOP; n->base.tablespacename = NULL; n->base.if_not_exists = false; /* FDW-specific data */ n->servername = $10; n->options = $11; $$ = (Node *) n; } | CREATE FOREIGN TABLE IF_P NOT EXISTS qualified_name '(' OptTableElementList ')' OptInherit SERVER name create_generic_options { CreateForeignTableStmt *n = makeNode(CreateForeignTableStmt); $7->relpersistence = RELPERSISTENCE_PERMANENT; n->base.relation = $7; n->base.tableElts = $9; n->base.inhRelations = $11; n->base.ofTypename = NULL; n->base.constraints = NIL; n->base.options = NIL; n->base.oncommit = ONCOMMIT_NOOP; n->base.tablespacename = NULL; n->base.if_not_exists = true; /* FDW-specific data */ n->servername = $13; n->options = $14; $$ = (Node *) n; } | CREATE FOREIGN TABLE qualified_name PARTITION OF qualified_name OptTypedTableElementList PartitionBoundSpec SERVER name create_generic_options { CreateForeignTableStmt *n = makeNode(CreateForeignTableStmt); $4->relpersistence = RELPERSISTENCE_PERMANENT; n->base.relation = $4; n->base.inhRelations = list_make1($7); n->base.tableElts = $8; n->base.partbound = $9; n->base.ofTypename = NULL; n->base.constraints = NIL; n->base.options = NIL; n->base.oncommit = ONCOMMIT_NOOP; n->base.tablespacename = NULL; n->base.if_not_exists = false; /* FDW-specific data */ n->servername = $11; n->options = $12; $$ = (Node *) n; } | CREATE FOREIGN TABLE IF_P NOT EXISTS qualified_name PARTITION OF qualified_name OptTypedTableElementList PartitionBoundSpec SERVER name create_generic_options { CreateForeignTableStmt *n = makeNode(CreateForeignTableStmt); $7->relpersistence = RELPERSISTENCE_PERMANENT; n->base.relation = $7; n->base.inhRelations = list_make1($10); n->base.tableElts = $11; n->base.partbound = $12; n->base.ofTypename = NULL; n->base.constraints = NIL; n->base.options = NIL; n->base.oncommit = ONCOMMIT_NOOP; n->base.tablespacename = NULL; n->base.if_not_exists = true; /* FDW-specific data */ n->servername = $14; n->options = $15; $$ = (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: * IMPORT FOREIGN SCHEMA remote_schema * [ { LIMIT TO | EXCEPT } ( table_list ) ] * FROM SERVER server_name INTO local_schema [ OPTIONS (...) ] * ****************************************************************************/ ImportForeignSchemaStmt: IMPORT_P FOREIGN SCHEMA name import_qualification FROM SERVER name INTO name create_generic_options { ImportForeignSchemaStmt *n = makeNode(ImportForeignSchemaStmt); n->server_name = $8; n->remote_schema = $4; n->local_schema = $10; n->list_type = $5->type; n->table_list = $5->table_names; n->options = $11; $$ = (Node *) n; } ; import_qualification_type: LIMIT TO { $$ = FDW_IMPORT_SCHEMA_LIMIT_TO; } | EXCEPT { $$ = FDW_IMPORT_SCHEMA_EXCEPT; } ; import_qualification: import_qualification_type '(' relation_expr_list ')' { ImportQual *n = (ImportQual *) palloc(sizeof(ImportQual)); n->type = $1; n->table_names = $3; $$ = n; } | /*EMPTY*/ { ImportQual *n = (ImportQual *) palloc(sizeof(ImportQual)); n->type = FDW_IMPORT_SCHEMA_ALL; n->table_names = NIL; $$ = 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->user = $5; n->servername = $7; n->options = $8; n->if_not_exists = false; $$ = (Node *) n; } | CREATE USER MAPPING IF_P NOT EXISTS FOR auth_ident SERVER name create_generic_options { CreateUserMappingStmt *n = makeNode(CreateUserMappingStmt); n->user = $8; n->servername = $10; n->options = $11; n->if_not_exists = true; $$ = (Node *) n; } ; /* User mapping authorization identifier */ auth_ident: RoleSpec { $$ = $1; } | USER { $$ = makeRoleSpec(ROLESPEC_CURRENT_USER, @1); } ; /***************************************************************************** * * QUERY : * DROP USER MAPPING FOR auth_ident SERVER name * * XXX you'd think this should have a CASCADE/RESTRICT option, even if it's * only pro forma; but the SQL standard doesn't show one. ****************************************************************************/ DropUserMappingStmt: DROP USER MAPPING FOR auth_ident SERVER name { DropUserMappingStmt *n = makeNode(DropUserMappingStmt); n->user = $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->user = $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->user = $5; n->servername = $7; n->options = $8; $$ = (Node *) n; } ; /***************************************************************************** * * QUERIES: * CREATE POLICY name ON table * [AS { PERMISSIVE | RESTRICTIVE } ] * [FOR { SELECT | INSERT | UPDATE | DELETE } ] * [TO role, ...] * [USING (qual)] [WITH CHECK (with check qual)] * ALTER POLICY name ON table [TO role, ...] * [USING (qual)] [WITH CHECK (with check qual)] * *****************************************************************************/ CreatePolicyStmt: CREATE POLICY name ON qualified_name RowSecurityDefaultPermissive RowSecurityDefaultForCmd RowSecurityDefaultToRole RowSecurityOptionalExpr RowSecurityOptionalWithCheck { CreatePolicyStmt *n = makeNode(CreatePolicyStmt); n->policy_name = $3; n->table = $5; n->permissive = $6; n->cmd_name = $7; n->roles = $8; n->qual = $9; n->with_check = $10; $$ = (Node *) n; } ; AlterPolicyStmt: ALTER POLICY name ON qualified_name RowSecurityOptionalToRole RowSecurityOptionalExpr RowSecurityOptionalWithCheck { AlterPolicyStmt *n = makeNode(AlterPolicyStmt); n->policy_name = $3; n->table = $5; n->roles = $6; n->qual = $7; n->with_check = $8; $$ = (Node *) n; } ; RowSecurityOptionalExpr: USING '(' a_expr ')' { $$ = $3; } | /* EMPTY */ { $$ = NULL; } ; RowSecurityOptionalWithCheck: WITH CHECK '(' a_expr ')' { $$ = $4; } | /* EMPTY */ { $$ = NULL; } ; RowSecurityDefaultToRole: TO role_list { $$ = $2; } | /* EMPTY */ { $$ = list_make1(makeRoleSpec(ROLESPEC_PUBLIC, -1)); } ; RowSecurityOptionalToRole: TO role_list { $$ = $2; } | /* EMPTY */ { $$ = NULL; } ; RowSecurityDefaultPermissive: AS IDENT { if (strcmp($2, "permissive") == 0) $$ = true; else if (strcmp($2, "restrictive") == 0) $$ = false; else ereport(ERROR, (errcode(ERRCODE_SYNTAX_ERROR), errmsg("unrecognized row security option \"%s\"", $2), errhint("Only PERMISSIVE or RESTRICTIVE policies are supported currently."), parser_errposition(@2))); } | /* EMPTY */ { $$ = true; } ; RowSecurityDefaultForCmd: FOR row_security_cmd { $$ = $2; } | /* EMPTY */ { $$ = "all"; } ; row_security_cmd: ALL { $$ = "all"; } | SELECT { $$ = "select"; } | INSERT { $$ = "insert"; } | UPDATE { $$ = "update"; } | DELETE_P { $$ = "delete"; } ; /***************************************************************************** * * QUERY: * CREATE ACCESS METHOD name HANDLER handler_name * *****************************************************************************/ CreateAmStmt: CREATE ACCESS METHOD name TYPE_P am_type HANDLER handler_name { CreateAmStmt *n = makeNode(CreateAmStmt); n->amname = $4; n->handler_name = $8; n->amtype = $6; $$ = (Node *) n; } ; am_type: INDEX { $$ = AMTYPE_INDEX; } | TABLE { $$ = AMTYPE_TABLE; } ; /***************************************************************************** * * QUERIES : * CREATE TRIGGER ... * *****************************************************************************/ CreateTrigStmt: CREATE TRIGGER name TriggerActionTime TriggerEvents ON qualified_name TriggerReferencing TriggerForSpec TriggerWhen EXECUTE FUNCTION_or_PROCEDURE func_name '(' TriggerFuncArgs ')' { CreateTrigStmt *n = makeNode(CreateTrigStmt); n->trigname = $3; n->relation = $7; n->funcname = $13; n->args = $15; n->row = $9; n->timing = $4; n->events = intVal(linitial($5)); n->columns = (List *) lsecond($5); n->whenClause = $10; n->transitionRels = $8; 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 FUNCTION_or_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->transitionRels = NIL; 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); } ; TriggerReferencing: REFERENCING TriggerTransitions { $$ = $2; } | /*EMPTY*/ { $$ = NIL; } ; TriggerTransitions: TriggerTransition { $$ = list_make1($1); } | TriggerTransitions TriggerTransition { $$ = lappend($1, $2); } ; TriggerTransition: TransitionOldOrNew TransitionRowOrTable opt_as TransitionRelName { TriggerTransition *n = makeNode(TriggerTransition); n->name = $4; n->isNew = $1; n->isTable = $2; $$ = (Node *)n; } ; TransitionOldOrNew: NEW { $$ = true; } | OLD { $$ = false; } ; TransitionRowOrTable: TABLE { $$ = true; } /* * According to the standard, lack of a keyword here implies ROW. * Support for that would require prohibiting ROW entirely here, * reserving the keyword ROW, and/or requiring AS (instead of * allowing it to be optional, as the standard specifies) as the * next token. Requiring ROW seems cleanest and easiest to * explain. */ | ROW { $$ = false; } ; TransitionRelName: ColId { $$ = $1; } ; 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; } ; FUNCTION_or_PROCEDURE: FUNCTION | PROCEDURE ; TriggerFuncArgs: TriggerFuncArg { $$ = list_make1($1); } | TriggerFuncArgs ',' TriggerFuncArg { $$ = lappend($1, $3); } | /*EMPTY*/ { $$ = NIL; } ; TriggerFuncArg: Iconst { $$ = makeString(psprintf("%d", $1)); } | 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; } ; /***************************************************************************** * * QUERIES : * CREATE EVENT TRIGGER ... * ALTER EVENT TRIGGER ... * *****************************************************************************/ CreateEventTrigStmt: CREATE EVENT TRIGGER name ON ColLabel EXECUTE FUNCTION_or_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 FUNCTION_or_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, @1); } ; 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; } ; /***************************************************************************** * * QUERY : * CREATE ASSERTION ... * *****************************************************************************/ CreateAssertionStmt: CREATE ASSERTION any_name CHECK '(' a_expr ')' ConstraintAttributeSpec { ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), errmsg("CREATE ASSERTION is not yet implemented"))); $$ = NULL; } ; /***************************************************************************** * * QUERY : * define (aggregate,operator,type) * *****************************************************************************/ DefineStmt: CREATE opt_or_replace AGGREGATE func_name aggr_args definition { DefineStmt *n = makeNode(DefineStmt); n->kind = OBJECT_AGGREGATE; n->oldstyle = false; n->replace = $2; n->defnames = $4; n->args = $5; n->definition = $6; $$ = (Node *)n; } | CREATE opt_or_replace 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->replace = $2; n->defnames = $4; n->args = NIL; n->definition = $5; $$ = (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 IF_P NOT EXISTS any_name definition { DefineStmt *n = makeNode(DefineStmt); n->kind = OBJECT_COLLATION; n->args = NIL; n->defnames = $6; n->definition = $7; n->if_not_exists = true; $$ = (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, @5)); $$ = (Node *)n; } | CREATE COLLATION IF_P NOT EXISTS any_name FROM any_name { DefineStmt *n = makeNode(DefineStmt); n->kind = OBJECT_COLLATION; n->args = NIL; n->defnames = $6; n->definition = list_make1(makeDefElem("from", (Node *) $8, @8)); n->if_not_exists = true; $$ = (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, @1); } | ColLabel { $$ = makeDefElem($1, NULL, @1); } ; /* 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); } | NONE { $$ = (Node *)makeString(pstrdup($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, @1); } ; 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->oldVal = NULL; n->newVal = $7; n->newValNeighbor = NULL; n->newValIsAfter = true; n->skipIfNewValExists = $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->oldVal = NULL; n->newVal = $7; n->newValNeighbor = $9; n->newValIsAfter = false; n->skipIfNewValExists = $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->oldVal = NULL; n->newVal = $7; n->newValNeighbor = $9; n->newValIsAfter = true; n->skipIfNewValExists = $6; $$ = (Node *) n; } | ALTER TYPE_P any_name RENAME VALUE_P Sconst TO Sconst { AlterEnumStmt *n = makeNode(AlterEnumStmt); n->typeName = $3; n->oldVal = $6; n->newVal = $8; n->newValNeighbor = NULL; n->newValIsAfter = false; n->skipIfNewValExists = false; $$ = (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); ObjectWithArgs *owa = makeNode(ObjectWithArgs); owa->objname = $3; owa->objargs = NIL; n->itemtype = OPCLASS_ITEM_OPERATOR; n->name = owa; n->number = $2; n->order_family = $4; $$ = (Node *) n; } | OPERATOR Iconst operator_with_argtypes opclass_purpose opt_recheck { CreateOpClassItem *n = makeNode(CreateOpClassItem); n->itemtype = OPCLASS_ITEM_OPERATOR; n->name = $3; n->number = $2; n->order_family = $4; $$ = (Node *) n; } | FUNCTION Iconst function_with_argtypes { CreateOpClassItem *n = makeNode(CreateOpClassItem); n->itemtype = OPCLASS_ITEM_FUNCTION; n->name = $3; n->number = $2; $$ = (Node *) n; } | FUNCTION Iconst '(' type_list ')' function_with_argtypes { CreateOpClassItem *n = makeNode(CreateOpClassItem); n->itemtype = OPCLASS_ITEM_FUNCTION; n->name = $6; 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->class_args = $4; $$ = (Node *) n; } | FUNCTION Iconst '(' type_list ')' { CreateOpClassItem *n = makeNode(CreateOpClassItem); n->itemtype = OPCLASS_ITEM_FUNCTION; n->number = $2; n->class_args = $4; $$ = (Node *) n; } ; DropOpClassStmt: DROP OPERATOR CLASS any_name USING access_method opt_drop_behavior { DropStmt *n = makeNode(DropStmt); n->objects = list_make1(lcons(makeString($6), $4)); 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(lcons(makeString($8), $6)); 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(lcons(makeString($6), $4)); 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(lcons(makeString($8), $6)); 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 RoleSpec { 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_any_name IF_P EXISTS any_name_list opt_drop_behavior { DropStmt *n = makeNode(DropStmt); n->removeType = $2; n->missing_ok = true; n->objects = $5; n->behavior = $6; n->concurrent = false; $$ = (Node *)n; } | DROP drop_type_any_name any_name_list opt_drop_behavior { DropStmt *n = makeNode(DropStmt); n->removeType = $2; n->missing_ok = false; n->objects = $3; n->behavior = $4; n->concurrent = false; $$ = (Node *)n; } | DROP drop_type_name IF_P EXISTS name_list opt_drop_behavior { DropStmt *n = makeNode(DropStmt); n->removeType = $2; n->missing_ok = true; n->objects = $5; n->behavior = $6; n->concurrent = false; $$ = (Node *)n; } | DROP drop_type_name name_list opt_drop_behavior { DropStmt *n = makeNode(DropStmt); n->removeType = $2; n->missing_ok = false; n->objects = $3; n->behavior = $4; n->concurrent = false; $$ = (Node *)n; } | DROP drop_type_name_on_any_name name ON any_name opt_drop_behavior { DropStmt *n = makeNode(DropStmt); n->removeType = $2; n->objects = list_make1(lappend($5, makeString($3))); n->behavior = $6; n->missing_ok = false; n->concurrent = false; $$ = (Node *) n; } | DROP drop_type_name_on_any_name IF_P EXISTS name ON any_name opt_drop_behavior { DropStmt *n = makeNode(DropStmt); n->removeType = $2; n->objects = list_make1(lappend($7, makeString($5))); n->behavior = $8; n->missing_ok = true; n->concurrent = false; $$ = (Node *) n; } | DROP TYPE_P type_name_list opt_drop_behavior { DropStmt *n = makeNode(DropStmt); n->removeType = OBJECT_TYPE; n->missing_ok = false; n->objects = $3; n->behavior = $4; n->concurrent = false; $$ = (Node *) n; } | DROP TYPE_P IF_P EXISTS type_name_list opt_drop_behavior { DropStmt *n = makeNode(DropStmt); n->removeType = OBJECT_TYPE; n->missing_ok = true; n->objects = $5; n->behavior = $6; n->concurrent = false; $$ = (Node *) n; } | DROP DOMAIN_P type_name_list opt_drop_behavior { DropStmt *n = makeNode(DropStmt); n->removeType = OBJECT_DOMAIN; n->missing_ok = false; n->objects = $3; n->behavior = $4; n->concurrent = false; $$ = (Node *) n; } | DROP DOMAIN_P IF_P EXISTS type_name_list opt_drop_behavior { DropStmt *n = makeNode(DropStmt); n->removeType = OBJECT_DOMAIN; n->missing_ok = true; n->objects = $5; n->behavior = $6; 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->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->behavior = $7; n->concurrent = true; $$ = (Node *)n; } ; /* object types taking any_name_list */ drop_type_any_name: TABLE { $$ = OBJECT_TABLE; } | SEQUENCE { $$ = OBJECT_SEQUENCE; } | VIEW { $$ = OBJECT_VIEW; } | MATERIALIZED VIEW { $$ = OBJECT_MATVIEW; } | INDEX { $$ = OBJECT_INDEX; } | FOREIGN TABLE { $$ = OBJECT_FOREIGN_TABLE; } | COLLATION { $$ = OBJECT_COLLATION; } | CONVERSION_P { $$ = OBJECT_CONVERSION; } | STATISTICS { $$ = OBJECT_STATISTIC_EXT; } | TEXT_P SEARCH PARSER { $$ = OBJECT_TSPARSER; } | TEXT_P SEARCH DICTIONARY { $$ = OBJECT_TSDICTIONARY; } | TEXT_P SEARCH TEMPLATE { $$ = OBJECT_TSTEMPLATE; } | TEXT_P SEARCH CONFIGURATION { $$ = OBJECT_TSCONFIGURATION; } ; /* object types taking name_list */ drop_type_name: ACCESS METHOD { $$ = OBJECT_ACCESS_METHOD; } | EVENT TRIGGER { $$ = OBJECT_EVENT_TRIGGER; } | EXTENSION { $$ = OBJECT_EXTENSION; } | FOREIGN DATA_P WRAPPER { $$ = OBJECT_FDW; } | PUBLICATION { $$ = OBJECT_PUBLICATION; } | SCHEMA { $$ = OBJECT_SCHEMA; } | SERVER { $$ = OBJECT_FOREIGN_SERVER; } ; /* object types attached to a table */ drop_type_name_on_any_name: POLICY { $$ = OBJECT_POLICY; } | RULE { $$ = OBJECT_RULE; } | TRIGGER { $$ = OBJECT_TRIGGER; } ; 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)); } ; type_name_list: Typename { $$ = list_make1($1); } | type_name_list ',' Typename { $$ = lappend($1, $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 [ [ ACCESS METHOD | CONVERSION | COLLATION | * DATABASE | DOMAIN | * EXTENSION | EVENT TRIGGER | FOREIGN DATA WRAPPER | * FOREIGN TABLE | INDEX | [PROCEDURAL] LANGUAGE | * MATERIALIZED VIEW | POLICY | 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 | * CONSTRAINT ON DOMAIN | * FUNCTION (arg1, arg2, ...) | * LARGE OBJECT | * OPERATOR (leftoperand_typ, rightoperand_typ) | * OPERATOR CLASS USING | * OPERATOR FAMILY USING | * RULE ON | * TRIGGER ON ] * IS { 'text' | NULL } * *****************************************************************************/ CommentStmt: COMMENT ON comment_type_any_name any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); n->objtype = $3; n->object = (Node *) $4; n->comment = $6; $$ = (Node *) n; } | COMMENT ON comment_type_name name IS comment_text { CommentStmt *n = makeNode(CommentStmt); n->objtype = $3; n->object = (Node *) makeString($4); n->comment = $6; $$ = (Node *) n; } | COMMENT ON TYPE_P Typename IS comment_text { CommentStmt *n = makeNode(CommentStmt); n->objtype = OBJECT_TYPE; n->object = (Node *) $4; n->comment = $6; $$ = (Node *) n; } | COMMENT ON DOMAIN_P Typename IS comment_text { CommentStmt *n = makeNode(CommentStmt); n->objtype = OBJECT_DOMAIN; n->object = (Node *) $4; n->comment = $6; $$ = (Node *) n; } | COMMENT ON AGGREGATE aggregate_with_argtypes IS comment_text { CommentStmt *n = makeNode(CommentStmt); n->objtype = OBJECT_AGGREGATE; n->object = (Node *) $4; n->comment = $6; $$ = (Node *) n; } | COMMENT ON FUNCTION function_with_argtypes IS comment_text { CommentStmt *n = makeNode(CommentStmt); n->objtype = OBJECT_FUNCTION; n->object = (Node *) $4; n->comment = $6; $$ = (Node *) n; } | COMMENT ON OPERATOR operator_with_argtypes IS comment_text { CommentStmt *n = makeNode(CommentStmt); n->objtype = OBJECT_OPERATOR; n->object = (Node *) $4; n->comment = $6; $$ = (Node *) n; } | COMMENT ON CONSTRAINT name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); n->objtype = OBJECT_TABCONSTRAINT; n->object = (Node *) lappend($6, makeString($4)); n->comment = $8; $$ = (Node *) n; } | COMMENT ON CONSTRAINT name ON DOMAIN_P any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); n->objtype = OBJECT_DOMCONSTRAINT; /* * should use Typename not any_name in the production, but * there's a shift/reduce conflict if we do that, so fix it * up here. */ n->object = (Node *) list_make2(makeTypeNameFromNameList($7), makeString($4)); n->comment = $9; $$ = (Node *) n; } | COMMENT ON POLICY name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); n->objtype = OBJECT_POLICY; n->object = (Node *) lappend($6, makeString($4)); n->comment = $8; $$ = (Node *) n; } | COMMENT ON PROCEDURE function_with_argtypes IS comment_text { CommentStmt *n = makeNode(CommentStmt); n->objtype = OBJECT_PROCEDURE; n->object = (Node *) $4; n->comment = $6; $$ = (Node *) n; } | COMMENT ON ROUTINE function_with_argtypes IS comment_text { CommentStmt *n = makeNode(CommentStmt); n->objtype = OBJECT_ROUTINE; n->object = (Node *) $4; n->comment = $6; $$ = (Node *) n; } | COMMENT ON RULE name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); n->objtype = OBJECT_RULE; n->object = (Node *) lappend($6, makeString($4)); n->comment = $8; $$ = (Node *) n; } | COMMENT ON TRANSFORM FOR Typename LANGUAGE name IS comment_text { CommentStmt *n = makeNode(CommentStmt); n->objtype = OBJECT_TRANSFORM; n->object = (Node *) list_make2($5, makeString($7)); n->comment = $9; $$ = (Node *) n; } | COMMENT ON TRIGGER name ON any_name IS comment_text { CommentStmt *n = makeNode(CommentStmt); n->objtype = OBJECT_TRIGGER; n->object = (Node *) lappend($6, makeString($4)); 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->object = (Node *) lcons(makeString($7), $5); 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->object = (Node *) lcons(makeString($7), $5); n->comment = $9; $$ = (Node *) n; } | COMMENT ON LARGE_P OBJECT_P NumericOnly IS comment_text { CommentStmt *n = makeNode(CommentStmt); n->objtype = OBJECT_LARGEOBJECT; n->object = (Node *) $5; n->comment = $7; $$ = (Node *) n; } | COMMENT ON CAST '(' Typename AS Typename ')' IS comment_text { CommentStmt *n = makeNode(CommentStmt); n->objtype = OBJECT_CAST; n->object = (Node *) list_make2($5, $7); n->comment = $10; $$ = (Node *) n; } ; /* object types taking any_name */ comment_type_any_name: COLUMN { $$ = OBJECT_COLUMN; } | INDEX { $$ = OBJECT_INDEX; } | SEQUENCE { $$ = OBJECT_SEQUENCE; } | STATISTICS { $$ = OBJECT_STATISTIC_EXT; } | TABLE { $$ = OBJECT_TABLE; } | VIEW { $$ = OBJECT_VIEW; } | MATERIALIZED VIEW { $$ = OBJECT_MATVIEW; } | COLLATION { $$ = OBJECT_COLLATION; } | CONVERSION_P { $$ = OBJECT_CONVERSION; } | FOREIGN TABLE { $$ = OBJECT_FOREIGN_TABLE; } | TEXT_P SEARCH CONFIGURATION { $$ = OBJECT_TSCONFIGURATION; } | TEXT_P SEARCH DICTIONARY { $$ = OBJECT_TSDICTIONARY; } | TEXT_P SEARCH PARSER { $$ = OBJECT_TSPARSER; } | TEXT_P SEARCH TEMPLATE { $$ = OBJECT_TSTEMPLATE; } ; /* object types taking name */ comment_type_name: ACCESS METHOD { $$ = OBJECT_ACCESS_METHOD; } | DATABASE { $$ = OBJECT_DATABASE; } | EVENT TRIGGER { $$ = OBJECT_EVENT_TRIGGER; } | EXTENSION { $$ = OBJECT_EXTENSION; } | FOREIGN DATA_P WRAPPER { $$ = OBJECT_FDW; } | opt_procedural LANGUAGE { $$ = OBJECT_LANGUAGE; } | PUBLICATION { $$ = OBJECT_PUBLICATION; } | ROLE { $$ = OBJECT_ROLE; } | SCHEMA { $$ = OBJECT_SCHEMA; } | SERVER { $$ = OBJECT_FOREIGN_SERVER; } | SUBSCRIPTION { $$ = OBJECT_SUBSCRIPTION; } | TABLESPACE { $$ = OBJECT_TABLESPACE; } ; comment_text: Sconst { $$ = $1; } | NULL_P { $$ = NULL; } ; /***************************************************************************** * * SECURITY LABEL [FOR ] ON IS